mainwindow.cpp
changeset 366 e95081c21da2
parent 357 64819498efbf
child 374 8df2895c131c
     1.1 --- a/mainwindow.cpp	Tue Sep 05 09:47:13 2006 +0000
     1.2 +++ b/mainwindow.cpp	Tue Sep 05 09:47:14 2006 +0000
     1.3 @@ -1,20 +1,25 @@
     1.4  #include "mainwindow.h"
     1.5  
     1.6 -#include <qstatusbar.h>
     1.7 -#include <qmessagebox.h>
     1.8 -#include <qmenubar.h>
     1.9 -#include <qapplication.h>
    1.10 -#include <qpainter.h>
    1.11 -#include <qprinter.h>
    1.12 -#include <qfile.h>
    1.13 -#include <qfiledialog.h>
    1.14 -#include <qcolor.h>
    1.15 -#include <qcolordialog.h>
    1.16 -#include <qbitmap.h>
    1.17 -#include <qinputdialog.h>
    1.18 +#include <QtGui>
    1.19 +#include <QPainter>
    1.20 +#include <QPrinter>
    1.21 +#include <QFile>
    1.22 +#include <q3filedialog.h>
    1.23 +#include <QColor>
    1.24 +#include <QColorDialog>
    1.25 +#include <QBitmap>
    1.26 +#include <QInputDialog>
    1.27 +//Added by qt3to4:
    1.28 +#include <Q3StrList>
    1.29 +#include <QPixmap>
    1.30 +#include <QCloseEvent>
    1.31 +#include <QShowEvent>
    1.32 +#include <QHideEvent>
    1.33 +#include <Q3PopupMenu>
    1.34 +#include <QActionGroup>
    1.35 +#include <Q3PtrList>
    1.36  //#include <qdatetime.h>			// for random seed
    1.37  
    1.38 -
    1.39  #include <iostream>
    1.40  #include <cstdlib>
    1.41  #include <typeinfo>
    1.42 @@ -44,7 +49,7 @@
    1.43  extern FlagRowObj* standardFlagsDefault;
    1.44  extern FlagRowObj* systemFlagsDefault;
    1.45  
    1.46 -extern QPtrList <QAction> actionListBranches;
    1.47 +extern Q3PtrList <QAction> actionListBranches;
    1.48  
    1.49  extern QAction* actionFileSave;
    1.50  extern QAction* actionFilePrint;
    1.51 @@ -58,11 +63,13 @@
    1.52  extern QAction *actionEditToggleScroll;
    1.53  extern QAction* actionEditOpenURL;
    1.54  extern QAction* actionEditOpenURLTab;
    1.55 +extern QAction* actionEditOpenMultipleURLTabs;
    1.56  extern QAction* actionEditURL;
    1.57  extern QAction* actionEditHeading2URL;
    1.58  extern QAction* actionEditBugzilla2URL;
    1.59  extern QAction* actionEditFATE2URL;
    1.60  extern QAction *actionEditOpenVymLink;
    1.61 +extern QAction *actionEditOpenMultipleVymLinks;
    1.62  extern QAction *actionEditVymLink;
    1.63  extern QAction *actionEditDeleteVymLink;
    1.64  extern QAction *actionEditToggleHideExport;
    1.65 @@ -115,36 +122,34 @@
    1.66  extern QAction* actionSettingsAutoselectHeading;
    1.67  extern QAction* actionSettingsAutoselectHeading;
    1.68  extern QAction* actionSettingsAutoselectText;
    1.69 -extern QAction* actionSettingsPasteNewHeading;
    1.70  extern QAction* actionSettingsUseDelKey;
    1.71  extern QAction* actionSettingsUseFlagGroups;
    1.72  extern QAction* actionSettingsUseHideExport;
    1.73  
    1.74 -extern QPopupMenu* branchContextMenu;
    1.75 -extern QPopupMenu* branchAddContextMenu;
    1.76 -extern QPopupMenu* branchRemoveContextMenu;
    1.77 -extern QPopupMenu* branchLinksContextMenu;
    1.78 -extern QPopupMenu* branchLinksContextMenuDup;
    1.79 -extern QPopupMenu* floatimageContextMenu;
    1.80 -extern QPopupMenu* saveImageFormatMenu;
    1.81 -extern QPopupMenu* canvasContextMenu;
    1.82 -extern QPopupMenu* lastMapsMenu;
    1.83 -extern QPopupMenu* importMenu;
    1.84 -extern QPopupMenu* exportMenu;
    1.85 -extern QPopupMenu* exportImageFormatMenu;
    1.86 +extern QMenu* branchContextMenu;
    1.87 +extern QMenu* branchAddContextMenu;
    1.88 +extern QMenu* branchRemoveContextMenu;
    1.89 +extern QMenu* branchLinksContextMenu;
    1.90 +extern QMenu* branchXLinksContextMenuEdit;
    1.91 +extern QMenu* branchXLinksContextMenuFollow;
    1.92 +extern QMenu* floatimageContextMenu;
    1.93 +extern QMenu* canvasContextMenu;
    1.94 +extern QMenu* fileLastMapsMenu;
    1.95 +extern QMenu* fileImportMenu;
    1.96 +extern QMenu* fileExportMenu;
    1.97  
    1.98  
    1.99  extern Settings settings;
   1.100  extern Options options;
   1.101 +extern ImageIO imageIO;
   1.102 +
   1.103  extern QDir vymBaseDir;
   1.104 +extern QDir lastImageDir;
   1.105 +extern QDir lastFileDir;
   1.106  extern QString iconPath;
   1.107  extern QString flagsPath;
   1.108  
   1.109 -#if defined(Q_OS_LINUX)
   1.110 -extern void qt_wait_for_window_manager( QWidget* w );
   1.111 -#endif
   1.112 -
   1.113 -Main::Main(QWidget* parent, const char* name, WFlags f) :
   1.114 +Main::Main(QWidget* parent, const char* name, Qt::WFlags f) :
   1.115      QMainWindow(parent,name,f)
   1.116  {
   1.117  	mainWindow=this;
   1.118 @@ -152,14 +157,18 @@
   1.119  	setCaption ("VYM - View Your Mind");
   1.120  
   1.121  	// Load window settings
   1.122 -	resize (settings.readNumEntry( "/vym/mainwindow/geometry/width", 800),
   1.123 -	        settings.readNumEntry( "/vym/mainwindow/geometry/height",600));
   1.124 -	move   (settings.readNumEntry( "/vym/mainwindow/geometry/posX", 100),
   1.125 -	        settings.readNumEntry( "/vym/mainwindow/geometry/posY", 100));
   1.126 +	resize (settings.value( "/mainwindow/geometry/size",QSize (800,600)).toSize());
   1.127 +	move   (settings.value( "/mainwindow/geometry/pos", QPoint(300,100)).toPoint());
   1.128  
   1.129  
   1.130  	// Create unique temporary directory
   1.131 -	tmpVymDir=makeUniqueDir ("/tmp/vym-XXXXXX");
   1.132 +	bool ok;
   1.133 +	tmpVymDir=makeUniqueDir (ok,"/tmp/vym-XXXXXX");
   1.134 +	if (!ok)
   1.135 +	{
   1.136 +		qWarning ("Mainwindow: Could not create temporary directory, failed to start vym");
   1.137 +		exit (1);
   1.138 +	}
   1.139  
   1.140  	// Create direcctory for clipboard
   1.141  	clipboardDir=tmpVymDir+"/clipboard";
   1.142 @@ -180,30 +189,30 @@
   1.143  	QString p,s;
   1.144  
   1.145  		// application to open URLs
   1.146 -		p="/vym/mainwindow/readerURL";
   1.147 +		p="/mainwindow/readerURL";
   1.148  		#if defined(Q_OS_LINUX)
   1.149 -			s=settings.readEntry (p,"konqueror");
   1.150 +			s=settings.value (p,"konqueror").toString();
   1.151  		#else
   1.152  			#if defined(Q_OS_MACX)
   1.153 -				s=settings.readEntry (p,"/usr/bin/open");
   1.154 +				s=settings.value (p,"/usr/bin/open").toString();
   1.155  			#else
   1.156 -				s=settings.readEntry (p,"mozilla");
   1.157 +				s=settings.value (p,"mozilla");
   1.158  			#endif
   1.159  		#endif
   1.160 -		settings.writeEntry( p,s);
   1.161 +		settings.setValue( p,s);
   1.162  
   1.163  		// application to open PDFs
   1.164 -		p="/vym/mainwindow/readerPDF";
   1.165 +		p="/mainwindow/readerPDF";
   1.166  		#if defined(Q_OS_LINUX)
   1.167 -			s=settings.readEntry (p,"acroread");
   1.168 +			s=settings.value (p,"acroread").toString();
   1.169  		#else
   1.170  			#if defined(Q_OS_MACX)
   1.171 -				s=settings.readEntry (p,"/usr/bin/open");
   1.172 +				s=settings.value (p,"/usr/bin/open").toString();
   1.173  			#else
   1.174 -				s=settings.readEntry (p,"acroread");
   1.175 +				s=settings.value (p,"acroread").toString();
   1.176  			#endif
   1.177  		#endif
   1.178 -		settings.writeEntry( p,s);
   1.179 +		settings.setValue( p,s);
   1.180  
   1.181  	
   1.182  	maxLastMaps=9;
   1.183 @@ -213,6 +222,9 @@
   1.184  	connect( tabWidget, SIGNAL( currentChanged( QWidget * ) ), 
   1.185  		this, SLOT( editorChanged( QWidget * ) ) );
   1.186  
   1.187 +	lineedit=new QLineEdit (this);
   1.188 +	lineedit->hide();
   1.189 +
   1.190  	setCentralWidget(tabWidget);	
   1.191  
   1.192      setupFileActions();
   1.193 @@ -223,14 +235,12 @@
   1.194  	setupFlagActions();
   1.195      setupSettingsActions();
   1.196  	setupContextMenus();
   1.197 -    if (settings.readBoolEntry( "/vym/mainwindow/showTestMenu",false)) setupTestActions();
   1.198 +    if (settings.value( "/mainwindow/showTestMenu",false).toBool()) setupTestActions();
   1.199      setupHelpActions();
   1.200      
   1.201 -	// After menu is created, we can enable some actions
   1.202 -	actionFilePrint->setEnabled (true);
   1.203 -
   1.204      statusBar();
   1.205  
   1.206 +	restoreState (settings.value("/mainwindow/state",0).toByteArray());
   1.207  
   1.208  	// Initialize Find window
   1.209  	findWindow=new FindWindow(NULL,"findwindow");
   1.210 @@ -248,31 +258,29 @@
   1.211  Main::~Main()
   1.212  {
   1.213  	// Save Settings
   1.214 -	settings.writeEntry( "/vym/mainwindow/geometry/width", width() );
   1.215 -	settings.writeEntry( "/vym/mainwindow/geometry/height", height() );
   1.216 -	settings.writeEntry( "/vym/mainwindow/geometry/posX", pos().x() );
   1.217 -	settings.writeEntry( "/vym/mainwindow/geometry/posY", pos().y() );
   1.218 -
   1.219 -	settings.writeEntry( "/vym/version/version", __VYM_VERSION );
   1.220 -	settings.writeEntry( "/vym/version/builddate", __BUILD_DATE );
   1.221 -
   1.222 -	settings.writeEntry( "/vym/mapeditor/editmode/autoselectheading",actionSettingsAutoselectHeading->isOn() );
   1.223 -	settings.writeEntry( "/vym/mapeditor/editmode/autoselecttext",actionSettingsAutoselectText->isOn() );
   1.224 -	settings.writeEntry( "/vym/mapeditor/editmode/pastenewheading",actionSettingsPasteNewHeading->isOn() );
   1.225 -	settings.writeEntry( "/vym/mapeditor/editmode/autoedit",actionSettingsAutoedit->isOn() );
   1.226 -	settings.writeEntry( "/vym/mapeditor/editmode/useDelKey",actionSettingsUseDelKey->isOn() );
   1.227 -	settings.writeEntry( "/vym/mapeditor/editmode/useFlagGroups",actionSettingsUseFlagGroups->isOn() );
   1.228 -	settings.writeEntry( "/vym/export/useHideExport",actionSettingsUseHideExport->isOn() );
   1.229 +	settings.setValue ( "/mainwindow/geometry/size", size() );
   1.230 +	settings.setValue ( "/mainwindow/geometry/pos", pos() );
   1.231 +
   1.232 +	settings.setValue ("/mainwindow/state",saveState(0));
   1.233 +
   1.234 +	settings.setValue( "/version/version", __VYM_VERSION );
   1.235 +	settings.setValue( "/version/builddate", __BUILD_DATE );
   1.236 +
   1.237 +	settings.setValue( "/mapeditor/editmode/autoSelectHeading",actionSettingsAutoselectHeading->isOn() );
   1.238 +	settings.setValue( "/mapeditor/editmode/autoSelectText",actionSettingsAutoselectText->isOn() );
   1.239 +	settings.setValue( "/mapeditor/editmode/autoEdit",actionSettingsAutoedit->isOn() );
   1.240 +	settings.setValue( "/mapeditor/editmode/useDelKey",actionSettingsUseDelKey->isOn() );
   1.241 +	settings.setValue( "/mapeditor/editmode/useFlagGroups",actionSettingsUseFlagGroups->isOn() );
   1.242 +	settings.setValue( "/export/useHideExport",actionSettingsUseHideExport->isOn() );
   1.243  
   1.244  	QString s;
   1.245  	int maps=lastMaps.count();
   1.246 -	settings.writeEntry( "/vym/lastMaps/number",maps );
   1.247 +	settings.setValue( "/lastMaps/number",maps );
   1.248  	for (int i=1;i<=maps;i++)
   1.249  	{
   1.250 -		QStringList::Iterator it = lastMaps.at(i-1);
   1.251 -		s=QString("/vym/lastMaps/map-%1").arg(i);
   1.252 +		s=QString("/lastMaps/map-%1").arg(i);
   1.253  		if (!s.isEmpty() && i<=maxLastMaps) 
   1.254 -			settings.writeEntry (s, *it);
   1.255 +			settings.setValue (s, lastMaps.at(i-1));
   1.256  	}
   1.257  
   1.258  
   1.259 @@ -315,215 +323,327 @@
   1.260  // File Actions
   1.261  void Main::setupFileActions()
   1.262  {
   1.263 -    QToolBar *tb = new QToolBar( this );
   1.264 -    tb->setLabel( "File Actions" );
   1.265 -    QPopupMenu *menu = new QPopupMenu( this );
   1.266 -    menuBar()->insertItem( tr( "&File" ), menu );
   1.267 -
   1.268 -	// Keycodes:  /usr/lib64/qt3/include/qnamespace.h
   1.269 +	QMenu *fileMenu = menuBar()->addMenu ( tr ("&Map") );
   1.270 +    QToolBar *tb = addToolBar( tr ("&Map") );
   1.271 +	tb->setObjectName ("mapTB");
   1.272  
   1.273      QAction *a;
   1.274 -    a = new QAction( tr( "New map","File menu" ), QPixmap( iconPath+"filenew.png"), tr( "&New..." ), CTRL + Key_N, this, "fileNew" );
   1.275 -    connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) );
   1.276 +    a = new QAction(QPixmap( iconPath+"filenew.png"), tr( "&New..." ),this);
   1.277 +	a->setStatusTip ( tr( "New map","File menu" ) );
   1.278 +	a->setShortcut ( Qt::CTRL + Qt::Key_N );
   1.279      a->addTo( tb );
   1.280 -    a->addTo( menu );
   1.281 +	fileMenu->addAction (a);
   1.282 +    connect( a, SIGNAL( triggered() ), this, SLOT( fileNew() ) );
   1.283  	
   1.284 -    a = new QAction( tr( "Open","File menu" ), QPixmap( iconPath+"fileopen.png"), tr( "&Open..." ), CTRL + Key_O, this, "fileOpen" );
   1.285 -    connect( a, SIGNAL( activated() ), this, SLOT( fileLoad() ) );
   1.286 +    a = new QAction( QPixmap( iconPath+"fileopen.png"), tr( "&Open..." ),this);
   1.287 +	a->setStatusTip (tr( "Open","File menu" ) );
   1.288 +	a->setShortcut ( Qt::CTRL + Qt::Key_O );
   1.289      a->addTo( tb );
   1.290 -    a->addTo( menu );
   1.291 +	fileMenu->addAction (a);
   1.292 +    connect( a, SIGNAL( triggered() ), this, SLOT( fileLoad() ) );
   1.293  	
   1.294 -	lastMapsMenu = new QPopupMenu (this);
   1.295 -
   1.296 -    menu->insertItem (tr("Open Recent"),lastMapsMenu );
   1.297 -    menu->insertSeparator();
   1.298 +	fileLastMapsMenu = fileMenu->addMenu (tr("Open Recent"));
   1.299 +	fileMenu->addSeparator();
   1.300  	
   1.301 -    a = new QAction( tr( "Save" ), QPixmap( iconPath+"filesave.png"), tr( "&Save..." ), CTRL + Key_S, this, "fileSave" );
   1.302 -    connect( a, SIGNAL( activated() ), this, SLOT( fileSave() ) );
   1.303 +    a = new QAction( QPixmap( iconPath+"filesave.png"), tr( "&Save..." ), this);
   1.304 +	a->setStatusTip ( tr( "Save" ));
   1.305 +	a->setShortcut (Qt::CTRL + Qt::Key_S );
   1.306      a->addTo( tb );
   1.307 -    a->addTo( menu );
   1.308 +	fileMenu->addAction (a);
   1.309 +    connect( a, SIGNAL( triggered() ), this, SLOT( fileSave() ) );
   1.310  	actionFileSave=a;
   1.311  	
   1.312 -    a = new QAction( tr( "Save &As" ), QPixmap(iconPath+"filesaveas.png"), tr( "Save &As..." ), 0, this, "fileSaveAs" );
   1.313 -    connect( a, SIGNAL( activated() ), this, SLOT( fileSaveAs() ) );
   1.314 -    a->addTo( menu );
   1.315 -
   1.316 -    menu->insertSeparator();
   1.317 -
   1.318 -	importMenu = new QPopupMenu (this);
   1.319 -    menu->insertItem (tr("Import"),importMenu );
   1.320 -
   1.321 -	a = new QAction( tr( "Import")+" "+tr("KDE Bookmarks" ), QPixmap(), tr("KDE Bookmarks"), 0, this, "importKDEBookmarks" );
   1.322 -	connect( a, SIGNAL( activated() ), this, SLOT( fileImportKDEBookmarks() ) );
   1.323 -	a->addTo (importMenu);
   1.324 -
   1.325 -    if (settings.readBoolEntry( "/vym/mainwindow/showTestMenu",false)) 
   1.326 +    a = new QAction( QPixmap(iconPath+"filesaveas.png"), tr( "Save &As..." ), this);
   1.327 +	a->setStatusTip (tr( "Save &As" ) );
   1.328 +	fileMenu->addAction (a);
   1.329 +    connect( a, SIGNAL( triggered() ), this, SLOT( fileSaveAs() ) );
   1.330 +
   1.331 +	fileMenu->addSeparator();
   1.332 +
   1.333 +	fileImportMenu = fileMenu->addMenu (tr("Import"));
   1.334 +
   1.335 +	a = new QAction(tr("KDE Bookmarks"), this);
   1.336 +	a->setStatusTip ( tr( "Import")+" "+tr("KDE Bookmarks" ));
   1.337 +	a->addTo (fileImportMenu);
   1.338 +	connect( a, SIGNAL( triggered() ), this, SLOT( fileImportKDEBookmarks() ) );
   1.339 +
   1.340 +    if (settings.value( "/mainwindow/showTestMenu",false).toBool()) 
   1.341  	{
   1.342 -		a = new QAction( tr( "Import")+" "+tr("Firefox Bookmarks" ), QPixmap(), tr("Firefox Bookmarks"), 0, this, "importFirefoxBookmarks" );
   1.343 -		connect( a, SIGNAL( activated() ), this, SLOT( fileImportFirefoxBookmarks() ) );
   1.344 -		a->addTo (importMenu);
   1.345 +		a = new QAction( QPixmap(), tr("Firefox Bookmarks"),this);
   1.346 +		a->setStatusTip (tr( "Import")+" "+tr("Firefox Bookmarks" ) );
   1.347 +		a->addTo (fileImportMenu);
   1.348 +		connect( a, SIGNAL( triggered() ), this, SLOT( fileImportFirefoxBookmarks() ) );
   1.349  	}	
   1.350  
   1.351 -	a = new QAction( tr( "Import")+" Mind Manager" , QPixmap(), "Mind Manager...", 0, this, "importMM" );
   1.352 -	connect( a, SIGNAL( activated() ), this, SLOT( fileImportMM() ) );
   1.353 -	a->addTo (importMenu);
   1.354 -
   1.355 -    a = new QAction( tr( "Import directory structure (experimental)" ), QPixmap(), tr( "Import Dir"+QString("...") ), 0, this, "export" );
   1.356 -    connect( a, SIGNAL( activated() ), this, SLOT( fileImportDir() ) );
   1.357 -    a->addTo( importMenu);
   1.358 -
   1.359 -	exportMenu = new QPopupMenu (this);
   1.360 -    menu->insertItem (tr("Export"),exportMenu );
   1.361 -
   1.362 -    menu->insertSeparator();
   1.363 -
   1.364 -
   1.365 -    a = new QAction( tr( "Print" ), QPixmap( iconPath+"fileprint.png"), tr( "&Print")+QString("..."), CTRL + Key_P, this, "filePrint" );
   1.366 -    connect( a, SIGNAL( activated() ), this, SLOT( filePrint() ) );
   1.367 +	a = new QAction("Mind Manager...",this);
   1.368 +	a->setStatusTip ( tr( "Import")+" Mind Manager"  );
   1.369 +	fileImportMenu->addAction (a);
   1.370 +	connect( a, SIGNAL( triggered() ), this, SLOT( fileImportMM() ) );
   1.371 +
   1.372 +    a = new QAction( tr( "Import Dir"+QString("...") ), this);
   1.373 +	a->setStatusTip (tr( "Import directory structure (experimental)" ) );
   1.374 +	fileImportMenu->addAction (a);
   1.375 +    connect( a, SIGNAL( triggered() ), this, SLOT( fileImportDir() ) );
   1.376 +
   1.377 +	fileExportMenu = fileMenu->addMenu (tr("Export"));
   1.378 +
   1.379 +	a = new QAction( tr("Image")+QString("..."), this);
   1.380 +	a->setStatusTip( tr( "Export map as image" ));
   1.381 +	connect( a, SIGNAL( triggered() ), this, SLOT( fileExportImage() ) );
   1.382 +	fileExportMenu->addAction (a);
   1.383 +
   1.384 +	a = new QAction( "Open Office"+QString("..."), this);
   1.385 +	a->setStatusTip( tr( "Export in Open Document Format used e.g. in Open Office " ));
   1.386 +	connect( a, SIGNAL( triggered() ), this, SLOT( fileExportOOPresentation() ) );
   1.387 +	fileExportMenu->addAction (a);
   1.388 +
   1.389 +	a = new QAction(  "Webpage (XHTML)...",this );
   1.390 +	a->setShortcut (Qt::ALT + Qt::Key_X);
   1.391 +	a->setStatusTip ( tr( "Export as")+" webpage (XHTML)");
   1.392 +    connect( a, SIGNAL( triggered() ), this, SLOT( fileExportXHTML() ) );
   1.393 +	fileExportMenu->addAction (a);
   1.394 +
   1.395 +    a = new QAction( "Text (ASCII)...", this);
   1.396 +	a->setStatusTip ( tr( "Export as")+" ASCII"+" "+tr("(still experimental)" ));
   1.397 +    connect( a, SIGNAL( triggered() ), this, SLOT( fileExportASCII() ) );
   1.398 +	fileExportMenu->addAction (a);
   1.399 +
   1.400 +	a = new QAction( tr("KDE Bookmarks"), this);
   1.401 +	a->setStatusTip( tr( "Export as")+" "+tr("KDE Bookmarks" ));
   1.402 +	connect( a, SIGNAL( triggered() ), this, SLOT( fileExportKDEBookmarks() ) );
   1.403 +	fileExportMenu->addAction (a);
   1.404 +
   1.405 +    a = new QAction( "Taskjuggler...", this );
   1.406 +    a->setStatusTip( tr( "Export as")+" Taskjuggler"+" "+tr("(still experimental)" ));
   1.407 +    connect( a, SIGNAL( triggered() ), this, SLOT( fileExportTaskjuggler() ) );
   1.408 +	fileExportMenu->addAction (a);
   1.409 +
   1.410 +    a = new QAction( "LaTeX...", this);
   1.411 +    a->setStatusTip( tr( "Export as")+" LaTeX"+" "+tr("(still experimental)" ));
   1.412 +    connect( a, SIGNAL( triggered() ), this, SLOT( fileExportLaTeX() ) );
   1.413 +	fileExportMenu->addAction (a);
   1.414 +
   1.415 +	a = new QAction( "XML..." , this );
   1.416 +	a->setStatusTip (tr( "Export as")+" XML");
   1.417 +    connect( a, SIGNAL( triggered() ), this, SLOT( fileExportXML() ) );
   1.418 +	fileExportMenu->addAction (a);
   1.419 +
   1.420 +	fileMenu->addSeparator();
   1.421 +
   1.422 +    a = new QAction(QPixmap( iconPath+"fileprint.png"), tr( "&Print")+QString("..."), this);
   1.423 +	a->setStatusTip ( tr( "Print" ) );
   1.424 +	a->setShortcut (Qt::CTRL + Qt::Key_P );
   1.425      a->addTo( tb );
   1.426 -    a->addTo( menu );
   1.427 +	fileMenu->addAction (a);
   1.428 +    connect( a, SIGNAL( triggered() ), this, SLOT( filePrint() ) );
   1.429  	actionFilePrint=a;
   1.430  
   1.431 -    a = new QAction( tr( "Close Map" ), QPixmap(iconPath+"fileclose.png"), tr( "&Close Map" ), ALT + Key_C, this, "fileCloseMap" );
   1.432 -    connect( a, SIGNAL( activated() ), this, SLOT( fileCloseMap() ) );
   1.433 -    a->addTo( menu );
   1.434 -
   1.435 -    a = new QAction( tr( "Exit")+" "+__VYM, QPixmap(iconPath+"exit.png"), tr( "E&xit")+" "+__VYM, CTRL + Key_Q, this, "fileExitVYM" );
   1.436 -    connect( a, SIGNAL( activated() ), this, SLOT( fileExitVYM() ) );
   1.437 -    a->addTo( menu );
   1.438 +    a = new QAction( QPixmap(iconPath+"fileclose.png"), tr( "&Close Map" ), this);
   1.439 +	a->setStatusTip (tr( "Close Map" ) );
   1.440 +	a->setShortcut (Qt::ALT + Qt::Key_C );
   1.441 +	fileMenu->addAction (a);
   1.442 +    connect( a, SIGNAL( triggered() ), this, SLOT( fileCloseMap() ) );
   1.443 +
   1.444 +    a = new QAction(QPixmap(iconPath+"exit.png"), tr( "E&xit")+" "+__VYM, this);
   1.445 +	a->setStatusTip ( tr( "Exit")+" "+__VYM );
   1.446 +	a->setShortcut (Qt::CTRL + Qt::Key_Q );
   1.447 +	fileMenu->addAction (a);
   1.448 +    connect( a, SIGNAL( triggered() ), this, SLOT( fileExitVYM() ) );
   1.449  }
   1.450  
   1.451  
   1.452  //Edit Actions
   1.453  void Main::setupEditActions()
   1.454  {
   1.455 -    QToolBar *tb = new QToolBar( this );
   1.456 +    QToolBar *tb = addToolBar( tr ("&Actions") );
   1.457      tb->setLabel( "Edit Actions" );
   1.458 -    QPopupMenu *menu = new QPopupMenu( this );
   1.459 -    menuBar()->insertItem( tr( "&Edit" ), menu );
   1.460 +	tb->setObjectName ("actionsTB");
   1.461 +    QMenu *editMenu = menuBar()->addMenu( tr("&Edit") );
   1.462  
   1.463      QAction *a;
   1.464  	QAction *alt;
   1.465 -    a = new QAction( tr( "Undo" ), QPixmap( iconPath+"undo.png"), tr( "&Undo" ), CTRL + Key_Z, this, "editUndo" );
   1.466 -    connect( a, SIGNAL( activated() ), this, SLOT( editUndo() ) );
   1.467 +    a = new QAction( QPixmap( iconPath+"undo.png"), tr( "&Undo" ),this);
   1.468 +    connect( a, SIGNAL( triggered() ), this, SLOT( editUndo() ) );
   1.469 +	a->setStatusTip (tr( "Undo" ) );
   1.470 +	a->setShortcut ( Qt::CTRL + Qt::Key_Z );
   1.471  	a->setEnabled (false);
   1.472 -    a->addTo( tb );
   1.473 -    a->addTo( menu );
   1.474 +    tb->addAction (a);
   1.475 +	editMenu->addAction (a);
   1.476  	actionEditUndo=a;
   1.477      
   1.478 -    if (settings.readBoolEntry( "/vym/mainwindow/showTestMenu",false)) 
   1.479 -	{
   1.480 -		a = new QAction( tr( "Redo" ), QPixmap( iconPath+"redo.png"), tr( "&Redo" ), CTRL + Key_Y, this, "editRedo" ); 
   1.481 -		connect( a, SIGNAL( activated() ), this, SLOT( editRedo() ) );
   1.482 -		a->addTo( tb );
   1.483 -		a->addTo( menu );
   1.484 -	}
   1.485 +	a = new QAction( QPixmap( iconPath+"redo.png"), tr( "&Redo" ), this); 
   1.486 +	a->setStatusTip (tr( "Redo" ));
   1.487 +	a->setShortcut (Qt::CTRL + Qt::Key_Y );
   1.488 +    tb->addAction (a);
   1.489 +	editMenu->addAction (a);
   1.490 +	connect( a, SIGNAL( triggered() ), this, SLOT( editRedo() ) );
   1.491 +	actionEditRedo=a;
   1.492     
   1.493 -    menu->insertSeparator();
   1.494 -    a = new QAction( tr( "Copy" ), QPixmap( iconPath+"editcopy.png"), tr( "&Copy" ), CTRL + Key_C, this, "editCopy" );
   1.495 -    connect( a, SIGNAL( activated() ), this, SLOT( editCopy() ) );
   1.496 +	editMenu->addSeparator();
   1.497 +    a = new QAction(QPixmap( iconPath+"editcopy.png"), tr( "&Copy" ), this);
   1.498 +	a->setStatusTip ( tr( "Copy" ) );
   1.499 +	a->setShortcut (Qt::CTRL + Qt::Key_C );
   1.500  	a->setEnabled (false);
   1.501 -    a->addTo( tb );
   1.502 -    a->addTo( menu );
   1.503 +    tb->addAction (a);
   1.504 +	editMenu->addAction (a);
   1.505 +    connect( a, SIGNAL( triggered() ), this, SLOT( editCopy() ) );
   1.506  	actionEditCopy=a;
   1.507 -    a = new QAction( tr( "Cut" ), QPixmap( iconPath+"editcut.png" ), tr( "Cu&t" ), CTRL + Key_X, this, "editCut" );
   1.508 -    connect( a, SIGNAL( activated() ), this, SLOT( editCut() ) );
   1.509 +	
   1.510 +    a = new QAction(QPixmap( iconPath+"editcut.png" ), tr( "Cu&t" ), this);
   1.511 +	a->setStatusTip ( tr( "Cut" ) );
   1.512 +	a->setShortcut (Qt::CTRL + Qt::Key_X );
   1.513  	a->setEnabled (false);
   1.514 -    a->addTo( tb );
   1.515 -    a->addTo( menu );
   1.516 +    tb->addAction (a);
   1.517 +	editMenu->addAction (a);
   1.518  	actionEditCut=a;
   1.519 -    a = new QAction( tr( "Paste" ), QPixmap( iconPath+"editpaste.png"), tr( "&Paste" ), CTRL + Key_V, this, "editPaste" );
   1.520 -    connect( a, SIGNAL( activated() ), this, SLOT( editPaste() ) );
   1.521 +    connect( a, SIGNAL( triggered() ), this, SLOT( editCut() ) );
   1.522 +	
   1.523 +    a = new QAction(QPixmap( iconPath+"editpaste.png"), tr( "&Paste" ),this);
   1.524 +    connect( a, SIGNAL( triggered() ), this, SLOT( editPaste() ) );
   1.525 +	a->setStatusTip ( tr( "Paste" ) );
   1.526 +	a->setShortcut ( Qt::CTRL + Qt::Key_V );
   1.527  	a->setEnabled (false);
   1.528 -    a->addTo( tb );
   1.529 -    a->addTo( menu );
   1.530 +    tb->addAction (a);
   1.531 +	editMenu->addAction (a);
   1.532  	actionEditPaste=a;
   1.533  
   1.534      // Shortcuts to modify heading:
   1.535 -    a = new QAction( tr( "edit Heading" ),tr( "Edit heading" ), Key_Enter, this, "editHeading" );
   1.536 -    connect( a, SIGNAL( activated() ), this, SLOT( editHeading() ) );
   1.537 +    a = new QAction(tr( "Edit heading" ),this);
   1.538 +	a->setStatusTip ( tr( "edit Heading" ));
   1.539 +	a->setShortcut ( Qt::Key_Enter);
   1.540 +//	a->setShortcutContext (Qt::WindowShortcut);
   1.541 +	addAction (a);
   1.542 +    connect( a, SIGNAL( triggered() ), this, SLOT( editHeading() ) );
   1.543  	actionListBranches.append(a);
   1.544 -    a = new QAction( tr( "edit Heading" ),tr( "Edit heading" ), Key_Return, this, "editHeading" );
   1.545 -    connect( a, SIGNAL( activated() ), this, SLOT( editHeading() ) );
   1.546 +    a = new QAction( tr( "Edit heading" ), this);
   1.547 +	a->setStatusTip (tr( "edit Heading" ));
   1.548 +	a->setShortcut (Qt::Key_Return );
   1.549 +	//a->setShortcutContext (Qt::WindowShortcut);
   1.550 +	addAction (a);
   1.551 +    connect( a, SIGNAL( triggered() ), this, SLOT( editHeading() ) );
   1.552  	actionListBranches.append(a);
   1.553 +	editMenu->addAction (a);
   1.554  	actionEditHeading=a;
   1.555 -    a = new QAction( tr( "edit Heading" ),tr( "Edit heading" ), Key_F2, this, "editHeading" );
   1.556 -    connect( a, SIGNAL( activated() ), this, SLOT( editHeading() ) );
   1.557 -	a->setEnabled (false);
   1.558 -	actionEditHeading=a;
   1.559 +    a = new QAction( tr( "Edit heading" ), this);
   1.560 +	a->setStatusTip (tr( "edit Heading" ));
   1.561 +	a->setShortcut ( Qt::Key_F2 );
   1.562 +	a->setShortcutContext (Qt::WindowShortcut);
   1.563 +	addAction (a);
   1.564 +    connect( a, SIGNAL( triggered() ), this, SLOT( editHeading() ) );
   1.565  	actionListBranches.append(a);
   1.566      
   1.567      // Shortcut to delete selection
   1.568 -    a = new QAction( tr( "Delete Selection" ),tr( "Delete Selection" ), Key_Delete, this, "deleteBranch" );
   1.569 -    connect( a, SIGNAL( activated() ), this, SLOT( editDeleteSelection() ) );
   1.570 -	a->setEnabled (false);
   1.571 +    a = new QAction( tr( "Delete Selection" ),this);
   1.572 +	a->setStatusTip (tr( "Delete Selection" ));
   1.573 +	a->setShortcut ( Qt::Key_Delete);
   1.574 +	a->setShortcutContext (Qt::WindowShortcut);
   1.575 +	addAction (a);
   1.576 +    connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteSelection() ) );
   1.577  	actionEditDelete=a;
   1.578      
   1.579      // Shortcut to add branch
   1.580 -	alt = new QAction( tr( "Add a branch as child of selection" ),QPixmap(iconPath+"newbranch.png"),tr( "Add branch as child" ), Key_A, this, "newBranch" );
   1.581 -    connect( alt, SIGNAL( activated() ), this, SLOT( editNewBranch() ) );
   1.582 -		a = new QAction( tr( "Add a branch as child of selection" ),QPixmap(iconPath+"newbranch.png"),tr( "Add branch as child" ), Key_Insert, this, "newBranch" );
   1.583 -    connect( a, SIGNAL( activated() ), this, SLOT( editNewBranch() ) );
   1.584 -	a->setEnabled (false);
   1.585 +	alt = new QAction(QPixmap(iconPath+"newbranch.png"), tr( "Add branch as child" ), this);
   1.586 +	alt->setStatusTip ( tr( "Add a branch as child of selection" ));
   1.587 +	alt->setShortcut (Qt::Key_A);
   1.588 +	alt->setShortcutContext (Qt::WindowShortcut);
   1.589 +	addAction (alt);
   1.590 +	connect( alt, SIGNAL( triggered() ), this, SLOT( editNewBranch() ) );
   1.591 +	a = new QAction(QPixmap(iconPath+"newbranch.png"), tr( "Add branch as child" ), this);
   1.592 +	a->setStatusTip ( tr( "Add a branch as child of selection" ));
   1.593 +	a->setShortcut (Qt::Key_Insert);	
   1.594 +	connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranch() ) );
   1.595  	actionListBranches.append(a);
   1.596  	#if defined (Q_OS_MACX)
   1.597 -		// In OSX show different shortcut in menues, the keys work independtly always			
   1.598 +		// In OSX show different shortcut in menues, the keys work indepently always			
   1.599  		actionEditAddBranch=alt;
   1.600  	#else	
   1.601  		actionEditAddBranch=a;
   1.602  	#endif	
   1.603 -    actionEditAddBranch->addTo( menu );
   1.604 -    actionEditAddBranch->addTo( tb );
   1.605 +	editMenu->addAction (actionEditAddBranch);
   1.606 +	tb->addAction (actionEditAddBranch);
   1.607 +
   1.608  
   1.609      // Add branch by inserting it at selection
   1.610 -	a = new QAction( tr( "Add a branch by inserting and making selection its child" ),tr( "Add branch (insert)" ), ALT + Key_Insert, this, "newBranchHere" );
   1.611 -    connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchHere() ) );
   1.612 +	a = new QAction(tr( "Add branch (insert)" ), this);
   1.613 +	a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" ));
   1.614 +	a->setShortcut (Qt::ALT + Qt::Key_Insert );
   1.615 +	a->setShortcutContext (Qt::WindowShortcut);
   1.616 +	addAction (a);
   1.617 +    connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchHere() ) );
   1.618  	a->setEnabled (false);
   1.619  	actionListBranches.append(a);
   1.620  	actionEditAddBranchHere=a;
   1.621 -	a = new QAction( tr( "Add a branch by inserting and making selection its child" ),tr( "Add branch (insert)" ), ALT + Key_A, this, "newBranchHere" );
   1.622 -    connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchHere() ) );
   1.623 +	a = new QAction(tr( "Add branch (insert)" ),this);
   1.624 +	a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" ));
   1.625 +	a->setShortcut ( Qt::ALT + Qt::Key_A );
   1.626 +	a->setShortcutContext (Qt::WindowShortcut);
   1.627 +	addAction (a);
   1.628 +    connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchHere() ) );
   1.629  	actionListBranches.append(a);
   1.630  
   1.631  	// Add branch above
   1.632 -    a = new QAction( tr( "Add a branch above selection" ),tr( "Add branch above" ), SHIFT+Key_Insert, this, "newBranch" );
   1.633 -    connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchAbove() ) );
   1.634 +    a = new QAction(tr( "Add branch above" ), this);
   1.635 +	a->setStatusTip ( tr( "Add a branch above selection" ));
   1.636 +	a->setShortcut (Qt::SHIFT+Qt::Key_Insert );
   1.637 +	a->setShortcutContext (Qt::WindowShortcut);
   1.638 +	addAction (a);
   1.639 +    connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchAbove() ) );
   1.640  	a->setEnabled (false);
   1.641  	actionListBranches.append(a);
   1.642  	actionEditAddBranchAbove=a;
   1.643 -    a = new QAction( tr( "Add a branch above selection" ),tr( "Add branch above" ), SHIFT+Key_A, this, "newBranch" );
   1.644 -    connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchAbove() ) );
   1.645 +    a = new QAction(tr( "Add branch above" ), this);
   1.646 +	a->setStatusTip ( tr( "Add a branch above selection" ));
   1.647 +	a->setShortcut (Qt::SHIFT+Qt::Key_A );
   1.648 +	a->setShortcutContext (Qt::WindowShortcut);
   1.649 +	addAction (a);
   1.650 +    connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchAbove() ) );
   1.651  	actionListBranches.append(a);
   1.652  
   1.653  	// Add branch below 
   1.654 -    a = new QAction( tr( "Add a branch below selection" ),tr( "Add branch below" ), CTRL +Key_Insert, this, "newBranch" );
   1.655 -    connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchBelow() ) );
   1.656 +    a = new QAction(tr( "Add branch below" ), this);
   1.657 +	a->setStatusTip ( tr( "Add a branch below selection" ));
   1.658 +	a->setShortcut (Qt::CTRL +Qt::Key_Insert );
   1.659 +	a->setShortcutContext (Qt::WindowShortcut);
   1.660 +	addAction (a);
   1.661 +    connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBelow() ) );
   1.662  	a->setEnabled (false);
   1.663  	actionListBranches.append(a);
   1.664  	actionEditAddBranchBelow=a;
   1.665 -    a = new QAction( tr( "Add a branch below selection" ),tr( "Add branch below" ), CTRL +Key_A, this, "newBranch" );
   1.666 -    connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchBelow() ) );
   1.667 +    a = new QAction(tr( "Add branch below" ), this);
   1.668 +	a->setStatusTip ( tr( "Add a branch below selection" ));
   1.669 +	a->setShortcut (Qt::CTRL +Qt::Key_A );
   1.670 +	a->setShortcutContext (Qt::WindowShortcut);
   1.671 +	addAction (a);
   1.672 +    connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBelow() ) );
   1.673  	actionListBranches.append(a);
   1.674  
   1.675 -    a = new QAction( tr( "Move branch up" ), QPixmap(iconPath+"up.png" ), tr( "Move up" ), Key_PageUp, this, "editMoveUp" );
   1.676 -    connect( a, SIGNAL( activated() ), this, SLOT( editMoveUp() ) );
   1.677 +    a = new QAction(QPixmap(iconPath+"up.png" ), tr( "Move up" ), this);
   1.678 +	a->setStatusTip ( tr( "Move branch up" ) );
   1.679 +	a->setShortcut (Qt::Key_PageUp );
   1.680  	a->setEnabled (false);
   1.681 -    a->addTo( tb );
   1.682 -    a->addTo( menu );
   1.683 +    tb->addAction (a);
   1.684 +	editMenu->addAction (a);
   1.685 +    connect( a, SIGNAL( triggered() ), this, SLOT( editMoveUp() ) );
   1.686  	actionEditMoveUp=a;
   1.687  
   1.688 -    a = new QAction( tr( "Move branch down" ), QPixmap( iconPath+"down.png"), tr( "Move down" ), Key_PageDown, this, "editMoveDown" );
   1.689 -    connect( a, SIGNAL( activated() ), this, SLOT( editMoveDown() ) );
   1.690 +    a = new QAction( QPixmap( iconPath+"down.png"), tr( "Move down" ),this);
   1.691 +    connect( a, SIGNAL( triggered() ), this, SLOT( editMoveDown() ) );
   1.692 +	a->setStatusTip (tr( "Move branch down" ) );
   1.693 +	a->setShortcut ( Qt::Key_PageDown );
   1.694  	a->setEnabled (false);
   1.695 -    a->addTo( tb );
   1.696 -    a->addTo( menu );
   1.697 +    tb->addAction (a);
   1.698 +	editMenu->addAction (a);
   1.699  	actionEditMoveDown=a;
   1.700  	
   1.701  
   1.702 -	a = new QAction( tr( "Scroll branch" ), QPixmap(flagsPath+"flag-scrolled-right.png"), tr( "Scroll branch" ), Key_ScrollLock, this, "scroll" );
   1.703 -    connect( a, SIGNAL( activated() ), this, SLOT( editToggleScroll() ) );
   1.704 -	alt = new QAction( tr( "Scroll branch" ), QPixmap(flagsPath+"flag-scrolled-right.png"), tr( "Scroll branch" ), Key_S, this, "scroll" );
   1.705 -    connect( alt, SIGNAL( activated() ), this, SLOT( editToggleScroll() ) );
   1.706 +	a = new QAction( QPixmap(flagsPath+"flag-scrolled-right.png"), tr( "Scroll branch" ),this);
   1.707 +	a->setShortcut ( Qt::Key_ScrollLock );
   1.708 +	a->setStatusTip (tr( "Scroll branch" ) );
   1.709 +    connect( a, SIGNAL( triggered() ), this, SLOT( editToggleScroll() ) );
   1.710 +	alt = new QAction( QPixmap(flagsPath+"flag-scrolled-right.png"), tr( "Scroll branch" ), this);
   1.711 +	alt->setShortcut ( Qt::Key_S );
   1.712 +	alt->setStatusTip (tr( "Scroll branch" )); 
   1.713 +    connect( alt, SIGNAL( triggered() ), this, SLOT( editToggleScroll() ) );
   1.714  	#if defined(Q_OS_MACX)
   1.715  		actionEditToggleScroll=alt;
   1.716  	#else	
   1.717 @@ -531,147 +651,215 @@
   1.718  	#endif	
   1.719  	actionEditToggleScroll->setEnabled (false);
   1.720  	actionEditToggleScroll->setToggleAction(true);
   1.721 -    actionEditToggleScroll->addTo( tb );
   1.722 -    actionEditToggleScroll->addTo( menu );
   1.723 +    tb->addAction (actionEditToggleScroll);
   1.724 +    editMenu->addAction ( actionEditToggleScroll);
   1.725 +	editMenu->addAction (actionEditToggleScroll);
   1.726  	actionListBranches.append(actionEditToggleScroll);
   1.727  	
   1.728 -    a = new QAction( tr( "Unscroll all" ), QPixmap(), tr( "Unscroll all scrolled branches" ), 0, this, "scroll" );
   1.729 -    connect( a, SIGNAL( activated() ), this, SLOT( editUnScrollAll() ) );
   1.730 -    a->addTo( menu );
   1.731 +    a = new QAction( tr( "Unscroll all scrolled branches" ), this);
   1.732 +	a->setStatusTip (tr( "Unscroll all" ));
   1.733 +	editMenu->addAction (a);
   1.734 +    connect( a, SIGNAL( triggered() ), this, SLOT( editUnScrollAll() ) );
   1.735  	
   1.736 -    menu->insertSeparator();
   1.737 -
   1.738 -	a = new QAction( tr( "Find" ), QPixmap(iconPath+"find.png"), tr( "Find"+QString("...") ), CTRL + Key_F, this, "find" );
   1.739 -    connect( a, SIGNAL( activated() ), this, SLOT( editOpenFindWindow() ) );
   1.740 -    a->addTo( menu );
   1.741 +	editMenu->addSeparator();
   1.742 +
   1.743 +	a = new QAction( QPixmap(iconPath+"find.png"), tr( "Find"+QString("...") ), this);
   1.744 +	a->setStatusTip (tr( "Find" ) );
   1.745 +	a->setShortcut (Qt::CTRL + Qt::Key_F );
   1.746 +	editMenu->addAction (a);
   1.747 +    connect( a, SIGNAL( triggered() ), this, SLOT( editOpenFindWindow() ) );
   1.748      
   1.749 -	menu->insertSeparator();
   1.750 -
   1.751 -	a = new QAction( tr( "Open URL" ), QPixmap(flagsPath+"flag-url.png"), tr( "Open URL" ), CTRL + Key_U, this, "url" );
   1.752 -    connect( a, SIGNAL( activated() ), this, SLOT( editOpenURL() ) );
   1.753 -    a->addTo( tb );
   1.754 -	a->setEnabled (false);
   1.755 +	editMenu->addSeparator();
   1.756 +
   1.757 +	a = new QAction( QPixmap(flagsPath+"flag-url.png"), tr( "Open URL" ), this);
   1.758 +	a->setShortcut (Qt::CTRL + Qt::Key_U );
   1.759 +	a->setShortcut (tr( "Open URL" ));
   1.760 +    tb->addAction (a);
   1.761 +	addAction(a);
   1.762 +    connect( a, SIGNAL( triggered() ), this, SLOT( editOpenURL() ) );
   1.763  	actionEditOpenURL=a;
   1.764  
   1.765 -	a = new QAction( tr( "Open URL in new tab" ), QPixmap(), tr( "Open URL in new tab" ), CTRL + Key_U, this, "urltab" );
   1.766 -    connect( a, SIGNAL( activated() ), this, SLOT( editOpenURLTab() ) );
   1.767 -	a->setEnabled (false);
   1.768 +	a = new QAction( tr( "Open URL in new tab" ), this);
   1.769 +	a->setStatusTip (tr( "Open URL in new tab" ));
   1.770 +	a->setShortcut (Qt::CTRL+Qt::Key_U );
   1.771 +	addAction(a);
   1.772 +    connect( a, SIGNAL( triggered() ), this, SLOT( editOpenURLTab() ) );
   1.773  	actionEditOpenURLTab=a;
   1.774  
   1.775 -	a = new QAction( tr( "Edit URL" ), QPixmap(), tr( "Edit URL"+QString("...") ), SHIFT + CTRL + Key_U, this, "url" );
   1.776 -    connect( a, SIGNAL( activated() ), this, SLOT( editURL() ) );
   1.777 +	a = new QAction( tr( "Open all URLs in subtree" ), this);
   1.778 +	a->setStatusTip (tr( "Open all URLs in subtree" ));
   1.779 +	addAction(a);
   1.780 +	actionListBranches.append(a);
   1.781 +    connect( a, SIGNAL( triggered() ), this, SLOT( editOpenMultipleURLTabs() ) );
   1.782 +	actionEditOpenMultipleURLTabs=a;
   1.783 +
   1.784 +	a = new QAction(QPixmap(), tr( "Edit URL"+QString("...") ), this);
   1.785 +	a->setStatusTip ( tr( "Edit URL" ) );
   1.786 +	a->setShortcut (Qt::SHIFT + Qt::CTRL + Qt::Key_U );
   1.787 +	//a->setShortcut ( Qt::Key_U );
   1.788 +	a->setShortcutContext (Qt::WindowShortcut);
   1.789 +	actionListBranches.append(a);
   1.790 +	addAction(a);
   1.791 +    connect( a, SIGNAL( triggered() ), this, SLOT( editURL() ) );
   1.792 +	actionEditURL=a;
   1.793 +	
   1.794 +	a = new QAction( tr( "Use heading for URL" ), this);
   1.795 +	a->setStatusTip ( tr( "Use heading of selected branch as URL" ));
   1.796  	a->setEnabled (false);
   1.797  	actionListBranches.append(a);
   1.798 -	actionEditURL=a;
   1.799 -	
   1.800 -	a = new QAction( tr( "Use heading of selected branch as URL" ), QPixmap(), tr( "Use heading for URL" ), 0, this, "heading2url" );
   1.801 -    connect( a, SIGNAL( activated() ), this, SLOT( editHeading2URL() ) );
   1.802 +    connect( a, SIGNAL( triggered() ), this, SLOT( editHeading2URL() ) );
   1.803 +	actionEditHeading2URL=a;
   1.804 +    
   1.805 +	a = new QAction(tr( "Create URL to Bugzilla" ), this);
   1.806 +	a->setStatusTip ( tr( "Create URL to Bugzilla" ));
   1.807  	a->setEnabled (false);
   1.808  	actionListBranches.append(a);
   1.809 -	actionEditHeading2URL=a;
   1.810 +    connect( a, SIGNAL( triggered() ), this, SLOT( editBugzilla2URL() ) );
   1.811 +	actionEditBugzilla2URL=a;
   1.812      
   1.813 -	a = new QAction( tr( "Create URL to Bugzilla" ), QPixmap(), tr( "Create URL to Bugzilla" ), 0, this, "bugzilla2url" );
   1.814 -    connect( a, SIGNAL( activated() ), this, SLOT( editBugzilla2URL() ) );
   1.815 +	a = new QAction(tr( "Create URL to FATE" ), this);
   1.816 +	a->setStatusTip ( tr( "Create URL to FATE" ));
   1.817  	a->setEnabled (false);
   1.818  	actionListBranches.append(a);
   1.819 -	actionEditBugzilla2URL=a;
   1.820 -    
   1.821 -	a = new QAction( tr( "Create URL to FATE" ), QPixmap(), tr( "Create URL to FATE" ), 0, this, "FATE2url" );
   1.822 -    connect( a, SIGNAL( activated() ), this, SLOT( editFATE2URL() ) );
   1.823 +    connect( a, SIGNAL( triggered() ), this, SLOT( editFATE2URL() ) );
   1.824 +	actionEditFATE2URL=a;
   1.825 +	
   1.826 +    a = new QAction(QPixmap(flagsPath+"flag-vymlink.png"), tr( "Open xlinked map" ), this);
   1.827 +	a->setStatusTip ( tr( "Jump to another vym map, if needed load it first" ));
   1.828 +    tb->addAction (a);
   1.829 +	a->setEnabled (false);
   1.830 +    connect( a, SIGNAL( triggered() ), this, SLOT( editOpenVymLink() ) );
   1.831 +	actionEditOpenVymLink=a;
   1.832 +	
   1.833 +    a = new QAction(QPixmap(), tr( "Open all vym links in subtree" ), this);
   1.834 +	a->setStatusTip ( tr( "Open all vym links in subtree" ));
   1.835  	a->setEnabled (false);
   1.836  	actionListBranches.append(a);
   1.837 -	actionEditFATE2URL=a;
   1.838 +    connect( a, SIGNAL( triggered() ), this, SLOT( editOpenMultipleVymLinks() ) );
   1.839 +	actionEditOpenMultipleVymLinks=a;
   1.840  	
   1.841 -    a = new QAction( tr( "Jump to another vym map, if needed load it first" ), QPixmap(flagsPath+"flag-vymlink.png"), tr( "Jump to map" ), 0, this, "jumpMap" );
   1.842 -    connect( a, SIGNAL( activated() ), this, SLOT( editOpenVymLink() ) );
   1.843 -    a->addTo( tb );
   1.844 +
   1.845 +    a = new QAction(tr( "Edit vym link"+QString("...") ), this);
   1.846  	a->setEnabled (false);
   1.847 -	actionEditOpenVymLink=a;
   1.848 -	
   1.849 -    a = new QAction( tr( "Edit link to another vym map" ), QPixmap(), tr( "Edit vym link"+QString("...") ), 0, this, "editLinkMap" );
   1.850 -    connect( a, SIGNAL( activated() ), this, SLOT( editVymLink() ) );
   1.851 -	a->setEnabled (false);
   1.852 +	a->setStatusTip ( tr( "Edit link to another vym map" ));
   1.853 +    connect( a, SIGNAL( triggered() ), this, SLOT( editVymLink() ) );
   1.854  	actionListBranches.append(a);
   1.855  	actionEditVymLink=a;
   1.856  
   1.857 -    a = new QAction( tr( "Delete link to another vym map" ), QPixmap(), tr( "Delete vym link" ), 0, this, "deleteLinkMap" );
   1.858 -    connect( a, SIGNAL( activated() ), this, SLOT( editDeleteVymLink() ) );
   1.859 +    a = new QAction(tr( "Delete vym link" ),this);
   1.860 +	a->setStatusTip ( tr( "Delete link to another vym map" ));
   1.861  	a->setEnabled (false);
   1.862 +    connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteVymLink() ) );
   1.863  	actionEditDeleteVymLink=a;
   1.864  
   1.865 -    a = new QAction( tr( "Hide object in exports" ), QPixmap(flagsPath+"flag-hideexport.png"), tr( "Hide in exports" ), Key_H, this, "hideExport" );
   1.866 -    connect( a, SIGNAL( activated() ), this, SLOT( editToggleHideExport() ) );
   1.867 +    a = new QAction(QPixmap(flagsPath+"flag-hideexport.png"), tr( "Hide in exports" ), this);
   1.868 +	a->setStatusTip ( tr( "Hide object in exports" ) );
   1.869 +	a->setShortcut (Qt::Key_H );
   1.870  	a->setToggleAction(true);
   1.871 -    a->addTo( tb );
   1.872 +    tb->addAction (a);
   1.873  	a->setEnabled (false);
   1.874 +    connect( a, SIGNAL( triggered() ), this, SLOT( editToggleHideExport() ) );
   1.875  	actionEditToggleHideExport=a;
   1.876  
   1.877 -    a = new QAction( tr( "Edit Map Info" ), QPixmap(), tr( "Edit Map Info"+QString("...") ), 0, this, "editMapInfo" );
   1.878 -    connect( a, SIGNAL( activated() ), this, SLOT( editMapInfo() ) );
   1.879 +    a = new QAction(tr( "Edit Map Info"+QString("...") ),this);
   1.880 +	a->setStatusTip ( tr( "Edit Map Info" ));
   1.881  	a->setEnabled (true);
   1.882 +    connect( a, SIGNAL( triggered() ), this, SLOT( editMapInfo() ) );
   1.883  	actionEditMapInfo=a;
   1.884  
   1.885 -	menu->insertSeparator();
   1.886 +	editMenu->addSeparator();
   1.887  
   1.888  	// Import at selection (adding to selection)
   1.889 -    a = new QAction( tr( "Add map at selection" ),tr( "Add map (insert)" ), 0, this, "importAdd" );
   1.890 -    connect( a, SIGNAL( activated() ), this, SLOT( editImportAdd() ) );
   1.891 +    a = new QAction( tr( "Add map (insert)" ),this);
   1.892 +	a->setStatusTip (tr( "Add map at selection" ));
   1.893 +    connect( a, SIGNAL( triggered() ), this, SLOT( editImportAdd() ) );
   1.894  	a->setEnabled (false);
   1.895  	actionListBranches.append(a);
   1.896  	actionEditImportAdd=a;
   1.897  
   1.898  	// Import at selection (replacing selection)
   1.899 -    a = new QAction( tr( "Replace selection with map" ),tr( "Add map (replace)" ), 0, this, "importReplace" );
   1.900 -    connect( a, SIGNAL( activated() ), this, SLOT( editImportReplace() ) );
   1.901 +    a = new QAction( tr( "Add map (replace)" ), this);
   1.902 +	a->setStatusTip (tr( "Replace selection with map" ));
   1.903 +    connect( a, SIGNAL( triggered() ), this, SLOT( editImportReplace() ) );
   1.904  	a->setEnabled (false);
   1.905  	actionListBranches.append(a);
   1.906  	actionEditImportReplace=a;
   1.907  
   1.908  	// Save selection 
   1.909 -    a = new QAction( tr( "Save selection" ),tr( "Save selection" ), 0, this, "saveSelection" );
   1.910 -    connect( a, SIGNAL( activated() ), this, SLOT( editSaveBranch() ) );
   1.911 +    a = new QAction( tr( "Save selection" ), this);
   1.912 +	a->setStatusTip (tr( "Save selection" ));
   1.913 +    connect( a, SIGNAL( triggered() ), this, SLOT( editSaveBranch() ) );
   1.914  	a->setEnabled (false);
   1.915  	actionListBranches.append(a);
   1.916  	actionEditSaveBranch=a;
   1.917  
   1.918  	// Only remove branch, not its childs
   1.919 -    a = new QAction( tr( "Remove only branch and keep its childs" ),tr( "Remove only branch " ), ALT + Key_Delete, this, "removeBranchHere" );
   1.920 -    connect( a, SIGNAL( activated() ), this, SLOT( editRemoveBranchKeepChilds() ) );
   1.921 +    a = new QAction(tr( "Remove only branch " ), this);
   1.922 +	a->setStatusTip ( tr( "Remove only branch and keep its childs" ));
   1.923 +	a->setShortcut (Qt::ALT + Qt::Key_Delete );
   1.924 +    connect( a, SIGNAL( triggered() ), this, SLOT( editRemoveBranchKeepChilds() ) );
   1.925  	a->setEnabled (false);
   1.926  	actionListBranches.append(a);
   1.927  	actionEditRemoveBranchKeepChilds=a;
   1.928  
   1.929  	// Only remove childs of a branch
   1.930 -    a = new QAction( tr( "Remove childs of branch" ),tr( "Remove childs" ), SHIFT + Key_Delete, this, "removeBranchChilds" );
   1.931 -    connect( a, SIGNAL( activated() ), this, SLOT( editRemoveChilds() ) );
   1.932 +    a = new QAction( tr( "Remove childs" ), this);
   1.933 +	a->setStatusTip (tr( "Remove childs of branch" ));
   1.934 +	a->setShortcut (Qt::SHIFT + Qt::Key_Delete );
   1.935 +    connect( a, SIGNAL( triggered() ), this, SLOT( editRemoveChilds() ) );
   1.936  	a->setEnabled (false);
   1.937  	actionListBranches.append(a);
   1.938  	actionEditRemoveChilds=a;
   1.939  
   1.940      // Shortcuts for navigating with cursor:
   1.941 -    a = new QAction( tr( "Select upper branch" ),tr( "Select upper branch" ), Key_Up, this, "upperBranch" );
   1.942 -    connect( a, SIGNAL( activated() ), this, SLOT( editUpperBranch() ) );
   1.943 -    a = new QAction( tr( "Select lower branch" ),tr( "Select lower branch" ), Key_Down, this, "lowerBranch" );
   1.944 -    connect( a, SIGNAL( activated() ), this, SLOT( editLowerBranch() ) );
   1.945 -    a = new QAction( tr( "Select left branch" ),tr( "Select left branch" ), Key_Left, this, "upperBranch" );
   1.946 -    connect( a, SIGNAL( activated() ), this, SLOT( editLeftBranch() ) );
   1.947 -    a = new QAction( tr( "Select right branch" ),tr( "Select child branch" ), Key_Right, this, "rightBranch" );
   1.948 -    connect( a, SIGNAL( activated() ), this, SLOT( editRightBranch() ) );
   1.949 -    a = new QAction( tr( "Select first branch" ),tr( "Select first branch" ), Key_Home, this, "firstBranch" );
   1.950 +    a = new QAction(tr( "Select upper branch" ), this);
   1.951 +	a->setStatusTip ( tr( "Select upper branch" ));
   1.952 +	a->setShortcut (Qt::Key_Up );
   1.953 +	a->setShortcutContext (Qt::WindowShortcut);
   1.954 +	addAction (a);
   1.955 +    connect( a, SIGNAL( triggered() ), this, SLOT( editUpperBranch() ) );
   1.956 +    a = new QAction( tr( "Select lower branch" ),this);
   1.957 +	a->setStatusTip (tr( "Select lower branch" ));
   1.958 +	a->setShortcut ( Qt::Key_Down );
   1.959 +	a->setShortcutContext (Qt::WindowShortcut);
   1.960 +	addAction (a);
   1.961 +    connect( a, SIGNAL( triggered() ), this, SLOT( editLowerBranch() ) );
   1.962 +    a = new QAction(tr( "Select left branch" ), this);
   1.963 +	a->setStatusTip ( tr( "Select left branch" ));
   1.964 +	a->setShortcut (Qt::Key_Left );
   1.965 +	a->setShortcutContext (Qt::WindowShortcut);
   1.966 +	addAction (a);
   1.967 +    connect( a, SIGNAL( triggered() ), this, SLOT( editLeftBranch() ) );
   1.968 +    a = new QAction( tr( "Select child branch" ), this);
   1.969 +	a->setStatusTip (tr( "Select right branch" ));
   1.970 +	a->setShortcut (Qt::Key_Right);
   1.971 +	a->setShortcutContext (Qt::WindowShortcut);
   1.972 +	addAction (a);
   1.973 +    connect( a, SIGNAL( triggered() ), this, SLOT( editRightBranch() ) );
   1.974 +    a = new QAction( tr( "Select first branch" ), this);
   1.975 +	a->setStatusTip (tr( "Select first branch" ));
   1.976 +	a->setShortcut (Qt::Key_Home );
   1.977 +	a->setShortcutContext (Qt::WindowShortcut);
   1.978 +	addAction (a);
   1.979  	a->setEnabled (false);
   1.980 -    a->addTo ( menu );
   1.981 +	editMenu->addAction (a);
   1.982  	actionListBranches.append(a);
   1.983  	actionEditSelectFirst=a;
   1.984 -    connect( a, SIGNAL( activated() ), this, SLOT( editFirstBranch() ) );
   1.985 -    a = new QAction( tr( "Select last branch" ),tr( "Select last branch" ), Key_End, this, "lastBranch" );
   1.986 -    connect( a, SIGNAL( activated() ), this, SLOT( editLastBranch() ) );
   1.987 +    connect( a, SIGNAL( triggered() ), this, SLOT( editFirstBranch() ) );
   1.988 +    a = new QAction( tr( "Select last branch" ),this);
   1.989 +	a->setStatusTip (tr( "Select last branch" ));
   1.990 +	a->setShortcut ( Qt::Key_End );
   1.991 +	a->setShortcutContext (Qt::WindowShortcut);
   1.992 +	addAction (a);
   1.993 +    connect( a, SIGNAL( triggered() ), this, SLOT( editLastBranch() ) );
   1.994  	a->setEnabled (false);
   1.995 -    a->addTo ( menu );
   1.996 +	editMenu->addAction (a);
   1.997  	actionListBranches.append(a);
   1.998  	actionEditSelectLast=a;
   1.999  
  1.1000 -    a = new QAction( tr( "Add Image" ),tr( "Add Image" )+QString("..."), 0, this, "loadImage" );
  1.1001 -    connect( a, SIGNAL( activated() ), this, SLOT( editLoadImage() ) );
  1.1002 +    a = new QAction( tr( "Add Image" )+QString("..."), this);
  1.1003 +	a->setStatusTip (tr( "Add Image" ));
  1.1004 +    connect( a, SIGNAL( triggered() ), this, SLOT( editLoadImage() ) );
  1.1005  	actionEditLoadImage=a;
  1.1006  
  1.1007  }
  1.1008 @@ -679,147 +867,194 @@
  1.1009  // Format Actions
  1.1010  void Main::setupFormatActions()
  1.1011  {
  1.1012 -    QPopupMenu *menu = new QPopupMenu( this );
  1.1013 -    menuBar()->insertItem( tr( "F&ormat" ), menu );
  1.1014 -
  1.1015 -    QToolBar *tb = new QToolBar( this );
  1.1016 +    QMenu *formatMenu = menuBar()->addMenu (tr ("F&ormat"));
  1.1017 +
  1.1018 +    QToolBar *tb = addToolBar( tr("Format Actions","Toolbars"));
  1.1019 +	tb->setObjectName ("formatTB");
  1.1020      QAction *a;
  1.1021      QPixmap pix( 16,16);
  1.1022 -    pix.fill (black);
  1.1023 -    actionFormatColor= new QAction( tr( "Set Color" ), pix, tr( "Set &Color" )+QString("..."), 0, this, "formatColor" );
  1.1024 -    connect( actionFormatColor, SIGNAL( activated() ), this, SLOT( formatSelectColor() ) );
  1.1025 -    actionFormatColor->addTo( tb );
  1.1026 -    actionFormatColor->addTo( menu );
  1.1027 -    a= new QAction( tr( "Pick color\nHint: You can pick a color from another branch and color using CTRL+Left Button" ), QPixmap(iconPath+"formatcolorpicker.png"), tr( "Pic&k color" ), CTRL + Key_K, this, "pickColor" );
  1.1028 -    connect( a, SIGNAL( activated() ), this, SLOT( formatPickColor() ) );
  1.1029 +    pix.fill (Qt::black);
  1.1030 +    a= new QAction(pix, tr( "Set &Color" )+QString("..."), this);
  1.1031 +	a->setStatusTip ( tr( "Set Color" ));
  1.1032 +    connect( a, SIGNAL( triggered() ), this, SLOT( formatSelectColor() ) );
  1.1033 +    a->addTo( tb );
  1.1034 +	formatMenu->addAction (a);
  1.1035 +	actionFormatColor=a;
  1.1036 +    a= new QAction( QPixmap(iconPath+"formatcolorpicker.png"), tr( "Pic&k color" ), this);
  1.1037 +	a->setStatusTip (tr( "Pick color\nHint: You can pick a color from another branch and color using CTRL+Left Button" ) );
  1.1038 +	a->setShortcut (Qt::CTRL + Qt::Key_K );
  1.1039 +    connect( a, SIGNAL( triggered() ), this, SLOT( formatPickColor() ) );
  1.1040  	a->setEnabled (false);
  1.1041      a->addTo( tb );
  1.1042 -    a->addTo( menu );
  1.1043 +	formatMenu->addAction (a);
  1.1044  	actionListBranches.append(a);
  1.1045  	actionFormatPickColor=a;
  1.1046 -    a= new QAction( tr( "Color branch" ), QPixmap(iconPath+"formatcoloritem.png"), tr( "Color &branch" ), CTRL + Key_I, this, "colorItem" );
  1.1047 -    connect( a, SIGNAL( activated() ), this, SLOT( formatColorItem() ) );
  1.1048 +
  1.1049 +    a= new QAction(QPixmap(iconPath+"formatcoloritem.png"), tr( "Color &branch" ), this);
  1.1050 +	a->setStatusTip ( tr( "Color branch" ) );
  1.1051 +	a->setShortcut (Qt::CTRL + Qt::Key_I);
  1.1052 +    connect( a, SIGNAL( triggered() ), this, SLOT( formatColorItem() ) );
  1.1053  	a->setEnabled (false);
  1.1054      a->addTo( tb );
  1.1055 -    a->addTo( menu );
  1.1056 +	formatMenu->addAction (a);
  1.1057  	actionListBranches.append(a);
  1.1058  	actionFormatColorBranch=a;
  1.1059 -    a= new QAction( tr( "Color Subtree" ), QPixmap(iconPath+"formatcolorbranch.png"), tr( "Color sub&tree" ), CTRL + Key_T, this, "colorBranch" );
  1.1060 -    connect( a, SIGNAL( activated() ), this, SLOT( formatColorBranch() ) );
  1.1061 +
  1.1062 +    a= new QAction(QPixmap(iconPath+"formatcolorbranch.png"), tr( "Color sub&tree" ), this);
  1.1063 +	a->setStatusTip ( tr( "Color Subtree" ));
  1.1064 +	a->setShortcut (Qt::CTRL + Qt::Key_T);
  1.1065 +    connect( a, SIGNAL( triggered() ), this, SLOT( formatColorBranch() ) );
  1.1066  	a->setEnabled (false);
  1.1067 -    a->addTo( menu );
  1.1068 +	formatMenu->addAction (a);
  1.1069      a->addTo( tb );
  1.1070  	actionListBranches.append(a);
  1.1071  	actionFormatColorSubtree=a;
  1.1072  
  1.1073 -    menu->insertSeparator();
  1.1074 -	actionGroupFormatLinkStyles=new QActionGroup ( this, "formatLinkStyles");
  1.1075 +	formatMenu->addSeparator();
  1.1076 +	actionGroupFormatLinkStyles=new QActionGroup ( this);
  1.1077  	actionGroupFormatLinkStyles->setExclusive (true);
  1.1078 -    a= new QAction( tr( "Line" ), QPixmap(), tr( "Linkstyle Line" ), 0, actionGroupFormatLinkStyles, "formatLinkStyleLine" );
  1.1079 +    a= new QAction( tr( "Linkstyle Line" ), actionGroupFormatLinkStyles);
  1.1080 +	a->setStatusTip (tr( "Line" ));
  1.1081  	a->setToggleAction(true);
  1.1082 -    connect( a, SIGNAL( activated() ), this, SLOT( formatLinkStyleLine() ) );
  1.1083 +    connect( a, SIGNAL( triggered() ), this, SLOT( formatLinkStyleLine() ) );
  1.1084 +	formatMenu->addAction (a);
  1.1085  	actionFormatLinkStyleLine=a;
  1.1086 -    a= new QAction( tr( "Line" ), QPixmap(), tr( "Linkstyle Parabel" ), 0, actionGroupFormatLinkStyles, "formatLinkStyleLine" );
  1.1087 +    a= new QAction( tr( "Linkstyle Parabel" ), actionGroupFormatLinkStyles);
  1.1088 +	a->setStatusTip (tr( "Line" ));
  1.1089  	a->setToggleAction(true);
  1.1090 -    connect( a, SIGNAL( activated() ), this, SLOT( formatLinkStyleParabel() ) );
  1.1091 +    connect( a, SIGNAL( triggered() ), this, SLOT( formatLinkStyleParabel() ) );
  1.1092 +	formatMenu->addAction (a);
  1.1093  	actionFormatLinkStyleParabel=a;
  1.1094 -    a= new QAction( tr( "PolyLine" ), QPixmap(), tr( "Linkstyle Thick Line" ), 0, actionGroupFormatLinkStyles, "formatLinkStyleLine" );
  1.1095 +    a= new QAction( tr( "Linkstyle Thick Line" ), actionGroupFormatLinkStyles );
  1.1096 +	a->setStatusTip (tr( "PolyLine" ));
  1.1097  	a->setToggleAction(true);
  1.1098 -    connect( a, SIGNAL( activated() ), this, SLOT( formatLinkStylePolyLine() ) );
  1.1099 +    connect( a, SIGNAL( triggered() ), this, SLOT( formatLinkStylePolyLine() ) );
  1.1100 +	formatMenu->addAction (a);
  1.1101  	actionFormatLinkStylePolyLine=a;
  1.1102 -    a= new QAction( tr( "PolyParabel" ), QPixmap(), tr( "Linkstyle Thick Parabel" ), 0, actionGroupFormatLinkStyles, "formatLinkStylePolyParabel" );
  1.1103 +    a= new QAction( tr( "Linkstyle Thick Parabel" ), actionGroupFormatLinkStyles);
  1.1104 +	a->setStatusTip (tr( "PolyParabel" ) );
  1.1105  	a->setToggleAction(true);
  1.1106 -    connect( a, SIGNAL( activated() ), this, SLOT( formatLinkStylePolyParabel() ) );
  1.1107 +	a->setChecked (true);
  1.1108 +    connect( a, SIGNAL( triggered() ), this, SLOT( formatLinkStylePolyParabel() ) );
  1.1109 +	formatMenu->addAction (a);
  1.1110  	actionFormatLinkStylePolyParabel=a;
  1.1111 -	actionGroupFormatLinkStyles->addTo (menu);
  1.1112  	
  1.1113 -	actionGroupFormatFrameTypes=new QActionGroup ( this, "formatFrameTypes");
  1.1114 +	actionGroupFormatFrameTypes=new QActionGroup ( this);
  1.1115  	actionGroupFormatFrameTypes->setExclusive (true);
  1.1116 -    a = new QAction( tr( "No Frame" ),tr( "No Frame" ), 0, actionGroupFormatFrameTypes, "frameNone" );
  1.1117 +    a = new QAction( tr( "No Frame" ), actionGroupFormatFrameTypes );
  1.1118 +	a->setStatusTip (tr("No Frame"));
  1.1119  	a->setToggleAction(true);
  1.1120 -    connect( a, SIGNAL( activated() ), this, SLOT( formatFrameNone() ) );
  1.1121 +    connect( a, SIGNAL( triggered() ), this, SLOT( formatFrameNone() ) );
  1.1122  	actionFormatFrameNone=a;
  1.1123 -    a = new QAction( tr( "Rectangle" ),tr( "Rectangle" ), 0, actionGroupFormatFrameTypes, "frameRectangle" );
  1.1124 +    a = new QAction( tr( "Rectangle" ), actionGroupFormatFrameTypes);
  1.1125 +	a->setStatusTip (tr( "Rectangle" ));
  1.1126  	a->setToggleAction(true);
  1.1127 -    connect( a, SIGNAL( activated() ), this, SLOT( formatFrameRectangle() ) );
  1.1128 +    connect( a, SIGNAL( triggered() ), this, SLOT( formatFrameRectangle() ) );
  1.1129  	actionFormatFrameRectangle=a;
  1.1130  
  1.1131 -    a = new QAction( tr ("Include top and bottom position of images into branch"), tr( "Include images vertically" ), 0, actionFormatIncludeImagesVer, "includeImagesVer" );
  1.1132 +    a = new QAction( tr( "Include images vertically" ),  actionFormatIncludeImagesVer);
  1.1133 +	a->setStatusTip ( tr ("Include top and bottom position of images into branch"));
  1.1134  	a->setToggleAction(true);
  1.1135 -    connect( a, SIGNAL( activated() ), this, SLOT( formatIncludeImagesVer() ) );
  1.1136 +    connect( a, SIGNAL( triggered() ), this, SLOT( formatIncludeImagesVer() ) );
  1.1137  	actionFormatIncludeImagesVer=a;
  1.1138  
  1.1139 -    a = new QAction( tr ("Include left and right position of images into branch"), tr( "Include images horizontally" ), 0, actionFormatIncludeImagesHor, "includeImagesHor" );
  1.1140 +    a = new QAction( tr( "Include images horizontally" ),  actionFormatIncludeImagesHor );
  1.1141 +	a->setStatusTip ( tr ("Include left and right position of images into branch"));
  1.1142  	a->setToggleAction(true);
  1.1143 -    connect( a, SIGNAL( activated() ), this, SLOT( formatIncludeImagesHor() ) );
  1.1144 +    connect( a, SIGNAL( triggered() ), this, SLOT( formatIncludeImagesHor() ) );
  1.1145  	actionFormatIncludeImagesHor=a;
  1.1146  
  1.1147 -    a = new QAction( tr( "Hide link" ),tr( "Hide link if object is not selected" ), 0, actionFormatHideLinkUnselected, "hideLinkUnselected" );
  1.1148 +    a = new QAction( tr( "Hide link if object is not selected" ), actionFormatHideLinkUnselected);
  1.1149 +	a->setStatusTip (tr( "Hide link" ));
  1.1150  	a->setToggleAction(true);
  1.1151 -    connect( a, SIGNAL( activated() ), this, SLOT( formatHideLinkUnselected() ) );
  1.1152 +    connect( a, SIGNAL( triggered() ), this, SLOT( formatHideLinkUnselected() ) );
  1.1153  	actionFormatHideLinkUnselected=a;
  1.1154  
  1.1155 -    menu->insertSeparator();
  1.1156 -    a= new QAction( tr( "Use same color for links and headings" ), QPixmap(), tr( "&Use color of heading for link" ), 0, this, "formatLinkColorHint" );
  1.1157 +	formatMenu->addSeparator();
  1.1158 +    a= new QAction( tr( "&Use color of heading for link" ),  this);
  1.1159 +	a->setStatusTip (tr( "Use same color for links and headings" ));
  1.1160  	a->setToggleAction(true);
  1.1161 -    connect( a, SIGNAL( activated() ), this, SLOT( formatToggleLinkColorHint() ) );
  1.1162 -	a->addTo( menu );
  1.1163 +    connect( a, SIGNAL( triggered() ), this, SLOT( formatToggleLinkColorHint() ) );
  1.1164 +	formatMenu->addAction (a);
  1.1165  	actionFormatLinkColorHint=a;
  1.1166 -    pix.fill (white);
  1.1167 -    actionFormatLinkColor= new QAction( tr( "Set Link Color" ), pix, tr( "Set &Link Color"+QString("...") ), 0, this, "formatLinkColor" );
  1.1168 -    connect( actionFormatLinkColor, SIGNAL( activated() ), this, SLOT( formatSelectLinkColor() ) );
  1.1169 -    actionFormatLinkColor->addTo( menu );
  1.1170 -    actionFormatBackColor= new QAction( tr( "Set Background Color" ), pix, tr( "Set &Background Color" )+QString("..."), 0, this, "formatBackColor" );
  1.1171 -    connect( actionFormatBackColor, SIGNAL( activated() ), this, SLOT( formatSelectBackColor() ) );
  1.1172 -    actionFormatBackColor->addTo( menu );
  1.1173 +
  1.1174 +    pix.fill (Qt::white);
  1.1175 +    a= new QAction( pix, tr( "Set &Link Color"+QString("...") ), this  );
  1.1176 +	a->setStatusTip (tr( "Set Link Color" ));
  1.1177 +	formatMenu->addAction (a);
  1.1178 +    connect( a, SIGNAL( triggered() ), this, SLOT( formatSelectLinkColor() ) );
  1.1179 +    actionFormatLinkColor=a;
  1.1180 +
  1.1181 +    a= new QAction( pix, tr( "Set &Background Color" )+QString("..."), this );
  1.1182 +	a->setStatusTip (tr( "Set Background Color" ));
  1.1183 +	formatMenu->addAction (a);
  1.1184 +    connect( a, SIGNAL( triggered() ), this, SLOT( formatSelectBackColor() ) );
  1.1185 +    actionFormatBackColor=a;
  1.1186  }
  1.1187  
  1.1188  // View Actions
  1.1189  void Main::setupViewActions()
  1.1190  {
  1.1191 -    QToolBar *tb = new QToolBar( this );
  1.1192 +    QToolBar *tb = addToolBar( tr("View Actions","Toolbars") );
  1.1193      tb->setLabel( "View Actions" );
  1.1194 -    QPopupMenu *menu = new QPopupMenu( this );
  1.1195 -    menuBar()->insertItem( tr( "&View" ), menu );
  1.1196 +	tb->setObjectName ("viewTB");
  1.1197 +    QMenu *viewMenu = menuBar()->addMenu ( tr( "&View" ));
  1.1198  
  1.1199      QAction *a;
  1.1200 -    a = new QAction( tr( "Zoom reset" ), QPixmap(iconPath+"viewmag-reset.png"), tr( "reset Zoom" ), CTRL + Key_0, this, "zoomReset" );
  1.1201 -    connect( a, SIGNAL( activated() ), this, SLOT(viewZoomReset() ) );
  1.1202 +    a = new QAction(QPixmap(iconPath+"viewmag-reset.png"), tr( "reset Zoom" ), this);
  1.1203 +	a->setStatusTip ( tr( "Zoom reset" ) );
  1.1204 +	a->setShortcut (Qt::CTRL + Qt::Key_0 );
  1.1205      a->addTo( tb );
  1.1206 -    a->addTo( menu );
  1.1207 -    a = new QAction( tr( "Zoom in" ), QPixmap(iconPath+"viewmag+.png"), tr( "Zoom in" ), CTRL + Key_Plus, this, "zoomIn" );
  1.1208 -    connect( a, SIGNAL( activated() ), this, SLOT(viewZoomIn() ) );
  1.1209 +	viewMenu->addAction (a);
  1.1210 +    connect( a, SIGNAL( triggered() ), this, SLOT(viewZoomReset() ) );
  1.1211 +	
  1.1212 +    a = new QAction( QPixmap(iconPath+"viewmag+.png"), tr( "Zoom in" ), this);
  1.1213 +	a->setStatusTip (tr( "Zoom in" ));
  1.1214 +	a->setShortcut (Qt::CTRL + Qt::Key_Plus);
  1.1215      a->addTo( tb );
  1.1216 -    a->addTo( menu );
  1.1217 -    a = new QAction( tr( "Zoom out" ), QPixmap(iconPath+"viewmag-.png"), tr( "Zoom out" ), CTRL + Key_Minus, this, "zoomOut" );
  1.1218 -    connect( a, SIGNAL( activated() ), this, SLOT( viewZoomOut() ) );
  1.1219 +	viewMenu->addAction (a);
  1.1220 +    connect( a, SIGNAL( triggered() ), this, SLOT(viewZoomIn() ) );
  1.1221 +	
  1.1222 +    a = new QAction( QPixmap(iconPath+"viewmag-.png"), tr( "Zoom out" ), this);
  1.1223 +	a->setStatusTip (tr( "Zoom out" ));
  1.1224 +	a->setShortcut (Qt::CTRL + Qt::Key_Minus );
  1.1225      a->addTo( tb );
  1.1226 -    a->addTo( menu );
  1.1227 -
  1.1228 -
  1.1229 -    a = new QAction( tr( "Show Note Editor" ), QPixmap(flagsPath+"flag-note.png"), tr( "Show Note Editor" ), CTRL + Key_E , this, "noteEditor" );
  1.1230 -    connect( a, SIGNAL( activated() ), this, SLOT(windowToggleNoteEditor() ) );
  1.1231 +	viewMenu->addAction (a);
  1.1232 +    connect( a, SIGNAL( triggered() ), this, SLOT( viewZoomOut() ) );
  1.1233 +
  1.1234 +
  1.1235 +    a = new QAction(QPixmap(flagsPath+"flag-note.png"), tr( "Show Note Editor" ),this);
  1.1236 +	a->setStatusTip ( tr( "Show Note Editor" ));
  1.1237 +	a->setShortcut ( Qt::CTRL + Qt::Key_E );
  1.1238  	a->setToggleAction(true);
  1.1239  	if (textEditor->showWithMain())
  1.1240  		a->setOn(true);
  1.1241  	else	
  1.1242  		a->setOn(false);
  1.1243      a->addTo( tb );
  1.1244 -    a->addTo( menu );
  1.1245 +	viewMenu->addAction (a);
  1.1246 +    connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleNoteEditor() ) );
  1.1247  	actionViewToggleNoteEditor=a;
  1.1248  
  1.1249 -    a = new QAction( tr( "Show history window" ), QPixmap(), tr( "Show history window" ), CTRL + Key_H , this, "historyWindow" );
  1.1250 -    connect( a, SIGNAL( activated() ), this, SLOT(windowToggleHistory() ) );
  1.1251 +    a = new QAction(  tr( "Show history window" ),this );
  1.1252 +	a->setStatusTip ( tr( "Show history window" ));
  1.1253 +	a->setShortcut ( Qt::CTRL + Qt::Key_H  );
  1.1254  	a->setToggleAction(false);
  1.1255 -    a->addTo( menu );
  1.1256 +	viewMenu->addAction (a);
  1.1257 +    connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleHistory() ) );
  1.1258  	actionViewToggleHistoryWindow=a;
  1.1259  
  1.1260 -    a = new QAction( tr( "&Next Window" ), QPixmap(), tr( "Next Window" ), ALT + Key_N , this, "nextWindow" );
  1.1261 -    connect( a, SIGNAL( activated() ), this, SLOT(windowNextEditor() ) );
  1.1262 -    a->addTo( menu );
  1.1263 -    a = new QAction( tr( "&Previous Window" ), QPixmap(), tr( "Previous Window" ), ALT + Key_P , this, "previousWindow" );
  1.1264 -    connect( a, SIGNAL( activated() ), this, SLOT(windowPreviousEditor() ) );
  1.1265 -    a->addTo( menu );
  1.1266 +    a = new QAction(tr( "Next Window" ), this);
  1.1267 +	a->setStatusTip ( tr( "&Next Window" ) );
  1.1268 +	a->setShortcut (Qt::ALT + Qt::Key_N );
  1.1269 +	viewMenu->addAction (a);
  1.1270 +    connect( a, SIGNAL( triggered() ), this, SLOT(windowNextEditor() ) );
  1.1271 +
  1.1272 +    a = new QAction (tr( "Previous Window" ), this );
  1.1273 +	a->setStatusTip (tr( "&Previous Window" ));
  1.1274 +	a->setShortcut (Qt::ALT + Qt::Key_P );
  1.1275 +	viewMenu->addAction (a);
  1.1276 +    connect( a, SIGNAL( triggered() ), this, SLOT(windowPreviousEditor() ) );
  1.1277  }
  1.1278  
  1.1279  // Mode Actions
  1.1280 @@ -828,23 +1063,29 @@
  1.1281      //QPopupMenu *menu = new QPopupMenu( this );
  1.1282      //menuBar()->insertItem( tr( "&Mode (using modifiers)" ), menu );
  1.1283  
  1.1284 -    QToolBar *tb = new QToolBar( this );
  1.1285 -    tb->setLabel( tr ("Modes when using modifiers") );
  1.1286 +    QToolBar *tb = addToolBar( tr ("Modes when using modifiers","Toolbars") );
  1.1287 +	tb->setObjectName ("modesTB");
  1.1288      QAction *a;
  1.1289 -	actionGroupModModes=new QActionGroup ( this, "formatLinkStyles");
  1.1290 +	actionGroupModModes=new QActionGroup ( this);
  1.1291  	actionGroupModModes->setExclusive (true);
  1.1292 -    a= new QAction( tr( "Use modifier to color branches" ), QPixmap(iconPath+"modecolor.png"), 0, Key_J, actionGroupModModes, "modModeColor" );
  1.1293 +    a= new QAction( QPixmap(iconPath+"modecolor.png"), tr( "Use modifier to color branches" ), actionGroupModModes);
  1.1294 +	a->setShortcut (Qt::Key_J);
  1.1295 +    a->setStatusTip ( tr( "Use modifier to color branches" ));
  1.1296  	a->setToggleAction(true);
  1.1297  	a->addTo (tb);
  1.1298  	a->setOn(true);
  1.1299  	actionModModeColor=a;
  1.1300  	
  1.1301 -    a= new QAction( tr( "Use modifier to copy" ), QPixmap(iconPath+"modecopy.png"), 0, Key_K, actionGroupModModes, "modModeCopy" );
  1.1302 +    a= new QAction( QPixmap(iconPath+"modecopy.png"), tr( "Use modifier to copy" ), actionGroupModModes );
  1.1303 +	a->setShortcut( Qt::Key_K); 
  1.1304 +    a->setStatusTip( tr( "Use modifier to copy" ));
  1.1305  	a->setToggleAction(true);
  1.1306  	a->addTo (tb);
  1.1307  	actionModModeCopy=a;
  1.1308  
  1.1309 -    a= new QAction( tr( "Use modifier to draw xLinks" ), QPixmap(iconPath+"modelink.png"), 0, Key_L, actionGroupModModes, "modModeLink" );
  1.1310 +    a= new QAction(QPixmap(iconPath+"modelink.png"), tr( "Use modifier to draw xLinks" ), actionGroupModModes );
  1.1311 +	a->setShortcut (Qt::Key_L);
  1.1312 +    a->setStatusTip( tr( "Use modifier to draw xLinks" ));
  1.1313  	a->setToggleAction(true);
  1.1314  	a->addTo (tb);
  1.1315  	actionModModeLink=a;
  1.1316 @@ -890,239 +1131,379 @@
  1.1317  	systemFlagsDefault->addFlag (fo);
  1.1318  
  1.1319  	// Create Standard Flags
  1.1320 +	QToolBar *tb=addToolBar (tr ("Standard Flags","Standard Flag Toolbar"));
  1.1321 +	tb->setObjectName ("standardFlagTB");
  1.1322 +
  1.1323  	standardFlagsDefault = new FlagRowObj ();
  1.1324  	standardFlagsDefault->setVisibility (false);
  1.1325  	standardFlagsDefault->setName ("standardFlagsDef");
  1.1326 +	standardFlagsDefault->setToolBar (tb);
  1.1327  
  1.1328  	fo->load(QPixmap(flagsPath+"flag-exclamationmark.png"));
  1.1329  	fo->setName ("exclamationmark");
  1.1330  	fo->setGroup("standard-mark");
  1.1331 -	fo->setToolTip(tr("Take care!","Standardflag"));
  1.1332 +	QAction *a=new QAction (fo->getPixmap(),fo->getName(),this);
  1.1333 +	tb->addAction (a);
  1.1334 +	fo->setAction (a);
  1.1335 +	a->setCheckable(true);
  1.1336 +	a->setObjectName(fo->getName());
  1.1337 +	a->setToolTip(tr("Take care!","Standardflag"));
  1.1338 +	connect (a, SIGNAL( triggered() ), this, SLOT( standardFlagChanged() ) );
  1.1339  	standardFlagsDefault->addFlag (fo);	// makes deep copy
  1.1340  	
  1.1341  	fo->load(QPixmap(flagsPath+"flag-questionmark.png"));
  1.1342  	fo->setName("questionmark");
  1.1343  	fo->setGroup("standard-mark");
  1.1344 -	fo->setToolTip(tr("Really?","Standardflag"));
  1.1345 +	a=new QAction (fo->getPixmap(),fo->getName(),this);
  1.1346 +	tb->addAction (a);
  1.1347 +	fo->setAction (a);
  1.1348 +	a->setCheckable(true);
  1.1349 +	a->setObjectName(fo->getName());
  1.1350 +	a->setToolTip(tr("Really?","Standardflag"));
  1.1351 +	connect (a, SIGNAL( triggered() ), this, SLOT( standardFlagChanged() ) );
  1.1352  	standardFlagsDefault->addFlag (fo);	
  1.1353  
  1.1354  	fo->load(QPixmap(flagsPath+"flag-hook-green.png"));
  1.1355  	fo->setName("hook-green");
  1.1356  	fo->setGroup("standard-hook");
  1.1357 -	fo->setToolTip(tr("ok!","Standardflag"));
  1.1358 +	a=new QAction (fo->getPixmap(),fo->getName(),this);
  1.1359 +	tb->addAction (a);
  1.1360 +	fo->setAction (a);
  1.1361 +	a->setCheckable(true);
  1.1362 +	a->setObjectName(fo->getName());
  1.1363 +	a->setToolTip(tr("ok!","Standardflag"));
  1.1364 +	connect (a, SIGNAL( triggered() ), this, SLOT( standardFlagChanged() ) );
  1.1365  	standardFlagsDefault->addFlag (fo);	
  1.1366  
  1.1367  	fo->load(QPixmap(flagsPath+"flag-cross-red.png"));
  1.1368  	fo->setName("cross-red");
  1.1369  	fo->setGroup("standard-hook");
  1.1370 -	fo->setToolTip(tr("Not ok!","Standardflag"));
  1.1371 +	a=new QAction (fo->getPixmap(),fo->getName(),this);
  1.1372 +	tb->addAction (a);
  1.1373 +	fo->setAction (a);
  1.1374 +	a->setCheckable(true);
  1.1375 +	a->setObjectName(fo->getName());
  1.1376 +	a->setToolTip(tr("Not ok!","Standardflag"));
  1.1377 +	connect (a, SIGNAL( triggered() ), this, SLOT( standardFlagChanged() ) );
  1.1378  	standardFlagsDefault->addFlag (fo);	
  1.1379  
  1.1380  	fo->load(QPixmap(flagsPath+"flag-stopsign.png"));
  1.1381  	fo->setName("stopsign");
  1.1382 -	fo->setToolTip(tr("This won't work!","Standardflag"));
  1.1383 +	a=new QAction (fo->getPixmap(),fo->getName(),this);
  1.1384 +	tb->addAction (a);
  1.1385 +	fo->setAction (a);
  1.1386 +	a->setCheckable(true);
  1.1387 +	a->setObjectName(fo->getName());
  1.1388 +	a->setToolTip(tr("This won't work!","Standardflag"));
  1.1389 +	connect (a, SIGNAL( triggered() ), this, SLOT( standardFlagChanged() ) );
  1.1390  	standardFlagsDefault->addFlag (fo);	
  1.1391  
  1.1392  	fo->load(QPixmap(flagsPath+"flag-smiley-good.png"));
  1.1393  	fo->setName("smiley-good");
  1.1394  	fo->setGroup("standard-smiley");
  1.1395 -	fo->setToolTip(tr("Good","Standardflag"));
  1.1396 +	a=new QAction (fo->getPixmap(),fo->getName(),this);
  1.1397 +	tb->addAction (a);
  1.1398 +	fo->setAction (a);
  1.1399 +	a->setCheckable(true);
  1.1400 +	a->setObjectName(fo->getName());
  1.1401 +	a->setToolTip(tr("Good","Standardflag"));
  1.1402 +	connect (a, SIGNAL( triggered() ), this, SLOT( standardFlagChanged() ) );
  1.1403  	standardFlagsDefault->addFlag (fo);	
  1.1404  
  1.1405  	fo->load(QPixmap(flagsPath+"flag-smiley-sad.png"));
  1.1406  	fo->setName("smiley-sad");
  1.1407  	fo->setGroup("standard-smiley");
  1.1408 -	fo->setToolTip(tr("Bad","Standardflag"));
  1.1409 +	a=new QAction (fo->getPixmap(),fo->getName(),this);
  1.1410 +	tb->addAction (a);
  1.1411 +	fo->setAction (a);
  1.1412 +	a->setCheckable(true);
  1.1413 +	a->setObjectName(fo->getName());
  1.1414 +	a->setToolTip(tr("Bad","Standardflag"));
  1.1415 +	connect (a, SIGNAL( triggered() ), this, SLOT( standardFlagChanged() ) );
  1.1416  	standardFlagsDefault->addFlag (fo);	
  1.1417  
  1.1418  	fo->load(QPixmap(flagsPath+"flag-smiley-omg.png"));
  1.1419  	// Original omg.png (in KDE emoticons)
  1.1420  	fo->setName("smiley-omg");
  1.1421  	fo->setGroup("standard-smiley");
  1.1422 -	fo->setToolTip(tr("Oh no!","Standardflag"));
  1.1423 +	a=new QAction (fo->getPixmap(),fo->getName(),this);
  1.1424 +	tb->addAction (a);
  1.1425 +	fo->setAction (a);
  1.1426 +	a->setCheckable(true);
  1.1427 +	a->setObjectName(fo->getName());
  1.1428 +	a->setToolTip(tr("Oh no!","Standardflag"));
  1.1429 +	connect (a, SIGNAL( triggered() ), this, SLOT( standardFlagChanged() ) );
  1.1430  	standardFlagsDefault->addFlag (fo);	
  1.1431  
  1.1432  	fo->load(QPixmap(flagsPath+"flag-kalarm.png"));
  1.1433  	fo->setName("clock");
  1.1434 -	fo->setToolTip(tr("Time critical","Standardflag"));
  1.1435 +	a=new QAction (fo->getPixmap(),fo->getName(),this);
  1.1436 +	tb->addAction (a);
  1.1437 +	fo->setAction (a);
  1.1438 +	a->setCheckable(true);
  1.1439 +	a->setObjectName(fo->getName());
  1.1440 +	a->setToolTip(tr("Time critical","Standardflag"));
  1.1441 +	connect (a, SIGNAL( triggered() ), this, SLOT( standardFlagChanged() ) );
  1.1442  	standardFlagsDefault->addFlag (fo);	
  1.1443  
  1.1444  	fo->load(QPixmap(flagsPath+"flag-phone.png"));
  1.1445  	fo->setName("phone");
  1.1446 -	fo->setToolTip(tr("Call...","Standardflag"));
  1.1447 +	a=new QAction (fo->getPixmap(),fo->getName(),this);
  1.1448 +	tb->addAction (a);
  1.1449 +	fo->setAction (a);
  1.1450 +	a->setCheckable(true);
  1.1451 +	a->setObjectName(fo->getName());
  1.1452 +	a->setToolTip(tr("Call...","Standardflag"));
  1.1453 +	connect (a, SIGNAL( triggered() ), this, SLOT( standardFlagChanged() ) );
  1.1454  	standardFlagsDefault->addFlag (fo);	
  1.1455  
  1.1456  	fo->load(QPixmap(flagsPath+"flag-lamp.png"));
  1.1457  	fo->setName("lamp");
  1.1458 -	fo->setToolTip(tr("Idea!","Standardflag"));
  1.1459 +	a=new QAction (fo->getPixmap(),fo->getName(),this);
  1.1460 +	tb->addAction (a);
  1.1461 +	fo->setAction (a);
  1.1462 +	a->setCheckable(true);
  1.1463 +	a->setObjectName(fo->getName());
  1.1464 +	a->setToolTip(tr("Idea!","Standardflag"));
  1.1465 +	connect (a, SIGNAL( triggered() ), this, SLOT( standardFlagChanged() ) );
  1.1466  	standardFlagsDefault->addFlag (fo);	
  1.1467  
  1.1468  	fo->load(QPixmap(flagsPath+"flag-arrow-up.png"));
  1.1469  	fo->setName("arrow-up");
  1.1470  	fo->setGroup("standard-arrow");
  1.1471 -	fo->setToolTip(tr("Important","Standardflag"));
  1.1472 +	a=new QAction (fo->getPixmap(),fo->getName(),this);
  1.1473 +	tb->addAction (a);
  1.1474 +	fo->setAction (a);
  1.1475 +	a->setCheckable(true);
  1.1476 +	a->setObjectName(fo->getName());
  1.1477 +	a->setToolTip(tr("Important","Standardflag"));
  1.1478 +	connect (a, SIGNAL( triggered() ), this, SLOT( standardFlagChanged() ) );
  1.1479  	standardFlagsDefault->addFlag (fo);	
  1.1480  
  1.1481  	fo->load(QPixmap(flagsPath+"flag-arrow-down.png"));
  1.1482  	fo->setName("arrow-down");
  1.1483  	fo->setGroup("standard-arrow");
  1.1484 -	fo->setToolTip(tr("Unimportant","Standardflag"));
  1.1485 +	a=new QAction (fo->getPixmap(),fo->getName(),this);
  1.1486 +	tb->addAction (a);
  1.1487 +	fo->setAction (a);
  1.1488 +	a->setCheckable(true);
  1.1489 +	a->setObjectName(fo->getName());
  1.1490 +	a->setToolTip(tr("Unimportant","Standardflag"));
  1.1491 +	connect (a, SIGNAL( triggered() ), this, SLOT( standardFlagChanged() ) );
  1.1492  	standardFlagsDefault->addFlag (fo);	
  1.1493  
  1.1494  	fo->load(QPixmap(flagsPath+"flag-arrow-2up.png"));
  1.1495  	fo->setName("2arrow-up");
  1.1496  	fo->setGroup("standard-arrow");
  1.1497 -	fo->setToolTip(tr("Very important!","Standardflag"));
  1.1498 +	a=new QAction (fo->getPixmap(),fo->getName(),this);
  1.1499 +	tb->addAction (a);
  1.1500 +	fo->setAction (a);
  1.1501 +	a->setCheckable(true);
  1.1502 +	a->setObjectName(fo->getName());
  1.1503 +	a->setToolTip(tr("Very important!","Standardflag"));
  1.1504 +	connect (a, SIGNAL( triggered() ), this, SLOT( standardFlagChanged() ) );
  1.1505  	standardFlagsDefault->addFlag (fo);	
  1.1506  
  1.1507  	fo->load(QPixmap(flagsPath+"flag-arrow-2down.png"));
  1.1508  	fo->setName("2arrow-down");
  1.1509  	fo->setGroup("standard-arrow");
  1.1510 -	fo->setToolTip(tr("Very unimportant!","Standardflag"));
  1.1511 +	a=new QAction (fo->getPixmap(),fo->getName(),this);
  1.1512 +	tb->addAction (a);
  1.1513 +	fo->setAction (a);
  1.1514 +	a->setCheckable(true);
  1.1515 +	a->setObjectName(fo->getName());
  1.1516 +	a->setToolTip(tr("Very unimportant!","Standardflag"));
  1.1517 +	connect (a, SIGNAL( triggered() ), this, SLOT( standardFlagChanged() ) );
  1.1518  	standardFlagsDefault->addFlag (fo);	
  1.1519  
  1.1520  	fo->load(QPixmap(flagsPath+"flag-thumb-up.png"));
  1.1521  	fo->setName("thumb-up");
  1.1522  	fo->setGroup("standard-thumb");
  1.1523 -	fo->setToolTip(tr("I like this","Standardflag"));
  1.1524 +	a=new QAction (fo->getPixmap(),fo->getName(),this);
  1.1525 +	tb->addAction (a);
  1.1526 +	fo->setAction (a);
  1.1527 +	a->setCheckable(true);
  1.1528 +	a->setObjectName(fo->getName());
  1.1529 +	a->setToolTip(tr("I like this","Standardflag"));
  1.1530 +	connect (a, SIGNAL( triggered() ), this, SLOT( standardFlagChanged() ) );
  1.1531  	standardFlagsDefault->addFlag (fo);	
  1.1532  
  1.1533  	fo->load(QPixmap(flagsPath+"flag-thumb-down.png"));
  1.1534  	fo->setName("thumb-down");
  1.1535  	fo->setGroup("standard-thumb");
  1.1536 -	fo->setToolTip(tr("I like this","Standardflag"));
  1.1537 -	fo->setToolTip(tr("I do not like this","Standardflag"));
  1.1538 +	a=new QAction (fo->getPixmap(),fo->getName(),this);
  1.1539 +	tb->addAction (a);
  1.1540 +	fo->setAction (a);
  1.1541 +	a->setCheckable(true);
  1.1542 +	a->setObjectName(fo->getName());
  1.1543 +	a->setToolTip(tr("I do not like this","Standardflag"));
  1.1544 +	connect (a, SIGNAL( triggered() ), this, SLOT( standardFlagChanged() ) );
  1.1545  	standardFlagsDefault->addFlag (fo);	
  1.1546  	
  1.1547  	fo->load(QPixmap(flagsPath+"flag-rose.png"));
  1.1548  	fo->setName("rose");
  1.1549 -	fo->setToolTip(tr("Rose","Standardflag"));
  1.1550 +	a=new QAction (fo->getPixmap(),fo->getName(),this);
  1.1551 +	tb->addAction (a);
  1.1552 +	fo->setAction (a);
  1.1553 +	a->setCheckable(true);
  1.1554 +	a->setObjectName(fo->getName());
  1.1555 +	a->setToolTip(tr("Rose","Standardflag"));
  1.1556 +	connect (a, SIGNAL( triggered() ), this, SLOT( standardFlagChanged() ) );
  1.1557  	standardFlagsDefault->addFlag (fo);	
  1.1558  
  1.1559  	fo->load(QPixmap(flagsPath+"flag-heart.png"));
  1.1560  	fo->setName("heart");
  1.1561 -	fo->setToolTip(tr("I just love... ","Standardflag"));
  1.1562 +	a=new QAction (fo->getPixmap(),fo->getName(),this);
  1.1563 +	tb->addAction (a);
  1.1564 +	a->setCheckable(true);
  1.1565 +	a->setObjectName(fo->getName());
  1.1566 +	a->setToolTip(tr("I just love... ","Standardflag"));
  1.1567 +	connect (a, SIGNAL( triggered() ), this, SLOT( standardFlagChanged() ) );
  1.1568  	standardFlagsDefault->addFlag (fo);	
  1.1569  
  1.1570  	fo->load(QPixmap(flagsPath+"flag-present.png"));
  1.1571  	fo->setName("present");
  1.1572 -	fo->setToolTip(tr("Surprise!","Standardflag"));
  1.1573 +	a=new QAction (fo->getPixmap(),fo->getName(),this);
  1.1574 +	tb->addAction (a);
  1.1575 +	fo->setAction (a);
  1.1576 +	a->setCheckable(true);
  1.1577 +	a->setObjectName(fo->getName());
  1.1578 +	a->setToolTip(tr("Surprise!","Standardflag"));
  1.1579 +	connect (a, SIGNAL( triggered() ), this, SLOT( standardFlagChanged() ) );
  1.1580  	standardFlagsDefault->addFlag (fo);	
  1.1581  
  1.1582  	fo->load(QPixmap(flagsPath+"flag-flash.png"));
  1.1583  	fo->setName("flash");
  1.1584 -	fo->setToolTip(tr("Dangerous","Standardflag"));
  1.1585 +	a=new QAction (fo->getPixmap(),fo->getName(),this);
  1.1586 +	tb->addAction (a);
  1.1587 +	fo->setAction (a);
  1.1588 +	a->setCheckable(true);
  1.1589 +	a->setObjectName(fo->getName());
  1.1590 +	a->setToolTip(tr("Dangerous","Standardflag"));
  1.1591 +	connect (a, SIGNAL( triggered() ), this, SLOT( standardFlagChanged() ) );
  1.1592  	standardFlagsDefault->addFlag (fo);	
  1.1593  	
  1.1594  	fo->load(QPixmap(flagsPath+"flag-info.png"));
  1.1595  	// Original: xsldbg_output.png
  1.1596  	fo->setName("info");
  1.1597 -	fo->setToolTip(tr("Info","Standardflag"));
  1.1598 +	a=new QAction (fo->getPixmap(),fo->getName(),this);
  1.1599 +	tb->addAction (a);
  1.1600 +	fo->setAction (a);
  1.1601 +	a->setCheckable(true);
  1.1602 +	a->setObjectName(fo->getName());
  1.1603 +	a->setToolTip(tr("Info","Standardflag"));
  1.1604 +	connect (a, SIGNAL( triggered() ), this, SLOT( standardFlagChanged() ) );
  1.1605  	standardFlagsDefault->addFlag (fo);	
  1.1606  
  1.1607  	fo->load(QPixmap(flagsPath+"flag-lifebelt.png"));
  1.1608  	// Original khelpcenter.png
  1.1609  	fo->setName("lifebelt");
  1.1610 -	fo->setToolTip(tr("This will help","Standardflag"));
  1.1611 +	a=new QAction (fo->getPixmap(),fo->getName(),this);
  1.1612 +	tb->addAction (a);
  1.1613 +	fo->setAction (a);
  1.1614 +	a->setCheckable(true);
  1.1615 +	a->setObjectName(fo->getName());
  1.1616 +	a->setToolTip(tr("This will help","Standardflag"));
  1.1617 +	connect (a, SIGNAL( triggered() ), this, SLOT( standardFlagChanged() ) );
  1.1618  	standardFlagsDefault->addFlag (fo);	
  1.1619  
  1.1620  	delete (fo);
  1.1621 -
  1.1622 -	standardFlagsDefault->makeToolbar(this, "Standard Flags");
  1.1623  }
  1.1624  
  1.1625  // Settings Actions
  1.1626  void Main::setupSettingsActions()
  1.1627  {
  1.1628 -    QPopupMenu *menu = new QPopupMenu( this );
  1.1629 -    menuBar()->insertItem( tr( "&Settings" ), menu );
  1.1630 +    QMenu *settingsMenu = menuBar()->addMenu( tr( "&Settings" ));
  1.1631  
  1.1632  	QAction *a;
  1.1633  
  1.1634 -
  1.1635 -    a = new QAction( tr( "Set application to open pdf files"), QPixmap(), tr( "Set application to open pdf files  ...") , 0, this, "setPDF" );
  1.1636 -    connect( a, SIGNAL( activated() ), this, SLOT( settingsPDF() ) );
  1.1637 -    a->addTo( menu );
  1.1638 -
  1.1639 -    a = new QAction( tr( "Set application to open external links"), QPixmap(), tr( "Set application to open external links..."), 0, this, "setURL" );
  1.1640 -    connect( a, SIGNAL( activated() ), this, SLOT( settingsURL() ) );
  1.1641 -    a->addTo( menu );
  1.1642 -
  1.1643 -    menu->insertSeparator();
  1.1644 -    a = new QAction( tr( "Edit branch after adding it" ), QPixmap(), tr( "Edit branch after adding it" ), 0, this, "autoedit" );
  1.1645 +    a = new QAction( tr( "Set application to open pdf files"), this);
  1.1646 +    a->setStatusTip ( tr( "Set application to open pdf files"));
  1.1647 +    connect( a, SIGNAL( triggered() ), this, SLOT( settingsPDF() ) );
  1.1648 +	settingsMenu->addAction (a);
  1.1649 +
  1.1650 +    a = new QAction( tr( "Set application to open external links"), this);
  1.1651 +    a->setStatusTip( tr( "Set application to open external links"));
  1.1652 +    connect( a, SIGNAL( triggered() ), this, SLOT( settingsURL() ) );
  1.1653 +	settingsMenu->addAction (a);
  1.1654 +
  1.1655 +	settingsMenu->addSeparator();
  1.1656 +    a = new QAction( tr( "Edit branch after adding it" ), this );
  1.1657 +    a->setStatusTip( tr( "Edit branch after adding it" ));
  1.1658  	a->setToggleAction(true);
  1.1659 -	a->setOn ( settings.readBoolEntry ("/vym/mapeditor/editmode/autoedit",true) );
  1.1660 -    a->addTo( menu );
  1.1661 +	a->setOn ( settings.value ("/mapeditor/editmode/autoEdit",true).toBool());
  1.1662 +	settingsMenu->addAction (a);
  1.1663  	actionSettingsAutoedit=a;
  1.1664  
  1.1665 -    a= new QAction( tr( "Select branch after adding it" ), QPixmap(), tr( "Select branch after adding it" ), 0, this, "autoselectheading" );
  1.1666 +    a= new QAction( tr( "Select branch after adding it" ), this );
  1.1667 +    a->setStatusTip( tr( "Select branch after adding it" ));
  1.1668  	a->setToggleAction(true);
  1.1669 -	a->setOn ( settings.readBoolEntry ("/vym/mapeditor/editmode/autoselect",false) );
  1.1670 -    a->addTo( menu );
  1.1671 +	a->setOn ( settings.value ("/mapeditor/editmode/autoSelectHeading",false).toBool() );
  1.1672 +	settingsMenu->addAction (a);
  1.1673  	actionSettingsAutoselectHeading=a;
  1.1674  	
  1.1675 -    a= new QAction( tr( "Select heading before editing" ), QPixmap(), tr( "Select existing heading" ), 0, this, "autoselectexistingtext" );
  1.1676 +    a= new QAction(tr( "Select existing heading" ), this);
  1.1677 +    a->setStatusTip( tr( "Select heading before editing" ));
  1.1678  	a->setToggleAction(true);
  1.1679 -	a->setOn ( settings.readBoolEntry ("/vym/mapeditor/editmode/autoselectexistingtext",true) );
  1.1680 -    a->addTo( menu );
  1.1681 +	a->setOn ( settings.value ("/mapeditor/editmode/autoSelectText",true).toBool() );
  1.1682 +	settingsMenu->addAction (a);
  1.1683  	actionSettingsAutoselectText=a;
  1.1684  	
  1.1685 -    a= new QAction( tr( "Pasting into new branch" ), QPixmap(), tr( "pasting into new branch" ), 0, this, "pastenewheading" );
  1.1686 +    a= new QAction( tr( "Delete key" ), this);
  1.1687 +    a->setStatusTip( tr( "Delete key for deleting branches" ));
  1.1688  	a->setToggleAction(true);
  1.1689 -	a->setOn ( settings.readBoolEntry ("/vym/mapeditor/editmode/newheadingisempty",true) );
  1.1690 -    a->addTo( menu );
  1.1691 -	actionSettingsPasteNewHeading=a;
  1.1692 -	
  1.1693 -    a= new QAction( tr( "Delete key for deleting branches" ), QPixmap(), tr( "Delete key" ), 0, this, "delkey" );
  1.1694 +	a->setOn ( settings.value ("/mapeditor/editmode/useDelKey",false).toBool() );
  1.1695 +	settingsMenu->addAction (a);
  1.1696 +    connect( a, SIGNAL( triggered() ), this, SLOT( settingsToggleDelKey() ) );
  1.1697 +	actionSettingsUseDelKey=a;
  1.1698 +
  1.1699 +    a= new QAction( tr( "Exclusive flags" ), this);
  1.1700 +    a->setStatusTip( tr( "Use exclusive flags in flag toolbars" ));
  1.1701  	a->setToggleAction(true);
  1.1702 -	a->setOn ( settings.readBoolEntry ("/vym/mapeditor/editmode/useDelKey",false) );
  1.1703 -    a->addTo( menu );
  1.1704 -    connect( a, SIGNAL( activated() ), this, SLOT( settingsToggleDelKey() ) );
  1.1705 -	actionSettingsUseDelKey=a;
  1.1706 -
  1.1707 -    a= new QAction( tr( "Use exclusive flags in flag toolbars" ), QPixmap(), tr( "Exclusive flags" ), 0, this, "flaggroups" );
  1.1708 -	a->setToggleAction(true);
  1.1709 -	a->setOn ( settings.readBoolEntry ("/vym/mapeditor/editmode/useFlagGroups",true) );
  1.1710 -    a->addTo( menu );
  1.1711 +	a->setOn ( settings.value ("/mapeditor/editmode/useFlagGroups",true).toBool() );
  1.1712 +	settingsMenu->addAction (a);
  1.1713  	actionSettingsUseFlagGroups=a;
  1.1714  	
  1.1715 -    a= new QAction( tr( "Use hide flag during exports " ), QPixmap(), tr( "Use hide flags" ), 0, this, "hideexport" );
  1.1716 +    a= new QAction( tr( "Use hide flags" ), this);
  1.1717 +    a->setStatusTip( tr( "Use hide flag during exports " ));
  1.1718  	a->setToggleAction(true);
  1.1719 -	a->setOn ( settings.readBoolEntry ("/vym/export/useHideExport",true) );
  1.1720 -    a->addTo( menu );
  1.1721 +	a->setOn ( settings.value ("/export/useHideExport",true).toBool() );
  1.1722 +	settingsMenu->addAction (a);
  1.1723  	actionSettingsUseHideExport=a;
  1.1724  }
  1.1725  
  1.1726  // Test Actions
  1.1727  void Main::setupTestActions()
  1.1728  {
  1.1729 -    QPopupMenu *menu = new QPopupMenu( this );
  1.1730 -    menuBar()->insertItem( tr( "&Test" ), menu );
  1.1731 +    QMenu *testMenu = menuBar()->addMenu( tr( "&Test" ));
  1.1732  
  1.1733      QAction *a;
  1.1734 -    a = new QAction( tr( "Call test function" ), QPixmap(), tr( "test flag" ), 0, this, "flag" );
  1.1735 -    connect( a, SIGNAL( activated() ), this, SLOT( testFunction() ) );
  1.1736 -    a->addTo( menu );
  1.1737 +    a = new QAction( tr( "test flag" ), this);
  1.1738 +    a->setStatusTip( tr( "Call test function" ));
  1.1739 +    connect( a, SIGNAL( triggered() ), this, SLOT( testFunction() ) );
  1.1740 +	testMenu->addAction (a);
  1.1741  }
  1.1742  
  1.1743  // Help Actions
  1.1744  void Main::setupHelpActions()
  1.1745  {
  1.1746 -    QPopupMenu *menu = new QPopupMenu( this );
  1.1747 -    menuBar()->insertItem( tr( "&Help" ), menu );
  1.1748 +    QMenu *helpMenu = menuBar()->addMenu ( tr( "&Help" ));
  1.1749  
  1.1750      QAction *a;
  1.1751 -    a = new QAction( tr( "Open VYM Documentation (pdf)" ), QPixmap(), tr( "Open VYM Documentation (pdf) " ), 0, this, "about" );
  1.1752 -    connect( a, SIGNAL( activated() ), this, SLOT( helpDoc() ) );
  1.1753 -    a->addTo( menu );
  1.1754 -
  1.1755 -    a = new QAction( tr( "About VYM")+" "__VYM, QPixmap(), tr( "About VYM" ), 0, this, "about" );
  1.1756 -    connect( a, SIGNAL( activated() ), this, SLOT( helpAbout() ) );
  1.1757 -    a->addTo( menu );
  1.1758 -
  1.1759 -    a = new QAction( tr( "Information about QT toolkit" ), QPixmap(), tr( "About QT" ), 0, this, "about" );
  1.1760 -    connect( a, SIGNAL( activated() ), this, SLOT( helpAboutQT() ) );
  1.1761 -    a->addTo( menu );
  1.1762 +    a = new QAction(  tr( "Open VYM Documentation (pdf) " ), this );
  1.1763 +    a->setStatusTip( tr( "Open VYM Documentation (pdf)" ));
  1.1764 +    connect( a, SIGNAL( triggered() ), this, SLOT( helpDoc() ) );
  1.1765 +	helpMenu->addAction (a);
  1.1766 +
  1.1767 +    a = new QAction( tr( "About VYM" ), this);
  1.1768 +    a->setStatusTip( tr( "About VYM")+" "__VYM);
  1.1769 +    connect( a, SIGNAL( triggered() ), this, SLOT( helpAbout() ) );
  1.1770 +	helpMenu->addAction (a);
  1.1771 +
  1.1772 +    a = new QAction( tr( "About QT" ), this);
  1.1773 +    a->setStatusTip( tr( "Information about QT toolkit" ));
  1.1774 +    connect( a, SIGNAL( triggered() ), this, SLOT( helpAboutQT() ) );
  1.1775 +	helpMenu->addAction (a);
  1.1776  }
  1.1777  
  1.1778  // Context Menus
  1.1779 @@ -1131,130 +1512,87 @@
  1.1780  	QAction*a;
  1.1781  
  1.1782  	// Context Menu for branch or mapcenter
  1.1783 -	branchContextMenu =new QPopupMenu (this);
  1.1784 +	branchContextMenu =new QMenu (this);
  1.1785  
  1.1786  		// Submenu "Add"
  1.1787 -		branchAddContextMenu =new QPopupMenu (this);
  1.1788 -		actionEditPaste->addTo ( branchAddContextMenu );
  1.1789 -		actionEditAddBranch->addTo ( branchAddContextMenu );
  1.1790 -		actionEditAddBranchHere->addTo ( branchAddContextMenu );
  1.1791 -		actionEditAddBranchAbove->addTo ( branchAddContextMenu );
  1.1792 -		actionEditAddBranchBelow->addTo ( branchAddContextMenu );
  1.1793 -		branchAddContextMenu->insertSeparator();	
  1.1794 -		actionEditLoadImage->addTo( branchAddContextMenu );
  1.1795 -		branchAddContextMenu->insertSeparator();	
  1.1796 -		actionEditImportAdd->addTo ( branchAddContextMenu );
  1.1797 -		actionEditImportReplace->addTo ( branchAddContextMenu );
  1.1798 +		branchAddContextMenu =branchContextMenu->addMenu (tr("Add"));
  1.1799 +		branchAddContextMenu->addAction (actionEditPaste );
  1.1800 +		branchAddContextMenu->addAction ( actionEditAddBranch );
  1.1801 +		branchAddContextMenu->addAction ( actionEditAddBranchHere );
  1.1802 +		branchAddContextMenu->addAction ( actionEditAddBranchAbove);
  1.1803 +		branchAddContextMenu->addAction ( actionEditAddBranchBelow );
  1.1804 +		branchAddContextMenu->addSeparator();	
  1.1805 +		branchAddContextMenu->addAction ( actionEditLoadImage);
  1.1806 +		branchAddContextMenu->addSeparator();	
  1.1807 +		branchAddContextMenu->addAction ( actionEditImportAdd );
  1.1808 +		branchAddContextMenu->addAction ( actionEditImportReplace );
  1.1809  
  1.1810  		// Submenu "Remove"
  1.1811 -		branchRemoveContextMenu =new QPopupMenu (this);
  1.1812 -		actionEditCut->addTo ( branchRemoveContextMenu );
  1.1813 -		actionEditDelete->addTo ( branchRemoveContextMenu );
  1.1814 -		actionEditRemoveBranchKeepChilds->addTo( branchRemoveContextMenu );
  1.1815 -		actionEditRemoveChilds->addTo( branchRemoveContextMenu );
  1.1816 +		branchRemoveContextMenu =branchContextMenu->addMenu (tr ("Remove"));
  1.1817 +		branchRemoveContextMenu->addAction (actionEditCut);
  1.1818 +		branchRemoveContextMenu->addAction ( actionEditDelete );
  1.1819 +		branchRemoveContextMenu->addAction ( actionEditRemoveBranchKeepChilds );
  1.1820 +		branchRemoveContextMenu->addAction ( actionEditRemoveChilds );
  1.1821  		
  1.1822 -	branchContextMenu->insertItem (tr("Add"),branchAddContextMenu);	
  1.1823 -	branchContextMenu->insertItem (tr("Remove"),branchRemoveContextMenu);	
  1.1824  
  1.1825  	actionEditSaveBranch->addTo( branchContextMenu );
  1.1826  
  1.1827 -	branchContextMenu->insertSeparator();	
  1.1828 -	actionEditOpenURL->addTo ( branchContextMenu );
  1.1829 -	actionEditOpenURLTab->addTo ( branchContextMenu );
  1.1830 -	actionEditURL->addTo ( branchContextMenu );
  1.1831 -	actionEditHeading2URL->addTo ( branchContextMenu );
  1.1832 -	actionEditBugzilla2URL->addTo( branchContextMenu );
  1.1833 -    if (settings.readBoolEntry( "/vym/mainwindow/showTestMenu",false)) 
  1.1834 -	{
  1.1835 -		actionEditFATE2URL->addTo( branchContextMenu );
  1.1836 -	}	
  1.1837 -	branchContextMenu->insertSeparator();	
  1.1838 -	actionEditOpenVymLink->addTo ( branchContextMenu );
  1.1839 -	actionEditVymLink->addTo ( branchContextMenu );
  1.1840 -	actionEditDeleteVymLink->addTo ( branchContextMenu );
  1.1841 -	
  1.1842 -	branchContextMenu->insertSeparator();	
  1.1843 -	actionGroupFormatFrameTypes->addTo( branchContextMenu );
  1.1844 -
  1.1845 -	branchContextMenu->insertSeparator();	
  1.1846 -	actionFormatIncludeImagesVer->addTo( branchContextMenu );
  1.1847 -	actionFormatIncludeImagesHor->addTo( branchContextMenu );
  1.1848 -	actionFormatHideLinkUnselected->addTo( branchContextMenu );
  1.1849 -
  1.1850 -	// Context Menu for links in a branch menu
  1.1851 +	branchContextMenu->addSeparator();	
  1.1852 +	branchContextMenu->addAction ( actionFormatFrameNone );
  1.1853 +	branchContextMenu->addAction ( actionFormatFrameRectangle);
  1.1854 +
  1.1855 +	branchContextMenu->addSeparator();	
  1.1856 +	branchContextMenu->addAction ( actionFormatIncludeImagesVer );
  1.1857 +	branchContextMenu->addAction ( actionFormatIncludeImagesHor );
  1.1858 +	branchContextMenu->addAction ( actionFormatHideLinkUnselected );
  1.1859 +
  1.1860 +	// Submenu for Links (URLs, vymLinks)
  1.1861 +	branchLinksContextMenu =new QMenu (this);
  1.1862 +
  1.1863 +		branchContextMenu->addSeparator();	
  1.1864 +		branchLinksContextMenu=branchContextMenu->addMenu(tr("URLs and vymLinks"));	
  1.1865 +		branchLinksContextMenu->addAction ( actionEditOpenURL );
  1.1866 +		branchLinksContextMenu->addAction ( actionEditOpenURLTab );
  1.1867 +		branchLinksContextMenu->addAction ( actionEditOpenMultipleURLTabs );
  1.1868 +		branchLinksContextMenu->addAction ( actionEditURL );
  1.1869 +		branchLinksContextMenu->addAction ( actionEditHeading2URL );
  1.1870 +		branchLinksContextMenu->addAction ( actionEditBugzilla2URL );
  1.1871 +		if (settings.value( "/mainwindow/showTestMenu",true).toBool() )
  1.1872 +		{
  1.1873 +			branchLinksContextMenu->addAction ( actionEditFATE2URL );
  1.1874 +		}	
  1.1875 +		branchLinksContextMenu->addSeparator();	
  1.1876 +		branchLinksContextMenu->addAction ( actionEditOpenVymLink );
  1.1877 +		branchLinksContextMenu->addAction ( actionEditOpenMultipleVymLinks );
  1.1878 +		branchLinksContextMenu->addAction ( actionEditVymLink );
  1.1879 +		branchLinksContextMenu->addAction ( actionEditDeleteVymLink );
  1.1880 +		
  1.1881 +
  1.1882 +	// Context Menu for XLinks in a branch menu
  1.1883  	// This will be populated "on demand" in MapEditor::updateActions
  1.1884 -	branchContextMenu->insertSeparator();	
  1.1885 -	branchLinksContextMenu =new QPopupMenu (this);
  1.1886 -	branchLinksContextMenuDup =new QPopupMenu (this);
  1.1887 -	branchContextMenu->insertItem (tr("Edit XLink"),branchLinksContextMenuDup);
  1.1888 -	connect( branchLinksContextMenuDup, SIGNAL( activated(int) ), this, SLOT( editEditXLink(int ) ) );
  1.1889 -
  1.1890 -	branchContextMenu->insertItem (tr("Goto XLink"),branchLinksContextMenu);
  1.1891 -	connect( branchLinksContextMenu, SIGNAL( activated(int) ), this, SLOT( editFollowXLink(int ) ) );
  1.1892 +	branchContextMenu->addSeparator();	
  1.1893 +	branchXLinksContextMenuEdit =branchContextMenu->addMenu (tr ("Edit XLink"));
  1.1894 +	branchXLinksContextMenuFollow =branchContextMenu->addMenu (tr ("Follow XLink"));
  1.1895 +	connect( branchXLinksContextMenuFollow, SIGNAL( triggered(QAction *) ), this, SLOT( editFollowXLink(QAction * ) ) );
  1.1896 +	connect( branchXLinksContextMenuEdit, SIGNAL( triggered(QAction *) ), this, SLOT( editEditXLink(QAction * ) ) );
  1.1897 + 	
  1.1898  	
  1.1899  	// Context menu for floatimage
  1.1900 -	floatimageContextMenu =new QPopupMenu (this);
  1.1901 -	saveImageFormatMenu=new QPopupMenu (this);
  1.1902 -	exportImageFormatMenu=new QPopupMenu (this);
  1.1903 -
  1.1904 -	QStrList fmt = QImage::outputFormats();
  1.1905 -	for (const char* f = fmt.first(); f; f = fmt.next()) 
  1.1906 -	{
  1.1907 -		saveImageFormatMenu->insertItem( f );
  1.1908 -		exportImageFormatMenu->insertItem( f );
  1.1909 -	}	
  1.1910 -	connect( saveImageFormatMenu, SIGNAL( activated(int) ), this, SLOT( editSaveImage(int ) ) );
  1.1911 -	connect( exportImageFormatMenu, SIGNAL( activated(int) ), this, SLOT( fileExportImage(int ) ) );
  1.1912 -	floatimageContextMenu->insertItem( tr("Save image"),saveImageFormatMenu );
  1.1913 -	
  1.1914 -	floatimageContextMenu->insertSeparator();	
  1.1915 +	floatimageContextMenu =new QMenu (this);
  1.1916 +	a= new QAction (tr ("Save image"),this);
  1.1917 +	connect (a, SIGNAL (triggered()), this, SLOT (editSaveImage()));
  1.1918 +	floatimageContextMenu->addAction (a);
  1.1919 +
  1.1920 +	floatimageContextMenu->addSeparator();	
  1.1921  	actionEditCopy->addTo( floatimageContextMenu );
  1.1922  	actionEditCut->addTo( floatimageContextMenu );
  1.1923  
  1.1924 -/* FIXME not needed any longer
  1.1925 -	floatimageContextMenu->insertSeparator();	
  1.1926 -    a = new QAction( tr( "Use for Export" ), QPixmap(), tr( "Use for Export"), 0, this, "useForExport" );
  1.1927 -	a->setToggleAction(true);
  1.1928 -    connect( a, SIGNAL( activated() ), this, SLOT( editToggleFloatExport() ) );
  1.1929 -    a->addTo( floatimageContextMenu);
  1.1930 -	actionEditToggleFloatExport=a;
  1.1931 -	*/
  1.1932 -
  1.1933 -	floatimageContextMenu->insertSeparator();	
  1.1934 -	actionFormatHideLinkUnselected->addTo( floatimageContextMenu );
  1.1935 -
  1.1936 -	exportMenu->insertItem ( tr("Export as")+" Image",exportImageFormatMenu);
  1.1937 -
  1.1938 -	a = new QAction( tr( "Export in Open Document Format used e.g. in Open Office " ), QPixmap(), "Open Office"+QString("..."), 0, this, "exportOOPresentation" );
  1.1939 -	connect( a, SIGNAL( activated() ), this, SLOT( fileExportOOPresentation() ) );
  1.1940 -	a->addTo (exportMenu);
  1.1941 -
  1.1942 -	a = new QAction( tr( "Export as")+" webpage (XHTML)" , QPixmap(), "Webpage (XHTML)...", ALT + Key_X, this, "exportXHTML" );
  1.1943 -    connect( a, SIGNAL( activated() ), this, SLOT( fileExportXHTML() ) );
  1.1944 -    a->addTo( exportMenu );
  1.1945 -
  1.1946 -    a = new QAction( tr( "Export as")+" ASCII"+" "+tr("(still experimental)" ), QPixmap(), "Text (ASCII)...", 0, this, "exportASCII" );
  1.1947 -    connect( a, SIGNAL( activated() ), this, SLOT( fileExportASCII() ) );
  1.1948 -	a->addTo( exportMenu );
  1.1949 -
  1.1950 -	a = new QAction( tr( "Export as")+" "+tr("KDE Bookmarks" ), QPixmap(), tr("KDE Bookmarks"), 0, this, "importKDEBookmarks" );
  1.1951 -	connect( a, SIGNAL( activated() ), this, SLOT( fileExportKDEBookmarks() ) );
  1.1952 -	a->addTo (exportMenu);
  1.1953 -
  1.1954 -    a = new QAction( tr( "Export as")+" Taskjuggler"+" "+tr("(still experimental)" ), QPixmap(), "Taskjuggler...", 0, this, "exportTJ" );
  1.1955 -    connect( a, SIGNAL( activated() ), this, SLOT( fileExportTaskjuggler() ) );
  1.1956 -	a->addTo( exportMenu );
  1.1957 -
  1.1958 -    a = new QAction( tr( "Export as")+" LaTeX"+" "+tr("(still experimental)" ), QPixmap(), "LaTeX...", 0, this, "exportLaTeX" );
  1.1959 -    connect( a, SIGNAL( activated() ), this, SLOT( fileExportLaTeX() ) );
  1.1960 -	a->addTo( exportMenu );
  1.1961 -
  1.1962 -	a = new QAction( tr( "Export as")+" XML" , QPixmap(), "XML...",  0, this, "exportXML" );
  1.1963 -    connect( a, SIGNAL( activated() ), this, SLOT( fileExportXML() ) );
  1.1964 -    a->addTo( exportMenu );
  1.1965 +	floatimageContextMenu->addSeparator();	
  1.1966 +	floatimageContextMenu->addAction ( actionFormatHideLinkUnselected );
  1.1967 +
  1.1968  	
  1.1969  	// Context menu for canvas
  1.1970 -	canvasContextMenu =new QPopupMenu (this);
  1.1971 +	canvasContextMenu =new QMenu (this);
  1.1972  	actionEditMapInfo->addTo( canvasContextMenu );
  1.1973  	canvasContextMenu->insertSeparator();	
  1.1974  	actionGroupFormatLinkStyles->addTo( canvasContextMenu );
  1.1975 @@ -1266,15 +1604,15 @@
  1.1976  	// Menu for last opened files
  1.1977  	// Read settings initially
  1.1978  	QString s;
  1.1979 -	int j=settings.readNumEntry( "/vym/lastMaps/number",0);
  1.1980 +	int j=settings.readNumEntry( "/lastMaps/number",0);
  1.1981  	for (int i=1;i<=j;i++)
  1.1982  	{
  1.1983 -		s=settings.readEntry(QString("/vym/lastMaps/map-%1").arg(i),"");
  1.1984 +		s=settings.value(QString("/lastMaps/map-%1").arg(i),"").toString();
  1.1985  		if (!s.isEmpty() && j<=maxLastMaps) 
  1.1986  			lastMaps.append(s);
  1.1987  	}
  1.1988  	setupLastMapsMenu();
  1.1989 -	connect( lastMapsMenu, SIGNAL( activated(int) ), this, SLOT( fileLoadLast(int ) ) );
  1.1990 +	connect( fileLastMapsMenu, SIGNAL( triggered(QAction *) ), this, SLOT( fileLoadLast(QAction*) ) );
  1.1991  }
  1.1992  
  1.1993  void Main::setupLastMapsMenu()
  1.1994 @@ -1300,10 +1638,9 @@
  1.1995  	while ((int)(lastMaps.count()) > maxLastMaps) lastMaps.pop_back();
  1.1996  	
  1.1997  	// build Menu from lastMaps string list
  1.1998 -	lastMapsMenu->clear();
  1.1999 +	fileLastMapsMenu->clear();
  1.2000  	for (it = lastMaps.begin(); it != lastMaps.end(); ++it ) 
  1.2001 -		lastMapsMenu->insertItem (*it );
  1.2002 -		
  1.2003 +		fileLastMapsMenu->addAction (*it );
  1.2004  }
  1.2005  
  1.2006  void Main::hideEvent (QHideEvent * )
  1.2007 @@ -1347,8 +1684,8 @@
  1.2008  
  1.2009  QString Main::browseDirectory (const QString &caption)
  1.2010  {
  1.2011 -	QFileDialog fd(this,caption);
  1.2012 -	fd.setMode (QFileDialog::DirectoryOnly);
  1.2013 +	Q3FileDialog fd(this,caption);
  1.2014 +	fd.setMode (Q3FileDialog::DirectoryOnly);
  1.2015  	fd.setCaption(__VYM " - "+caption);
  1.2016  	fd.show();
  1.2017  	
  1.2018 @@ -1370,7 +1707,7 @@
  1.2019  void Main::newView() 
  1.2020  {
  1.2021      // Open a new view... have it delete when closed.
  1.2022 -    Main *m = new Main(0, 0, WDestructiveClose);
  1.2023 +    Main *m = new Main(0, 0, Qt::WDestructiveClose);
  1.2024      qApp->setMainWidget(m);
  1.2025      m->show();
  1.2026      qApp->setMainWidget(0);
  1.2027 @@ -1397,12 +1734,12 @@
  1.2028  void Main::fileNew()
  1.2029  {
  1.2030  	QString fn="unnamed";
  1.2031 -	MapEditor* medit = new MapEditor (tabWidget, true);
  1.2032 +	MapEditor* medit = new MapEditor ( NULL,true);
  1.2033  	tabWidget->addTab (medit,fn);
  1.2034  	tabWidget->showPage(medit);
  1.2035  	medit->viewport()->setFocus();
  1.2036 -		// For the very first map we do not have flagrows yet...
  1.2037 -		medit->select("mc:");
  1.2038 +	// For the very first map we do not have flagrows yet...
  1.2039 +	medit->select("mc:");
  1.2040  }
  1.2041  
  1.2042  ErrorCode Main::fileLoad(QString fn, const LoadMode &lmode)
  1.2043 @@ -1435,7 +1772,7 @@
  1.2044  					QMessageBox::Warning,
  1.2045  					QMessageBox::Yes | QMessageBox::Default,
  1.2046  					QMessageBox::Cancel | QMessageBox::Escape,
  1.2047 -					QMessageBox::QMessageBox::NoButton);
  1.2048 +					QMessageBox::NoButton);
  1.2049  				mb.setButtonText( QMessageBox::Yes, tr("Open anyway") );
  1.2050  				mb.setButtonText( QMessageBox::Cancel, tr("Cancel"));
  1.2051  				switch( mb.exec() ) 
  1.2052 @@ -1465,7 +1802,7 @@
  1.2053  		// create a new mapeditor in a new tab
  1.2054  		if ( lmode==NewMap && (!me || !me->isDefault() ) )
  1.2055  		{
  1.2056 -			me = new MapEditor (tabWidget,true);
  1.2057 +			me= new MapEditor ( NULL,true);
  1.2058  			tabWidget->addTab (me,fn);
  1.2059  			tabIndex=tabWidget->indexOf (me);
  1.2060  			tabWidget->setCurrentPage (tabIndex);
  1.2061 @@ -1480,7 +1817,7 @@
  1.2062  				QMessageBox::Question,
  1.2063  				QMessageBox::Yes ,
  1.2064  				QMessageBox::Cancel | QMessageBox::Default,
  1.2065 -				QMessageBox::QMessageBox::NoButton );
  1.2066 +				QMessageBox::NoButton );
  1.2067  
  1.2068  			mb.setButtonText( QMessageBox::Yes, tr("Create"));
  1.2069  			mb.setButtonText( QMessageBox::No, tr("Cancel"));
  1.2070 @@ -1603,10 +1940,9 @@
  1.2071  
  1.2072  void Main::fileLoad(const LoadMode &lmode)
  1.2073  {
  1.2074 -	QFileDialog *fd=new QFileDialog( this);
  1.2075 -	if (!lastFileDir.isEmpty()) 
  1.2076 -		fd->setDir (lastFileDir);
  1.2077 -	fd->setMode (QFileDialog::ExistingFiles);
  1.2078 +	Q3FileDialog *fd=new Q3FileDialog( this);
  1.2079 +	fd->setDir (lastFileDir);
  1.2080 +	fd->setMode (Q3FileDialog::ExistingFiles);
  1.2081  	fd->addFilter ("XML (*.xml)");
  1.2082  	fd->addFilter ("VYM map (*.vym *.vyp)");
  1.2083  	switch (lmode)
  1.2084 @@ -1644,9 +1980,9 @@
  1.2085  	fileLoad (NewMap);
  1.2086  }
  1.2087  
  1.2088 -void Main::fileLoadLast(int i)
  1.2089 +void Main::fileLoadLast(QAction *a)
  1.2090  {
  1.2091 -	fileLoad(*lastMaps.at(lastMapsMenu->indexOf (i) ),NewMap);			   
  1.2092 +	fileLoad(lastMaps.at(fileLastMapsMenu->actions().indexOf(a)) ,NewMap);
  1.2093  }
  1.2094  
  1.2095  void Main::fileSave(const SaveMode &savemode)
  1.2096 @@ -1770,9 +2106,9 @@
  1.2097  	if (currentMapEditor())
  1.2098  	{
  1.2099  		if (savemode==CompleteMap)
  1.2100 -			fn = QFileDialog::getSaveFileName( QString::null, "VYM map (*.vym)", this );
  1.2101 +			fn = Q3FileDialog::getSaveFileName( QString::null, "VYM map (*.vym)", this );
  1.2102  		else		
  1.2103 -			fn = QFileDialog::getSaveFileName( QString::null, "VYM part of map (*.vyp)", this );
  1.2104 +			fn = Q3FileDialog::getSaveFileName( QString::null, "VYM part of map (*.vyp)", this );
  1.2105  		if ( !fn.isEmpty() ) 
  1.2106  		{
  1.2107  			// Check for existing file
  1.2108 @@ -1783,7 +2119,7 @@
  1.2109  					QMessageBox::Warning,
  1.2110  					QMessageBox::Yes | QMessageBox::Default,
  1.2111  					QMessageBox::Cancel | QMessageBox::Escape,
  1.2112 -					QMessageBox::QMessageBox::NoButton);
  1.2113 +					QMessageBox::NoButton);
  1.2114  				mb.setButtonText( QMessageBox::Yes, tr("Overwrite") );
  1.2115  				mb.setButtonText( QMessageBox::Cancel, tr("Cancel"));
  1.2116  				switch( mb.exec() ) 
  1.2117 @@ -1842,9 +2178,9 @@
  1.2118  
  1.2119  void Main::fileImportFirefoxBookmarks()
  1.2120  {
  1.2121 -	QFileDialog *fd=new QFileDialog( this);
  1.2122 +	Q3FileDialog *fd=new Q3FileDialog( this);
  1.2123  	fd->setDir (vymBaseDir.homeDirPath()+"/.mozilla/firefox");
  1.2124 -	fd->setMode (QFileDialog::ExistingFiles);
  1.2125 +	fd->setMode (Q3FileDialog::ExistingFiles);
  1.2126  	fd->addFilter ("Firefox "+tr("Bookmarks")+" (*.html)");
  1.2127  	fd->setCaption(tr("Import")+" "+"Firefox "+tr("Bookmarks"));
  1.2128  	fd->show();
  1.2129 @@ -1871,10 +2207,9 @@
  1.2130  {
  1.2131  	ImportMM im;
  1.2132  
  1.2133 -	QFileDialog *fd=new QFileDialog( this);
  1.2134 -	if (!lastFileDir.isEmpty()) 
  1.2135 -		fd->setDir (lastFileDir);
  1.2136 -	fd->setMode (QFileDialog::ExistingFiles);
  1.2137 +	Q3FileDialog *fd=new Q3FileDialog( this);
  1.2138 +	fd->setDir (lastFileDir);
  1.2139 +	fd->setMode (Q3FileDialog::ExistingFiles);
  1.2140  	fd->addFilter ("Mind Manager (*.mmap)");
  1.2141  	fd->setCaption(tr("Import")+" "+"Mind Manager");
  1.2142  	fd->show();
  1.2143 @@ -1949,18 +2284,23 @@
  1.2144  	}	
  1.2145  }
  1.2146  
  1.2147 -void Main::fileExportImage(int item)
  1.2148 +void Main::fileExportImage()
  1.2149  {
  1.2150  	MapEditor *me=currentMapEditor();
  1.2151  	if (me)
  1.2152  	{
  1.2153 -		QString fn = QFileDialog::getSaveFileName( QString::null, "Image  (*.bmp *.jpg *.pbm *.pgm *.png *.ppm *xbm *.xpm)",
  1.2154 -							   this );
  1.2155 -		if ( !fn.isEmpty() ) 
  1.2156 -			me->exportImage(fn,item);
  1.2157 -		else 
  1.2158 -			statusBar()->message( tr("Couldn't save %1").arg(fn), statusbarTime );
  1.2159 -		
  1.2160 +		QStringList fl;
  1.2161 +		QFileDialog *fd=new QFileDialog (this);
  1.2162 +		fd->setCaption (tr("Export map as image"));
  1.2163 +		fd->setFileMode(QFileDialog::AnyFile);
  1.2164 +		fd->setFilters  (imageIO.getFilters() );
  1.2165 +		fd->setDirectory (lastImageDir);
  1.2166 +		if (fd->exec())
  1.2167 +		{
  1.2168 +			fl=fd->selectedFiles();
  1.2169 +			qWarning ("Selected "+fl.first()+"  filter: "+fd->selectedFilter());
  1.2170 +			me->exportImage (fl.first(), imageIO.getType (fd->selectedFilter() ) );
  1.2171 +		} 
  1.2172  	}
  1.2173  }
  1.2174  
  1.2175 @@ -2032,13 +2372,13 @@
  1.2176  void Main::fileExportOOPresentation()
  1.2177  {
  1.2178  	ExportOOFileDialog *fd=new ExportOOFileDialog( this,__VYM " - "+tr("Export to")+" Open Office");
  1.2179 -	// FIXME add extra info in dialog
  1.2180 +	// TODO add preview in dialog
  1.2181  	//ImagePreview *p =new ImagePreview (fd);
  1.2182  	//fd->setContentsPreviewEnabled( TRUE );
  1.2183  	//fd->setContentsPreview( p, p );
  1.2184  	//fd->setPreviewMode( QFileDialog::Contents );
  1.2185  	fd->setCaption(__VYM " - " +tr("Export to")+" Open Office");
  1.2186 -	//fd->setDir (lastImageDir);
  1.2187 +	fd->setDir (QDir().current());
  1.2188  	if (fd->foundConfig())
  1.2189  	{
  1.2190  		fd->show();
  1.2191 @@ -2046,6 +2386,9 @@
  1.2192  		if ( fd->exec() == QDialog::Accepted )
  1.2193  		{
  1.2194  			QString fn=fd->selectedFile();
  1.2195 +			if (!fn.contains (".odp"))
  1.2196 +				fn +=".odp";
  1.2197 +
  1.2198  			//lastImageDir=fn.left(fn.findRev ("/"));
  1.2199  			if (currentMapEditor())
  1.2200  				currentMapEditor()->exportOOPresentation(fn,fd->selectedConfig());	
  1.2201 @@ -2053,8 +2396,8 @@
  1.2202  	} else
  1.2203  	{
  1.2204  		QMessageBox::warning(0, 
  1.2205 -			tr("Warning"),
  1.2206 -			tr("Couldn't find configuration for export to Open Office\n"));
  1.2207 +		tr("Warning"),
  1.2208 +		tr("Couldn't find configuration for export to Open Office\n"));
  1.2209  	}
  1.2210  }
  1.2211  
  1.2212 @@ -2121,13 +2464,8 @@
  1.2213  				QMessageBox::Cancel | QMessageBox::Escape );
  1.2214  			mb.setButtonText( QMessageBox::Yes, tr("Save map") );
  1.2215  			mb.setButtonText( QMessageBox::No, tr("Discard changes") );
  1.2216 +			mb.setModal (true);
  1.2217  			mb.show();
  1.2218 -			// Call undocumented function: setActiveWindow is only
  1.2219 -			// possible, if widget is visible. This depends on
  1.2220 -			// windowmanager...
  1.2221 -#if defined(Q_OS_LINUX)
  1.2222 -			qt_wait_for_window_manager( this);
  1.2223 -#endif			
  1.2224  			mb.setActiveWindow();
  1.2225  			switch( mb.exec() ) {
  1.2226  				case QMessageBox::Yes:
  1.2227 @@ -2180,13 +2518,6 @@
  1.2228  {
  1.2229  	findWindow->popup();
  1.2230  	findWindow->raise();
  1.2231 -
  1.2232 -	// Call undocumented function: setActiveWindow is only
  1.2233 -	// possible, if widget is visible. This depends on
  1.2234 -	// windowmanager...
  1.2235 -#if defined(Q_OS_LINUX)
  1.2236 -	qt_wait_for_window_manager( this);
  1.2237 -#endif	
  1.2238  	findWindow->setActiveWindow();
  1.2239  }
  1.2240  
  1.2241 @@ -2209,20 +2540,86 @@
  1.2242  	currentMapEditor()->findReset();
  1.2243  }
  1.2244  
  1.2245 +void Main::openTabs(QStringList urls)
  1.2246 +{
  1.2247 +	if (!urls.isEmpty())
  1.2248 +	{	
  1.2249 +		bool success=true;
  1.2250 +		QStringList args;
  1.2251 +		QString browser=settings.value("/mainwindow/readerURL" ).toString();
  1.2252 +		QProcess *p;
  1.2253 +		if (!procBrowser ||  procBrowser->state()!=QProcess::Running)
  1.2254 +		{
  1.2255 +			QString u=urls.takeFirst();
  1.2256 +			procBrowser = new QProcess( this );
  1.2257 +			args<<u;
  1.2258 +			procBrowser->start(browser,args);
  1.2259 +			if ( !procBrowser->waitForStarted())
  1.2260 +			{
  1.2261 +				// try to set path to browser
  1.2262 +				QMessageBox::warning(0, 
  1.2263 +					tr("Warning"),
  1.2264 +					tr("Couldn't find a viewer to open %1.\n").arg(u)+
  1.2265 +					tr("Please use Settings->")+tr("Set application to open an URL"));
  1.2266 +				return;
  1.2267 +			}
  1.2268 +			sleep (3);
  1.2269 +		}
  1.2270 +		if (browser.contains("konqueror"))
  1.2271 +		{
  1.2272 +			for (int i=0; i<urls.size(); i++)
  1.2273 +			{
  1.2274 +				// Open new browser
  1.2275 +				// Try to open new tab in existing konqueror started previously by vym
  1.2276 +				p=new QProcess (this);
  1.2277 +				args.clear();
  1.2278 +				args<< QString("konqueror-%1").arg(procBrowser->pid())<< 
  1.2279 +					"konqueror-mainwindow#1"<< 
  1.2280 +					"newTab" << 
  1.2281 +					urls.at(i);
  1.2282 +				p->start ("dcop",args);
  1.2283 +				if ( !p->waitForStarted() ) success=false;
  1.2284 +			}
  1.2285 +			if (!success)
  1.2286 +				QMessageBox::warning(0, 
  1.2287 +					tr("Warning"),
  1.2288 +					tr("Couldn't start %1 to open a new tab in %2.").arg("dcop").arg("konqueror"));
  1.2289 +			return;		
  1.2290 +		} else if (browser.contains ("firefox") || browser.contains ("mozilla") )
  1.2291 +		{
  1.2292 +			for (int i=0; i<urls.size(); i++)
  1.2293 +			{
  1.2294 +				// Try to open new tab in firefox
  1.2295 +				p=new QProcess (this);
  1.2296 +				args<< "-remote"<< QString("openurl(%1,new-tab)").arg(urls.at(i));
  1.2297 +				p->start (browser,args);
  1.2298 +				if ( !p->waitForStarted() ) success=false;
  1.2299 +			}			
  1.2300 +			if (!success)
  1.2301 +				QMessageBox::warning(0, 
  1.2302 +					tr("Warning"),
  1.2303 +					tr("Couldn't start %1 to open a new tab").arg(browser));
  1.2304 +			return;		
  1.2305 +		}			
  1.2306 +		QMessageBox::warning(0, 
  1.2307 +			tr("Warning"),
  1.2308 +			tr("Sorry, currently only Konqueror and Mozilla support tabbed browsing."));
  1.2309 +	}	
  1.2310 +}
  1.2311 +
  1.2312  void Main::editOpenURL()
  1.2313  {
  1.2314  	// Open new browser
  1.2315  	if (currentMapEditor())
  1.2316  	{	
  1.2317  	    QString url=currentMapEditor()->getURL();
  1.2318 +		QStringList args;
  1.2319  		if (url=="") return;
  1.2320 -		QString browser=settings.readEntry("/vym/mainwindow/readerURL" );
  1.2321 +		QString browser=settings.value("/mainwindow/readerURL" ).toString();
  1.2322  		procBrowser = new QProcess( this );
  1.2323 -
  1.2324 -		procBrowser->addArgument( browser);
  1.2325 -		procBrowser->addArgument( url);
  1.2326 -
  1.2327 -		if ( !procBrowser->start() ) 
  1.2328 +		args<<url;
  1.2329 +		procBrowser->start(browser,args);
  1.2330 +		if ( !procBrowser->waitForStarted())
  1.2331  		{
  1.2332  			// try to set path to browser
  1.2333  			QMessageBox::warning(0, 
  1.2334 @@ -2237,45 +2634,21 @@
  1.2335  {
  1.2336  	if (currentMapEditor())
  1.2337  	{	
  1.2338 -	    QString url=currentMapEditor()->getURL();
  1.2339 -		if (url=="") return;
  1.2340 -		QString browser=settings.readEntry("/vym/mainwindow/readerURL" );
  1.2341 -		if (procBrowser && procBrowser->isRunning())
  1.2342 -		{
  1.2343 -			if (browser.contains("konqueror"))
  1.2344 -			{
  1.2345 -				// Try to open new tab in existing konqueror started previously by vym
  1.2346 -				QProcess *p=new QProcess (this);
  1.2347 -				p->addArgument ("dcop");
  1.2348 -				p->addArgument (QString("konqueror-%1").arg(procBrowser->processIdentifier()));
  1.2349 -				p->addArgument ("konqueror-mainwindow#1");
  1.2350 -				p->addArgument ("newTab");
  1.2351 -				p->addArgument (url);
  1.2352 -				if ( !p->start() ) 
  1.2353 -					// try to set browser
  1.2354 -					QMessageBox::warning(0, 
  1.2355 -						tr("Warning"),
  1.2356 -						tr("Couldn't start %1 to open a new tab in %2.").arg("dcop").arg("konqueror"));
  1.2357 -				return;		
  1.2358 -			} else if (browser.contains ("firefox") || browser.contains ("mozilla") )
  1.2359 -			{
  1.2360 -				// Try to open new tab in firefox
  1.2361 -				QProcess *p=new QProcess (this);
  1.2362 -				p->addArgument (browser);
  1.2363 -				p->addArgument ("-remote");
  1.2364 -				p->addArgument (QString("openurl(%1,new-tab)").arg(url));
  1.2365 -				if ( !p->start() ) 
  1.2366 -					// try to set browser
  1.2367 -					QMessageBox::warning(0, 
  1.2368 -						tr("Warning"),
  1.2369 -						tr("Couldn't start %1 to open a new tab").arg(browser));
  1.2370 -				return;		
  1.2371 -			}
  1.2372 -		}
  1.2373 -		// Open new browser
  1.2374 -		editOpenURL();
  1.2375 +	    QStringList urls;
  1.2376 +		urls.append(currentMapEditor()->getURL());
  1.2377 +		openTabs (urls);
  1.2378  	}	
  1.2379  }
  1.2380 +void Main::editOpenMultipleURLTabs()
  1.2381 +{
  1.2382 +	if (currentMapEditor())
  1.2383 +	{	
  1.2384 +	    QStringList urls;
  1.2385 +		urls=currentMapEditor()->getURLs();
  1.2386 +		openTabs (urls);
  1.2387 +	}	
  1.2388 +}
  1.2389 +
  1.2390  
  1.2391  void Main::editURL()
  1.2392  {
  1.2393 @@ -2301,13 +2674,66 @@
  1.2394  	    currentMapEditor()->editFATE2URL();
  1.2395  }
  1.2396  
  1.2397 -void Main::editOpenVymLink()
  1.2398 +void Main::editHeading()
  1.2399  {
  1.2400 -	// Get current path to map
  1.2401 -	QString currentVymLink;
  1.2402 -	if (currentMapEditor())
  1.2403 +	if (lineedit->isVisible())
  1.2404  	{
  1.2405 -		currentVymLink=currentMapEditor()->getVymLink();	
  1.2406 +		if (currentMapEditor())
  1.2407 +		{	
  1.2408 +			MapEditor *me=currentMapEditor();
  1.2409 +			QString oldSel=me->getSelectString();
  1.2410 +			if (me->select (editSel))
  1.2411 +				me->setHeading(lineedit->text());
  1.2412 +			me->select (oldSel);
  1.2413 +		}	
  1.2414 +		lineedit->releaseKeyboard();
  1.2415 +		lineedit->hide();
  1.2416 +		setFocus();
  1.2417 +	} else
  1.2418 +	{
  1.2419 +		if (currentMapEditor())
  1.2420 +		{
  1.2421 +			bool ok;
  1.2422 +			QPoint p;
  1.2423 +			QString s=currentMapEditor()->getHeading(ok,p);
  1.2424 +
  1.2425 +			if (ok)
  1.2426 +			{
  1.2427 +#if defined(Q_OS_MACX)
  1.2428 +				p = currentMapEditor()->mapToGlobal( currentMapEditor()->worldMatrix().map( p));
  1.2429 +				QDialog *d =new QDialog(NULL);
  1.2430 +				QLineEdit *le=new QLineEdit (d);
  1.2431 +				d->setWindowFlags (Qt::FramelessWindowHint);
  1.2432 +				d->setGeometry(p.x(),p.y(),200,25);
  1.2433 +				le->resize (d->size());
  1.2434 +				le->setText (s);
  1.2435 +				le->selectAll();
  1.2436 +				connect (le, SIGNAL (returnPressed()), d, SLOT (accept()));
  1.2437 +				d->activateWindow();
  1.2438 +				d->exec();
  1.2439 +				currentMapEditor()->setHeading (le->text());
  1.2440 +#else
  1.2441 +				p = currentMapEditor()->mapTo(this, currentMapEditor()->worldMatrix().map( p));
  1.2442 +				lineedit->setGeometry(p.x(),p.y(),200,25);
  1.2443 +				lineedit->setText(s);
  1.2444 +				lineedit->setCursorPosition(1);
  1.2445 +				lineedit->selectAll();
  1.2446 +				lineedit->show();
  1.2447 +				lineedit->grabKeyboard();
  1.2448 +				lineedit->setFocus();
  1.2449 +
  1.2450 +				editSel=currentMapEditor()->getSelectString();
  1.2451 +#endif
  1.2452 +
  1.2453 +			}
  1.2454 +		}
  1.2455 +	}
  1.2456 +}
  1.2457 +
  1.2458 +void Main::openVymLinks(const QStringList &vl)
  1.2459 +{
  1.2460 +	for (int j=0; j<vl.size(); j++)
  1.2461 +	{
  1.2462  		// compare path with already loaded maps
  1.2463  		int index=-1;
  1.2464  		int i;
  1.2465 @@ -2315,7 +2741,7 @@
  1.2466  		for (i=0;i<=tabWidget->count() -1;i++)
  1.2467  		{
  1.2468  			me=(MapEditor*)tabWidget->page(i);
  1.2469 -			if (currentVymLink==me->getFilePath() )
  1.2470 +			if (vl.at(j)==me->getFilePath() )
  1.2471  			{
  1.2472  				index=i;
  1.2473  				break;
  1.2474 @@ -2324,12 +2750,12 @@
  1.2475  		if (index<0)
  1.2476  		// Load map
  1.2477  		{
  1.2478 -			if (!QFile(currentVymLink).exists() )
  1.2479 +			if (!QFile(vl.at(j)).exists() )
  1.2480  				QMessageBox::critical( 0, tr( "Critical Error" ),
  1.2481 -				   tr("Couldn't open map %1").arg(currentVymLink));
  1.2482 +				   tr("Couldn't open map %1").arg(vl.at(j)));
  1.2483  			else
  1.2484  			{
  1.2485 -				fileLoad (currentVymLink, NewMap);
  1.2486 +				fileLoad (vl.at(j), NewMap);
  1.2487  				tabWidget->setCurrentPage (tabWidget->count()-1);	
  1.2488  			}
  1.2489  		} else
  1.2490 @@ -2338,6 +2764,26 @@
  1.2491  	}
  1.2492  }
  1.2493  
  1.2494 +void Main::editOpenVymLink()
  1.2495 +{
  1.2496 +	if (currentMapEditor())
  1.2497 +	{
  1.2498 +		QStringList vl;
  1.2499 +		vl.append(currentMapEditor()->getVymLink());	
  1.2500 +		openVymLinks (vl);
  1.2501 +	}
  1.2502 +}
  1.2503 +
  1.2504 +void Main::editOpenMultipleVymLinks()
  1.2505 +{
  1.2506 +	QString currentVymLink;
  1.2507 +	if (currentMapEditor())
  1.2508 +	{
  1.2509 +		QStringList vl=currentMapEditor()->getVymLinks();
  1.2510 +		openVymLinks (vl);
  1.2511 +	}
  1.2512 +}
  1.2513 +
  1.2514  void Main::editVymLink()
  1.2515  {
  1.2516  	if (currentMapEditor())
  1.2517 @@ -2390,15 +2836,10 @@
  1.2518  	}	
  1.2519  }
  1.2520  
  1.2521 -void Main::editHeading()
  1.2522 -{
  1.2523 -	if (currentMapEditor())
  1.2524 -		currentMapEditor()->editHeading();
  1.2525 -}
  1.2526 -
  1.2527  void Main::editNewBranch()
  1.2528  {
  1.2529 -	if (currentMapEditor())
  1.2530 +
  1.2531 +	if (!lineedit->isVisible() && currentMapEditor())
  1.2532  		currentMapEditor()->addNewBranch(0);
  1.2533  }
  1.2534  
  1.2535 @@ -2495,22 +2936,23 @@
  1.2536  		currentMapEditor()->loadFloatImage();
  1.2537  }
  1.2538  
  1.2539 -void Main::editSaveImage(int item)
  1.2540 +void Main::editSaveImage()
  1.2541  {
  1.2542  	if (currentMapEditor())
  1.2543 -		currentMapEditor()->saveFloatImage(item);
  1.2544 +		currentMapEditor()->saveFloatImage();
  1.2545  }
  1.2546  
  1.2547 -void Main::editFollowXLink(int item)
  1.2548 +void Main::editFollowXLink(QAction *a)
  1.2549 +{
  1.2550 +
  1.2551 +	if (currentMapEditor())
  1.2552 +		currentMapEditor()->followXLink(branchXLinksContextMenuFollow->actions().indexOf(a));
  1.2553 +}
  1.2554 +
  1.2555 +void Main::editEditXLink(QAction *a)
  1.2556  {
  1.2557  	if (currentMapEditor())
  1.2558 -		currentMapEditor()->followXLink(branchLinksContextMenu->indexOf(item));
  1.2559 -}
  1.2560 -
  1.2561 -void Main::editEditXLink(int item)
  1.2562 -{
  1.2563 -	if (currentMapEditor())
  1.2564 -		currentMapEditor()->editXLink(branchLinksContextMenuDup->indexOf(item));
  1.2565 +		currentMapEditor()->editXLink(branchXLinksContextMenuEdit->actions().indexOf(a));
  1.2566  }
  1.2567  
  1.2568  void Main::formatSelectColor()
  1.2569 @@ -2624,7 +3066,7 @@
  1.2570  {
  1.2571  	if (currentMapEditor())
  1.2572  	{
  1.2573 -		QWMatrix m;
  1.2574 +		QMatrix m;
  1.2575  		m.reset();
  1.2576  		currentMapEditor()->setWorldMatrix( m );
  1.2577  		currentMapEditor()->setViewCenter();
  1.2578 @@ -2636,7 +3078,7 @@
  1.2579  {
  1.2580  	if (currentMapEditor())
  1.2581  	{
  1.2582 -		QWMatrix m = currentMapEditor()->worldMatrix();
  1.2583 +		QMatrix m = currentMapEditor()->worldMatrix();
  1.2584  		m.scale( 1.25, 1.25 );
  1.2585  		currentMapEditor()->setWorldMatrix( m );
  1.2586  		currentMapEditor()->setViewCenter();
  1.2587 @@ -2648,7 +3090,7 @@
  1.2588  {
  1.2589  	if (currentMapEditor())
  1.2590  	{
  1.2591 -		QWMatrix m = currentMapEditor()->worldMatrix();
  1.2592 +		QMatrix m = currentMapEditor()->worldMatrix();
  1.2593  		m.scale( 0.8, 0.8 );
  1.2594  		currentMapEditor()->setWorldMatrix( m );
  1.2595  		currentMapEditor()->setViewCenter();
  1.2596 @@ -2670,9 +3112,9 @@
  1.2597  	bool ok;
  1.2598  	QString text = QInputDialog::getText(
  1.2599  		"VYM", tr("Set application to open PDF files")+":", QLineEdit::Normal,
  1.2600 -		settings.readEntry("/vym/mainwindow/readerPDF"), &ok, this );
  1.2601 +		settings.value("/mainwindow/readerPDF").toString(), &ok, this );
  1.2602  	if (ok)
  1.2603 -		settings.writeEntry ("/vym/mainwindow/readerPDF",text);
  1.2604 +		settings.setValue ("/mainwindow/readerPDF",text);
  1.2605  	return ok;
  1.2606  }
  1.2607  
  1.2608 @@ -2683,10 +3125,10 @@
  1.2609  	bool ok;
  1.2610  	QString text = QInputDialog::getText(
  1.2611  		"VYM", tr("Set application to open an URL")+":", QLineEdit::Normal,
  1.2612 -		settings.readEntry("/vym/mainwindow/readerURL")
  1.2613 +		settings.value("/mainwindow/readerURL").toString()
  1.2614  		, &ok, this );
  1.2615  	if (ok)
  1.2616 -		settings.writeEntry ("/vym/mainwindow/readerURL",text);
  1.2617 +		settings.setValue ("/mainwindow/readerURL",text);
  1.2618  	return ok;
  1.2619  }
  1.2620  
  1.2621 @@ -2694,7 +3136,7 @@
  1.2622  {
  1.2623  	if (actionSettingsUseDelKey->isOn())
  1.2624  	{
  1.2625 -		actionEditDelete->setAccel (QKeySequence (Key_Delete));
  1.2626 +		actionEditDelete->setAccel (QKeySequence (Qt::Key_Delete));
  1.2627  	} else
  1.2628  	{
  1.2629  		actionEditDelete->setAccel (QKeySequence (""));
  1.2630 @@ -2793,7 +3235,7 @@
  1.2631  	
  1.2632  	Process *pdfProc = new Process();
  1.2633  	pdfProc->clearArguments();
  1.2634 -	pdfProc->addArgument( settings.readEntry("/vym/mainwindow/readerPDF"));
  1.2635 +	pdfProc->addArgument( settings.value("/mainwindow/readerPDF").toString());
  1.2636  	pdfProc->addArgument( docpath);
  1.2637  
  1.2638  	if ( !pdfProc->start() )