# HG changeset patch # User insilmaril # Date 1147094746 0 # Node ID 549bb67a8ab2b346539cf1794d845434a3932566 # Parent 6ae1c6f1b7ebf0228a8c5fb5d4cfeef50cf96127 1.7.16 Small bugfixes diff -r 6ae1c6f1b7eb -r 549bb67a8ab2 mainwindow.cpp --- a/mainwindow.cpp Mon May 08 13:25:46 2006 +0000 +++ b/mainwindow.cpp Mon May 08 13:25:46 2006 +0000 @@ -357,6 +357,10 @@ connect( a, SIGNAL( activated() ), this, SLOT( fileImportKDEBookmarks() ) ); a->addTo (importMenu); + a = new QAction( tr( "Import")+" "+tr("Firefox Bookmarks" ), QPixmap(), tr("Firefox Bookmarks"), 0, this, "importFirefoxBookmarks" ); + connect( a, SIGNAL( activated() ), this, SLOT( fileImportFirefoxBookmarks() ) ); + a->addTo (importMenu); + a = new QAction( tr( "Import")+" Mind Manager" , QPixmap(), "Mind Manager...", 0, this, "importMM" ); connect( a, SIGNAL( activated() ), this, SLOT( fileImportMM() ) ); a->addTo (importMenu); @@ -437,7 +441,6 @@ a->setEnabled (false); a->addTo( tb ); a->addTo( menu ); - actionListBranches.append(a); actionEditMoveUp=a; a = new QAction( tr( "Move branch down" ), QPixmap( iconPath+"down.png"), tr( "Move down" ), Key_PageDown, this, "editMoveDown" ); @@ -445,7 +448,6 @@ a->setEnabled (false); a->addTo( tb ); a->addTo( menu ); - actionListBranches.append(a); actionEditMoveDown=a; @@ -673,7 +675,7 @@ void Main::setupFormatActions() { QPopupMenu *menu = new QPopupMenu( this ); - menuBar()->insertItem( tr( "&Format" ), menu ); + menuBar()->insertItem( tr( "F&ormat" ), menu ); QToolBar *tb = new QToolBar( this ); QAction *a; @@ -790,7 +792,7 @@ a->addTo( menu ); - a = new QAction( tr( "Toggle Note Editor" ), QPixmap(flagsPath+"flag-note.png"), tr( "Toggle Note Editor" ), CTRL + Key_E , this, "noteEditor" ); + a = new QAction( tr( "Show Note Editor" ), QPixmap(flagsPath+"flag-note.png"), tr( "Show Note Editor" ), CTRL + Key_E , this, "noteEditor" ); connect( a, SIGNAL( activated() ), this, SLOT(windowToggleNoteEditor() ) ); a->setToggleAction(true); if (textEditor->showWithMain()) @@ -801,7 +803,7 @@ a->addTo( menu ); actionViewToggleNoteEditor=a; - a = new QAction( tr( "Toggle history window" ), QPixmap(), tr( "Toggle history window" ), CTRL + Key_H , this, "historyWindow" ); + a = new QAction( tr( "Show history window" ), QPixmap(), tr( "Show history window" ), CTRL + Key_H , this, "historyWindow" ); connect( a, SIGNAL( activated() ), this, SLOT(windowToggleHistory() ) ); a->setToggleAction(false); a->addTo( menu ); @@ -1231,8 +1233,7 @@ a = new QAction( tr( "Export as")+" "+tr("KDE Bookmarks" ), QPixmap(), tr("KDE Bookmarks"), 0, this, "importKDEBookmarks" ); connect( a, SIGNAL( activated() ), this, SLOT( fileExportKDEBookmarks() ) ); -//FIXME later! -// a->addTo (exportMenu); + a->addTo (exportMenu); a = new QAction( tr( "Export as")+" Taskjuggler"+" "+tr("(still experimental)" ), QPixmap(), "Taskjuggler...", 0, this, "exportTJ" ); connect( a, SIGNAL( activated() ), this, SLOT( fileExportTaskjuggler() ) ); @@ -1833,6 +1834,14 @@ currentMapEditor()->setFilePath (""); } +void Main::fileImportFirefoxBookmarks() +{ + ImportFirefoxBookmarks im; + im.transform(); + if (success==fileLoad (im.getTransformedFile(),NewMap) && currentMapEditor() ) + currentMapEditor()->setFilePath (""); +} + void Main::fileImportMM() { ImportMM im; diff -r 6ae1c6f1b7eb -r 549bb67a8ab2 mainwindow.h --- a/mainwindow.h Mon May 08 13:25:46 2006 +0000 +++ b/mainwindow.h Mon May 08 13:25:46 2006 +0000 @@ -66,6 +66,7 @@ void fileSaveAs(const SaveMode &); void fileSaveAs(); void fileImportKDEBookmarks(); + void fileImportFirefoxBookmarks(); void fileImportMM(); void fileImportDir(); void fileExportXML(); diff -r 6ae1c6f1b7eb -r 549bb67a8ab2 mapeditor.cpp --- a/mapeditor.cpp Mon May 08 13:25:46 2006 +0000 +++ b/mapeditor.cpp Mon May 08 13:25:46 2006 +0000 @@ -36,6 +36,7 @@ #include "misc.h" #include "settings.h" #include "texteditor.h" +#include "warningdialog.h" #include "xml.h" @@ -334,13 +335,19 @@ QString MapEditor::getName (LinkableMapObj *lmo) { - if (!lmo) return QString("NULL has no name!"); + QString s; + if (!lmo) return QString("Error: NULL has no name!"); if ((typeid(*lmo) == typeid(BranchObj) || typeid(*lmo) == typeid(MapCenterObj))) - return QString("branch (%1)").arg(((BranchObj*)lmo)->getHeading()); + { + + s=(((BranchObj*)lmo)->getHeading()); + if (s=="") s="unnamed"; + return QString("branch (%1)").arg(s); + } if ((typeid(*lmo) == typeid(FloatImageObj) )) - return QString ("floatimage [%1]").arg(((FloatImageObj*)lmo)->getOriginalFilename()); + return QString ("floatimage [%1]").arg(((FloatImageObj*)lmo)->getOriginalFilename()); return QString("Unknown type has no name!"); } @@ -1426,6 +1433,7 @@ if (typeid(*selection) == typeid(BranchObj) ) { bo=(BranchObj*)selection; + if (!bo->canMoveBranchUp()) return; par=(BranchObj*)(bo->getParObj()); selection->unselect(); selection=par->moveBranchUp (bo); @@ -1446,6 +1454,7 @@ if (typeid(*selection) == typeid(BranchObj) ) { bo=(BranchObj*)selection; + if (!bo->canMoveBranchDown()) return; par=(BranchObj*)(bo->getParObj()); selection->unselect(); selection=par->moveBranchDown(bo); @@ -2183,7 +2192,7 @@ else s="Set"; saveState(selection, QString("%1 standard flag \"%2\" of %3").arg(s).arg(f).arg(getName(bo)));// TODO undoCommand - bo->toggleStandardFlag (f,actionSettingsUseFlagGroups); + bo->toggleStandardFlag (f,actionSettingsUseFlagGroups->isOn()); adjustCanvasSize(); } } @@ -2575,6 +2584,17 @@ actionEditOpenVymLink->setEnabled (true); actionEditDeleteVymLink->setEnabled (true); } + + if (bo->canMoveBranchUp()) + actionEditMoveUp->setEnabled (true); + else + actionEditMoveUp->setEnabled (false); + if (bo->canMoveBranchDown()) + actionEditMoveDown->setEnabled (true); + else + actionEditMoveDown->setEnabled (false); + + actionEditToggleHideExport->setEnabled (true); actionEditToggleHideExport->setOn (bo->hideInExport() ); @@ -2625,6 +2645,8 @@ actionEditDelete->setEnabled (true); actionFormatHideLinkUnselected->setOn ( selection->getHideLinkUnselected()); + actionEditMoveUp->setEnabled (false); + actionEditMoveDown->setEnabled (false); } } else @@ -2637,12 +2659,15 @@ for (a=actionListBranches.first();a;a=actionListBranches.next()) a->setEnabled(false); - actionEditToggleScroll->setEnabled (true); + actionEditToggleScroll->setEnabled (false); actionEditOpenURL->setEnabled (false); actionEditOpenVymLink->setEnabled (false); actionEditDeleteVymLink->setEnabled (false); actionEditHeading2URL->setEnabled (false); actionEditDelete->setEnabled (false); + actionEditMoveUp->setEnabled (false); + actionEditMoveDown->setEnabled (false); + actionEditToggleHideExport->setEnabled (false); } } @@ -3047,6 +3072,16 @@ void MapEditor::testFunction() { cout << "MapEditor::testFunction() called\n"; + + WarningDialog dia; + dia.setCancelButton (true); + dia.setText("This is a longer \nWarning"); + dia.setCaption("Warning: Flux problem"); + dia.setShowAgainName("/vym/warnings/mapeditor"); + if (dia.exec()==QDialog::Accepted) + cout << "accepted!\n"; + else + cout << "canceled!\n"; return; QString ub=vymBaseDir.path()+"/scripts/update-bookmarks";