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