mainwindow.cpp
changeset 442 dfbc371b7280
parent 437 918417b015e0
child 445 0796c5592f00
     1.1 --- a/mainwindow.cpp	Sat Mar 31 09:28:27 2007 +0000
     1.2 +++ b/mainwindow.cpp	Sat Mar 31 09:28:27 2007 +0000
     1.3 @@ -19,6 +19,7 @@
     1.4  #include "process.h"
     1.5  #include "settings.h"
     1.6  #include "texteditor.h"
     1.7 +#include "warningdialog.h"
     1.8  
     1.9  extern TextEditor *textEditor;
    1.10  extern Main *mainWindow;
    1.11 @@ -160,6 +161,8 @@
    1.12  
    1.13  	restoreState (settings.value("/mainwindow/state",0).toByteArray());
    1.14  
    1.15 +	// Satellite windows //////////////////////////////////////////
    1.16 +
    1.17  	// Initialize Find window
    1.18  	findWindow=new FindWindow(NULL);
    1.19  	findWindow->move (x(),y()+70);
    1.20 @@ -170,7 +173,10 @@
    1.21  
    1.22  	// Connect TextEditor, so that we can update flags if text changes
    1.23  	connect (textEditor, SIGNAL (textHasChanged() ), this, SLOT (updateNoteFlag()));
    1.24 -	connect (textEditor, SIGNAL (textEditorClosed() ), this, SLOT (updateActions()));
    1.25 +	connect (textEditor, SIGNAL (windowClosed() ), this, SLOT (updateActions()));
    1.26 +
    1.27 +	// Connect HistoryWindow, so that we can update flags
    1.28 +	connect (historyWindow, SIGNAL (windowClosed() ), this, SLOT (updateActions()));
    1.29  
    1.30  	updateGeometry();
    1.31  }
    1.32 @@ -198,7 +204,7 @@
    1.33  	//FIXME save scriptEditor settings
    1.34  
    1.35  	// call the destructors
    1.36 -	delete (textEditor);
    1.37 +	delete textEditor;
    1.38  	delete historyWindow;
    1.39  
    1.40  	// Remove temporary directory
    1.41 @@ -244,25 +250,24 @@
    1.42      QAction *a;
    1.43      a = new QAction(QPixmap( iconPath+"filenew.png"), tr( "&New...","File menu" ),this);
    1.44  	a->setStatusTip ( tr( "New map","Status tip File menu" ) );
    1.45 -	a->setShortcut ( Qt::CTRL + Qt::Key_N );
    1.46 +	a->setShortcut ( Qt::CTRL + Qt::Key_N );		//New map
    1.47      a->addTo( tb );
    1.48  	fileMenu->addAction (a);
    1.49      connect( a, SIGNAL( triggered() ), this, SLOT( fileNew() ) );
    1.50  	
    1.51      a = new QAction( QPixmap( iconPath+"fileopen.png"), tr( "&Open..." ,"File menu"),this);
    1.52  	a->setStatusTip (tr( "Open","Status tip File menu" ) );
    1.53 -	a->setShortcut ( Qt::CTRL + Qt::Key_O );
    1.54 +	a->setShortcut ( Qt::CTRL + Qt::Key_O );		//Open map
    1.55      a->addTo( tb );
    1.56  	fileMenu->addAction (a);
    1.57      connect( a, SIGNAL( triggered() ), this, SLOT( fileLoad() ) );
    1.58  	
    1.59  	fileLastMapsMenu = fileMenu->addMenu (tr("Open Recent","File menu"));
    1.60 -	fileLastMapsMenu->menuAction()->setShortcut ( Qt::CTRL + +Qt::SHIFT + Qt::Key_O );
    1.61  	fileMenu->addSeparator();
    1.62  	
    1.63      a = new QAction( QPixmap( iconPath+"filesave.png"), tr( "&Save...","File menu" ), this);
    1.64  	a->setStatusTip ( tr( "Save","Status tip file menu" ));
    1.65 -	a->setShortcut (Qt::CTRL + Qt::Key_S );
    1.66 +	a->setShortcut (Qt::CTRL + Qt::Key_S );			//Save map
    1.67      a->addTo( tb );
    1.68  	fileMenu->addAction (a);
    1.69      connect( a, SIGNAL( triggered() ), this, SLOT( fileSave() ) );
    1.70 @@ -313,7 +318,7 @@
    1.71  	fileExportMenu->addAction (a);
    1.72  
    1.73  	a = new QAction(  "Webpage (XHTML)...",this );
    1.74 -	a->setShortcut (Qt::ALT + Qt::Key_X);
    1.75 +	a->setShortcut (Qt::ALT + Qt::Key_X);			//Export XHTML
    1.76  	a->setStatusTip ( tr( "Export as %1","status tip file menu").arg(tr(" webpage (XHTML)","status tip file menu")));
    1.77      connect( a, SIGNAL( triggered() ), this, SLOT( fileExportXHTML() ) );
    1.78  	fileExportMenu->addAction (a);
    1.79 @@ -347,7 +352,7 @@
    1.80  
    1.81      a = new QAction(QPixmap( iconPath+"fileprint.png"), tr( "&Print")+QString("..."), this);
    1.82  	a->setStatusTip ( tr( "Print" ,"File menu") );
    1.83 -	a->setShortcut (Qt::CTRL + Qt::Key_P );
    1.84 +	a->setShortcut (Qt::CTRL + Qt::Key_P );			//Print map
    1.85      a->addTo( tb );
    1.86  	fileMenu->addAction (a);
    1.87      connect( a, SIGNAL( triggered() ), this, SLOT( filePrint() ) );
    1.88 @@ -355,13 +360,13 @@
    1.89  
    1.90      a = new QAction( QPixmap(iconPath+"fileclose.png"), tr( "&Close Map","File menu" ), this);
    1.91  	a->setStatusTip (tr( "Close Map" ) );
    1.92 -	a->setShortcut (Qt::ALT + Qt::Key_C );
    1.93 +	a->setShortcut (Qt::ALT + Qt::Key_C );			//Close map
    1.94  	fileMenu->addAction (a);
    1.95      connect( a, SIGNAL( triggered() ), this, SLOT( fileCloseMap() ) );
    1.96  
    1.97      a = new QAction(QPixmap(iconPath+"exit.png"), tr( "E&xit","File menu")+" "+vymName, this);
    1.98  	a->setStatusTip ( tr( "Exit")+" "+vymName );
    1.99 -	a->setShortcut (Qt::CTRL + Qt::Key_Q );
   1.100 +	a->setShortcut (Qt::CTRL + Qt::Key_Q );			//Quit vym
   1.101  	fileMenu->addAction (a);
   1.102      connect( a, SIGNAL( triggered() ), this, SLOT( fileExitVYM() ) );
   1.103  }
   1.104 @@ -380,7 +385,7 @@
   1.105      a = new QAction( QPixmap( iconPath+"undo.png"), tr( "&Undo","Edit menu" ),this);
   1.106      connect( a, SIGNAL( triggered() ), this, SLOT( editUndo() ) );
   1.107  	a->setStatusTip (tr( "Undo" ) );
   1.108 -	a->setShortcut ( Qt::CTRL + Qt::Key_Z );
   1.109 +	a->setShortcut ( Qt::CTRL + Qt::Key_Z );		//Undo last action
   1.110  	a->setEnabled (false);
   1.111      tb->addAction (a);
   1.112  	editMenu->addAction (a);
   1.113 @@ -388,7 +393,7 @@
   1.114      
   1.115  	a = new QAction( QPixmap( iconPath+"redo.png"), tr( "&Redo","Edit menu" ), this); 
   1.116  	a->setStatusTip (tr( "Redo" ));
   1.117 -	a->setShortcut (Qt::CTRL + Qt::Key_Y );
   1.118 +	a->setShortcut (Qt::CTRL + Qt::Key_Y );			//Redo last action
   1.119      tb->addAction (a);
   1.120  	editMenu->addAction (a);
   1.121  	connect( a, SIGNAL( triggered() ), this, SLOT( editRedo() ) );
   1.122 @@ -397,7 +402,7 @@
   1.123  	editMenu->addSeparator();
   1.124      a = new QAction(QPixmap( iconPath+"editcopy.png"), tr( "&Copy","Edit menu" ), this);
   1.125  	a->setStatusTip ( tr( "Copy" ) );
   1.126 -	a->setShortcut (Qt::CTRL + Qt::Key_C );
   1.127 +	a->setShortcut (Qt::CTRL + Qt::Key_C );			//Copy
   1.128  	a->setEnabled (false);
   1.129      tb->addAction (a);
   1.130  	editMenu->addAction (a);
   1.131 @@ -406,7 +411,7 @@
   1.132  	
   1.133      a = new QAction(QPixmap( iconPath+"editcut.png" ), tr( "Cu&t","Edit menu" ), this);
   1.134  	a->setStatusTip ( tr( "Cut" ) );
   1.135 -	a->setShortcut (Qt::CTRL + Qt::Key_X );
   1.136 +	a->setShortcut (Qt::CTRL + Qt::Key_X );			//Cut
   1.137  	a->setEnabled (false);
   1.138      tb->addAction (a);
   1.139  	editMenu->addAction (a);
   1.140 @@ -416,7 +421,7 @@
   1.141      a = new QAction(QPixmap( iconPath+"editpaste.png"), tr( "&Paste","Edit menu" ),this);
   1.142      connect( a, SIGNAL( triggered() ), this, SLOT( editPaste() ) );
   1.143  	a->setStatusTip ( tr( "Paste" ) );
   1.144 -	a->setShortcut ( Qt::CTRL + Qt::Key_V );
   1.145 +	a->setShortcut ( Qt::CTRL + Qt::Key_V );		//Paste
   1.146  	a->setEnabled (false);
   1.147      tb->addAction (a);
   1.148  	editMenu->addAction (a);
   1.149 @@ -425,14 +430,14 @@
   1.150      // Shortcuts to modify heading:
   1.151      a = new QAction(tr( "Edit heading","Edit menu" ),this);
   1.152  	a->setStatusTip ( tr( "edit Heading" ));
   1.153 -	a->setShortcut ( Qt::Key_Enter);
   1.154 +	a->setShortcut ( Qt::Key_Enter);				//Edit heading
   1.155  //	a->setShortcutContext (Qt::WindowShortcut);
   1.156  	addAction (a);
   1.157      connect( a, SIGNAL( triggered() ), this, SLOT( editHeading() ) );
   1.158  	actionListBranches.append(a);
   1.159      a = new QAction( tr( "Edit heading","Edit menu" ), this);
   1.160  	a->setStatusTip (tr( "edit Heading" ));
   1.161 -	a->setShortcut (Qt::Key_Return );
   1.162 +	a->setShortcut (Qt::Key_Return );				//Edit heading
   1.163  	//a->setShortcutContext (Qt::WindowShortcut);
   1.164  	addAction (a);
   1.165      connect( a, SIGNAL( triggered() ), this, SLOT( editHeading() ) );
   1.166 @@ -441,7 +446,7 @@
   1.167  	actionEditHeading=a;
   1.168      a = new QAction( tr( "Edit heading","Edit menu" ), this);
   1.169  	a->setStatusTip (tr( "edit Heading" ));
   1.170 -	a->setShortcut ( Qt::Key_F2 );
   1.171 +	a->setShortcut ( Qt::Key_F2 );					//Edit heading
   1.172  	a->setShortcutContext (Qt::WindowShortcut);
   1.173  	addAction (a);
   1.174      connect( a, SIGNAL( triggered() ), this, SLOT( editHeading() ) );
   1.175 @@ -450,7 +455,7 @@
   1.176      // Shortcut to delete selection
   1.177      a = new QAction( tr( "Delete Selection","Edit menu" ),this);
   1.178  	a->setStatusTip (tr( "Delete Selection" ));
   1.179 -	a->setShortcut ( Qt::Key_Delete);
   1.180 +	a->setShortcut ( Qt::Key_Delete);				//Delete selection
   1.181  	a->setShortcutContext (Qt::WindowShortcut);
   1.182  	addAction (a);
   1.183      connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteSelection() ) );
   1.184 @@ -459,13 +464,13 @@
   1.185      // Shortcut to add branch
   1.186  	alt = new QAction(QPixmap(iconPath+"newbranch.png"), tr( "Add branch as child","Edit menu" ), this);
   1.187  	alt->setStatusTip ( tr( "Add a branch as child of selection" ));
   1.188 -	alt->setShortcut (Qt::Key_A);
   1.189 +	alt->setShortcut (Qt::Key_A);					//Add branch
   1.190  	alt->setShortcutContext (Qt::WindowShortcut);
   1.191  	addAction (alt);
   1.192  	connect( alt, SIGNAL( triggered() ), this, SLOT( editNewBranch() ) );
   1.193  	a = new QAction(QPixmap(iconPath+"newbranch.png"), tr( "Add branch as child","Edit menu" ), this);
   1.194  	a->setStatusTip ( tr( "Add a branch as child of selection" ));
   1.195 -	a->setShortcut (Qt::Key_Insert);	
   1.196 +	a->setShortcut (Qt::Key_Insert);				//Add branch
   1.197  	connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranch() ) );
   1.198  	actionListBranches.append(a);
   1.199  	#if defined (Q_OS_MACX)
   1.200 @@ -481,7 +486,7 @@
   1.201      // Add branch by inserting it at selection
   1.202  	a = new QAction(tr( "Add branch (insert)","Edit menu" ), this);
   1.203  	a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" ));
   1.204 -	a->setShortcut (Qt::ALT + Qt::Key_Insert );
   1.205 +	a->setShortcut (Qt::ALT + Qt::Key_Insert );		//Insert branch
   1.206  	a->setShortcutContext (Qt::WindowShortcut);
   1.207  	addAction (a);
   1.208      connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBefore() ) );
   1.209 @@ -490,7 +495,7 @@
   1.210  	actionEditAddBranchBefore=a;
   1.211  	a = new QAction(tr( "Add branch (insert)","Edit menu" ),this);
   1.212  	a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" ));
   1.213 -	a->setShortcut ( Qt::ALT + Qt::Key_A );
   1.214 +	a->setShortcut ( Qt::ALT + Qt::Key_A );			//Insert branch
   1.215  	a->setShortcutContext (Qt::WindowShortcut);
   1.216  	addAction (a);
   1.217      connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBefore() ) );
   1.218 @@ -499,7 +504,7 @@
   1.219  	// Add branch above
   1.220      a = new QAction(tr( "Add branch above","Edit menu" ), this);
   1.221  	a->setStatusTip ( tr( "Add a branch above selection" ));
   1.222 -	a->setShortcut (Qt::SHIFT+Qt::Key_Insert );
   1.223 +	a->setShortcut (Qt::SHIFT+Qt::Key_Insert );		//Add branch above
   1.224  	a->setShortcutContext (Qt::WindowShortcut);
   1.225  	addAction (a);
   1.226      connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchAbove() ) );
   1.227 @@ -508,7 +513,7 @@
   1.228  	actionEditAddBranchAbove=a;
   1.229      a = new QAction(tr( "Add branch above","Edit menu" ), this);
   1.230  	a->setStatusTip ( tr( "Add a branch above selection" ));
   1.231 -	a->setShortcut (Qt::SHIFT+Qt::Key_A );
   1.232 +	a->setShortcut (Qt::SHIFT+Qt::Key_A );			//Add branch above
   1.233  	a->setShortcutContext (Qt::WindowShortcut);
   1.234  	addAction (a);
   1.235      connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchAbove() ) );
   1.236 @@ -517,7 +522,7 @@
   1.237  	// Add branch below 
   1.238      a = new QAction(tr( "Add branch below","Edit menu" ), this);
   1.239  	a->setStatusTip ( tr( "Add a branch below selection" ));
   1.240 -	a->setShortcut (Qt::CTRL +Qt::Key_Insert );
   1.241 +	a->setShortcut (Qt::CTRL +Qt::Key_Insert );		//Add branch below
   1.242  	a->setShortcutContext (Qt::WindowShortcut);
   1.243  	addAction (a);
   1.244      connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBelow() ) );
   1.245 @@ -526,7 +531,7 @@
   1.246  	actionEditAddBranchBelow=a;
   1.247      a = new QAction(tr( "Add branch below","Edit menu" ), this);
   1.248  	a->setStatusTip ( tr( "Add a branch below selection" ));
   1.249 -	a->setShortcut (Qt::CTRL +Qt::Key_A );
   1.250 +	a->setShortcut (Qt::CTRL +Qt::Key_A );			// Add branch below
   1.251  	a->setShortcutContext (Qt::WindowShortcut);
   1.252  	addAction (a);
   1.253      connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBelow() ) );
   1.254 @@ -534,7 +539,7 @@
   1.255  
   1.256      a = new QAction(QPixmap(iconPath+"up.png" ), tr( "Move up","Edit menu" ), this);
   1.257  	a->setStatusTip ( tr( "Move branch up" ) );
   1.258 -	a->setShortcut (Qt::Key_PageUp );
   1.259 +	a->setShortcut (Qt::Key_PageUp );				// Move branch up
   1.260  	a->setEnabled (false);
   1.261      tb->addAction (a);
   1.262  	editMenu->addAction (a);
   1.263 @@ -544,7 +549,7 @@
   1.264      a = new QAction( QPixmap( iconPath+"down.png"), tr( "Move down","Edit menu" ),this);
   1.265      connect( a, SIGNAL( triggered() ), this, SLOT( editMoveDown() ) );
   1.266  	a->setStatusTip (tr( "Move branch down" ) );
   1.267 -	a->setShortcut ( Qt::Key_PageDown );
   1.268 +	a->setShortcut ( Qt::Key_PageDown );			// Move branch down
   1.269  	a->setEnabled (false);
   1.270      tb->addAction (a);
   1.271  	editMenu->addAction (a);
   1.272 @@ -557,7 +562,7 @@
   1.273      connect( a, SIGNAL( triggered() ), this, SLOT( editToggleScroll() ) );
   1.274  
   1.275  	alt = new QAction( QPixmap(flagsPath+"flag-scrolled-right.png"), tr( "Scroll branch","Edit menu" ), this);
   1.276 -	alt->setShortcut ( Qt::Key_S );
   1.277 +	alt->setShortcut ( Qt::Key_S );					// Scroll branch
   1.278  	alt->setStatusTip (tr( "Scroll branch" )); 
   1.279      connect( alt, SIGNAL( triggered() ), this, SLOT( editToggleScroll() ) );
   1.280  	#if defined(Q_OS_MACX)
   1.281 @@ -583,7 +588,7 @@
   1.282  
   1.283  	a = new QAction( QPixmap(iconPath+"find.png"), tr( "Find...","Edit menu"), this);
   1.284  	a->setStatusTip (tr( "Find" ) );
   1.285 -	a->setShortcut (Qt::CTRL + Qt::Key_F );
   1.286 +	a->setShortcut (Qt::CTRL + Qt::Key_F );				//Find
   1.287  	editMenu->addAction (a);
   1.288      connect( a, SIGNAL( triggered() ), this, SLOT( editOpenFindWindow() ) );
   1.289      
   1.290 @@ -779,10 +784,13 @@
   1.291      connect( a, SIGNAL( triggered() ), this, SLOT( editLoadImage() ) );
   1.292  	actionEditLoadImage=a;
   1.293  
   1.294 -    a = new QAction( tr( "Properties","Context menu for images and branches" )+QString ("..."), this);
   1.295 -	a->setStatusTip (tr( "Set properties for object" ));
   1.296 +    a = new QAction( tr( "Property Dialog","Dialog to edit properties of selection" )+QString ("..."), this);
   1.297 +	a->setStatusTip (tr( "Set properties for selection" ));
   1.298 +	a->setShortcut ( Qt::CTRL + Qt::Key_I );		//Property window
   1.299 +	a->setShortcutContext (Qt::WindowShortcut);
   1.300 +	addAction (a);
   1.301      connect( a, SIGNAL( triggered() ), this, SLOT( showPropertyDialog() ) );
   1.302 -	actionOpenPropertyDialog=a;
   1.303 +	actionTogglePropertyDialog=a;
   1.304  }
   1.305  
   1.306  // Format Actions
   1.307 @@ -813,7 +821,7 @@
   1.308  
   1.309      a= new QAction(QPixmap(iconPath+"formatcolorbranch.png"), tr( "Color &branch","Edit menu" ), this);
   1.310  	a->setStatusTip ( tr( "Color branch" ) );
   1.311 -	a->setShortcut (Qt::CTRL + Qt::Key_I);
   1.312 +	a->setShortcut (Qt::CTRL + Qt::Key_B);
   1.313      connect( a, SIGNAL( triggered() ), this, SLOT( formatColorBranch() ) );
   1.314  	a->setEnabled (false);
   1.315      a->addTo( tb );
   1.316 @@ -893,6 +901,12 @@
   1.317      connect( a, SIGNAL( triggered() ), this, SLOT( formatSelectLinkColor() ) );
   1.318      actionFormatLinkColor=a;
   1.319  
   1.320 +    a= new QAction( pix, tr( "Set &Selection Color"+QString("...") ), this  );
   1.321 +	a->setStatusTip (tr( "Set Selection Color" ));
   1.322 +	formatMenu->addAction (a);
   1.323 +    connect( a, SIGNAL( triggered() ), this, SLOT( formatSelectSelectionColor() ) );
   1.324 +    actionFormatSelectionColor=a;
   1.325 +
   1.326      a= new QAction( pix, tr( "Set &Background Color" )+QString("..."), this );
   1.327  	a->setStatusTip (tr( "Set Background Color" ));
   1.328  	formatMenu->addAction (a);
   1.329 @@ -950,8 +964,8 @@
   1.330      connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleNoteEditor() ) );
   1.331  	actionViewToggleNoteEditor=a;
   1.332  
   1.333 -    a = new QAction(QPixmap(iconPath+"history.png"),  tr( "Show history window","View action" ),this );
   1.334 -	a->setStatusTip ( tr( "Show history window" ));
   1.335 +    a = new QAction(QPixmap(iconPath+"history.png"),  tr( "History Window","View action" ),this );
   1.336 +	a->setStatusTip ( tr( "Show History Window" ));
   1.337  	a->setShortcut ( Qt::CTRL + Qt::Key_H  );
   1.338  	a->setToggleAction(true);
   1.339      a->addTo( tb );
   1.340 @@ -959,6 +973,8 @@
   1.341      connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleHistory() ) );
   1.342  	actionViewToggleHistoryWindow=a;
   1.343  
   1.344 +	viewMenu->addAction (actionTogglePropertyDialog );
   1.345 +
   1.346      a = new QAction(tr( "Antialiasing","View action" ),this );
   1.347  	a->setStatusTip ( tr( "Antialiasing" ));
   1.348  	a->setToggleAction(true);
   1.349 @@ -1450,8 +1466,7 @@
   1.350  
   1.351  	// Context Menu for branch or mapcenter
   1.352  	branchContextMenu =new QMenu (this);
   1.353 -
   1.354 -	actionOpenPropertyDialog->addTo (branchContextMenu);
   1.355 +	branchContextMenu->addAction (actionTogglePropertyDialog);
   1.356  	branchContextMenu->addSeparator();	
   1.357  
   1.358  		// Submenu "Add"
   1.359 @@ -1533,6 +1548,7 @@
   1.360  	canvasContextMenu->insertSeparator();	
   1.361  	actionFormatLinkColorHint->addTo( canvasContextMenu );
   1.362  	actionFormatLinkColor->addTo( canvasContextMenu );
   1.363 +	actionFormatSelectionColor->addTo( canvasContextMenu );
   1.364  	actionFormatBackColor->addTo( canvasContextMenu );
   1.365  	actionFormatBackImage->addTo( canvasContextMenu );
   1.366  
   1.367 @@ -2215,13 +2231,14 @@
   1.368  			QString dir=dia.getDir();
   1.369  			// Check, if warnings should be used before overwriting
   1.370  			// the output directory
   1.371 -			bool ok;
   1.372 -			if (dia.warnings()) 
   1.373 -				ok=reallyWriteDirectory(dir);
   1.374 -			else
   1.375 -				ok=true;
   1.376 -
   1.377 -			if (ok)
   1.378 +			WarningDialog warn;
   1.379 +			warn.showCancelButton (true);
   1.380 +			warn.setText(QString(
   1.381 +				"The directory %1 is not empty.\n"
   1.382 +				"Do you risk to overwrite some of its contents?").arg(dir));
   1.383 +			warn.setCaption("Warning: Directory not empty");
   1.384 +			warn.setShowAgainName("mainwindow/overwrite-dir-xhtml");
   1.385 +			if (warn.exec()==QDialog::Accepted)
   1.386  			{
   1.387  				me->exportXML (dia.getDir() );
   1.388  				dia.doExport(me->getMapName() );
   1.389 @@ -3067,6 +3084,12 @@
   1.390  		currentMapEditor()->selectMapLinkColor();
   1.391  }
   1.392  
   1.393 +void Main::formatSelectSelectionColor()
   1.394 +{
   1.395 +	if (currentMapEditor())
   1.396 +		currentMapEditor()->selectMapSelectionColor();
   1.397 +}
   1.398 +
   1.399  void Main::formatToggleLinkColorHint()
   1.400  {
   1.401  	currentMapEditor()->toggleMapLinkColorHint();
   1.402 @@ -3211,6 +3234,11 @@
   1.403  		currentMapEditor()->updateNoteFlag();
   1.404  }
   1.405  
   1.406 +void Main::updateSatellites(MapEditor *me)
   1.407 +{
   1.408 +	branchPropertyWindow->setMapEditor (me);
   1.409 +}
   1.410 +
   1.411  void Main::updateActions()
   1.412  {
   1.413  	MapEditor *me=currentMapEditor();
   1.414 @@ -3220,6 +3248,7 @@
   1.415  
   1.416  	// updateActions is also called when NoteEditor is closed
   1.417  	actionViewToggleNoteEditor->setOn (textEditor->showWithMain());
   1.418 +	actionViewToggleHistoryWindow->setOn (historyWindow->showWithMain());
   1.419  
   1.420  	if (me->getMapLinkColorHint()==HeadingColor) 
   1.421  		actionFormatLinkColorHint->setOn(true);
   1.422 @@ -3244,12 +3273,16 @@
   1.423  			break;
   1.424  	}	
   1.425  
   1.426 +	// Update colors
   1.427  	QPixmap pix( 16, 16 );
   1.428      pix.fill( me->getMapBackgroundColor() );
   1.429      actionFormatBackColor->setIconSet( pix );
   1.430 +    pix.fill( me->getSelectionColor() );
   1.431 +    actionFormatSelectionColor->setIconSet( pix );
   1.432      pix.fill( me->getMapDefLinkColor() );
   1.433      actionFormatLinkColor->setIconSet( pix );
   1.434  
   1.435 +
   1.436  	actionFileSave->setEnabled( me->isUnsaved() );
   1.437  	if (me->isUndoAvailable())
   1.438  		actionEditUndo->setEnabled( true);