diff -r 4a84d7e444d8 -r c2ce9944148c vymmodel.cpp --- a/vymmodel.cpp Thu Jan 21 11:56:57 2010 +0000 +++ b/vymmodel.cpp Wed Feb 10 13:48:42 2010 +0000 @@ -143,9 +143,6 @@ // Network netstate=Offline; - // Create MapCenter - // addMapCenter(); FIXME-2 VM create this in MapEditor until BO and MCO are independent of scene - //Initialize DBUS object adaptorModel=new AdaptorModel(this); // Created and not deleted as documented in Qt if (!dbusConnection.registerObject (QString("/vymmodel_%1").arg(mapNum),this)) @@ -1438,14 +1435,14 @@ return ti; } -TreeItem* VymModel::findID (const QString &s) //FIXME-4 Search also other types... +TreeItem* VymModel::findID (const uint &i) //FIXME-3 Search also other types... { BranchItem *cur=NULL; BranchItem *prev=NULL; nextBranch(cur,prev); while (cur) { - if (s==cur->getID() ) return cur; + if (i==cur->getID() ) return cur; nextBranch(cur,prev); } return NULL; @@ -1553,7 +1550,6 @@ void VymModel::setNote(const QString &s) { - cout << "VM::setNote\n"; TreeItem *selti=getSelectedItem(); if (selti) { @@ -1881,7 +1877,7 @@ } } -void VymModel::setHideLinkUnselected (bool b)//FIXME-2 +void VymModel::setHideLinkUnselected (bool b) // FIXME-2 Images still have visible link after load { TreeItem *ti=getSelectedItem(); if (ti && (ti->getType()==TreeItem::Image ||ti->isBranchLikeType())) @@ -2023,7 +2019,7 @@ } } -bool VymModel::moveUp(BranchItem *bi) //FIXME-2 crashes if trying to move MCO +bool VymModel::moveUp(BranchItem *bi) { if (bi && bi->canMoveUp()) return relinkBranch (bi,(BranchItem*)bi->parent(),bi->num()-1); @@ -2094,17 +2090,20 @@ } } -void VymModel::sortChildren() +void VymModel::sortChildren(bool inverse) { BranchItem* selbi=getSelectedBranch(); if (selbi) { if(selbi->branchCount()>1) { + if (!inverse) + { saveStateChangingPart( selbi,selbi, "sortChildren ()", QString("Sort children of %1").arg(getObjectName(selbi))); - selbi->sortChildren(); + } + selbi->sortChildren(inverse); reposition(); emitShowSelection(); } @@ -2221,6 +2220,7 @@ emit (layoutChanged() ); + ai->createMapObj(mapScene); //FIXME-2 check that... reposition(); return ai; } @@ -2399,6 +2399,10 @@ { unselect(); + // Do we need to update frame type? + bool keepFrame=false; + + emit (layoutAboutToBeChanged() ); BranchItem *branchpi=(BranchItem*)branch->parent(); // Remove at current position @@ -2432,7 +2436,7 @@ branch->setType(TreeItem::Branch); // reset parObj, fonts, frame, etc in related LMO or other view-objects - branch->updateStyles(); + branch->updateStyles(keepFrame); emit (layoutChanged() ); reposition(); // both for moveUp/Down and relinking @@ -2937,19 +2941,9 @@ QString bugID=rx.cap(1); cout << "VM::getBugzillaData bug="<getScene()->update(); // FIXME-2 check this... - QImage img (mapEditor->getImage()); //FIXME-2 calls getTotalBBox, but also in ExportHTML::doExport() + mapEditor->getScene()->update(); // FIXME-3 check this... + QImage img (mapEditor->getImage()); //FIXME-3 calls getTotalBBox, but also in ExportHTML::doExport() img.save(fname, format); setExportMode (false); } @@ -4317,24 +4313,23 @@ } } -void VymModel::exportHTML (const QString &dir, bool askForName) -{ - ExportXHTMLDialog dia(NULL); +void VymModel::exportHTML (const QString &dir, bool askForName) //FIXME-2 own dialogue missing and also option to save settings in map +{ + ExportXHTMLDialog dia(NULL); dia.setFilePath (filePath ); dia.setMapName (mapName ); dia.readSettings(); if (dir!="") dia.setDir (dir); - + QDir d; bool ok=true; - /* if (askForName) { if (dia.exec()!=QDialog::Accepted) ok=false; else { - QDir d (dia.getDir()); + d=dia.getDir(); // Check, if warnings should be used before overwriting // the output directory if (d.exists() && d.count()>0) @@ -4345,21 +4340,20 @@ "The directory %1 is not empty.\n" "Do you risk to overwrite some of its contents?").arg(d.path() )); warn.setCaption("Warning: Directory not empty"); - warn.setShowAgainName("mainwindow/overwrite-dir-xhtml"); + warn.setShowAgainName("mainwindow/export-XML-overwrite-dir"); if (warn.exec()!=QDialog::Accepted) ok=false; } } } -*/ - ok=true; if (ok) { // Hide stuff during export, if settings want this setExportMode (true); ExportHTML ex (this); - ex.setFile ("x/xxx.html"); + ex.setFile (d.path()+"/"+mapName+".html"); + cout << "VM::exportHTML writing "<setMode (Q3FileDialog::ExistingFile);