1.1 --- a/mainwindow.cpp Wed Nov 25 10:58:21 2009 +0000
1.2 +++ b/mainwindow.cpp Wed Nov 25 15:27:22 2009 +0000
1.3 @@ -32,10 +32,10 @@
1.4 // clashes with the one in Win32 API.
1.5 typedef struct _PROCESS_INFORMATION
1.6 {
1.7 -long hProcess;
1.8 -long hThread;
1.9 -long dwProcessId;
1.10 -long dwThreadId;
1.11 + long hProcess;
1.12 + long hThread;
1.13 + long dwProcessId;
1.14 + long dwThreadId;
1.15 } PROCESS_INFORMATION, *LPPROCESS_INFORMATION;
1.16 #endif
1.17
1.18 @@ -83,1769 +83,1759 @@
1.19 Main::Main(QWidget* parent, const char* name, Qt::WFlags f) :
1.20 QMainWindow(parent,name,f)
1.21 {
1.22 -mainWindow=this;
1.23 -
1.24 -setCaption ("VYM - View Your Mind");
1.25 -
1.26 -// Load window settings
1.27 -#if defined(Q_OS_WIN32)
1.28 -if (settings.value("/mainwindow/geometry/maximized", false).toBool())
1.29 -{
1.30 - setWindowState(Qt::WindowMaximized);
1.31 -}
1.32 -else
1.33 -#endif
1.34 -{
1.35 - resize (settings.value("/mainwindow/geometry/size", QSize (800,600)).toSize());
1.36 - move (settings.value("/mainwindow/geometry/pos", QPoint(300,100)).toPoint());
1.37 -}
1.38 -
1.39 -// Sometimes we may need to remember old selections
1.40 -prevSelection="";
1.41 -
1.42 -// Default color
1.43 -currentColor=Qt::black;
1.44 -
1.45 -// Create unique temporary directory
1.46 -bool ok;
1.47 -tmpVymDir=makeTmpDir (ok,"vym");
1.48 -if (!ok)
1.49 -{
1.50 - qWarning ("Mainwindow: Could not create temporary directory, failed to start vym");
1.51 - exit (1);
1.52 -}
1.53 -if (debug) qDebug (QString("vym tmpDir=%1").arg(tmpVymDir) );
1.54 -
1.55 -// Create direcctory for clipboard
1.56 -clipboardDir=tmpVymDir+"/clipboard";
1.57 -clipboardFile="map.xml";
1.58 -QDir d(clipboardDir);
1.59 -d.mkdir (clipboardDir,true);
1.60 -makeSubDirs (clipboardDir);
1.61 -clipboardEmpty=true;
1.62 -
1.63 -browserPID=new qint64;
1.64 -*browserPID=0;
1.65 -
1.66 -// Satellite windows //////////////////////////////////////////
1.67 -// history window
1.68 -historyWindow=new HistoryWindow();
1.69 -connect (historyWindow, SIGNAL (windowClosed() ), this, SLOT (updateActions()));
1.70 -
1.71 -// properties window
1.72 -branchPropertyWindow = new BranchPropertyWindow();
1.73 -connect (branchPropertyWindow, SIGNAL (windowClosed() ), this, SLOT (updateActions()));
1.74 -
1.75 -// Connect TextEditor, so that we can update flags if text changes
1.76 -connect (textEditor, SIGNAL (textHasChanged() ), this, SLOT (updateNoteFlag()));
1.77 -connect (textEditor, SIGNAL (windowClosed() ), this, SLOT (updateActions()));
1.78 -
1.79 -// Initialize script editor
1.80 -scriptEditor = new SimpleScriptEditor();
1.81 -scriptEditor->move (50,50);
1.82 -
1.83 -connect( scriptEditor, SIGNAL( runScript ( QString ) ),
1.84 - this, SLOT( runScript( QString ) ) );
1.85 -
1.86 -
1.87 -// Initialize Find window
1.88 -findWindow=new FindWindow(NULL);
1.89 -findWindow->move (x(),y()+70);
1.90 -connect (findWindow, SIGNAL( findButton(QString) ),
1.91 - this, SLOT(editFind(QString) ) );
1.92 -connect (findWindow, SIGNAL( somethingChanged() ),
1.93 - this, SLOT(editFindChanged() ) );
1.94 -
1.95 -// Initialize some settings, which are platform dependant
1.96 -QString p,s;
1.97 -
1.98 - // application to open URLs
1.99 - p="/mainwindow/readerURL";
1.100 - #if defined(Q_OS_LINUX)
1.101 - s=settings.value (p,"xdg-open").toString();
1.102 - #else
1.103 - #if defined(Q_OS_MACX)
1.104 - s=settings.value (p,"/usr/bin/open").toString();
1.105 -
1.106 + mainWindow=this;
1.107 +
1.108 + setCaption ("VYM - View Your Mind");
1.109 +
1.110 + // Load window settings
1.111 + #if defined(Q_OS_WIN32)
1.112 + if (settings.value("/mainwindow/geometry/maximized", false).toBool())
1.113 + {
1.114 + setWindowState(Qt::WindowMaximized);
1.115 + }
1.116 + else
1.117 + #endif
1.118 + {
1.119 + resize (settings.value("/mainwindow/geometry/size", QSize (800,600)).toSize());
1.120 + move (settings.value("/mainwindow/geometry/pos", QPoint(300,100)).toPoint());
1.121 + }
1.122 +
1.123 + // Sometimes we may need to remember old selections
1.124 + prevSelection="";
1.125 +
1.126 + // Default color
1.127 + currentColor=Qt::black;
1.128 +
1.129 + // Create unique temporary directory
1.130 + bool ok;
1.131 + tmpVymDir=makeTmpDir (ok,"vym");
1.132 + if (!ok)
1.133 + {
1.134 + qWarning ("Mainwindow: Could not create temporary directory, failed to start vym");
1.135 + exit (1);
1.136 + }
1.137 + if (debug) qDebug (QString("vym tmpDir=%1").arg(tmpVymDir) );
1.138 +
1.139 + // Create direcctory for clipboard
1.140 + clipboardDir=tmpVymDir+"/clipboard";
1.141 + clipboardFile="map.xml";
1.142 + QDir d(clipboardDir);
1.143 + d.mkdir (clipboardDir,true);
1.144 + makeSubDirs (clipboardDir);
1.145 + clipboardEmpty=true;
1.146 +
1.147 + browserPID=new qint64;
1.148 + *browserPID=0;
1.149 +
1.150 + // Satellite windows //////////////////////////////////////////
1.151 + // history window
1.152 + historyWindow=new HistoryWindow();
1.153 + connect (historyWindow, SIGNAL (windowClosed() ), this, SLOT (updateActions()));
1.154 +
1.155 + // properties window
1.156 + branchPropertyWindow = new BranchPropertyWindow();
1.157 + connect (branchPropertyWindow, SIGNAL (windowClosed() ), this, SLOT (updateActions()));
1.158 +
1.159 + // Connect TextEditor, so that we can update flags if text changes
1.160 + connect (textEditor, SIGNAL (textHasChanged() ), this, SLOT (updateNoteFlag()));
1.161 + connect (textEditor, SIGNAL (windowClosed() ), this, SLOT (updateActions()));
1.162 +
1.163 + // Initialize script editor
1.164 + scriptEditor = new SimpleScriptEditor();
1.165 + scriptEditor->move (50,50);
1.166 +
1.167 + connect( scriptEditor, SIGNAL( runScript ( QString ) ),
1.168 + this, SLOT( runScript( QString ) ) );
1.169 +
1.170 + // Initialize some settings, which are platform dependant
1.171 + QString p,s;
1.172 +
1.173 + // application to open URLs
1.174 + p="/mainwindow/readerURL";
1.175 + #if defined(Q_OS_LINUX)
1.176 + s=settings.value (p,"xdg-open").toString();
1.177 #else
1.178 - #if defined(Q_OS_WIN32)
1.179 - // Assume that system has been set up so that
1.180 - // Explorer automagically opens up the URL
1.181 - // in the user's preferred browser.
1.182 - s=settings.value (p,"explorer").toString();
1.183 + #if defined(Q_OS_MACX)
1.184 + s=settings.value (p,"/usr/bin/open").toString();
1.185 +
1.186 #else
1.187 - s=settings.value (p,"mozilla").toString();
1.188 + #if defined(Q_OS_WIN32)
1.189 + // Assume that system has been set up so that
1.190 + // Explorer automagically opens up the URL
1.191 + // in the user's preferred browser.
1.192 + s=settings.value (p,"explorer").toString();
1.193 + #else
1.194 + s=settings.value (p,"mozilla").toString();
1.195 + #endif
1.196 #endif
1.197 #endif
1.198 - #endif
1.199 - settings.setValue( p,s);
1.200 -
1.201 - // application to open PDFs
1.202 - p="/mainwindow/readerPDF";
1.203 - #if defined(Q_OS_LINUX)
1.204 - s=settings.value (p,"xdg-open").toString();
1.205 - #else
1.206 - #if defined(Q_OS_MACX)
1.207 - s=settings.value (p,"/usr/bin/open").toString();
1.208 - #elif defined(Q_OS_WIN32)
1.209 - s=settings.value (p,"acrord32").toString();
1.210 + settings.setValue( p,s);
1.211 +
1.212 + // application to open PDFs
1.213 + p="/mainwindow/readerPDF";
1.214 + #if defined(Q_OS_LINUX)
1.215 + s=settings.value (p,"xdg-open").toString();
1.216 #else
1.217 - s=settings.value (p,"acroread").toString();
1.218 + #if defined(Q_OS_MACX)
1.219 + s=settings.value (p,"/usr/bin/open").toString();
1.220 + #elif defined(Q_OS_WIN32)
1.221 + s=settings.value (p,"acrord32").toString();
1.222 + #else
1.223 + s=settings.value (p,"acroread").toString();
1.224 + #endif
1.225 #endif
1.226 - #endif
1.227 - settings.setValue( p,s);
1.228 -
1.229 -// width of xLinksMenu
1.230 -xLinkMenuWidth=60;
1.231 -
1.232 -// Create tab widget which holds the maps
1.233 -tabWidget= new QTabWidget (this);
1.234 -connect( tabWidget, SIGNAL( currentChanged( QWidget * ) ),
1.235 - this, SLOT( editorChanged( QWidget * ) ) );
1.236 -
1.237 -setCentralWidget(tabWidget);
1.238 -
1.239 -setupFileActions();
1.240 -setupEditActions();
1.241 -setupFormatActions();
1.242 -setupViewActions();
1.243 -setupModeActions();
1.244 -setupFlagActions();
1.245 -setupNetworkActions();
1.246 -setupSettingsActions();
1.247 -setupContextMenus();
1.248 -setupMacros();
1.249 -if (settings.value( "/mainwindow/showTestMenu",false).toBool()) setupTestActions();
1.250 -setupHelpActions();
1.251 -
1.252 -// Status bar and progress bar there
1.253 -statusBar();
1.254 -progressMax=0;
1.255 -progressBar=new QProgressBar;
1.256 -progressBar->hide();
1.257 -statusBar()->addPermanentWidget(progressBar);
1.258 -
1.259 -restoreState (settings.value("/mainwindow/state",0).toByteArray());
1.260 -
1.261 -updateGeometry();
1.262 + settings.setValue( p,s);
1.263 +
1.264 + // width of xLinksMenu
1.265 + xLinkMenuWidth=60;
1.266 +
1.267 + // Create tab widget which holds the maps
1.268 + tabWidget= new QTabWidget (this);
1.269 + connect( tabWidget, SIGNAL( currentChanged( QWidget * ) ),
1.270 + this, SLOT( editorChanged( QWidget * ) ) );
1.271 +
1.272 + setCentralWidget(tabWidget);
1.273 +
1.274 + setupFileActions();
1.275 + setupEditActions();
1.276 + setupFormatActions();
1.277 + setupViewActions();
1.278 + setupModeActions();
1.279 + setupFlagActions();
1.280 + setupNetworkActions();
1.281 + setupSettingsActions();
1.282 + setupContextMenus();
1.283 + setupMacros();
1.284 + if (settings.value( "/mainwindow/showTestMenu",false).toBool()) setupTestActions();
1.285 + setupHelpActions();
1.286 +
1.287 + // Status bar and progress bar there
1.288 + statusBar();
1.289 + progressMax=0;
1.290 + progressBar=new QProgressBar;
1.291 + progressBar->hide();
1.292 + statusBar()->addPermanentWidget(progressBar);
1.293 +
1.294 + restoreState (settings.value("/mainwindow/state",0).toByteArray());
1.295 +
1.296 + updateGeometry();
1.297 }
1.298
1.299 Main::~Main()
1.300 {
1.301 -// Save Settings
1.302 -#if defined(Q_OS_WIN32)
1.303 -settings.setValue ("/mainwindow/geometry/maximized", isMaximized());
1.304 -#endif
1.305 -settings.setValue ("/mainwindow/geometry/size", size());
1.306 -settings.setValue ("/mainwindow/geometry/pos", pos());
1.307 -settings.setValue ("/mainwindow/state",saveState(0));
1.308 -
1.309 -settings.setValue ("/mainwindow/view/AntiAlias",actionViewToggleAntiAlias->isOn());
1.310 -settings.setValue ("/mainwindow/view/SmoothPixmapTransform",actionViewToggleSmoothPixmapTransform->isOn());
1.311 -settings.setValue( "/version/version", vymVersion );
1.312 -settings.setValue( "/version/builddate", vymBuildDate );
1.313 -
1.314 -settings.setValue( "/mainwindow/autosave/use",actionSettingsAutosaveToggle->isOn() );
1.315 -settings.setValue( "/mapeditor/editmode/autoSelectNewBranch",actionSettingsAutoSelectNewBranch->isOn() );
1.316 -settings.setValue( "/mainwindow/writeBackupFile",actionSettingsWriteBackupFile->isOn() );
1.317 -settings.setValue( "/mapeditor/editmode/autoSelectText",actionSettingsAutoSelectText->isOn() );
1.318 -settings.setValue( "/mapeditor/editmode/autoEditNewBranch",actionSettingsAutoEditNewBranch->isOn() );
1.319 -settings.setValue( "/mapeditor/editmode/useDelKey",actionSettingsUseDelKey->isOn() );
1.320 -settings.setValue( "/mapeditor/editmode/useFlagGroups",actionSettingsUseFlagGroups->isOn() );
1.321 -settings.setValue( "/export/useHideExport",actionSettingsUseHideExport->isOn() );
1.322 -
1.323 -//TODO save scriptEditor settings
1.324 -
1.325 -// call the destructors
1.326 -delete textEditor;
1.327 -delete historyWindow;
1.328 -delete branchPropertyWindow;
1.329 -delete progressBar;
1.330 -
1.331 -// Remove temporary directory
1.332 -removeDir (QDir(tmpVymDir));
1.333 + // Save Settings
1.334 + #if defined(Q_OS_WIN32)
1.335 + settings.setValue ("/mainwindow/geometry/maximized", isMaximized());
1.336 + #endif
1.337 + settings.setValue ("/mainwindow/geometry/size", size());
1.338 + settings.setValue ("/mainwindow/geometry/pos", pos());
1.339 + settings.setValue ("/mainwindow/state",saveState(0));
1.340 +
1.341 + settings.setValue ("/mainwindow/view/AntiAlias",actionViewToggleAntiAlias->isOn());
1.342 + settings.setValue ("/mainwindow/view/SmoothPixmapTransform",actionViewToggleSmoothPixmapTransform->isOn());
1.343 + settings.setValue( "/version/version", vymVersion );
1.344 + settings.setValue( "/version/builddate", vymBuildDate );
1.345 +
1.346 + settings.setValue( "/mainwindow/autosave/use",actionSettingsAutosaveToggle->isOn() );
1.347 + settings.setValue( "/mapeditor/editmode/autoSelectNewBranch",actionSettingsAutoSelectNewBranch->isOn() );
1.348 + settings.setValue( "/mainwindow/writeBackupFile",actionSettingsWriteBackupFile->isOn() );
1.349 + settings.setValue( "/mapeditor/editmode/autoSelectText",actionSettingsAutoSelectText->isOn() );
1.350 + settings.setValue( "/mapeditor/editmode/autoEditNewBranch",actionSettingsAutoEditNewBranch->isOn() );
1.351 + settings.setValue( "/mapeditor/editmode/useDelKey",actionSettingsUseDelKey->isOn() );
1.352 + settings.setValue( "/mapeditor/editmode/useFlagGroups",actionSettingsUseFlagGroups->isOn() );
1.353 + settings.setValue( "/export/useHideExport",actionSettingsUseHideExport->isOn() );
1.354 +
1.355 + //TODO save scriptEditor settings
1.356 +
1.357 + // call the destructors
1.358 + delete textEditor;
1.359 + delete historyWindow;
1.360 + delete branchPropertyWindow;
1.361 + delete progressBar;
1.362 +
1.363 + // Remove temporary directory
1.364 + removeDir (QDir(tmpVymDir));
1.365 }
1.366
1.367 void Main::loadCmdLine()
1.368 {
1.369 -/* TODO draw some kind of splashscreen while loading...
1.370 -if (qApp->argc()>1)
1.371 -{
1.372 -}
1.373 -*/
1.374 -
1.375 -QStringList flist=options.getFileList();
1.376 -QStringList::Iterator it=flist.begin();
1.377 -
1.378 -while (it !=flist.end() )
1.379 -{
1.380 - fileLoad (*it, NewMap);
1.381 - *it++;
1.382 -}
1.383 + /* TODO draw some kind of splashscreen while loading...
1.384 + if (qApp->argc()>1)
1.385 + {
1.386 + }
1.387 + */
1.388 +
1.389 + QStringList flist=options.getFileList();
1.390 + QStringList::Iterator it=flist.begin();
1.391 +
1.392 + while (it !=flist.end() )
1.393 + {
1.394 + fileLoad (*it, NewMap);
1.395 + *it++;
1.396 + }
1.397 }
1.398
1.399
1.400 void Main::statusMessage(const QString &s)
1.401 {
1.402 -// Surpress messages while progressbar during
1.403 -// load is active
1.404 -if (progressMin==progressMax)
1.405 - statusBar()->message( s);
1.406 + // Surpress messages while progressbar during
1.407 + // load is active
1.408 + if (progressMin==progressMax)
1.409 + statusBar()->message( s);
1.410 }
1.411
1.412 void Main::setProgressMinimum (int min)
1.413 {
1.414 -progressBar->setMinimum(min);
1.415 -progressMin=min;
1.416 + progressBar->setMinimum(min);
1.417 + progressMin=min;
1.418 }
1.419
1.420 void Main::setProgressMaximum (int max)
1.421 {
1.422 -progressBar->setMaximum(max);
1.423 -progressMax=max;
1.424 -if (max>0)
1.425 -{
1.426 - statusBar()->addPermanentWidget(progressBar);
1.427 - progressBar->show();
1.428 -}
1.429 + progressBar->setMaximum(max);
1.430 + progressMax=max;
1.431 + if (max>0)
1.432 + {
1.433 + statusBar()->addPermanentWidget(progressBar);
1.434 + progressBar->show();
1.435 + }
1.436 }
1.437
1.438 void Main::setProgressValue (int v)
1.439 {
1.440 -progressBar->setValue (v);
1.441 + progressBar->setValue (v);
1.442 }
1.443
1.444 void Main::removeProgressBar()
1.445 {
1.446 -if (progressMax>0)
1.447 - statusBar()->removeWidget(progressBar);
1.448 -progressMax=progressMin=0;
1.449 + if (progressMax>0)
1.450 + statusBar()->removeWidget(progressBar);
1.451 + progressMax=progressMin=0;
1.452 }
1.453
1.454 void Main::closeEvent (QCloseEvent* )
1.455 {
1.456 -fileExitVYM();
1.457 + fileExitVYM();
1.458 }
1.459
1.460 // File Actions
1.461 void Main::setupFileActions()
1.462 {
1.463 -QMenu *fileMenu = menuBar()->addMenu ( tr ("&Map") );
1.464 -QToolBar *tb = addToolBar( tr ("&Map") );
1.465 -tb->setObjectName ("mapTB");
1.466 -
1.467 -QAction *a;
1.468 -a = new QAction(QPixmap( iconPath+"filenew.png"), tr( "&New map","File menu" ),this);
1.469 -a->setStatusTip ( tr( "New map","Status tip File menu" ) );
1.470 -a->setShortcut ( Qt::CTRL + Qt::Key_N ); //New map
1.471 -a->addTo( tb );
1.472 -fileMenu->addAction (a);
1.473 -connect( a, SIGNAL( triggered() ), this, SLOT( fileNew() ) );
1.474 -
1.475 -a = new QAction(QPixmap( iconPath+"filenewcopy.png"), tr( "&Copy to new map","File menu" ),this);
1.476 -a->setStatusTip ( tr( "Copy selection to mapcenter of a new map","Status tip File menu" ) );
1.477 -a->setShortcut ( Qt::CTRL +Qt::SHIFT + Qt::Key_N ); //New map
1.478 -fileMenu->addAction (a);
1.479 -connect( a, SIGNAL( triggered() ), this, SLOT( fileNewCopy() ) );
1.480 -actionFileNewCopy=a;
1.481 -
1.482 -a = new QAction( QPixmap( iconPath+"fileopen.png"), tr( "&Open..." ,"File menu"),this);
1.483 -a->setStatusTip (tr( "Open","Status tip File menu" ) );
1.484 -a->setShortcut ( Qt::CTRL + Qt::Key_O ); //Open map
1.485 -a->addTo( tb );
1.486 -fileMenu->addAction (a);
1.487 -connect( a, SIGNAL( triggered() ), this, SLOT( fileLoad() ) );
1.488 -
1.489 -fileLastMapsMenu = fileMenu->addMenu (tr("Open Recent","File menu"));
1.490 -fileMenu->addSeparator();
1.491 -
1.492 -a = new QAction( QPixmap( iconPath+"filesave.png"), tr( "&Save...","File menu" ), this);
1.493 -a->setStatusTip ( tr( "Save","Status tip file menu" ));
1.494 -a->setShortcut (Qt::CTRL + Qt::Key_S ); //Save map
1.495 -a->addTo( tb );
1.496 -fileMenu->addAction (a);
1.497 -connect( a, SIGNAL( triggered() ), this, SLOT( fileSave() ) );
1.498 -actionFileSave=a;
1.499 -
1.500 -a = new QAction( QPixmap(iconPath+"filesaveas.png"), tr( "Save &As...","File menu" ), this);
1.501 -a->setStatusTip (tr( "Save &As","Status tip file menu" ) );
1.502 -fileMenu->addAction (a);
1.503 -connect( a, SIGNAL( triggered() ), this, SLOT( fileSaveAs() ) );
1.504 -
1.505 -fileMenu->addSeparator();
1.506 -
1.507 -fileImportMenu = fileMenu->addMenu (tr("Import","File menu"));
1.508 -
1.509 -a = new QAction(tr("KDE 3 Bookmarks"), this);
1.510 -a->setStatusTip ( tr( "Import %1","Status tip file menu" ).arg(tr("KDE 3 bookmarks")));
1.511 -a->addTo (fileImportMenu);
1.512 -connect( a, SIGNAL( triggered() ), this, SLOT( fileImportKDE3Bookmarks() ) );
1.513 -
1.514 -a = new QAction(tr("KDE 4 Bookmarks"), this);
1.515 -a->setStatusTip ( tr( "Import %1","Status tip file menu" ).arg(tr("KDE 4 bookmarks")));
1.516 -a->addTo (fileImportMenu);
1.517 -connect( a, SIGNAL( triggered() ), this, SLOT( fileImportKDE4Bookmarks() ) );
1.518 -
1.519 -if (settings.value( "/mainwindow/showTestMenu",false).toBool())
1.520 -{
1.521 - a = new QAction( QPixmap(), tr("Firefox Bookmarks","File menu"),this);
1.522 - a->setStatusTip (tr( "Import %1","Status tip file menu").arg(tr("Firefox Bookmarks" ) ));
1.523 + QMenu *fileMenu = menuBar()->addMenu ( tr ("&Map") );
1.524 + QToolBar *tb = addToolBar( tr ("&Map") );
1.525 + tb->setObjectName ("mapTB");
1.526 +
1.527 + QAction *a;
1.528 + a = new QAction(QPixmap( iconPath+"filenew.png"), tr( "&New map","File menu" ),this);
1.529 + a->setStatusTip ( tr( "New map","Status tip File menu" ) );
1.530 + a->setShortcut ( Qt::CTRL + Qt::Key_N ); //New map
1.531 + a->addTo( tb );
1.532 + fileMenu->addAction (a);
1.533 + connect( a, SIGNAL( triggered() ), this, SLOT( fileNew() ) );
1.534 +
1.535 + a = new QAction(QPixmap( iconPath+"filenewcopy.png"), tr( "&Copy to new map","File menu" ),this);
1.536 + a->setStatusTip ( tr( "Copy selection to mapcenter of a new map","Status tip File menu" ) );
1.537 + a->setShortcut ( Qt::CTRL +Qt::SHIFT + Qt::Key_N ); //New map
1.538 + fileMenu->addAction (a);
1.539 + connect( a, SIGNAL( triggered() ), this, SLOT( fileNewCopy() ) );
1.540 + actionFileNewCopy=a;
1.541 +
1.542 + a = new QAction( QPixmap( iconPath+"fileopen.png"), tr( "&Open..." ,"File menu"),this);
1.543 + a->setStatusTip (tr( "Open","Status tip File menu" ) );
1.544 + a->setShortcut ( Qt::CTRL + Qt::Key_O ); //Open map
1.545 + a->addTo( tb );
1.546 + fileMenu->addAction (a);
1.547 + connect( a, SIGNAL( triggered() ), this, SLOT( fileLoad() ) );
1.548 +
1.549 + fileLastMapsMenu = fileMenu->addMenu (tr("Open Recent","File menu"));
1.550 + fileMenu->addSeparator();
1.551 +
1.552 + a = new QAction( QPixmap( iconPath+"filesave.png"), tr( "&Save...","File menu" ), this);
1.553 + a->setStatusTip ( tr( "Save","Status tip file menu" ));
1.554 + a->setShortcut (Qt::CTRL + Qt::Key_S ); //Save map
1.555 + a->addTo( tb );
1.556 + fileMenu->addAction (a);
1.557 + connect( a, SIGNAL( triggered() ), this, SLOT( fileSave() ) );
1.558 + actionFileSave=a;
1.559 +
1.560 + a = new QAction( QPixmap(iconPath+"filesaveas.png"), tr( "Save &As...","File menu" ), this);
1.561 + a->setStatusTip (tr( "Save &As","Status tip file menu" ) );
1.562 + fileMenu->addAction (a);
1.563 + connect( a, SIGNAL( triggered() ), this, SLOT( fileSaveAs() ) );
1.564 +
1.565 + fileMenu->addSeparator();
1.566 +
1.567 + fileImportMenu = fileMenu->addMenu (tr("Import","File menu"));
1.568 +
1.569 + a = new QAction(tr("KDE 3 Bookmarks"), this);
1.570 + a->setStatusTip ( tr( "Import %1","Status tip file menu" ).arg(tr("KDE 3 bookmarks")));
1.571 a->addTo (fileImportMenu);
1.572 - connect( a, SIGNAL( triggered() ), this, SLOT( fileImportFirefoxBookmarks() ) );
1.573 -}
1.574 -
1.575 -a = new QAction("Freemind...",this);
1.576 -a->setStatusTip ( tr( "Import %1","status tip file menu").arg(" Freemind") );
1.577 -fileImportMenu->addAction (a);
1.578 -connect( a, SIGNAL( triggered() ), this, SLOT( fileImportFreemind() ) );
1.579 -
1.580 -a = new QAction("Mind Manager...",this);
1.581 -a->setStatusTip ( tr( "Import %1","status tip file menu").arg(" Mind Manager") );
1.582 -fileImportMenu->addAction (a);
1.583 -connect( a, SIGNAL( triggered() ), this, SLOT( fileImportMM() ) );
1.584 -
1.585 -a = new QAction( tr( "Import Dir%1","File menu").arg("..."), this);
1.586 -a->setStatusTip (tr( "Import directory structure (experimental)","status tip file menu" ) );
1.587 -fileImportMenu->addAction (a);
1.588 -connect( a, SIGNAL( triggered() ), this, SLOT( fileImportDir() ) );
1.589 -
1.590 -fileExportMenu = fileMenu->addMenu (tr("Export","File menu"));
1.591 -
1.592 -a = new QAction( tr("Image%1","File export menu").arg("..."), this);
1.593 -a->setStatusTip( tr( "Export map as image","status tip file menu" ));
1.594 -connect( a, SIGNAL( triggered() ), this, SLOT( fileExportImage() ) );
1.595 -fileExportMenu->addAction (a);
1.596 -
1.597 -a = new QAction( "Open Office...", this);
1.598 -a->setStatusTip( tr( "Export in Open Document Format used e.g. in Open Office ","status tip file menu" ));
1.599 -connect( a, SIGNAL( triggered() ), this, SLOT( fileExportOOPresentation() ) );
1.600 -fileExportMenu->addAction (a);
1.601 -
1.602 -a = new QAction( "Webpage (XHTML)...",this );
1.603 -a->setShortcut (Qt::ALT + Qt::Key_X); //Export XHTML
1.604 -a->setStatusTip ( tr( "Export as %1","status tip file menu").arg(tr(" webpage (XHTML)","status tip file menu")));
1.605 -connect( a, SIGNAL( triggered() ), this, SLOT( fileExportXHTML() ) );
1.606 -fileExportMenu->addAction (a);
1.607 -
1.608 -a = new QAction( "Text (A&O report)...", this);
1.609 -a->setStatusTip ( tr( "Export as %1").arg("A&O report "+tr("(still experimental)" )));
1.610 -connect( a, SIGNAL( triggered() ), this, SLOT( fileExportAO() ) );
1.611 -fileExportMenu->addAction (a);
1.612 -
1.613 -a = new QAction( "Text (ASCII)...", this);
1.614 -a->setStatusTip ( tr( "Export as %1").arg("ASCII "+tr("(still experimental)" )));
1.615 -connect( a, SIGNAL( triggered() ), this, SLOT( fileExportASCII() ) );
1.616 -fileExportMenu->addAction (a);
1.617 -
1.618 -a = new QAction( "Spreadsheet (CSV)...", this);
1.619 -a->setStatusTip ( tr( "Export as %1").arg("CSV "+tr("(still experimental)" )));
1.620 -connect( a, SIGNAL( triggered() ), this, SLOT( fileExportCSV() ) );
1.621 -fileExportMenu->addAction (a);
1.622 -
1.623 -a = new QAction( tr("KDE 3 Bookmarks","File menu"), this);
1.624 -a->setStatusTip( tr( "Export as %1").arg(tr("KDE 3 Bookmarks" )));
1.625 -connect( a, SIGNAL( triggered() ), this, SLOT( fileExportKDE3Bookmarks() ) );
1.626 -fileExportMenu->addAction (a);
1.627 -
1.628 -a = new QAction( tr("KDE 4 Bookmarks","File menu"), this);
1.629 -a->setStatusTip( tr( "Export as %1").arg(tr("KDE 4 Bookmarks" )));
1.630 -connect( a, SIGNAL( triggered() ), this, SLOT( fileExportKDE4Bookmarks() ) );
1.631 -fileExportMenu->addAction (a);
1.632 -
1.633 -a = new QAction( "Taskjuggler...", this );
1.634 -a->setStatusTip( tr( "Export as %1").arg("Taskjuggler "+tr("(still experimental)" )));
1.635 -connect( a, SIGNAL( triggered() ), this, SLOT( fileExportTaskjuggler() ) );
1.636 -fileExportMenu->addAction (a);
1.637 -
1.638 -a = new QAction( "LaTeX...", this);
1.639 -a->setStatusTip( tr( "Export as %1").arg("LaTeX "+tr("(still experimental)" )));
1.640 -connect( a, SIGNAL( triggered() ), this, SLOT( fileExportLaTeX() ) );
1.641 -fileExportMenu->addAction (a);
1.642 -
1.643 -a = new QAction( "XML..." , this );
1.644 -a->setStatusTip (tr( "Export as %1").arg("XML"));
1.645 -connect( a, SIGNAL( triggered() ), this, SLOT( fileExportXML() ) );
1.646 -fileExportMenu->addAction (a);
1.647 -
1.648 -fileMenu->addSeparator();
1.649 -
1.650 -a = new QAction(QPixmap( iconPath+"fileprint.png"), tr( "&Print")+QString("..."), this);
1.651 -a->setStatusTip ( tr( "Print" ,"File menu") );
1.652 -a->setShortcut (Qt::CTRL + Qt::Key_P ); //Print map
1.653 -a->addTo( tb );
1.654 -fileMenu->addAction (a);
1.655 -connect( a, SIGNAL( triggered() ), this, SLOT( filePrint() ) );
1.656 -actionFilePrint=a;
1.657 -
1.658 -a = new QAction( QPixmap(iconPath+"fileclose.png"), tr( "&Close Map","File menu" ), this);
1.659 -a->setStatusTip (tr( "Close Map" ) );
1.660 -a->setShortcut (Qt::CTRL + Qt::Key_W ); //Close map
1.661 -fileMenu->addAction (a);
1.662 -connect( a, SIGNAL( triggered() ), this, SLOT( fileCloseMap() ) );
1.663 -
1.664 -a = new QAction(QPixmap(iconPath+"exit.png"), tr( "E&xit","File menu")+" "+vymName, this);
1.665 -a->setStatusTip ( tr( "Exit")+" "+vymName );
1.666 -a->setShortcut (Qt::CTRL + Qt::Key_Q ); //Quit vym
1.667 -fileMenu->addAction (a);
1.668 -connect( a, SIGNAL( triggered() ), this, SLOT( fileExitVYM() ) );
1.669 + connect( a, SIGNAL( triggered() ), this, SLOT( fileImportKDE3Bookmarks() ) );
1.670 +
1.671 + a = new QAction(tr("KDE 4 Bookmarks"), this);
1.672 + a->setStatusTip ( tr( "Import %1","Status tip file menu" ).arg(tr("KDE 4 bookmarks")));
1.673 + a->addTo (fileImportMenu);
1.674 + connect( a, SIGNAL( triggered() ), this, SLOT( fileImportKDE4Bookmarks() ) );
1.675 +
1.676 + if (settings.value( "/mainwindow/showTestMenu",false).toBool())
1.677 + {
1.678 + a = new QAction( QPixmap(), tr("Firefox Bookmarks","File menu"),this);
1.679 + a->setStatusTip (tr( "Import %1","Status tip file menu").arg(tr("Firefox Bookmarks" ) ));
1.680 + a->addTo (fileImportMenu);
1.681 + connect( a, SIGNAL( triggered() ), this, SLOT( fileImportFirefoxBookmarks() ) );
1.682 + }
1.683 +
1.684 + a = new QAction("Freemind...",this);
1.685 + a->setStatusTip ( tr( "Import %1","status tip file menu").arg(" Freemind") );
1.686 + fileImportMenu->addAction (a);
1.687 + connect( a, SIGNAL( triggered() ), this, SLOT( fileImportFreemind() ) );
1.688 +
1.689 + a = new QAction("Mind Manager...",this);
1.690 + a->setStatusTip ( tr( "Import %1","status tip file menu").arg(" Mind Manager") );
1.691 + fileImportMenu->addAction (a);
1.692 + connect( a, SIGNAL( triggered() ), this, SLOT( fileImportMM() ) );
1.693 +
1.694 + a = new QAction( tr( "Import Dir%1","File menu").arg("..."), this);
1.695 + a->setStatusTip (tr( "Import directory structure (experimental)","status tip file menu" ) );
1.696 + fileImportMenu->addAction (a);
1.697 + connect( a, SIGNAL( triggered() ), this, SLOT( fileImportDir() ) );
1.698 +
1.699 + fileExportMenu = fileMenu->addMenu (tr("Export","File menu"));
1.700 +
1.701 + a = new QAction( tr("Image%1","File export menu").arg("..."), this);
1.702 + a->setStatusTip( tr( "Export map as image","status tip file menu" ));
1.703 + connect( a, SIGNAL( triggered() ), this, SLOT( fileExportImage() ) );
1.704 + fileExportMenu->addAction (a);
1.705 +
1.706 + a = new QAction( "Open Office...", this);
1.707 + a->setStatusTip( tr( "Export in Open Document Format used e.g. in Open Office ","status tip file menu" ));
1.708 + connect( a, SIGNAL( triggered() ), this, SLOT( fileExportOOPresentation() ) );
1.709 + fileExportMenu->addAction (a);
1.710 +
1.711 + a = new QAction( "Webpage (XHTML)...",this );
1.712 + a->setShortcut (Qt::ALT + Qt::Key_X); //Export XHTML
1.713 + a->setStatusTip ( tr( "Export as %1","status tip file menu").arg(tr(" webpage (XHTML)","status tip file menu")));
1.714 + connect( a, SIGNAL( triggered() ), this, SLOT( fileExportXHTML() ) );
1.715 + fileExportMenu->addAction (a);
1.716 +
1.717 + a = new QAction( "Text (A&O report)...", this);
1.718 + a->setStatusTip ( tr( "Export as %1").arg("A&O report "+tr("(still experimental)" )));
1.719 + connect( a, SIGNAL( triggered() ), this, SLOT( fileExportAO() ) );
1.720 + fileExportMenu->addAction (a);
1.721 +
1.722 + a = new QAction( "Text (ASCII)...", this);
1.723 + a->setStatusTip ( tr( "Export as %1").arg("ASCII "+tr("(still experimental)" )));
1.724 + connect( a, SIGNAL( triggered() ), this, SLOT( fileExportASCII() ) );
1.725 + fileExportMenu->addAction (a);
1.726 +
1.727 + a = new QAction( "Spreadsheet (CSV)...", this);
1.728 + a->setStatusTip ( tr( "Export as %1").arg("CSV "+tr("(still experimental)" )));
1.729 + connect( a, SIGNAL( triggered() ), this, SLOT( fileExportCSV() ) );
1.730 + fileExportMenu->addAction (a);
1.731 +
1.732 + a = new QAction( tr("KDE 3 Bookmarks","File menu"), this);
1.733 + a->setStatusTip( tr( "Export as %1").arg(tr("KDE 3 Bookmarks" )));
1.734 + connect( a, SIGNAL( triggered() ), this, SLOT( fileExportKDE3Bookmarks() ) );
1.735 + fileExportMenu->addAction (a);
1.736 +
1.737 + a = new QAction( tr("KDE 4 Bookmarks","File menu"), this);
1.738 + a->setStatusTip( tr( "Export as %1").arg(tr("KDE 4 Bookmarks" )));
1.739 + connect( a, SIGNAL( triggered() ), this, SLOT( fileExportKDE4Bookmarks() ) );
1.740 + fileExportMenu->addAction (a);
1.741 +
1.742 + a = new QAction( "Taskjuggler...", this );
1.743 + a->setStatusTip( tr( "Export as %1").arg("Taskjuggler "+tr("(still experimental)" )));
1.744 + connect( a, SIGNAL( triggered() ), this, SLOT( fileExportTaskjuggler() ) );
1.745 + fileExportMenu->addAction (a);
1.746 +
1.747 + a = new QAction( "LaTeX...", this);
1.748 + a->setStatusTip( tr( "Export as %1").arg("LaTeX "+tr("(still experimental)" )));
1.749 + connect( a, SIGNAL( triggered() ), this, SLOT( fileExportLaTeX() ) );
1.750 + fileExportMenu->addAction (a);
1.751 +
1.752 + a = new QAction( "XML..." , this );
1.753 + a->setStatusTip (tr( "Export as %1").arg("XML"));
1.754 + connect( a, SIGNAL( triggered() ), this, SLOT( fileExportXML() ) );
1.755 + fileExportMenu->addAction (a);
1.756 +
1.757 + fileMenu->addSeparator();
1.758 +
1.759 + a = new QAction(QPixmap( iconPath+"fileprint.png"), tr( "&Print")+QString("..."), this);
1.760 + a->setStatusTip ( tr( "Print" ,"File menu") );
1.761 + a->setShortcut (Qt::CTRL + Qt::Key_P ); //Print map
1.762 + a->addTo( tb );
1.763 + fileMenu->addAction (a);
1.764 + connect( a, SIGNAL( triggered() ), this, SLOT( filePrint() ) );
1.765 + actionFilePrint=a;
1.766 +
1.767 + a = new QAction( QPixmap(iconPath+"fileclose.png"), tr( "&Close Map","File menu" ), this);
1.768 + a->setStatusTip (tr( "Close Map" ) );
1.769 + a->setShortcut (Qt::CTRL + Qt::Key_W ); //Close map
1.770 + fileMenu->addAction (a);
1.771 + connect( a, SIGNAL( triggered() ), this, SLOT( fileCloseMap() ) );
1.772 +
1.773 + a = new QAction(QPixmap(iconPath+"exit.png"), tr( "E&xit","File menu")+" "+vymName, this);
1.774 + a->setStatusTip ( tr( "Exit")+" "+vymName );
1.775 + a->setShortcut (Qt::CTRL + Qt::Key_Q ); //Quit vym
1.776 + fileMenu->addAction (a);
1.777 + connect( a, SIGNAL( triggered() ), this, SLOT( fileExitVYM() ) );
1.778 }
1.779
1.780
1.781 //Edit Actions
1.782 void Main::setupEditActions()
1.783 {
1.784 -QToolBar *tb = addToolBar( tr ("&Actions toolbar","Toolbar name") );
1.785 -tb->setLabel( "Edit Actions" );
1.786 -tb->setObjectName ("actionsTB");
1.787 -QMenu *editMenu = menuBar()->addMenu( tr("&Edit","Edit menu") );
1.788 -
1.789 -QAction *a;
1.790 -QAction *alt;
1.791 -a = new QAction( QPixmap( iconPath+"undo.png"), tr( "&Undo","Edit menu" ),this);
1.792 -connect( a, SIGNAL( triggered() ), this, SLOT( editUndo() ) );
1.793 -a->setStatusTip (tr( "Undo" ) );
1.794 -a->setShortcut ( Qt::CTRL + Qt::Key_Z ); //Undo last action
1.795 -a->setEnabled (false);
1.796 -tb->addAction (a);
1.797 -editMenu->addAction (a);
1.798 -actionUndo=a;
1.799 -
1.800 -a = new QAction( QPixmap( iconPath+"redo.png"), tr( "&Redo","Edit menu" ), this);
1.801 -a->setStatusTip (tr( "Redo" ));
1.802 -a->setShortcut (Qt::CTRL + Qt::Key_Y ); //Redo last action
1.803 -tb->addAction (a);
1.804 -editMenu->addAction (a);
1.805 -connect( a, SIGNAL( triggered() ), this, SLOT( editRedo() ) );
1.806 -actionRedo=a;
1.807 -
1.808 -editMenu->addSeparator();
1.809 -a = new QAction(QPixmap( iconPath+"editcopy.png"), tr( "&Copy","Edit menu" ), this);
1.810 -a->setStatusTip ( tr( "Copy" ) );
1.811 -a->setShortcut (Qt::CTRL + Qt::Key_C ); //Copy
1.812 -a->setEnabled (false);
1.813 -tb->addAction (a);
1.814 -editMenu->addAction (a);
1.815 -connect( a, SIGNAL( triggered() ), this, SLOT( editCopy() ) );
1.816 -actionCopy=a;
1.817 -
1.818 -a = new QAction(QPixmap( iconPath+"editcut.png" ), tr( "Cu&t","Edit menu" ), this);
1.819 -a->setStatusTip ( tr( "Cut" ) );
1.820 -a->setShortcut (Qt::CTRL + Qt::Key_X ); //Cut
1.821 -a->setEnabled (false);
1.822 -tb->addAction (a);
1.823 -editMenu->addAction (a);
1.824 -actionCut=a;
1.825 -connect( a, SIGNAL( triggered() ), this, SLOT( editCut() ) );
1.826 -
1.827 -a = new QAction(QPixmap( iconPath+"editpaste.png"), tr( "&Paste","Edit menu" ),this);
1.828 -connect( a, SIGNAL( triggered() ), this, SLOT( editPaste() ) );
1.829 -a->setStatusTip ( tr( "Paste" ) );
1.830 -a->setShortcut ( Qt::CTRL + Qt::Key_V ); //Paste
1.831 -a->setEnabled (false);
1.832 -tb->addAction (a);
1.833 -editMenu->addAction (a);
1.834 -actionPaste=a;
1.835 -
1.836 -// Shortcut to delete selection
1.837 -a = new QAction( tr( "Delete Selection","Edit menu" ),this);
1.838 -a->setStatusTip (tr( "Delete Selection" ));
1.839 -a->setShortcut ( Qt::Key_Delete); //Delete selection
1.840 -a->setShortcutContext (Qt::WindowShortcut);
1.841 -addAction (a);
1.842 -connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteSelection() ) );
1.843 -actionDelete=a;
1.844 -
1.845 -// Shortcut to add attribute
1.846 -a= new QAction(tr( "Add attribute" ), this);
1.847 -a->setShortcut ( Qt::Key_Q);
1.848 -a->setShortcutContext (Qt::WindowShortcut);
1.849 -addAction (a);
1.850 -connect( a, SIGNAL( triggered() ), this, SLOT( editAddAttribute() ) );
1.851 -actionAddAttribute= a;
1.852 -
1.853 -
1.854 -// Shortcut to add mapcenter
1.855 -a= new QAction(QPixmap(iconPath+"newmapcenter.png"),tr( "Add mapcenter","Canvas context menu" ), this);
1.856 -a->setShortcut ( Qt::Key_M);
1.857 -a->setShortcutContext (Qt::WindowShortcut);
1.858 -connect( a, SIGNAL( triggered() ), this, SLOT( editAddMapCenter() ) );
1.859 -//actionListBranches.append(a);
1.860 -tb->addAction (a);
1.861 -actionAddMapCenter = a;
1.862 -
1.863 -
1.864 -// Shortcut to add branch
1.865 -alt = new QAction(QPixmap(iconPath+"newbranch.png"), tr( "Add branch as child","Edit menu" ), this);
1.866 -alt->setStatusTip ( tr( "Add a branch as child of selection" ));
1.867 -alt->setShortcut (Qt::Key_A); //Add branch
1.868 -alt->setShortcutContext (Qt::WindowShortcut);
1.869 -addAction (alt);
1.870 -connect( alt, SIGNAL( triggered() ), this, SLOT( editNewBranch() ) );
1.871 -a = new QAction(QPixmap(iconPath+"newbranch.png"), tr( "Add branch as child","Edit menu" ), this);
1.872 -a->setStatusTip ( tr( "Add a branch as child of selection" ));
1.873 -a->setShortcut (Qt::Key_Insert); //Add branch
1.874 -connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranch() ) );
1.875 -actionListBranches.append(a);
1.876 -#if defined (Q_OS_MACX)
1.877 - // In OSX show different shortcut in menues, the keys work indepently always
1.878 - actionAddBranch=alt;
1.879 -#else
1.880 - actionAddBranch=a;
1.881 -#endif
1.882 -editMenu->addAction (actionAddBranch);
1.883 -tb->addAction (actionAddBranch);
1.884 -
1.885 -
1.886 -// Add branch by inserting it at selection
1.887 -a = new QAction(tr( "Add branch (insert)","Edit menu" ), this);
1.888 -a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" ));
1.889 -a->setShortcut (Qt::ALT + Qt::Key_Insert ); //Insert branch
1.890 -a->setShortcutContext (Qt::WindowShortcut);
1.891 -addAction (a);
1.892 -connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBefore() ) );
1.893 -a->setEnabled (false);
1.894 -actionListBranches.append(a);
1.895 -actionAddBranchBefore=a;
1.896 -a = new QAction(tr( "Add branch (insert)","Edit menu" ),this);
1.897 -a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" ));
1.898 -a->setShortcut ( Qt::ALT + Qt::Key_A ); //Insert branch
1.899 -a->setShortcutContext (Qt::WindowShortcut);
1.900 -addAction (a);
1.901 -connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBefore() ) );
1.902 -actionListBranches.append(a);
1.903 -
1.904 -// Add branch above
1.905 -a = new QAction(tr( "Add branch above","Edit menu" ), this);
1.906 -a->setStatusTip ( tr( "Add a branch above selection" ));
1.907 -a->setShortcut (Qt::SHIFT+Qt::Key_Insert ); //Add branch above
1.908 -a->setShortcutContext (Qt::WindowShortcut);
1.909 -addAction (a);
1.910 -connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchAbove() ) );
1.911 -a->setEnabled (false);
1.912 -actionListBranches.append(a);
1.913 -actionAddBranchAbove=a;
1.914 -a = new QAction(tr( "Add branch above","Edit menu" ), this);
1.915 -a->setStatusTip ( tr( "Add a branch above selection" ));
1.916 -a->setShortcut (Qt::SHIFT+Qt::Key_A ); //Add branch above
1.917 -a->setShortcutContext (Qt::WindowShortcut);
1.918 -addAction (a);
1.919 -connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchAbove() ) );
1.920 -actionListBranches.append(a);
1.921 -
1.922 -// Add branch below
1.923 -a = new QAction(tr( "Add branch below","Edit menu" ), this);
1.924 -a->setStatusTip ( tr( "Add a branch below selection" ));
1.925 -a->setShortcut (Qt::CTRL +Qt::Key_Insert ); //Add branch below
1.926 -a->setShortcutContext (Qt::WindowShortcut);
1.927 -addAction (a);
1.928 -connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBelow() ) );
1.929 -a->setEnabled (false);
1.930 -actionListBranches.append(a);
1.931 -actionAddBranchBelow=a;
1.932 -a = new QAction(tr( "Add branch below","Edit menu" ), this);
1.933 -a->setStatusTip ( tr( "Add a branch below selection" ));
1.934 -a->setShortcut (Qt::CTRL +Qt::Key_A ); // Add branch below
1.935 -a->setShortcutContext (Qt::WindowShortcut);
1.936 -addAction (a);
1.937 -connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBelow() ) );
1.938 -actionListBranches.append(a);
1.939 -
1.940 -a = new QAction(QPixmap(iconPath+"up.png" ), tr( "Move up","Edit menu" ), this);
1.941 -a->setStatusTip ( tr( "Move branch up" ) );
1.942 -a->setShortcut (Qt::Key_PageUp ); // Move branch up
1.943 -a->setEnabled (false);
1.944 -tb->addAction (a);
1.945 -editMenu->addAction (a);
1.946 -connect( a, SIGNAL( triggered() ), this, SLOT( editMoveUp() ) );
1.947 -actionMoveUp=a;
1.948 -
1.949 -a = new QAction( QPixmap( iconPath+"down.png"), tr( "Move down","Edit menu" ),this);
1.950 -connect( a, SIGNAL( triggered() ), this, SLOT( editMoveDown() ) );
1.951 -a->setStatusTip (tr( "Move branch down" ) );
1.952 -a->setShortcut ( Qt::Key_PageDown ); // Move branch down
1.953 -a->setEnabled (false);
1.954 -tb->addAction (a);
1.955 -editMenu->addAction (a);
1.956 -actionMoveDown=a;
1.957 -
1.958 -a = new QAction(QPixmap(), tr( "&Detach","Context menu" ),this);
1.959 -a->setStatusTip ( tr( "Detach branch and use as mapcenter","Context menu" ) );
1.960 -a->setShortcut ( Qt::Key_D ); // Detach branch
1.961 -editMenu->addAction (a);
1.962 -connect( a, SIGNAL( triggered() ), this, SLOT( editDetach() ) );
1.963 -actionDetach=a;
1.964 -
1.965 -a = new QAction( QPixmap(iconPath+"editsort.png" ), tr( "Sort children","Edit menu" ), this );
1.966 -connect( a, SIGNAL( activated() ), this, SLOT( editSortChildren() ) );
1.967 -a->setEnabled (true);
1.968 -a->addTo( tb );
1.969 -editMenu->addAction (a);
1.970 -actionSortChildren=a;
1.971 -
1.972 -alt = new QAction( QPixmap(flagsPath+"flag-scrolled-right.png"), tr( "Scroll branch","Edit menu" ), this);
1.973 -alt->setShortcut ( Qt::Key_S ); // Scroll branch
1.974 -alt->setStatusTip (tr( "Scroll branch" ));
1.975 -connect( alt, SIGNAL( triggered() ), this, SLOT( editToggleScroll() ) );
1.976 -#if defined(Q_OS_MACX)
1.977 - actionToggleScroll=alt;
1.978 -#else
1.979 - actionToggleScroll=a;
1.980 -#endif
1.981 -actionToggleScroll->setEnabled (false);
1.982 -actionToggleScroll->setToggleAction(true);
1.983 -tb->addAction (actionToggleScroll);
1.984 -editMenu->addAction ( actionToggleScroll);
1.985 -editMenu->addAction (actionToggleScroll);
1.986 -addAction (a);
1.987 -addAction (alt);
1.988 -actionListBranches.append(actionToggleScroll);
1.989 -
1.990 -a = new QAction( QPixmap(), tr( "Expand all branches","Edit menu" ), this);
1.991 -a->setShortcut ( Qt::SHIFT + Qt::Key_X ); // Expand all branches
1.992 -a->setStatusTip (tr( "Expand all branches" ));
1.993 -connect( a, SIGNAL( triggered() ), this, SLOT( editExpandAll() ) );
1.994 -actionExpandAll=a;
1.995 -actionExpandAll->setEnabled (false);
1.996 -actionExpandAll->setToggleAction(false);
1.997 -//tb->addAction (actionExpandAll);
1.998 -editMenu->addAction ( actionExpandAll);
1.999 -addAction (a);
1.1000 -actionListBranches.append(actionExpandAll);
1.1001 -
1.1002 -a = new QAction( QPixmap(), tr( "Expand one level","Edit menu" ), this);
1.1003 -a->setShortcut ( Qt::Key_Greater ); // Expand one level in tree editor
1.1004 -a->setStatusTip (tr( "Expand one level in tree editor" ));
1.1005 -connect( a, SIGNAL( triggered() ), this, SLOT( editExpandOneLevel() ) );
1.1006 -a->setEnabled (false);
1.1007 -a->setToggleAction(false);
1.1008 -actionExpandOneLevel=a;
1.1009 -//tb->addAction (a);
1.1010 -editMenu->addAction ( a);
1.1011 -addAction (a);
1.1012 -actionListBranches.append(a);
1.1013 -
1.1014 -a = new QAction( QPixmap(), tr( "Collapse one level","Edit menu" ), this);
1.1015 -a->setShortcut ( Qt::Key_Less); // Collapse one level in tree editor
1.1016 -a->setStatusTip (tr( "Collapse one level in tree editor" ));
1.1017 -connect( a, SIGNAL( triggered() ), this, SLOT( editCollapseOneLevel() ) );
1.1018 -a->setEnabled (false);
1.1019 -a->setToggleAction(false);
1.1020 -actionCollapseOneLevel=a;
1.1021 -//tb->addAction (a);
1.1022 -editMenu->addAction ( a);
1.1023 -addAction (a);
1.1024 -actionListBranches.append(a);
1.1025 -
1.1026 -a = new QAction( tr( "Unscroll children","Edit menu" ), this);
1.1027 -a->setStatusTip (tr( "Unscroll all scrolled branches in selected subtree" ));
1.1028 -editMenu->addAction (a);
1.1029 -connect( a, SIGNAL( triggered() ), this, SLOT( editUnscrollChildren() ) );
1.1030 -
1.1031 -editMenu->addSeparator();
1.1032 -
1.1033 -a = new QAction( QPixmap(iconPath+"find.png"), tr( "Find...","Edit menu"), this);
1.1034 -a->setStatusTip (tr( "Find" ) );
1.1035 -a->setShortcut (Qt::CTRL + Qt::Key_F ); //Find
1.1036 -editMenu->addAction (a);
1.1037 -connect( a, SIGNAL( triggered() ), this, SLOT( editOpenFindWindow() ) );
1.1038 -
1.1039 -editMenu->addSeparator();
1.1040 -
1.1041 -a = new QAction( QPixmap(flagsPath+"flag-url.png"), tr( "Open URL","Edit menu" ), this);
1.1042 -a->setShortcut (Qt::SHIFT + Qt::Key_U );
1.1043 -a->setShortcut (tr( "Open URL" ));
1.1044 -tb->addAction (a);
1.1045 -addAction(a);
1.1046 -connect( a, SIGNAL( triggered() ), this, SLOT( editOpenURL() ) );
1.1047 -actionOpenURL=a;
1.1048 -
1.1049 -a = new QAction( tr( "Open URL in new tab","Edit menu" ), this);
1.1050 -a->setStatusTip (tr( "Open URL in new tab" ));
1.1051 -//a->setShortcut (Qt::CTRL+Qt::Key_U );
1.1052 -addAction(a);
1.1053 -connect( a, SIGNAL( triggered() ), this, SLOT( editOpenURLTab() ) );
1.1054 -actionOpenURLTab=a;
1.1055 -
1.1056 -a = new QAction( tr( "Open all URLs in subtree","Edit menu" ), this);
1.1057 -a->setStatusTip (tr( "Open all URLs in subtree" ));
1.1058 -a->setShortcut ( Qt::CTRL + Qt::Key_U );
1.1059 -addAction(a);
1.1060 -actionListBranches.append(a);
1.1061 -connect( a, SIGNAL( triggered() ), this, SLOT( editOpenMultipleURLTabs() ) );
1.1062 -actionOpenMultipleURLTabs=a;
1.1063 -
1.1064 -a = new QAction(QPixmap(), tr( "Edit URL...","Edit menu"), this);
1.1065 -a->setStatusTip ( tr( "Edit URL" ) );
1.1066 -a->setShortcut ( Qt::Key_U );
1.1067 -a->setShortcutContext (Qt::WindowShortcut);
1.1068 -actionListBranches.append(a);
1.1069 -addAction(a);
1.1070 -connect( a, SIGNAL( triggered() ), this, SLOT( editURL() ) );
1.1071 -actionURL=a;
1.1072 -
1.1073 -a = new QAction(QPixmap(), tr( "Edit local URL...","Edit menu"), this);
1.1074 -a->setStatusTip ( tr( "Edit local URL" ) );
1.1075 -//a->setShortcut (Qt::SHIFT + Qt::Key_U );
1.1076 -a->setShortcutContext (Qt::WindowShortcut);
1.1077 -actionListBranches.append(a);
1.1078 -addAction(a);
1.1079 -connect( a, SIGNAL( triggered() ), this, SLOT( editLocalURL() ) );
1.1080 -actionLocalURL=a;
1.1081 -
1.1082 -a = new QAction( tr( "Use heading for URL","Edit menu" ), this);
1.1083 -a->setStatusTip ( tr( "Use heading of selected branch as URL" ));
1.1084 -a->setEnabled (false);
1.1085 -actionListBranches.append(a);
1.1086 -connect( a, SIGNAL( triggered() ), this, SLOT( editHeading2URL() ) );
1.1087 -actionHeading2URL=a;
1.1088 -
1.1089 -a = new QAction(tr( "Create URL to Novell Bugzilla","Edit menu" ), this);
1.1090 -a->setStatusTip ( tr( "Create URL to Novell Bugzilla" ));
1.1091 -a->setEnabled (false);
1.1092 -actionListBranches.append(a);
1.1093 -a->setShortcut ( Qt::Key_B );
1.1094 -a->setShortcutContext (Qt::WindowShortcut);
1.1095 -addAction(a);
1.1096 -connect( a, SIGNAL( triggered() ), this, SLOT( editBugzilla2URL() ) );
1.1097 -actionBugzilla2URL=a;
1.1098 -
1.1099 -a = new QAction(tr( "Create URL to Novell FATE","Edit menu" ), this);
1.1100 -a->setStatusTip ( tr( "Create URL to Novell FATE" ));
1.1101 -a->setEnabled (false);
1.1102 -actionListBranches.append(a);
1.1103 -connect( a, SIGNAL( triggered() ), this, SLOT( editFATE2URL() ) );
1.1104 -actionFATE2URL=a;
1.1105 -
1.1106 -a = new QAction(QPixmap(flagsPath+"flag-vymlink.png"), tr( "Open linked map","Edit menu" ), this);
1.1107 -a->setStatusTip ( tr( "Jump to another vym map, if needed load it first" ));
1.1108 -tb->addAction (a);
1.1109 -a->setEnabled (false);
1.1110 -connect( a, SIGNAL( triggered() ), this, SLOT( editOpenVymLink() ) );
1.1111 -actionOpenVymLink=a;
1.1112 -
1.1113 -a = new QAction(QPixmap(), tr( "Open all vym links in subtree","Edit menu" ), this);
1.1114 -a->setStatusTip ( tr( "Open all vym links in subtree" ));
1.1115 -a->setEnabled (false);
1.1116 -actionListBranches.append(a);
1.1117 -connect( a, SIGNAL( triggered() ), this, SLOT( editOpenMultipleVymLinks() ) );
1.1118 -actionOpenMultipleVymLinks=a;
1.1119 -
1.1120 -
1.1121 -a = new QAction(tr( "Edit vym link...","Edit menu" ), this);
1.1122 -a->setEnabled (false);
1.1123 -a->setStatusTip ( tr( "Edit link to another vym map" ));
1.1124 -connect( a, SIGNAL( triggered() ), this, SLOT( editVymLink() ) );
1.1125 -actionListBranches.append(a);
1.1126 -actionVymLink=a;
1.1127 -
1.1128 -a = new QAction(tr( "Delete vym link","Edit menu" ),this);
1.1129 -a->setStatusTip ( tr( "Delete link to another vym map" ));
1.1130 -a->setEnabled (false);
1.1131 -connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteVymLink() ) );
1.1132 -actionDeleteVymLink=a;
1.1133 -
1.1134 -a = new QAction(QPixmap(flagsPath+"flag-hideexport.png"), tr( "Hide in exports","Edit menu" ), this);
1.1135 -a->setStatusTip ( tr( "Hide object in exports" ) );
1.1136 -a->setShortcut (Qt::Key_H );
1.1137 -a->setToggleAction(true);
1.1138 -tb->addAction (a);
1.1139 -a->setEnabled (false);
1.1140 -connect( a, SIGNAL( triggered() ), this, SLOT( editToggleHideExport() ) );
1.1141 -actionToggleHideExport=a;
1.1142 -
1.1143 -a = new QAction(tr( "Add timestamp","Edit menu" ), this);
1.1144 -a->setStatusTip ( tr( "Add timestamp" ));
1.1145 -a->setEnabled (false);
1.1146 -actionListBranches.append(a);
1.1147 -a->setShortcut ( Qt::Key_T ); // Add timestamp
1.1148 -a->setShortcutContext (Qt::WindowShortcut);
1.1149 -addAction(a);
1.1150 -connect( a, SIGNAL( triggered() ), this, SLOT( editAddTimestamp() ) );
1.1151 -actionAddTimestamp=a;
1.1152 -
1.1153 -a = new QAction(tr( "Edit Map Info...","Edit menu" ),this);
1.1154 -a->setStatusTip ( tr( "Edit Map Info" ));
1.1155 -a->setEnabled (true);
1.1156 -connect( a, SIGNAL( triggered() ), this, SLOT( editMapInfo() ) );
1.1157 -actionMapInfo=a;
1.1158 -
1.1159 -// Import at selection (adding to selection)
1.1160 -a = new QAction( tr( "Add map (insert)","Edit menu" ),this);
1.1161 -a->setStatusTip (tr( "Add map at selection" ));
1.1162 -connect( a, SIGNAL( triggered() ), this, SLOT( editImportAdd() ) );
1.1163 -a->setEnabled (false);
1.1164 -actionListBranches.append(a);
1.1165 -actionImportAdd=a;
1.1166 -
1.1167 -// Import at selection (replacing selection)
1.1168 -a = new QAction( tr( "Add map (replace)","Edit menu" ), this);
1.1169 -a->setStatusTip (tr( "Replace selection with map" ));
1.1170 -connect( a, SIGNAL( triggered() ), this, SLOT( editImportReplace() ) );
1.1171 -a->setEnabled (false);
1.1172 -actionListBranches.append(a);
1.1173 -actionImportReplace=a;
1.1174 -
1.1175 -// Save selection
1.1176 -a = new QAction( tr( "Save selection","Edit menu" ), this);
1.1177 -a->setStatusTip (tr( "Save selection" ));
1.1178 -connect( a, SIGNAL( triggered() ), this, SLOT( editSaveBranch() ) );
1.1179 -a->setEnabled (false);
1.1180 -actionListBranches.append(a);
1.1181 -actionSaveBranch=a;
1.1182 -
1.1183 -// Only remove branch, not its children
1.1184 -a = new QAction(tr( "Remove only branch ","Edit menu" ), this);
1.1185 -a->setStatusTip ( tr( "Remove only branch and keep its children" ));
1.1186 -a->setShortcut (Qt::ALT + Qt::Key_Delete );
1.1187 -connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteKeepChildren() ) );
1.1188 -a->setEnabled (false);
1.1189 -addAction (a);
1.1190 -actionListBranches.append(a);
1.1191 -actionDeleteKeepChildren=a;
1.1192 -
1.1193 -// Only remove children of a branch
1.1194 -a = new QAction( tr( "Remove children","Edit menu" ), this);
1.1195 -a->setStatusTip (tr( "Remove children of branch" ));
1.1196 -a->setShortcut (Qt::SHIFT + Qt::Key_Delete );
1.1197 -connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteChildren() ) );
1.1198 -a->setEnabled (false);
1.1199 -actionListBranches.append(a);
1.1200 -actionDeleteChildren=a;
1.1201 -
1.1202 -a = new QAction( tr( "Add Image...","Edit menu" ), this);
1.1203 -a->setStatusTip (tr( "Add Image" ));
1.1204 -connect( a, SIGNAL( triggered() ), this, SLOT( editLoadImage() ) );
1.1205 -actionLoadImage=a;
1.1206 -
1.1207 -a = new QAction( tr( "Property window","Dialog to edit properties of selection" )+QString ("..."), this);
1.1208 -a->setStatusTip (tr( "Set properties for selection" ));
1.1209 -a->setShortcut ( Qt::CTRL + Qt::Key_I ); //Property window
1.1210 -a->setShortcutContext (Qt::WindowShortcut);
1.1211 -a->setToggleAction (true);
1.1212 -addAction (a);
1.1213 -connect( a, SIGNAL( triggered() ), this, SLOT( windowToggleProperty() ) );
1.1214 -actionViewTogglePropertyWindow=a;
1.1215 + QToolBar *tb = addToolBar( tr ("&Actions toolbar","Toolbar name") );
1.1216 + tb->setLabel( "Edit Actions" );
1.1217 + tb->setObjectName ("actionsTB");
1.1218 + QMenu *editMenu = menuBar()->addMenu( tr("&Edit","Edit menu") );
1.1219 +
1.1220 + QAction *a;
1.1221 + QAction *alt;
1.1222 + a = new QAction( QPixmap( iconPath+"undo.png"), tr( "&Undo","Edit menu" ),this);
1.1223 + connect( a, SIGNAL( triggered() ), this, SLOT( editUndo() ) );
1.1224 + a->setStatusTip (tr( "Undo" ) );
1.1225 + a->setShortcut ( Qt::CTRL + Qt::Key_Z ); //Undo last action
1.1226 + a->setEnabled (false);
1.1227 + tb->addAction (a);
1.1228 + editMenu->addAction (a);
1.1229 + actionUndo=a;
1.1230 +
1.1231 + a = new QAction( QPixmap( iconPath+"redo.png"), tr( "&Redo","Edit menu" ), this);
1.1232 + a->setStatusTip (tr( "Redo" ));
1.1233 + a->setShortcut (Qt::CTRL + Qt::Key_Y ); //Redo last action
1.1234 + tb->addAction (a);
1.1235 + editMenu->addAction (a);
1.1236 + connect( a, SIGNAL( triggered() ), this, SLOT( editRedo() ) );
1.1237 + actionRedo=a;
1.1238 +
1.1239 + editMenu->addSeparator();
1.1240 + a = new QAction(QPixmap( iconPath+"editcopy.png"), tr( "&Copy","Edit menu" ), this);
1.1241 + a->setStatusTip ( tr( "Copy" ) );
1.1242 + a->setShortcut (Qt::CTRL + Qt::Key_C ); //Copy
1.1243 + a->setEnabled (false);
1.1244 + tb->addAction (a);
1.1245 + editMenu->addAction (a);
1.1246 + connect( a, SIGNAL( triggered() ), this, SLOT( editCopy() ) );
1.1247 + actionCopy=a;
1.1248 +
1.1249 + a = new QAction(QPixmap( iconPath+"editcut.png" ), tr( "Cu&t","Edit menu" ), this);
1.1250 + a->setStatusTip ( tr( "Cut" ) );
1.1251 + a->setShortcut (Qt::CTRL + Qt::Key_X ); //Cut
1.1252 + a->setEnabled (false);
1.1253 + tb->addAction (a);
1.1254 + editMenu->addAction (a);
1.1255 + actionCut=a;
1.1256 + connect( a, SIGNAL( triggered() ), this, SLOT( editCut() ) );
1.1257 +
1.1258 + a = new QAction(QPixmap( iconPath+"editpaste.png"), tr( "&Paste","Edit menu" ),this);
1.1259 + connect( a, SIGNAL( triggered() ), this, SLOT( editPaste() ) );
1.1260 + a->setStatusTip ( tr( "Paste" ) );
1.1261 + a->setShortcut ( Qt::CTRL + Qt::Key_V ); //Paste
1.1262 + a->setEnabled (false);
1.1263 + tb->addAction (a);
1.1264 + editMenu->addAction (a);
1.1265 + actionPaste=a;
1.1266 +
1.1267 + // Shortcut to delete selection
1.1268 + a = new QAction( tr( "Delete Selection","Edit menu" ),this);
1.1269 + a->setStatusTip (tr( "Delete Selection" ));
1.1270 + a->setShortcut ( Qt::Key_Delete); //Delete selection
1.1271 + a->setShortcutContext (Qt::WindowShortcut);
1.1272 + addAction (a);
1.1273 + connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteSelection() ) );
1.1274 + actionDelete=a;
1.1275 +
1.1276 + // Shortcut to add attribute
1.1277 + a= new QAction(tr( "Add attribute" ), this);
1.1278 + a->setShortcut ( Qt::Key_Q);
1.1279 + a->setShortcutContext (Qt::WindowShortcut);
1.1280 + addAction (a);
1.1281 + connect( a, SIGNAL( triggered() ), this, SLOT( editAddAttribute() ) );
1.1282 + actionAddAttribute= a;
1.1283 +
1.1284 +
1.1285 + // Shortcut to add mapcenter
1.1286 + a= new QAction(QPixmap(iconPath+"newmapcenter.png"),tr( "Add mapcenter","Canvas context menu" ), this);
1.1287 + a->setShortcut ( Qt::Key_M);
1.1288 + a->setShortcutContext (Qt::WindowShortcut);
1.1289 + connect( a, SIGNAL( triggered() ), this, SLOT( editAddMapCenter() ) );
1.1290 + //actionListBranches.append(a);
1.1291 + tb->addAction (a);
1.1292 + actionAddMapCenter = a;
1.1293 +
1.1294 +
1.1295 + // Shortcut to add branch
1.1296 + alt = new QAction(QPixmap(iconPath+"newbranch.png"), tr( "Add branch as child","Edit menu" ), this);
1.1297 + alt->setStatusTip ( tr( "Add a branch as child of selection" ));
1.1298 + alt->setShortcut (Qt::Key_A); //Add branch
1.1299 + alt->setShortcutContext (Qt::WindowShortcut);
1.1300 + addAction (alt);
1.1301 + connect( alt, SIGNAL( triggered() ), this, SLOT( editNewBranch() ) );
1.1302 + a = new QAction(QPixmap(iconPath+"newbranch.png"), tr( "Add branch as child","Edit menu" ), this);
1.1303 + a->setStatusTip ( tr( "Add a branch as child of selection" ));
1.1304 + a->setShortcut (Qt::Key_Insert); //Add branch
1.1305 + connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranch() ) );
1.1306 + actionListBranches.append(a);
1.1307 + #if defined (Q_OS_MACX)
1.1308 + // In OSX show different shortcut in menues, the keys work indepently always
1.1309 + actionAddBranch=alt;
1.1310 + #else
1.1311 + actionAddBranch=a;
1.1312 + #endif
1.1313 + editMenu->addAction (actionAddBranch);
1.1314 + tb->addAction (actionAddBranch);
1.1315 +
1.1316 +
1.1317 + // Add branch by inserting it at selection
1.1318 + a = new QAction(tr( "Add branch (insert)","Edit menu" ), this);
1.1319 + a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" ));
1.1320 + a->setShortcut (Qt::ALT + Qt::Key_Insert ); //Insert branch
1.1321 + a->setShortcutContext (Qt::WindowShortcut);
1.1322 + addAction (a);
1.1323 + connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBefore() ) );
1.1324 + a->setEnabled (false);
1.1325 + actionListBranches.append(a);
1.1326 + actionAddBranchBefore=a;
1.1327 + a = new QAction(tr( "Add branch (insert)","Edit menu" ),this);
1.1328 + a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" ));
1.1329 + a->setShortcut ( Qt::ALT + Qt::Key_A ); //Insert branch
1.1330 + a->setShortcutContext (Qt::WindowShortcut);
1.1331 + addAction (a);
1.1332 + connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBefore() ) );
1.1333 + actionListBranches.append(a);
1.1334 +
1.1335 + // Add branch above
1.1336 + a = new QAction(tr( "Add branch above","Edit menu" ), this);
1.1337 + a->setStatusTip ( tr( "Add a branch above selection" ));
1.1338 + a->setShortcut (Qt::SHIFT+Qt::Key_Insert ); //Add branch above
1.1339 + a->setShortcutContext (Qt::WindowShortcut);
1.1340 + addAction (a);
1.1341 + connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchAbove() ) );
1.1342 + a->setEnabled (false);
1.1343 + actionListBranches.append(a);
1.1344 + actionAddBranchAbove=a;
1.1345 + a = new QAction(tr( "Add branch above","Edit menu" ), this);
1.1346 + a->setStatusTip ( tr( "Add a branch above selection" ));
1.1347 + a->setShortcut (Qt::SHIFT+Qt::Key_A ); //Add branch above
1.1348 + a->setShortcutContext (Qt::WindowShortcut);
1.1349 + addAction (a);
1.1350 + connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchAbove() ) );
1.1351 + actionListBranches.append(a);
1.1352 +
1.1353 + // Add branch below
1.1354 + a = new QAction(tr( "Add branch below","Edit menu" ), this);
1.1355 + a->setStatusTip ( tr( "Add a branch below selection" ));
1.1356 + a->setShortcut (Qt::CTRL +Qt::Key_Insert ); //Add branch below
1.1357 + a->setShortcutContext (Qt::WindowShortcut);
1.1358 + addAction (a);
1.1359 + connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBelow() ) );
1.1360 + a->setEnabled (false);
1.1361 + actionListBranches.append(a);
1.1362 + actionAddBranchBelow=a;
1.1363 + a = new QAction(tr( "Add branch below","Edit menu" ), this);
1.1364 + a->setStatusTip ( tr( "Add a branch below selection" ));
1.1365 + a->setShortcut (Qt::CTRL +Qt::Key_A ); // Add branch below
1.1366 + a->setShortcutContext (Qt::WindowShortcut);
1.1367 + addAction (a);
1.1368 + connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBelow() ) );
1.1369 + actionListBranches.append(a);
1.1370 +
1.1371 + a = new QAction(QPixmap(iconPath+"up.png" ), tr( "Move up","Edit menu" ), this);
1.1372 + a->setStatusTip ( tr( "Move branch up" ) );
1.1373 + a->setShortcut (Qt::Key_PageUp ); // Move branch up
1.1374 + a->setEnabled (false);
1.1375 + tb->addAction (a);
1.1376 + editMenu->addAction (a);
1.1377 + connect( a, SIGNAL( triggered() ), this, SLOT( editMoveUp() ) );
1.1378 + actionMoveUp=a;
1.1379 +
1.1380 + a = new QAction( QPixmap( iconPath+"down.png"), tr( "Move down","Edit menu" ),this);
1.1381 + connect( a, SIGNAL( triggered() ), this, SLOT( editMoveDown() ) );
1.1382 + a->setStatusTip (tr( "Move branch down" ) );
1.1383 + a->setShortcut ( Qt::Key_PageDown ); // Move branch down
1.1384 + a->setEnabled (false);
1.1385 + tb->addAction (a);
1.1386 + editMenu->addAction (a);
1.1387 + actionMoveDown=a;
1.1388 +
1.1389 + a = new QAction(QPixmap(), tr( "&Detach","Context menu" ),this);
1.1390 + a->setStatusTip ( tr( "Detach branch and use as mapcenter","Context menu" ) );
1.1391 + a->setShortcut ( Qt::Key_D ); // Detach branch
1.1392 + editMenu->addAction (a);
1.1393 + connect( a, SIGNAL( triggered() ), this, SLOT( editDetach() ) );
1.1394 + actionDetach=a;
1.1395 +
1.1396 + a = new QAction( QPixmap(iconPath+"editsort.png" ), tr( "Sort children","Edit menu" ), this );
1.1397 + connect( a, SIGNAL( activated() ), this, SLOT( editSortChildren() ) );
1.1398 + a->setEnabled (true);
1.1399 + a->addTo( tb );
1.1400 + editMenu->addAction (a);
1.1401 + actionSortChildren=a;
1.1402 +
1.1403 + alt = new QAction( QPixmap(flagsPath+"flag-scrolled-right.png"), tr( "Scroll branch","Edit menu" ), this);
1.1404 + alt->setShortcut ( Qt::Key_S ); // Scroll branch
1.1405 + alt->setStatusTip (tr( "Scroll branch" ));
1.1406 + connect( alt, SIGNAL( triggered() ), this, SLOT( editToggleScroll() ) );
1.1407 + #if defined(Q_OS_MACX)
1.1408 + actionToggleScroll=alt;
1.1409 + #else
1.1410 + actionToggleScroll=a;
1.1411 + #endif
1.1412 + actionToggleScroll->setEnabled (false);
1.1413 + actionToggleScroll->setToggleAction(true);
1.1414 + tb->addAction (actionToggleScroll);
1.1415 + editMenu->addAction ( actionToggleScroll);
1.1416 + editMenu->addAction (actionToggleScroll);
1.1417 + addAction (a);
1.1418 + addAction (alt);
1.1419 + actionListBranches.append(actionToggleScroll);
1.1420 +
1.1421 + a = new QAction( QPixmap(), tr( "Expand all branches","Edit menu" ), this);
1.1422 + a->setShortcut ( Qt::SHIFT + Qt::Key_X ); // Expand all branches
1.1423 + a->setStatusTip (tr( "Expand all branches" ));
1.1424 + connect( a, SIGNAL( triggered() ), this, SLOT( editExpandAll() ) );
1.1425 + actionExpandAll=a;
1.1426 + actionExpandAll->setEnabled (false);
1.1427 + actionExpandAll->setToggleAction(false);
1.1428 + //tb->addAction (actionExpandAll);
1.1429 + editMenu->addAction ( actionExpandAll);
1.1430 + addAction (a);
1.1431 + actionListBranches.append(actionExpandAll);
1.1432 +
1.1433 + a = new QAction( QPixmap(), tr( "Expand one level","Edit menu" ), this);
1.1434 + a->setShortcut ( Qt::Key_Greater ); // Expand one level in tree editor
1.1435 + a->setStatusTip (tr( "Expand one level in tree editor" ));
1.1436 + connect( a, SIGNAL( triggered() ), this, SLOT( editExpandOneLevel() ) );
1.1437 + a->setEnabled (false);
1.1438 + a->setToggleAction(false);
1.1439 + actionExpandOneLevel=a;
1.1440 + //tb->addAction (a);
1.1441 + editMenu->addAction ( a);
1.1442 + addAction (a);
1.1443 + actionListBranches.append(a);
1.1444 +
1.1445 + a = new QAction( QPixmap(), tr( "Collapse one level","Edit menu" ), this);
1.1446 + a->setShortcut ( Qt::Key_Less); // Collapse one level in tree editor
1.1447 + a->setStatusTip (tr( "Collapse one level in tree editor" ));
1.1448 + connect( a, SIGNAL( triggered() ), this, SLOT( editCollapseOneLevel() ) );
1.1449 + a->setEnabled (false);
1.1450 + a->setToggleAction(false);
1.1451 + actionCollapseOneLevel=a;
1.1452 + //tb->addAction (a);
1.1453 + editMenu->addAction ( a);
1.1454 + addAction (a);
1.1455 + actionListBranches.append(a);
1.1456 +
1.1457 + a = new QAction( tr( "Unscroll children","Edit menu" ), this);
1.1458 + a->setStatusTip (tr( "Unscroll all scrolled branches in selected subtree" ));
1.1459 + editMenu->addAction (a);
1.1460 + connect( a, SIGNAL( triggered() ), this, SLOT( editUnscrollChildren() ) );
1.1461 +
1.1462 + editMenu->addSeparator();
1.1463 +
1.1464 + a = new QAction( QPixmap(iconPath+"find.png"), tr( "Find...","Edit menu"), this);
1.1465 + a->setStatusTip (tr( "Find" ) );
1.1466 + a->setShortcut (Qt::CTRL + Qt::Key_F ); //Find
1.1467 + editMenu->addAction (a);
1.1468 + connect( a, SIGNAL( triggered() ), this, SLOT( editOpenFindWidget() ) );
1.1469 +
1.1470 + editMenu->addSeparator();
1.1471 +
1.1472 + a = new QAction( QPixmap(flagsPath+"flag-url.png"), tr( "Open URL","Edit menu" ), this);
1.1473 + a->setShortcut (Qt::SHIFT + Qt::Key_U );
1.1474 + a->setShortcut (tr( "Open URL" ));
1.1475 + tb->addAction (a);
1.1476 + addAction(a);
1.1477 + connect( a, SIGNAL( triggered() ), this, SLOT( editOpenURL() ) );
1.1478 + actionOpenURL=a;
1.1479 +
1.1480 + a = new QAction( tr( "Open URL in new tab","Edit menu" ), this);
1.1481 + a->setStatusTip (tr( "Open URL in new tab" ));
1.1482 + //a->setShortcut (Qt::CTRL+Qt::Key_U );
1.1483 + addAction(a);
1.1484 + connect( a, SIGNAL( triggered() ), this, SLOT( editOpenURLTab() ) );
1.1485 + actionOpenURLTab=a;
1.1486 +
1.1487 + a = new QAction( tr( "Open all URLs in subtree","Edit menu" ), this);
1.1488 + a->setStatusTip (tr( "Open all URLs in subtree" ));
1.1489 + a->setShortcut ( Qt::CTRL + Qt::Key_U );
1.1490 + addAction(a);
1.1491 + actionListBranches.append(a);
1.1492 + connect( a, SIGNAL( triggered() ), this, SLOT( editOpenMultipleURLTabs() ) );
1.1493 + actionOpenMultipleURLTabs=a;
1.1494 +
1.1495 + a = new QAction(QPixmap(), tr( "Edit URL...","Edit menu"), this);
1.1496 + a->setStatusTip ( tr( "Edit URL" ) );
1.1497 + a->setShortcut ( Qt::Key_U );
1.1498 + a->setShortcutContext (Qt::WindowShortcut);
1.1499 + actionListBranches.append(a);
1.1500 + addAction(a);
1.1501 + connect( a, SIGNAL( triggered() ), this, SLOT( editURL() ) );
1.1502 + actionURL=a;
1.1503 +
1.1504 + a = new QAction(QPixmap(), tr( "Edit local URL...","Edit menu"), this);
1.1505 + a->setStatusTip ( tr( "Edit local URL" ) );
1.1506 + //a->setShortcut (Qt::SHIFT + Qt::Key_U );
1.1507 + a->setShortcutContext (Qt::WindowShortcut);
1.1508 + actionListBranches.append(a);
1.1509 + addAction(a);
1.1510 + connect( a, SIGNAL( triggered() ), this, SLOT( editLocalURL() ) );
1.1511 + actionLocalURL=a;
1.1512 +
1.1513 + a = new QAction( tr( "Use heading for URL","Edit menu" ), this);
1.1514 + a->setStatusTip ( tr( "Use heading of selected branch as URL" ));
1.1515 + a->setEnabled (false);
1.1516 + actionListBranches.append(a);
1.1517 + connect( a, SIGNAL( triggered() ), this, SLOT( editHeading2URL() ) );
1.1518 + actionHeading2URL=a;
1.1519 +
1.1520 + a = new QAction(tr( "Create URL to Novell Bugzilla","Edit menu" ), this);
1.1521 + a->setStatusTip ( tr( "Create URL to Novell Bugzilla" ));
1.1522 + a->setEnabled (false);
1.1523 + actionListBranches.append(a);
1.1524 + a->setShortcut ( Qt::Key_B );
1.1525 + a->setShortcutContext (Qt::WindowShortcut);
1.1526 + addAction(a);
1.1527 + connect( a, SIGNAL( triggered() ), this, SLOT( editBugzilla2URL() ) );
1.1528 + actionBugzilla2URL=a;
1.1529 +
1.1530 + a = new QAction(tr( "Create URL to Novell FATE","Edit menu" ), this);
1.1531 + a->setStatusTip ( tr( "Create URL to Novell FATE" ));
1.1532 + a->setEnabled (false);
1.1533 + actionListBranches.append(a);
1.1534 + connect( a, SIGNAL( triggered() ), this, SLOT( editFATE2URL() ) );
1.1535 + actionFATE2URL=a;
1.1536 +
1.1537 + a = new QAction(QPixmap(flagsPath+"flag-vymlink.png"), tr( "Open linked map","Edit menu" ), this);
1.1538 + a->setStatusTip ( tr( "Jump to another vym map, if needed load it first" ));
1.1539 + tb->addAction (a);
1.1540 + a->setEnabled (false);
1.1541 + connect( a, SIGNAL( triggered() ), this, SLOT( editOpenVymLink() ) );
1.1542 + actionOpenVymLink=a;
1.1543 +
1.1544 + a = new QAction(QPixmap(), tr( "Open all vym links in subtree","Edit menu" ), this);
1.1545 + a->setStatusTip ( tr( "Open all vym links in subtree" ));
1.1546 + a->setEnabled (false);
1.1547 + actionListBranches.append(a);
1.1548 + connect( a, SIGNAL( triggered() ), this, SLOT( editOpenMultipleVymLinks() ) );
1.1549 + actionOpenMultipleVymLinks=a;
1.1550 +
1.1551 +
1.1552 + a = new QAction(tr( "Edit vym link...","Edit menu" ), this);
1.1553 + a->setEnabled (false);
1.1554 + a->setStatusTip ( tr( "Edit link to another vym map" ));
1.1555 + connect( a, SIGNAL( triggered() ), this, SLOT( editVymLink() ) );
1.1556 + actionListBranches.append(a);
1.1557 + actionVymLink=a;
1.1558 +
1.1559 + a = new QAction(tr( "Delete vym link","Edit menu" ),this);
1.1560 + a->setStatusTip ( tr( "Delete link to another vym map" ));
1.1561 + a->setEnabled (false);
1.1562 + connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteVymLink() ) );
1.1563 + actionDeleteVymLink=a;
1.1564 +
1.1565 + a = new QAction(QPixmap(flagsPath+"flag-hideexport.png"), tr( "Hide in exports","Edit menu" ), this);
1.1566 + a->setStatusTip ( tr( "Hide object in exports" ) );
1.1567 + a->setShortcut (Qt::Key_H );
1.1568 + a->setToggleAction(true);
1.1569 + tb->addAction (a);
1.1570 + a->setEnabled (false);
1.1571 + connect( a, SIGNAL( triggered() ), this, SLOT( editToggleHideExport() ) );
1.1572 + actionToggleHideExport=a;
1.1573 +
1.1574 + a = new QAction(tr( "Add timestamp","Edit menu" ), this);
1.1575 + a->setStatusTip ( tr( "Add timestamp" ));
1.1576 + a->setEnabled (false);
1.1577 + actionListBranches.append(a);
1.1578 + a->setShortcut ( Qt::Key_T ); // Add timestamp
1.1579 + a->setShortcutContext (Qt::WindowShortcut);
1.1580 + addAction(a);
1.1581 + connect( a, SIGNAL( triggered() ), this, SLOT( editAddTimestamp() ) );
1.1582 + actionAddTimestamp=a;
1.1583 +
1.1584 + a = new QAction(tr( "Edit Map Info...","Edit menu" ),this);
1.1585 + a->setStatusTip ( tr( "Edit Map Info" ));
1.1586 + a->setEnabled (true);
1.1587 + connect( a, SIGNAL( triggered() ), this, SLOT( editMapInfo() ) );
1.1588 + actionMapInfo=a;
1.1589 +
1.1590 + // Import at selection (adding to selection)
1.1591 + a = new QAction( tr( "Add map (insert)","Edit menu" ),this);
1.1592 + a->setStatusTip (tr( "Add map at selection" ));
1.1593 + connect( a, SIGNAL( triggered() ), this, SLOT( editImportAdd() ) );
1.1594 + a->setEnabled (false);
1.1595 + actionListBranches.append(a);
1.1596 + actionImportAdd=a;
1.1597 +
1.1598 + // Import at selection (replacing selection)
1.1599 + a = new QAction( tr( "Add map (replace)","Edit menu" ), this);
1.1600 + a->setStatusTip (tr( "Replace selection with map" ));
1.1601 + connect( a, SIGNAL( triggered() ), this, SLOT( editImportReplace() ) );
1.1602 + a->setEnabled (false);
1.1603 + actionListBranches.append(a);
1.1604 + actionImportReplace=a;
1.1605 +
1.1606 + // Save selection
1.1607 + a = new QAction( tr( "Save selection","Edit menu" ), this);
1.1608 + a->setStatusTip (tr( "Save selection" ));
1.1609 + connect( a, SIGNAL( triggered() ), this, SLOT( editSaveBranch() ) );
1.1610 + a->setEnabled (false);
1.1611 + actionListBranches.append(a);
1.1612 + actionSaveBranch=a;
1.1613 +
1.1614 + // Only remove branch, not its children
1.1615 + a = new QAction(tr( "Remove only branch ","Edit menu" ), this);
1.1616 + a->setStatusTip ( tr( "Remove only branch and keep its children" ));
1.1617 + a->setShortcut (Qt::ALT + Qt::Key_Delete );
1.1618 + connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteKeepChildren() ) );
1.1619 + a->setEnabled (false);
1.1620 + addAction (a);
1.1621 + actionListBranches.append(a);
1.1622 + actionDeleteKeepChildren=a;
1.1623 +
1.1624 + // Only remove children of a branch
1.1625 + a = new QAction( tr( "Remove children","Edit menu" ), this);
1.1626 + a->setStatusTip (tr( "Remove children of branch" ));
1.1627 + a->setShortcut (Qt::SHIFT + Qt::Key_Delete );
1.1628 + connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteChildren() ) );
1.1629 + a->setEnabled (false);
1.1630 + actionListBranches.append(a);
1.1631 + actionDeleteChildren=a;
1.1632 +
1.1633 + a = new QAction( tr( "Add Image...","Edit menu" ), this);
1.1634 + a->setStatusTip (tr( "Add Image" ));
1.1635 + connect( a, SIGNAL( triggered() ), this, SLOT( editLoadImage() ) );
1.1636 + actionLoadImage=a;
1.1637 +
1.1638 + a = new QAction( tr( "Property window","Dialog to edit properties of selection" )+QString ("..."), this);
1.1639 + a->setStatusTip (tr( "Set properties for selection" ));
1.1640 + a->setShortcut ( Qt::CTRL + Qt::Key_I ); //Property window
1.1641 + a->setShortcutContext (Qt::WindowShortcut);
1.1642 + a->setToggleAction (true);
1.1643 + addAction (a);
1.1644 + connect( a, SIGNAL( triggered() ), this, SLOT( windowToggleProperty() ) );
1.1645 + actionViewTogglePropertyWindow=a;
1.1646 }
1.1647
1.1648 // Format Actions
1.1649 void Main::setupFormatActions()
1.1650 {
1.1651 -QMenu *formatMenu = menuBar()->addMenu (tr ("F&ormat","Format menu"));
1.1652 -
1.1653 -QToolBar *tb = addToolBar( tr("Format Actions","Format Toolbar name"));
1.1654 -tb->setObjectName ("formatTB");
1.1655 -QAction *a;
1.1656 -QPixmap pix( 16,16);
1.1657 -pix.fill (Qt::black);
1.1658 -a= new QAction(pix, tr( "Set &Color" )+QString("..."), this);
1.1659 -a->setStatusTip ( tr( "Set Color" ));
1.1660 -connect( a, SIGNAL( triggered() ), this, SLOT( formatSelectColor() ) );
1.1661 -a->addTo( tb );
1.1662 -formatMenu->addAction (a);
1.1663 -actionFormatColor=a;
1.1664 -a= new QAction( QPixmap(iconPath+"formatcolorpicker.png"), tr( "Pic&k color","Edit menu" ), this);
1.1665 -a->setStatusTip (tr( "Pick color\nHint: You can pick a color from another branch and color using CTRL+Left Button" ) );
1.1666 -a->setShortcut (Qt::CTRL + Qt::Key_K );
1.1667 -connect( a, SIGNAL( triggered() ), this, SLOT( formatPickColor() ) );
1.1668 -a->setEnabled (false);
1.1669 -a->addTo( tb );
1.1670 -formatMenu->addAction (a);
1.1671 -actionListBranches.append(a);
1.1672 -actionFormatPickColor=a;
1.1673 -
1.1674 -a= new QAction(QPixmap(iconPath+"formatcolorbranch.png"), tr( "Color &branch","Edit menu" ), this);
1.1675 -a->setStatusTip ( tr( "Color branch" ) );
1.1676 -a->setShortcut (Qt::CTRL + Qt::Key_B);
1.1677 -connect( a, SIGNAL( triggered() ), this, SLOT( formatColorBranch() ) );
1.1678 -a->setEnabled (false);
1.1679 -a->addTo( tb );
1.1680 -formatMenu->addAction (a);
1.1681 -actionListBranches.append(a);
1.1682 -actionFormatColorSubtree=a;
1.1683 -
1.1684 -a= new QAction(QPixmap(iconPath+"formatcolorsubtree.png"), tr( "Color sub&tree","Edit menu" ), this);
1.1685 -a->setStatusTip ( tr( "Color Subtree" ));
1.1686 -//FIXME-2 switch back to that a->setShortcut (Qt::CTRL + Qt::Key_T); // Color subtree
1.1687 -connect( a, SIGNAL( triggered() ), this, SLOT( formatColorSubtree() ) );
1.1688 -a->setEnabled (false);
1.1689 -formatMenu->addAction (a);
1.1690 -a->addTo( tb );
1.1691 -actionListBranches.append(a);
1.1692 -actionFormatColorSubtree=a;
1.1693 -
1.1694 -formatMenu->addSeparator();
1.1695 -actionGroupFormatLinkStyles=new QActionGroup ( this);
1.1696 -actionGroupFormatLinkStyles->setExclusive (true);
1.1697 -a= new QAction( tr( "Linkstyle Line" ), actionGroupFormatLinkStyles);
1.1698 -a->setStatusTip (tr( "Line" ));
1.1699 -a->setToggleAction(true);
1.1700 -connect( a, SIGNAL( triggered() ), this, SLOT( formatLinkStyleLine() ) );
1.1701 -formatMenu->addAction (a);
1.1702 -actionFormatLinkStyleLine=a;
1.1703 -a= new QAction( tr( "Linkstyle Curve" ), actionGroupFormatLinkStyles);
1.1704 -a->setStatusTip (tr( "Line" ));
1.1705 -a->setToggleAction(true);
1.1706 -connect( a, SIGNAL( triggered() ), this, SLOT( formatLinkStyleParabel() ) );
1.1707 -formatMenu->addAction (a);
1.1708 -actionFormatLinkStyleParabel=a;
1.1709 -a= new QAction( tr( "Linkstyle Thick Line" ), actionGroupFormatLinkStyles );
1.1710 -a->setStatusTip (tr( "PolyLine" ));
1.1711 -a->setToggleAction(true);
1.1712 -connect( a, SIGNAL( triggered() ), this, SLOT( formatLinkStylePolyLine() ) );
1.1713 -formatMenu->addAction (a);
1.1714 -actionFormatLinkStylePolyLine=a;
1.1715 -a= new QAction( tr( "Linkstyle Thick Curve" ), actionGroupFormatLinkStyles);
1.1716 -a->setStatusTip (tr( "PolyParabel" ) );
1.1717 -a->setToggleAction(true);
1.1718 -a->setChecked (true);
1.1719 -connect( a, SIGNAL( triggered() ), this, SLOT( formatLinkStylePolyParabel() ) );
1.1720 -formatMenu->addAction (a);
1.1721 -actionFormatLinkStylePolyParabel=a;
1.1722 -
1.1723 -a = new QAction( tr( "Hide link if object is not selected","Branch attribute" ), this);
1.1724 -a->setStatusTip (tr( "Hide link" ));
1.1725 -a->setToggleAction(true);
1.1726 -connect( a, SIGNAL( triggered() ), this, SLOT( formatHideLinkUnselected() ) );
1.1727 -actionFormatHideLinkUnselected=a;
1.1728 -
1.1729 -formatMenu->addSeparator();
1.1730 -a= new QAction( tr( "&Use color of heading for link","Branch attribute" ), this);
1.1731 -a->setStatusTip (tr( "Use same color for links and headings" ));
1.1732 -a->setToggleAction(true);
1.1733 -connect( a, SIGNAL( triggered() ), this, SLOT( formatToggleLinkColorHint() ) );
1.1734 -formatMenu->addAction (a);
1.1735 -actionFormatLinkColorHint=a;
1.1736 -
1.1737 -pix.fill (Qt::white);
1.1738 -a= new QAction( pix, tr( "Set &Link Color"+QString("...") ), this );
1.1739 -a->setStatusTip (tr( "Set Link Color" ));
1.1740 -formatMenu->addAction (a);
1.1741 -connect( a, SIGNAL( triggered() ), this, SLOT( formatSelectLinkColor() ) );
1.1742 -actionFormatLinkColor=a;
1.1743 -
1.1744 -a= new QAction( pix, tr( "Set &Selection Color"+QString("...") ), this );
1.1745 -a->setStatusTip (tr( "Set Selection Color" ));
1.1746 -formatMenu->addAction (a);
1.1747 -connect( a, SIGNAL( triggered() ), this, SLOT( formatSelectSelectionColor() ) );
1.1748 -actionFormatSelectionColor=a;
1.1749 -
1.1750 -a= new QAction( pix, tr( "Set &Background Color" )+QString("..."), this );
1.1751 -a->setStatusTip (tr( "Set Background Color" ));
1.1752 -formatMenu->addAction (a);
1.1753 -connect( a, SIGNAL( triggered() ), this, SLOT( formatSelectBackColor() ) );
1.1754 -actionFormatBackColor=a;
1.1755 -
1.1756 -a= new QAction( pix, tr( "Set &Background image" )+QString("..."), this );
1.1757 -a->setStatusTip (tr( "Set Background image" ));
1.1758 -formatMenu->addAction (a);
1.1759 -connect( a, SIGNAL( triggered() ), this, SLOT( formatSelectBackImage() ) );
1.1760 -actionFormatBackImage=a;
1.1761 + QMenu *formatMenu = menuBar()->addMenu (tr ("F&ormat","Format menu"));
1.1762 +
1.1763 + QToolBar *tb = addToolBar( tr("Format Actions","Format Toolbar name"));
1.1764 + tb->setObjectName ("formatTB");
1.1765 + QAction *a;
1.1766 + QPixmap pix( 16,16);
1.1767 + pix.fill (Qt::black);
1.1768 + a= new QAction(pix, tr( "Set &Color" )+QString("..."), this);
1.1769 + a->setStatusTip ( tr( "Set Color" ));
1.1770 + connect( a, SIGNAL( triggered() ), this, SLOT( formatSelectColor() ) );
1.1771 + a->addTo( tb );
1.1772 + formatMenu->addAction (a);
1.1773 + actionFormatColor=a;
1.1774 + a= new QAction( QPixmap(iconPath+"formatcolorpicker.png"), tr( "Pic&k color","Edit menu" ), this);
1.1775 + a->setStatusTip (tr( "Pick color\nHint: You can pick a color from another branch and color using CTRL+Left Button" ) );
1.1776 + a->setShortcut (Qt::CTRL + Qt::Key_K );
1.1777 + connect( a, SIGNAL( triggered() ), this, SLOT( formatPickColor() ) );
1.1778 + a->setEnabled (false);
1.1779 + a->addTo( tb );
1.1780 + formatMenu->addAction (a);
1.1781 + actionListBranches.append(a);
1.1782 + actionFormatPickColor=a;
1.1783 +
1.1784 + a= new QAction(QPixmap(iconPath+"formatcolorbranch.png"), tr( "Color &branch","Edit menu" ), this);
1.1785 + a->setStatusTip ( tr( "Color branch" ) );
1.1786 + a->setShortcut (Qt::CTRL + Qt::Key_B);
1.1787 + connect( a, SIGNAL( triggered() ), this, SLOT( formatColorBranch() ) );
1.1788 + a->setEnabled (false);
1.1789 + a->addTo( tb );
1.1790 + formatMenu->addAction (a);
1.1791 + actionListBranches.append(a);
1.1792 + actionFormatColorSubtree=a;
1.1793 +
1.1794 + a= new QAction(QPixmap(iconPath+"formatcolorsubtree.png"), tr( "Color sub&tree","Edit menu" ), this);
1.1795 + a->setStatusTip ( tr( "Color Subtree" ));
1.1796 + //FIXME-2 switch back to that a->setShortcut (Qt::CTRL + Qt::Key_T); // Color subtree
1.1797 + connect( a, SIGNAL( triggered() ), this, SLOT( formatColorSubtree() ) );
1.1798 + a->setEnabled (false);
1.1799 + formatMenu->addAction (a);
1.1800 + a->addTo( tb );
1.1801 + actionListBranches.append(a);
1.1802 + actionFormatColorSubtree=a;
1.1803 +
1.1804 + formatMenu->addSeparator();
1.1805 + actionGroupFormatLinkStyles=new QActionGroup ( this);
1.1806 + actionGroupFormatLinkStyles->setExclusive (true);
1.1807 + a= new QAction( tr( "Linkstyle Line" ), actionGroupFormatLinkStyles);
1.1808 + a->setStatusTip (tr( "Line" ));
1.1809 + a->setToggleAction(true);
1.1810 + connect( a, SIGNAL( triggered() ), this, SLOT( formatLinkStyleLine() ) );
1.1811 + formatMenu->addAction (a);
1.1812 + actionFormatLinkStyleLine=a;
1.1813 + a= new QAction( tr( "Linkstyle Curve" ), actionGroupFormatLinkStyles);
1.1814 + a->setStatusTip (tr( "Line" ));
1.1815 + a->setToggleAction(true);
1.1816 + connect( a, SIGNAL( triggered() ), this, SLOT( formatLinkStyleParabel() ) );
1.1817 + formatMenu->addAction (a);
1.1818 + actionFormatLinkStyleParabel=a;
1.1819 + a= new QAction( tr( "Linkstyle Thick Line" ), actionGroupFormatLinkStyles );
1.1820 + a->setStatusTip (tr( "PolyLine" ));
1.1821 + a->setToggleAction(true);
1.1822 + connect( a, SIGNAL( triggered() ), this, SLOT( formatLinkStylePolyLine() ) );
1.1823 + formatMenu->addAction (a);
1.1824 + actionFormatLinkStylePolyLine=a;
1.1825 + a= new QAction( tr( "Linkstyle Thick Curve" ), actionGroupFormatLinkStyles);
1.1826 + a->setStatusTip (tr( "PolyParabel" ) );
1.1827 + a->setToggleAction(true);
1.1828 + a->setChecked (true);
1.1829 + connect( a, SIGNAL( triggered() ), this, SLOT( formatLinkStylePolyParabel() ) );
1.1830 + formatMenu->addAction (a);
1.1831 + actionFormatLinkStylePolyParabel=a;
1.1832 +
1.1833 + a = new QAction( tr( "Hide link if object is not selected","Branch attribute" ), this);
1.1834 + a->setStatusTip (tr( "Hide link" ));
1.1835 + a->setToggleAction(true);
1.1836 + connect( a, SIGNAL( triggered() ), this, SLOT( formatHideLinkUnselected() ) );
1.1837 + actionFormatHideLinkUnselected=a;
1.1838 +
1.1839 + formatMenu->addSeparator();
1.1840 + a= new QAction( tr( "&Use color of heading for link","Branch attribute" ), this);
1.1841 + a->setStatusTip (tr( "Use same color for links and headings" ));
1.1842 + a->setToggleAction(true);
1.1843 + connect( a, SIGNAL( triggered() ), this, SLOT( formatToggleLinkColorHint() ) );
1.1844 + formatMenu->addAction (a);
1.1845 + actionFormatLinkColorHint=a;
1.1846 +
1.1847 + pix.fill (Qt::white);
1.1848 + a= new QAction( pix, tr( "Set &Link Color"+QString("...") ), this );
1.1849 + a->setStatusTip (tr( "Set Link Color" ));
1.1850 + formatMenu->addAction (a);
1.1851 + connect( a, SIGNAL( triggered() ), this, SLOT( formatSelectLinkColor() ) );
1.1852 + actionFormatLinkColor=a;
1.1853 +
1.1854 + a= new QAction( pix, tr( "Set &Selection Color"+QString("...") ), this );
1.1855 + a->setStatusTip (tr( "Set Selection Color" ));
1.1856 + formatMenu->addAction (a);
1.1857 + connect( a, SIGNAL( triggered() ), this, SLOT( formatSelectSelectionColor() ) );
1.1858 + actionFormatSelectionColor=a;
1.1859 +
1.1860 + a= new QAction( pix, tr( "Set &Background Color" )+QString("..."), this );
1.1861 + a->setStatusTip (tr( "Set Background Color" ));
1.1862 + formatMenu->addAction (a);
1.1863 + connect( a, SIGNAL( triggered() ), this, SLOT( formatSelectBackColor() ) );
1.1864 + actionFormatBackColor=a;
1.1865 +
1.1866 + a= new QAction( pix, tr( "Set &Background image" )+QString("..."), this );
1.1867 + a->setStatusTip (tr( "Set Background image" ));
1.1868 + formatMenu->addAction (a);
1.1869 + connect( a, SIGNAL( triggered() ), this, SLOT( formatSelectBackImage() ) );
1.1870 + actionFormatBackImage=a;
1.1871 }
1.1872
1.1873 // View Actions
1.1874 void Main::setupViewActions()
1.1875 {
1.1876 -QToolBar *tb = addToolBar( tr("View Actions","View Toolbar name") );
1.1877 -tb->setLabel( "View Actions" );
1.1878 -tb->setObjectName ("viewTB");
1.1879 -QMenu *viewMenu = menuBar()->addMenu ( tr( "&View" ));
1.1880 -
1.1881 -Switchboard switchboard; //FIXME-1 testing...
1.1882 -
1.1883 -QAction *a;
1.1884 -a = new QAction(QPixmap(iconPath+"viewmag-reset.png"), tr( "reset Zoom","View action" ), this);
1.1885 -a->setStatusTip ( tr( "Zoom reset" ) );
1.1886 -a->setShortcut (Qt::CTRL + Qt::Key_0); // Reset zoom
1.1887 -switchboard.addConnection(a,"CTRL+0");
1.1888 -a->addTo( tb );
1.1889 -viewMenu->addAction (a);
1.1890 -connect( a, SIGNAL( triggered() ), this, SLOT(viewZoomReset() ) );
1.1891 -
1.1892 -a = new QAction( QPixmap(iconPath+"viewmag+.png"), tr( "Zoom in","View action" ), this);
1.1893 -a->setStatusTip (tr( "Zoom in" ));
1.1894 -switchboard.addConnection(a,"CTRL++");
1.1895 -a->addTo( tb );
1.1896 -viewMenu->addAction (a);
1.1897 -connect( a, SIGNAL( triggered() ), this, SLOT(viewZoomIn() ) );
1.1898 -
1.1899 -a = new QAction( QPixmap(iconPath+"viewmag-.png"), tr( "Zoom out","View action" ), this);
1.1900 -a->setStatusTip (tr( "Zoom out" ));
1.1901 -switchboard.addConnection(a,"CTRL+-");
1.1902 -a->addTo( tb );
1.1903 -viewMenu->addAction (a);
1.1904 -connect( a, SIGNAL( triggered() ), this, SLOT( viewZoomOut() ) );
1.1905 -
1.1906 -a = new QAction( QPixmap(iconPath+"viewshowsel.png"), tr( "Show selection","View action" ), this);
1.1907 -a->setStatusTip (tr( "Show selection" ));
1.1908 -switchboard.addConnection(a,".");
1.1909 -a->addTo( tb );
1.1910 -viewMenu->addAction (a);
1.1911 -connect( a, SIGNAL( triggered() ), this, SLOT( viewCenter() ) );
1.1912 -
1.1913 -viewMenu->addSeparator();
1.1914 -
1.1915 -a = new QAction(QPixmap(flagsPath+"flag-note.png"), tr( "Show Note Editor","View action" ),this);
1.1916 -a->setStatusTip ( tr( "Show Note Editor" ));
1.1917 -a->setShortcut ( Qt::CTRL + Qt::Key_E ); // Toggle Note Editor
1.1918 -a->setToggleAction(true);
1.1919 -a->addTo( tb );
1.1920 -viewMenu->addAction (a);
1.1921 -connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleNoteEditor() ) );
1.1922 -actionViewToggleNoteEditor=a;
1.1923 -
1.1924 -a = new QAction(QPixmap(iconPath+"history.png"), tr( "History Window","View action" ),this );
1.1925 -a->setStatusTip ( tr( "Show History Window" ));
1.1926 -a->setShortcut ( Qt::CTRL + Qt::Key_H ); // Toggle history window
1.1927 -a->setToggleAction(true);
1.1928 -a->addTo( tb );
1.1929 -viewMenu->addAction (a);
1.1930 -connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleHistory() ) );
1.1931 -actionViewToggleHistoryWindow=a;
1.1932 -
1.1933 -viewMenu->addAction (actionViewTogglePropertyWindow);
1.1934 -
1.1935 -viewMenu->addSeparator();
1.1936 -
1.1937 -a = new QAction(tr( "Antialiasing","View action" ),this );
1.1938 -a->setStatusTip ( tr( "Antialiasing" ));
1.1939 -a->setToggleAction(true);
1.1940 -a->setChecked (settings.value("/mainwindow/view/AntiAlias",true).toBool());
1.1941 -viewMenu->addAction (a);
1.1942 -connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleAntiAlias() ) );
1.1943 -actionViewToggleAntiAlias=a;
1.1944 -
1.1945 -a = new QAction(tr( "Smooth pixmap transformations","View action" ),this );
1.1946 -a->setStatusTip (a->text());
1.1947 -a->setToggleAction(true);
1.1948 -a->setChecked (settings.value("/mainwindow/view/SmoothPixmapTransformation",true).toBool());
1.1949 -viewMenu->addAction (a);
1.1950 -connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleSmoothPixmap() ) );
1.1951 -actionViewToggleSmoothPixmapTransform=a;
1.1952 -
1.1953 -a = new QAction(tr( "Next Map","View action" ), this);
1.1954 -a->setStatusTip (a->text());
1.1955 -a->setShortcut (Qt::ALT + Qt::Key_N );
1.1956 -viewMenu->addAction (a);
1.1957 -connect( a, SIGNAL( triggered() ), this, SLOT(windowNextEditor() ) );
1.1958 -
1.1959 -a = new QAction (tr( "Previous Map","View action" ), this );
1.1960 -a->setStatusTip (a->text());
1.1961 -a->setShortcut (Qt::ALT + Qt::Key_P );
1.1962 -viewMenu->addAction (a);
1.1963 -connect( a, SIGNAL( triggered() ), this, SLOT(windowPreviousEditor() ) );
1.1964 -
1.1965 -switchboard.print();
1.1966 + QToolBar *tb = addToolBar( tr("View Actions","View Toolbar name") );
1.1967 + tb->setLabel( "View Actions" );
1.1968 + tb->setObjectName ("viewTB");
1.1969 + QMenu *viewMenu = menuBar()->addMenu ( tr( "&View" ));
1.1970 +
1.1971 + Switchboard switchboard; //FIXME-1 testing...
1.1972 +
1.1973 + QAction *a;
1.1974 + a = new QAction(QPixmap(iconPath+"viewmag-reset.png"), tr( "reset Zoom","View action" ), this);
1.1975 + a->setStatusTip ( tr( "Zoom reset" ) );
1.1976 + a->setShortcut (Qt::CTRL + Qt::Key_0); // Reset zoom
1.1977 + switchboard.addConnection(a,"CTRL+0");
1.1978 + a->addTo( tb );
1.1979 + viewMenu->addAction (a);
1.1980 + connect( a, SIGNAL( triggered() ), this, SLOT(viewZoomReset() ) );
1.1981 +
1.1982 + a = new QAction( QPixmap(iconPath+"viewmag+.png"), tr( "Zoom in","View action" ), this);
1.1983 + a->setStatusTip (tr( "Zoom in" ));
1.1984 + switchboard.addConnection(a,"CTRL++");
1.1985 + a->addTo( tb );
1.1986 + viewMenu->addAction (a);
1.1987 + connect( a, SIGNAL( triggered() ), this, SLOT(viewZoomIn() ) );
1.1988 +
1.1989 + a = new QAction( QPixmap(iconPath+"viewmag-.png"), tr( "Zoom out","View action" ), this);
1.1990 + a->setStatusTip (tr( "Zoom out" ));
1.1991 + switchboard.addConnection(a,"CTRL+-");
1.1992 + a->addTo( tb );
1.1993 + viewMenu->addAction (a);
1.1994 + connect( a, SIGNAL( triggered() ), this, SLOT( viewZoomOut() ) );
1.1995 +
1.1996 + a = new QAction( QPixmap(iconPath+"viewshowsel.png"), tr( "Show selection","View action" ), this);
1.1997 + a->setStatusTip (tr( "Show selection" ));
1.1998 + switchboard.addConnection(a,".");
1.1999 + a->addTo( tb );
1.2000 + viewMenu->addAction (a);
1.2001 + connect( a, SIGNAL( triggered() ), this, SLOT( viewCenter() ) );
1.2002 +
1.2003 + viewMenu->addSeparator();
1.2004 +
1.2005 + a = new QAction(QPixmap(flagsPath+"flag-note.png"), tr( "Show Note Editor","View action" ),this);
1.2006 + a->setStatusTip ( tr( "Show Note Editor" ));
1.2007 + a->setShortcut ( Qt::CTRL + Qt::Key_E ); // Toggle Note Editor
1.2008 + a->setToggleAction(true);
1.2009 + a->addTo( tb );
1.2010 + viewMenu->addAction (a);
1.2011 + connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleNoteEditor() ) );
1.2012 + actionViewToggleNoteEditor=a;
1.2013 +
1.2014 + a = new QAction(QPixmap(iconPath+"history.png"), tr( "History Window","View action" ),this );
1.2015 + a->setStatusTip ( tr( "Show History Window" ));
1.2016 + a->setShortcut ( Qt::CTRL + Qt::Key_H ); // Toggle history window
1.2017 + a->setToggleAction(true);
1.2018 + a->addTo( tb );
1.2019 + viewMenu->addAction (a);
1.2020 + connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleHistory() ) );
1.2021 + actionViewToggleHistoryWindow=a;
1.2022 +
1.2023 + viewMenu->addAction (actionViewTogglePropertyWindow);
1.2024 +
1.2025 + viewMenu->addSeparator();
1.2026 +
1.2027 + a = new QAction(tr( "Antialiasing","View action" ),this );
1.2028 + a->setStatusTip ( tr( "Antialiasing" ));
1.2029 + a->setToggleAction(true);
1.2030 + a->setChecked (settings.value("/mainwindow/view/AntiAlias",true).toBool());
1.2031 + viewMenu->addAction (a);
1.2032 + connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleAntiAlias() ) );
1.2033 + actionViewToggleAntiAlias=a;
1.2034 +
1.2035 + a = new QAction(tr( "Smooth pixmap transformations","View action" ),this );
1.2036 + a->setStatusTip (a->text());
1.2037 + a->setToggleAction(true);
1.2038 + a->setChecked (settings.value("/mainwindow/view/SmoothPixmapTransformation",true).toBool());
1.2039 + viewMenu->addAction (a);
1.2040 + connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleSmoothPixmap() ) );
1.2041 + actionViewToggleSmoothPixmapTransform=a;
1.2042 +
1.2043 + a = new QAction(tr( "Next Map","View action" ), this);
1.2044 + a->setStatusTip (a->text());
1.2045 + a->setShortcut (Qt::ALT + Qt::Key_N );
1.2046 + viewMenu->addAction (a);
1.2047 + connect( a, SIGNAL( triggered() ), this, SLOT(windowNextEditor() ) );
1.2048 +
1.2049 + a = new QAction (tr( "Previous Map","View action" ), this );
1.2050 + a->setStatusTip (a->text());
1.2051 + a->setShortcut (Qt::ALT + Qt::Key_P );
1.2052 + viewMenu->addAction (a);
1.2053 + connect( a, SIGNAL( triggered() ), this, SLOT(windowPreviousEditor() ) );
1.2054 +
1.2055 + switchboard.print();
1.2056 }
1.2057
1.2058 // Mode Actions
1.2059 void Main::setupModeActions()
1.2060 {
1.2061 -//QPopupMenu *menu = new QPopupMenu( this );
1.2062 -//menuBar()->insertItem( tr( "&Mode (using modifiers)" ), menu );
1.2063 -
1.2064 -QToolBar *tb = addToolBar( tr ("Modes when using modifiers","Modifier Toolbar name") );
1.2065 -tb->setObjectName ("modesTB");
1.2066 -QAction *a;
1.2067 -actionGroupModModes=new QActionGroup ( this);
1.2068 -actionGroupModModes->setExclusive (true);
1.2069 -a= new QAction( QPixmap(iconPath+"modecolor.png"), tr( "Use modifier to color branches","Mode modifier" ), actionGroupModModes);
1.2070 -a->setShortcut (Qt::Key_J);
1.2071 -a->setStatusTip ( tr( "Use modifier to color branches" ));
1.2072 -a->setToggleAction(true);
1.2073 -a->addTo (tb);
1.2074 -a->setChecked(true);
1.2075 -actionModModeColor=a;
1.2076 -
1.2077 -a= new QAction( QPixmap(iconPath+"modecopy.png"), tr( "Use modifier to copy","Mode modifier" ), actionGroupModModes );
1.2078 -a->setShortcut( Qt::Key_K);
1.2079 -a->setStatusTip( tr( "Use modifier to copy" ));
1.2080 -a->setToggleAction(true);
1.2081 -a->addTo (tb);
1.2082 -actionModModeCopy=a;
1.2083 -
1.2084 -a= new QAction(QPixmap(iconPath+"modelink.png"), tr( "Use modifier to draw xLinks","Mode modifier" ), actionGroupModModes );
1.2085 -a->setShortcut (Qt::Key_L);
1.2086 -a->setStatusTip( tr( "Use modifier to draw xLinks" ));
1.2087 -a->setToggleAction(true);
1.2088 -a->addTo (tb);
1.2089 -actionModModeXLink=a;
1.2090 + //QPopupMenu *menu = new QPopupMenu( this );
1.2091 + //menuBar()->insertItem( tr( "&Mode (using modifiers)" ), menu );
1.2092 +
1.2093 + QToolBar *tb = addToolBar( tr ("Modes when using modifiers","Modifier Toolbar name") );
1.2094 + tb->setObjectName ("modesTB");
1.2095 + QAction *a;
1.2096 + actionGroupModModes=new QActionGroup ( this);
1.2097 + actionGroupModModes->setExclusive (true);
1.2098 + a= new QAction( QPixmap(iconPath+"modecolor.png"), tr( "Use modifier to color branches","Mode modifier" ), actionGroupModModes);
1.2099 + a->setShortcut (Qt::Key_J);
1.2100 + a->setStatusTip ( tr( "Use modifier to color branches" ));
1.2101 + a->setToggleAction(true);
1.2102 + a->addTo (tb);
1.2103 + a->setChecked(true);
1.2104 + actionModModeColor=a;
1.2105 +
1.2106 + a= new QAction( QPixmap(iconPath+"modecopy.png"), tr( "Use modifier to copy","Mode modifier" ), actionGroupModModes );
1.2107 + a->setShortcut( Qt::Key_K);
1.2108 + a->setStatusTip( tr( "Use modifier to copy" ));
1.2109 + a->setToggleAction(true);
1.2110 + a->addTo (tb);
1.2111 + actionModModeCopy=a;
1.2112 +
1.2113 + a= new QAction(QPixmap(iconPath+"modelink.png"), tr( "Use modifier to draw xLinks","Mode modifier" ), actionGroupModModes );
1.2114 + a->setShortcut (Qt::Key_L);
1.2115 + a->setStatusTip( tr( "Use modifier to draw xLinks" ));
1.2116 + a->setToggleAction(true);
1.2117 + a->addTo (tb);
1.2118 + actionModModeXLink=a;
1.2119 }
1.2120
1.2121 // Flag Actions
1.2122 void Main::setupFlagActions()
1.2123 {
1.2124 -// Create System Flags
1.2125 -QToolBar *tb=NULL;
1.2126 -
1.2127 -Flag *flag=new Flag;;
1.2128 -flag->setVisible(true);
1.2129 -
1.2130 -flag->load(QPixmap(flagsPath+"flag-note.png"));
1.2131 -setupFlag (flag,tb,"system-note",tr("Note","SystemFlag"));
1.2132 -
1.2133 -flag->load(QPixmap(flagsPath+"flag-url.png"));
1.2134 -setupFlag (flag,tb,"system-url",tr("URL to Document ","SystemFlag"));
1.2135 -
1.2136 -flag->load(QPixmap(flagsPath+"flag-vymlink.png"));
1.2137 -setupFlag (flag,tb,"system-vymLink",tr("Link to another vym map","SystemFlag"));
1.2138 -
1.2139 -flag->load(QPixmap(flagsPath+"flag-scrolled-right.png"));
1.2140 -setupFlag (flag,tb,"system-scrolledright",tr("subtree is scrolled","SystemFlag"));
1.2141 -
1.2142 -flag->load(QPixmap(flagsPath+"flag-tmpUnscrolled-right.png"));
1.2143 -setupFlag (flag,tb,"system-tmpUnscrolledRight",tr("subtree is temporary scrolled","SystemFlag"));
1.2144 -
1.2145 -flag->load(QPixmap(flagsPath+"flag-hideexport.png"));
1.2146 -setupFlag (flag,tb,"system-hideInExport",tr("Hide object in exported maps","SystemFlag"));
1.2147 -
1.2148 -// Create Standard Flags
1.2149 -tb=addToolBar (tr ("Standard Flags","Standard Flag Toolbar"));
1.2150 -tb->setObjectName ("standardFlagTB");
1.2151 -standardFlagsMaster->setToolBar (tb);
1.2152 -
1.2153 -flag->load(flagsPath+"flag-exclamationmark.png");
1.2154 -flag->setGroup("standard-mark");
1.2155 -setupFlag (flag,tb,"exclamationmark",tr("Take care!","Standardflag"));
1.2156 -
1.2157 -flag->load(flagsPath+"flag-questionmark.png");
1.2158 -flag->setGroup("standard-mark");
1.2159 -setupFlag (flag,tb,"questionmark",tr("Really?","Standardflag"));
1.2160 -
1.2161 -flag->load(flagsPath+"flag-hook-green.png");
1.2162 -flag->setGroup("standard-hook");
1.2163 -setupFlag (flag,tb,"hook-green",tr("ok!","Standardflag"));
1.2164 -
1.2165 -flag->load(flagsPath+"flag-cross-red.png");
1.2166 -flag->setGroup("standard-hook");
1.2167 -setupFlag (flag,tb,"cross-red",tr("Not ok!","Standardflag"));
1.2168 -flag->unsetGroup();
1.2169 -
1.2170 -flag->load(flagsPath+"flag-stopsign.png");
1.2171 -setupFlag (flag,tb,"stopsign",tr("This won't work!","Standardflag"));
1.2172 -
1.2173 -flag->load(flagsPath+"flag-smiley-good.png");
1.2174 -flag->setGroup("standard-smiley");
1.2175 -setupFlag (flag,tb,"smiley-good",tr("Good","Standardflag"));
1.2176 -
1.2177 -flag->load(flagsPath+"flag-smiley-sad.png");
1.2178 -flag->setGroup("standard-smiley");
1.2179 -setupFlag (flag,tb,"smiley-sad",tr("Bad","Standardflag"));
1.2180 -
1.2181 -flag->load(flagsPath+"flag-smiley-omg.png");
1.2182 -flag->setGroup("standard-smiley");
1.2183 -setupFlag (flag,tb,"smiley-omb",tr("Oh no!","Standardflag"));
1.2184 -// Original omg.png (in KDE emoticons)
1.2185 -flag->unsetGroup();
1.2186 -
1.2187 -flag->load(flagsPath+"flag-kalarm.png");
1.2188 -setupFlag (flag,tb,"clock",tr("Time critical","Standardflag"));
1.2189 -
1.2190 -flag->load(flagsPath+"flag-phone.png");
1.2191 -setupFlag (flag,tb,"phone",tr("Call...","Standardflag"));
1.2192 -
1.2193 -flag->load(flagsPath+"flag-lamp.png");
1.2194 -setupFlag (flag,tb,"lamp",tr("Idea!","Standardflag"));
1.2195 -
1.2196 -flag->load(flagsPath+"flag-arrow-up.png");
1.2197 -flag->setGroup("standard-arrow");
1.2198 -setupFlag (flag,tb,"arrow-up",tr("Important","Standardflag"));
1.2199 -
1.2200 -flag->load(flagsPath+"flag-arrow-down.png");
1.2201 -flag->setGroup("standard-arrow");
1.2202 -setupFlag (flag,tb,"arrow-down",tr("Unimportant","Standardflag"));
1.2203 -
1.2204 -flag->load(flagsPath+"flag-arrow-2up.png");
1.2205 -flag->setGroup("standard-arrow");
1.2206 -setupFlag (flag,tb,"2arrow-up",tr("Very important!","Standardflag"));
1.2207 -
1.2208 -flag->load(flagsPath+"flag-arrow-2down.png");
1.2209 -flag->setGroup("standard-arrow");
1.2210 -setupFlag (flag,tb,"2arrow-down",tr("Very unimportant!","Standardflag"));
1.2211 -flag->unsetGroup();
1.2212 -
1.2213 -flag->load(flagsPath+"flag-thumb-up.png");
1.2214 -flag->setGroup("standard-thumb");
1.2215 -setupFlag (flag,tb,"thumb-up",tr("I like this","Standardflag"));
1.2216 -
1.2217 -flag->load(flagsPath+"flag-thumb-down.png");
1.2218 -flag->setGroup("standard-thumb");
1.2219 -setupFlag (flag,tb,"thumb-down",tr("I do not like this","Standardflag"));
1.2220 -flag->unsetGroup();
1.2221 -
1.2222 -flag->load(flagsPath+"flag-rose.png");
1.2223 -setupFlag (flag,tb,"rose",tr("Rose","Standardflag"));
1.2224 -
1.2225 -flag->load(flagsPath+"flag-heart.png");
1.2226 -setupFlag (flag,tb,"heart",tr("I just love...","Standardflag"));
1.2227 -
1.2228 -flag->load(flagsPath+"flag-present.png");
1.2229 -setupFlag (flag,tb,"present",tr("Surprise!","Standardflag"));
1.2230 -
1.2231 -flag->load(flagsPath+"flag-flash.png");
1.2232 -setupFlag (flag,tb,"flash",tr("Dangerous","Standardflag"));
1.2233 -
1.2234 -// Original: xsldbg_output.png
1.2235 -flag->load(flagsPath+"flag-info.png");
1.2236 -setupFlag (flag,tb,"info",tr("Info","Standardflag"));
1.2237 -
1.2238 -// Original khelpcenter.png
1.2239 -flag->load(flagsPath+"flag-lifebelt.png");
1.2240 -setupFlag (flag,tb,"lifebelt",tr("This will help","Standardflag"));
1.2241 -
1.2242 -// Freemind flags
1.2243 -flag->setVisible(false);
1.2244 -flag->load(flagsPath+"freemind/warning.png");
1.2245 -setupFlag (flag,tb, "freemind-warning",tr("Important","Freemind-Flag"));
1.2246 -
1.2247 -for (int i=1; i<8; i++)
1.2248 -{
1.2249 - flag->load(flagsPath+QString("freemind/priority-%1.png").arg(i));
1.2250 - setupFlag (flag,tb, QString("freemind-priority-%1").arg(i),tr("Priority","Freemind-Flag"));
1.2251 -}
1.2252 -
1.2253 -flag->load(flagsPath+"freemind/back.png");
1.2254 -setupFlag (flag,tb,"freemind-back",tr("Back","Freemind-Flag"));
1.2255 -
1.2256 -flag->load(flagsPath+"freemind/forward.png");
1.2257 -setupFlag (flag,tb,"freemind-forward",tr("forward","Freemind-Flag"));
1.2258 -
1.2259 -flag->load(flagsPath+"freemind/attach.png");
1.2260 -setupFlag (flag,tb,"freemind-attach",tr("Look here","Freemind-Flag"));
1.2261 -
1.2262 -flag->load(flagsPath+"freemind/clanbomber.png");
1.2263 -setupFlag (flag,tb,"freemind-clanbomber",tr("Dangerous","Freemind-Flag"));
1.2264 -
1.2265 -flag->load(flagsPath+"freemind/desktopnew.png");
1.2266 -setupFlag (flag,tb,"freemind-desktopnew",tr("Don't flagrget","Freemind-Flag"));
1.2267 -
1.2268 -flag->load(flagsPath+"freemind/flag.png");
1.2269 -setupFlag (flag,tb,"freemind-flag",tr("Flag","Freemind-Flag"));
1.2270 -
1.2271 -
1.2272 -flag->load(flagsPath+"freemind/gohome.png");
1.2273 -setupFlag (flag,tb,"freemind-gohome",tr("Home","Freemind-Flag"));
1.2274 -
1.2275 -
1.2276 -flag->load(flagsPath+"freemind/kaddressbook.png");
1.2277 -setupFlag (flag,tb,"freemind-kaddressbook",tr("Telephone","Freemind-Flag"));
1.2278 -
1.2279 -flag->load(flagsPath+"freemind/knotify.png");
1.2280 -setupFlag (flag,tb,"freemind-knotify",tr("Music","Freemind-Flag"));
1.2281 -
1.2282 -flag->load(flagsPath+"freemind/korn.png");
1.2283 -setupFlag (flag,tb,"freemind-korn",tr("Mailbox","Freemind-Flag"));
1.2284 -
1.2285 -flag->load(flagsPath+"freemind/mail.png");
1.2286 -setupFlag (flag,tb,"freemind-mail",tr("Maix","Freemind-Flag"));
1.2287 -
1.2288 -flag->load(flagsPath+"freemind/password.png");
1.2289 -setupFlag (flag,tb,"freemind-password",tr("Password","Freemind-Flag"));
1.2290 -
1.2291 -flag->load(flagsPath+"freemind/pencil.png");
1.2292 -setupFlag (flag,tb,"freemind-pencil",tr("To be improved","Freemind-Flag"));
1.2293 -
1.2294 -flag->load(flagsPath+"freemind/stop.png");
1.2295 -setupFlag (flag,tb,"freemind-stop",tr("Stop","Freemind-Flag"));
1.2296 -
1.2297 -flag->load(flagsPath+"freemind/wizard.png");
1.2298 -setupFlag (flag,tb,"freemind-wizard",tr("Magic","Freemind-Flag"));
1.2299 -
1.2300 -flag->load(flagsPath+"freemind/xmag.png");
1.2301 -setupFlag (flag,tb,"freemind-xmag",tr("To be discussed","Freemind-Flag"));
1.2302 -
1.2303 -flag->load(flagsPath+"freemind/bell.png");
1.2304 -setupFlag (flag,tb,"freemind-bell",tr("Reminder","Freemind-Flag"));
1.2305 -
1.2306 -flag->load(flagsPath+"freemind/bookmark.png");
1.2307 -setupFlag (flag,tb,"freemind-bookmark",tr("Excellent","Freemind-Flag"));
1.2308 -
1.2309 -flag->load(flagsPath+"freemind/penguin.png");
1.2310 -setupFlag (flag,tb,"freemind-penguin",tr("Linux","Freemind-Flag"));
1.2311 -
1.2312 -flag->load(flagsPath+"freemind/licq.png");
1.2313 -setupFlag (flag,tb,"freemind-licq",tr("Sweet","Freemind-Flag"));
1.2314 + // Create System Flags
1.2315 + QToolBar *tb=NULL;
1.2316 +
1.2317 + Flag *flag=new Flag;;
1.2318 + flag->setVisible(true);
1.2319 +
1.2320 + flag->load(QPixmap(flagsPath+"flag-note.png"));
1.2321 + setupFlag (flag,tb,"system-note",tr("Note","SystemFlag"));
1.2322 +
1.2323 + flag->load(QPixmap(flagsPath+"flag-url.png"));
1.2324 + setupFlag (flag,tb,"system-url",tr("URL to Document ","SystemFlag"));
1.2325 +
1.2326 + flag->load(QPixmap(flagsPath+"flag-vymlink.png"));
1.2327 + setupFlag (flag,tb,"system-vymLink",tr("Link to another vym map","SystemFlag"));
1.2328 +
1.2329 + flag->load(QPixmap(flagsPath+"flag-scrolled-right.png"));
1.2330 + setupFlag (flag,tb,"system-scrolledright",tr("subtree is scrolled","SystemFlag"));
1.2331 +
1.2332 + flag->load(QPixmap(flagsPath+"flag-tmpUnscrolled-right.png"));
1.2333 + setupFlag (flag,tb,"system-tmpUnscrolledRight",tr("subtree is temporary scrolled","SystemFlag"));
1.2334 +
1.2335 + flag->load(QPixmap(flagsPath+"flag-hideexport.png"));
1.2336 + setupFlag (flag,tb,"system-hideInExport",tr("Hide object in exported maps","SystemFlag"));
1.2337 +
1.2338 + // Create Standard Flags
1.2339 + tb=addToolBar (tr ("Standard Flags","Standard Flag Toolbar"));
1.2340 + tb->setObjectName ("standardFlagTB");
1.2341 + standardFlagsMaster->setToolBar (tb);
1.2342 +
1.2343 + flag->load(flagsPath+"flag-exclamationmark.png");
1.2344 + flag->setGroup("standard-mark");
1.2345 + setupFlag (flag,tb,"exclamationmark",tr("Take care!","Standardflag"));
1.2346 +
1.2347 + flag->load(flagsPath+"flag-questionmark.png");
1.2348 + flag->setGroup("standard-mark");
1.2349 + setupFlag (flag,tb,"questionmark",tr("Really?","Standardflag"));
1.2350 +
1.2351 + flag->load(flagsPath+"flag-hook-green.png");
1.2352 + flag->setGroup("standard-hook");
1.2353 + setupFlag (flag,tb,"hook-green",tr("ok!","Standardflag"));
1.2354 +
1.2355 + flag->load(flagsPath+"flag-cross-red.png");
1.2356 + flag->setGroup("standard-hook");
1.2357 + setupFlag (flag,tb,"cross-red",tr("Not ok!","Standardflag"));
1.2358 + flag->unsetGroup();
1.2359 +
1.2360 + flag->load(flagsPath+"flag-stopsign.png");
1.2361 + setupFlag (flag,tb,"stopsign",tr("This won't work!","Standardflag"));
1.2362 +
1.2363 + flag->load(flagsPath+"flag-smiley-good.png");
1.2364 + flag->setGroup("standard-smiley");
1.2365 + setupFlag (flag,tb,"smiley-good",tr("Good","Standardflag"));
1.2366 +
1.2367 + flag->load(flagsPath+"flag-smiley-sad.png");
1.2368 + flag->setGroup("standard-smiley");
1.2369 + setupFlag (flag,tb,"smiley-sad",tr("Bad","Standardflag"));
1.2370 +
1.2371 + flag->load(flagsPath+"flag-smiley-omg.png");
1.2372 + flag->setGroup("standard-smiley");
1.2373 + setupFlag (flag,tb,"smiley-omb",tr("Oh no!","Standardflag"));
1.2374 + // Original omg.png (in KDE emoticons)
1.2375 + flag->unsetGroup();
1.2376 +
1.2377 + flag->load(flagsPath+"flag-kalarm.png");
1.2378 + setupFlag (flag,tb,"clock",tr("Time critical","Standardflag"));
1.2379 +
1.2380 + flag->load(flagsPath+"flag-phone.png");
1.2381 + setupFlag (flag,tb,"phone",tr("Call...","Standardflag"));
1.2382 +
1.2383 + flag->load(flagsPath+"flag-lamp.png");
1.2384 + setupFlag (flag,tb,"lamp",tr("Idea!","Standardflag"));
1.2385 +
1.2386 + flag->load(flagsPath+"flag-arrow-up.png");
1.2387 + flag->setGroup("standard-arrow");
1.2388 + setupFlag (flag,tb,"arrow-up",tr("Important","Standardflag"));
1.2389 +
1.2390 + flag->load(flagsPath+"flag-arrow-down.png");
1.2391 + flag->setGroup("standard-arrow");
1.2392 + setupFlag (flag,tb,"arrow-down",tr("Unimportant","Standardflag"));
1.2393 +
1.2394 + flag->load(flagsPath+"flag-arrow-2up.png");
1.2395 + flag->setGroup("standard-arrow");
1.2396 + setupFlag (flag,tb,"2arrow-up",tr("Very important!","Standardflag"));
1.2397 +
1.2398 + flag->load(flagsPath+"flag-arrow-2down.png");
1.2399 + flag->setGroup("standard-arrow");
1.2400 + setupFlag (flag,tb,"2arrow-down",tr("Very unimportant!","Standardflag"));
1.2401 + flag->unsetGroup();
1.2402 +
1.2403 + flag->load(flagsPath+"flag-thumb-up.png");
1.2404 + flag->setGroup("standard-thumb");
1.2405 + setupFlag (flag,tb,"thumb-up",tr("I like this","Standardflag"));
1.2406 +
1.2407 + flag->load(flagsPath+"flag-thumb-down.png");
1.2408 + flag->setGroup("standard-thumb");
1.2409 + setupFlag (flag,tb,"thumb-down",tr("I do not like this","Standardflag"));
1.2410 + flag->unsetGroup();
1.2411 +
1.2412 + flag->load(flagsPath+"flag-rose.png");
1.2413 + setupFlag (flag,tb,"rose",tr("Rose","Standardflag"));
1.2414 +
1.2415 + flag->load(flagsPath+"flag-heart.png");
1.2416 + setupFlag (flag,tb,"heart",tr("I just love...","Standardflag"));
1.2417 +
1.2418 + flag->load(flagsPath+"flag-present.png");
1.2419 + setupFlag (flag,tb,"present",tr("Surprise!","Standardflag"));
1.2420 +
1.2421 + flag->load(flagsPath+"flag-flash.png");
1.2422 + setupFlag (flag,tb,"flash",tr("Dangerous","Standardflag"));
1.2423 +
1.2424 + // Original: xsldbg_output.png
1.2425 + flag->load(flagsPath+"flag-info.png");
1.2426 + setupFlag (flag,tb,"info",tr("Info","Standardflag"));
1.2427 +
1.2428 + // Original khelpcenter.png
1.2429 + flag->load(flagsPath+"flag-lifebelt.png");
1.2430 + setupFlag (flag,tb,"lifebelt",tr("This will help","Standardflag"));
1.2431 +
1.2432 + // Freemind flags
1.2433 + flag->setVisible(false);
1.2434 + flag->load(flagsPath+"freemind/warning.png");
1.2435 + setupFlag (flag,tb, "freemind-warning",tr("Important","Freemind-Flag"));
1.2436 +
1.2437 + for (int i=1; i<8; i++)
1.2438 + {
1.2439 + flag->load(flagsPath+QString("freemind/priority-%1.png").arg(i));
1.2440 + setupFlag (flag,tb, QString("freemind-priority-%1").arg(i),tr("Priority","Freemind-Flag"));
1.2441 + }
1.2442 +
1.2443 + flag->load(flagsPath+"freemind/back.png");
1.2444 + setupFlag (flag,tb,"freemind-back",tr("Back","Freemind-Flag"));
1.2445 +
1.2446 + flag->load(flagsPath+"freemind/forward.png");
1.2447 + setupFlag (flag,tb,"freemind-forward",tr("forward","Freemind-Flag"));
1.2448 +
1.2449 + flag->load(flagsPath+"freemind/attach.png");
1.2450 + setupFlag (flag,tb,"freemind-attach",tr("Look here","Freemind-Flag"));
1.2451 +
1.2452 + flag->load(flagsPath+"freemind/clanbomber.png");
1.2453 + setupFlag (flag,tb,"freemind-clanbomber",tr("Dangerous","Freemind-Flag"));
1.2454 +
1.2455 + flag->load(flagsPath+"freemind/desktopnew.png");
1.2456 + setupFlag (flag,tb,"freemind-desktopnew",tr("Don't flagrget","Freemind-Flag"));
1.2457 +
1.2458 + flag->load(flagsPath+"freemind/flag.png");
1.2459 + setupFlag (flag,tb,"freemind-flag",tr("Flag","Freemind-Flag"));
1.2460 +
1.2461 +
1.2462 + flag->load(flagsPath+"freemind/gohome.png");
1.2463 + setupFlag (flag,tb,"freemind-gohome",tr("Home","Freemind-Flag"));
1.2464 +
1.2465 +
1.2466 + flag->load(flagsPath+"freemind/kaddressbook.png");
1.2467 + setupFlag (flag,tb,"freemind-kaddressbook",tr("Telephone","Freemind-Flag"));
1.2468 +
1.2469 + flag->load(flagsPath+"freemind/knotify.png");
1.2470 + setupFlag (flag,tb,"freemind-knotify",tr("Music","Freemind-Flag"));
1.2471 +
1.2472 + flag->load(flagsPath+"freemind/korn.png");
1.2473 + setupFlag (flag,tb,"freemind-korn",tr("Mailbox","Freemind-Flag"));
1.2474 +
1.2475 + flag->load(flagsPath+"freemind/mail.png");
1.2476 + setupFlag (flag,tb,"freemind-mail",tr("Maix","Freemind-Flag"));
1.2477 +
1.2478 + flag->load(flagsPath+"freemind/password.png");
1.2479 + setupFlag (flag,tb,"freemind-password",tr("Password","Freemind-Flag"));
1.2480 +
1.2481 + flag->load(flagsPath+"freemind/pencil.png");
1.2482 + setupFlag (flag,tb,"freemind-pencil",tr("To be improved","Freemind-Flag"));
1.2483 +
1.2484 + flag->load(flagsPath+"freemind/stop.png");
1.2485 + setupFlag (flag,tb,"freemind-stop",tr("Stop","Freemind-Flag"));
1.2486 +
1.2487 + flag->load(flagsPath+"freemind/wizard.png");
1.2488 + setupFlag (flag,tb,"freemind-wizard",tr("Magic","Freemind-Flag"));
1.2489 +
1.2490 + flag->load(flagsPath+"freemind/xmag.png");
1.2491 + setupFlag (flag,tb,"freemind-xmag",tr("To be discussed","Freemind-Flag"));
1.2492 +
1.2493 + flag->load(flagsPath+"freemind/bell.png");
1.2494 + setupFlag (flag,tb,"freemind-bell",tr("Reminder","Freemind-Flag"));
1.2495 +
1.2496 + flag->load(flagsPath+"freemind/bookmark.png");
1.2497 + setupFlag (flag,tb,"freemind-bookmark",tr("Excellent","Freemind-Flag"));
1.2498 +
1.2499 + flag->load(flagsPath+"freemind/penguin.png");
1.2500 + setupFlag (flag,tb,"freemind-penguin",tr("Linux","Freemind-Flag"));
1.2501 +
1.2502 + flag->load(flagsPath+"freemind/licq.png");
1.2503 + setupFlag (flag,tb,"freemind-licq",tr("Sweet","Freemind-Flag"));
1.2504 }
1.2505
1.2506 void Main::setupFlag (Flag *flag, QToolBar *tb, const QString &name, const QString &tooltip)
1.2507 {
1.2508 -flag->setName(name);
1.2509 -flag->setToolTip (tooltip);
1.2510 -QAction *a;
1.2511 -if (tb)
1.2512 -{
1.2513 - a=new QAction (flag->getPixmap(),name,this);
1.2514 - // StandardFlag
1.2515 - tb->addAction (a);
1.2516 - flag->setAction (a);
1.2517 - a->setVisible (flag->isVisible());
1.2518 - a->setCheckable(true);
1.2519 - a->setObjectName(name);
1.2520 - a->setToolTip(tooltip);
1.2521 - connect (a, SIGNAL( triggered() ), this, SLOT( standardFlagChanged() ) );
1.2522 - standardFlagsMaster->addFlag (flag);
1.2523 -} else
1.2524 -{
1.2525 - // SystemFlag
1.2526 - systemFlagsMaster->addFlag (flag);
1.2527 -}
1.2528 + flag->setName(name);
1.2529 + flag->setToolTip (tooltip);
1.2530 + QAction *a;
1.2531 + if (tb)
1.2532 + {
1.2533 + a=new QAction (flag->getPixmap(),name,this);
1.2534 + // StandardFlag
1.2535 + tb->addAction (a);
1.2536 + flag->setAction (a);
1.2537 + a->setVisible (flag->isVisible());
1.2538 + a->setCheckable(true);
1.2539 + a->setObjectName(name);
1.2540 + a->setToolTip(tooltip);
1.2541 + connect (a, SIGNAL( triggered() ), this, SLOT( standardFlagChanged() ) );
1.2542 + standardFlagsMaster->addFlag (flag);
1.2543 + } else
1.2544 + {
1.2545 + // SystemFlag
1.2546 + systemFlagsMaster->addFlag (flag);
1.2547 + }
1.2548 }
1.2549
1.2550 // Network Actions
1.2551 void Main::setupNetworkActions()
1.2552 {
1.2553 -if (!settings.value( "/mainwindow/showTestMenu",false).toBool() )
1.2554 - return;
1.2555 -QMenu *netMenu = menuBar()->addMenu( "Network" );
1.2556 -
1.2557 -QAction *a;
1.2558 -
1.2559 -a = new QAction( "Start TCPserver for MapEditor",this);
1.2560 -//a->setStatusTip ( "Set application to open pdf files"));
1.2561 -//a->setShortcut ( Qt::ALT + Qt::Key_T ); //New TCP server
1.2562 -connect( a, SIGNAL( triggered() ), this, SLOT( networkStartServer() ) );
1.2563 -netMenu->addAction (a);
1.2564 -
1.2565 -a = new QAction( "Connect MapEditor to server",this);
1.2566 -//a->setStatusTip ( "Set application to open pdf files"));
1.2567 -a->setShortcut ( Qt::ALT + Qt::Key_C ); // Connect to server
1.2568 -connect( a, SIGNAL( triggered() ), this, SLOT( networkConnect() ) );
1.2569 -netMenu->addAction (a);
1.2570 + if (!settings.value( "/mainwindow/showTestMenu",false).toBool() )
1.2571 + return;
1.2572 + QMenu *netMenu = menuBar()->addMenu( "Network" );
1.2573 +
1.2574 + QAction *a;
1.2575 +
1.2576 + a = new QAction( "Start TCPserver for MapEditor",this);
1.2577 + //a->setStatusTip ( "Set application to open pdf files"));
1.2578 + //a->setShortcut ( Qt::ALT + Qt::Key_T ); //New TCP server
1.2579 + connect( a, SIGNAL( triggered() ), this, SLOT( networkStartServer() ) );
1.2580 + netMenu->addAction (a);
1.2581 +
1.2582 + a = new QAction( "Connect MapEditor to server",this);
1.2583 + //a->setStatusTip ( "Set application to open pdf files"));
1.2584 + a->setShortcut ( Qt::ALT + Qt::Key_C ); // Connect to server
1.2585 + connect( a, SIGNAL( triggered() ), this, SLOT( networkConnect() ) );
1.2586 + netMenu->addAction (a);
1.2587 }
1.2588
1.2589 // Settings Actions
1.2590 void Main::setupSettingsActions()
1.2591 {
1.2592 -QMenu *settingsMenu = menuBar()->addMenu( tr( "&Settings" ));
1.2593 -
1.2594 -QAction *a;
1.2595 -
1.2596 -a = new QAction( tr( "Set application to open pdf files","Settings action"), this);
1.2597 -a->setStatusTip ( tr( "Set application to open pdf files"));
1.2598 -connect( a, SIGNAL( triggered() ), this, SLOT( settingsPDF() ) );
1.2599 -settingsMenu->addAction (a);
1.2600 -
1.2601 -a = new QAction( tr( "Set application to open external links","Settings action"), this);
1.2602 -a->setStatusTip( tr( "Set application to open external links"));
1.2603 -connect( a, SIGNAL( triggered() ), this, SLOT( settingsURL() ) );
1.2604 -settingsMenu->addAction (a);
1.2605 -
1.2606 -a = new QAction( tr( "Set path for macros","Settings action")+"...", this);
1.2607 -a->setStatusTip( tr( "Set path for macros"));
1.2608 -connect( a, SIGNAL( triggered() ), this, SLOT( settingsMacroDir() ) );
1.2609 -settingsMenu->addAction (a);
1.2610 -
1.2611 -a = new QAction( tr( "Set number of undo levels","Settings action")+"...", this);
1.2612 -a->setStatusTip( tr( "Set number of undo levels"));
1.2613 -connect( a, SIGNAL( triggered() ), this, SLOT( settingsUndoLevels() ) );
1.2614 -settingsMenu->addAction (a);
1.2615 -
1.2616 -settingsMenu->addSeparator();
1.2617 -
1.2618 -a = new QAction( tr( "Autosave","Settings action"), this);
1.2619 -a->setStatusTip( tr( "Autosave"));
1.2620 -a->setToggleAction(true);
1.2621 -a->setChecked ( settings.value ("/mainwindow/autosave/use",false).toBool());
1.2622 -connect( a, SIGNAL( triggered() ), this, SLOT( settingsAutosaveToggle() ) );
1.2623 -settingsMenu->addAction (a);
1.2624 -actionSettingsAutosaveToggle=a;
1.2625 -
1.2626 -a = new QAction( tr( "Autosave time","Settings action")+"...", this);
1.2627 -a->setStatusTip( tr( "Autosave time"));
1.2628 -connect( a, SIGNAL( triggered() ), this, SLOT( settingsAutosaveTime() ) );
1.2629 -settingsMenu->addAction (a);
1.2630 -actionSettingsAutosaveTime=a;
1.2631 -
1.2632 -a = new QAction( tr( "Write backup file on save","Settings action"), this);
1.2633 -a->setStatusTip( tr( "Write backup file on save"));
1.2634 -a->setToggleAction(true);
1.2635 -a->setChecked ( settings.value ("/mainwindow/writeBackupFile",false).toBool());
1.2636 -connect( a, SIGNAL( triggered() ), this, SLOT( settingsWriteBackupFileToggle() ) );
1.2637 -settingsMenu->addAction (a);
1.2638 -actionSettingsWriteBackupFile=a;
1.2639 -
1.2640 -settingsMenu->addSeparator();
1.2641 -
1.2642 -a = new QAction( tr( "Edit branch after adding it","Settings action" ), this );
1.2643 -a->setStatusTip( tr( "Edit branch after adding it" ));
1.2644 -a->setToggleAction(true);
1.2645 -a->setChecked ( settings.value ("/mapeditor/editmode/autoEditNewBranch",true).toBool());
1.2646 -settingsMenu->addAction (a);
1.2647 -actionSettingsAutoEditNewBranch=a;
1.2648 -
1.2649 -a= new QAction( tr( "Select branch after adding it","Settings action" ), this );
1.2650 -a->setStatusTip( tr( "Select branch after adding it" ));
1.2651 -a->setToggleAction(true);
1.2652 -a->setChecked ( settings.value ("/mapeditor/editmode/autoSelectNewBranch",false).toBool() );
1.2653 -settingsMenu->addAction (a);
1.2654 -actionSettingsAutoSelectNewBranch=a;
1.2655 -
1.2656 -a= new QAction(tr( "Select existing heading","Settings action" ), this);
1.2657 -a->setStatusTip( tr( "Select heading before editing" ));
1.2658 -a->setToggleAction(true);
1.2659 -a->setChecked ( settings.value ("/mapeditor/editmode/autoSelectText",true).toBool() );
1.2660 -settingsMenu->addAction (a);
1.2661 -actionSettingsAutoSelectText=a;
1.2662 -
1.2663 -a= new QAction( tr( "Delete key","Settings action" ), this);
1.2664 -a->setStatusTip( tr( "Delete key for deleting branches" ));
1.2665 -a->setToggleAction(true);
1.2666 -a->setChecked ( settings.value ("/mapeditor/editmode/useDelKey",true).toBool() );
1.2667 -settingsMenu->addAction (a);
1.2668 -connect( a, SIGNAL( triggered() ), this, SLOT( settingsToggleDelKey() ) );
1.2669 -actionSettingsUseDelKey=a;
1.2670 -
1.2671 -a= new QAction( tr( "Exclusive flags","Settings action" ), this);
1.2672 -a->setStatusTip( tr( "Use exclusive flags in flag toolbars" ));
1.2673 -a->setToggleAction(true);
1.2674 -a->setChecked ( settings.value ("/mapeditor/editmode/useFlagGroups",true).toBool() );
1.2675 -settingsMenu->addAction (a);
1.2676 -actionSettingsUseFlagGroups=a;
1.2677 -
1.2678 -a= new QAction( tr( "Use hide flags","Settings action" ), this);
1.2679 -a->setStatusTip( tr( "Use hide flag during exports " ));
1.2680 -a->setToggleAction(true);
1.2681 -a->setChecked ( settings.value ("/export/useHideExport",true).toBool() );
1.2682 -settingsMenu->addAction (a);
1.2683 -actionSettingsUseHideExport=a;
1.2684 -
1.2685 -a = new QAction( tr( "Animation","Settings action"), this);
1.2686 -a->setStatusTip( tr( "Animation"));
1.2687 -a->setToggleAction(true);
1.2688 -a->setChecked (settings.value("/animation/use",true).toBool() );
1.2689 -connect( a, SIGNAL( triggered() ), this, SLOT( settingsToggleAnimation() ) );
1.2690 -settingsMenu->addAction (a);
1.2691 -actionSettingsUseAnimation=a;
1.2692 + QMenu *settingsMenu = menuBar()->addMenu( tr( "&Settings" ));
1.2693 +
1.2694 + QAction *a;
1.2695 +
1.2696 + a = new QAction( tr( "Set application to open pdf files","Settings action"), this);
1.2697 + a->setStatusTip ( tr( "Set application to open pdf files"));
1.2698 + connect( a, SIGNAL( triggered() ), this, SLOT( settingsPDF() ) );
1.2699 + settingsMenu->addAction (a);
1.2700 +
1.2701 + a = new QAction( tr( "Set application to open external links","Settings action"), this);
1.2702 + a->setStatusTip( tr( "Set application to open external links"));
1.2703 + connect( a, SIGNAL( triggered() ), this, SLOT( settingsURL() ) );
1.2704 + settingsMenu->addAction (a);
1.2705 +
1.2706 + a = new QAction( tr( "Set path for macros","Settings action")+"...", this);
1.2707 + a->setStatusTip( tr( "Set path for macros"));
1.2708 + connect( a, SIGNAL( triggered() ), this, SLOT( settingsMacroDir() ) );
1.2709 + settingsMenu->addAction (a);
1.2710 +
1.2711 + a = new QAction( tr( "Set number of undo levels","Settings action")+"...", this);
1.2712 + a->setStatusTip( tr( "Set number of undo levels"));
1.2713 + connect( a, SIGNAL( triggered() ), this, SLOT( settingsUndoLevels() ) );
1.2714 + settingsMenu->addAction (a);
1.2715 +
1.2716 + settingsMenu->addSeparator();
1.2717 +
1.2718 + a = new QAction( tr( "Autosave","Settings action"), this);
1.2719 + a->setStatusTip( tr( "Autosave"));
1.2720 + a->setToggleAction(true);
1.2721 + a->setChecked ( settings.value ("/mainwindow/autosave/use",false).toBool());
1.2722 + connect( a, SIGNAL( triggered() ), this, SLOT( settingsAutosaveToggle() ) );
1.2723 + settingsMenu->addAction (a);
1.2724 + actionSettingsAutosaveToggle=a;
1.2725 +
1.2726 + a = new QAction( tr( "Autosave time","Settings action")+"...", this);
1.2727 + a->setStatusTip( tr( "Autosave time"));
1.2728 + connect( a, SIGNAL( triggered() ), this, SLOT( settingsAutosaveTime() ) );
1.2729 + settingsMenu->addAction (a);
1.2730 + actionSettingsAutosaveTime=a;
1.2731 +
1.2732 + a = new QAction( tr( "Write backup file on save","Settings action"), this);
1.2733 + a->setStatusTip( tr( "Write backup file on save"));
1.2734 + a->setToggleAction(true);
1.2735 + a->setChecked ( settings.value ("/mainwindow/writeBackupFile",false).toBool());
1.2736 + connect( a, SIGNAL( triggered() ), this, SLOT( settingsWriteBackupFileToggle() ) );
1.2737 + settingsMenu->addAction (a);
1.2738 + actionSettingsWriteBackupFile=a;
1.2739 +
1.2740 + settingsMenu->addSeparator();
1.2741 +
1.2742 + a = new QAction( tr( "Edit branch after adding it","Settings action" ), this );
1.2743 + a->setStatusTip( tr( "Edit branch after adding it" ));
1.2744 + a->setToggleAction(true);
1.2745 + a->setChecked ( settings.value ("/mapeditor/editmode/autoEditNewBranch",true).toBool());
1.2746 + settingsMenu->addAction (a);
1.2747 + actionSettingsAutoEditNewBranch=a;
1.2748 +
1.2749 + a= new QAction( tr( "Select branch after adding it","Settings action" ), this );
1.2750 + a->setStatusTip( tr( "Select branch after adding it" ));
1.2751 + a->setToggleAction(true);
1.2752 + a->setChecked ( settings.value ("/mapeditor/editmode/autoSelectNewBranch",false).toBool() );
1.2753 + settingsMenu->addAction (a);
1.2754 + actionSettingsAutoSelectNewBranch=a;
1.2755 +
1.2756 + a= new QAction(tr( "Select existing heading","Settings action" ), this);
1.2757 + a->setStatusTip( tr( "Select heading before editing" ));
1.2758 + a->setToggleAction(true);
1.2759 + a->setChecked ( settings.value ("/mapeditor/editmode/autoSelectText",true).toBool() );
1.2760 + settingsMenu->addAction (a);
1.2761 + actionSettingsAutoSelectText=a;
1.2762 +
1.2763 + a= new QAction( tr( "Delete key","Settings action" ), this);
1.2764 + a->setStatusTip( tr( "Delete key for deleting branches" ));
1.2765 + a->setToggleAction(true);
1.2766 + a->setChecked ( settings.value ("/mapeditor/editmode/useDelKey",true).toBool() );
1.2767 + settingsMenu->addAction (a);
1.2768 + connect( a, SIGNAL( triggered() ), this, SLOT( settingsToggleDelKey() ) );
1.2769 + actionSettingsUseDelKey=a;
1.2770 +
1.2771 + a= new QAction( tr( "Exclusive flags","Settings action" ), this);
1.2772 + a->setStatusTip( tr( "Use exclusive flags in flag toolbars" ));
1.2773 + a->setToggleAction(true);
1.2774 + a->setChecked ( settings.value ("/mapeditor/editmode/useFlagGroups",true).toBool() );
1.2775 + settingsMenu->addAction (a);
1.2776 + actionSettingsUseFlagGroups=a;
1.2777 +
1.2778 + a= new QAction( tr( "Use hide flags","Settings action" ), this);
1.2779 + a->setStatusTip( tr( "Use hide flag during exports " ));
1.2780 + a->setToggleAction(true);
1.2781 + a->setChecked ( settings.value ("/export/useHideExport",true).toBool() );
1.2782 + settingsMenu->addAction (a);
1.2783 + actionSettingsUseHideExport=a;
1.2784 +
1.2785 + a = new QAction( tr( "Animation","Settings action"), this);
1.2786 + a->setStatusTip( tr( "Animation"));
1.2787 + a->setToggleAction(true);
1.2788 + a->setChecked (settings.value("/animation/use",true).toBool() );
1.2789 + connect( a, SIGNAL( triggered() ), this, SLOT( settingsToggleAnimation() ) );
1.2790 + settingsMenu->addAction (a);
1.2791 + actionSettingsUseAnimation=a;
1.2792 }
1.2793
1.2794 // Test Actions
1.2795 void Main::setupTestActions()
1.2796 {
1.2797 -QMenu *testMenu = menuBar()->addMenu( tr( "&Test" ));
1.2798 -
1.2799 -QAction *a;
1.2800 -a = new QAction( "Test function 1" , this);
1.2801 -a->setStatusTip( "Call test function 1" );
1.2802 -a->setShortcut (Qt::CTRL + Qt::Key_T); // Test function 1 //FIXME-2 originally: color subtree
1.2803 -testMenu->addAction (a);
1.2804 -connect( a, SIGNAL( triggered() ), this, SLOT( testFunction1() ) );
1.2805 -
1.2806 -a = new QAction( "Test function 2" , this);
1.2807 -a->setStatusTip( "Call test function 2" );
1.2808 -a->setShortcut (Qt::SHIFT + Qt::Key_T); // Test function 2
1.2809 -testMenu->addAction (a);
1.2810 -connect( a, SIGNAL( triggered() ), this, SLOT( testFunction2() ) );
1.2811 -
1.2812 -a = new QAction( "Command" , this);
1.2813 -a->setStatusTip( "Enter command to call in editor" );
1.2814 -connect( a, SIGNAL( triggered() ), this, SLOT( testCommand() ) );
1.2815 -testMenu->addAction (a);
1.2816 + QMenu *testMenu = menuBar()->addMenu( tr( "&Test" ));
1.2817 +
1.2818 + QAction *a;
1.2819 + a = new QAction( "Test function 1" , this);
1.2820 + a->setStatusTip( "Call test function 1" );
1.2821 + a->setShortcut (Qt::CTRL + Qt::Key_T); // Test function 1 //FIXME-2 originally: color subtree
1.2822 + testMenu->addAction (a);
1.2823 + connect( a, SIGNAL( triggered() ), this, SLOT( testFunction1() ) );
1.2824 +
1.2825 + a = new QAction( "Test function 2" , this);
1.2826 + a->setStatusTip( "Call test function 2" );
1.2827 + a->setShortcut (Qt::SHIFT + Qt::Key_T); // Test function 2
1.2828 + testMenu->addAction (a);
1.2829 + connect( a, SIGNAL( triggered() ), this, SLOT( testFunction2() ) );
1.2830 +
1.2831 + a = new QAction( "Command" , this);
1.2832 + a->setStatusTip( "Enter command to call in editor" );
1.2833 + connect( a, SIGNAL( triggered() ), this, SLOT( testCommand() ) );
1.2834 + testMenu->addAction (a);
1.2835 }
1.2836
1.2837 // Help Actions
1.2838 void Main::setupHelpActions()
1.2839 {
1.2840 -QMenu *helpMenu = menuBar()->addMenu ( tr( "&Help","Help menubar entry" ));
1.2841 -
1.2842 -QAction *a;
1.2843 -a = new QAction( tr( "Open VYM Documentation (pdf) ","Help action" ), this );
1.2844 -a->setStatusTip( tr( "Open VYM Documentation (pdf)" ));
1.2845 -connect( a, SIGNAL( triggered() ), this, SLOT( helpDoc() ) );
1.2846 -helpMenu->addAction (a);
1.2847 -
1.2848 -a = new QAction( tr( "Open VYM example maps ","Help action" ), this );
1.2849 -a->setStatusTip( tr( "Open VYM example maps " ));
1.2850 -connect( a, SIGNAL( triggered() ), this, SLOT( helpDemo() ) );
1.2851 -helpMenu->addAction (a);
1.2852 -
1.2853 -a = new QAction( tr( "About VYM","Help action" ), this);
1.2854 -a->setStatusTip( tr( "About VYM")+vymName);
1.2855 -connect( a, SIGNAL( triggered() ), this, SLOT( helpAbout() ) );
1.2856 -helpMenu->addAction (a);
1.2857 -
1.2858 -a = new QAction( tr( "About QT","Help action" ), this);
1.2859 -a->setStatusTip( tr( "Information about QT toolkit" ));
1.2860 -connect( a, SIGNAL( triggered() ), this, SLOT( helpAboutQT() ) );
1.2861 -helpMenu->addAction (a);
1.2862 + QMenu *helpMenu = menuBar()->addMenu ( tr( "&Help","Help menubar entry" ));
1.2863 +
1.2864 + QAction *a;
1.2865 + a = new QAction( tr( "Open VYM Documentation (pdf) ","Help action" ), this );
1.2866 + a->setStatusTip( tr( "Open VYM Documentation (pdf)" ));
1.2867 + connect( a, SIGNAL( triggered() ), this, SLOT( helpDoc() ) );
1.2868 + helpMenu->addAction (a);
1.2869 +
1.2870 + a = new QAction( tr( "Open VYM example maps ","Help action" ), this );
1.2871 + a->setStatusTip( tr( "Open VYM example maps " ));
1.2872 + connect( a, SIGNAL( triggered() ), this, SLOT( helpDemo() ) );
1.2873 + helpMenu->addAction (a);
1.2874 +
1.2875 + a = new QAction( tr( "About VYM","Help action" ), this);
1.2876 + a->setStatusTip( tr( "About VYM")+vymName);
1.2877 + connect( a, SIGNAL( triggered() ), this, SLOT( helpAbout() ) );
1.2878 + helpMenu->addAction (a);
1.2879 +
1.2880 + a = new QAction( tr( "About QT","Help action" ), this);
1.2881 + a->setStatusTip( tr( "Information about QT toolkit" ));
1.2882 + connect( a, SIGNAL( triggered() ), this, SLOT( helpAboutQT() ) );
1.2883 + helpMenu->addAction (a);
1.2884 }
1.2885
1.2886 // Context Menus
1.2887 void Main::setupContextMenus()
1.2888 {
1.2889 -QAction*a;
1.2890 -
1.2891 -// Context Menu for branch or mapcenter
1.2892 -branchContextMenu =new QMenu (this);
1.2893 -branchContextMenu->addAction (actionViewTogglePropertyWindow);
1.2894 -branchContextMenu->addSeparator();
1.2895 -
1.2896 - // Submenu "Add"
1.2897 - branchAddContextMenu =branchContextMenu->addMenu (tr("Add"));
1.2898 - branchAddContextMenu->addAction (actionPaste );
1.2899 - branchAddContextMenu->addAction ( actionAddMapCenter );
1.2900 - branchAddContextMenu->addAction ( actionAddBranch );
1.2901 - branchAddContextMenu->addAction ( actionAddBranchBefore );
1.2902 - branchAddContextMenu->addAction ( actionAddBranchAbove);
1.2903 - branchAddContextMenu->addAction ( actionAddBranchBelow );
1.2904 - branchAddContextMenu->addSeparator();
1.2905 - branchAddContextMenu->addAction ( actionImportAdd );
1.2906 - branchAddContextMenu->addAction ( actionImportReplace );
1.2907 -
1.2908 - // Submenu "Remove"
1.2909 - branchRemoveContextMenu =branchContextMenu->addMenu (tr ("Remove","Context menu name"));
1.2910 - branchRemoveContextMenu->addAction (actionCut);
1.2911 - branchRemoveContextMenu->addAction ( actionDelete );
1.2912 - branchRemoveContextMenu->addAction ( actionDeleteKeepChildren );
1.2913 - branchRemoveContextMenu->addAction ( actionDeleteChildren );
1.2914 -
1.2915 -
1.2916 -actionSaveBranch->addTo( branchContextMenu );
1.2917 -actionFileNewCopy->addTo (branchContextMenu );
1.2918 -actionDetach->addTo (branchContextMenu );
1.2919 -
1.2920 -branchContextMenu->addSeparator();
1.2921 -branchContextMenu->addAction ( actionLoadImage);
1.2922 -
1.2923 -// Submenu for Links (URLs, vymLinks)
1.2924 -branchLinksContextMenu =new QMenu (this);
1.2925 -
1.2926 + QAction*a;
1.2927 +
1.2928 + // Context Menu for branch or mapcenter
1.2929 + branchContextMenu =new QMenu (this);
1.2930 + branchContextMenu->addAction (actionViewTogglePropertyWindow);
1.2931 branchContextMenu->addSeparator();
1.2932 - branchLinksContextMenu=branchContextMenu->addMenu(tr("References (URLs, vymLinks, ...)","Context menu name"));
1.2933 - branchLinksContextMenu->addAction ( actionOpenURL );
1.2934 - branchLinksContextMenu->addAction ( actionOpenURLTab );
1.2935 - branchLinksContextMenu->addAction ( actionOpenMultipleURLTabs );
1.2936 - branchLinksContextMenu->addAction ( actionURL );
1.2937 - branchLinksContextMenu->addAction ( actionLocalURL );
1.2938 - branchLinksContextMenu->addAction ( actionHeading2URL );
1.2939 - branchLinksContextMenu->addAction ( actionBugzilla2URL );
1.2940 - if (settings.value( "/mainwindow/showTestMenu",false).toBool() )
1.2941 +
1.2942 + // Submenu "Add"
1.2943 + branchAddContextMenu =branchContextMenu->addMenu (tr("Add"));
1.2944 + branchAddContextMenu->addAction (actionPaste );
1.2945 + branchAddContextMenu->addAction ( actionAddMapCenter );
1.2946 + branchAddContextMenu->addAction ( actionAddBranch );
1.2947 + branchAddContextMenu->addAction ( actionAddBranchBefore );
1.2948 + branchAddContextMenu->addAction ( actionAddBranchAbove);
1.2949 + branchAddContextMenu->addAction ( actionAddBranchBelow );
1.2950 + branchAddContextMenu->addSeparator();
1.2951 + branchAddContextMenu->addAction ( actionImportAdd );
1.2952 + branchAddContextMenu->addAction ( actionImportReplace );
1.2953 +
1.2954 + // Submenu "Remove"
1.2955 + branchRemoveContextMenu =branchContextMenu->addMenu (tr ("Remove","Context menu name"));
1.2956 + branchRemoveContextMenu->addAction (actionCut);
1.2957 + branchRemoveContextMenu->addAction ( actionDelete );
1.2958 + branchRemoveContextMenu->addAction ( actionDeleteKeepChildren );
1.2959 + branchRemoveContextMenu->addAction ( actionDeleteChildren );
1.2960 +
1.2961 +
1.2962 + actionSaveBranch->addTo( branchContextMenu );
1.2963 + actionFileNewCopy->addTo (branchContextMenu );
1.2964 + actionDetach->addTo (branchContextMenu );
1.2965 +
1.2966 + branchContextMenu->addSeparator();
1.2967 + branchContextMenu->addAction ( actionLoadImage);
1.2968 +
1.2969 + // Submenu for Links (URLs, vymLinks)
1.2970 + branchLinksContextMenu =new QMenu (this);
1.2971 +
1.2972 + branchContextMenu->addSeparator();
1.2973 + branchLinksContextMenu=branchContextMenu->addMenu(tr("References (URLs, vymLinks, ...)","Context menu name"));
1.2974 + branchLinksContextMenu->addAction ( actionOpenURL );
1.2975 + branchLinksContextMenu->addAction ( actionOpenURLTab );
1.2976 + branchLinksContextMenu->addAction ( actionOpenMultipleURLTabs );
1.2977 + branchLinksContextMenu->addAction ( actionURL );
1.2978 + branchLinksContextMenu->addAction ( actionLocalURL );
1.2979 + branchLinksContextMenu->addAction ( actionHeading2URL );
1.2980 + branchLinksContextMenu->addAction ( actionBugzilla2URL );
1.2981 + if (settings.value( "/mainwindow/showTestMenu",false).toBool() )
1.2982 + {
1.2983 + branchLinksContextMenu->addAction ( actionFATE2URL );
1.2984 + }
1.2985 + branchLinksContextMenu->addSeparator();
1.2986 + branchLinksContextMenu->addAction ( actionOpenVymLink );
1.2987 + branchLinksContextMenu->addAction ( actionOpenMultipleVymLinks );
1.2988 + branchLinksContextMenu->addAction ( actionVymLink );
1.2989 + branchLinksContextMenu->addAction ( actionDeleteVymLink );
1.2990 +
1.2991 +
1.2992 + // Context Menu for XLinks in a branch menu
1.2993 + // This will be populated "on demand" in MapEditor::updateActions
1.2994 + branchContextMenu->addSeparator();
1.2995 + branchXLinksContextMenuEdit =branchContextMenu->addMenu (tr ("Edit XLink","Context menu name"));
1.2996 + branchXLinksContextMenuFollow =branchContextMenu->addMenu (tr ("Follow XLink","Context menu name"));
1.2997 + connect( branchXLinksContextMenuFollow, SIGNAL( triggered(QAction *) ), this, SLOT( editFollowXLink(QAction * ) ) );
1.2998 + connect( branchXLinksContextMenuEdit, SIGNAL( triggered(QAction *) ), this, SLOT( editEditXLink(QAction * ) ) );
1.2999 +
1.3000 +
1.3001 + // Context menu for floatimage
1.3002 + floatimageContextMenu =new QMenu (this);
1.3003 + a= new QAction (tr ("Save image","Context action"),this);
1.3004 + connect (a, SIGNAL (triggered()), this, SLOT (editSaveImage()));
1.3005 + floatimageContextMenu->addAction (a);
1.3006 +
1.3007 + floatimageContextMenu->addSeparator();
1.3008 + actionCopy->addTo( floatimageContextMenu );
1.3009 + actionCut->addTo( floatimageContextMenu );
1.3010 +
1.3011 + floatimageContextMenu->addSeparator();
1.3012 + floatimageContextMenu->addAction ( actionFormatHideLinkUnselected );
1.3013 +
1.3014 +
1.3015 + // Context menu for canvas
1.3016 + canvasContextMenu =new QMenu (this);
1.3017 + actionAddMapCenter->addTo( canvasContextMenu );
1.3018 + actionMapInfo->addTo( canvasContextMenu );
1.3019 + canvasContextMenu->insertSeparator();
1.3020 + actionGroupFormatLinkStyles->addTo( canvasContextMenu );
1.3021 + canvasContextMenu->insertSeparator();
1.3022 + actionFormatLinkColorHint->addTo( canvasContextMenu );
1.3023 + actionFormatLinkColor->addTo( canvasContextMenu );
1.3024 + actionFormatSelectionColor->addTo( canvasContextMenu );
1.3025 + actionFormatBackColor->addTo( canvasContextMenu );
1.3026 + // actionFormatBackImage->addTo( canvasContextMenu ); //FIXME-4 makes vym too slow: postponed for later version
1.3027 +
1.3028 + // Menu for last opened files
1.3029 + // Create actions
1.3030 + for (int i = 0; i < MaxRecentFiles; ++i)
1.3031 {
1.3032 - branchLinksContextMenu->addAction ( actionFATE2URL );
1.3033 - }
1.3034 - branchLinksContextMenu->addSeparator();
1.3035 - branchLinksContextMenu->addAction ( actionOpenVymLink );
1.3036 - branchLinksContextMenu->addAction ( actionOpenMultipleVymLinks );
1.3037 - branchLinksContextMenu->addAction ( actionVymLink );
1.3038 - branchLinksContextMenu->addAction ( actionDeleteVymLink );
1.3039 -
1.3040 -
1.3041 -// Context Menu for XLinks in a branch menu
1.3042 -// This will be populated "on demand" in MapEditor::updateActions
1.3043 -branchContextMenu->addSeparator();
1.3044 -branchXLinksContextMenuEdit =branchContextMenu->addMenu (tr ("Edit XLink","Context menu name"));
1.3045 -branchXLinksContextMenuFollow =branchContextMenu->addMenu (tr ("Follow XLink","Context menu name"));
1.3046 -connect( branchXLinksContextMenuFollow, SIGNAL( triggered(QAction *) ), this, SLOT( editFollowXLink(QAction * ) ) );
1.3047 -connect( branchXLinksContextMenuEdit, SIGNAL( triggered(QAction *) ), this, SLOT( editEditXLink(QAction * ) ) );
1.3048 -
1.3049 -
1.3050 -// Context menu for floatimage
1.3051 -floatimageContextMenu =new QMenu (this);
1.3052 -a= new QAction (tr ("Save image","Context action"),this);
1.3053 -connect (a, SIGNAL (triggered()), this, SLOT (editSaveImage()));
1.3054 -floatimageContextMenu->addAction (a);
1.3055 -
1.3056 -floatimageContextMenu->addSeparator();
1.3057 -actionCopy->addTo( floatimageContextMenu );
1.3058 -actionCut->addTo( floatimageContextMenu );
1.3059 -
1.3060 -floatimageContextMenu->addSeparator();
1.3061 -floatimageContextMenu->addAction ( actionFormatHideLinkUnselected );
1.3062 -
1.3063 -
1.3064 -// Context menu for canvas
1.3065 -canvasContextMenu =new QMenu (this);
1.3066 -actionAddMapCenter->addTo( canvasContextMenu );
1.3067 -actionMapInfo->addTo( canvasContextMenu );
1.3068 -canvasContextMenu->insertSeparator();
1.3069 -actionGroupFormatLinkStyles->addTo( canvasContextMenu );
1.3070 -canvasContextMenu->insertSeparator();
1.3071 -actionFormatLinkColorHint->addTo( canvasContextMenu );
1.3072 -actionFormatLinkColor->addTo( canvasContextMenu );
1.3073 -actionFormatSelectionColor->addTo( canvasContextMenu );
1.3074 -actionFormatBackColor->addTo( canvasContextMenu );
1.3075 -// actionFormatBackImage->addTo( canvasContextMenu ); //FIXME-4 makes vym too slow: postponed for later version
1.3076 -
1.3077 -// Menu for last opened files
1.3078 -// Create actions
1.3079 -for (int i = 0; i < MaxRecentFiles; ++i)
1.3080 -{
1.3081 - recentFileActions[i] = new QAction(this);
1.3082 - recentFileActions[i]->setVisible(false);
1.3083 - fileLastMapsMenu->addAction(recentFileActions[i]);
1.3084 - connect(recentFileActions[i], SIGNAL(triggered()),
1.3085 - this, SLOT(fileLoadRecent()));
1.3086 -}
1.3087 -setupRecentMapsMenu();
1.3088 + recentFileActions[i] = new QAction(this);
1.3089 + recentFileActions[i]->setVisible(false);
1.3090 + fileLastMapsMenu->addAction(recentFileActions[i]);
1.3091 + connect(recentFileActions[i], SIGNAL(triggered()),
1.3092 + this, SLOT(fileLoadRecent()));
1.3093 + }
1.3094 + setupRecentMapsMenu();
1.3095 }
1.3096
1.3097 void Main::setupRecentMapsMenu()
1.3098 {
1.3099 -QStringList files = settings.value("/mainwindow/recentFileList").toStringList();
1.3100 -
1.3101 -int numRecentFiles = qMin(files.size(), (int)MaxRecentFiles);
1.3102 -
1.3103 -for (int i = 0; i < numRecentFiles; ++i) {
1.3104 - QString text = tr("&%1 %2").arg(i + 1).arg(files[i]);
1.3105 - recentFileActions[i]->setText(text);
1.3106 - recentFileActions[i]->setData(files[i]);
1.3107 - recentFileActions[i]->setVisible(true);
1.3108 -}
1.3109 -for (int j = numRecentFiles; j < MaxRecentFiles; ++j)
1.3110 - recentFileActions[j]->setVisible(false);
1.3111 + QStringList files = settings.value("/mainwindow/recentFileList").toStringList();
1.3112 +
1.3113 + int numRecentFiles = qMin(files.size(), (int)MaxRecentFiles);
1.3114 +
1.3115 + for (int i = 0; i < numRecentFiles; ++i) {
1.3116 + QString text = tr("&%1 %2").arg(i + 1).arg(files[i]);
1.3117 + recentFileActions[i]->setText(text);
1.3118 + recentFileActions[i]->setData(files[i]);
1.3119 + recentFileActions[i]->setVisible(true);
1.3120 + }
1.3121 + for (int j = numRecentFiles; j < MaxRecentFiles; ++j)
1.3122 + recentFileActions[j]->setVisible(false);
1.3123 }
1.3124
1.3125 void Main::setupMacros()
1.3126 {
1.3127 -for (int i = 0; i <= 11; i++)
1.3128 -{
1.3129 - macroActions[i] = new QAction(this);
1.3130 - macroActions[i]->setData(i);
1.3131 - addAction (macroActions[i]);
1.3132 - connect(macroActions[i], SIGNAL(triggered()),
1.3133 - this, SLOT(callMacro()));
1.3134 -}
1.3135 -macroActions[0]->setShortcut ( Qt::Key_F1 );
1.3136 -macroActions[1]->setShortcut ( Qt::Key_F2 );
1.3137 -macroActions[2]->setShortcut ( Qt::Key_F3 );
1.3138 -macroActions[3]->setShortcut ( Qt::Key_F4 );
1.3139 -macroActions[4]->setShortcut ( Qt::Key_F5 );
1.3140 -macroActions[5]->setShortcut ( Qt::Key_F6 );
1.3141 -macroActions[6]->setShortcut ( Qt::Key_F7 );
1.3142 -macroActions[7]->setShortcut ( Qt::Key_F8 );
1.3143 -macroActions[8]->setShortcut ( Qt::Key_F9 );
1.3144 -macroActions[9]->setShortcut ( Qt::Key_F10 );
1.3145 -macroActions[10]->setShortcut ( Qt::Key_F11 );
1.3146 -macroActions[11]->setShortcut ( Qt::Key_F12 );
1.3147 + for (int i = 0; i <= 11; i++)
1.3148 + {
1.3149 + macroActions[i] = new QAction(this);
1.3150 + macroActions[i]->setData(i);
1.3151 + addAction (macroActions[i]);
1.3152 + connect(macroActions[i], SIGNAL(triggered()),
1.3153 + this, SLOT(callMacro()));
1.3154 + }
1.3155 + macroActions[0]->setShortcut ( Qt::Key_F1 );
1.3156 + macroActions[1]->setShortcut ( Qt::Key_F2 );
1.3157 + macroActions[2]->setShortcut ( Qt::Key_F3 );
1.3158 + macroActions[3]->setShortcut ( Qt::Key_F4 );
1.3159 + macroActions[4]->setShortcut ( Qt::Key_F5 );
1.3160 + macroActions[5]->setShortcut ( Qt::Key_F6 );
1.3161 + macroActions[6]->setShortcut ( Qt::Key_F7 );
1.3162 + macroActions[7]->setShortcut ( Qt::Key_F8 );
1.3163 + macroActions[8]->setShortcut ( Qt::Key_F9 );
1.3164 + macroActions[9]->setShortcut ( Qt::Key_F10 );
1.3165 + macroActions[10]->setShortcut ( Qt::Key_F11 );
1.3166 + macroActions[11]->setShortcut ( Qt::Key_F12 );
1.3167 }
1.3168
1.3169 void Main::hideEvent (QHideEvent * )
1.3170 {
1.3171 -if (!textEditor->isMinimized() ) textEditor->hide();
1.3172 + if (!textEditor->isMinimized() ) textEditor->hide();
1.3173 }
1.3174
1.3175 void Main::showEvent (QShowEvent * )
1.3176 {
1.3177 -if (actionViewToggleNoteEditor->isOn()) textEditor->showNormal();
1.3178 + if (actionViewToggleNoteEditor->isOn()) textEditor->showNormal();
1.3179 }
1.3180
1.3181
1.3182 MapEditor* Main::currentMapEditor() const
1.3183 {
1.3184 -if ( tabWidget->currentPage())
1.3185 - return vymViews.at(tabWidget->currentIndex())->getMapEditor();
1.3186 -return NULL;
1.3187 + if ( tabWidget->currentPage())
1.3188 + return vymViews.at(tabWidget->currentIndex())->getMapEditor();
1.3189 + return NULL;
1.3190 }
1.3191
1.3192 VymModel* Main::currentModel() const
1.3193 {
1.3194 -if ( tabWidget->currentPage())
1.3195 - return vymViews.at(tabWidget->currentIndex())->getModel();
1.3196 -return NULL;
1.3197 + if ( tabWidget->currentPage())
1.3198 + return vymViews.at(tabWidget->currentIndex())->getModel();
1.3199 + return NULL;
1.3200 }
1.3201
1.3202
1.3203 void Main::editorChanged(QWidget *)
1.3204 {
1.3205 -// Unselect all possibly selected objects
1.3206 -// (Important to update note editor)
1.3207 -VymModel *m;
1.3208 -for (int i=0;i<=tabWidget->count() -1;i++)
1.3209 -{
1.3210 - m= vymViews.at(i)->getModel();
1.3211 - if (m) m->unselect();
1.3212 -}
1.3213 -m=currentModel();
1.3214 -if (m) m->reselect();
1.3215 -
1.3216 -// Update actions to in menus and toolbars according to editor
1.3217 -updateActions();
1.3218 + // Unselect all possibly selected objects
1.3219 + // (Important to update note editor)
1.3220 + VymModel *m;
1.3221 + for (int i=0;i<=tabWidget->count() -1;i++)
1.3222 + {
1.3223 + m= vymViews.at(i)->getModel();
1.3224 + if (m) m->unselect();
1.3225 + }
1.3226 + m=currentModel();
1.3227 + if (m) m->reselect();
1.3228 +
1.3229 + // Update actions to in menus and toolbars according to editor
1.3230 + updateActions();
1.3231 }
1.3232
1.3233 void Main::fileNew()
1.3234 {
1.3235 -VymModel *vm=new VymModel;
1.3236 -
1.3237 -/////////////////////////////////////
1.3238 -new ModelTest(vm, this); //FIXME-3
1.3239 -/////////////////////////////////////
1.3240 -
1.3241 -
1.3242 -VymView *vv=new VymView (vm);
1.3243 -vymViews.append (vv);
1.3244 -tabWidget->addTab (vv,tr("unnamed","MainWindow: name for new and empty file"));
1.3245 -tabWidget->setCurrentIndex (vymViews.count() );
1.3246 -vv->initFocus();
1.3247 -
1.3248 -// Create MapCenter for empty map
1.3249 -vm->addMapCenter();
1.3250 -vm->makeDefault();
1.3251 -
1.3252 -// For the very first map we do not have flagrows yet...
1.3253 -vm->select("mc:");
1.3254 + VymModel *vm=new VymModel;
1.3255 +
1.3256 + /////////////////////////////////////
1.3257 + new ModelTest(vm, this); //FIXME-3
1.3258 + /////////////////////////////////////
1.3259 +
1.3260 + VymView *vv=new VymView (vm);
1.3261 + vymViews.append (vv);
1.3262 + tabWidget->addTab (vv,tr("unnamed","MainWindow: name for new and empty file"));
1.3263 + tabWidget->setCurrentIndex (vymViews.count() );
1.3264 + vv->initFocus();
1.3265 +
1.3266 + // Create MapCenter for empty map
1.3267 + vm->addMapCenter();
1.3268 + vm->makeDefault();
1.3269 +
1.3270 + // For the very first map we do not have flagrows yet...
1.3271 + vm->select("mc:");
1.3272 }
1.3273
1.3274 void Main::fileNewCopy()
1.3275 {
1.3276 -QString fn="unnamed";
1.3277 -VymModel *srcModel=currentModel();
1.3278 -if (srcModel)
1.3279 -{
1.3280 - srcModel->copy();
1.3281 - fileNew();
1.3282 - VymModel *dstModel=vymViews.last()->getModel();
1.3283 - dstModel->select("mc:");
1.3284 - dstModel->load (clipboardDir+"/"+clipboardFile,ImportReplace, VymMap);
1.3285 -}
1.3286 + QString fn="unnamed";
1.3287 + VymModel *srcModel=currentModel();
1.3288 + if (srcModel)
1.3289 + {
1.3290 + srcModel->copy();
1.3291 + fileNew();
1.3292 + VymModel *dstModel=vymViews.last()->getModel();
1.3293 + dstModel->select("mc:");
1.3294 + dstModel->load (clipboardDir+"/"+clipboardFile,ImportReplace, VymMap);
1.3295 + }
1.3296 }
1.3297
1.3298 ErrorCode Main::fileLoad(QString fn, const LoadMode &lmode, const FileType &ftype)
1.3299 {
1.3300 -ErrorCode err=success;
1.3301 -
1.3302 -// fn is usually the archive, mapfile the file after uncompressing
1.3303 -QString mapfile;
1.3304 -
1.3305 -// Make fn absolute (needed for unzip)
1.3306 -fn=QDir (fn).absPath();
1.3307 -
1.3308 -VymModel *vm;
1.3309 -
1.3310 -if (lmode==NewMap)
1.3311 -{
1.3312 - // Check, if map is already loaded
1.3313 - int i=0;
1.3314 - while (i<=tabWidget->count() -1)
1.3315 + ErrorCode err=success;
1.3316 +
1.3317 + // fn is usually the archive, mapfile the file after uncompressing
1.3318 + QString mapfile;
1.3319 +
1.3320 + // Make fn absolute (needed for unzip)
1.3321 + fn=QDir (fn).absPath();
1.3322 +
1.3323 + VymModel *vm;
1.3324 +
1.3325 + if (lmode==NewMap)
1.3326 {
1.3327 - if (vymViews.at(i)->getModel()->getFilePath() == fn)
1.3328 + // Check, if map is already loaded
1.3329 + int i=0;
1.3330 + while (i<=tabWidget->count() -1)
1.3331 {
1.3332 - // Already there, ask for confirmation
1.3333 - QMessageBox mb( vymName,
1.3334 - tr("The map %1\nis already opened."
1.3335 - "Opening the same map in multiple editors may lead \n"
1.3336 - "to confusion when finishing working with vym."
1.3337 - "Do you want to").arg(fn),
1.3338 - QMessageBox::Warning,
1.3339 - QMessageBox::Yes | QMessageBox::Default,
1.3340 - QMessageBox::Cancel | QMessageBox::Escape,
1.3341 - QMessageBox::NoButton);
1.3342 - mb.setButtonText( QMessageBox::Yes, tr("Open anyway") );
1.3343 - mb.setButtonText( QMessageBox::Cancel, tr("Cancel"));
1.3344 - switch( mb.exec() )
1.3345 + if (vymViews.at(i)->getModel()->getFilePath() == fn)
1.3346 {
1.3347 - case QMessageBox::Yes:
1.3348 - // end loop and load anyway
1.3349 - i=tabWidget->count();
1.3350 - break;
1.3351 - case QMessageBox::Cancel:
1.3352 - // do nothing
1.3353 - return aborted;
1.3354 - break;
1.3355 + // Already there, ask for confirmation
1.3356 + QMessageBox mb( vymName,
1.3357 + tr("The map %1\nis already opened."
1.3358 + "Opening the same map in multiple editors may lead \n"
1.3359 + "to confusion when finishing working with vym."
1.3360 + "Do you want to").arg(fn),
1.3361 + QMessageBox::Warning,
1.3362 + QMessageBox::Yes | QMessageBox::Default,
1.3363 + QMessageBox::Cancel | QMessageBox::Escape,
1.3364 + QMessageBox::NoButton);
1.3365 + mb.setButtonText( QMessageBox::Yes, tr("Open anyway") );
1.3366 + mb.setButtonText( QMessageBox::Cancel, tr("Cancel"));
1.3367 + switch( mb.exec() )
1.3368 + {
1.3369 + case QMessageBox::Yes:
1.3370 + // end loop and load anyway
1.3371 + i=tabWidget->count();
1.3372 + break;
1.3373 + case QMessageBox::Cancel:
1.3374 + // do nothing
1.3375 + return aborted;
1.3376 + break;
1.3377 + }
1.3378 }
1.3379 + i++;
1.3380 }
1.3381 - i++;
1.3382 }
1.3383 -}
1.3384 -
1.3385 -int tabIndex=tabWidget->currentPageIndex();
1.3386 +
1.3387 + int tabIndex=tabWidget->currentPageIndex();
1.3388
1.3389 // Try to load map
1.3390 if ( !fn.isEmpty() )
1.3391 @@ -2489,35 +2479,10 @@
1.3392 if (m) m->cut();
1.3393 }
1.3394
1.3395 -void Main::editOpenFindWindow()
1.3396 -{
1.3397 - findWindow->popup();
1.3398 - findWindow->raise();
1.3399 - findWindow->setActiveWindow();
1.3400 -}
1.3401 -
1.3402 -void Main::editFind(QString s)
1.3403 +void Main::editOpenFindWidget()
1.3404 {
1.3405 VymModel *m=currentModel();
1.3406 - if (m)
1.3407 - {
1.3408 - bool cs=false;
1.3409 - BranchItem *bi=m->findText(s, cs);
1.3410 - if (bi)
1.3411 - {
1.3412 - statusBar()->message( "Found: " + bi->getHeading(), statusbarTime );
1.3413 - } else
1.3414 - {
1.3415 - QMessageBox::information( findWindow, tr( "VYM -Information:" ),
1.3416 - tr("No matches found for \"%1\"").arg(s));
1.3417 - }
1.3418 - }
1.3419 -}
1.3420 -
1.3421 -void Main::editFindChanged()
1.3422 -{ // Notify editor, to abort the current find process
1.3423 - VymModel *m=currentModel();
1.3424 - if (m) m->findReset();
1.3425 + if (m) m->emitShowFindWidget();
1.3426 }
1.3427
1.3428 void Main::openTabs(QStringList urls)