diff -r ec3d2962893d -r 5cfbba1dc2f8 mainwindow.cpp --- a/mainwindow.cpp Tue Jun 13 13:54:53 2006 +0000 +++ b/mainwindow.cpp Wed Jun 14 10:28:01 2006 +0000 @@ -2,10 +2,6 @@ #include "mainwindow.h" -//#include -//#include -//#include -//#include #include #include #include @@ -235,7 +231,7 @@ setupHelpActions(); // After menu is created, we can enable some actions -//FIXME testing actionFilePrint->setEnabled (true); +//FIXME QT3 testing actionFilePrint->setEnabled (true); statusBar(); @@ -455,8 +451,7 @@ { QToolBar *tb = addToolBar( tr ("&Edit") ); tb->setLabel( "Edit Actions" ); - Q3PopupMenu *menu = new Q3PopupMenu( this ); - menuBar()->insertItem( tr( "&Edit" ), menu ); + QMenu *editMenu = menuBar()->addMenu( tr("&Edit") ); QAction *a; QAction *alt; @@ -465,8 +460,8 @@ a->setStatusTip (tr( "Undo" ) ); a->setShortcut ( Qt::CTRL + Qt::Key_Z ); a->setEnabled (false); - a->addTo( tb ); - a->addTo( menu ); + tb->addAction (a); + editMenu->addAction (a); actionEditUndo=a; if (settings.readBoolEntry( "/vym/mainwindow/showTestMenu",false)) @@ -474,18 +469,17 @@ a = new QAction( QPixmap( iconPath+"redo.png"), tr( "&Redo" ), this); a->setStatusTip (tr( "Redo" )); a->setShortcut (Qt::CTRL + Qt::Key_Y ); - a->addTo( tb ); - a->addTo( menu ); + editMenu->addAction (a); connect( a, SIGNAL( activated() ), this, SLOT( editRedo() ) ); } - menu->insertSeparator(); + editMenu->addSeparator(); a = new QAction(QPixmap( iconPath+"editcopy.png"), tr( "&Copy" ), this); a->setStatusTip ( tr( "Copy" ) ); a->setShortcut (Qt::CTRL + Qt::Key_C ); a->setEnabled (false); - a->addTo( tb ); - a->addTo( menu ); + tb->addAction (a); + editMenu->addAction (a); connect( a, SIGNAL( activated() ), this, SLOT( editCopy() ) ); actionEditCopy=a; @@ -493,8 +487,8 @@ a->setStatusTip ( tr( "Cut" ) ); a->setShortcut (Qt::CTRL + Qt::Key_X ); a->setEnabled (false); - a->addTo( tb ); - a->addTo( menu ); + tb->addAction (a); + editMenu->addAction (a); actionEditCut=a; connect( a, SIGNAL( activated() ), this, SLOT( editCut() ) ); @@ -503,16 +497,111 @@ a->setStatusTip ( tr( "Paste" ) ); a->setShortcut ( Qt::CTRL + Qt::Key_V ); a->setEnabled (false); - a->addTo( tb ); - a->addTo( menu ); + tb->addAction (a); + editMenu->addAction (a); actionEditPaste=a; + // Shortcuts to modify heading: + /* + a = new QAction(tr( "Edit heading" ),this); + a->setStatusTip ( tr( "edit Heading" )); + a->setShortcut ( Qt::Key_Enter); + connect( a, SIGNAL( triggered() ), this, SLOT( editHeading() ) ); + actionListBranches.append(a); + */ + a = new QAction( tr( "Edit heading" ), this); + a->setStatusTip (tr( "edit Heading" )); + a->setShortcut (Qt::Key_Return ); + connect( a, SIGNAL( activated() ), this, SLOT( editHeading() ) ); + //actionListBranches.append(a); + editMenu->addAction (a); + actionEditHeading=a; + /* + a = new QAction( tr( "Edit heading" ),this); + a->setStatusTip (tr( "edit Heading" )); + a->setShortcut ( Qt::Key_F2 ); + connect( a, SIGNAL( activated() ), this, SLOT( editHeading() ) ); + a->setEnabled (false); + actionListBranches.append(a); + */ + + // Shortcut to delete selection + a = new QAction( tr( "Delete Selection" ),this); + a->setStatusTip (tr( "Delete Selection" )); + a->setShortcut ( Qt::Key_Delete); + connect( a, SIGNAL( activated() ), this, SLOT( editDeleteSelection() ) ); + a->setEnabled (false); + actionEditDelete=a; + + // Shortcut to add branch + alt = new QAction(QPixmap(iconPath+"newbranch.png"), tr( "Add branch as child" ), this); + alt->setStatusTip ( tr( "Add a branch as child of selection" )); + alt->setShortcut (Qt::Key_A); + connect( alt, SIGNAL( activated() ), this, SLOT( editNewBranch() ) ); + a = new QAction(QPixmap(iconPath+"newbranch.png"), tr( "Add branch as child" ), this); + a->setStatusTip ( tr( "Add a branch as child of selection" )); + a->setShortcut (Qt::Key_Insert); +// a->setEnabled (false); + connect( a, SIGNAL( activated() ), this, SLOT( editNewBranch() ) ); + actionListBranches.append(a); + #if defined (Q_OS_MACX) + // In OSX show different shortcut in menues, the keys work indepently always + actionEditAddBranch=alt; + #else + actionEditAddBranch=a; + #endif + editMenu->addAction (actionEditAddBranch); + tb->addAction (actionEditAddBranch); + + + // Add branch by inserting it at selection + a = new QAction(tr( "Add branch (insert)" ), this); + a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" )); + a->setShortcut (Qt::ALT + Qt::Key_Insert ); + connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchHere() ) ); + a->setEnabled (false); + actionListBranches.append(a); + actionEditAddBranchHere=a; + a = new QAction(tr( "Add branch (insert)" ),this); + a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" )); + a->setShortcut ( Qt::ALT + Qt::Key_A ); + connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchHere() ) ); + actionListBranches.append(a); + + // Add branch above + a = new QAction(tr( "Add branch above" ), this); + a->setStatusTip ( tr( "Add a branch above selection" )); + a->setShortcut (Qt::SHIFT+Qt::Key_Insert ); + connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchAbove() ) ); + a->setEnabled (false); + actionListBranches.append(a); + actionEditAddBranchAbove=a; + a = new QAction(tr( "Add branch above" ), this); + a->setStatusTip ( tr( "Add a branch above selection" )); + a->setShortcut (Qt::SHIFT+Qt::Key_A ); + connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchAbove() ) ); + actionListBranches.append(a); + + // Add branch below + a = new QAction(tr( "Add branch below" ), this); + a->setStatusTip ( tr( "Add a branch below selection" )); + a->setShortcut (Qt::CTRL +Qt::Key_Insert ); + connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchBelow() ) ); + a->setEnabled (false); + actionListBranches.append(a); + actionEditAddBranchBelow=a; + a = new QAction(tr( "Add branch below" ), this); + a->setStatusTip ( tr( "Add a branch below selection" )); + a->setShortcut (Qt::CTRL +Qt::Key_A ); + connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchBelow() ) ); + actionListBranches.append(a); + a = new QAction(QPixmap(iconPath+"up.png" ), tr( "Move up" ), this); a->setStatusTip ( tr( "Move branch up" ) ); a->setShortcut (Qt::Key_PageUp ); a->setEnabled (false); - a->addTo( tb ); - a->addTo( menu ); + tb->addAction (a); + editMenu->addAction (a); connect( a, SIGNAL( activated() ), this, SLOT( editMoveUp() ) ); actionEditMoveUp=a; @@ -521,8 +610,8 @@ a->setStatusTip (tr( "Move branch down" ) ); a->setShortcut ( Qt::Key_PageDown ); a->setEnabled (false); - a->addTo( tb ); - a->addTo( menu ); + tb->addAction (a); + editMenu->addAction (a); actionEditMoveDown=a; @@ -541,29 +630,30 @@ #endif actionEditToggleScroll->setEnabled (false); actionEditToggleScroll->setToggleAction(true); - actionEditToggleScroll->addTo( tb ); - actionEditToggleScroll->addTo( menu ); + tb->addAction (actionEditToggleScroll); + editMenu->addAction ( actionEditToggleScroll); + editMenu->addAction (actionEditToggleScroll); actionListBranches.append(actionEditToggleScroll); a = new QAction( tr( "Unscroll all scrolled branches" ), this); a->setStatusTip (tr( "Unscroll all" )); - a->addTo( menu ); + editMenu->addAction (a); connect( a, SIGNAL( activated() ), this, SLOT( editUnScrollAll() ) ); - menu->insertSeparator(); + editMenu->addSeparator(); a = new QAction( QPixmap(iconPath+"find.png"), tr( "Find"+QString("...") ), this); a->setStatusTip (tr( "Find" ) ); a->setShortcut (Qt::CTRL + Qt::Key_F ); - a->addTo( menu ); + editMenu->addAction (a); connect( a, SIGNAL( activated() ), this, SLOT( editOpenFindWindow() ) ); - menu->insertSeparator(); + editMenu->addSeparator(); a = new QAction( QPixmap(flagsPath+"flag-url.png"), tr( "Open URL" ), this); a->setShortcut (Qt::CTRL + Qt::Key_U ); a->setShortcut (tr( "Open URL" )); - a->addTo( tb ); + tb->addAction (a); a->setEnabled (false); connect( a, SIGNAL( activated() ), this, SLOT( editOpenURL() ) ); actionEditOpenURL=a; @@ -606,7 +696,7 @@ a = new QAction(QPixmap(flagsPath+"flag-vymlink.png"), tr( "Jump to map" ), this); a->setStatusTip ( tr( "Jump to another vym map, if needed load it first" )); - a->addTo( tb ); + tb->addAction (a); a->setEnabled (false); connect( a, SIGNAL( activated() ), this, SLOT( editOpenVymLink() ) ); actionEditOpenVymLink=a; @@ -628,7 +718,7 @@ a->setStatusTip ( tr( "Hide object in exports" ) ); a->setShortcut (Qt::Key_H ); a->setToggleAction(true); - a->addTo( tb ); + tb->addAction (a); a->setEnabled (false); connect( a, SIGNAL( activated() ), this, SLOT( editToggleHideExport() ) ); actionEditToggleHideExport=a; @@ -639,99 +729,7 @@ connect( a, SIGNAL( activated() ), this, SLOT( editMapInfo() ) ); actionEditMapInfo=a; - menu->insertSeparator(); - - // Shortcuts to modify heading: - /* - a = new QAction(tr( "Edit heading" ),this); - a->setStatusTip ( tr( "edit Heading" )); - a->setShortcut ( Qt::Key_Enter); - connect( a, SIGNAL( triggered() ), this, SLOT( editHeading() ) ); - actionListBranches.append(a); - */ - a = new QAction( tr( "Edit heading" ), this); - a->setStatusTip (tr( "edit Heading" )); - a->setShortcut (Qt::Key_Return ); - connect( a, SIGNAL( activated() ), this, SLOT( editHeading() ) ); - //actionListBranches.append(a); - a->addTo( menu ); - actionEditHeading=a; - /* - a = new QAction( tr( "Edit heading" ),this); - a->setStatusTip (tr( "edit Heading" )); - a->setShortcut ( Qt::Key_F2 ); - connect( a, SIGNAL( activated() ), this, SLOT( editHeading() ) ); - a->setEnabled (false); - actionListBranches.append(a); - */ - - // Shortcut to delete selection - a = new QAction( tr( "Delete Selection" ),this); - a->setStatusTip (tr( "Delete Selection" )); - a->setShortcut ( Qt::Key_Delete); - connect( a, SIGNAL( activated() ), this, SLOT( editDeleteSelection() ) ); - a->setEnabled (false); - actionEditDelete=a; - - // Shortcut to add branch - alt = new QAction(tr( "Add branch as child" ), this); - alt->setStatusTip ( tr( "Add a branch as child of selection" )); - alt->setShortcut (Qt::Key_A); - connect( alt, SIGNAL( activated() ), this, SLOT( editNewBranch() ) ); - a = new QAction(tr( "Add branch as child" ), this); - a->setStatusTip ( tr( "Add a branch as child of selection" )); - a->setShortcut (Qt::Key_Insert); -// a->setEnabled (false); - connect( a, SIGNAL( activated() ), this, SLOT( editNewBranch() ) ); - actionListBranches.append(a); - #if defined (Q_OS_MACX) - // In OSX show different shortcut in menues, the keys work independtly always - actionEditAddBranch=alt; - #else - actionEditAddBranch=a; - #endif - - // Add branch by inserting it at selection - a = new QAction(tr( "Add branch (insert)" ), this); - a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" )); - a->setShortcut (Qt::ALT + Qt::Key_Insert ); - connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchHere() ) ); - a->setEnabled (false); - actionListBranches.append(a); - actionEditAddBranchHere=a; - a = new QAction(tr( "Add branch (insert)" ),this); - a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" )); - a->setShortcut ( Qt::ALT + Qt::Key_A ); - connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchHere() ) ); - actionListBranches.append(a); - - // Add branch above - a = new QAction(tr( "Add branch above" ), this); - a->setStatusTip ( tr( "Add a branch above selection" )); - a->setShortcut (Qt::SHIFT+Qt::Key_Insert ); - connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchAbove() ) ); - a->setEnabled (false); - actionListBranches.append(a); - actionEditAddBranchAbove=a; - a = new QAction(tr( "Add branch above" ), this); - a->setStatusTip ( tr( "Add a branch above selection" )); - a->setShortcut (Qt::SHIFT+Qt::Key_A ); - connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchAbove() ) ); - actionListBranches.append(a); - - // Add branch below - a = new QAction(tr( "Add branch below" ), this); - a->setStatusTip ( tr( "Add a branch below selection" )); - a->setShortcut (Qt::CTRL +Qt::Key_Insert ); - connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchBelow() ) ); - a->setEnabled (false); - actionListBranches.append(a); - actionEditAddBranchBelow=a; - a = new QAction(tr( "Add branch below" ), this); - a->setStatusTip ( tr( "Add a branch below selection" )); - a->setShortcut (Qt::CTRL +Qt::Key_A ); - connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchBelow() ) ); - actionListBranches.append(a); + editMenu->addSeparator(); // Import at selection (adding to selection) a = new QAction( tr( "Add map (insert)" ),this); @@ -796,7 +794,7 @@ a->setStatusTip (tr( "Select first branch" )); a->setShortcut (Qt::Key_Home ); a->setEnabled (false); - a->addTo ( menu ); + editMenu->addAction (a); actionListBranches.append(a); actionEditSelectFirst=a; connect( a, SIGNAL( activated() ), this, SLOT( editFirstBranch() ) ); @@ -805,7 +803,7 @@ a->setShortcut ( Qt::Key_End ); connect( a, SIGNAL( activated() ), this, SLOT( editLastBranch() ) ); a->setEnabled (false); - a->addTo ( menu ); + editMenu->addAction (a); actionListBranches.append(a); actionEditSelectLast=a; @@ -819,8 +817,7 @@ // Format Actions void Main::setupFormatActions() { - Q3PopupMenu *menu = new Q3PopupMenu( this ); - menuBar()->insertItem( tr( "F&ormat" ), menu ); + QMenu *formatMenu = menuBar()->addMenu (tr ("F&ormat")); QToolBar *tb = addToolBar( tr("Format Actions","Toolbars")); QAction *a; @@ -830,7 +827,7 @@ a->setStatusTip ( tr( "Set Color" )); connect( a, SIGNAL( activated() ), this, SLOT( formatSelectColor() ) ); a->addTo( tb ); - a->addTo( menu ); + formatMenu->addAction (a); actionFormatColor=a; a= new QAction( QPixmap(iconPath+"formatcolorpicker.png"), tr( "Pic&k color" ), this); a->setStatusTip (tr( "Pick color\nHint: You can pick a color from another branch and color using CTRL+Left Button" ) ); @@ -838,7 +835,7 @@ connect( a, SIGNAL( activated() ), this, SLOT( formatPickColor() ) ); a->setEnabled (false); a->addTo( tb ); - a->addTo( menu ); + formatMenu->addAction (a); actionListBranches.append(a); actionFormatPickColor=a; @@ -848,7 +845,7 @@ connect( a, SIGNAL( activated() ), this, SLOT( formatColorItem() ) ); a->setEnabled (false); a->addTo( tb ); - a->addTo( menu ); + formatMenu->addAction (a); actionListBranches.append(a); actionFormatColorBranch=a; @@ -857,35 +854,39 @@ a->setShortcut (Qt::CTRL + Qt::Key_T); connect( a, SIGNAL( activated() ), this, SLOT( formatColorBranch() ) ); a->setEnabled (false); - a->addTo( menu ); + formatMenu->addAction (a); a->addTo( tb ); actionListBranches.append(a); actionFormatColorSubtree=a; - menu->insertSeparator(); + formatMenu->addSeparator(); actionGroupFormatLinkStyles=new QActionGroup ( this); actionGroupFormatLinkStyles->setExclusive (true); a= new QAction( tr( "Linkstyle Line" ), actionGroupFormatLinkStyles); a->setStatusTip (tr( "Line" )); a->setToggleAction(true); connect( a, SIGNAL( activated() ), this, SLOT( formatLinkStyleLine() ) ); + formatMenu->addAction (a); actionFormatLinkStyleLine=a; a= new QAction( tr( "Linkstyle Parabel" ), actionGroupFormatLinkStyles); a->setStatusTip (tr( "Line" )); a->setToggleAction(true); connect( a, SIGNAL( activated() ), this, SLOT( formatLinkStyleParabel() ) ); + formatMenu->addAction (a); actionFormatLinkStyleParabel=a; a= new QAction( tr( "Linkstyle Thick Line" ), actionGroupFormatLinkStyles ); a->setStatusTip (tr( "PolyLine" )); a->setToggleAction(true); connect( a, SIGNAL( activated() ), this, SLOT( formatLinkStylePolyLine() ) ); + formatMenu->addAction (a); actionFormatLinkStylePolyLine=a; a= new QAction( tr( "Linkstyle Thick Parabel" ), actionGroupFormatLinkStyles); a->setStatusTip (tr( "PolyParabel" ) ); a->setToggleAction(true); + a->setChecked (true); connect( a, SIGNAL( activated() ), this, SLOT( formatLinkStylePolyParabel() ) ); + formatMenu->addAction (a); actionFormatLinkStylePolyParabel=a; - actionGroupFormatLinkStyles->addTo (menu); actionGroupFormatFrameTypes=new QActionGroup ( this); actionGroupFormatFrameTypes->setExclusive (true); @@ -918,24 +919,24 @@ connect( a, SIGNAL( activated() ), this, SLOT( formatHideLinkUnselected() ) ); actionFormatHideLinkUnselected=a; - menu->insertSeparator(); + formatMenu->addSeparator(); a= new QAction( tr( "&Use color of heading for link" ), this); a->setStatusTip (tr( "Use same color for links and headings" )); a->setToggleAction(true); connect( a, SIGNAL( activated() ), this, SLOT( formatToggleLinkColorHint() ) ); - a->addTo( menu ); + formatMenu->addAction (a); actionFormatLinkColorHint=a; pix.fill (Qt::white); a= new QAction( pix, tr( "Set &Link Color"+QString("...") ), this ); a->setStatusTip (tr( "Set Link Color" )); - a->addTo( menu ); + formatMenu->addAction (a); connect( a, SIGNAL( activated() ), this, SLOT( formatSelectLinkColor() ) ); actionFormatLinkColor=a; a= new QAction( pix, tr( "Set &Background Color" )+QString("..."), this ); a->setStatusTip (tr( "Set Background Color" )); - a->addTo( menu ); + formatMenu->addAction (a); connect( a, SIGNAL( activated() ), this, SLOT( formatSelectBackColor() ) ); actionFormatBackColor=a; } @@ -945,29 +946,28 @@ { QToolBar *tb = addToolBar( tr("View Actions","Toolbars") ); tb->setLabel( "View Actions" ); - Q3PopupMenu *menu = new Q3PopupMenu( this ); - menuBar()->insertItem( tr( "&View" ), menu ); + QMenu *viewMenu = menuBar()->addMenu ( tr( "&View" )); QAction *a; a = new QAction(QPixmap(iconPath+"viewmag-reset.png"), tr( "reset Zoom" ), this); a->setStatusTip ( tr( "Zoom reset" ) ); a->setShortcut (Qt::CTRL + Qt::Key_0 ); a->addTo( tb ); - a->addTo( menu ); + viewMenu->addAction (a); connect( a, SIGNAL( activated() ), this, SLOT(viewZoomReset() ) ); a = new QAction( QPixmap(iconPath+"viewmag+.png"), tr( "Zoom in" ), this); a->setStatusTip (tr( "Zoom in" )); a->setShortcut (Qt::CTRL + Qt::Key_Plus); a->addTo( tb ); - a->addTo( menu ); + viewMenu->addAction (a); connect( a, SIGNAL( activated() ), this, SLOT(viewZoomIn() ) ); a = new QAction( QPixmap(iconPath+"viewmag-.png"), tr( "Zoom out" ), this); a->setStatusTip (tr( "Zoom out" )); a->setShortcut (Qt::CTRL + Qt::Key_Minus ); a->addTo( tb ); - a->addTo( menu ); + viewMenu->addAction (a); connect( a, SIGNAL( activated() ), this, SLOT( viewZoomOut() ) ); @@ -980,7 +980,7 @@ else a->setOn(false); a->addTo( tb ); - a->addTo( menu ); + viewMenu->addAction (a); connect( a, SIGNAL( activated() ), this, SLOT(windowToggleNoteEditor() ) ); actionViewToggleNoteEditor=a; @@ -988,20 +988,20 @@ a->setStatusTip ( tr( "Show history window" )); a->setShortcut ( Qt::CTRL + Qt::Key_H ); a->setToggleAction(false); - a->addTo( menu ); + viewMenu->addAction (a); connect( a, SIGNAL( activated() ), this, SLOT(windowToggleHistory() ) ); actionViewToggleHistoryWindow=a; a = new QAction(tr( "Next Window" ), this); a->setStatusTip ( tr( "&Next Window" ) ); a->setShortcut (Qt::ALT + Qt::Key_N ); - a->addTo( menu ); + viewMenu->addAction (a); connect( a, SIGNAL( activated() ), this, SLOT(windowNextEditor() ) ); a = new QAction (tr( "Previous Window" ), this ); a->setStatusTip (tr( "&Previous Window" )); a->setShortcut (Qt::ALT + Qt::Key_P ); - a->addTo( menu ); + viewMenu->addAction (a); connect( a, SIGNAL( activated() ), this, SLOT(windowPreviousEditor() ) ); } @@ -1359,56 +1359,54 @@ // Settings Actions void Main::setupSettingsActions() { - Q3PopupMenu *menu = new Q3PopupMenu( this ); - menuBar()->insertItem( tr( "&Settings" ), menu ); + QMenu *settingsMenu = menuBar()->addMenu( tr( "&Settings" )); QAction *a; - a = new QAction( tr( "Set application to open pdf files"), this); a->setStatusTip ( tr( "Set application to open pdf files")); connect( a, SIGNAL( activated() ), this, SLOT( settingsPDF() ) ); - a->addTo( menu ); + settingsMenu->addAction (a); a = new QAction( tr( "Set application to open external links"), this); a->setStatusTip( tr( "Set application to open external links")); connect( a, SIGNAL( activated() ), this, SLOT( settingsURL() ) ); - a->addTo( menu ); - - menu->insertSeparator(); + settingsMenu->addAction (a); + + settingsMenu->addSeparator(); a = new QAction( tr( "Edit branch after adding it" ), this ); a->setStatusTip( tr( "Edit branch after adding it" )); a->setToggleAction(true); a->setOn ( settings.readBoolEntry ("/vym/mapeditor/editmode/autoedit",true) ); - a->addTo( menu ); + settingsMenu->addAction (a); actionSettingsAutoedit=a; a= new QAction( tr( "Select branch after adding it" ), this ); a->setStatusTip( tr( "Select branch after adding it" )); a->setToggleAction(true); a->setOn ( settings.readBoolEntry ("/vym/mapeditor/editmode/autoselect",false) ); - a->addTo( menu ); + settingsMenu->addAction (a); actionSettingsAutoselectHeading=a; a= new QAction(tr( "Select existing heading" ), this); a->setStatusTip( tr( "Select heading before editing" )); a->setToggleAction(true); a->setOn ( settings.readBoolEntry ("/vym/mapeditor/editmode/autoselectexistingtext",true) ); - a->addTo( menu ); + settingsMenu->addAction (a); actionSettingsAutoselectText=a; a= new QAction(tr( "pasting into new branch" ), this ); a->setStatusTip( tr( "Pasting into new branch" )); a->setToggleAction(true); a->setOn ( settings.readBoolEntry ("/vym/mapeditor/editmode/newheadingisempty",true) ); - a->addTo( menu ); + settingsMenu->addAction (a); actionSettingsPasteNewHeading=a; a= new QAction( tr( "Delete key" ), this); a->setStatusTip( tr( "Delete key for deleting branches" )); a->setToggleAction(true); a->setOn ( settings.readBoolEntry ("/vym/mapeditor/editmode/useDelKey",false) ); - a->addTo( menu ); + settingsMenu->addAction (a); connect( a, SIGNAL( activated() ), this, SLOT( settingsToggleDelKey() ) ); actionSettingsUseDelKey=a; @@ -1416,51 +1414,49 @@ a->setStatusTip( tr( "Use exclusive flags in flag toolbars" )); a->setToggleAction(true); a->setOn ( settings.readBoolEntry ("/vym/mapeditor/editmode/useFlagGroups",true) ); - a->addTo( menu ); + settingsMenu->addAction (a); actionSettingsUseFlagGroups=a; a= new QAction( tr( "Use hide flags" ), this); a->setStatusTip( tr( "Use hide flag during exports " )); a->setToggleAction(true); a->setOn ( settings.readBoolEntry ("/vym/export/useHideExport",true) ); - a->addTo( menu ); + settingsMenu->addAction (a); actionSettingsUseHideExport=a; } // Test Actions void Main::setupTestActions() { - Q3PopupMenu *menu = new Q3PopupMenu( this ); - menuBar()->insertItem( tr( "&Test" ), menu ); + QMenu *testMenu = menuBar()->addMenu( tr( "&Test" )); QAction *a; a = new QAction( tr( "test flag" ), this); a->setStatusTip( tr( "Call test function" )); connect( a, SIGNAL( activated() ), this, SLOT( testFunction() ) ); - a->addTo( menu ); + testMenu->addAction (a); } // Help Actions void Main::setupHelpActions() { - Q3PopupMenu *menu = new Q3PopupMenu( this ); - menuBar()->insertItem( tr( "&Help" ), menu ); + QMenu *helpMenu = menuBar()->addMenu ( tr( "&Help" )); QAction *a; a = new QAction( tr( "Open VYM Documentation (pdf) " ), this ); a->setStatusTip( tr( "Open VYM Documentation (pdf)" )); connect( a, SIGNAL( activated() ), this, SLOT( helpDoc() ) ); - a->addTo( menu ); + helpMenu->addAction (a); a = new QAction( tr( "About VYM" ), this); a->setStatusTip( tr( "About VYM")+" "__VYM); connect( a, SIGNAL( activated() ), this, SLOT( helpAbout() ) ); - a->addTo( menu ); + helpMenu->addAction (a); a = new QAction( tr( "About QT" ), this); a->setStatusTip( tr( "Information about QT toolkit" )); connect( a, SIGNAL( activated() ), this, SLOT( helpAboutQT() ) ); - a->addTo( menu ); + helpMenu->addAction (a); } // Context Menus @@ -1495,33 +1491,34 @@ actionEditSaveBranch->addTo( branchContextMenu ); -/* branchContextMenu->addSeparator(); - actionEditOpenURL->addTo ( branchContextMenu ); - actionEditOpenURLTab->addTo ( branchContextMenu ); - actionEditURL->addTo ( branchContextMenu ); - actionEditHeading2URL->addTo ( branchContextMenu ); - actionEditBugzilla2URL->addTo( branchContextMenu ); + branchContextMenu->addAction ( actionEditOpenURL ); + branchContextMenu->addAction ( actionEditOpenURLTab ); + branchContextMenu->addAction ( actionEditURL ); + branchContextMenu->addAction ( actionEditHeading2URL ); + branchContextMenu->addAction ( actionEditBugzilla2URL ); if (settings.readBoolEntry( "/vym/mainwindow/showTestMenu",false)) { - actionEditFATE2URL->addTo( branchContextMenu ); + branchContextMenu->addAction ( actionEditFATE2URL ); } - branchContextMenu->insertSeparator(); - actionEditOpenVymLink->addTo ( branchContextMenu ); - actionEditVymLink->addTo ( branchContextMenu ); - actionEditDeleteVymLink->addTo ( branchContextMenu ); + branchContextMenu->addSeparator(); + branchContextMenu->addAction ( actionEditOpenVymLink ); + branchContextMenu->addAction ( actionEditVymLink ); + branchContextMenu->addAction ( actionEditDeleteVymLink ); - branchContextMenu->insertSeparator(); - actionGroupFormatFrameTypes->addTo( branchContextMenu ); - - branchContextMenu->insertSeparator(); - actionFormatIncludeImagesVer->addTo( branchContextMenu ); - actionFormatIncludeImagesHor->addTo( branchContextMenu ); - actionFormatHideLinkUnselected->addTo( branchContextMenu ); + branchContextMenu->addSeparator(); + branchContextMenu->addAction ( actionFormatFrameNone ); + branchContextMenu->addAction ( actionFormatFrameRectangle); + + branchContextMenu->addSeparator(); + branchContextMenu->addAction ( actionFormatIncludeImagesVer ); + branchContextMenu->addAction ( actionFormatIncludeImagesHor ); + branchContextMenu->addAction ( actionFormatHideLinkUnselected ); // Context Menu for links in a branch menu // This will be populated "on demand" in MapEditor::updateActions - branchContextMenu->insertSeparator(); + branchContextMenu->addSeparator(); + /* FIXME not yet ported from QT3 branchLinksContextMenu =new Q3PopupMenu (this); branchLinksContextMenuDup =new Q3PopupMenu (this); branchContextMenu->insertItem (tr("Edit XLink"),branchLinksContextMenuDup); @@ -1529,8 +1526,8 @@ branchContextMenu->insertItem (tr("Goto XLink"),branchLinksContextMenu); connect( branchLinksContextMenu, SIGNAL( activated(int) ), this, SLOT( editFollowXLink(int ) ) ); + */ -*/ // Context menu for floatimage floatimageContextMenu =new QMenu (this); saveImageFormatMenu=floatimageContextMenu->addMenu (tr("Save image"));