diff -r 67cfa6e6b863 -r 7ced3733ba60 mainwindow.cpp --- a/mainwindow.cpp Tue Oct 24 15:36:38 2006 +0000 +++ b/mainwindow.cpp Mon Oct 30 12:39:37 2006 +0000 @@ -73,6 +73,9 @@ // Sometimes we may need to remember old selections prevSelection=""; + // Default color + currentColor=Qt::black; + // Create unique temporary directory bool ok; tmpVymDir=makeUniqueDir (ok,"/tmp/vym-XXXXXX"); @@ -242,123 +245,123 @@ tb->setObjectName ("mapTB"); QAction *a; - a = new QAction(QPixmap( iconPath+"filenew.png"), tr( "&New..." ),this); - a->setStatusTip ( tr( "New map","File menu" ) ); + a = new QAction(QPixmap( iconPath+"filenew.png"), tr( "&New...","File menu" ),this); + a->setStatusTip ( tr( "New map","Status tip File menu" ) ); a->setShortcut ( Qt::CTRL + Qt::Key_N ); a->addTo( tb ); fileMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( fileNew() ) ); - a = new QAction( QPixmap( iconPath+"fileopen.png"), tr( "&Open..." ),this); - a->setStatusTip (tr( "Open","File menu" ) ); + 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 ); a->addTo( tb ); fileMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( fileLoad() ) ); - fileLastMapsMenu = fileMenu->addMenu (tr("Open Recent")); + fileLastMapsMenu = fileMenu->addMenu (tr("Open Recent","File menu")); fileMenu->addSeparator(); - a = new QAction( QPixmap( iconPath+"filesave.png"), tr( "&Save..." ), this); - a->setStatusTip ( tr( "Save" )); + 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 ); a->addTo( tb ); fileMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( fileSave() ) ); actionFileSave=a; - a = new QAction( QPixmap(iconPath+"filesaveas.png"), tr( "Save &As..." ), this); - a->setStatusTip (tr( "Save &As" ) ); + a = new QAction( QPixmap(iconPath+"filesaveas.png"), tr( "Save &As...","File menu" ), this); + a->setStatusTip (tr( "Save &As","Status tip file menu" ) ); fileMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( fileSaveAs() ) ); fileMenu->addSeparator(); - fileImportMenu = fileMenu->addMenu (tr("Import")); + fileImportMenu = fileMenu->addMenu (tr("Import","File menu")); a = new QAction(tr("KDE Bookmarks"), this); - a->setStatusTip ( tr( "Import")+" "+tr("KDE Bookmarks" )); + a->setStatusTip ( tr( "Import %1","Status tip file menu" ).arg(tr("KDE bookmarks"))); a->addTo (fileImportMenu); connect( a, SIGNAL( triggered() ), this, SLOT( fileImportKDEBookmarks() ) ); if (settings.value( "/mainwindow/showTestMenu",false).toBool()) { - a = new QAction( QPixmap(), tr("Firefox Bookmarks"),this); - a->setStatusTip (tr( "Import")+" "+tr("Firefox Bookmarks" ) ); + 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); connect( a, SIGNAL( triggered() ), this, SLOT( fileImportFirefoxBookmarks() ) ); } a = new QAction("Mind Manager...",this); - a->setStatusTip ( tr( "Import")+" Mind Manager" ); + a->setStatusTip ( tr( "Import %1","status tip file menu").arg(" Mind Manager") ); fileImportMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( fileImportMM() ) ); - a = new QAction( tr( "Import Dir"+QString("...") ), this); - a->setStatusTip (tr( "Import directory structure (experimental)" ) ); + a = new QAction( tr( "Import Dir%1","File menu").arg("..."), this); + a->setStatusTip (tr( "Import directory structure (experimental)","status tip file menu" ) ); fileImportMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( fileImportDir() ) ); - fileExportMenu = fileMenu->addMenu (tr("Export")); - - a = new QAction( tr("Image")+QString("..."), this); - a->setStatusTip( tr( "Export map as image" )); + fileExportMenu = fileMenu->addMenu (tr("Export","File menu")); + + a = new QAction( tr("Image%1","File export menu").arg("..."), this); + a->setStatusTip( tr( "Export map as image","status tip file menu" )); connect( a, SIGNAL( triggered() ), this, SLOT( fileExportImage() ) ); fileExportMenu->addAction (a); - a = new QAction( "Open Office"+QString("..."), this); - a->setStatusTip( tr( "Export in Open Document Format used e.g. in Open Office " )); + a = new QAction( "Open Office...", this); + a->setStatusTip( tr( "Export in Open Document Format used e.g. in Open Office ","status tip file menu" )); connect( a, SIGNAL( triggered() ), this, SLOT( fileExportOOPresentation() ) ); fileExportMenu->addAction (a); a = new QAction( "Webpage (XHTML)...",this ); a->setShortcut (Qt::ALT + Qt::Key_X); - a->setStatusTip ( tr( "Export as")+" webpage (XHTML)"); + a->setStatusTip ( tr( "Export as %1","status tip file menu").arg(tr(" webpage (XHTML)","status tip file menu"))); connect( a, SIGNAL( triggered() ), this, SLOT( fileExportXHTML() ) ); fileExportMenu->addAction (a); a = new QAction( "Text (ASCII)...", this); - a->setStatusTip ( tr( "Export as")+" ASCII"+" "+tr("(still experimental)" )); + a->setStatusTip ( tr( "Export as %1").arg("ASCII "+tr("(still experimental)" ))); connect( a, SIGNAL( triggered() ), this, SLOT( fileExportASCII() ) ); fileExportMenu->addAction (a); - a = new QAction( tr("KDE Bookmarks"), this); - a->setStatusTip( tr( "Export as")+" "+tr("KDE Bookmarks" )); + a = new QAction( tr("KDE Bookmarks","File menu"), this); + a->setStatusTip( tr( "Export as %1").arg(tr("KDE Bookmarks" ))); connect( a, SIGNAL( triggered() ), this, SLOT( fileExportKDEBookmarks() ) ); fileExportMenu->addAction (a); a = new QAction( "Taskjuggler...", this ); - a->setStatusTip( tr( "Export as")+" Taskjuggler"+" "+tr("(still experimental)" )); + a->setStatusTip( tr( "Export as %1").arg("Taskjuggler "+tr("(still experimental)" ))); connect( a, SIGNAL( triggered() ), this, SLOT( fileExportTaskjuggler() ) ); fileExportMenu->addAction (a); a = new QAction( "LaTeX...", this); - a->setStatusTip( tr( "Export as")+" LaTeX"+" "+tr("(still experimental)" )); + a->setStatusTip( tr( "Export as %1").arg("LaTeX "+tr("(still experimental)" ))); connect( a, SIGNAL( triggered() ), this, SLOT( fileExportLaTeX() ) ); fileExportMenu->addAction (a); a = new QAction( "XML..." , this ); - a->setStatusTip (tr( "Export as")+" XML"); + a->setStatusTip (tr( "Export as %1").arg("XML")); connect( a, SIGNAL( triggered() ), this, SLOT( fileExportXML() ) ); fileExportMenu->addAction (a); fileMenu->addSeparator(); a = new QAction(QPixmap( iconPath+"fileprint.png"), tr( "&Print")+QString("..."), this); - a->setStatusTip ( tr( "Print" ) ); + a->setStatusTip ( tr( "Print" ,"File menu") ); a->setShortcut (Qt::CTRL + Qt::Key_P ); a->addTo( tb ); fileMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( filePrint() ) ); actionFilePrint=a; - a = new QAction( QPixmap(iconPath+"fileclose.png"), tr( "&Close Map" ), this); + a = new QAction( QPixmap(iconPath+"fileclose.png"), tr( "&Close Map","File menu" ), this); a->setStatusTip (tr( "Close Map" ) ); a->setShortcut (Qt::ALT + Qt::Key_C ); fileMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( fileCloseMap() ) ); - a = new QAction(QPixmap(iconPath+"exit.png"), tr( "E&xit")+" "+__VYM, this); + a = new QAction(QPixmap(iconPath+"exit.png"), tr( "E&xit","File menu")+" "+__VYM, this); a->setStatusTip ( tr( "Exit")+" "+__VYM ); a->setShortcut (Qt::CTRL + Qt::Key_Q ); fileMenu->addAction (a); @@ -369,14 +372,14 @@ //Edit Actions void Main::setupEditActions() { - QToolBar *tb = addToolBar( tr ("&Actions") ); + QToolBar *tb = addToolBar( tr ("&Actions toolbar","Toolbar name") ); tb->setLabel( "Edit Actions" ); tb->setObjectName ("actionsTB"); - QMenu *editMenu = menuBar()->addMenu( tr("&Edit") ); + QMenu *editMenu = menuBar()->addMenu( tr("&Edit","Edit menu") ); QAction *a; QAction *alt; - a = new QAction( QPixmap( iconPath+"undo.png"), tr( "&Undo" ),this); + a = new QAction( QPixmap( iconPath+"undo.png"), tr( "&Undo","Edit menu" ),this); connect( a, SIGNAL( triggered() ), this, SLOT( editUndo() ) ); a->setStatusTip (tr( "Undo" ) ); a->setShortcut ( Qt::CTRL + Qt::Key_Z ); @@ -385,7 +388,7 @@ editMenu->addAction (a); actionEditUndo=a; - a = new QAction( QPixmap( iconPath+"redo.png"), tr( "&Redo" ), this); + a = new QAction( QPixmap( iconPath+"redo.png"), tr( "&Redo","Edit menu" ), this); a->setStatusTip (tr( "Redo" )); a->setShortcut (Qt::CTRL + Qt::Key_Y ); tb->addAction (a); @@ -394,7 +397,7 @@ actionEditRedo=a; editMenu->addSeparator(); - a = new QAction(QPixmap( iconPath+"editcopy.png"), tr( "&Copy" ), this); + a = new QAction(QPixmap( iconPath+"editcopy.png"), tr( "&Copy","Edit menu" ), this); a->setStatusTip ( tr( "Copy" ) ); a->setShortcut (Qt::CTRL + Qt::Key_C ); a->setEnabled (false); @@ -403,7 +406,7 @@ connect( a, SIGNAL( triggered() ), this, SLOT( editCopy() ) ); actionEditCopy=a; - a = new QAction(QPixmap( iconPath+"editcut.png" ), tr( "Cu&t" ), this); + a = new QAction(QPixmap( iconPath+"editcut.png" ), tr( "Cu&t","Edit menu" ), this); a->setStatusTip ( tr( "Cut" ) ); a->setShortcut (Qt::CTRL + Qt::Key_X ); a->setEnabled (false); @@ -412,7 +415,7 @@ actionEditCut=a; connect( a, SIGNAL( triggered() ), this, SLOT( editCut() ) ); - a = new QAction(QPixmap( iconPath+"editpaste.png"), tr( "&Paste" ),this); + a = new QAction(QPixmap( iconPath+"editpaste.png"), tr( "&Paste","Edit menu" ),this); connect( a, SIGNAL( triggered() ), this, SLOT( editPaste() ) ); a->setStatusTip ( tr( "Paste" ) ); a->setShortcut ( Qt::CTRL + Qt::Key_V ); @@ -422,14 +425,14 @@ actionEditPaste=a; // Shortcuts to modify heading: - a = new QAction(tr( "Edit heading" ),this); + a = new QAction(tr( "Edit heading","Edit menu" ),this); a->setStatusTip ( tr( "edit Heading" )); a->setShortcut ( Qt::Key_Enter); // a->setShortcutContext (Qt::WindowShortcut); addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editHeading() ) ); actionListBranches.append(a); - a = new QAction( tr( "Edit heading" ), this); + a = new QAction( tr( "Edit heading","Edit menu" ), this); a->setStatusTip (tr( "edit Heading" )); a->setShortcut (Qt::Key_Return ); //a->setShortcutContext (Qt::WindowShortcut); @@ -438,7 +441,7 @@ actionListBranches.append(a); editMenu->addAction (a); actionEditHeading=a; - a = new QAction( tr( "Edit heading" ), this); + a = new QAction( tr( "Edit heading","Edit menu" ), this); a->setStatusTip (tr( "edit Heading" )); a->setShortcut ( Qt::Key_F2 ); a->setShortcutContext (Qt::WindowShortcut); @@ -447,7 +450,7 @@ actionListBranches.append(a); // Shortcut to delete selection - a = new QAction( tr( "Delete Selection" ),this); + a = new QAction( tr( "Delete Selection","Edit menu" ),this); a->setStatusTip (tr( "Delete Selection" )); a->setShortcut ( Qt::Key_Delete); a->setShortcutContext (Qt::WindowShortcut); @@ -456,13 +459,13 @@ actionEditDelete=a; // Shortcut to add branch - alt = new QAction(QPixmap(iconPath+"newbranch.png"), tr( "Add branch as child" ), this); + alt = new QAction(QPixmap(iconPath+"newbranch.png"), tr( "Add branch as child","Edit menu" ), this); alt->setStatusTip ( tr( "Add a branch as child of selection" )); alt->setShortcut (Qt::Key_A); alt->setShortcutContext (Qt::WindowShortcut); addAction (alt); connect( alt, SIGNAL( triggered() ), this, SLOT( editNewBranch() ) ); - a = new QAction(QPixmap(iconPath+"newbranch.png"), tr( "Add branch as child" ), this); + 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); connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranch() ) ); @@ -478,7 +481,7 @@ // Add branch by inserting it at selection - a = new QAction(tr( "Add branch (insert)" ), this); + a = new QAction(tr( "Add branch (insert)","Edit menu" ), this); a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" )); a->setShortcut (Qt::ALT + Qt::Key_Insert ); a->setShortcutContext (Qt::WindowShortcut); @@ -487,7 +490,7 @@ a->setEnabled (false); actionListBranches.append(a); actionEditAddBranchBefore=a; - a = new QAction(tr( "Add branch (insert)" ),this); + a = new QAction(tr( "Add branch (insert)","Edit menu" ),this); a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" )); a->setShortcut ( Qt::ALT + Qt::Key_A ); a->setShortcutContext (Qt::WindowShortcut); @@ -496,7 +499,7 @@ actionListBranches.append(a); // Add branch above - a = new QAction(tr( "Add branch above" ), this); + a = new QAction(tr( "Add branch above","Edit menu" ), this); a->setStatusTip ( tr( "Add a branch above selection" )); a->setShortcut (Qt::SHIFT+Qt::Key_Insert ); a->setShortcutContext (Qt::WindowShortcut); @@ -505,7 +508,7 @@ a->setEnabled (false); actionListBranches.append(a); actionEditAddBranchAbove=a; - a = new QAction(tr( "Add branch above" ), this); + a = new QAction(tr( "Add branch above","Edit menu" ), this); a->setStatusTip ( tr( "Add a branch above selection" )); a->setShortcut (Qt::SHIFT+Qt::Key_A ); a->setShortcutContext (Qt::WindowShortcut); @@ -514,7 +517,7 @@ actionListBranches.append(a); // Add branch below - a = new QAction(tr( "Add branch below" ), this); + a = new QAction(tr( "Add branch below","Edit menu" ), this); a->setStatusTip ( tr( "Add a branch below selection" )); a->setShortcut (Qt::CTRL +Qt::Key_Insert ); a->setShortcutContext (Qt::WindowShortcut); @@ -523,7 +526,7 @@ a->setEnabled (false); actionListBranches.append(a); actionEditAddBranchBelow=a; - a = new QAction(tr( "Add branch below" ), this); + a = new QAction(tr( "Add branch below","Edit menu" ), this); a->setStatusTip ( tr( "Add a branch below selection" )); a->setShortcut (Qt::CTRL +Qt::Key_A ); a->setShortcutContext (Qt::WindowShortcut); @@ -531,7 +534,7 @@ connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBelow() ) ); actionListBranches.append(a); - a = new QAction(QPixmap(iconPath+"up.png" ), tr( "Move up" ), this); + a = new QAction(QPixmap(iconPath+"up.png" ), tr( "Move up","Edit menu" ), this); a->setStatusTip ( tr( "Move branch up" ) ); a->setShortcut (Qt::Key_PageUp ); a->setEnabled (false); @@ -540,7 +543,7 @@ connect( a, SIGNAL( triggered() ), this, SLOT( editMoveUp() ) ); actionEditMoveUp=a; - a = new QAction( QPixmap( iconPath+"down.png"), tr( "Move down" ),this); + a = new QAction( QPixmap( iconPath+"down.png"), tr( "Move down","Edit menu" ),this); connect( a, SIGNAL( triggered() ), this, SLOT( editMoveDown() ) ); a->setStatusTip (tr( "Move branch down" ) ); a->setShortcut ( Qt::Key_PageDown ); @@ -550,12 +553,12 @@ actionEditMoveDown=a; - a = new QAction( QPixmap(flagsPath+"flag-scrolled-right.png"), tr( "Scroll branch" ),this); + a = new QAction( QPixmap(flagsPath+"flag-scrolled-right.png"), tr( "Scroll branch","Edit menu" ),this); a->setShortcut ( Qt::Key_ScrollLock ); a->setStatusTip (tr( "Scroll branch" ) ); connect( a, SIGNAL( triggered() ), this, SLOT( editToggleScroll() ) ); - alt = new QAction( QPixmap(flagsPath+"flag-scrolled-right.png"), tr( "Scroll branch" ), this); + alt = new QAction( QPixmap(flagsPath+"flag-scrolled-right.png"), tr( "Scroll branch","Edit menu" ), this); alt->setShortcut ( Qt::Key_S ); alt->setStatusTip (tr( "Scroll branch" )); connect( alt, SIGNAL( triggered() ), this, SLOT( editToggleScroll() ) ); @@ -573,14 +576,14 @@ addAction (alt); actionListBranches.append(actionEditToggleScroll); - a = new QAction( tr( "Unscroll all scrolled branches" ), this); + a = new QAction( tr( "Unscroll all scrolled branches","Edit menu" ), this); a->setStatusTip (tr( "Unscroll all" )); editMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editUnScrollAll() ) ); editMenu->addSeparator(); - a = new QAction( QPixmap(iconPath+"find.png"), tr( "Find"+QString("...") ), this); + a = new QAction( QPixmap(iconPath+"find.png"), tr( "Find...","Edit menu"), this); a->setStatusTip (tr( "Find" ) ); a->setShortcut (Qt::CTRL + Qt::Key_F ); editMenu->addAction (a); @@ -588,7 +591,7 @@ editMenu->addSeparator(); - a = new QAction( QPixmap(flagsPath+"flag-url.png"), tr( "Open URL" ), this); + a = new QAction( QPixmap(flagsPath+"flag-url.png"), tr( "Open URL","Edit menu" ), this); a->setShortcut (Qt::CTRL + Qt::Key_U ); a->setShortcut (tr( "Open URL" )); tb->addAction (a); @@ -596,21 +599,21 @@ connect( a, SIGNAL( triggered() ), this, SLOT( editOpenURL() ) ); actionEditOpenURL=a; - a = new QAction( tr( "Open URL in new tab" ), this); + 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 ); addAction(a); connect( a, SIGNAL( triggered() ), this, SLOT( editOpenURLTab() ) ); actionEditOpenURLTab=a; - a = new QAction( tr( "Open all URLs in subtree" ), this); + a = new QAction( tr( "Open all URLs in subtree","Edit menu" ), this); a->setStatusTip (tr( "Open all URLs in subtree" )); addAction(a); actionListBranches.append(a); connect( a, SIGNAL( triggered() ), this, SLOT( editOpenMultipleURLTabs() ) ); actionEditOpenMultipleURLTabs=a; - a = new QAction(QPixmap(), tr( "Edit URL"+QString("...") ), this); + a = new QAction(QPixmap(), tr( "Edit URL...","Edit menu"), this); a->setStatusTip ( tr( "Edit URL" ) ); a->setShortcut (Qt::SHIFT + Qt::CTRL + Qt::Key_U ); //a->setShortcut ( Qt::Key_U ); @@ -620,35 +623,35 @@ connect( a, SIGNAL( triggered() ), this, SLOT( editURL() ) ); actionEditURL=a; - a = new QAction( tr( "Use heading for URL" ), this); + a = new QAction( tr( "Use heading for URL","Edit menu" ), this); a->setStatusTip ( tr( "Use heading of selected branch as URL" )); a->setEnabled (false); actionListBranches.append(a); connect( a, SIGNAL( triggered() ), this, SLOT( editHeading2URL() ) ); actionEditHeading2URL=a; - a = new QAction(tr( "Create URL to Bugzilla" ), this); + a = new QAction(tr( "Create URL to Bugzilla","Edit menu" ), this); a->setStatusTip ( tr( "Create URL to Bugzilla" )); a->setEnabled (false); actionListBranches.append(a); connect( a, SIGNAL( triggered() ), this, SLOT( editBugzilla2URL() ) ); actionEditBugzilla2URL=a; - a = new QAction(tr( "Create URL to FATE" ), this); + a = new QAction(tr( "Create URL to FATE","Edit menu" ), this); a->setStatusTip ( tr( "Create URL to FATE" )); a->setEnabled (false); actionListBranches.append(a); connect( a, SIGNAL( triggered() ), this, SLOT( editFATE2URL() ) ); actionEditFATE2URL=a; - a = new QAction(QPixmap(flagsPath+"flag-vymlink.png"), tr( "Open xlinked map" ), this); + a = new QAction(QPixmap(flagsPath+"flag-vymlink.png"), tr( "Open linked map","Edit menu" ), this); a->setStatusTip ( tr( "Jump to another vym map, if needed load it first" )); tb->addAction (a); a->setEnabled (false); connect( a, SIGNAL( triggered() ), this, SLOT( editOpenVymLink() ) ); actionEditOpenVymLink=a; - a = new QAction(QPixmap(), tr( "Open all vym links in subtree" ), this); + 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); actionListBranches.append(a); @@ -656,20 +659,20 @@ actionEditOpenMultipleVymLinks=a; - a = new QAction(tr( "Edit vym link"+QString("...") ), this); + a = new QAction(tr( "Edit vym link...","Edit menu" ), this); a->setEnabled (false); a->setStatusTip ( tr( "Edit link to another vym map" )); connect( a, SIGNAL( triggered() ), this, SLOT( editVymLink() ) ); actionListBranches.append(a); actionEditVymLink=a; - a = new QAction(tr( "Delete vym link" ),this); + a = new QAction(tr( "Delete vym link","Edit menu" ),this); a->setStatusTip ( tr( "Delete link to another vym map" )); a->setEnabled (false); connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteVymLink() ) ); actionEditDeleteVymLink=a; - a = new QAction(QPixmap(flagsPath+"flag-hideexport.png"), tr( "Hide in exports" ), this); + a = new QAction(QPixmap(flagsPath+"flag-hideexport.png"), tr( "Hide in exports","Edit menu" ), this); a->setStatusTip ( tr( "Hide object in exports" ) ); a->setShortcut (Qt::Key_H ); a->setToggleAction(true); @@ -678,14 +681,14 @@ connect( a, SIGNAL( triggered() ), this, SLOT( editToggleHideExport() ) ); actionEditToggleHideExport=a; - a = new QAction(tr( "Edit Map Info"+QString("...") ),this); + a = new QAction(tr( "Edit Map Info...","Edit menu" ),this); a->setStatusTip ( tr( "Edit Map Info" )); a->setEnabled (true); connect( a, SIGNAL( triggered() ), this, SLOT( editMapInfo() ) ); actionEditMapInfo=a; // Import at selection (adding to selection) - a = new QAction( tr( "Add map (insert)" ),this); + a = new QAction( tr( "Add map (insert)","Edit menu" ),this); a->setStatusTip (tr( "Add map at selection" )); connect( a, SIGNAL( triggered() ), this, SLOT( editImportAdd() ) ); a->setEnabled (false); @@ -693,7 +696,7 @@ actionEditImportAdd=a; // Import at selection (replacing selection) - a = new QAction( tr( "Add map (replace)" ), this); + a = new QAction( tr( "Add map (replace)","Edit menu" ), this); a->setStatusTip (tr( "Replace selection with map" )); connect( a, SIGNAL( triggered() ), this, SLOT( editImportReplace() ) ); a->setEnabled (false); @@ -701,7 +704,7 @@ actionEditImportReplace=a; // Save selection - a = new QAction( tr( "Save selection" ), this); + a = new QAction( tr( "Save selection","Edit menu" ), this); a->setStatusTip (tr( "Save selection" )); connect( a, SIGNAL( triggered() ), this, SLOT( editSaveBranch() ) ); a->setEnabled (false); @@ -709,50 +712,50 @@ actionEditSaveBranch=a; // Only remove branch, not its childs - a = new QAction(tr( "Remove only branch " ), this); + a = new QAction(tr( "Remove only branch ","Edit menu" ), this); a->setStatusTip ( tr( "Remove only branch and keep its childs" )); a->setShortcut (Qt::ALT + Qt::Key_Delete ); - connect( a, SIGNAL( triggered() ), this, SLOT( editRemoveBranchKeepChilds() ) ); + connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteKeepChilds() ) ); a->setEnabled (false); addAction (a); actionListBranches.append(a); - actionEditRemoveBranchKeepChilds=a; + actionEditDeleteKeepChilds=a; // Only remove childs of a branch - a = new QAction( tr( "Remove childs" ), this); + a = new QAction( tr( "Remove childs","Edit menu" ), this); a->setStatusTip (tr( "Remove childs of branch" )); a->setShortcut (Qt::SHIFT + Qt::Key_Delete ); - connect( a, SIGNAL( triggered() ), this, SLOT( editRemoveChilds() ) ); + connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteChilds() ) ); a->setEnabled (false); actionListBranches.append(a); - actionEditRemoveChilds=a; + actionEditDeleteChilds=a; // Shortcuts for navigating with cursor: - a = new QAction(tr( "Select upper branch" ), this); + a = new QAction(tr( "Select upper branch","Edit menu" ), this); a->setStatusTip ( tr( "Select upper branch" )); a->setShortcut (Qt::Key_Up ); a->setShortcutContext (Qt::WindowShortcut); addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editUpperBranch() ) ); - a = new QAction( tr( "Select lower branch" ),this); + a = new QAction( tr( "Select lower branch","Edit menu" ),this); a->setStatusTip (tr( "Select lower branch" )); a->setShortcut ( Qt::Key_Down ); a->setShortcutContext (Qt::WindowShortcut); addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editLowerBranch() ) ); - a = new QAction(tr( "Select left branch" ), this); + a = new QAction(tr( "Select left branch","Edit menu" ), this); a->setStatusTip ( tr( "Select left branch" )); a->setShortcut (Qt::Key_Left ); a->setShortcutContext (Qt::WindowShortcut); addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editLeftBranch() ) ); - a = new QAction( tr( "Select child branch" ), this); + a = new QAction( tr( "Select child branch","Edit menu" ), this); a->setStatusTip (tr( "Select right branch" )); a->setShortcut (Qt::Key_Right); a->setShortcutContext (Qt::WindowShortcut); addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editRightBranch() ) ); - a = new QAction( tr( "Select first branch" ), this); + a = new QAction( tr( "Select first branch","Edit menu" ), this); a->setStatusTip (tr( "Select first branch" )); a->setShortcut (Qt::Key_Home ); a->setShortcutContext (Qt::WindowShortcut); @@ -762,7 +765,7 @@ actionListBranches.append(a); actionEditSelectFirst=a; connect( a, SIGNAL( triggered() ), this, SLOT( editFirstBranch() ) ); - a = new QAction( tr( "Select last branch" ),this); + a = new QAction( tr( "Select last branch","Edit menu" ),this); a->setStatusTip (tr( "Select last branch" )); a->setShortcut ( Qt::Key_End ); a->setShortcutContext (Qt::WindowShortcut); @@ -773,7 +776,7 @@ actionListBranches.append(a); actionEditSelectLast=a; - a = new QAction( tr( "Add Image" )+QString("..."), this); + a = new QAction( tr( "Add Image...","Edit menu" ), this); a->setStatusTip (tr( "Add Image" )); connect( a, SIGNAL( triggered() ), this, SLOT( editLoadImage() ) ); actionEditLoadImage=a; @@ -783,9 +786,9 @@ // Format Actions void Main::setupFormatActions() { - QMenu *formatMenu = menuBar()->addMenu (tr ("F&ormat")); - - QToolBar *tb = addToolBar( tr("Format Actions","Toolbars")); + QMenu *formatMenu = menuBar()->addMenu (tr ("F&ormat","Format menu")); + + QToolBar *tb = addToolBar( tr("Format Actions","Format Toolbar name")); tb->setObjectName ("formatTB"); QAction *a; QPixmap pix( 16,16); @@ -796,7 +799,7 @@ a->addTo( tb ); formatMenu->addAction (a); actionFormatColor=a; - a= new QAction( QPixmap(iconPath+"formatcolorpicker.png"), tr( "Pic&k color" ), this); + a= new QAction( QPixmap(iconPath+"formatcolorpicker.png"), tr( "Pic&k color","Edit menu" ), this); a->setStatusTip (tr( "Pick color\nHint: You can pick a color from another branch and color using CTRL+Left Button" ) ); a->setShortcut (Qt::CTRL + Qt::Key_K ); connect( a, SIGNAL( triggered() ), this, SLOT( formatPickColor() ) ); @@ -806,7 +809,7 @@ actionListBranches.append(a); actionFormatPickColor=a; - a= new QAction(QPixmap(iconPath+"formatcoloritem.png"), tr( "Color &branch" ), this); + a= new QAction(QPixmap(iconPath+"formatcoloritem.png"), tr( "Color &branch","Edit menu" ), this); a->setStatusTip ( tr( "Color branch" ) ); a->setShortcut (Qt::CTRL + Qt::Key_I); connect( a, SIGNAL( triggered() ), this, SLOT( formatColorItem() ) ); @@ -816,7 +819,7 @@ actionListBranches.append(a); actionFormatColorBranch=a; - a= new QAction(QPixmap(iconPath+"formatcolorbranch.png"), tr( "Color sub&tree" ), this); + a= new QAction(QPixmap(iconPath+"formatcolorbranch.png"), tr( "Color sub&tree","Edit menu" ), this); a->setStatusTip ( tr( "Color Subtree" )); a->setShortcut (Qt::CTRL + Qt::Key_T); connect( a, SIGNAL( triggered() ), this, SLOT( formatColorBranch() ) ); @@ -857,37 +860,37 @@ actionGroupFormatFrameTypes=new QActionGroup ( this); actionGroupFormatFrameTypes->setExclusive (true); - a = new QAction( tr( "No Frame" ), actionGroupFormatFrameTypes ); + a = new QAction( tr( "No Frame","Branch attribute" ), actionGroupFormatFrameTypes ); a->setStatusTip (tr("No Frame")); a->setToggleAction(true); connect( a, SIGNAL( triggered() ), this, SLOT( formatFrameNone() ) ); actionFormatFrameNone=a; - a = new QAction( tr( "Rectangle" ), actionGroupFormatFrameTypes); + a = new QAction( tr( "Rectangle""Branch attribute" ), actionGroupFormatFrameTypes); a->setStatusTip (tr( "Rectangle" )); a->setToggleAction(true); connect( a, SIGNAL( triggered() ), this, SLOT( formatFrameRectangle() ) ); actionFormatFrameRectangle=a; - a = new QAction( tr( "Include images vertically" ), this); + a = new QAction( tr( "Include images vertically","Branch attribute" ), this); a->setStatusTip ( tr ("Include top and bottom position of images into branch")); a->setToggleAction(true); connect( a, SIGNAL( triggered() ), this, SLOT( formatIncludeImagesVer() ) ); actionFormatIncludeImagesVer=a; - a = new QAction( tr( "Include images horizontally" ), this); + a = new QAction( tr( "Include images horizontally","Branch attribute" ), this); a->setStatusTip ( tr ("Include left and right position of images into branch")); a->setToggleAction(true); connect( a, SIGNAL( triggered() ), this, SLOT( formatIncludeImagesHor() ) ); actionFormatIncludeImagesHor=a; - a = new QAction( tr( "Hide link if object is not selected" ), this); + a = new QAction( tr( "Hide link if object is not selected","Branch attribute" ), this); a->setStatusTip (tr( "Hide link" )); a->setToggleAction(true); connect( a, SIGNAL( triggered() ), this, SLOT( formatHideLinkUnselected() ) ); actionFormatHideLinkUnselected=a; formatMenu->addSeparator(); - a= new QAction( tr( "&Use color of heading for link" ), this); + a= new QAction( tr( "&Use color of heading for link","Branch attribute" ), this); a->setStatusTip (tr( "Use same color for links and headings" )); a->setToggleAction(true); connect( a, SIGNAL( triggered() ), this, SLOT( formatToggleLinkColorHint() ) ); @@ -911,27 +914,27 @@ // View Actions void Main::setupViewActions() { - QToolBar *tb = addToolBar( tr("View Actions","Toolbars") ); + QToolBar *tb = addToolBar( tr("View Actions","View Toolbar name") ); tb->setLabel( "View Actions" ); tb->setObjectName ("viewTB"); QMenu *viewMenu = menuBar()->addMenu ( tr( "&View" )); QAction *a; - a = new QAction(QPixmap(iconPath+"viewmag-reset.png"), tr( "reset Zoom" ), this); + 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 ); a->addTo( tb ); viewMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT(viewZoomReset() ) ); - a = new QAction( QPixmap(iconPath+"viewmag+.png"), tr( "Zoom in" ), this); + a = new QAction( QPixmap(iconPath+"viewmag+.png"), tr( "Zoom in","View action" ), this); a->setStatusTip (tr( "Zoom in" )); a->setShortcut (Qt::CTRL + Qt::Key_Plus); a->addTo( tb ); viewMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT(viewZoomIn() ) ); - a = new QAction( QPixmap(iconPath+"viewmag-.png"), tr( "Zoom out" ), this); + a = new QAction( QPixmap(iconPath+"viewmag-.png"), tr( "Zoom out","View action" ), this); a->setStatusTip (tr( "Zoom out" )); a->setShortcut (Qt::CTRL + Qt::Key_Minus ); a->addTo( tb ); @@ -939,7 +942,7 @@ connect( a, SIGNAL( triggered() ), this, SLOT( viewZoomOut() ) ); - a = new QAction(QPixmap(flagsPath+"flag-note.png"), tr( "Show Note Editor" ),this); + 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 ); a->setToggleAction(true); @@ -952,7 +955,7 @@ connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleNoteEditor() ) ); actionViewToggleNoteEditor=a; - a = new QAction( tr( "Show history window" ),this ); + a = new QAction( tr( "Show history window","View action" ),this ); a->setStatusTip ( tr( "Show history window" )); a->setShortcut ( Qt::CTRL + Qt::Key_H ); a->setToggleAction(false); @@ -960,13 +963,13 @@ connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleHistory() ) ); actionViewToggleHistoryWindow=a; - a = new QAction(tr( "Next Window" ), this); + a = new QAction(tr( "Next Window","View action" ), this); a->setStatusTip ( tr( "&Next Window" ) ); a->setShortcut (Qt::ALT + Qt::Key_N ); viewMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT(windowNextEditor() ) ); - a = new QAction (tr( "Previous Window" ), this ); + a = new QAction (tr( "Previous Window","View action" ), this ); a->setStatusTip (tr( "&Previous Window" )); a->setShortcut (Qt::ALT + Qt::Key_P ); viewMenu->addAction (a); @@ -979,12 +982,12 @@ //QPopupMenu *menu = new QPopupMenu( this ); //menuBar()->insertItem( tr( "&Mode (using modifiers)" ), menu ); - QToolBar *tb = addToolBar( tr ("Modes when using modifiers","Toolbars") ); + QToolBar *tb = addToolBar( tr ("Modes when using modifiers","Modifier Toolbar name") ); tb->setObjectName ("modesTB"); QAction *a; actionGroupModModes=new QActionGroup ( this); actionGroupModModes->setExclusive (true); - a= new QAction( QPixmap(iconPath+"modecolor.png"), tr( "Use modifier to color branches" ), actionGroupModModes); + a= new QAction( QPixmap(iconPath+"modecolor.png"), tr( "Use modifier to color branches","Mode modifier" ), actionGroupModModes); a->setShortcut (Qt::Key_J); a->setStatusTip ( tr( "Use modifier to color branches" )); a->setToggleAction(true); @@ -992,14 +995,14 @@ a->setOn(true); actionModModeColor=a; - a= new QAction( QPixmap(iconPath+"modecopy.png"), tr( "Use modifier to copy" ), actionGroupModModes ); + a= new QAction( QPixmap(iconPath+"modecopy.png"), tr( "Use modifier to copy","Mode modifier" ), actionGroupModModes ); a->setShortcut( Qt::Key_K); a->setStatusTip( tr( "Use modifier to copy" )); a->setToggleAction(true); a->addTo (tb); actionModModeCopy=a; - a= new QAction(QPixmap(iconPath+"modelink.png"), tr( "Use modifier to draw xLinks" ), actionGroupModModes ); + a= new QAction(QPixmap(iconPath+"modelink.png"), tr( "Use modifier to draw xLinks","Mode modifier" ), actionGroupModModes ); a->setShortcut (Qt::Key_L); a->setStatusTip( tr( "Use modifier to draw xLinks" )); a->setToggleAction(true); @@ -1333,39 +1336,39 @@ QAction *a; - a = new QAction( tr( "Set application to open pdf files"), this); + a = new QAction( tr( "Set application to open pdf files","Settings action"), this); a->setStatusTip ( tr( "Set application to open pdf files")); connect( a, SIGNAL( triggered() ), this, SLOT( settingsPDF() ) ); settingsMenu->addAction (a); - a = new QAction( tr( "Set application to open external links"), this); + a = new QAction( tr( "Set application to open external links","Settings action"), this); a->setStatusTip( tr( "Set application to open external links")); connect( a, SIGNAL( triggered() ), this, SLOT( settingsURL() ) ); settingsMenu->addAction (a); settingsMenu->addSeparator(); - a = new QAction( tr( "Edit branch after adding it" ), this ); + a = new QAction( tr( "Edit branch after adding it","Settings action" ), this ); a->setStatusTip( tr( "Edit branch after adding it" )); a->setToggleAction(true); a->setOn ( settings.value ("/mapeditor/editmode/autoEdit",true).toBool()); settingsMenu->addAction (a); actionSettingsAutoEdit=a; - a= new QAction( tr( "Select branch after adding it" ), this ); + a= new QAction( tr( "Select branch after adding it","Settings action" ), this ); a->setStatusTip( tr( "Select branch after adding it" )); a->setToggleAction(true); a->setOn ( settings.value ("/mapeditor/editmode/autoSelectHeading",false).toBool() ); settingsMenu->addAction (a); actionSettingsAutoSelectHeading=a; - a= new QAction(tr( "Select existing heading" ), this); + a= new QAction(tr( "Select existing heading","Settings action" ), this); a->setStatusTip( tr( "Select heading before editing" )); a->setToggleAction(true); a->setOn ( settings.value ("/mapeditor/editmode/autoSelectText",true).toBool() ); settingsMenu->addAction (a); actionSettingsAutoSelectText=a; - a= new QAction( tr( "Delete key" ), this); + a= new QAction( tr( "Delete key","Settings action" ), this); a->setStatusTip( tr( "Delete key for deleting branches" )); a->setToggleAction(true); a->setOn ( settings.value ("/mapeditor/editmode/useDelKey",false).toBool() ); @@ -1373,14 +1376,14 @@ connect( a, SIGNAL( triggered() ), this, SLOT( settingsToggleDelKey() ) ); actionSettingsUseDelKey=a; - a= new QAction( tr( "Exclusive flags" ), this); + a= new QAction( tr( "Exclusive flags","Settings action" ), this); a->setStatusTip( tr( "Use exclusive flags in flag toolbars" )); a->setToggleAction(true); a->setOn ( settings.value ("/mapeditor/editmode/useFlagGroups",true).toBool() ); settingsMenu->addAction (a); actionSettingsUseFlagGroups=a; - a= new QAction( tr( "Use hide flags" ), this); + a= new QAction( tr( "Use hide flags","Settings action" ), this); a->setStatusTip( tr( "Use hide flag during exports " )); a->setToggleAction(true); a->setOn ( settings.value ("/export/useHideExport",true).toBool() ); @@ -1394,13 +1397,13 @@ QMenu *testMenu = menuBar()->addMenu( tr( "&Test" )); QAction *a; - a = new QAction( tr( "Test function" ), this); - a->setStatusTip( tr( "Call test function" )); + a = new QAction( "Test function" , this); + a->setStatusTip( "Call test function" ); a->setShortcut (Qt::Key_F4 ); connect( a, SIGNAL( triggered() ), this, SLOT( testFunction() ) ); testMenu->addAction (a); - a = new QAction( tr( "Command" ), this); - a->setStatusTip( tr( "Enter command to call in editor" )); + a = new QAction( "Command" , this); + a->setStatusTip( "Enter command to call in editor" ); a->setShortcut (Qt::Key_F5 ); connect( a, SIGNAL( triggered() ), this, SLOT( testCommand() ) ); testMenu->addAction (a); @@ -1409,20 +1412,20 @@ // Help Actions void Main::setupHelpActions() { - QMenu *helpMenu = menuBar()->addMenu ( tr( "&Help" )); + QMenu *helpMenu = menuBar()->addMenu ( tr( "&Help","Help menubar entry" )); QAction *a; - a = new QAction( tr( "Open VYM Documentation (pdf) " ), this ); + a = new QAction( tr( "Open VYM Documentation (pdf) ","Help action" ), this ); a->setStatusTip( tr( "Open VYM Documentation (pdf)" )); connect( a, SIGNAL( triggered() ), this, SLOT( helpDoc() ) ); helpMenu->addAction (a); - a = new QAction( tr( "About VYM" ), this); + a = new QAction( tr( "About VYM","Help action" ), this); a->setStatusTip( tr( "About VYM")+" "__VYM); connect( a, SIGNAL( triggered() ), this, SLOT( helpAbout() ) ); helpMenu->addAction (a); - a = new QAction( tr( "About QT" ), this); + a = new QAction( tr( "About QT","Help action" ), this); a->setStatusTip( tr( "Information about QT toolkit" )); connect( a, SIGNAL( triggered() ), this, SLOT( helpAboutQT() ) ); helpMenu->addAction (a); @@ -1450,11 +1453,11 @@ branchAddContextMenu->addAction ( actionEditImportReplace ); // Submenu "Remove" - branchRemoveContextMenu =branchContextMenu->addMenu (tr ("Remove")); + branchRemoveContextMenu =branchContextMenu->addMenu (tr ("Remove","Context menu name")); branchRemoveContextMenu->addAction (actionEditCut); branchRemoveContextMenu->addAction ( actionEditDelete ); - branchRemoveContextMenu->addAction ( actionEditRemoveBranchKeepChilds ); - branchRemoveContextMenu->addAction ( actionEditRemoveChilds ); + branchRemoveContextMenu->addAction ( actionEditDeleteKeepChilds ); + branchRemoveContextMenu->addAction ( actionEditDeleteChilds ); actionEditSaveBranch->addTo( branchContextMenu ); @@ -1472,7 +1475,7 @@ branchLinksContextMenu =new QMenu (this); branchContextMenu->addSeparator(); - branchLinksContextMenu=branchContextMenu->addMenu(tr("URLs and vymLinks")); + branchLinksContextMenu=branchContextMenu->addMenu(tr("URLs and vymLinks","Context menu name")); branchLinksContextMenu->addAction ( actionEditOpenURL ); branchLinksContextMenu->addAction ( actionEditOpenURLTab ); branchLinksContextMenu->addAction ( actionEditOpenMultipleURLTabs ); @@ -1493,15 +1496,15 @@ // Context Menu for XLinks in a branch menu // This will be populated "on demand" in MapEditor::updateActions branchContextMenu->addSeparator(); - branchXLinksContextMenuEdit =branchContextMenu->addMenu (tr ("Edit XLink")); - branchXLinksContextMenuFollow =branchContextMenu->addMenu (tr ("Follow XLink")); + branchXLinksContextMenuEdit =branchContextMenu->addMenu (tr ("Edit XLink","Context menu name")); + branchXLinksContextMenuFollow =branchContextMenu->addMenu (tr ("Follow XLink","Context menu name")); connect( branchXLinksContextMenuFollow, SIGNAL( triggered(QAction *) ), this, SLOT( editFollowXLink(QAction * ) ) ); connect( branchXLinksContextMenuEdit, SIGNAL( triggered(QAction *) ), this, SLOT( editEditXLink(QAction * ) ) ); // Context menu for floatimage floatimageContextMenu =new QMenu (this); - a= new QAction (tr ("Save image"),this); + a= new QAction (tr ("Save image","Context action"),this); connect (a, SIGNAL (triggered()), this, SLOT (editSaveImage())); floatimageContextMenu->addAction (a); @@ -1583,7 +1586,7 @@ if (!eList.isEmpty()) { QMessageBox mb( __VYM, - tr("The directory %1 is not empty.\nDo you risk to overwrite its contents?").arg(dir), + tr("The directory %1 is not empty.\nDo you risk to overwrite its contents?","write directory").arg(dir), QMessageBox::Warning, QMessageBox::Yes , QMessageBox::Cancel | QMessageBox::Default, @@ -2882,16 +2885,16 @@ fileSaveAs (PartOfMap); } -void Main::editRemoveBranchKeepChilds() +void Main::editDeleteKeepChilds() { if (currentMapEditor()) - currentMapEditor()->removeBranchKeepChilds(); + currentMapEditor()->deleteKeepChilds(); } -void Main::editRemoveChilds() +void Main::editDeleteChilds() { if (currentMapEditor()) - currentMapEditor()->removeChilds(); + currentMapEditor()->deleteChilds(); } void Main::editDeleteSelection() @@ -2965,9 +2968,8 @@ { if (currentMapEditor()) { - QColor col = QColorDialog::getColor( currentMapEditor()->getColor(), this ); + QColor col = QColorDialog::getColor((currentColor ), this ); if ( !col.isValid() ) return; - currentMapEditor()->setColor( col ); colorChanged( col ); } } @@ -2975,7 +2977,7 @@ void Main::formatPickColor() { if (currentMapEditor()) - colorChanged( currentMapEditor()->pickColor() ); + colorChanged( currentMapEditor()->getCurrentHeadingColor() ); } void Main::colorChanged(QColor c) @@ -2983,18 +2985,19 @@ QPixmap pix( 16, 16 ); pix.fill( c ); actionFormatColor->setIconSet( pix ); + currentColor=c; } void Main::formatColorItem() { if (currentMapEditor()) - currentMapEditor()->colorItem(); + currentMapEditor()->colorItem(currentColor); } void Main::formatColorBranch() { if (currentMapEditor()) - currentMapEditor()->colorBranch(); + currentMapEditor()->colorBranch(currentColor); } void Main::formatLinkStyleLine() @@ -3412,6 +3415,7 @@ { if (!currentMapEditor()) return; currentMapEditor()->testFunction(); + } void Main::testCommand() @@ -3425,38 +3429,45 @@ void Main::helpDoc() { - QString docpath; + QString locale = QLocale::system().name(); + QString docname; + if (locale.left(2)=="es") + docname="vym_es.pdf"; + else + docname="vym.pdf"; + QDir docdir; #if defined(Q_OS_MACX) - docpath="./vym.app/Contents/vym.pdf"; + docdir.setPath("./vym.app/Contents"); #else // default path in SUSE LINUX - docpath="/usr/share/doc/packages/vym/doc/vym.pdf"; + docdir.setPath("/usr/share/doc/packages/vym/doc"); #endif - if (!QFile (docpath).exists() ) + if (!docdir.exists() ) { // relative path for easy testing in tarball - docpath="doc/vym.pdf"; - if (!QFile (docpath).exists() ) + docdir.setPath("doc"); + if (!docdir.exists() ) { // relative path for testing while still writing vym.tex - docpath="doc/tex/vym.pdf"; - if (!QFile (docpath).exists() ) + docdir.setPath("doc/tex/vym.pdf"); + if (!docdir.exists() ) { // Try yet another one for Knoppix - docpath="/usr/share/doc/packages/vym/vym.pdf"; - if (!QFile (docpath).exists() ) + docdir.setPath("/usr/share/doc/packages/vym"); + if (!docdir.exists() ) { QMessageBox::critical(0, tr("Critcal error"), tr("Couldn't find the documentation\n" - "vym.pdf in various places.")); + "vym.pdf in various directories.")); return; } } } } + QString docpath=docdir.path()+"/"+docname; Process *pdfProc = new Process(); pdfProc->clearArguments(); pdfProc->addArgument( settings.value("/mainwindow/readerPDF").toString()); @@ -3467,7 +3478,7 @@ // error handling QMessageBox::warning(0, tr("Warning"), - tr("Couldn't find a viewer to open %1.\n").arg("vym.pdf")+ + tr("Couldn't find a viewer to open %1.\n").arg(docpath)+ tr("Please use Settings->")+tr("Set application to open PDF files")); settingsPDF(); return;