1.1 --- a/mainwindow.cpp Tue Jun 13 13:54:53 2006 +0000
1.2 +++ b/mainwindow.cpp Wed Jun 14 10:28:01 2006 +0000
1.3 @@ -2,10 +2,6 @@
1.4
1.5 #include "mainwindow.h"
1.6
1.7 -//#include <qstatusbar.h>
1.8 -//#include <qmessagebox.h>
1.9 -//#include <qmenubar.h>
1.10 -//#include <qapplication.h>
1.11 #include <qpainter.h>
1.12 #include <qprinter.h>
1.13 #include <qfile.h>
1.14 @@ -235,7 +231,7 @@
1.15 setupHelpActions();
1.16
1.17 // After menu is created, we can enable some actions
1.18 -//FIXME testing actionFilePrint->setEnabled (true);
1.19 +//FIXME QT3 testing actionFilePrint->setEnabled (true);
1.20
1.21 statusBar();
1.22
1.23 @@ -455,8 +451,7 @@
1.24 {
1.25 QToolBar *tb = addToolBar( tr ("&Edit") );
1.26 tb->setLabel( "Edit Actions" );
1.27 - Q3PopupMenu *menu = new Q3PopupMenu( this );
1.28 - menuBar()->insertItem( tr( "&Edit" ), menu );
1.29 + QMenu *editMenu = menuBar()->addMenu( tr("&Edit") );
1.30
1.31 QAction *a;
1.32 QAction *alt;
1.33 @@ -465,8 +460,8 @@
1.34 a->setStatusTip (tr( "Undo" ) );
1.35 a->setShortcut ( Qt::CTRL + Qt::Key_Z );
1.36 a->setEnabled (false);
1.37 - a->addTo( tb );
1.38 - a->addTo( menu );
1.39 + tb->addAction (a);
1.40 + editMenu->addAction (a);
1.41 actionEditUndo=a;
1.42
1.43 if (settings.readBoolEntry( "/vym/mainwindow/showTestMenu",false))
1.44 @@ -474,18 +469,17 @@
1.45 a = new QAction( QPixmap( iconPath+"redo.png"), tr( "&Redo" ), this);
1.46 a->setStatusTip (tr( "Redo" ));
1.47 a->setShortcut (Qt::CTRL + Qt::Key_Y );
1.48 - a->addTo( tb );
1.49 - a->addTo( menu );
1.50 + editMenu->addAction (a);
1.51 connect( a, SIGNAL( activated() ), this, SLOT( editRedo() ) );
1.52 }
1.53
1.54 - menu->insertSeparator();
1.55 + editMenu->addSeparator();
1.56 a = new QAction(QPixmap( iconPath+"editcopy.png"), tr( "&Copy" ), this);
1.57 a->setStatusTip ( tr( "Copy" ) );
1.58 a->setShortcut (Qt::CTRL + Qt::Key_C );
1.59 a->setEnabled (false);
1.60 - a->addTo( tb );
1.61 - a->addTo( menu );
1.62 + tb->addAction (a);
1.63 + editMenu->addAction (a);
1.64 connect( a, SIGNAL( activated() ), this, SLOT( editCopy() ) );
1.65 actionEditCopy=a;
1.66
1.67 @@ -493,8 +487,8 @@
1.68 a->setStatusTip ( tr( "Cut" ) );
1.69 a->setShortcut (Qt::CTRL + Qt::Key_X );
1.70 a->setEnabled (false);
1.71 - a->addTo( tb );
1.72 - a->addTo( menu );
1.73 + tb->addAction (a);
1.74 + editMenu->addAction (a);
1.75 actionEditCut=a;
1.76 connect( a, SIGNAL( activated() ), this, SLOT( editCut() ) );
1.77
1.78 @@ -503,16 +497,111 @@
1.79 a->setStatusTip ( tr( "Paste" ) );
1.80 a->setShortcut ( Qt::CTRL + Qt::Key_V );
1.81 a->setEnabled (false);
1.82 - a->addTo( tb );
1.83 - a->addTo( menu );
1.84 + tb->addAction (a);
1.85 + editMenu->addAction (a);
1.86 actionEditPaste=a;
1.87
1.88 + // Shortcuts to modify heading:
1.89 + /*
1.90 + a = new QAction(tr( "Edit heading" ),this);
1.91 + a->setStatusTip ( tr( "edit Heading" ));
1.92 + a->setShortcut ( Qt::Key_Enter);
1.93 + connect( a, SIGNAL( triggered() ), this, SLOT( editHeading() ) );
1.94 + actionListBranches.append(a);
1.95 + */
1.96 + a = new QAction( tr( "Edit heading" ), this);
1.97 + a->setStatusTip (tr( "edit Heading" ));
1.98 + a->setShortcut (Qt::Key_Return );
1.99 + connect( a, SIGNAL( activated() ), this, SLOT( editHeading() ) );
1.100 + //actionListBranches.append(a);
1.101 + editMenu->addAction (a);
1.102 + actionEditHeading=a;
1.103 + /*
1.104 + a = new QAction( tr( "Edit heading" ),this);
1.105 + a->setStatusTip (tr( "edit Heading" ));
1.106 + a->setShortcut ( Qt::Key_F2 );
1.107 + connect( a, SIGNAL( activated() ), this, SLOT( editHeading() ) );
1.108 + a->setEnabled (false);
1.109 + actionListBranches.append(a);
1.110 + */
1.111 +
1.112 + // Shortcut to delete selection
1.113 + a = new QAction( tr( "Delete Selection" ),this);
1.114 + a->setStatusTip (tr( "Delete Selection" ));
1.115 + a->setShortcut ( Qt::Key_Delete);
1.116 + connect( a, SIGNAL( activated() ), this, SLOT( editDeleteSelection() ) );
1.117 + a->setEnabled (false);
1.118 + actionEditDelete=a;
1.119 +
1.120 + // Shortcut to add branch
1.121 + alt = new QAction(QPixmap(iconPath+"newbranch.png"), tr( "Add branch as child" ), this);
1.122 + alt->setStatusTip ( tr( "Add a branch as child of selection" ));
1.123 + alt->setShortcut (Qt::Key_A);
1.124 + connect( alt, SIGNAL( activated() ), this, SLOT( editNewBranch() ) );
1.125 + a = new QAction(QPixmap(iconPath+"newbranch.png"), tr( "Add branch as child" ), this);
1.126 + a->setStatusTip ( tr( "Add a branch as child of selection" ));
1.127 + a->setShortcut (Qt::Key_Insert);
1.128 +// a->setEnabled (false);
1.129 + connect( a, SIGNAL( activated() ), this, SLOT( editNewBranch() ) );
1.130 + actionListBranches.append(a);
1.131 + #if defined (Q_OS_MACX)
1.132 + // In OSX show different shortcut in menues, the keys work indepently always
1.133 + actionEditAddBranch=alt;
1.134 + #else
1.135 + actionEditAddBranch=a;
1.136 + #endif
1.137 + editMenu->addAction (actionEditAddBranch);
1.138 + tb->addAction (actionEditAddBranch);
1.139 +
1.140 +
1.141 + // Add branch by inserting it at selection
1.142 + a = new QAction(tr( "Add branch (insert)" ), this);
1.143 + a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" ));
1.144 + a->setShortcut (Qt::ALT + Qt::Key_Insert );
1.145 + connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchHere() ) );
1.146 + a->setEnabled (false);
1.147 + actionListBranches.append(a);
1.148 + actionEditAddBranchHere=a;
1.149 + a = new QAction(tr( "Add branch (insert)" ),this);
1.150 + a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" ));
1.151 + a->setShortcut ( Qt::ALT + Qt::Key_A );
1.152 + connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchHere() ) );
1.153 + actionListBranches.append(a);
1.154 +
1.155 + // Add branch above
1.156 + a = new QAction(tr( "Add branch above" ), this);
1.157 + a->setStatusTip ( tr( "Add a branch above selection" ));
1.158 + a->setShortcut (Qt::SHIFT+Qt::Key_Insert );
1.159 + connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchAbove() ) );
1.160 + a->setEnabled (false);
1.161 + actionListBranches.append(a);
1.162 + actionEditAddBranchAbove=a;
1.163 + a = new QAction(tr( "Add branch above" ), this);
1.164 + a->setStatusTip ( tr( "Add a branch above selection" ));
1.165 + a->setShortcut (Qt::SHIFT+Qt::Key_A );
1.166 + connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchAbove() ) );
1.167 + actionListBranches.append(a);
1.168 +
1.169 + // Add branch below
1.170 + a = new QAction(tr( "Add branch below" ), this);
1.171 + a->setStatusTip ( tr( "Add a branch below selection" ));
1.172 + a->setShortcut (Qt::CTRL +Qt::Key_Insert );
1.173 + connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchBelow() ) );
1.174 + a->setEnabled (false);
1.175 + actionListBranches.append(a);
1.176 + actionEditAddBranchBelow=a;
1.177 + a = new QAction(tr( "Add branch below" ), this);
1.178 + a->setStatusTip ( tr( "Add a branch below selection" ));
1.179 + a->setShortcut (Qt::CTRL +Qt::Key_A );
1.180 + connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchBelow() ) );
1.181 + actionListBranches.append(a);
1.182 +
1.183 a = new QAction(QPixmap(iconPath+"up.png" ), tr( "Move up" ), this);
1.184 a->setStatusTip ( tr( "Move branch up" ) );
1.185 a->setShortcut (Qt::Key_PageUp );
1.186 a->setEnabled (false);
1.187 - a->addTo( tb );
1.188 - a->addTo( menu );
1.189 + tb->addAction (a);
1.190 + editMenu->addAction (a);
1.191 connect( a, SIGNAL( activated() ), this, SLOT( editMoveUp() ) );
1.192 actionEditMoveUp=a;
1.193
1.194 @@ -521,8 +610,8 @@
1.195 a->setStatusTip (tr( "Move branch down" ) );
1.196 a->setShortcut ( Qt::Key_PageDown );
1.197 a->setEnabled (false);
1.198 - a->addTo( tb );
1.199 - a->addTo( menu );
1.200 + tb->addAction (a);
1.201 + editMenu->addAction (a);
1.202 actionEditMoveDown=a;
1.203
1.204
1.205 @@ -541,29 +630,30 @@
1.206 #endif
1.207 actionEditToggleScroll->setEnabled (false);
1.208 actionEditToggleScroll->setToggleAction(true);
1.209 - actionEditToggleScroll->addTo( tb );
1.210 - actionEditToggleScroll->addTo( menu );
1.211 + tb->addAction (actionEditToggleScroll);
1.212 + editMenu->addAction ( actionEditToggleScroll);
1.213 + editMenu->addAction (actionEditToggleScroll);
1.214 actionListBranches.append(actionEditToggleScroll);
1.215
1.216 a = new QAction( tr( "Unscroll all scrolled branches" ), this);
1.217 a->setStatusTip (tr( "Unscroll all" ));
1.218 - a->addTo( menu );
1.219 + editMenu->addAction (a);
1.220 connect( a, SIGNAL( activated() ), this, SLOT( editUnScrollAll() ) );
1.221
1.222 - menu->insertSeparator();
1.223 + editMenu->addSeparator();
1.224
1.225 a = new QAction( QPixmap(iconPath+"find.png"), tr( "Find"+QString("...") ), this);
1.226 a->setStatusTip (tr( "Find" ) );
1.227 a->setShortcut (Qt::CTRL + Qt::Key_F );
1.228 - a->addTo( menu );
1.229 + editMenu->addAction (a);
1.230 connect( a, SIGNAL( activated() ), this, SLOT( editOpenFindWindow() ) );
1.231
1.232 - menu->insertSeparator();
1.233 + editMenu->addSeparator();
1.234
1.235 a = new QAction( QPixmap(flagsPath+"flag-url.png"), tr( "Open URL" ), this);
1.236 a->setShortcut (Qt::CTRL + Qt::Key_U );
1.237 a->setShortcut (tr( "Open URL" ));
1.238 - a->addTo( tb );
1.239 + tb->addAction (a);
1.240 a->setEnabled (false);
1.241 connect( a, SIGNAL( activated() ), this, SLOT( editOpenURL() ) );
1.242 actionEditOpenURL=a;
1.243 @@ -606,7 +696,7 @@
1.244
1.245 a = new QAction(QPixmap(flagsPath+"flag-vymlink.png"), tr( "Jump to map" ), this);
1.246 a->setStatusTip ( tr( "Jump to another vym map, if needed load it first" ));
1.247 - a->addTo( tb );
1.248 + tb->addAction (a);
1.249 a->setEnabled (false);
1.250 connect( a, SIGNAL( activated() ), this, SLOT( editOpenVymLink() ) );
1.251 actionEditOpenVymLink=a;
1.252 @@ -628,7 +718,7 @@
1.253 a->setStatusTip ( tr( "Hide object in exports" ) );
1.254 a->setShortcut (Qt::Key_H );
1.255 a->setToggleAction(true);
1.256 - a->addTo( tb );
1.257 + tb->addAction (a);
1.258 a->setEnabled (false);
1.259 connect( a, SIGNAL( activated() ), this, SLOT( editToggleHideExport() ) );
1.260 actionEditToggleHideExport=a;
1.261 @@ -639,99 +729,7 @@
1.262 connect( a, SIGNAL( activated() ), this, SLOT( editMapInfo() ) );
1.263 actionEditMapInfo=a;
1.264
1.265 - menu->insertSeparator();
1.266 -
1.267 - // Shortcuts to modify heading:
1.268 - /*
1.269 - a = new QAction(tr( "Edit heading" ),this);
1.270 - a->setStatusTip ( tr( "edit Heading" ));
1.271 - a->setShortcut ( Qt::Key_Enter);
1.272 - connect( a, SIGNAL( triggered() ), this, SLOT( editHeading() ) );
1.273 - actionListBranches.append(a);
1.274 - */
1.275 - a = new QAction( tr( "Edit heading" ), this);
1.276 - a->setStatusTip (tr( "edit Heading" ));
1.277 - a->setShortcut (Qt::Key_Return );
1.278 - connect( a, SIGNAL( activated() ), this, SLOT( editHeading() ) );
1.279 - //actionListBranches.append(a);
1.280 - a->addTo( menu );
1.281 - actionEditHeading=a;
1.282 - /*
1.283 - a = new QAction( tr( "Edit heading" ),this);
1.284 - a->setStatusTip (tr( "edit Heading" ));
1.285 - a->setShortcut ( Qt::Key_F2 );
1.286 - connect( a, SIGNAL( activated() ), this, SLOT( editHeading() ) );
1.287 - a->setEnabled (false);
1.288 - actionListBranches.append(a);
1.289 - */
1.290 -
1.291 - // Shortcut to delete selection
1.292 - a = new QAction( tr( "Delete Selection" ),this);
1.293 - a->setStatusTip (tr( "Delete Selection" ));
1.294 - a->setShortcut ( Qt::Key_Delete);
1.295 - connect( a, SIGNAL( activated() ), this, SLOT( editDeleteSelection() ) );
1.296 - a->setEnabled (false);
1.297 - actionEditDelete=a;
1.298 -
1.299 - // Shortcut to add branch
1.300 - alt = new QAction(tr( "Add branch as child" ), this);
1.301 - alt->setStatusTip ( tr( "Add a branch as child of selection" ));
1.302 - alt->setShortcut (Qt::Key_A);
1.303 - connect( alt, SIGNAL( activated() ), this, SLOT( editNewBranch() ) );
1.304 - a = new QAction(tr( "Add branch as child" ), this);
1.305 - a->setStatusTip ( tr( "Add a branch as child of selection" ));
1.306 - a->setShortcut (Qt::Key_Insert);
1.307 -// a->setEnabled (false);
1.308 - connect( a, SIGNAL( activated() ), this, SLOT( editNewBranch() ) );
1.309 - actionListBranches.append(a);
1.310 - #if defined (Q_OS_MACX)
1.311 - // In OSX show different shortcut in menues, the keys work independtly always
1.312 - actionEditAddBranch=alt;
1.313 - #else
1.314 - actionEditAddBranch=a;
1.315 - #endif
1.316 -
1.317 - // Add branch by inserting it at selection
1.318 - a = new QAction(tr( "Add branch (insert)" ), this);
1.319 - a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" ));
1.320 - a->setShortcut (Qt::ALT + Qt::Key_Insert );
1.321 - connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchHere() ) );
1.322 - a->setEnabled (false);
1.323 - actionListBranches.append(a);
1.324 - actionEditAddBranchHere=a;
1.325 - a = new QAction(tr( "Add branch (insert)" ),this);
1.326 - a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" ));
1.327 - a->setShortcut ( Qt::ALT + Qt::Key_A );
1.328 - connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchHere() ) );
1.329 - actionListBranches.append(a);
1.330 -
1.331 - // Add branch above
1.332 - a = new QAction(tr( "Add branch above" ), this);
1.333 - a->setStatusTip ( tr( "Add a branch above selection" ));
1.334 - a->setShortcut (Qt::SHIFT+Qt::Key_Insert );
1.335 - connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchAbove() ) );
1.336 - a->setEnabled (false);
1.337 - actionListBranches.append(a);
1.338 - actionEditAddBranchAbove=a;
1.339 - a = new QAction(tr( "Add branch above" ), this);
1.340 - a->setStatusTip ( tr( "Add a branch above selection" ));
1.341 - a->setShortcut (Qt::SHIFT+Qt::Key_A );
1.342 - connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchAbove() ) );
1.343 - actionListBranches.append(a);
1.344 -
1.345 - // Add branch below
1.346 - a = new QAction(tr( "Add branch below" ), this);
1.347 - a->setStatusTip ( tr( "Add a branch below selection" ));
1.348 - a->setShortcut (Qt::CTRL +Qt::Key_Insert );
1.349 - connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchBelow() ) );
1.350 - a->setEnabled (false);
1.351 - actionListBranches.append(a);
1.352 - actionEditAddBranchBelow=a;
1.353 - a = new QAction(tr( "Add branch below" ), this);
1.354 - a->setStatusTip ( tr( "Add a branch below selection" ));
1.355 - a->setShortcut (Qt::CTRL +Qt::Key_A );
1.356 - connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchBelow() ) );
1.357 - actionListBranches.append(a);
1.358 + editMenu->addSeparator();
1.359
1.360 // Import at selection (adding to selection)
1.361 a = new QAction( tr( "Add map (insert)" ),this);
1.362 @@ -796,7 +794,7 @@
1.363 a->setStatusTip (tr( "Select first branch" ));
1.364 a->setShortcut (Qt::Key_Home );
1.365 a->setEnabled (false);
1.366 - a->addTo ( menu );
1.367 + editMenu->addAction (a);
1.368 actionListBranches.append(a);
1.369 actionEditSelectFirst=a;
1.370 connect( a, SIGNAL( activated() ), this, SLOT( editFirstBranch() ) );
1.371 @@ -805,7 +803,7 @@
1.372 a->setShortcut ( Qt::Key_End );
1.373 connect( a, SIGNAL( activated() ), this, SLOT( editLastBranch() ) );
1.374 a->setEnabled (false);
1.375 - a->addTo ( menu );
1.376 + editMenu->addAction (a);
1.377 actionListBranches.append(a);
1.378 actionEditSelectLast=a;
1.379
1.380 @@ -819,8 +817,7 @@
1.381 // Format Actions
1.382 void Main::setupFormatActions()
1.383 {
1.384 - Q3PopupMenu *menu = new Q3PopupMenu( this );
1.385 - menuBar()->insertItem( tr( "F&ormat" ), menu );
1.386 + QMenu *formatMenu = menuBar()->addMenu (tr ("F&ormat"));
1.387
1.388 QToolBar *tb = addToolBar( tr("Format Actions","Toolbars"));
1.389 QAction *a;
1.390 @@ -830,7 +827,7 @@
1.391 a->setStatusTip ( tr( "Set Color" ));
1.392 connect( a, SIGNAL( activated() ), this, SLOT( formatSelectColor() ) );
1.393 a->addTo( tb );
1.394 - a->addTo( menu );
1.395 + formatMenu->addAction (a);
1.396 actionFormatColor=a;
1.397 a= new QAction( QPixmap(iconPath+"formatcolorpicker.png"), tr( "Pic&k color" ), this);
1.398 a->setStatusTip (tr( "Pick color\nHint: You can pick a color from another branch and color using CTRL+Left Button" ) );
1.399 @@ -838,7 +835,7 @@
1.400 connect( a, SIGNAL( activated() ), this, SLOT( formatPickColor() ) );
1.401 a->setEnabled (false);
1.402 a->addTo( tb );
1.403 - a->addTo( menu );
1.404 + formatMenu->addAction (a);
1.405 actionListBranches.append(a);
1.406 actionFormatPickColor=a;
1.407
1.408 @@ -848,7 +845,7 @@
1.409 connect( a, SIGNAL( activated() ), this, SLOT( formatColorItem() ) );
1.410 a->setEnabled (false);
1.411 a->addTo( tb );
1.412 - a->addTo( menu );
1.413 + formatMenu->addAction (a);
1.414 actionListBranches.append(a);
1.415 actionFormatColorBranch=a;
1.416
1.417 @@ -857,35 +854,39 @@
1.418 a->setShortcut (Qt::CTRL + Qt::Key_T);
1.419 connect( a, SIGNAL( activated() ), this, SLOT( formatColorBranch() ) );
1.420 a->setEnabled (false);
1.421 - a->addTo( menu );
1.422 + formatMenu->addAction (a);
1.423 a->addTo( tb );
1.424 actionListBranches.append(a);
1.425 actionFormatColorSubtree=a;
1.426
1.427 - menu->insertSeparator();
1.428 + formatMenu->addSeparator();
1.429 actionGroupFormatLinkStyles=new QActionGroup ( this);
1.430 actionGroupFormatLinkStyles->setExclusive (true);
1.431 a= new QAction( tr( "Linkstyle Line" ), actionGroupFormatLinkStyles);
1.432 a->setStatusTip (tr( "Line" ));
1.433 a->setToggleAction(true);
1.434 connect( a, SIGNAL( activated() ), this, SLOT( formatLinkStyleLine() ) );
1.435 + formatMenu->addAction (a);
1.436 actionFormatLinkStyleLine=a;
1.437 a= new QAction( tr( "Linkstyle Parabel" ), actionGroupFormatLinkStyles);
1.438 a->setStatusTip (tr( "Line" ));
1.439 a->setToggleAction(true);
1.440 connect( a, SIGNAL( activated() ), this, SLOT( formatLinkStyleParabel() ) );
1.441 + formatMenu->addAction (a);
1.442 actionFormatLinkStyleParabel=a;
1.443 a= new QAction( tr( "Linkstyle Thick Line" ), actionGroupFormatLinkStyles );
1.444 a->setStatusTip (tr( "PolyLine" ));
1.445 a->setToggleAction(true);
1.446 connect( a, SIGNAL( activated() ), this, SLOT( formatLinkStylePolyLine() ) );
1.447 + formatMenu->addAction (a);
1.448 actionFormatLinkStylePolyLine=a;
1.449 a= new QAction( tr( "Linkstyle Thick Parabel" ), actionGroupFormatLinkStyles);
1.450 a->setStatusTip (tr( "PolyParabel" ) );
1.451 a->setToggleAction(true);
1.452 + a->setChecked (true);
1.453 connect( a, SIGNAL( activated() ), this, SLOT( formatLinkStylePolyParabel() ) );
1.454 + formatMenu->addAction (a);
1.455 actionFormatLinkStylePolyParabel=a;
1.456 - actionGroupFormatLinkStyles->addTo (menu);
1.457
1.458 actionGroupFormatFrameTypes=new QActionGroup ( this);
1.459 actionGroupFormatFrameTypes->setExclusive (true);
1.460 @@ -918,24 +919,24 @@
1.461 connect( a, SIGNAL( activated() ), this, SLOT( formatHideLinkUnselected() ) );
1.462 actionFormatHideLinkUnselected=a;
1.463
1.464 - menu->insertSeparator();
1.465 + formatMenu->addSeparator();
1.466 a= new QAction( tr( "&Use color of heading for link" ), this);
1.467 a->setStatusTip (tr( "Use same color for links and headings" ));
1.468 a->setToggleAction(true);
1.469 connect( a, SIGNAL( activated() ), this, SLOT( formatToggleLinkColorHint() ) );
1.470 - a->addTo( menu );
1.471 + formatMenu->addAction (a);
1.472 actionFormatLinkColorHint=a;
1.473
1.474 pix.fill (Qt::white);
1.475 a= new QAction( pix, tr( "Set &Link Color"+QString("...") ), this );
1.476 a->setStatusTip (tr( "Set Link Color" ));
1.477 - a->addTo( menu );
1.478 + formatMenu->addAction (a);
1.479 connect( a, SIGNAL( activated() ), this, SLOT( formatSelectLinkColor() ) );
1.480 actionFormatLinkColor=a;
1.481
1.482 a= new QAction( pix, tr( "Set &Background Color" )+QString("..."), this );
1.483 a->setStatusTip (tr( "Set Background Color" ));
1.484 - a->addTo( menu );
1.485 + formatMenu->addAction (a);
1.486 connect( a, SIGNAL( activated() ), this, SLOT( formatSelectBackColor() ) );
1.487 actionFormatBackColor=a;
1.488 }
1.489 @@ -945,29 +946,28 @@
1.490 {
1.491 QToolBar *tb = addToolBar( tr("View Actions","Toolbars") );
1.492 tb->setLabel( "View Actions" );
1.493 - Q3PopupMenu *menu = new Q3PopupMenu( this );
1.494 - menuBar()->insertItem( tr( "&View" ), menu );
1.495 + QMenu *viewMenu = menuBar()->addMenu ( tr( "&View" ));
1.496
1.497 QAction *a;
1.498 a = new QAction(QPixmap(iconPath+"viewmag-reset.png"), tr( "reset Zoom" ), this);
1.499 a->setStatusTip ( tr( "Zoom reset" ) );
1.500 a->setShortcut (Qt::CTRL + Qt::Key_0 );
1.501 a->addTo( tb );
1.502 - a->addTo( menu );
1.503 + viewMenu->addAction (a);
1.504 connect( a, SIGNAL( activated() ), this, SLOT(viewZoomReset() ) );
1.505
1.506 a = new QAction( QPixmap(iconPath+"viewmag+.png"), tr( "Zoom in" ), this);
1.507 a->setStatusTip (tr( "Zoom in" ));
1.508 a->setShortcut (Qt::CTRL + Qt::Key_Plus);
1.509 a->addTo( tb );
1.510 - a->addTo( menu );
1.511 + viewMenu->addAction (a);
1.512 connect( a, SIGNAL( activated() ), this, SLOT(viewZoomIn() ) );
1.513
1.514 a = new QAction( QPixmap(iconPath+"viewmag-.png"), tr( "Zoom out" ), this);
1.515 a->setStatusTip (tr( "Zoom out" ));
1.516 a->setShortcut (Qt::CTRL + Qt::Key_Minus );
1.517 a->addTo( tb );
1.518 - a->addTo( menu );
1.519 + viewMenu->addAction (a);
1.520 connect( a, SIGNAL( activated() ), this, SLOT( viewZoomOut() ) );
1.521
1.522
1.523 @@ -980,7 +980,7 @@
1.524 else
1.525 a->setOn(false);
1.526 a->addTo( tb );
1.527 - a->addTo( menu );
1.528 + viewMenu->addAction (a);
1.529 connect( a, SIGNAL( activated() ), this, SLOT(windowToggleNoteEditor() ) );
1.530 actionViewToggleNoteEditor=a;
1.531
1.532 @@ -988,20 +988,20 @@
1.533 a->setStatusTip ( tr( "Show history window" ));
1.534 a->setShortcut ( Qt::CTRL + Qt::Key_H );
1.535 a->setToggleAction(false);
1.536 - a->addTo( menu );
1.537 + viewMenu->addAction (a);
1.538 connect( a, SIGNAL( activated() ), this, SLOT(windowToggleHistory() ) );
1.539 actionViewToggleHistoryWindow=a;
1.540
1.541 a = new QAction(tr( "Next Window" ), this);
1.542 a->setStatusTip ( tr( "&Next Window" ) );
1.543 a->setShortcut (Qt::ALT + Qt::Key_N );
1.544 - a->addTo( menu );
1.545 + viewMenu->addAction (a);
1.546 connect( a, SIGNAL( activated() ), this, SLOT(windowNextEditor() ) );
1.547
1.548 a = new QAction (tr( "Previous Window" ), this );
1.549 a->setStatusTip (tr( "&Previous Window" ));
1.550 a->setShortcut (Qt::ALT + Qt::Key_P );
1.551 - a->addTo( menu );
1.552 + viewMenu->addAction (a);
1.553 connect( a, SIGNAL( activated() ), this, SLOT(windowPreviousEditor() ) );
1.554 }
1.555
1.556 @@ -1359,56 +1359,54 @@
1.557 // Settings Actions
1.558 void Main::setupSettingsActions()
1.559 {
1.560 - Q3PopupMenu *menu = new Q3PopupMenu( this );
1.561 - menuBar()->insertItem( tr( "&Settings" ), menu );
1.562 + QMenu *settingsMenu = menuBar()->addMenu( tr( "&Settings" ));
1.563
1.564 QAction *a;
1.565
1.566 -
1.567 a = new QAction( tr( "Set application to open pdf files"), this);
1.568 a->setStatusTip ( tr( "Set application to open pdf files"));
1.569 connect( a, SIGNAL( activated() ), this, SLOT( settingsPDF() ) );
1.570 - a->addTo( menu );
1.571 + settingsMenu->addAction (a);
1.572
1.573 a = new QAction( tr( "Set application to open external links"), this);
1.574 a->setStatusTip( tr( "Set application to open external links"));
1.575 connect( a, SIGNAL( activated() ), this, SLOT( settingsURL() ) );
1.576 - a->addTo( menu );
1.577 -
1.578 - menu->insertSeparator();
1.579 + settingsMenu->addAction (a);
1.580 +
1.581 + settingsMenu->addSeparator();
1.582 a = new QAction( tr( "Edit branch after adding it" ), this );
1.583 a->setStatusTip( tr( "Edit branch after adding it" ));
1.584 a->setToggleAction(true);
1.585 a->setOn ( settings.readBoolEntry ("/vym/mapeditor/editmode/autoedit",true) );
1.586 - a->addTo( menu );
1.587 + settingsMenu->addAction (a);
1.588 actionSettingsAutoedit=a;
1.589
1.590 a= new QAction( tr( "Select branch after adding it" ), this );
1.591 a->setStatusTip( tr( "Select branch after adding it" ));
1.592 a->setToggleAction(true);
1.593 a->setOn ( settings.readBoolEntry ("/vym/mapeditor/editmode/autoselect",false) );
1.594 - a->addTo( menu );
1.595 + settingsMenu->addAction (a);
1.596 actionSettingsAutoselectHeading=a;
1.597
1.598 a= new QAction(tr( "Select existing heading" ), this);
1.599 a->setStatusTip( tr( "Select heading before editing" ));
1.600 a->setToggleAction(true);
1.601 a->setOn ( settings.readBoolEntry ("/vym/mapeditor/editmode/autoselectexistingtext",true) );
1.602 - a->addTo( menu );
1.603 + settingsMenu->addAction (a);
1.604 actionSettingsAutoselectText=a;
1.605
1.606 a= new QAction(tr( "pasting into new branch" ), this );
1.607 a->setStatusTip( tr( "Pasting into new branch" ));
1.608 a->setToggleAction(true);
1.609 a->setOn ( settings.readBoolEntry ("/vym/mapeditor/editmode/newheadingisempty",true) );
1.610 - a->addTo( menu );
1.611 + settingsMenu->addAction (a);
1.612 actionSettingsPasteNewHeading=a;
1.613
1.614 a= new QAction( tr( "Delete key" ), this);
1.615 a->setStatusTip( tr( "Delete key for deleting branches" ));
1.616 a->setToggleAction(true);
1.617 a->setOn ( settings.readBoolEntry ("/vym/mapeditor/editmode/useDelKey",false) );
1.618 - a->addTo( menu );
1.619 + settingsMenu->addAction (a);
1.620 connect( a, SIGNAL( activated() ), this, SLOT( settingsToggleDelKey() ) );
1.621 actionSettingsUseDelKey=a;
1.622
1.623 @@ -1416,51 +1414,49 @@
1.624 a->setStatusTip( tr( "Use exclusive flags in flag toolbars" ));
1.625 a->setToggleAction(true);
1.626 a->setOn ( settings.readBoolEntry ("/vym/mapeditor/editmode/useFlagGroups",true) );
1.627 - a->addTo( menu );
1.628 + settingsMenu->addAction (a);
1.629 actionSettingsUseFlagGroups=a;
1.630
1.631 a= new QAction( tr( "Use hide flags" ), this);
1.632 a->setStatusTip( tr( "Use hide flag during exports " ));
1.633 a->setToggleAction(true);
1.634 a->setOn ( settings.readBoolEntry ("/vym/export/useHideExport",true) );
1.635 - a->addTo( menu );
1.636 + settingsMenu->addAction (a);
1.637 actionSettingsUseHideExport=a;
1.638 }
1.639
1.640 // Test Actions
1.641 void Main::setupTestActions()
1.642 {
1.643 - Q3PopupMenu *menu = new Q3PopupMenu( this );
1.644 - menuBar()->insertItem( tr( "&Test" ), menu );
1.645 + QMenu *testMenu = menuBar()->addMenu( tr( "&Test" ));
1.646
1.647 QAction *a;
1.648 a = new QAction( tr( "test flag" ), this);
1.649 a->setStatusTip( tr( "Call test function" ));
1.650 connect( a, SIGNAL( activated() ), this, SLOT( testFunction() ) );
1.651 - a->addTo( menu );
1.652 + testMenu->addAction (a);
1.653 }
1.654
1.655 // Help Actions
1.656 void Main::setupHelpActions()
1.657 {
1.658 - Q3PopupMenu *menu = new Q3PopupMenu( this );
1.659 - menuBar()->insertItem( tr( "&Help" ), menu );
1.660 + QMenu *helpMenu = menuBar()->addMenu ( tr( "&Help" ));
1.661
1.662 QAction *a;
1.663 a = new QAction( tr( "Open VYM Documentation (pdf) " ), this );
1.664 a->setStatusTip( tr( "Open VYM Documentation (pdf)" ));
1.665 connect( a, SIGNAL( activated() ), this, SLOT( helpDoc() ) );
1.666 - a->addTo( menu );
1.667 + helpMenu->addAction (a);
1.668
1.669 a = new QAction( tr( "About VYM" ), this);
1.670 a->setStatusTip( tr( "About VYM")+" "__VYM);
1.671 connect( a, SIGNAL( activated() ), this, SLOT( helpAbout() ) );
1.672 - a->addTo( menu );
1.673 + helpMenu->addAction (a);
1.674
1.675 a = new QAction( tr( "About QT" ), this);
1.676 a->setStatusTip( tr( "Information about QT toolkit" ));
1.677 connect( a, SIGNAL( activated() ), this, SLOT( helpAboutQT() ) );
1.678 - a->addTo( menu );
1.679 + helpMenu->addAction (a);
1.680 }
1.681
1.682 // Context Menus
1.683 @@ -1495,33 +1491,34 @@
1.684
1.685 actionEditSaveBranch->addTo( branchContextMenu );
1.686
1.687 -/*
1.688 branchContextMenu->addSeparator();
1.689 - actionEditOpenURL->addTo ( branchContextMenu );
1.690 - actionEditOpenURLTab->addTo ( branchContextMenu );
1.691 - actionEditURL->addTo ( branchContextMenu );
1.692 - actionEditHeading2URL->addTo ( branchContextMenu );
1.693 - actionEditBugzilla2URL->addTo( branchContextMenu );
1.694 + branchContextMenu->addAction ( actionEditOpenURL );
1.695 + branchContextMenu->addAction ( actionEditOpenURLTab );
1.696 + branchContextMenu->addAction ( actionEditURL );
1.697 + branchContextMenu->addAction ( actionEditHeading2URL );
1.698 + branchContextMenu->addAction ( actionEditBugzilla2URL );
1.699 if (settings.readBoolEntry( "/vym/mainwindow/showTestMenu",false))
1.700 {
1.701 - actionEditFATE2URL->addTo( branchContextMenu );
1.702 + branchContextMenu->addAction ( actionEditFATE2URL );
1.703 }
1.704 - branchContextMenu->insertSeparator();
1.705 - actionEditOpenVymLink->addTo ( branchContextMenu );
1.706 - actionEditVymLink->addTo ( branchContextMenu );
1.707 - actionEditDeleteVymLink->addTo ( branchContextMenu );
1.708 + branchContextMenu->addSeparator();
1.709 + branchContextMenu->addAction ( actionEditOpenVymLink );
1.710 + branchContextMenu->addAction ( actionEditVymLink );
1.711 + branchContextMenu->addAction ( actionEditDeleteVymLink );
1.712
1.713 - branchContextMenu->insertSeparator();
1.714 - actionGroupFormatFrameTypes->addTo( branchContextMenu );
1.715 -
1.716 - branchContextMenu->insertSeparator();
1.717 - actionFormatIncludeImagesVer->addTo( branchContextMenu );
1.718 - actionFormatIncludeImagesHor->addTo( branchContextMenu );
1.719 - actionFormatHideLinkUnselected->addTo( branchContextMenu );
1.720 + branchContextMenu->addSeparator();
1.721 + branchContextMenu->addAction ( actionFormatFrameNone );
1.722 + branchContextMenu->addAction ( actionFormatFrameRectangle);
1.723 +
1.724 + branchContextMenu->addSeparator();
1.725 + branchContextMenu->addAction ( actionFormatIncludeImagesVer );
1.726 + branchContextMenu->addAction ( actionFormatIncludeImagesHor );
1.727 + branchContextMenu->addAction ( actionFormatHideLinkUnselected );
1.728
1.729 // Context Menu for links in a branch menu
1.730 // This will be populated "on demand" in MapEditor::updateActions
1.731 - branchContextMenu->insertSeparator();
1.732 + branchContextMenu->addSeparator();
1.733 + /* FIXME not yet ported from QT3
1.734 branchLinksContextMenu =new Q3PopupMenu (this);
1.735 branchLinksContextMenuDup =new Q3PopupMenu (this);
1.736 branchContextMenu->insertItem (tr("Edit XLink"),branchLinksContextMenuDup);
1.737 @@ -1529,8 +1526,8 @@
1.738
1.739 branchContextMenu->insertItem (tr("Goto XLink"),branchLinksContextMenu);
1.740 connect( branchLinksContextMenu, SIGNAL( activated(int) ), this, SLOT( editFollowXLink(int ) ) );
1.741 + */
1.742
1.743 -*/
1.744 // Context menu for floatimage
1.745 floatimageContextMenu =new QMenu (this);
1.746 saveImageFormatMenu=floatimageContextMenu->addMenu (tr("Save image"));