1.7.16 Small bugfixes
authorinsilmaril
Mon May 08 13:25:46 2006 +0000 (2006-05-08)
changeset 314549bb67a8ab2
parent 313 6ae1c6f1b7eb
child 315 866f79dfa6d7
1.7.16 Small bugfixes
mainwindow.cpp
mainwindow.h
mapeditor.cpp
     1.1 --- a/mainwindow.cpp	Mon May 08 13:25:46 2006 +0000
     1.2 +++ b/mainwindow.cpp	Mon May 08 13:25:46 2006 +0000
     1.3 @@ -357,6 +357,10 @@
     1.4  	connect( a, SIGNAL( activated() ), this, SLOT( fileImportKDEBookmarks() ) );
     1.5  	a->addTo (importMenu);
     1.6  
     1.7 +	a = new QAction( tr( "Import")+" "+tr("Firefox Bookmarks" ), QPixmap(), tr("Firefox Bookmarks"), 0, this, "importFirefoxBookmarks" );
     1.8 +	connect( a, SIGNAL( activated() ), this, SLOT( fileImportFirefoxBookmarks() ) );
     1.9 +	a->addTo (importMenu);
    1.10 +
    1.11  	a = new QAction( tr( "Import")+" Mind Manager" , QPixmap(), "Mind Manager...", 0, this, "importMM" );
    1.12  	connect( a, SIGNAL( activated() ), this, SLOT( fileImportMM() ) );
    1.13  	a->addTo (importMenu);
    1.14 @@ -437,7 +441,6 @@
    1.15  	a->setEnabled (false);
    1.16      a->addTo( tb );
    1.17      a->addTo( menu );
    1.18 -	actionListBranches.append(a);
    1.19  	actionEditMoveUp=a;
    1.20  
    1.21      a = new QAction( tr( "Move branch down" ), QPixmap( iconPath+"down.png"), tr( "Move down" ), Key_PageDown, this, "editMoveDown" );
    1.22 @@ -445,7 +448,6 @@
    1.23  	a->setEnabled (false);
    1.24      a->addTo( tb );
    1.25      a->addTo( menu );
    1.26 -	actionListBranches.append(a);
    1.27  	actionEditMoveDown=a;
    1.28  	
    1.29  
    1.30 @@ -673,7 +675,7 @@
    1.31  void Main::setupFormatActions()
    1.32  {
    1.33      QPopupMenu *menu = new QPopupMenu( this );
    1.34 -    menuBar()->insertItem( tr( "&Format" ), menu );
    1.35 +    menuBar()->insertItem( tr( "F&ormat" ), menu );
    1.36  
    1.37      QToolBar *tb = new QToolBar( this );
    1.38      QAction *a;
    1.39 @@ -790,7 +792,7 @@
    1.40      a->addTo( menu );
    1.41  
    1.42  
    1.43 -    a = new QAction( tr( "Toggle Note Editor" ), QPixmap(flagsPath+"flag-note.png"), tr( "Toggle Note Editor" ), CTRL + Key_E , this, "noteEditor" );
    1.44 +    a = new QAction( tr( "Show Note Editor" ), QPixmap(flagsPath+"flag-note.png"), tr( "Show Note Editor" ), CTRL + Key_E , this, "noteEditor" );
    1.45      connect( a, SIGNAL( activated() ), this, SLOT(windowToggleNoteEditor() ) );
    1.46  	a->setToggleAction(true);
    1.47  	if (textEditor->showWithMain())
    1.48 @@ -801,7 +803,7 @@
    1.49      a->addTo( menu );
    1.50  	actionViewToggleNoteEditor=a;
    1.51  
    1.52 -    a = new QAction( tr( "Toggle history window" ), QPixmap(), tr( "Toggle history window" ), CTRL + Key_H , this, "historyWindow" );
    1.53 +    a = new QAction( tr( "Show history window" ), QPixmap(), tr( "Show history window" ), CTRL + Key_H , this, "historyWindow" );
    1.54      connect( a, SIGNAL( activated() ), this, SLOT(windowToggleHistory() ) );
    1.55  	a->setToggleAction(false);
    1.56      a->addTo( menu );
    1.57 @@ -1231,8 +1233,7 @@
    1.58  
    1.59  	a = new QAction( tr( "Export as")+" "+tr("KDE Bookmarks" ), QPixmap(), tr("KDE Bookmarks"), 0, this, "importKDEBookmarks" );
    1.60  	connect( a, SIGNAL( activated() ), this, SLOT( fileExportKDEBookmarks() ) );
    1.61 -//FIXME later!
    1.62 -//	a->addTo (exportMenu);
    1.63 +	a->addTo (exportMenu);
    1.64  
    1.65      a = new QAction( tr( "Export as")+" Taskjuggler"+" "+tr("(still experimental)" ), QPixmap(), "Taskjuggler...", 0, this, "exportTJ" );
    1.66      connect( a, SIGNAL( activated() ), this, SLOT( fileExportTaskjuggler() ) );
    1.67 @@ -1833,6 +1834,14 @@
    1.68  		currentMapEditor()->setFilePath ("");
    1.69  }
    1.70  
    1.71 +void Main::fileImportFirefoxBookmarks()
    1.72 +{
    1.73 +	ImportFirefoxBookmarks im;
    1.74 +	im.transform();
    1.75 +	if (success==fileLoad (im.getTransformedFile(),NewMap) && currentMapEditor() )
    1.76 +		currentMapEditor()->setFilePath ("");
    1.77 +}
    1.78 +
    1.79  void Main::fileImportMM()
    1.80  {
    1.81  	ImportMM im;
     2.1 --- a/mainwindow.h	Mon May 08 13:25:46 2006 +0000
     2.2 +++ b/mainwindow.h	Mon May 08 13:25:46 2006 +0000
     2.3 @@ -66,6 +66,7 @@
     2.4      void fileSaveAs(const SaveMode &);
     2.5      void fileSaveAs();
     2.6      void fileImportKDEBookmarks();
     2.7 +    void fileImportFirefoxBookmarks();
     2.8      void fileImportMM();
     2.9      void fileImportDir();
    2.10      void fileExportXML();
     3.1 --- a/mapeditor.cpp	Mon May 08 13:25:46 2006 +0000
     3.2 +++ b/mapeditor.cpp	Mon May 08 13:25:46 2006 +0000
     3.3 @@ -36,6 +36,7 @@
     3.4  #include "misc.h"
     3.5  #include "settings.h"
     3.6  #include "texteditor.h"
     3.7 +#include "warningdialog.h"
     3.8  #include "xml.h"
     3.9  
    3.10  
    3.11 @@ -334,13 +335,19 @@
    3.12  
    3.13  QString MapEditor::getName (LinkableMapObj *lmo)
    3.14  {
    3.15 -	if (!lmo) return QString("NULL has no name!");
    3.16 +	QString s;
    3.17 +	if (!lmo) return QString("Error: NULL has no name!");
    3.18  
    3.19  	if ((typeid(*lmo) == typeid(BranchObj) ||
    3.20  				      typeid(*lmo) == typeid(MapCenterObj))) 
    3.21 -		return QString("branch (%1)").arg(((BranchObj*)lmo)->getHeading());
    3.22 +	{
    3.23 +		
    3.24 +		s=(((BranchObj*)lmo)->getHeading());
    3.25 +		if (s=="") s="unnamed";
    3.26 +		return QString("branch (<font color=\"#0000ff\">%1</font>)").arg(s);
    3.27 +	}	
    3.28  	if ((typeid(*lmo) == typeid(FloatImageObj) ))
    3.29 -		return QString ("floatimage [%1]").arg(((FloatImageObj*)lmo)->getOriginalFilename());
    3.30 +		return QString ("floatimage [<font color=\"#0000ff\">%1</font>]").arg(((FloatImageObj*)lmo)->getOriginalFilename());
    3.31  	return QString("Unknown type has no name!");
    3.32  }
    3.33  
    3.34 @@ -1426,6 +1433,7 @@
    3.35  	if (typeid(*selection) == typeid(BranchObj)  ) 
    3.36  	{
    3.37  		bo=(BranchObj*)selection;
    3.38 +		if (!bo->canMoveBranchUp()) return;
    3.39  		par=(BranchObj*)(bo->getParObj());
    3.40  		selection->unselect();
    3.41  		selection=par->moveBranchUp (bo);
    3.42 @@ -1446,6 +1454,7 @@
    3.43  	if (typeid(*selection) == typeid(BranchObj)  ) 
    3.44  	{
    3.45  		bo=(BranchObj*)selection;
    3.46 +		if (!bo->canMoveBranchDown()) return;
    3.47  		par=(BranchObj*)(bo->getParObj());
    3.48  		selection->unselect(); 
    3.49  		selection=par->moveBranchDown(bo);
    3.50 @@ -2183,7 +2192,7 @@
    3.51  		else
    3.52  			s="Set";
    3.53  		saveState(selection, QString("%1 standard flag \"%2\" of %3").arg(s).arg(f).arg(getName(bo)));// TODO undoCommand	
    3.54 -		bo->toggleStandardFlag (f,actionSettingsUseFlagGroups);
    3.55 +		bo->toggleStandardFlag (f,actionSettingsUseFlagGroups->isOn());
    3.56  		adjustCanvasSize();
    3.57  	}	
    3.58  }
    3.59 @@ -2575,6 +2584,17 @@
    3.60  				actionEditOpenVymLink->setEnabled (true);
    3.61  				actionEditDeleteVymLink->setEnabled (true);
    3.62  			}	
    3.63 +
    3.64 +			if (bo->canMoveBranchUp()) 
    3.65 +				actionEditMoveUp->setEnabled (true);
    3.66 +			else	
    3.67 +				actionEditMoveUp->setEnabled (false);
    3.68 +			if (bo->canMoveBranchDown()) 
    3.69 +				actionEditMoveDown->setEnabled (true);
    3.70 +			else	
    3.71 +				actionEditMoveDown->setEnabled (false);
    3.72 +
    3.73 +
    3.74  			actionEditToggleHideExport->setEnabled (true);	
    3.75  			actionEditToggleHideExport->setOn (bo->hideInExport() );	
    3.76  
    3.77 @@ -2625,6 +2645,8 @@
    3.78  			actionEditDelete->setEnabled (true);
    3.79  			actionFormatHideLinkUnselected->setOn
    3.80  				( selection->getHideLinkUnselected());
    3.81 +			actionEditMoveUp->setEnabled (false);
    3.82 +			actionEditMoveDown->setEnabled (false);
    3.83  		}
    3.84  
    3.85  	} else
    3.86 @@ -2637,12 +2659,15 @@
    3.87  		for (a=actionListBranches.first();a;a=actionListBranches.next())
    3.88  			a->setEnabled(false);
    3.89  
    3.90 -		actionEditToggleScroll->setEnabled (true);
    3.91 +		actionEditToggleScroll->setEnabled (false);
    3.92  		actionEditOpenURL->setEnabled (false);
    3.93  		actionEditOpenVymLink->setEnabled (false);
    3.94  		actionEditDeleteVymLink->setEnabled (false);	
    3.95  		actionEditHeading2URL->setEnabled (false);	
    3.96  		actionEditDelete->setEnabled (false);
    3.97 +		actionEditMoveUp->setEnabled (false);
    3.98 +		actionEditMoveDown->setEnabled (false);
    3.99 +		actionEditToggleHideExport->setEnabled (false);	
   3.100  	}	
   3.101  }
   3.102  
   3.103 @@ -3047,6 +3072,16 @@
   3.104  void MapEditor::testFunction()
   3.105  {
   3.106  	cout << "MapEditor::testFunction() called\n";
   3.107 +
   3.108 +	WarningDialog dia;
   3.109 +	dia.setCancelButton (true);
   3.110 +	dia.setText("This is a longer \nWarning");
   3.111 +	dia.setCaption("Warning: Flux problem");
   3.112 +	dia.setShowAgainName("/vym/warnings/mapeditor");
   3.113 +	if (dia.exec()==QDialog::Accepted)
   3.114 +		cout << "accepted!\n";
   3.115 +	else	
   3.116 +		cout << "canceled!\n";
   3.117  	return;
   3.118  
   3.119  	QString ub=vymBaseDir.path()+"/scripts/update-bookmarks";