diff -r 0bba81dde1bc -r 36eb4b8f409e mainwindow.cpp --- a/mainwindow.cpp Fri Feb 19 13:47:03 2010 +0000 +++ b/mainwindow.cpp Thu Feb 25 11:03:52 2010 +0000 @@ -205,6 +205,8 @@ setupSettingsActions(); setupContextMenus(); setupMacros(); + if (debug) switchboard.print(); + if (settings.value( "/mainwindow/showTestMenu",false).toBool()) setupTestActions(); setupHelpActions(); @@ -341,6 +343,7 @@ a = new QAction(QPixmap( iconPath+"filenew.png"), tr( "&New map","File menu" ),this); a->setStatusTip ( tr( "New map","Status tip File menu" ) ); a->setShortcut ( Qt::CTRL + Qt::Key_N ); //New map + switchboard.addConnection(a,tr("File","Shortcut group")); a->addTo( tb ); fileMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( fileNew() ) ); @@ -348,6 +351,7 @@ a = new QAction(QPixmap( iconPath+"filenewcopy.png"), tr( "&Copy to new map","File menu" ),this); a->setStatusTip ( tr( "Copy selection to mapcenter of a new map","Status tip File menu" ) ); a->setShortcut ( Qt::CTRL +Qt::SHIFT + Qt::Key_N ); //New map + switchboard.addConnection(a,tr("File","Shortcut group")); fileMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( fileNewCopy() ) ); actionFileNewCopy=a; @@ -355,6 +359,7 @@ a = new QAction( QPixmap( iconPath+"fileopen.png"), tr( "&Open..." ,"File menu"),this); a->setStatusTip (tr( "Open","Status tip File menu" ) ); a->setShortcut ( Qt::CTRL + Qt::Key_O ); //Open map + switchboard.addConnection(a,tr("File","Shortcut group")); a->addTo( tb ); fileMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( fileLoad() ) ); @@ -365,6 +370,7 @@ a = new QAction( QPixmap( iconPath+"filesave.png"), tr( "&Save...","File menu" ), this); a->setStatusTip ( tr( "Save","Status tip file menu" )); a->setShortcut (Qt::CTRL + Qt::Key_S ); //Save map + switchboard.addConnection(a,tr("File","Shortcut group")); a->addTo( tb ); fileMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( fileSave() ) ); @@ -372,6 +378,7 @@ a = new QAction( QPixmap(iconPath+"filesaveas.png"), tr( "Save &As...","File menu" ), this); a->setStatusTip (tr( "Save &As","Status tip file menu" ) ); + switchboard.addConnection(a,tr("File","Shortcut group")); fileMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( fileSaveAs() ) ); @@ -381,12 +388,14 @@ a = new QAction(tr("KDE 3 Bookmarks"), this); a->setStatusTip ( tr( "Import %1","Status tip file menu" ).arg(tr("KDE 3 bookmarks"))); + switchboard.addConnection(a,tr("File","Shortcut group")); a->addTo (fileImportMenu); connect( a, SIGNAL( triggered() ), this, SLOT( fileImportKDE3Bookmarks() ) ); a = new QAction(tr("KDE 4 Bookmarks"), this); a->setStatusTip ( tr( "Import %1","Status tip file menu" ).arg(tr("KDE 4 bookmarks"))); a->addTo (fileImportMenu); + switchboard.addConnection(a,tr("File","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( fileImportKDE4Bookmarks() ) ); if (settings.value( "/mainwindow/showTestMenu",false).toBool()) @@ -394,21 +403,25 @@ a = new QAction( QPixmap(), tr("Firefox Bookmarks","File menu"),this); a->setStatusTip (tr( "Import %1","Status tip file menu").arg(tr("Firefox Bookmarks" ) )); a->addTo (fileImportMenu); + switchboard.addConnection(a,tr("File","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( fileImportFirefoxBookmarks() ) ); } a = new QAction("Freemind...",this); a->setStatusTip ( tr( "Import %1","status tip file menu").arg(" Freemind") ); + switchboard.addConnection(a,tr("File","Shortcut group")); fileImportMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( fileImportFreemind() ) ); a = new QAction("Mind Manager...",this); a->setStatusTip ( tr( "Import %1","status tip file menu").arg(" Mind Manager") ); + switchboard.addConnection(a,tr("File","Shortcut group")); fileImportMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( fileImportMM() ) ); a = new QAction( tr( "Import Dir%1","File menu").arg("..."), this); a->setStatusTip (tr( "Import directory structure (experimental)","status tip file menu" ) ); + switchboard.addConnection(a,tr("File","Shortcut group")); fileImportMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( fileImportDir() ) ); @@ -416,17 +429,20 @@ a = new QAction( tr("Image%1","File export menu").arg("..."), this); a->setStatusTip( tr( "Export map as image","status tip file menu" )); + switchboard.addConnection(a,tr("File","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( fileExportImage() ) ); fileExportMenu->addAction (a); a = new QAction( "Open Office...", this); a->setStatusTip( tr( "Export in Open Document Format used e.g. in Open Office ","status tip file menu" )); + switchboard.addConnection(a,tr("File","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( fileExportOOPresentation() ) ); fileExportMenu->addAction (a); a = new QAction( "Webpage (HTML)...",this ); a->setShortcut (Qt::ALT + Qt::Key_X); //Export HTML a->setStatusTip ( tr( "Export as %1","status tip file menu").arg(tr(" webpage (XHTML)","status tip file menu"))); + switchboard.addConnection(a,tr("File","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( fileExportHTML() ) ); fileExportMenu->addAction (a); @@ -438,41 +454,49 @@ a = new QAction( "Text (A&O report)...", this); a->setStatusTip ( tr( "Export as %1").arg("A&O report "+tr("(still experimental)" ))); + switchboard.addConnection(a,tr("File","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( fileExportAO() ) ); fileExportMenu->addAction (a); a = new QAction( "Text (ASCII)...", this); a->setStatusTip ( tr( "Export as %1").arg("ASCII "+tr("(still experimental)" ))); + switchboard.addConnection(a,tr("File","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( fileExportASCII() ) ); fileExportMenu->addAction (a); a = new QAction( "Spreadsheet (CSV)...", this); a->setStatusTip ( tr( "Export as %1").arg("CSV "+tr("(still experimental)" ))); + switchboard.addConnection(a,tr("File","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( fileExportCSV() ) ); fileExportMenu->addAction (a); a = new QAction( tr("KDE 3 Bookmarks","File menu"), this); a->setStatusTip( tr( "Export as %1").arg(tr("KDE 3 Bookmarks" ))); + switchboard.addConnection(a,tr("File","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( fileExportKDE3Bookmarks() ) ); fileExportMenu->addAction (a); a = new QAction( tr("KDE 4 Bookmarks","File menu"), this); a->setStatusTip( tr( "Export as %1").arg(tr("KDE 4 Bookmarks" ))); + switchboard.addConnection(a,tr("File","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( fileExportKDE4Bookmarks() ) ); fileExportMenu->addAction (a); a = new QAction( "Taskjuggler...", this ); a->setStatusTip( tr( "Export as %1").arg("Taskjuggler "+tr("(still experimental)" ))); + switchboard.addConnection(a,tr("File","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( fileExportTaskjuggler() ) ); fileExportMenu->addAction (a); a = new QAction( "LaTeX...", this); a->setStatusTip( tr( "Export as %1").arg("LaTeX "+tr("(still experimental)" ))); + switchboard.addConnection(a,tr("File","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( fileExportLaTeX() ) ); fileExportMenu->addAction (a); a = new QAction( "XML..." , this ); a->setStatusTip (tr( "Export as %1").arg("XML")); + switchboard.addConnection(a,tr("File","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( fileExportXML() ) ); fileExportMenu->addAction (a); @@ -482,6 +506,7 @@ a->setStatusTip ( tr( "Print" ,"File menu") ); a->setShortcut (Qt::CTRL + Qt::Key_P ); //Print map a->addTo( tb ); + switchboard.addConnection(a,tr("File","Shortcut group")); fileMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( filePrint() ) ); actionFilePrint=a; @@ -489,12 +514,14 @@ a = new QAction( QPixmap(iconPath+"fileclose.png"), tr( "&Close Map","File menu" ), this); a->setStatusTip (tr( "Close Map" ) ); a->setShortcut (Qt::CTRL + Qt::Key_W ); //Close map + switchboard.addConnection(a,tr("File","Shortcut group")); fileMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( fileCloseMap() ) ); a = new QAction(QPixmap(iconPath+"exit.png"), tr( "E&xit","File menu")+" "+vymName, this); a->setStatusTip ( tr( "Exit")+" "+vymName ); a->setShortcut (Qt::CTRL + Qt::Key_Q ); //Quit vym + switchboard.addConnection(a,tr("File","Shortcut group")); fileMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( fileExitVYM() ) ); } @@ -515,6 +542,7 @@ a->setStatusTip (tr( "Undo" ) ); a->setShortcut ( Qt::CTRL + Qt::Key_Z ); //Undo last action a->setEnabled (false); + switchboard.addConnection(a,tr("Edit","Shortcut group")); tb->addAction (a); editMenu->addAction (a); actionUndo=a; @@ -522,6 +550,7 @@ a = new QAction( QPixmap( iconPath+"redo.png"), tr( "&Redo","Edit menu" ), this); a->setStatusTip (tr( "Redo" )); a->setShortcut (Qt::CTRL + Qt::Key_Y ); //Redo last action + switchboard.addConnection(a,tr("Edit","Shortcut group")); tb->addAction (a); editMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editRedo() ) ); @@ -532,6 +561,7 @@ a->setStatusTip ( tr( "Copy" ) ); a->setShortcut (Qt::CTRL + Qt::Key_C ); //Copy a->setEnabled (false); + switchboard.addConnection(a,tr("Edit","Shortcut group")); tb->addAction (a); editMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editCopy() ) ); @@ -542,6 +572,7 @@ a->setShortcut (Qt::CTRL + Qt::Key_X ); //Cut a->setEnabled (false); tb->addAction (a); + switchboard.addConnection(a,tr("Edit","Shortcut group")); editMenu->addAction (a); actionCut=a; connect( a, SIGNAL( triggered() ), this, SLOT( editCut() ) ); @@ -552,6 +583,7 @@ a->setShortcut ( Qt::CTRL + Qt::Key_V ); //Paste a->setEnabled (false); tb->addAction (a); + switchboard.addConnection(a,tr("Edit","Shortcut group")); editMenu->addAction (a); actionPaste=a; @@ -560,6 +592,7 @@ a->setStatusTip (tr( "Delete Selection" )); a->setShortcut ( Qt::Key_Delete); //Delete selection a->setShortcutContext (Qt::WindowShortcut); + switchboard.addConnection(a,tr("Edit","Shortcut group")); addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteSelection() ) ); actionDelete=a; @@ -568,6 +601,7 @@ a= new QAction(tr( "Add attribute" ), this); a->setShortcut ( Qt::Key_Q); a->setShortcutContext (Qt::WindowShortcut); + switchboard.addConnection(a,tr("Edit","Shortcut group")); addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editAddAttribute() ) ); actionAddAttribute= a; @@ -577,6 +611,7 @@ a= new QAction(QPixmap(iconPath+"newmapcenter.png"),tr( "Add mapcenter","Canvas context menu" ), this); a->setShortcut ( Qt::Key_M); a->setShortcutContext (Qt::WindowShortcut); + switchboard.addConnection(a,tr("Edit","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( editAddMapCenter() ) ); //actionListBranches.append(a); tb->addAction (a); @@ -588,11 +623,13 @@ alt->setStatusTip ( tr( "Add a branch as child of selection" )); alt->setShortcut (Qt::Key_A); //Add branch alt->setShortcutContext (Qt::WindowShortcut); + switchboard.addConnection(alt,tr("Edit","Shortcut group")); addAction (alt); connect( alt, SIGNAL( triggered() ), this, SLOT( editNewBranch() ) ); a = new QAction(QPixmap(iconPath+"newbranch.png"), tr( "Add branch as child","Edit menu" ), this); a->setStatusTip ( tr( "Add a branch as child of selection" )); a->setShortcut (Qt::Key_Insert); //Add branch + switchboard.addConnection(a,tr("Edit","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranch() ) ); actionListBranches.append(a); #if defined (Q_OS_MACX) @@ -610,6 +647,7 @@ a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" )); a->setShortcut (Qt::ALT + Qt::Key_Insert ); //Insert branch a->setShortcutContext (Qt::WindowShortcut); + switchboard.addConnection(a,tr("Edit","Shortcut group")); addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBefore() ) ); a->setEnabled (false); @@ -619,6 +657,7 @@ a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" )); a->setShortcut ( Qt::ALT + Qt::Key_A ); //Insert branch a->setShortcutContext (Qt::WindowShortcut); + switchboard.addConnection(a,tr("Edit","Shortcut group")); addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBefore() ) ); actionListBranches.append(a); @@ -628,6 +667,7 @@ a->setStatusTip ( tr( "Add a branch above selection" )); a->setShortcut (Qt::SHIFT+Qt::Key_Insert ); //Add branch above a->setShortcutContext (Qt::WindowShortcut); + switchboard.addConnection(a,tr("Edit","Shortcut group")); addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchAbove() ) ); a->setEnabled (false); @@ -637,6 +677,7 @@ a->setStatusTip ( tr( "Add a branch above selection" )); a->setShortcut (Qt::SHIFT+Qt::Key_A ); //Add branch above a->setShortcutContext (Qt::WindowShortcut); + switchboard.addConnection(a,tr("Edit","Shortcut group")); addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchAbove() ) ); actionListBranches.append(a); @@ -646,6 +687,7 @@ a->setStatusTip ( tr( "Add a branch below selection" )); a->setShortcut (Qt::CTRL +Qt::Key_Insert ); //Add branch below a->setShortcutContext (Qt::WindowShortcut); + switchboard.addConnection(a,tr("Edit","Shortcut group")); addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBelow() ) ); a->setEnabled (false); @@ -655,6 +697,7 @@ a->setStatusTip ( tr( "Add a branch below selection" )); a->setShortcut (Qt::CTRL +Qt::Key_A ); // Add branch below a->setShortcutContext (Qt::WindowShortcut); + switchboard.addConnection(a,tr("Edit","Shortcut group")); addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBelow() ) ); actionListBranches.append(a); @@ -663,6 +706,7 @@ a->setStatusTip ( tr( "Move branch up" ) ); a->setShortcut (Qt::Key_PageUp ); // Move branch up a->setEnabled (false); + switchboard.addConnection(a,tr("Edit","Shortcut group")); tb->addAction (a); editMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editMoveUp() ) ); @@ -673,6 +717,7 @@ a->setStatusTip (tr( "Move branch down" ) ); a->setShortcut ( Qt::Key_PageDown ); // Move branch down a->setEnabled (false); + switchboard.addConnection(a,tr("Edit","Shortcut group")); tb->addAction (a); editMenu->addAction (a); actionMoveDown=a; @@ -680,6 +725,7 @@ a = new QAction(QPixmap(), tr( "&Detach","Context menu" ),this); a->setStatusTip ( tr( "Detach branch and use as mapcenter","Context menu" ) ); a->setShortcut ( Qt::Key_D ); // Detach branch + switchboard.addConnection(a,tr("Edit","Shortcut group")); editMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editDetach() ) ); actionDetach=a; @@ -688,6 +734,7 @@ connect( a, SIGNAL( activated() ), this, SLOT( editSortChildren() ) ); a->setEnabled (true); a->addTo( tb ); + switchboard.addConnection(a,tr("Edit","Shortcut group")); editMenu->addAction (a); actionSortChildren=a; @@ -695,12 +742,14 @@ connect( a, SIGNAL( activated() ), this, SLOT( editSortBackChildren() ) ); a->setEnabled (true); a->addTo( tb ); + switchboard.addConnection(a,tr("Edit","Shortcut group")); editMenu->addAction (a); actionSortBackChildren=a; alt = new QAction( QPixmap(flagsPath+"flag-scrolled-right.png"), tr( "Scroll branch","Edit menu" ), this); alt->setShortcut ( Qt::Key_S ); // Scroll branch alt->setStatusTip (tr( "Scroll branch" )); + switchboard.addConnection(alt,tr("Edit","Shortcut group")); connect( alt, SIGNAL( triggered() ), this, SLOT( editToggleScroll() ) ); #if defined(Q_OS_MACX) actionToggleScroll=alt; @@ -719,6 +768,7 @@ a = new QAction( QPixmap(), tr( "Expand all branches","Edit menu" ), this); a->setShortcut ( Qt::SHIFT + Qt::Key_X ); // Expand all branches a->setStatusTip (tr( "Expand all branches" )); + switchboard.addConnection(a,tr("Edit","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( editExpandAll() ) ); actionExpandAll=a; actionExpandAll->setEnabled (false); @@ -730,6 +780,7 @@ a = new QAction( QPixmap(), tr( "Expand one level","Edit menu" ), this); a->setShortcut ( Qt::Key_Greater ); // Expand one level in tree editor + switchboard.addConnection(a,tr("Edit","Shortcut group")); a->setStatusTip (tr( "Expand one level in tree editor" )); connect( a, SIGNAL( triggered() ), this, SLOT( editExpandOneLevel() ) ); a->setEnabled (false); @@ -742,6 +793,7 @@ a = new QAction( QPixmap(), tr( "Collapse one level","Edit menu" ), this); a->setShortcut ( Qt::Key_Less); // Collapse one level in tree editor + switchboard.addConnection(a,tr("Edit","Shortcut group")); a->setStatusTip (tr( "Collapse one level in tree editor" )); connect( a, SIGNAL( triggered() ), this, SLOT( editCollapseOneLevel() ) ); a->setEnabled (false); @@ -754,6 +806,7 @@ a = new QAction( tr( "Unscroll children","Edit menu" ), this); a->setStatusTip (tr( "Unscroll all scrolled branches in selected subtree" )); + switchboard.addConnection(a,tr("Edit","Shortcut group")); editMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editUnscrollChildren() ) ); @@ -762,12 +815,14 @@ a = new QAction( QPixmap(iconPath+"find.png"), tr( "Find...","Edit menu"), this); a->setStatusTip (tr( "Find" ) ); a->setShortcut (Qt::CTRL + Qt::Key_F ); //Find + switchboard.addConnection(a,tr("Edit","Shortcut group")); editMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editOpenFindWidget() ) ); a = new QAction( tr( "Find duplicate URLs","Edit menu"), this); //a->setStatusTip (tr( "Find" ) ); a->setShortcut (Qt::SHIFT + Qt::Key_F); //Find duplicate URLs + switchboard.addConnection(a,tr("Edit","Shortcut group")); if (settings.value( "/mainwindow/showTestMenu",false).toBool() ) editMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editFindDuplicateURLs() ) ); @@ -776,7 +831,7 @@ a = new QAction( QPixmap(flagsPath+"flag-url.png"), tr( "Open URL","Edit menu" ), this); a->setShortcut (Qt::SHIFT + Qt::Key_U ); - a->setShortcut (tr( "Open URL" )); + switchboard.addConnection(a,tr("Edit","Shortcut group")); tb->addAction (a); addAction(a); connect( a, SIGNAL( triggered() ), this, SLOT( editOpenURL() ) ); @@ -785,6 +840,7 @@ a = new QAction( tr( "Open URL in new tab","Edit menu" ), this); a->setStatusTip (tr( "Open URL in new tab" )); //a->setShortcut (Qt::CTRL+Qt::Key_U ); + switchboard.addConnection(a,tr("Edit","Shortcut group")); addAction(a); connect( a, SIGNAL( triggered() ), this, SLOT( editOpenURLTab() ) ); actionOpenURLTab=a; @@ -792,6 +848,7 @@ a = new QAction( tr( "Open all URLs in subtree (including scrolled branches)","Edit menu" ), this); a->setStatusTip (tr( "Open all URLs in subtree (including scrolled branches)" )); a->setShortcut ( Qt::CTRL + Qt::Key_U ); + switchboard.addConnection(a,tr("Edit","Shortcut group")); addAction(a); actionListBranches.append(a); connect( a, SIGNAL( triggered() ), this, SLOT( editOpenMultipleVisURLTabs() ) ); @@ -799,6 +856,7 @@ a = new QAction( tr( "Open all URLs in subtree","Edit menu" ), this); a->setStatusTip (tr( "Open all URLs in subtree" )); + switchboard.addConnection(a,tr("Edit","Shortcut group")); addAction(a); actionListBranches.append(a); connect( a, SIGNAL( triggered() ), this, SLOT( editOpenMultipleURLTabs() ) ); @@ -808,6 +866,7 @@ a->setStatusTip ( tr( "Edit URL" ) ); a->setShortcut ( Qt::Key_U ); a->setShortcutContext (Qt::WindowShortcut); + switchboard.addConnection(a,tr("Edit","Shortcut group")); actionListBranches.append(a); addAction(a); connect( a, SIGNAL( triggered() ), this, SLOT( editURL() ) ); @@ -817,6 +876,7 @@ a->setStatusTip ( tr( "Edit local URL" ) ); //a->setShortcut (Qt::SHIFT + Qt::Key_U ); a->setShortcutContext (Qt::WindowShortcut); + switchboard.addConnection(a,tr("Edit","Shortcut group")); actionListBranches.append(a); addAction(a); connect( a, SIGNAL( triggered() ), this, SLOT( editLocalURL() ) ); @@ -825,6 +885,7 @@ a = new QAction( tr( "Use heading for URL","Edit menu" ), this); a->setStatusTip ( tr( "Use heading of selected branch as URL" )); a->setEnabled (false); + switchboard.addConnection(a,tr("Edit","Shortcut group")); actionListBranches.append(a); connect( a, SIGNAL( triggered() ), this, SLOT( editHeading2URL() ) ); actionHeading2URL=a; @@ -835,6 +896,7 @@ actionListBranches.append(a); a->setShortcut ( Qt::Key_B ); a->setShortcutContext (Qt::WindowShortcut); + switchboard.addConnection(a,tr("Edit","Shortcut group")); addAction(a); connect( a, SIGNAL( triggered() ), this, SLOT( editBugzilla2URL() ) ); actionBugzilla2URL=a; @@ -845,6 +907,7 @@ actionListBranches.append(a); a->setShortcut ( Qt::Key_B + Qt::SHIFT); a->setShortcutContext (Qt::WindowShortcut); + switchboard.addConnection(a,tr("Edit","Shortcut group")); addAction(a); connect( a, SIGNAL( triggered() ), this, SLOT( getBugzillaData() ) ); actionGetBugzillaData=a; @@ -852,6 +915,7 @@ a = new QAction(tr( "Create URL to Novell FATE","Edit menu" ), this); a->setStatusTip ( tr( "Create URL to Novell FATE" )); a->setEnabled (false); + switchboard.addConnection(a,tr("Edit","Shortcut group")); actionListBranches.append(a); connect( a, SIGNAL( triggered() ), this, SLOT( editFATE2URL() ) ); actionFATE2URL=a; @@ -860,12 +924,14 @@ a->setStatusTip ( tr( "Jump to another vym map, if needed load it first" )); tb->addAction (a); a->setEnabled (false); + switchboard.addConnection(a,tr("Edit","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( editOpenVymLink() ) ); actionOpenVymLink=a; a = new QAction(QPixmap(), tr( "Open all vym links in subtree","Edit menu" ), this); a->setStatusTip ( tr( "Open all vym links in subtree" )); a->setEnabled (false); + switchboard.addConnection(a,tr("Edit","Shortcut group")); actionListBranches.append(a); connect( a, SIGNAL( triggered() ), this, SLOT( editOpenMultipleVymLinks() ) ); actionOpenMultipleVymLinks=a; @@ -874,6 +940,7 @@ a = new QAction(tr( "Edit vym link...","Edit menu" ), this); a->setEnabled (false); a->setStatusTip ( tr( "Edit link to another vym map" )); + switchboard.addConnection(a,tr("Edit","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( editVymLink() ) ); actionListBranches.append(a); actionVymLink=a; @@ -881,6 +948,7 @@ a = new QAction(tr( "Delete vym link","Edit menu" ),this); a->setStatusTip ( tr( "Delete link to another vym map" )); a->setEnabled (false); + switchboard.addConnection(a,tr("Edit","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteVymLink() ) ); actionDeleteVymLink=a; @@ -890,6 +958,7 @@ a->setToggleAction(true); tb->addAction (a); a->setEnabled (false); + switchboard.addConnection(a,tr("Edit","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( editToggleHideExport() ) ); actionToggleHideExport=a; @@ -899,6 +968,7 @@ actionListBranches.append(a); a->setShortcut ( Qt::Key_T ); // Add timestamp a->setShortcutContext (Qt::WindowShortcut); + switchboard.addConnection(a,tr("Edit","Shortcut group")); addAction(a); connect( a, SIGNAL( triggered() ), this, SLOT( editAddTimestamp() ) ); actionAddTimestamp=a; @@ -906,6 +976,7 @@ a = new QAction(tr( "Edit Map Info...","Edit menu" ),this); a->setStatusTip ( tr( "Edit Map Info" )); a->setEnabled (true); + switchboard.addConnection(a,tr("Edit","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( editMapInfo() ) ); actionMapInfo=a; @@ -914,12 +985,14 @@ a->setStatusTip (tr( "Add map at selection" )); connect( a, SIGNAL( triggered() ), this, SLOT( editImportAdd() ) ); a->setEnabled (false); + switchboard.addConnection(a,tr("Edit","Shortcut group")); actionListBranches.append(a); actionImportAdd=a; // Import at selection (replacing selection) a = new QAction( tr( "Add map (replace)","Edit menu" ), this); a->setStatusTip (tr( "Replace selection with map" )); + switchboard.addConnection(a,tr("Edit","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( editImportReplace() ) ); a->setEnabled (false); actionListBranches.append(a); @@ -930,6 +1003,7 @@ a->setStatusTip (tr( "Save selection" )); connect( a, SIGNAL( triggered() ), this, SLOT( editSaveBranch() ) ); a->setEnabled (false); + switchboard.addConnection(a,tr("Edit","Shortcut group")); actionListBranches.append(a); actionSaveBranch=a; @@ -939,6 +1013,7 @@ a->setShortcut (Qt::ALT + Qt::Key_Delete ); connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteKeepChildren() ) ); a->setEnabled (false); + switchboard.addConnection(a,tr("Edit","Shortcut group")); addAction (a); actionListBranches.append(a); actionDeleteKeepChildren=a; @@ -947,6 +1022,7 @@ a = new QAction( tr( "Remove children","Edit menu" ), this); a->setStatusTip (tr( "Remove children of branch" )); a->setShortcut (Qt::SHIFT + Qt::Key_Delete ); + switchboard.addConnection(a,tr("Edit","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteChildren() ) ); a->setEnabled (false); actionListBranches.append(a); @@ -954,6 +1030,7 @@ a = new QAction( tr( "Add Image...","Edit menu" ), this); a->setStatusTip (tr( "Add Image" )); + switchboard.addConnection(a,tr("Edit","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( editLoadImage() ) ); actionLoadImage=a; @@ -962,6 +1039,7 @@ a->setShortcut ( Qt::CTRL + Qt::Key_I ); //Property window a->setShortcutContext (Qt::WindowShortcut); a->setToggleAction (true); + switchboard.addConnection(a,tr("View shortcuts","Shortcut group")); addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( windowToggleProperty() ) ); actionViewTogglePropertyWindow=a; @@ -1090,34 +1168,36 @@ tb->setObjectName ("viewTB"); QMenu *viewMenu = menuBar()->addMenu ( tr( "&View" )); - Switchboard switchboard; //FIXME-2 testing... QAction *a; a = new QAction(QPixmap(iconPath+"viewmag-reset.png"), tr( "reset Zoom","View action" ), this); a->setStatusTip ( tr( "Zoom reset" ) ); a->setShortcut (Qt::CTRL + Qt::Key_0); // Reset zoom - switchboard.addConnection(a,"CTRL+0"); + switchboard.addConnection(a,tr("View shortcuts","Shortcut group")); a->addTo( tb ); viewMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT(viewZoomReset() ) ); a = new QAction( QPixmap(iconPath+"viewmag+.png"), tr( "Zoom in","View action" ), this); a->setStatusTip (tr( "Zoom in" )); - switchboard.addConnection(a,"CTRL++"); + a->setShortcut(Qt::CTRL + Qt::Key_Plus); + switchboard.addConnection(a,tr("View shortcuts","Shortcut group")); a->addTo( tb ); viewMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT(viewZoomIn() ) ); a = new QAction( QPixmap(iconPath+"viewmag-.png"), tr( "Zoom out","View action" ), this); a->setStatusTip (tr( "Zoom out" )); - switchboard.addConnection(a,"CTRL+-"); + a->setShortcut(Qt::CTRL + Qt::Key_Minus); + switchboard.addConnection(a,tr("View shortcuts","Shortcut group")); a->addTo( tb ); viewMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( viewZoomOut() ) ); a = new QAction( QPixmap(iconPath+"viewshowsel.png"), tr( "Show selection","View action" ), this); a->setStatusTip (tr( "Show selection" )); - switchboard.addConnection(a,"."); + a->setShortcut(Qt::CTRL + Qt::Key_Period); + switchboard.addConnection(a,tr("View shortcuts","Shortcut group")); a->addTo( tb ); viewMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( viewCenter() ) ); @@ -1127,6 +1207,7 @@ a = new QAction(QPixmap(flagsPath+"flag-note.png"), tr( "Show Note Editor","View action" ),this); a->setStatusTip ( tr( "Show Note Editor" )); a->setShortcut ( Qt::CTRL + Qt::Key_E ); // Toggle Note Editor + switchboard.addConnection(a,tr("View shortcuts","Shortcut group")); a->setToggleAction(true); a->addTo( tb ); viewMenu->addAction (a); @@ -1135,7 +1216,8 @@ a = new QAction(QPixmap(), tr( "Show tree editor","View action" ),this); a->setStatusTip ( tr( "Show tree editor" )); - a->setShortcut ( Qt::CTRL + Qt::Key_T ); // Toggle Note Editor // FIXME-3 originally: color subtree + a->setShortcut ( Qt::CTRL + Qt::Key_T ); // Toggle Tree Editor // FIXME-3 originally: color subtree + switchboard.addConnection(a,tr("View shortcuts","Shortcut group")); a->setToggleAction(true); a->addTo( tb ); viewMenu->addAction (a); @@ -1145,6 +1227,7 @@ a = new QAction(QPixmap(iconPath+"history.png"), tr( "History Window","View action" ),this ); a->setStatusTip ( tr( "Show History Window" )); a->setShortcut ( Qt::CTRL + Qt::Key_H ); // Toggle history window + switchboard.addConnection(a,tr("View shortcuts","Shortcut group")); a->setToggleAction(true); a->addTo( tb ); viewMenu->addAction (a); @@ -1159,6 +1242,7 @@ a->setStatusTip ( tr( "Antialiasing" )); a->setToggleAction(true); a->setChecked (settings.value("/mainwindow/view/AntiAlias",true).toBool()); + switchboard.addConnection(a,tr("View shortcuts","Shortcut group")); viewMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleAntiAlias() ) ); actionViewToggleAntiAlias=a; @@ -1167,6 +1251,7 @@ a->setStatusTip (a->text()); a->setToggleAction(true); a->setChecked (settings.value("/mainwindow/view/SmoothPixmapTransformation",true).toBool()); + switchboard.addConnection(a,tr("View shortcuts","Shortcut group")); viewMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleSmoothPixmap() ) ); actionViewToggleSmoothPixmapTransform=a; @@ -1174,16 +1259,16 @@ a = new QAction(tr( "Next Map","View action" ), this); a->setStatusTip (a->text()); a->setShortcut (Qt::ALT + Qt::Key_N ); + switchboard.addConnection(a,tr("View shortcuts","Shortcut group")); viewMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT(windowNextEditor() ) ); a = new QAction (tr( "Previous Map","View action" ), this ); a->setStatusTip (a->text()); a->setShortcut (Qt::ALT + Qt::Key_P ); + switchboard.addConnection(a,tr("View shortcuts","Shortcut group")); viewMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT(windowPreviousEditor() ) ); - - if (debug) switchboard.print(); } // Mode Actions @@ -1199,6 +1284,7 @@ actionGroupModModes->setExclusive (true); a= new QAction( QPixmap(iconPath+"modecolor.png"), tr( "Use modifier to color branches","Mode modifier" ), actionGroupModModes); a->setShortcut (Qt::Key_J); + switchboard.addConnection(a,tr("Modes","Shortcut group")); a->setStatusTip ( tr( "Use modifier to color branches" )); a->setToggleAction(true); a->addTo (tb); @@ -1207,6 +1293,7 @@ a= new QAction( QPixmap(iconPath+"modecopy.png"), tr( "Use modifier to copy","Mode modifier" ), actionGroupModModes ); a->setShortcut( Qt::Key_K); + switchboard.addConnection(a,tr("Modes","Shortcut group")); a->setStatusTip( tr( "Use modifier to copy" )); a->setToggleAction(true); a->addTo (tb); @@ -1214,6 +1301,7 @@ a= new QAction(QPixmap(iconPath+"modelink.png"), tr( "Use modifier to draw xLinks","Mode modifier" ), actionGroupModModes ); a->setShortcut (Qt::Key_L); + switchboard.addConnection(a,tr("Modes","Shortcut group")); a->setStatusTip( tr( "Use modifier to draw xLinks" )); a->setToggleAction(true); a->addTo (tb); @@ -1458,12 +1546,14 @@ a = new QAction( "Start TCPserver for MapEditor",this); //a->setStatusTip ( "Set application to open pdf files")); //a->setShortcut ( Qt::ALT + Qt::Key_T ); //New TCP server + switchboard.addConnection(a,tr("Network shortcuts","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( networkStartServer() ) ); netMenu->addAction (a); a = new QAction( "Connect MapEditor to server",this); //a->setStatusTip ( "Set application to open pdf files")); a->setShortcut ( Qt::ALT + Qt::Key_C ); // Connect to server + switchboard.addConnection(a,tr("Network shortcuts","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( networkConnect() ) ); netMenu->addAction (a); } @@ -1582,17 +1672,20 @@ a = new QAction( "Test function 1" , this); a->setStatusTip( "Call test function 1" ); a->setShortcut (Qt::SHIFT + Qt::Key_T); // Test function 1 + switchboard.addConnection(a,tr("Test shortcuts","Shortcut group")); testMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( testFunction1() ) ); a = new QAction( "Test function 2" , this); a->setStatusTip( "Call test function 2" ); a->setShortcut (Qt::ALT + Qt::Key_T); // Test function 2 + switchboard.addConnection(a,tr("Test shortcuts","Shortcut group")); testMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( testFunction2() ) ); a = new QAction( "Command" , this); a->setStatusTip( "Enter command to call in editor" ); + switchboard.addConnection(a,tr("Test shortcuts","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( testCommand() ) ); testMenu->addAction (a); } @@ -1605,11 +1698,13 @@ QAction *a; a = new QAction( tr( "Open VYM Documentation (pdf) ","Help action" ), this ); a->setStatusTip( tr( "Open VYM Documentation (pdf)" )); + switchboard.addConnection(a,tr("Help shortcuts","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( helpDoc() ) ); helpMenu->addAction (a); a = new QAction( tr( "Open VYM example maps ","Help action" ), this ); a->setStatusTip( tr( "Open VYM example maps " )); + switchboard.addConnection(a,tr("Help shortcuts","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( helpDemo() ) ); helpMenu->addAction (a); @@ -1758,6 +1853,7 @@ macroActions[i] = new QAction(this); macroActions[i]->setData(i); addAction (macroActions[i]); + //switchboard.addConnection(macroActions[i],tr("Macro shortcuts","Shortcut group")); connect(macroActions[i], SIGNAL(triggered()), this, SLOT(callMacro())); }