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"));
2.1 --- a/texteditor.cpp Tue Jun 13 13:54:53 2006 +0000
2.2 +++ b/texteditor.cpp Wed Jun 14 10:28:01 2006 +0000
2.3 @@ -1,10 +1,6 @@
2.4 #include "texteditor.h"
2.5
2.6 #include <q3canvas.h>
2.7 -#include <qstatusbar.h>
2.8 -#include <qmessagebox.h>
2.9 -#include <qaction.h>
2.10 -#include <qapplication.h>
2.11 #include <qpainter.h>
2.12 #include <qprinter.h>
2.13 #include <qfile.h>
2.14 @@ -13,7 +9,6 @@
2.15 #include <q3popupmenu.h>
2.16 #include <qmenubar.h>
2.17 #include <q3textedit.h>
2.18 -#include <q3accel.h>
2.19 #include <qtextstream.h>
2.20 #include <q3paintdevicemetrics.h>
2.21 #include <qsettings.h>
2.22 @@ -21,12 +16,10 @@
2.23 #include <qmessagebox.h>
2.24 #include <qcolordialog.h>
2.25 #include <qregexp.h>
2.26 -#include <qlineedit.h>
2.27 #include <q3simplerichtext.h>
2.28 //Added by qt3to4:
2.29 #include <Q3ValueList>
2.30 #include <QPixmap>
2.31 -#include <QActionGroup>
2.32 #include <QCloseEvent>
2.33
2.34 #include <iostream>
2.35 @@ -226,137 +219,130 @@
2.36
2.37 void TextEditor::setupFileActions()
2.38 {
2.39 - Q3ToolBar *tb = new Q3ToolBar( this );
2.40 - tb->setLabel( "File Actions" );
2.41 - Q3PopupMenu *menu = new Q3PopupMenu( this );
2.42 - menuBar()->insertItem( tr( "&File" ), menu );
2.43 + QToolBar *tb = addToolBar ( tr("File Actions") );
2.44 + QMenu *fileMenu = menuBar()->addMenu( tr( "&File" ));
2.45
2.46 QAction *a;
2.47 a = new QAction( QPixmap( iconPath+"fileopen.png"), tr( "&Import..." ),this);
2.48 a->setStatusTip (tr( "Import" ) );
2.49 a->setShortcut( Qt::CTRL + Qt::Key_O );
2.50 connect( a, SIGNAL( activated() ), this, SLOT( textLoad() ) );
2.51 - a->setEnabled(false);
2.52 - a->addTo( tb );
2.53 - a->addTo( menu );
2.54 + tb->addAction (a);
2.55 + fileMenu->addAction (a);
2.56 actionFileLoad=a;
2.57
2.58 - menu->insertSeparator();
2.59 + fileMenu->addSeparator();
2.60 a = new QAction( QPixmap(iconPath+"filesave.png" ), tr( "&Export..." ),this);
2.61 a->setStatusTip (tr( "Export Note (HTML)" ) );
2.62 a->setShortcut( Qt::CTRL + Qt::Key_S );
2.63 connect( a, SIGNAL( activated() ), this, SLOT( textSave() ) );
2.64 - a->addTo( tb );
2.65 - a->addTo( menu );
2.66 + tb->addAction (a);
2.67 + fileMenu->addAction (a);
2.68 actionFileSave=a;
2.69
2.70 a = new QAction( QPixmap(), tr( "Export &As... (HTML)" ), this);
2.71 a->setStatusTip (tr( "Export Note As (HTML) " ));
2.72 connect( a, SIGNAL( activated() ), this, SLOT( textSaveAs() ) );
2.73 - a->addTo( menu );
2.74 + fileMenu->addAction (a);
2.75 actionFileSaveAs=a;
2.76
2.77 a = new QAction(QPixmap(), tr( "Export &As...(ASCII)" ), this);
2.78 a->setStatusTip ( tr( "Export Note As (ASCII) " ) );
2.79 a->setShortcut(Qt::ALT + Qt::Key_X );
2.80 connect( a, SIGNAL( activated() ), this, SLOT( textExportAsASCII() ) );
2.81 - a->addTo( menu );
2.82 + fileMenu->addAction (a);
2.83 actionFileSaveAs=a;
2.84
2.85 - menu->insertSeparator();
2.86 + fileMenu->addSeparator();
2.87 a = new QAction( QPixmap(iconPath+"fileprint.png" ), tr( "&Print..." ),this);
2.88 a->setStatusTip (tr( "Print Note" ) );
2.89 a->setShortcut( Qt::CTRL + Qt::Key_P );
2.90 connect( a, SIGNAL( activated() ), this, SLOT( textPrint() ) );
2.91 - a->addTo( tb );
2.92 - a->addTo( menu );
2.93 + tb->addAction (a);
2.94 + fileMenu->addAction (a);
2.95 actionFilePrint=a;
2.96 }
2.97
2.98 void TextEditor::setupEditActions()
2.99 {
2.100 - Q3ToolBar *tb = new Q3ToolBar( this );
2.101 - tb->setLabel( "Edit Actions" );
2.102 - Q3PopupMenu *menu = new Q3PopupMenu( this );
2.103 - menuBar()->insertItem( tr( "&Edit" ), menu );
2.104 + QToolBar *tb = addToolBar ( tr( "Edit Actions" ));
2.105 + QMenu *editMenu = menuBar()->addMenu ( tr( "&Edit" ));
2.106
2.107 QAction *a;
2.108 a = new QAction(QPixmap(iconPath+"undo.png"), tr( "&Undo" ), this );
2.109 a->setStatusTip ( tr( "Undo" ) );
2.110 a->setShortcut(Qt::CTRL + Qt::Key_Z );
2.111 connect( a, SIGNAL( activated() ), e, SLOT( undo() ) );
2.112 - a->addTo( menu );
2.113 - a->addTo( tb);
2.114 + editMenu->addAction (a);
2.115 + tb->addAction (a);
2.116 actionEditUndo=a;
2.117
2.118 a = new QAction(QPixmap(iconPath+"redo.png" ), tr( "&Redo" ),this);
2.119 a->setStatusTip ( tr( "Redo" ) );
2.120 a->setShortcut( Qt::CTRL + Qt::Key_Y );
2.121 connect( a, SIGNAL( activated() ), e, SLOT( redo() ) );
2.122 - a->addTo( tb );
2.123 - a->addTo( menu );
2.124 + editMenu->addAction (a);
2.125 + tb->addAction (a);
2.126 actionEditRedo=a;
2.127
2.128 - menu->insertSeparator();
2.129 + editMenu->addSeparator();
2.130 a = new QAction(QPixmap(), tr( "Select and copy &all" ),this);
2.131 a->setStatusTip ( tr( "Select and copy all" ) );
2.132 a->setShortcut( Qt::CTRL + Qt::Key_A );
2.133 connect( a, SIGNAL( activated() ), this, SLOT( editCopyAll() ) );
2.134 - a->addTo( menu );
2.135 + editMenu->addAction (a);
2.136
2.137 - menu->insertSeparator();
2.138 + editMenu->addSeparator();
2.139 a = new QAction(QPixmap(iconPath+"editcopy.png" ), tr( "&Copy" ),this);
2.140 a->setStatusTip ( tr( "Copy" ) );
2.141 a->setShortcut( Qt::CTRL + Qt::Key_C );
2.142 connect( a, SIGNAL( activated() ), e, SLOT( copy() ) );
2.143 - a->addTo( tb );
2.144 - a->addTo( menu );
2.145 + editMenu->addAction (a);
2.146 + tb->addAction (a);
2.147 actionEditCopy=a;
2.148
2.149 a = new QAction(QPixmap(iconPath+"editcut.png" ), tr( "Cu&t" ),this);
2.150 a->setStatusTip ( tr( "Cut" ) );
2.151 a->setShortcut( Qt::CTRL + Qt::Key_X );
2.152 connect( a, SIGNAL( activated() ), e, SLOT( cut() ) );
2.153 - a->addTo( tb );
2.154 - a->addTo( menu );
2.155 + editMenu->addAction (a);
2.156 + tb->addAction (a);
2.157 actionEditCut=a;
2.158
2.159 a = new QAction(QPixmap(iconPath+"editpaste.png" ), tr( "&Paste" ),this);
2.160 a->setStatusTip ( tr( "Paste" ) );
2.161 a->setShortcut( Qt::CTRL + Qt::Key_V );
2.162 connect( a, SIGNAL( activated() ), e, SLOT( paste() ) );
2.163 - a->addTo( tb );
2.164 - a->addTo( menu );
2.165 + editMenu->addAction (a);
2.166 + tb->addAction (a);
2.167 actionEditPaste=a;
2.168
2.169 a = new QAction( QPixmap( iconPath+"edittrash.png"), tr( "&Delete All" ), this);
2.170 a->setStatusTip (tr( "Delete all" ) );
2.171 connect( a, SIGNAL( activated() ), e, SLOT( clear() ) );
2.172 - a->addTo( tb );
2.173 - a->addTo( menu );
2.174 + editMenu->addAction (a);
2.175 + tb->addAction (a);
2.176 actionEditDeleteAll=a;
2.177
2.178 a = new QAction(QPixmap(), tr( "&Convert Paragraphs" ),this);
2.179 a->setStatusTip(tr( "Convert paragraphs to linebreaks" ));
2.180 a->setShortcut( Qt::ALT + Qt::Key_P );
2.181 connect( a, SIGNAL( activated() ), this, SLOT( textConvertPar() ) );
2.182 - a->addTo( menu );
2.183 + editMenu->addAction (a);
2.184 actionEditConvertPar=a;
2.185
2.186 a = new QAction( QPixmap(), tr( "&Join lines" ), this);
2.187 a->setStatusTip(tr( "Join all lines of a paragraph" ) );
2.188 a->setShortcut(Qt::ALT + Qt::Key_J );
2.189 connect( a, SIGNAL( activated() ), this, SLOT( textJoinLines() ) );
2.190 - a->addTo( menu );
2.191 + editMenu->addAction (a);
2.192 actionEditJoinLines=a;
2.193 }
2.194
2.195 void TextEditor::setupFormatActions()
2.196 {
2.197 - Q3ToolBar *tb = new Q3ToolBar( this );
2.198 - tb->setLabel( "Format Actions" );
2.199 - Q3PopupMenu *menu = new Q3PopupMenu( this );
2.200 - menuBar()->insertItem( tr( "F&ormat" ), menu );
2.201 + QToolBar *tb = addToolBar ( tr("Format Actions" ));
2.202 + QMenu *formatMenu = menuBar()->addMenu ( tr( "F&ormat" ));
2.203
2.204 QAction *a;
2.205
2.206 @@ -365,93 +351,112 @@
2.207 a->setToggleAction (true);
2.208 a->setOn (settings.readBoolEntry ("/vym/noteeditor/fonts/useFixedByDefault",false) );
2.209 connect( a, SIGNAL( activated() ), this, SLOT( toggleFonthint() ) );
2.210 - a->addTo( menu );
2.211 - a->addTo( tb );
2.212 + formatMenu->addAction (a);
2.213 + tb->addAction (a);
2.214 actionFormatUseFixedFont=a;
2.215
2.216 - menu->insertSeparator();
2.217 -
2.218 - comboFont = new QComboBox( true, tb );
2.219 +// comboFont = new QComboBox( true, tb );
2.220 + comboFont = new QComboBox;
2.221 + tb->addWidget (comboFont);
2.222 QFontDatabase db;
2.223 comboFont->insertStringList( db.families() );
2.224 connect( comboFont, SIGNAL( activated( const QString & ) ),
2.225 this, SLOT( textFamily( const QString & ) ) );
2.226 - comboFont->lineEdit()->setText( QApplication::font().family() );
2.227 -
2.228 - comboSize = new QComboBox( true, tb );
2.229 + comboFont->addItem( QApplication::font().family() );
2.230 +// comboSize = new QComboBox( true, tb );
2.231 + comboSize = new QComboBox;
2.232 + tb->addWidget (comboSize);
2.233 Q3ValueList<int> sizes = db.standardSizes();
2.234 Q3ValueList<int>::Iterator it = sizes.begin();
2.235 for ( ; it != sizes.end(); ++it )
2.236 comboSize->insertItem( QString::number( *it ) );
2.237 connect( comboSize, SIGNAL( activated( const QString & ) ),
2.238 this, SLOT( textSize( const QString & ) ) );
2.239 - comboSize->lineEdit()->setText( QString::number( QApplication::font().pointSize() ) );
2.240 + comboSize->addItem ( QString::number( QApplication::font().pointSize() ) );
2.241
2.242 - menu->insertSeparator();
2.243 + formatMenu->addSeparator();
2.244
2.245 QPixmap pix( 16, 16 );
2.246 pix.fill( e->color());
2.247 - actionTextColor = new QAction( pix, tr( "&Color..." ), this);
2.248 - actionTextColor->addTo( tb );
2.249 - actionTextColor->addTo( menu );
2.250 - connect( actionTextColor, SIGNAL( activated() ), this, SLOT( textColor() ) );
2.251 + a = new QAction( pix, tr( "&Color..." ), this);
2.252 + formatMenu->addAction (a);
2.253 + tb->addAction (a);
2.254 + connect( a, SIGNAL( activated() ), this, SLOT( textColor() ) );
2.255 + actionTextColor=a;
2.256
2.257 - actionTextBold = new QAction( QPixmap (iconPath+"text_bold.png"), tr( "&Bold" ), this);
2.258 - actionTextBold->setShortcut(Qt::CTRL + Qt::Key_B );
2.259 - connect( actionTextBold, SIGNAL( activated() ), this, SLOT( textBold() ) );
2.260 - actionTextBold->addTo( tb );
2.261 - actionTextBold->addTo( menu );
2.262 - actionTextBold->setToggleAction( true );
2.263 - actionTextItalic = new QAction( QPixmap(iconPath+"text_italic.png"), tr( "&Italic" ), this);
2.264 - actionTextItalic->setShortcut(Qt::CTRL + Qt::Key_I);
2.265 - connect( actionTextItalic, SIGNAL( activated() ), this, SLOT( textItalic() ) );
2.266 - actionTextItalic->addTo( tb );
2.267 - actionTextItalic->addTo( menu );
2.268 - actionTextItalic->setToggleAction( true );
2.269 - actionTextUnderline = new QAction( QPixmap (iconPath+"text_under.png"), tr( "&Underline" ), this);
2.270 - actionTextUnderline->setShortcut(Qt::CTRL + Qt::Key_U );
2.271 - connect( actionTextUnderline, SIGNAL( activated() ), this, SLOT( textUnderline() ) );
2.272 - actionTextUnderline->addTo( tb );
2.273 - actionTextUnderline->addTo( menu );
2.274 - actionTextUnderline->setToggleAction( true );
2.275 - menu->insertSeparator();
2.276 + a = new QAction( QPixmap (iconPath+"text_bold.png"), tr( "&Bold" ), this);
2.277 + a->setShortcut(Qt::CTRL + Qt::Key_B );
2.278 + connect( a, SIGNAL( activated() ), this, SLOT( textBold() ) );
2.279 + tb->addAction (a);
2.280 + formatMenu->addAction (a);
2.281 + a->setToggleAction( true );
2.282 + actionTextBold=a;
2.283 +
2.284 + a = new QAction( QPixmap(iconPath+"text_italic.png"), tr( "&Italic" ), this);
2.285 + a->setShortcut(Qt::CTRL + Qt::Key_I);
2.286 + connect( a, SIGNAL( activated() ), this, SLOT( textItalic() ) );
2.287 + tb->addAction (a);
2.288 + formatMenu->addAction (a);
2.289 + a->setToggleAction( true );
2.290 + actionTextItalic=a;
2.291 +
2.292 + a = new QAction( QPixmap (iconPath+"text_under.png"), tr( "&Underline" ), this);
2.293 + a->setShortcut(Qt::CTRL + Qt::Key_U );
2.294 + connect( a, SIGNAL( activated() ), this, SLOT( textUnderline() ) );
2.295 + tb->addAction (a);
2.296 + formatMenu->addAction (a);
2.297 + a->setToggleAction( true );
2.298 + actionTextUnderline=a;
2.299 + formatMenu->addSeparator();
2.300
2.301 QActionGroup *grp = new QActionGroup( this );
2.302 connect( grp, SIGNAL( selected( QAction* ) ), this, SLOT( textAlign( QAction* ) ) );
2.303
2.304 - actionAlignLeft = new QAction( QPixmap (iconPath+"text_left.png"), tr( "&Left" ),grp );
2.305 - actionAlignLeft->setShortcut( Qt::CTRL+Qt::Key_L );
2.306 - actionAlignLeft->setToggleAction( true );
2.307 - actionAlignCenter = new QAction( QPixmap (iconPath+"text_center.png"), tr( "C&enter" ),grp);
2.308 - actionAlignCenter->setShortcut( Qt::CTRL + Qt::Key_E);
2.309 - actionAlignCenter->setToggleAction( true );
2.310 - actionAlignRight = new QAction( QPixmap (iconPath+"text_right.png" ), tr( "&Right" ), grp);
2.311 - actionAlignRight->setShortcut(Qt::CTRL + Qt::Key_R );
2.312 - actionAlignRight->setToggleAction( true );
2.313 - actionAlignJustify = new QAction( QPixmap ( iconPath+"text_block.png"), tr( "&Justify" ), grp );
2.314 - actionAlignJustify->setShortcut(Qt::CTRL + Qt::Key_J );
2.315 - actionAlignJustify->setToggleAction( true );
2.316 -
2.317 - grp->addTo( tb );
2.318 - grp->addTo( menu );
2.319 + a = new QAction( QPixmap (iconPath+"text_left.png"), tr( "&Left" ),grp );
2.320 + a->setShortcut( Qt::CTRL+Qt::Key_L );
2.321 + a->setToggleAction( true );
2.322 + tb->addAction (a);
2.323 + formatMenu->addAction (a);
2.324 + actionAlignLeft=a;
2.325 + a = new QAction( QPixmap (iconPath+"text_center.png"), tr( "C&enter" ),grp);
2.326 + a->setShortcut( Qt::CTRL + Qt::Key_E);
2.327 + a->setToggleAction( true );
2.328 + tb->addAction (a);
2.329 + formatMenu->addAction (a);
2.330 + actionAlignCenter=a;
2.331 + a = new QAction( QPixmap (iconPath+"text_right.png" ), tr( "&Right" ), grp);
2.332 + a->setShortcut(Qt::CTRL + Qt::Key_R );
2.333 + a->setToggleAction( true );
2.334 + tb->addAction (a);
2.335 + formatMenu->addAction (a);
2.336 + actionAlignRight=a;
2.337 + a = new QAction( QPixmap ( iconPath+"text_block.png"), tr( "&Justify" ), grp );
2.338 + a->setShortcut(Qt::CTRL + Qt::Key_J );
2.339 + a->setToggleAction( true );
2.340 + tb->addAction (a);
2.341 + formatMenu->addAction (a);
2.342 + actionAlignJustify=a;
2.343
2.344 QActionGroup *grp2 = new QActionGroup( this );
2.345 - grp2->setExclusive(false);
2.346 - actionAlignSubScript = new QAction( QPixmap (iconPath+"text_sub.png"), tr( "Subs&cript" ),grp2 );
2.347 - actionAlignSubScript->setShortcut( Qt::CTRL + Qt::SHIFT + Qt::Key_B );
2.348 - actionAlignSubScript->setToggleAction( true );
2.349 - connect(actionAlignSubScript, SIGNAL(activated()), this, SLOT(textVAlign()));
2.350 + grp2->setExclusive(true);
2.351 + a = new QAction( QPixmap (iconPath+"text_sub.png"), tr( "Subs&cript" ),grp2 );
2.352 + a->setShortcut( Qt::CTRL + Qt::SHIFT + Qt::Key_B );
2.353 + a->setToggleAction( true );
2.354 + tb->addAction (a);
2.355 + formatMenu->addAction (a);
2.356 + connect(a, SIGNAL(activated()), this, SLOT(textVAlign()));
2.357 + actionAlignSubScript=a;
2.358
2.359 - actionAlignSuperScript = new QAction( QPixmap (iconPath+"text_super.png"), tr( "Su&perscript" ),grp2 );
2.360 - actionAlignSuperScript->setShortcut( Qt::CTRL + Qt::SHIFT + Qt::Key_P );
2.361 - actionAlignSuperScript->setToggleAction( true );
2.362 - connect(actionAlignSuperScript, SIGNAL(activated()), this, SLOT(textVAlign()));
2.363 + a = new QAction( QPixmap (iconPath+"text_super.png"), tr( "Su&perscript" ),grp2 );
2.364 + a->setShortcut( Qt::CTRL + Qt::SHIFT + Qt::Key_P );
2.365 + a->setToggleAction( true );
2.366 + tb->addAction (a);
2.367 + formatMenu->addAction (a);
2.368 + connect(a, SIGNAL(activated()), this, SLOT(textVAlign()));
2.369 + actionAlignSuperScript=a;
2.370
2.371 - menu->insertSeparator();
2.372 + formatMenu->addSeparator();
2.373
2.374 - grp2->addTo(tb);
2.375 - grp2->addTo(menu);
2.376 -
2.377 connect( e, SIGNAL( currentFontChanged( const QFont & ) ),
2.378 this, SLOT( fontChanged( const QFont & ) ) );
2.379 connect( e, SIGNAL( currentColorChanged( const QColor & ) ),
2.380 @@ -465,27 +470,26 @@
2.381
2.382 void TextEditor::setupSettingsActions()
2.383 {
2.384 - Q3PopupMenu *menu = new Q3PopupMenu( this );
2.385 - menuBar()->insertItem( tr( "&Settings" ), menu );
2.386 + QMenu *settingsMenu = menuBar()->addMenu ( tr( "&Settings" ));
2.387
2.388 QAction *a;
2.389 a = new QAction(tr( "Set &fixed font" ), this);
2.390 a->setStatusTip ( tr( "Set fixed font" ));
2.391 connect( a, SIGNAL( activated() ), this, SLOT( setFixedFont() ) );
2.392 - a->addTo( menu );
2.393 + settingsMenu->addAction (a);
2.394 actionSettingsFixedFont=a;
2.395
2.396 a = new QAction(tr( "Set &variable font" ), this);
2.397 a->setStatusTip ( tr( "Set variable font" ) );
2.398 connect( a, SIGNAL( activated() ), this, SLOT( setVarFont() ) );
2.399 - a->addTo( menu );
2.400 + settingsMenu->addAction (a);
2.401 actionSettingsVarFont=a;
2.402
2.403 a = new QAction(tr( "&fixed font is default" ), this);
2.404 a->setStatusTip (tr( "Used fixed font by default" ) );
2.405 a->setToggleAction (true);
2.406 // set state later in constructor...
2.407 - a->addTo( menu );
2.408 + settingsMenu->addAction (a);
2.409 actionSettingsFonthintDefault=a;
2.410 }
2.411
2.412 @@ -909,8 +913,10 @@
2.413
2.414 void TextEditor::fontChanged( const QFont &f )
2.415 {
2.416 +/*
2.417 comboFont->lineEdit()->setText( f.family() );
2.418 comboSize->lineEdit()->setText( QString::number( f.pointSize() ) );
2.419 +*/
2.420 actionTextBold->setOn( f.bold() );
2.421 actionTextItalic->setOn( f.italic() );
2.422 actionTextUnderline->setOn( f.underline() );
3.1 --- a/texteditor.h Tue Jun 13 13:54:53 2006 +0000
3.2 +++ b/texteditor.h Wed Jun 14 10:28:01 2006 +0000
3.3 @@ -2,9 +2,9 @@
3.4 #ifndef TEXTEDITOR_H
3.5 #define TEXTEDITOR_H
3.6
3.7 +#include <QtGui>
3.8 #include <q3mainwindow.h>
3.9 #include <q3textedit.h>
3.10 -#include <qaction.h>
3.11 #include <qfontdatabase.h>
3.12 #include <qcombobox.h>
3.13 //Added by qt3to4:
3.14 @@ -15,7 +15,7 @@
3.15
3.16 class MyTextEdit;
3.17
3.18 -class TextEditor : public Q3MainWindow {
3.19 +class TextEditor : public QMainWindow {
3.20 Q_OBJECT
3.21 public:
3.22 TextEditor();
4.1 --- a/version.h Tue Jun 13 13:54:53 2006 +0000
4.2 +++ b/version.h Wed Jun 14 10:28:01 2006 +0000
4.3 @@ -3,6 +3,6 @@
4.4
4.5 #define __VYM "VYM"
4.6 #define __VYM_VERSION "1.7.50"
4.7 -#define __BUILD_DATE "June 5, 2006"
4.8 +#define __BUILD_DATE "June 12, 2006"
4.9
4.10 #endif