1.1 --- a/adaptormodel.cpp Tue Nov 17 08:24:59 2009 +0000
1.2 +++ b/adaptormodel.cpp Wed Nov 25 10:58:21 2009 +0000
1.3 @@ -5,6 +5,8 @@
1.4
1.5 #include "vymmodel.h"
1.6
1.7 +extern QString vymInstanceName;
1.8 +
1.9 AdaptorModel::AdaptorModel(QObject *obj)
1.10 : QDBusAbstractAdaptor(obj)
1.11 {
1.12 @@ -60,3 +62,16 @@
1.13 model->setHeading(s);
1.14 }
1.15
1.16 +QDBusVariant AdaptorModel::getInstanceName()
1.17 +{
1.18 + return QDBusVariant (vymInstanceName);
1.19 +}
1.20 +
1.21 +QDBusVariant AdaptorModel::execute (const QString &s)
1.22 +{
1.23 + if (model)
1.24 + return QDBusVariant (model->runScript (s));
1.25 + else
1.26 + return QDBusVariant ("No model.");
1.27 +}
1.28 +
2.1 --- a/adaptormodel.h Tue Nov 17 08:24:59 2009 +0000
2.2 +++ b/adaptormodel.h Wed Nov 25 10:58:21 2009 +0000
2.3 @@ -30,6 +30,8 @@
2.4 QDBusVariant query(const QString &query);
2.5 QDBusVariant getHeading();
2.6 void setHeading (const QString &s);
2.7 + QDBusVariant getInstanceName();
2.8 + QDBusVariant execute (const QString &s);
2.9
2.10 Q_SIGNALS: // SIGNALS
2.11 void crashed();
3.1 Binary file demos/vym-contribute.vym has changed
4.1 --- a/exports.cpp Tue Nov 17 08:24:59 2009 +0000
4.2 +++ b/exports.cpp Wed Nov 25 10:58:21 2009 +0000
4.3 @@ -125,6 +125,111 @@
4.4 }
4.5
4.6 ////////////////////////////////////////////////////////////////////////
4.7 +ExportAO::ExportAO()
4.8 +{
4.9 + filter="TXT (*.txt)";
4.10 + caption=vymName+ " -" +QObject::tr("Export as ASCII")+" "+QObject::tr("(still experimental)");
4.11 +}
4.12 +
4.13 +void ExportAO::doExport()
4.14 +{
4.15 + QFile file (outputFile);
4.16 + if ( !file.open( QIODevice::WriteOnly ) )
4.17 + {
4.18 + qWarning ("ExportAO::doExport couldn't open "+outputFile);
4.19 + return;
4.20 + }
4.21 + QTextStream ts( &file ); // use LANG decoding here...
4.22 +
4.23 + // Main loop over all branches
4.24 + QString s;
4.25 + QString curIndent;
4.26 + int i;
4.27 + BranchItem *cur=NULL;
4.28 + BranchItem *prev=NULL;
4.29 +
4.30 + QString colString;
4.31 + QColor col;
4.32 +
4.33 + cur=model->nextBranch (cur,prev);
4.34 + while (cur)
4.35 + {
4.36 + if (cur->getType()==TreeItem::Branch || cur->getType()==TreeItem::MapCenter)
4.37 + {
4.38 + // Make indentstring
4.39 + curIndent="";
4.40 + for (i=0;i<cur->depth()-1;i++) curIndent+= indentPerDepth;
4.41 +
4.42 + if (!cur->hasHiddenExportParent() )
4.43 + {
4.44 + col=cur->getHeadingColor();
4.45 + if (col==QColor (255,0,0))
4.46 + colString="[R]";
4.47 + else if (col==QColor (217,81,0))
4.48 + colString="[O]";
4.49 + else if (col==QColor (0,85,0))
4.50 + colString="[G]";
4.51 + else
4.52 + colString="[?]";
4.53 + switch (cur->depth())
4.54 + {
4.55 + case 0:
4.56 + //ts << underline (cur->getHeading(),QString("="));
4.57 + //ts << "\n";
4.58 + break;
4.59 + case 1:
4.60 + //ts << "\n";
4.61 + //ts << (underline ( cur->getHeading(), QString("-") ) );
4.62 + //ts << "\n";
4.63 + break;
4.64 + case 2: // Main heading
4.65 + ts << "\n";
4.66 + ts << underline ( cur->getHeading(), QString("=") );
4.67 + ts << "\n\n";
4.68 + break;
4.69 + case 3: // Achievement, Bonus, Objective ...
4.70 + ts << underline ( cur->getHeading(), "-");
4.71 + ts << "\n\n";
4.72 + break;
4.73 + case 4: // That's the item we need to know
4.74 + ts << (curIndent + "* " + colString+" "+ cur->getHeading());
4.75 + if (cur->isActiveStandardFlag ("hook-green"))
4.76 + ts << " [DONE] ";
4.77 + else if (cur->isActiveStandardFlag ("clock"))
4.78 + ts << " [WIP] ";
4.79 + else if (cur->isActiveStandardFlag ("cross-red"))
4.80 + ts << " [NOT STARTED] ";
4.81 + ts << "\n";
4.82 + default:
4.83 + break;
4.84 + ts << (curIndent + "- " + cur->getHeading());
4.85 + ts << "\n";
4.86 + break;
4.87 + }
4.88 +
4.89 + // If necessary, write note
4.90 + if (!cur->getNoteObj().isEmpty())
4.91 + {
4.92 + curIndent +=" | ";
4.93 + s=cur->getNoteASCII( curIndent, 80);
4.94 + ts << s;
4.95 + }
4.96 + }
4.97 + }
4.98 + cur=model->nextBranch(cur,prev);
4.99 + }
4.100 + file.close();
4.101 +}
4.102 +
4.103 +QString ExportAO::underline (const QString &text, const QString &line)
4.104 +{
4.105 + QString r=text + "\n";
4.106 + for (int j=0;j<text.length();j++) r+=line;
4.107 + return r;
4.108 +}
4.109 +
4.110 +
4.111 +////////////////////////////////////////////////////////////////////////
4.112 ExportASCII::ExportASCII()
4.113 {
4.114 filter="TXT (*.txt)";
4.115 @@ -136,7 +241,7 @@
4.116 QFile file (outputFile);
4.117 if ( !file.open( QIODevice::WriteOnly ) )
4.118 {
4.119 - qWarning ("ExportBase::exportXML couldn't open "+outputFile);
4.120 + qWarning ("ExportASCII::doExport couldn't open "+outputFile);
4.121 return;
4.122 }
4.123 QTextStream ts( &file ); // use LANG decoding here...
5.1 --- a/exports.h Tue Nov 17 08:24:59 2009 +0000
5.2 +++ b/exports.h Wed Nov 25 10:58:21 2009 +0000
5.3 @@ -41,6 +41,15 @@
5.4 };
5.5
5.6 ///////////////////////////////////////////////////////////////////////
5.7 +class ExportAO:public ExportBase
5.8 +{
5.9 +public:
5.10 + ExportAO();
5.11 + virtual void doExport();
5.12 + virtual QString underline (const QString &text, const QString &line);
5.13 +};
5.14 +
5.15 +///////////////////////////////////////////////////////////////////////
5.16 class ExportASCII:public ExportBase
5.17 {
5.18 public:
6.1 --- a/findwindow.cpp Tue Nov 17 08:24:59 2009 +0000
6.2 +++ b/findwindow.cpp Wed Nov 25 10:58:21 2009 +0000
6.3 @@ -8,24 +8,25 @@
6.4 extern QString vymName;
6.5
6.6 FindWindow::FindWindow(QWidget* parent)
6.7 - : QGroupBox( tr("Find"), parent )
6.8 + //: QGroupBox( tr("Find"), parent )
6.9
6.10 {
6.11 - setWindowTitle(vymName + " - " +tr("Find Text"));
6.12 + //setWindowTitle(vymName + " - " +tr("Find Text"));
6.13
6.14 QVBoxLayout* mainLayout = new QVBoxLayout;
6.15
6.16 QHBoxLayout *row1Layout = new QHBoxLayout;
6.17 + /*
6.18 // Create a Label
6.19 QLabel* label = new QLabel;
6.20 label->setText( tr("Text to find:"));
6.21 row1Layout->addWidget( label );
6.22 -
6.23 + */
6.24
6.25 // Create LineEdit (here QComboBox)
6.26 QHBoxLayout *row2Layout = new QHBoxLayout;
6.27 findcombo = new QComboBox;
6.28 - findcombo->setMinimumWidth(150);
6.29 + findcombo->setMinimumWidth(250);
6.30 findcombo->setEditable(true);
6.31 connect ( findcombo, SIGNAL( highlighted(int) ),
6.32 this, SLOT( findPressed() ) );
6.33 @@ -35,17 +36,17 @@
6.34 row2Layout->addWidget(findcombo);
6.35
6.36 // Create Buttons
6.37 - QHBoxLayout *row3Layout = new QHBoxLayout;
6.38 + //QHBoxLayout *row3Layout = new QHBoxLayout;
6.39 clearbutton = new QPushButton;
6.40 clearbutton->setText(tr("Clear"));
6.41 connect ( clearbutton, SIGNAL( clicked() ), this, SLOT( clearLineEdit() ) );
6.42 - row3Layout->addWidget (clearbutton);
6.43 + row2Layout->addWidget (clearbutton);
6.44
6.45 cancelbutton = new QPushButton;
6.46 cancelbutton->setText(tr("Cancel"));
6.47 cancelbutton->setShortcut (Qt::Key_Escape);
6.48 connect ( cancelbutton, SIGNAL( clicked() ), this, SLOT( cancelPressed() ) );
6.49 - row3Layout->addWidget (cancelbutton);
6.50 + row2Layout->addWidget (cancelbutton);
6.51
6.52 findbutton = new QPushButton;
6.53 findbutton->setText (tr("Find"));
6.54 @@ -53,12 +54,12 @@
6.55 findbutton->setShortcut (Qt::Key_Return);
6.56 connect ( findbutton, SIGNAL( clicked() ), this, SLOT( findPressed() ) );
6.57
6.58 - row3Layout->addStretch(2);
6.59 - row3Layout->addWidget(findbutton);
6.60 + //row2Layout->addStretch(2);
6.61 + row2Layout->addWidget(findbutton);
6.62
6.63 mainLayout->addLayout (row1Layout);
6.64 mainLayout->addLayout (row2Layout);
6.65 - mainLayout->addLayout (row3Layout);
6.66 + //mainLayout->addLayout (row3Layout);
6.67 setLayout (mainLayout);
6.68 }
6.69
7.1 --- a/findwindow.h Tue Nov 17 08:24:59 2009 +0000
7.2 +++ b/findwindow.h Wed Nov 25 10:58:21 2009 +0000
7.3 @@ -9,7 +9,7 @@
7.4 #include <QLabel>
7.5
7.6
7.7 -class FindWindow : public QGroupBox
7.8 +class FindWindow : public QWidget
7.9 {
7.10 Q_OBJECT
7.11
8.1 --- a/highlighter.cpp Tue Nov 17 08:24:59 2009 +0000
8.2 +++ b/highlighter.cpp Wed Nov 25 10:58:21 2009 +0000
8.3 @@ -48,6 +48,7 @@
8.4 << "\\bdelete\\b"
8.5 << "\\bdeleteKeepChilds\\b"
8.6 << "\\bdeleteChilds\\b"
8.7 + << "\\bexportAO\\b"
8.8 << "\\bexportASCII\\b"
8.9 << "\\bexportImage\\b"
8.10 << "\\bexportXHTML\\b"
9.1 --- a/main.cpp Tue Nov 17 08:24:59 2009 +0000
9.2 +++ b/main.cpp Wed Nov 25 10:58:21 2009 +0000
9.3 @@ -71,7 +71,7 @@
9.4 options.add ("debug", Option::Switch, "d", "debug");
9.5 options.add ("version", Option::Switch, "v","version");
9.6 options.add ("local", Option::Switch, "l", "local");
9.7 - options.add ("name", Option::Switch, "n", "name");
9.8 + options.add ("name", Option::String, "n", "name");
9.9 options.add ("help", Option::Switch, "h", "help");
9.10 options.add ("quit", Option::Switch, "q", "quit");
9.11 options.add ("run", Option::String, "r", "run");
9.12 @@ -104,7 +104,13 @@
9.13 // Register for DBUS
9.14 if (debug) cout << "PID="<<getpid()<<endl;
9.15 QString pidString=QString ("%1").arg(getpid());
9.16 - dbusConnection.registerService ("org.insilmaril.vym-"+pidString);
9.17 + if (!dbusConnection.registerService ("org.insilmaril.vym-"+pidString))
9.18 + {
9.19 + fprintf(stderr, "%s\n",
9.20 + qPrintable(QDBusConnection::sessionBus().lastError().message()));
9.21 + exit(1);
9.22 + }
9.23 +
9.24 if (options.isOn ("name"))
9.25 vymInstanceName=options.getArg ("name");
9.26 else
10.1 --- a/mainwindow.cpp Tue Nov 17 08:24:59 2009 +0000
10.2 +++ b/mainwindow.cpp Wed Nov 25 10:58:21 2009 +0000
10.3 @@ -32,10 +32,10 @@
10.4 // clashes with the one in Win32 API.
10.5 typedef struct _PROCESS_INFORMATION
10.6 {
10.7 - long hProcess;
10.8 - long hThread;
10.9 - long dwProcessId;
10.10 - long dwThreadId;
10.11 +long hProcess;
10.12 +long hThread;
10.13 +long dwProcessId;
10.14 +long dwThreadId;
10.15 } PROCESS_INFORMATION, *LPPROCESS_INFORMATION;
10.16 #endif
10.17
10.18 @@ -81,1764 +81,1771 @@
10.19
10.20
10.21 Main::Main(QWidget* parent, const char* name, Qt::WFlags f) :
10.22 - QMainWindow(parent,name,f)
10.23 +QMainWindow(parent,name,f)
10.24 {
10.25 - mainWindow=this;
10.26 -
10.27 - setCaption ("VYM - View Your Mind");
10.28 -
10.29 - // Load window settings
10.30 +mainWindow=this;
10.31 +
10.32 +setCaption ("VYM - View Your Mind");
10.33 +
10.34 +// Load window settings
10.35 #if defined(Q_OS_WIN32)
10.36 - if (settings.value("/mainwindow/geometry/maximized", false).toBool())
10.37 - {
10.38 - setWindowState(Qt::WindowMaximized);
10.39 - }
10.40 - else
10.41 +if (settings.value("/mainwindow/geometry/maximized", false).toBool())
10.42 +{
10.43 + setWindowState(Qt::WindowMaximized);
10.44 +}
10.45 +else
10.46 #endif
10.47 - {
10.48 - resize (settings.value("/mainwindow/geometry/size", QSize (800,600)).toSize());
10.49 - move (settings.value("/mainwindow/geometry/pos", QPoint(300,100)).toPoint());
10.50 - }
10.51 -
10.52 - // Sometimes we may need to remember old selections
10.53 - prevSelection="";
10.54 -
10.55 - // Default color
10.56 - currentColor=Qt::black;
10.57 -
10.58 - // Create unique temporary directory
10.59 - bool ok;
10.60 - tmpVymDir=makeTmpDir (ok,"vym");
10.61 - if (!ok)
10.62 - {
10.63 - qWarning ("Mainwindow: Could not create temporary directory, failed to start vym");
10.64 - exit (1);
10.65 - }
10.66 - if (debug) qDebug (QString("vym tmpDir=%1").arg(tmpVymDir) );
10.67 -
10.68 - // Create direcctory for clipboard
10.69 - clipboardDir=tmpVymDir+"/clipboard";
10.70 - clipboardFile="map.xml";
10.71 - QDir d(clipboardDir);
10.72 - d.mkdir (clipboardDir,true);
10.73 - makeSubDirs (clipboardDir);
10.74 - clipboardEmpty=true;
10.75 -
10.76 - browserPID=new qint64;
10.77 - *browserPID=0;
10.78 -
10.79 - // Satellite windows //////////////////////////////////////////
10.80 - // history window
10.81 - historyWindow=new HistoryWindow();
10.82 - connect (historyWindow, SIGNAL (windowClosed() ), this, SLOT (updateActions()));
10.83 -
10.84 - // properties window
10.85 - branchPropertyWindow = new BranchPropertyWindow();
10.86 - connect (branchPropertyWindow, SIGNAL (windowClosed() ), this, SLOT (updateActions()));
10.87 -
10.88 - // Connect TextEditor, so that we can update flags if text changes
10.89 - connect (textEditor, SIGNAL (textHasChanged() ), this, SLOT (updateNoteFlag()));
10.90 - connect (textEditor, SIGNAL (windowClosed() ), this, SLOT (updateActions()));
10.91 -
10.92 - // Initialize script editor
10.93 - scriptEditor = new SimpleScriptEditor();
10.94 - scriptEditor->move (50,50);
10.95 -
10.96 - connect( scriptEditor, SIGNAL( runScript ( QString ) ),
10.97 - this, SLOT( runScript( QString ) ) );
10.98 -
10.99 -
10.100 - // Initialize Find window
10.101 - findWindow=new FindWindow(NULL);
10.102 - findWindow->move (x(),y()+70);
10.103 - connect (findWindow, SIGNAL( findButton(QString) ),
10.104 - this, SLOT(editFind(QString) ) );
10.105 - connect (findWindow, SIGNAL( somethingChanged() ),
10.106 - this, SLOT(editFindChanged() ) );
10.107 -
10.108 - // Initialize some settings, which are platform dependant
10.109 - QString p,s;
10.110 -
10.111 - // application to open URLs
10.112 - p="/mainwindow/readerURL";
10.113 - #if defined(Q_OS_LINUX)
10.114 - s=settings.value (p,"xdg-open").toString();
10.115 +{
10.116 + resize (settings.value("/mainwindow/geometry/size", QSize (800,600)).toSize());
10.117 + move (settings.value("/mainwindow/geometry/pos", QPoint(300,100)).toPoint());
10.118 +}
10.119 +
10.120 +// Sometimes we may need to remember old selections
10.121 +prevSelection="";
10.122 +
10.123 +// Default color
10.124 +currentColor=Qt::black;
10.125 +
10.126 +// Create unique temporary directory
10.127 +bool ok;
10.128 +tmpVymDir=makeTmpDir (ok,"vym");
10.129 +if (!ok)
10.130 +{
10.131 + qWarning ("Mainwindow: Could not create temporary directory, failed to start vym");
10.132 + exit (1);
10.133 +}
10.134 +if (debug) qDebug (QString("vym tmpDir=%1").arg(tmpVymDir) );
10.135 +
10.136 +// Create direcctory for clipboard
10.137 +clipboardDir=tmpVymDir+"/clipboard";
10.138 +clipboardFile="map.xml";
10.139 +QDir d(clipboardDir);
10.140 +d.mkdir (clipboardDir,true);
10.141 +makeSubDirs (clipboardDir);
10.142 +clipboardEmpty=true;
10.143 +
10.144 +browserPID=new qint64;
10.145 +*browserPID=0;
10.146 +
10.147 +// Satellite windows //////////////////////////////////////////
10.148 +// history window
10.149 +historyWindow=new HistoryWindow();
10.150 +connect (historyWindow, SIGNAL (windowClosed() ), this, SLOT (updateActions()));
10.151 +
10.152 +// properties window
10.153 +branchPropertyWindow = new BranchPropertyWindow();
10.154 +connect (branchPropertyWindow, SIGNAL (windowClosed() ), this, SLOT (updateActions()));
10.155 +
10.156 +// Connect TextEditor, so that we can update flags if text changes
10.157 +connect (textEditor, SIGNAL (textHasChanged() ), this, SLOT (updateNoteFlag()));
10.158 +connect (textEditor, SIGNAL (windowClosed() ), this, SLOT (updateActions()));
10.159 +
10.160 +// Initialize script editor
10.161 +scriptEditor = new SimpleScriptEditor();
10.162 +scriptEditor->move (50,50);
10.163 +
10.164 +connect( scriptEditor, SIGNAL( runScript ( QString ) ),
10.165 + this, SLOT( runScript( QString ) ) );
10.166 +
10.167 +
10.168 +// Initialize Find window
10.169 +findWindow=new FindWindow(NULL);
10.170 +findWindow->move (x(),y()+70);
10.171 +connect (findWindow, SIGNAL( findButton(QString) ),
10.172 + this, SLOT(editFind(QString) ) );
10.173 +connect (findWindow, SIGNAL( somethingChanged() ),
10.174 + this, SLOT(editFindChanged() ) );
10.175 +
10.176 +// Initialize some settings, which are platform dependant
10.177 +QString p,s;
10.178 +
10.179 + // application to open URLs
10.180 + p="/mainwindow/readerURL";
10.181 + #if defined(Q_OS_LINUX)
10.182 + s=settings.value (p,"xdg-open").toString();
10.183 + #else
10.184 + #if defined(Q_OS_MACX)
10.185 + s=settings.value (p,"/usr/bin/open").toString();
10.186 +
10.187 #else
10.188 - #if defined(Q_OS_MACX)
10.189 - s=settings.value (p,"/usr/bin/open").toString();
10.190 -
10.191 - #else
10.192 - #if defined(Q_OS_WIN32)
10.193 - // Assume that system has been set up so that
10.194 - // Explorer automagically opens up the URL
10.195 - // in the user's preferred browser.
10.196 - s=settings.value (p,"explorer").toString();
10.197 - #else
10.198 - s=settings.value (p,"mozilla").toString();
10.199 - #endif
10.200 + #if defined(Q_OS_WIN32)
10.201 + // Assume that system has been set up so that
10.202 + // Explorer automagically opens up the URL
10.203 + // in the user's preferred browser.
10.204 + s=settings.value (p,"explorer").toString();
10.205 + #else
10.206 + s=settings.value (p,"mozilla").toString();
10.207 #endif
10.208 #endif
10.209 - settings.setValue( p,s);
10.210 -
10.211 - // application to open PDFs
10.212 - p="/mainwindow/readerPDF";
10.213 - #if defined(Q_OS_LINUX)
10.214 - s=settings.value (p,"xdg-open").toString();
10.215 + #endif
10.216 + settings.setValue( p,s);
10.217 +
10.218 + // application to open PDFs
10.219 + p="/mainwindow/readerPDF";
10.220 + #if defined(Q_OS_LINUX)
10.221 + s=settings.value (p,"xdg-open").toString();
10.222 + #else
10.223 + #if defined(Q_OS_MACX)
10.224 + s=settings.value (p,"/usr/bin/open").toString();
10.225 + #elif defined(Q_OS_WIN32)
10.226 + s=settings.value (p,"acrord32").toString();
10.227 #else
10.228 - #if defined(Q_OS_MACX)
10.229 - s=settings.value (p,"/usr/bin/open").toString();
10.230 - #elif defined(Q_OS_WIN32)
10.231 - s=settings.value (p,"acrord32").toString();
10.232 - #else
10.233 - s=settings.value (p,"acroread").toString();
10.234 - #endif
10.235 + s=settings.value (p,"acroread").toString();
10.236 #endif
10.237 - settings.setValue( p,s);
10.238 -
10.239 - // width of xLinksMenu
10.240 - xLinkMenuWidth=60;
10.241 -
10.242 - // Create tab widget which holds the maps
10.243 - tabWidget= new QTabWidget (this);
10.244 - connect( tabWidget, SIGNAL( currentChanged( QWidget * ) ),
10.245 - this, SLOT( editorChanged( QWidget * ) ) );
10.246 -
10.247 - setCentralWidget(tabWidget);
10.248 -
10.249 - setupFileActions();
10.250 - setupEditActions();
10.251 - setupFormatActions();
10.252 - setupViewActions();
10.253 - setupModeActions();
10.254 - setupFlagActions();
10.255 - setupNetworkActions();
10.256 - setupSettingsActions();
10.257 - setupContextMenus();
10.258 - setupMacros();
10.259 - if (settings.value( "/mainwindow/showTestMenu",false).toBool()) setupTestActions();
10.260 - setupHelpActions();
10.261 -
10.262 - // Status bar and progress bar there
10.263 - statusBar();
10.264 - progressMax=0;
10.265 - progressBar=new QProgressBar;
10.266 - progressBar->hide();
10.267 - statusBar()->addPermanentWidget(progressBar);
10.268 -
10.269 - restoreState (settings.value("/mainwindow/state",0).toByteArray());
10.270 -
10.271 - updateGeometry();
10.272 + #endif
10.273 + settings.setValue( p,s);
10.274 +
10.275 +// width of xLinksMenu
10.276 +xLinkMenuWidth=60;
10.277 +
10.278 +// Create tab widget which holds the maps
10.279 +tabWidget= new QTabWidget (this);
10.280 +connect( tabWidget, SIGNAL( currentChanged( QWidget * ) ),
10.281 + this, SLOT( editorChanged( QWidget * ) ) );
10.282 +
10.283 +setCentralWidget(tabWidget);
10.284 +
10.285 +setupFileActions();
10.286 +setupEditActions();
10.287 +setupFormatActions();
10.288 +setupViewActions();
10.289 +setupModeActions();
10.290 +setupFlagActions();
10.291 +setupNetworkActions();
10.292 +setupSettingsActions();
10.293 +setupContextMenus();
10.294 +setupMacros();
10.295 +if (settings.value( "/mainwindow/showTestMenu",false).toBool()) setupTestActions();
10.296 +setupHelpActions();
10.297 +
10.298 +// Status bar and progress bar there
10.299 +statusBar();
10.300 +progressMax=0;
10.301 +progressBar=new QProgressBar;
10.302 +progressBar->hide();
10.303 +statusBar()->addPermanentWidget(progressBar);
10.304 +
10.305 +restoreState (settings.value("/mainwindow/state",0).toByteArray());
10.306 +
10.307 +updateGeometry();
10.308 }
10.309
10.310 Main::~Main()
10.311 {
10.312 - // Save Settings
10.313 +// Save Settings
10.314 #if defined(Q_OS_WIN32)
10.315 - settings.setValue ("/mainwindow/geometry/maximized", isMaximized());
10.316 +settings.setValue ("/mainwindow/geometry/maximized", isMaximized());
10.317 #endif
10.318 - settings.setValue ("/mainwindow/geometry/size", size());
10.319 - settings.setValue ("/mainwindow/geometry/pos", pos());
10.320 - settings.setValue ("/mainwindow/state",saveState(0));
10.321 -
10.322 - settings.setValue ("/mainwindow/view/AntiAlias",actionViewToggleAntiAlias->isOn());
10.323 - settings.setValue ("/mainwindow/view/SmoothPixmapTransform",actionViewToggleSmoothPixmapTransform->isOn());
10.324 - settings.setValue( "/version/version", vymVersion );
10.325 - settings.setValue( "/version/builddate", vymBuildDate );
10.326 -
10.327 - settings.setValue( "/mainwindow/autosave/use",actionSettingsAutosaveToggle->isOn() );
10.328 - settings.setValue( "/mapeditor/editmode/autoSelectNewBranch",actionSettingsAutoSelectNewBranch->isOn() );
10.329 - settings.setValue( "/mainwindow/writeBackupFile",actionSettingsWriteBackupFile->isOn() );
10.330 - settings.setValue( "/mapeditor/editmode/autoSelectText",actionSettingsAutoSelectText->isOn() );
10.331 - settings.setValue( "/mapeditor/editmode/autoEditNewBranch",actionSettingsAutoEditNewBranch->isOn() );
10.332 - settings.setValue( "/mapeditor/editmode/useDelKey",actionSettingsUseDelKey->isOn() );
10.333 - settings.setValue( "/mapeditor/editmode/useFlagGroups",actionSettingsUseFlagGroups->isOn() );
10.334 - settings.setValue( "/export/useHideExport",actionSettingsUseHideExport->isOn() );
10.335 -
10.336 - //TODO save scriptEditor settings
10.337 -
10.338 - // call the destructors
10.339 - delete textEditor;
10.340 - delete historyWindow;
10.341 - delete branchPropertyWindow;
10.342 - delete progressBar;
10.343 -
10.344 - // Remove temporary directory
10.345 - removeDir (QDir(tmpVymDir));
10.346 +settings.setValue ("/mainwindow/geometry/size", size());
10.347 +settings.setValue ("/mainwindow/geometry/pos", pos());
10.348 +settings.setValue ("/mainwindow/state",saveState(0));
10.349 +
10.350 +settings.setValue ("/mainwindow/view/AntiAlias",actionViewToggleAntiAlias->isOn());
10.351 +settings.setValue ("/mainwindow/view/SmoothPixmapTransform",actionViewToggleSmoothPixmapTransform->isOn());
10.352 +settings.setValue( "/version/version", vymVersion );
10.353 +settings.setValue( "/version/builddate", vymBuildDate );
10.354 +
10.355 +settings.setValue( "/mainwindow/autosave/use",actionSettingsAutosaveToggle->isOn() );
10.356 +settings.setValue( "/mapeditor/editmode/autoSelectNewBranch",actionSettingsAutoSelectNewBranch->isOn() );
10.357 +settings.setValue( "/mainwindow/writeBackupFile",actionSettingsWriteBackupFile->isOn() );
10.358 +settings.setValue( "/mapeditor/editmode/autoSelectText",actionSettingsAutoSelectText->isOn() );
10.359 +settings.setValue( "/mapeditor/editmode/autoEditNewBranch",actionSettingsAutoEditNewBranch->isOn() );
10.360 +settings.setValue( "/mapeditor/editmode/useDelKey",actionSettingsUseDelKey->isOn() );
10.361 +settings.setValue( "/mapeditor/editmode/useFlagGroups",actionSettingsUseFlagGroups->isOn() );
10.362 +settings.setValue( "/export/useHideExport",actionSettingsUseHideExport->isOn() );
10.363 +
10.364 +//TODO save scriptEditor settings
10.365 +
10.366 +// call the destructors
10.367 +delete textEditor;
10.368 +delete historyWindow;
10.369 +delete branchPropertyWindow;
10.370 +delete progressBar;
10.371 +
10.372 +// Remove temporary directory
10.373 +removeDir (QDir(tmpVymDir));
10.374 }
10.375
10.376 void Main::loadCmdLine()
10.377 {
10.378 - /* TODO draw some kind of splashscreen while loading...
10.379 - if (qApp->argc()>1)
10.380 - {
10.381 - }
10.382 - */
10.383 -
10.384 - QStringList flist=options.getFileList();
10.385 - QStringList::Iterator it=flist.begin();
10.386 -
10.387 - while (it !=flist.end() )
10.388 - {
10.389 - fileLoad (*it, NewMap);
10.390 - *it++;
10.391 - }
10.392 +/* TODO draw some kind of splashscreen while loading...
10.393 +if (qApp->argc()>1)
10.394 +{
10.395 +}
10.396 +*/
10.397 +
10.398 +QStringList flist=options.getFileList();
10.399 +QStringList::Iterator it=flist.begin();
10.400 +
10.401 +while (it !=flist.end() )
10.402 +{
10.403 + fileLoad (*it, NewMap);
10.404 + *it++;
10.405 +}
10.406 }
10.407
10.408
10.409 void Main::statusMessage(const QString &s)
10.410 {
10.411 - // Surpress messages while progressbar during
10.412 - // load is active
10.413 - if (progressMin==progressMax)
10.414 - statusBar()->message( s);
10.415 +// Surpress messages while progressbar during
10.416 +// load is active
10.417 +if (progressMin==progressMax)
10.418 + statusBar()->message( s);
10.419 }
10.420
10.421 void Main::setProgressMinimum (int min)
10.422 {
10.423 - progressBar->setMinimum(min);
10.424 - progressMin=min;
10.425 +progressBar->setMinimum(min);
10.426 +progressMin=min;
10.427 }
10.428
10.429 void Main::setProgressMaximum (int max)
10.430 {
10.431 - progressBar->setMaximum(max);
10.432 - progressMax=max;
10.433 - if (max>0)
10.434 - {
10.435 - statusBar()->addPermanentWidget(progressBar);
10.436 - progressBar->show();
10.437 - }
10.438 +progressBar->setMaximum(max);
10.439 +progressMax=max;
10.440 +if (max>0)
10.441 +{
10.442 + statusBar()->addPermanentWidget(progressBar);
10.443 + progressBar->show();
10.444 +}
10.445 }
10.446
10.447 void Main::setProgressValue (int v)
10.448 {
10.449 - progressBar->setValue (v);
10.450 +progressBar->setValue (v);
10.451 }
10.452
10.453 void Main::removeProgressBar()
10.454 {
10.455 - if (progressMax>0)
10.456 - statusBar()->removeWidget(progressBar);
10.457 - progressMax=progressMin=0;
10.458 +if (progressMax>0)
10.459 + statusBar()->removeWidget(progressBar);
10.460 +progressMax=progressMin=0;
10.461 }
10.462
10.463 void Main::closeEvent (QCloseEvent* )
10.464 {
10.465 - fileExitVYM();
10.466 +fileExitVYM();
10.467 }
10.468
10.469 // File Actions
10.470 void Main::setupFileActions()
10.471 {
10.472 - QMenu *fileMenu = menuBar()->addMenu ( tr ("&Map") );
10.473 - QToolBar *tb = addToolBar( tr ("&Map") );
10.474 - tb->setObjectName ("mapTB");
10.475 -
10.476 - QAction *a;
10.477 - a = new QAction(QPixmap( iconPath+"filenew.png"), tr( "&New map","File menu" ),this);
10.478 - a->setStatusTip ( tr( "New map","Status tip File menu" ) );
10.479 - a->setShortcut ( Qt::CTRL + Qt::Key_N ); //New map
10.480 - a->addTo( tb );
10.481 - fileMenu->addAction (a);
10.482 - connect( a, SIGNAL( triggered() ), this, SLOT( fileNew() ) );
10.483 -
10.484 - a = new QAction(QPixmap( iconPath+"filenewcopy.png"), tr( "&Copy to new map","File menu" ),this);
10.485 - a->setStatusTip ( tr( "Copy selection to mapcenter of a new map","Status tip File menu" ) );
10.486 - a->setShortcut ( Qt::CTRL +Qt::SHIFT + Qt::Key_N ); //New map
10.487 - fileMenu->addAction (a);
10.488 - connect( a, SIGNAL( triggered() ), this, SLOT( fileNewCopy() ) );
10.489 - actionFileNewCopy=a;
10.490 -
10.491 - a = new QAction( QPixmap( iconPath+"fileopen.png"), tr( "&Open..." ,"File menu"),this);
10.492 - a->setStatusTip (tr( "Open","Status tip File menu" ) );
10.493 - a->setShortcut ( Qt::CTRL + Qt::Key_O ); //Open map
10.494 - a->addTo( tb );
10.495 - fileMenu->addAction (a);
10.496 - connect( a, SIGNAL( triggered() ), this, SLOT( fileLoad() ) );
10.497 -
10.498 - fileLastMapsMenu = fileMenu->addMenu (tr("Open Recent","File menu"));
10.499 - fileMenu->addSeparator();
10.500 -
10.501 - a = new QAction( QPixmap( iconPath+"filesave.png"), tr( "&Save...","File menu" ), this);
10.502 - a->setStatusTip ( tr( "Save","Status tip file menu" ));
10.503 - a->setShortcut (Qt::CTRL + Qt::Key_S ); //Save map
10.504 - a->addTo( tb );
10.505 - fileMenu->addAction (a);
10.506 - connect( a, SIGNAL( triggered() ), this, SLOT( fileSave() ) );
10.507 - actionFileSave=a;
10.508 -
10.509 - a = new QAction( QPixmap(iconPath+"filesaveas.png"), tr( "Save &As...","File menu" ), this);
10.510 - a->setStatusTip (tr( "Save &As","Status tip file menu" ) );
10.511 - fileMenu->addAction (a);
10.512 - connect( a, SIGNAL( triggered() ), this, SLOT( fileSaveAs() ) );
10.513 -
10.514 - fileMenu->addSeparator();
10.515 -
10.516 - fileImportMenu = fileMenu->addMenu (tr("Import","File menu"));
10.517 -
10.518 - a = new QAction(tr("KDE 3 Bookmarks"), this);
10.519 - a->setStatusTip ( tr( "Import %1","Status tip file menu" ).arg(tr("KDE 3 bookmarks")));
10.520 +QMenu *fileMenu = menuBar()->addMenu ( tr ("&Map") );
10.521 +QToolBar *tb = addToolBar( tr ("&Map") );
10.522 +tb->setObjectName ("mapTB");
10.523 +
10.524 +QAction *a;
10.525 +a = new QAction(QPixmap( iconPath+"filenew.png"), tr( "&New map","File menu" ),this);
10.526 +a->setStatusTip ( tr( "New map","Status tip File menu" ) );
10.527 +a->setShortcut ( Qt::CTRL + Qt::Key_N ); //New map
10.528 +a->addTo( tb );
10.529 +fileMenu->addAction (a);
10.530 +connect( a, SIGNAL( triggered() ), this, SLOT( fileNew() ) );
10.531 +
10.532 +a = new QAction(QPixmap( iconPath+"filenewcopy.png"), tr( "&Copy to new map","File menu" ),this);
10.533 +a->setStatusTip ( tr( "Copy selection to mapcenter of a new map","Status tip File menu" ) );
10.534 +a->setShortcut ( Qt::CTRL +Qt::SHIFT + Qt::Key_N ); //New map
10.535 +fileMenu->addAction (a);
10.536 +connect( a, SIGNAL( triggered() ), this, SLOT( fileNewCopy() ) );
10.537 +actionFileNewCopy=a;
10.538 +
10.539 +a = new QAction( QPixmap( iconPath+"fileopen.png"), tr( "&Open..." ,"File menu"),this);
10.540 +a->setStatusTip (tr( "Open","Status tip File menu" ) );
10.541 +a->setShortcut ( Qt::CTRL + Qt::Key_O ); //Open map
10.542 +a->addTo( tb );
10.543 +fileMenu->addAction (a);
10.544 +connect( a, SIGNAL( triggered() ), this, SLOT( fileLoad() ) );
10.545 +
10.546 +fileLastMapsMenu = fileMenu->addMenu (tr("Open Recent","File menu"));
10.547 +fileMenu->addSeparator();
10.548 +
10.549 +a = new QAction( QPixmap( iconPath+"filesave.png"), tr( "&Save...","File menu" ), this);
10.550 +a->setStatusTip ( tr( "Save","Status tip file menu" ));
10.551 +a->setShortcut (Qt::CTRL + Qt::Key_S ); //Save map
10.552 +a->addTo( tb );
10.553 +fileMenu->addAction (a);
10.554 +connect( a, SIGNAL( triggered() ), this, SLOT( fileSave() ) );
10.555 +actionFileSave=a;
10.556 +
10.557 +a = new QAction( QPixmap(iconPath+"filesaveas.png"), tr( "Save &As...","File menu" ), this);
10.558 +a->setStatusTip (tr( "Save &As","Status tip file menu" ) );
10.559 +fileMenu->addAction (a);
10.560 +connect( a, SIGNAL( triggered() ), this, SLOT( fileSaveAs() ) );
10.561 +
10.562 +fileMenu->addSeparator();
10.563 +
10.564 +fileImportMenu = fileMenu->addMenu (tr("Import","File menu"));
10.565 +
10.566 +a = new QAction(tr("KDE 3 Bookmarks"), this);
10.567 +a->setStatusTip ( tr( "Import %1","Status tip file menu" ).arg(tr("KDE 3 bookmarks")));
10.568 +a->addTo (fileImportMenu);
10.569 +connect( a, SIGNAL( triggered() ), this, SLOT( fileImportKDE3Bookmarks() ) );
10.570 +
10.571 +a = new QAction(tr("KDE 4 Bookmarks"), this);
10.572 +a->setStatusTip ( tr( "Import %1","Status tip file menu" ).arg(tr("KDE 4 bookmarks")));
10.573 +a->addTo (fileImportMenu);
10.574 +connect( a, SIGNAL( triggered() ), this, SLOT( fileImportKDE4Bookmarks() ) );
10.575 +
10.576 +if (settings.value( "/mainwindow/showTestMenu",false).toBool())
10.577 +{
10.578 + a = new QAction( QPixmap(), tr("Firefox Bookmarks","File menu"),this);
10.579 + a->setStatusTip (tr( "Import %1","Status tip file menu").arg(tr("Firefox Bookmarks" ) ));
10.580 a->addTo (fileImportMenu);
10.581 - connect( a, SIGNAL( triggered() ), this, SLOT( fileImportKDE3Bookmarks() ) );
10.582 -
10.583 - a = new QAction(tr("KDE 4 Bookmarks"), this);
10.584 - a->setStatusTip ( tr( "Import %1","Status tip file menu" ).arg(tr("KDE 4 bookmarks")));
10.585 - a->addTo (fileImportMenu);
10.586 - connect( a, SIGNAL( triggered() ), this, SLOT( fileImportKDE4Bookmarks() ) );
10.587 -
10.588 - if (settings.value( "/mainwindow/showTestMenu",false).toBool())
10.589 - {
10.590 - a = new QAction( QPixmap(), tr("Firefox Bookmarks","File menu"),this);
10.591 - a->setStatusTip (tr( "Import %1","Status tip file menu").arg(tr("Firefox Bookmarks" ) ));
10.592 - a->addTo (fileImportMenu);
10.593 - connect( a, SIGNAL( triggered() ), this, SLOT( fileImportFirefoxBookmarks() ) );
10.594 - }
10.595 -
10.596 - a = new QAction("Freemind...",this);
10.597 - a->setStatusTip ( tr( "Import %1","status tip file menu").arg(" Freemind") );
10.598 - fileImportMenu->addAction (a);
10.599 - connect( a, SIGNAL( triggered() ), this, SLOT( fileImportFreemind() ) );
10.600 -
10.601 - a = new QAction("Mind Manager...",this);
10.602 - a->setStatusTip ( tr( "Import %1","status tip file menu").arg(" Mind Manager") );
10.603 - fileImportMenu->addAction (a);
10.604 - connect( a, SIGNAL( triggered() ), this, SLOT( fileImportMM() ) );
10.605 -
10.606 - a = new QAction( tr( "Import Dir%1","File menu").arg("..."), this);
10.607 - a->setStatusTip (tr( "Import directory structure (experimental)","status tip file menu" ) );
10.608 - fileImportMenu->addAction (a);
10.609 - connect( a, SIGNAL( triggered() ), this, SLOT( fileImportDir() ) );
10.610 -
10.611 - fileExportMenu = fileMenu->addMenu (tr("Export","File menu"));
10.612 -
10.613 - a = new QAction( tr("Image%1","File export menu").arg("..."), this);
10.614 - a->setStatusTip( tr( "Export map as image","status tip file menu" ));
10.615 - connect( a, SIGNAL( triggered() ), this, SLOT( fileExportImage() ) );
10.616 - fileExportMenu->addAction (a);
10.617 -
10.618 - a = new QAction( "Open Office...", this);
10.619 - a->setStatusTip( tr( "Export in Open Document Format used e.g. in Open Office ","status tip file menu" ));
10.620 - connect( a, SIGNAL( triggered() ), this, SLOT( fileExportOOPresentation() ) );
10.621 - fileExportMenu->addAction (a);
10.622 -
10.623 - a = new QAction( "Webpage (XHTML)...",this );
10.624 - a->setShortcut (Qt::ALT + Qt::Key_X); //Export XHTML
10.625 - a->setStatusTip ( tr( "Export as %1","status tip file menu").arg(tr(" webpage (XHTML)","status tip file menu")));
10.626 - connect( a, SIGNAL( triggered() ), this, SLOT( fileExportXHTML() ) );
10.627 - fileExportMenu->addAction (a);
10.628 -
10.629 - a = new QAction( "Text (ASCII)...", this);
10.630 - a->setStatusTip ( tr( "Export as %1").arg("ASCII "+tr("(still experimental)" )));
10.631 - connect( a, SIGNAL( triggered() ), this, SLOT( fileExportASCII() ) );
10.632 - fileExportMenu->addAction (a);
10.633 -
10.634 - a = new QAction( "Spreadsheet (CSV)...", this);
10.635 - a->setStatusTip ( tr( "Export as %1").arg("CSV "+tr("(still experimental)" )));
10.636 - connect( a, SIGNAL( triggered() ), this, SLOT( fileExportCSV() ) );
10.637 - fileExportMenu->addAction (a);
10.638 -
10.639 - a = new QAction( tr("KDE 3 Bookmarks","File menu"), this);
10.640 - a->setStatusTip( tr( "Export as %1").arg(tr("KDE 3 Bookmarks" )));
10.641 - connect( a, SIGNAL( triggered() ), this, SLOT( fileExportKDE3Bookmarks() ) );
10.642 - fileExportMenu->addAction (a);
10.643 -
10.644 - a = new QAction( tr("KDE 4 Bookmarks","File menu"), this);
10.645 - a->setStatusTip( tr( "Export as %1").arg(tr("KDE 4 Bookmarks" )));
10.646 - connect( a, SIGNAL( triggered() ), this, SLOT( fileExportKDE4Bookmarks() ) );
10.647 - fileExportMenu->addAction (a);
10.648 -
10.649 - a = new QAction( "Taskjuggler...", this );
10.650 - a->setStatusTip( tr( "Export as %1").arg("Taskjuggler "+tr("(still experimental)" )));
10.651 - connect( a, SIGNAL( triggered() ), this, SLOT( fileExportTaskjuggler() ) );
10.652 - fileExportMenu->addAction (a);
10.653 -
10.654 - a = new QAction( "LaTeX...", this);
10.655 - a->setStatusTip( tr( "Export as %1").arg("LaTeX "+tr("(still experimental)" )));
10.656 - connect( a, SIGNAL( triggered() ), this, SLOT( fileExportLaTeX() ) );
10.657 - fileExportMenu->addAction (a);
10.658 -
10.659 - a = new QAction( "XML..." , this );
10.660 - a->setStatusTip (tr( "Export as %1").arg("XML"));
10.661 - connect( a, SIGNAL( triggered() ), this, SLOT( fileExportXML() ) );
10.662 - fileExportMenu->addAction (a);
10.663 -
10.664 - fileMenu->addSeparator();
10.665 -
10.666 - a = new QAction(QPixmap( iconPath+"fileprint.png"), tr( "&Print")+QString("..."), this);
10.667 - a->setStatusTip ( tr( "Print" ,"File menu") );
10.668 - a->setShortcut (Qt::CTRL + Qt::Key_P ); //Print map
10.669 - a->addTo( tb );
10.670 - fileMenu->addAction (a);
10.671 - connect( a, SIGNAL( triggered() ), this, SLOT( filePrint() ) );
10.672 - actionFilePrint=a;
10.673 -
10.674 - a = new QAction( QPixmap(iconPath+"fileclose.png"), tr( "&Close Map","File menu" ), this);
10.675 - a->setStatusTip (tr( "Close Map" ) );
10.676 - a->setShortcut (Qt::CTRL + Qt::Key_W ); //Close map
10.677 - fileMenu->addAction (a);
10.678 - connect( a, SIGNAL( triggered() ), this, SLOT( fileCloseMap() ) );
10.679 -
10.680 - a = new QAction(QPixmap(iconPath+"exit.png"), tr( "E&xit","File menu")+" "+vymName, this);
10.681 - a->setStatusTip ( tr( "Exit")+" "+vymName );
10.682 - a->setShortcut (Qt::CTRL + Qt::Key_Q ); //Quit vym
10.683 - fileMenu->addAction (a);
10.684 - connect( a, SIGNAL( triggered() ), this, SLOT( fileExitVYM() ) );
10.685 + connect( a, SIGNAL( triggered() ), this, SLOT( fileImportFirefoxBookmarks() ) );
10.686 +}
10.687 +
10.688 +a = new QAction("Freemind...",this);
10.689 +a->setStatusTip ( tr( "Import %1","status tip file menu").arg(" Freemind") );
10.690 +fileImportMenu->addAction (a);
10.691 +connect( a, SIGNAL( triggered() ), this, SLOT( fileImportFreemind() ) );
10.692 +
10.693 +a = new QAction("Mind Manager...",this);
10.694 +a->setStatusTip ( tr( "Import %1","status tip file menu").arg(" Mind Manager") );
10.695 +fileImportMenu->addAction (a);
10.696 +connect( a, SIGNAL( triggered() ), this, SLOT( fileImportMM() ) );
10.697 +
10.698 +a = new QAction( tr( "Import Dir%1","File menu").arg("..."), this);
10.699 +a->setStatusTip (tr( "Import directory structure (experimental)","status tip file menu" ) );
10.700 +fileImportMenu->addAction (a);
10.701 +connect( a, SIGNAL( triggered() ), this, SLOT( fileImportDir() ) );
10.702 +
10.703 +fileExportMenu = fileMenu->addMenu (tr("Export","File menu"));
10.704 +
10.705 +a = new QAction( tr("Image%1","File export menu").arg("..."), this);
10.706 +a->setStatusTip( tr( "Export map as image","status tip file menu" ));
10.707 +connect( a, SIGNAL( triggered() ), this, SLOT( fileExportImage() ) );
10.708 +fileExportMenu->addAction (a);
10.709 +
10.710 +a = new QAction( "Open Office...", this);
10.711 +a->setStatusTip( tr( "Export in Open Document Format used e.g. in Open Office ","status tip file menu" ));
10.712 +connect( a, SIGNAL( triggered() ), this, SLOT( fileExportOOPresentation() ) );
10.713 +fileExportMenu->addAction (a);
10.714 +
10.715 +a = new QAction( "Webpage (XHTML)...",this );
10.716 +a->setShortcut (Qt::ALT + Qt::Key_X); //Export XHTML
10.717 +a->setStatusTip ( tr( "Export as %1","status tip file menu").arg(tr(" webpage (XHTML)","status tip file menu")));
10.718 +connect( a, SIGNAL( triggered() ), this, SLOT( fileExportXHTML() ) );
10.719 +fileExportMenu->addAction (a);
10.720 +
10.721 +a = new QAction( "Text (A&O report)...", this);
10.722 +a->setStatusTip ( tr( "Export as %1").arg("A&O report "+tr("(still experimental)" )));
10.723 +connect( a, SIGNAL( triggered() ), this, SLOT( fileExportAO() ) );
10.724 +fileExportMenu->addAction (a);
10.725 +
10.726 +a = new QAction( "Text (ASCII)...", this);
10.727 +a->setStatusTip ( tr( "Export as %1").arg("ASCII "+tr("(still experimental)" )));
10.728 +connect( a, SIGNAL( triggered() ), this, SLOT( fileExportASCII() ) );
10.729 +fileExportMenu->addAction (a);
10.730 +
10.731 +a = new QAction( "Spreadsheet (CSV)...", this);
10.732 +a->setStatusTip ( tr( "Export as %1").arg("CSV "+tr("(still experimental)" )));
10.733 +connect( a, SIGNAL( triggered() ), this, SLOT( fileExportCSV() ) );
10.734 +fileExportMenu->addAction (a);
10.735 +
10.736 +a = new QAction( tr("KDE 3 Bookmarks","File menu"), this);
10.737 +a->setStatusTip( tr( "Export as %1").arg(tr("KDE 3 Bookmarks" )));
10.738 +connect( a, SIGNAL( triggered() ), this, SLOT( fileExportKDE3Bookmarks() ) );
10.739 +fileExportMenu->addAction (a);
10.740 +
10.741 +a = new QAction( tr("KDE 4 Bookmarks","File menu"), this);
10.742 +a->setStatusTip( tr( "Export as %1").arg(tr("KDE 4 Bookmarks" )));
10.743 +connect( a, SIGNAL( triggered() ), this, SLOT( fileExportKDE4Bookmarks() ) );
10.744 +fileExportMenu->addAction (a);
10.745 +
10.746 +a = new QAction( "Taskjuggler...", this );
10.747 +a->setStatusTip( tr( "Export as %1").arg("Taskjuggler "+tr("(still experimental)" )));
10.748 +connect( a, SIGNAL( triggered() ), this, SLOT( fileExportTaskjuggler() ) );
10.749 +fileExportMenu->addAction (a);
10.750 +
10.751 +a = new QAction( "LaTeX...", this);
10.752 +a->setStatusTip( tr( "Export as %1").arg("LaTeX "+tr("(still experimental)" )));
10.753 +connect( a, SIGNAL( triggered() ), this, SLOT( fileExportLaTeX() ) );
10.754 +fileExportMenu->addAction (a);
10.755 +
10.756 +a = new QAction( "XML..." , this );
10.757 +a->setStatusTip (tr( "Export as %1").arg("XML"));
10.758 +connect( a, SIGNAL( triggered() ), this, SLOT( fileExportXML() ) );
10.759 +fileExportMenu->addAction (a);
10.760 +
10.761 +fileMenu->addSeparator();
10.762 +
10.763 +a = new QAction(QPixmap( iconPath+"fileprint.png"), tr( "&Print")+QString("..."), this);
10.764 +a->setStatusTip ( tr( "Print" ,"File menu") );
10.765 +a->setShortcut (Qt::CTRL + Qt::Key_P ); //Print map
10.766 +a->addTo( tb );
10.767 +fileMenu->addAction (a);
10.768 +connect( a, SIGNAL( triggered() ), this, SLOT( filePrint() ) );
10.769 +actionFilePrint=a;
10.770 +
10.771 +a = new QAction( QPixmap(iconPath+"fileclose.png"), tr( "&Close Map","File menu" ), this);
10.772 +a->setStatusTip (tr( "Close Map" ) );
10.773 +a->setShortcut (Qt::CTRL + Qt::Key_W ); //Close map
10.774 +fileMenu->addAction (a);
10.775 +connect( a, SIGNAL( triggered() ), this, SLOT( fileCloseMap() ) );
10.776 +
10.777 +a = new QAction(QPixmap(iconPath+"exit.png"), tr( "E&xit","File menu")+" "+vymName, this);
10.778 +a->setStatusTip ( tr( "Exit")+" "+vymName );
10.779 +a->setShortcut (Qt::CTRL + Qt::Key_Q ); //Quit vym
10.780 +fileMenu->addAction (a);
10.781 +connect( a, SIGNAL( triggered() ), this, SLOT( fileExitVYM() ) );
10.782 }
10.783
10.784
10.785 //Edit Actions
10.786 void Main::setupEditActions()
10.787 {
10.788 - QToolBar *tb = addToolBar( tr ("&Actions toolbar","Toolbar name") );
10.789 - tb->setLabel( "Edit Actions" );
10.790 - tb->setObjectName ("actionsTB");
10.791 - QMenu *editMenu = menuBar()->addMenu( tr("&Edit","Edit menu") );
10.792 -
10.793 - QAction *a;
10.794 - QAction *alt;
10.795 - a = new QAction( QPixmap( iconPath+"undo.png"), tr( "&Undo","Edit menu" ),this);
10.796 - connect( a, SIGNAL( triggered() ), this, SLOT( editUndo() ) );
10.797 - a->setStatusTip (tr( "Undo" ) );
10.798 - a->setShortcut ( Qt::CTRL + Qt::Key_Z ); //Undo last action
10.799 - a->setEnabled (false);
10.800 - tb->addAction (a);
10.801 - editMenu->addAction (a);
10.802 - actionUndo=a;
10.803 -
10.804 - a = new QAction( QPixmap( iconPath+"redo.png"), tr( "&Redo","Edit menu" ), this);
10.805 - a->setStatusTip (tr( "Redo" ));
10.806 - a->setShortcut (Qt::CTRL + Qt::Key_Y ); //Redo last action
10.807 - tb->addAction (a);
10.808 - editMenu->addAction (a);
10.809 - connect( a, SIGNAL( triggered() ), this, SLOT( editRedo() ) );
10.810 - actionRedo=a;
10.811 -
10.812 - editMenu->addSeparator();
10.813 - a = new QAction(QPixmap( iconPath+"editcopy.png"), tr( "&Copy","Edit menu" ), this);
10.814 - a->setStatusTip ( tr( "Copy" ) );
10.815 - a->setShortcut (Qt::CTRL + Qt::Key_C ); //Copy
10.816 - a->setEnabled (false);
10.817 - tb->addAction (a);
10.818 - editMenu->addAction (a);
10.819 - connect( a, SIGNAL( triggered() ), this, SLOT( editCopy() ) );
10.820 - actionCopy=a;
10.821 -
10.822 - a = new QAction(QPixmap( iconPath+"editcut.png" ), tr( "Cu&t","Edit menu" ), this);
10.823 - a->setStatusTip ( tr( "Cut" ) );
10.824 - a->setShortcut (Qt::CTRL + Qt::Key_X ); //Cut
10.825 - a->setEnabled (false);
10.826 - tb->addAction (a);
10.827 - editMenu->addAction (a);
10.828 - actionCut=a;
10.829 - connect( a, SIGNAL( triggered() ), this, SLOT( editCut() ) );
10.830 -
10.831 - a = new QAction(QPixmap( iconPath+"editpaste.png"), tr( "&Paste","Edit menu" ),this);
10.832 - connect( a, SIGNAL( triggered() ), this, SLOT( editPaste() ) );
10.833 - a->setStatusTip ( tr( "Paste" ) );
10.834 - a->setShortcut ( Qt::CTRL + Qt::Key_V ); //Paste
10.835 - a->setEnabled (false);
10.836 - tb->addAction (a);
10.837 - editMenu->addAction (a);
10.838 - actionPaste=a;
10.839 -
10.840 - // Shortcut to delete selection
10.841 - a = new QAction( tr( "Delete Selection","Edit menu" ),this);
10.842 - a->setStatusTip (tr( "Delete Selection" ));
10.843 - a->setShortcut ( Qt::Key_Delete); //Delete selection
10.844 - a->setShortcutContext (Qt::WindowShortcut);
10.845 - addAction (a);
10.846 - connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteSelection() ) );
10.847 - actionDelete=a;
10.848 -
10.849 - // Shortcut to add attribute
10.850 - a= new QAction(tr( "Add attribute" ), this);
10.851 - a->setShortcut ( Qt::Key_Q);
10.852 - a->setShortcutContext (Qt::WindowShortcut);
10.853 - addAction (a);
10.854 - connect( a, SIGNAL( triggered() ), this, SLOT( editAddAttribute() ) );
10.855 - actionAddAttribute= a;
10.856 -
10.857 -
10.858 - // Shortcut to add mapcenter
10.859 - a= new QAction(QPixmap(iconPath+"newmapcenter.png"),tr( "Add mapcenter","Canvas context menu" ), this);
10.860 - a->setShortcut ( Qt::Key_M);
10.861 - a->setShortcutContext (Qt::WindowShortcut);
10.862 - connect( a, SIGNAL( triggered() ), this, SLOT( editAddMapCenter() ) );
10.863 - //actionListBranches.append(a);
10.864 - tb->addAction (a);
10.865 - actionAddMapCenter = a;
10.866 -
10.867 -
10.868 - // Shortcut to add branch
10.869 - alt = new QAction(QPixmap(iconPath+"newbranch.png"), tr( "Add branch as child","Edit menu" ), this);
10.870 - alt->setStatusTip ( tr( "Add a branch as child of selection" ));
10.871 - alt->setShortcut (Qt::Key_A); //Add branch
10.872 - alt->setShortcutContext (Qt::WindowShortcut);
10.873 - addAction (alt);
10.874 - connect( alt, SIGNAL( triggered() ), this, SLOT( editNewBranch() ) );
10.875 - a = new QAction(QPixmap(iconPath+"newbranch.png"), tr( "Add branch as child","Edit menu" ), this);
10.876 - a->setStatusTip ( tr( "Add a branch as child of selection" ));
10.877 - a->setShortcut (Qt::Key_Insert); //Add branch
10.878 - connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranch() ) );
10.879 - actionListBranches.append(a);
10.880 - #if defined (Q_OS_MACX)
10.881 - // In OSX show different shortcut in menues, the keys work indepently always
10.882 - actionAddBranch=alt;
10.883 - #else
10.884 - actionAddBranch=a;
10.885 - #endif
10.886 - editMenu->addAction (actionAddBranch);
10.887 - tb->addAction (actionAddBranch);
10.888 -
10.889 -
10.890 - // Add branch by inserting it at selection
10.891 - a = new QAction(tr( "Add branch (insert)","Edit menu" ), this);
10.892 - a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" ));
10.893 - a->setShortcut (Qt::ALT + Qt::Key_Insert ); //Insert branch
10.894 - a->setShortcutContext (Qt::WindowShortcut);
10.895 - addAction (a);
10.896 - connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBefore() ) );
10.897 - a->setEnabled (false);
10.898 - actionListBranches.append(a);
10.899 - actionAddBranchBefore=a;
10.900 - a = new QAction(tr( "Add branch (insert)","Edit menu" ),this);
10.901 - a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" ));
10.902 - a->setShortcut ( Qt::ALT + Qt::Key_A ); //Insert branch
10.903 - a->setShortcutContext (Qt::WindowShortcut);
10.904 - addAction (a);
10.905 - connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBefore() ) );
10.906 - actionListBranches.append(a);
10.907 -
10.908 - // Add branch above
10.909 - a = new QAction(tr( "Add branch above","Edit menu" ), this);
10.910 - a->setStatusTip ( tr( "Add a branch above selection" ));
10.911 - a->setShortcut (Qt::SHIFT+Qt::Key_Insert ); //Add branch above
10.912 - a->setShortcutContext (Qt::WindowShortcut);
10.913 - addAction (a);
10.914 - connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchAbove() ) );
10.915 - a->setEnabled (false);
10.916 - actionListBranches.append(a);
10.917 - actionAddBranchAbove=a;
10.918 - a = new QAction(tr( "Add branch above","Edit menu" ), this);
10.919 - a->setStatusTip ( tr( "Add a branch above selection" ));
10.920 - a->setShortcut (Qt::SHIFT+Qt::Key_A ); //Add branch above
10.921 - a->setShortcutContext (Qt::WindowShortcut);
10.922 - addAction (a);
10.923 - connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchAbove() ) );
10.924 - actionListBranches.append(a);
10.925 -
10.926 - // Add branch below
10.927 - a = new QAction(tr( "Add branch below","Edit menu" ), this);
10.928 - a->setStatusTip ( tr( "Add a branch below selection" ));
10.929 - a->setShortcut (Qt::CTRL +Qt::Key_Insert ); //Add branch below
10.930 - a->setShortcutContext (Qt::WindowShortcut);
10.931 - addAction (a);
10.932 - connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBelow() ) );
10.933 - a->setEnabled (false);
10.934 - actionListBranches.append(a);
10.935 - actionAddBranchBelow=a;
10.936 - a = new QAction(tr( "Add branch below","Edit menu" ), this);
10.937 - a->setStatusTip ( tr( "Add a branch below selection" ));
10.938 - a->setShortcut (Qt::CTRL +Qt::Key_A ); // Add branch below
10.939 - a->setShortcutContext (Qt::WindowShortcut);
10.940 - addAction (a);
10.941 - connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBelow() ) );
10.942 - actionListBranches.append(a);
10.943 -
10.944 - a = new QAction(QPixmap(iconPath+"up.png" ), tr( "Move up","Edit menu" ), this);
10.945 - a->setStatusTip ( tr( "Move branch up" ) );
10.946 - a->setShortcut (Qt::Key_PageUp ); // Move branch up
10.947 - a->setEnabled (false);
10.948 - tb->addAction (a);
10.949 - editMenu->addAction (a);
10.950 - connect( a, SIGNAL( triggered() ), this, SLOT( editMoveUp() ) );
10.951 - actionMoveUp=a;
10.952 -
10.953 - a = new QAction( QPixmap( iconPath+"down.png"), tr( "Move down","Edit menu" ),this);
10.954 - connect( a, SIGNAL( triggered() ), this, SLOT( editMoveDown() ) );
10.955 - a->setStatusTip (tr( "Move branch down" ) );
10.956 - a->setShortcut ( Qt::Key_PageDown ); // Move branch down
10.957 - a->setEnabled (false);
10.958 - tb->addAction (a);
10.959 - editMenu->addAction (a);
10.960 - actionMoveDown=a;
10.961 -
10.962 - a = new QAction(QPixmap(), tr( "&Detach","Context menu" ),this);
10.963 - a->setStatusTip ( tr( "Detach branch and use as mapcenter","Context menu" ) );
10.964 - a->setShortcut ( Qt::Key_D ); // Detach branch
10.965 - editMenu->addAction (a);
10.966 - connect( a, SIGNAL( triggered() ), this, SLOT( editDetach() ) );
10.967 - actionDetach=a;
10.968 -
10.969 - a = new QAction( QPixmap(iconPath+"editsort.png" ), tr( "Sort children","Edit menu" ), this );
10.970 - connect( a, SIGNAL( activated() ), this, SLOT( editSortChildren() ) );
10.971 - a->setEnabled (true);
10.972 - a->addTo( tb );
10.973 - editMenu->addAction (a);
10.974 - actionSortChildren=a;
10.975 -
10.976 - alt = new QAction( QPixmap(flagsPath+"flag-scrolled-right.png"), tr( "Scroll branch","Edit menu" ), this);
10.977 - alt->setShortcut ( Qt::Key_S ); // Scroll branch
10.978 - alt->setStatusTip (tr( "Scroll branch" ));
10.979 - connect( alt, SIGNAL( triggered() ), this, SLOT( editToggleScroll() ) );
10.980 - #if defined(Q_OS_MACX)
10.981 - actionToggleScroll=alt;
10.982 - #else
10.983 - actionToggleScroll=a;
10.984 - #endif
10.985 - actionToggleScroll->setEnabled (false);
10.986 - actionToggleScroll->setToggleAction(true);
10.987 - tb->addAction (actionToggleScroll);
10.988 - editMenu->addAction ( actionToggleScroll);
10.989 - editMenu->addAction (actionToggleScroll);
10.990 - addAction (a);
10.991 - addAction (alt);
10.992 - actionListBranches.append(actionToggleScroll);
10.993 -
10.994 - a = new QAction( QPixmap(), tr( "Expand all branches","Edit menu" ), this);
10.995 - a->setShortcut ( Qt::SHIFT + Qt::Key_X ); // Expand all branches
10.996 - a->setStatusTip (tr( "Expand all branches" ));
10.997 - connect( a, SIGNAL( triggered() ), this, SLOT( editExpandAll() ) );
10.998 - actionExpandAll=a;
10.999 - actionExpandAll->setEnabled (false);
10.1000 - actionExpandAll->setToggleAction(false);
10.1001 - //tb->addAction (actionExpandAll);
10.1002 - editMenu->addAction ( actionExpandAll);
10.1003 - addAction (a);
10.1004 - actionListBranches.append(actionExpandAll);
10.1005 -
10.1006 - a = new QAction( QPixmap(), tr( "Expand one level","Edit menu" ), this);
10.1007 - a->setShortcut ( Qt::Key_Greater ); // Expand one level in tree editor
10.1008 - a->setStatusTip (tr( "Expand one level in tree editor" ));
10.1009 - connect( a, SIGNAL( triggered() ), this, SLOT( editExpandOneLevel() ) );
10.1010 - a->setEnabled (false);
10.1011 - a->setToggleAction(false);
10.1012 - actionExpandOneLevel=a;
10.1013 - //tb->addAction (a);
10.1014 - editMenu->addAction ( a);
10.1015 - addAction (a);
10.1016 - actionListBranches.append(a);
10.1017 -
10.1018 - a = new QAction( QPixmap(), tr( "Collapse one level","Edit menu" ), this);
10.1019 - a->setShortcut ( Qt::Key_Less); // Collapse one level in tree editor
10.1020 - a->setStatusTip (tr( "Collapse one level in tree editor" ));
10.1021 - connect( a, SIGNAL( triggered() ), this, SLOT( editCollapseOneLevel() ) );
10.1022 - a->setEnabled (false);
10.1023 - a->setToggleAction(false);
10.1024 - actionCollapseOneLevel=a;
10.1025 - //tb->addAction (a);
10.1026 - editMenu->addAction ( a);
10.1027 - addAction (a);
10.1028 - actionListBranches.append(a);
10.1029 -
10.1030 - a = new QAction( tr( "Unscroll children","Edit menu" ), this);
10.1031 - a->setStatusTip (tr( "Unscroll all scrolled branches in selected subtree" ));
10.1032 - editMenu->addAction (a);
10.1033 - connect( a, SIGNAL( triggered() ), this, SLOT( editUnscrollChildren() ) );
10.1034 -
10.1035 - editMenu->addSeparator();
10.1036 -
10.1037 - a = new QAction( QPixmap(iconPath+"find.png"), tr( "Find...","Edit menu"), this);
10.1038 - a->setStatusTip (tr( "Find" ) );
10.1039 - a->setShortcut (Qt::CTRL + Qt::Key_F ); //Find
10.1040 - editMenu->addAction (a);
10.1041 - connect( a, SIGNAL( triggered() ), this, SLOT( editOpenFindWindow() ) );
10.1042 -
10.1043 - editMenu->addSeparator();
10.1044 -
10.1045 - a = new QAction( QPixmap(flagsPath+"flag-url.png"), tr( "Open URL","Edit menu" ), this);
10.1046 - a->setShortcut (Qt::SHIFT + Qt::Key_U );
10.1047 - a->setShortcut (tr( "Open URL" ));
10.1048 - tb->addAction (a);
10.1049 - addAction(a);
10.1050 - connect( a, SIGNAL( triggered() ), this, SLOT( editOpenURL() ) );
10.1051 - actionOpenURL=a;
10.1052 -
10.1053 - a = new QAction( tr( "Open URL in new tab","Edit menu" ), this);
10.1054 - a->setStatusTip (tr( "Open URL in new tab" ));
10.1055 - //a->setShortcut (Qt::CTRL+Qt::Key_U );
10.1056 - addAction(a);
10.1057 - connect( a, SIGNAL( triggered() ), this, SLOT( editOpenURLTab() ) );
10.1058 - actionOpenURLTab=a;
10.1059 -
10.1060 - a = new QAction( tr( "Open all URLs in subtree","Edit menu" ), this);
10.1061 - a->setStatusTip (tr( "Open all URLs in subtree" ));
10.1062 - a->setShortcut ( Qt::CTRL + Qt::Key_U );
10.1063 - addAction(a);
10.1064 - actionListBranches.append(a);
10.1065 - connect( a, SIGNAL( triggered() ), this, SLOT( editOpenMultipleURLTabs() ) );
10.1066 - actionOpenMultipleURLTabs=a;
10.1067 -
10.1068 - a = new QAction(QPixmap(), tr( "Edit URL...","Edit menu"), this);
10.1069 - a->setStatusTip ( tr( "Edit URL" ) );
10.1070 - a->setShortcut ( Qt::Key_U );
10.1071 - a->setShortcutContext (Qt::WindowShortcut);
10.1072 - actionListBranches.append(a);
10.1073 - addAction(a);
10.1074 - connect( a, SIGNAL( triggered() ), this, SLOT( editURL() ) );
10.1075 - actionURL=a;
10.1076 -
10.1077 - a = new QAction(QPixmap(), tr( "Edit local URL...","Edit menu"), this);
10.1078 - a->setStatusTip ( tr( "Edit local URL" ) );
10.1079 - //a->setShortcut (Qt::SHIFT + Qt::Key_U );
10.1080 - a->setShortcutContext (Qt::WindowShortcut);
10.1081 - actionListBranches.append(a);
10.1082 - addAction(a);
10.1083 - connect( a, SIGNAL( triggered() ), this, SLOT( editLocalURL() ) );
10.1084 - actionLocalURL=a;
10.1085 -
10.1086 - a = new QAction( tr( "Use heading for URL","Edit menu" ), this);
10.1087 - a->setStatusTip ( tr( "Use heading of selected branch as URL" ));
10.1088 - a->setEnabled (false);
10.1089 - actionListBranches.append(a);
10.1090 - connect( a, SIGNAL( triggered() ), this, SLOT( editHeading2URL() ) );
10.1091 - actionHeading2URL=a;
10.1092 -
10.1093 - a = new QAction(tr( "Create URL to Novell Bugzilla","Edit menu" ), this);
10.1094 - a->setStatusTip ( tr( "Create URL to Novell Bugzilla" ));
10.1095 - a->setEnabled (false);
10.1096 - actionListBranches.append(a);
10.1097 - a->setShortcut ( Qt::Key_B );
10.1098 - a->setShortcutContext (Qt::WindowShortcut);
10.1099 - addAction(a);
10.1100 - connect( a, SIGNAL( triggered() ), this, SLOT( editBugzilla2URL() ) );
10.1101 - actionBugzilla2URL=a;
10.1102 -
10.1103 - a = new QAction(tr( "Create URL to Novell FATE","Edit menu" ), this);
10.1104 - a->setStatusTip ( tr( "Create URL to Novell FATE" ));
10.1105 - a->setEnabled (false);
10.1106 - actionListBranches.append(a);
10.1107 - connect( a, SIGNAL( triggered() ), this, SLOT( editFATE2URL() ) );
10.1108 - actionFATE2URL=a;
10.1109 -
10.1110 - a = new QAction(QPixmap(flagsPath+"flag-vymlink.png"), tr( "Open linked map","Edit menu" ), this);
10.1111 - a->setStatusTip ( tr( "Jump to another vym map, if needed load it first" ));
10.1112 - tb->addAction (a);
10.1113 - a->setEnabled (false);
10.1114 - connect( a, SIGNAL( triggered() ), this, SLOT( editOpenVymLink() ) );
10.1115 - actionOpenVymLink=a;
10.1116 -
10.1117 - a = new QAction(QPixmap(), tr( "Open all vym links in subtree","Edit menu" ), this);
10.1118 - a->setStatusTip ( tr( "Open all vym links in subtree" ));
10.1119 - a->setEnabled (false);
10.1120 - actionListBranches.append(a);
10.1121 - connect( a, SIGNAL( triggered() ), this, SLOT( editOpenMultipleVymLinks() ) );
10.1122 - actionOpenMultipleVymLinks=a;
10.1123 -
10.1124 -
10.1125 - a = new QAction(tr( "Edit vym link...","Edit menu" ), this);
10.1126 - a->setEnabled (false);
10.1127 - a->setStatusTip ( tr( "Edit link to another vym map" ));
10.1128 - connect( a, SIGNAL( triggered() ), this, SLOT( editVymLink() ) );
10.1129 - actionListBranches.append(a);
10.1130 - actionVymLink=a;
10.1131 -
10.1132 - a = new QAction(tr( "Delete vym link","Edit menu" ),this);
10.1133 - a->setStatusTip ( tr( "Delete link to another vym map" ));
10.1134 - a->setEnabled (false);
10.1135 - connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteVymLink() ) );
10.1136 - actionDeleteVymLink=a;
10.1137 -
10.1138 - a = new QAction(QPixmap(flagsPath+"flag-hideexport.png"), tr( "Hide in exports","Edit menu" ), this);
10.1139 - a->setStatusTip ( tr( "Hide object in exports" ) );
10.1140 - a->setShortcut (Qt::Key_H );
10.1141 - a->setToggleAction(true);
10.1142 - tb->addAction (a);
10.1143 - a->setEnabled (false);
10.1144 - connect( a, SIGNAL( triggered() ), this, SLOT( editToggleHideExport() ) );
10.1145 - actionToggleHideExport=a;
10.1146 -
10.1147 - a = new QAction(tr( "Add timestamp","Edit menu" ), this);
10.1148 - a->setStatusTip ( tr( "Add timestamp" ));
10.1149 - a->setEnabled (false);
10.1150 - actionListBranches.append(a);
10.1151 - a->setShortcut ( Qt::Key_T ); // Add timestamp
10.1152 - a->setShortcutContext (Qt::WindowShortcut);
10.1153 - addAction(a);
10.1154 - connect( a, SIGNAL( triggered() ), this, SLOT( editAddTimestamp() ) );
10.1155 - actionAddTimestamp=a;
10.1156 -
10.1157 - a = new QAction(tr( "Edit Map Info...","Edit menu" ),this);
10.1158 - a->setStatusTip ( tr( "Edit Map Info" ));
10.1159 - a->setEnabled (true);
10.1160 - connect( a, SIGNAL( triggered() ), this, SLOT( editMapInfo() ) );
10.1161 - actionMapInfo=a;
10.1162 -
10.1163 - // Import at selection (adding to selection)
10.1164 - a = new QAction( tr( "Add map (insert)","Edit menu" ),this);
10.1165 - a->setStatusTip (tr( "Add map at selection" ));
10.1166 - connect( a, SIGNAL( triggered() ), this, SLOT( editImportAdd() ) );
10.1167 - a->setEnabled (false);
10.1168 - actionListBranches.append(a);
10.1169 - actionImportAdd=a;
10.1170 -
10.1171 - // Import at selection (replacing selection)
10.1172 - a = new QAction( tr( "Add map (replace)","Edit menu" ), this);
10.1173 - a->setStatusTip (tr( "Replace selection with map" ));
10.1174 - connect( a, SIGNAL( triggered() ), this, SLOT( editImportReplace() ) );
10.1175 - a->setEnabled (false);
10.1176 - actionListBranches.append(a);
10.1177 - actionImportReplace=a;
10.1178 -
10.1179 - // Save selection
10.1180 - a = new QAction( tr( "Save selection","Edit menu" ), this);
10.1181 - a->setStatusTip (tr( "Save selection" ));
10.1182 - connect( a, SIGNAL( triggered() ), this, SLOT( editSaveBranch() ) );
10.1183 - a->setEnabled (false);
10.1184 - actionListBranches.append(a);
10.1185 - actionSaveBranch=a;
10.1186 -
10.1187 - // Only remove branch, not its children
10.1188 - a = new QAction(tr( "Remove only branch ","Edit menu" ), this);
10.1189 - a->setStatusTip ( tr( "Remove only branch and keep its children" ));
10.1190 - a->setShortcut (Qt::ALT + Qt::Key_Delete );
10.1191 - connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteKeepChildren() ) );
10.1192 - a->setEnabled (false);
10.1193 - addAction (a);
10.1194 - actionListBranches.append(a);
10.1195 - actionDeleteKeepChildren=a;
10.1196 -
10.1197 - // Only remove children of a branch
10.1198 - a = new QAction( tr( "Remove children","Edit menu" ), this);
10.1199 - a->setStatusTip (tr( "Remove children of branch" ));
10.1200 - a->setShortcut (Qt::SHIFT + Qt::Key_Delete );
10.1201 - connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteChildren() ) );
10.1202 - a->setEnabled (false);
10.1203 - actionListBranches.append(a);
10.1204 - actionDeleteChildren=a;
10.1205 -
10.1206 - a = new QAction( tr( "Add Image...","Edit menu" ), this);
10.1207 - a->setStatusTip (tr( "Add Image" ));
10.1208 - connect( a, SIGNAL( triggered() ), this, SLOT( editLoadImage() ) );
10.1209 - actionLoadImage=a;
10.1210 -
10.1211 - a = new QAction( tr( "Property window","Dialog to edit properties of selection" )+QString ("..."), this);
10.1212 - a->setStatusTip (tr( "Set properties for selection" ));
10.1213 - a->setShortcut ( Qt::CTRL + Qt::Key_I ); //Property window
10.1214 - a->setShortcutContext (Qt::WindowShortcut);
10.1215 - a->setToggleAction (true);
10.1216 - addAction (a);
10.1217 - connect( a, SIGNAL( triggered() ), this, SLOT( windowToggleProperty() ) );
10.1218 - actionViewTogglePropertyWindow=a;
10.1219 +QToolBar *tb = addToolBar( tr ("&Actions toolbar","Toolbar name") );
10.1220 +tb->setLabel( "Edit Actions" );
10.1221 +tb->setObjectName ("actionsTB");
10.1222 +QMenu *editMenu = menuBar()->addMenu( tr("&Edit","Edit menu") );
10.1223 +
10.1224 +QAction *a;
10.1225 +QAction *alt;
10.1226 +a = new QAction( QPixmap( iconPath+"undo.png"), tr( "&Undo","Edit menu" ),this);
10.1227 +connect( a, SIGNAL( triggered() ), this, SLOT( editUndo() ) );
10.1228 +a->setStatusTip (tr( "Undo" ) );
10.1229 +a->setShortcut ( Qt::CTRL + Qt::Key_Z ); //Undo last action
10.1230 +a->setEnabled (false);
10.1231 +tb->addAction (a);
10.1232 +editMenu->addAction (a);
10.1233 +actionUndo=a;
10.1234 +
10.1235 +a = new QAction( QPixmap( iconPath+"redo.png"), tr( "&Redo","Edit menu" ), this);
10.1236 +a->setStatusTip (tr( "Redo" ));
10.1237 +a->setShortcut (Qt::CTRL + Qt::Key_Y ); //Redo last action
10.1238 +tb->addAction (a);
10.1239 +editMenu->addAction (a);
10.1240 +connect( a, SIGNAL( triggered() ), this, SLOT( editRedo() ) );
10.1241 +actionRedo=a;
10.1242 +
10.1243 +editMenu->addSeparator();
10.1244 +a = new QAction(QPixmap( iconPath+"editcopy.png"), tr( "&Copy","Edit menu" ), this);
10.1245 +a->setStatusTip ( tr( "Copy" ) );
10.1246 +a->setShortcut (Qt::CTRL + Qt::Key_C ); //Copy
10.1247 +a->setEnabled (false);
10.1248 +tb->addAction (a);
10.1249 +editMenu->addAction (a);
10.1250 +connect( a, SIGNAL( triggered() ), this, SLOT( editCopy() ) );
10.1251 +actionCopy=a;
10.1252 +
10.1253 +a = new QAction(QPixmap( iconPath+"editcut.png" ), tr( "Cu&t","Edit menu" ), this);
10.1254 +a->setStatusTip ( tr( "Cut" ) );
10.1255 +a->setShortcut (Qt::CTRL + Qt::Key_X ); //Cut
10.1256 +a->setEnabled (false);
10.1257 +tb->addAction (a);
10.1258 +editMenu->addAction (a);
10.1259 +actionCut=a;
10.1260 +connect( a, SIGNAL( triggered() ), this, SLOT( editCut() ) );
10.1261 +
10.1262 +a = new QAction(QPixmap( iconPath+"editpaste.png"), tr( "&Paste","Edit menu" ),this);
10.1263 +connect( a, SIGNAL( triggered() ), this, SLOT( editPaste() ) );
10.1264 +a->setStatusTip ( tr( "Paste" ) );
10.1265 +a->setShortcut ( Qt::CTRL + Qt::Key_V ); //Paste
10.1266 +a->setEnabled (false);
10.1267 +tb->addAction (a);
10.1268 +editMenu->addAction (a);
10.1269 +actionPaste=a;
10.1270 +
10.1271 +// Shortcut to delete selection
10.1272 +a = new QAction( tr( "Delete Selection","Edit menu" ),this);
10.1273 +a->setStatusTip (tr( "Delete Selection" ));
10.1274 +a->setShortcut ( Qt::Key_Delete); //Delete selection
10.1275 +a->setShortcutContext (Qt::WindowShortcut);
10.1276 +addAction (a);
10.1277 +connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteSelection() ) );
10.1278 +actionDelete=a;
10.1279 +
10.1280 +// Shortcut to add attribute
10.1281 +a= new QAction(tr( "Add attribute" ), this);
10.1282 +a->setShortcut ( Qt::Key_Q);
10.1283 +a->setShortcutContext (Qt::WindowShortcut);
10.1284 +addAction (a);
10.1285 +connect( a, SIGNAL( triggered() ), this, SLOT( editAddAttribute() ) );
10.1286 +actionAddAttribute= a;
10.1287 +
10.1288 +
10.1289 +// Shortcut to add mapcenter
10.1290 +a= new QAction(QPixmap(iconPath+"newmapcenter.png"),tr( "Add mapcenter","Canvas context menu" ), this);
10.1291 +a->setShortcut ( Qt::Key_M);
10.1292 +a->setShortcutContext (Qt::WindowShortcut);
10.1293 +connect( a, SIGNAL( triggered() ), this, SLOT( editAddMapCenter() ) );
10.1294 +//actionListBranches.append(a);
10.1295 +tb->addAction (a);
10.1296 +actionAddMapCenter = a;
10.1297 +
10.1298 +
10.1299 +// Shortcut to add branch
10.1300 +alt = new QAction(QPixmap(iconPath+"newbranch.png"), tr( "Add branch as child","Edit menu" ), this);
10.1301 +alt->setStatusTip ( tr( "Add a branch as child of selection" ));
10.1302 +alt->setShortcut (Qt::Key_A); //Add branch
10.1303 +alt->setShortcutContext (Qt::WindowShortcut);
10.1304 +addAction (alt);
10.1305 +connect( alt, SIGNAL( triggered() ), this, SLOT( editNewBranch() ) );
10.1306 +a = new QAction(QPixmap(iconPath+"newbranch.png"), tr( "Add branch as child","Edit menu" ), this);
10.1307 +a->setStatusTip ( tr( "Add a branch as child of selection" ));
10.1308 +a->setShortcut (Qt::Key_Insert); //Add branch
10.1309 +connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranch() ) );
10.1310 +actionListBranches.append(a);
10.1311 +#if defined (Q_OS_MACX)
10.1312 + // In OSX show different shortcut in menues, the keys work indepently always
10.1313 + actionAddBranch=alt;
10.1314 +#else
10.1315 + actionAddBranch=a;
10.1316 +#endif
10.1317 +editMenu->addAction (actionAddBranch);
10.1318 +tb->addAction (actionAddBranch);
10.1319 +
10.1320 +
10.1321 +// Add branch by inserting it at selection
10.1322 +a = new QAction(tr( "Add branch (insert)","Edit menu" ), this);
10.1323 +a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" ));
10.1324 +a->setShortcut (Qt::ALT + Qt::Key_Insert ); //Insert branch
10.1325 +a->setShortcutContext (Qt::WindowShortcut);
10.1326 +addAction (a);
10.1327 +connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBefore() ) );
10.1328 +a->setEnabled (false);
10.1329 +actionListBranches.append(a);
10.1330 +actionAddBranchBefore=a;
10.1331 +a = new QAction(tr( "Add branch (insert)","Edit menu" ),this);
10.1332 +a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" ));
10.1333 +a->setShortcut ( Qt::ALT + Qt::Key_A ); //Insert branch
10.1334 +a->setShortcutContext (Qt::WindowShortcut);
10.1335 +addAction (a);
10.1336 +connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBefore() ) );
10.1337 +actionListBranches.append(a);
10.1338 +
10.1339 +// Add branch above
10.1340 +a = new QAction(tr( "Add branch above","Edit menu" ), this);
10.1341 +a->setStatusTip ( tr( "Add a branch above selection" ));
10.1342 +a->setShortcut (Qt::SHIFT+Qt::Key_Insert ); //Add branch above
10.1343 +a->setShortcutContext (Qt::WindowShortcut);
10.1344 +addAction (a);
10.1345 +connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchAbove() ) );
10.1346 +a->setEnabled (false);
10.1347 +actionListBranches.append(a);
10.1348 +actionAddBranchAbove=a;
10.1349 +a = new QAction(tr( "Add branch above","Edit menu" ), this);
10.1350 +a->setStatusTip ( tr( "Add a branch above selection" ));
10.1351 +a->setShortcut (Qt::SHIFT+Qt::Key_A ); //Add branch above
10.1352 +a->setShortcutContext (Qt::WindowShortcut);
10.1353 +addAction (a);
10.1354 +connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchAbove() ) );
10.1355 +actionListBranches.append(a);
10.1356 +
10.1357 +// Add branch below
10.1358 +a = new QAction(tr( "Add branch below","Edit menu" ), this);
10.1359 +a->setStatusTip ( tr( "Add a branch below selection" ));
10.1360 +a->setShortcut (Qt::CTRL +Qt::Key_Insert ); //Add branch below
10.1361 +a->setShortcutContext (Qt::WindowShortcut);
10.1362 +addAction (a);
10.1363 +connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBelow() ) );
10.1364 +a->setEnabled (false);
10.1365 +actionListBranches.append(a);
10.1366 +actionAddBranchBelow=a;
10.1367 +a = new QAction(tr( "Add branch below","Edit menu" ), this);
10.1368 +a->setStatusTip ( tr( "Add a branch below selection" ));
10.1369 +a->setShortcut (Qt::CTRL +Qt::Key_A ); // Add branch below
10.1370 +a->setShortcutContext (Qt::WindowShortcut);
10.1371 +addAction (a);
10.1372 +connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBelow() ) );
10.1373 +actionListBranches.append(a);
10.1374 +
10.1375 +a = new QAction(QPixmap(iconPath+"up.png" ), tr( "Move up","Edit menu" ), this);
10.1376 +a->setStatusTip ( tr( "Move branch up" ) );
10.1377 +a->setShortcut (Qt::Key_PageUp ); // Move branch up
10.1378 +a->setEnabled (false);
10.1379 +tb->addAction (a);
10.1380 +editMenu->addAction (a);
10.1381 +connect( a, SIGNAL( triggered() ), this, SLOT( editMoveUp() ) );
10.1382 +actionMoveUp=a;
10.1383 +
10.1384 +a = new QAction( QPixmap( iconPath+"down.png"), tr( "Move down","Edit menu" ),this);
10.1385 +connect( a, SIGNAL( triggered() ), this, SLOT( editMoveDown() ) );
10.1386 +a->setStatusTip (tr( "Move branch down" ) );
10.1387 +a->setShortcut ( Qt::Key_PageDown ); // Move branch down
10.1388 +a->setEnabled (false);
10.1389 +tb->addAction (a);
10.1390 +editMenu->addAction (a);
10.1391 +actionMoveDown=a;
10.1392 +
10.1393 +a = new QAction(QPixmap(), tr( "&Detach","Context menu" ),this);
10.1394 +a->setStatusTip ( tr( "Detach branch and use as mapcenter","Context menu" ) );
10.1395 +a->setShortcut ( Qt::Key_D ); // Detach branch
10.1396 +editMenu->addAction (a);
10.1397 +connect( a, SIGNAL( triggered() ), this, SLOT( editDetach() ) );
10.1398 +actionDetach=a;
10.1399 +
10.1400 +a = new QAction( QPixmap(iconPath+"editsort.png" ), tr( "Sort children","Edit menu" ), this );
10.1401 +connect( a, SIGNAL( activated() ), this, SLOT( editSortChildren() ) );
10.1402 +a->setEnabled (true);
10.1403 +a->addTo( tb );
10.1404 +editMenu->addAction (a);
10.1405 +actionSortChildren=a;
10.1406 +
10.1407 +alt = new QAction( QPixmap(flagsPath+"flag-scrolled-right.png"), tr( "Scroll branch","Edit menu" ), this);
10.1408 +alt->setShortcut ( Qt::Key_S ); // Scroll branch
10.1409 +alt->setStatusTip (tr( "Scroll branch" ));
10.1410 +connect( alt, SIGNAL( triggered() ), this, SLOT( editToggleScroll() ) );
10.1411 +#if defined(Q_OS_MACX)
10.1412 + actionToggleScroll=alt;
10.1413 +#else
10.1414 + actionToggleScroll=a;
10.1415 +#endif
10.1416 +actionToggleScroll->setEnabled (false);
10.1417 +actionToggleScroll->setToggleAction(true);
10.1418 +tb->addAction (actionToggleScroll);
10.1419 +editMenu->addAction ( actionToggleScroll);
10.1420 +editMenu->addAction (actionToggleScroll);
10.1421 +addAction (a);
10.1422 +addAction (alt);
10.1423 +actionListBranches.append(actionToggleScroll);
10.1424 +
10.1425 +a = new QAction( QPixmap(), tr( "Expand all branches","Edit menu" ), this);
10.1426 +a->setShortcut ( Qt::SHIFT + Qt::Key_X ); // Expand all branches
10.1427 +a->setStatusTip (tr( "Expand all branches" ));
10.1428 +connect( a, SIGNAL( triggered() ), this, SLOT( editExpandAll() ) );
10.1429 +actionExpandAll=a;
10.1430 +actionExpandAll->setEnabled (false);
10.1431 +actionExpandAll->setToggleAction(false);
10.1432 +//tb->addAction (actionExpandAll);
10.1433 +editMenu->addAction ( actionExpandAll);
10.1434 +addAction (a);
10.1435 +actionListBranches.append(actionExpandAll);
10.1436 +
10.1437 +a = new QAction( QPixmap(), tr( "Expand one level","Edit menu" ), this);
10.1438 +a->setShortcut ( Qt::Key_Greater ); // Expand one level in tree editor
10.1439 +a->setStatusTip (tr( "Expand one level in tree editor" ));
10.1440 +connect( a, SIGNAL( triggered() ), this, SLOT( editExpandOneLevel() ) );
10.1441 +a->setEnabled (false);
10.1442 +a->setToggleAction(false);
10.1443 +actionExpandOneLevel=a;
10.1444 +//tb->addAction (a);
10.1445 +editMenu->addAction ( a);
10.1446 +addAction (a);
10.1447 +actionListBranches.append(a);
10.1448 +
10.1449 +a = new QAction( QPixmap(), tr( "Collapse one level","Edit menu" ), this);
10.1450 +a->setShortcut ( Qt::Key_Less); // Collapse one level in tree editor
10.1451 +a->setStatusTip (tr( "Collapse one level in tree editor" ));
10.1452 +connect( a, SIGNAL( triggered() ), this, SLOT( editCollapseOneLevel() ) );
10.1453 +a->setEnabled (false);
10.1454 +a->setToggleAction(false);
10.1455 +actionCollapseOneLevel=a;
10.1456 +//tb->addAction (a);
10.1457 +editMenu->addAction ( a);
10.1458 +addAction (a);
10.1459 +actionListBranches.append(a);
10.1460 +
10.1461 +a = new QAction( tr( "Unscroll children","Edit menu" ), this);
10.1462 +a->setStatusTip (tr( "Unscroll all scrolled branches in selected subtree" ));
10.1463 +editMenu->addAction (a);
10.1464 +connect( a, SIGNAL( triggered() ), this, SLOT( editUnscrollChildren() ) );
10.1465 +
10.1466 +editMenu->addSeparator();
10.1467 +
10.1468 +a = new QAction( QPixmap(iconPath+"find.png"), tr( "Find...","Edit menu"), this);
10.1469 +a->setStatusTip (tr( "Find" ) );
10.1470 +a->setShortcut (Qt::CTRL + Qt::Key_F ); //Find
10.1471 +editMenu->addAction (a);
10.1472 +connect( a, SIGNAL( triggered() ), this, SLOT( editOpenFindWindow() ) );
10.1473 +
10.1474 +editMenu->addSeparator();
10.1475 +
10.1476 +a = new QAction( QPixmap(flagsPath+"flag-url.png"), tr( "Open URL","Edit menu" ), this);
10.1477 +a->setShortcut (Qt::SHIFT + Qt::Key_U );
10.1478 +a->setShortcut (tr( "Open URL" ));
10.1479 +tb->addAction (a);
10.1480 +addAction(a);
10.1481 +connect( a, SIGNAL( triggered() ), this, SLOT( editOpenURL() ) );
10.1482 +actionOpenURL=a;
10.1483 +
10.1484 +a = new QAction( tr( "Open URL in new tab","Edit menu" ), this);
10.1485 +a->setStatusTip (tr( "Open URL in new tab" ));
10.1486 +//a->setShortcut (Qt::CTRL+Qt::Key_U );
10.1487 +addAction(a);
10.1488 +connect( a, SIGNAL( triggered() ), this, SLOT( editOpenURLTab() ) );
10.1489 +actionOpenURLTab=a;
10.1490 +
10.1491 +a = new QAction( tr( "Open all URLs in subtree","Edit menu" ), this);
10.1492 +a->setStatusTip (tr( "Open all URLs in subtree" ));
10.1493 +a->setShortcut ( Qt::CTRL + Qt::Key_U );
10.1494 +addAction(a);
10.1495 +actionListBranches.append(a);
10.1496 +connect( a, SIGNAL( triggered() ), this, SLOT( editOpenMultipleURLTabs() ) );
10.1497 +actionOpenMultipleURLTabs=a;
10.1498 +
10.1499 +a = new QAction(QPixmap(), tr( "Edit URL...","Edit menu"), this);
10.1500 +a->setStatusTip ( tr( "Edit URL" ) );
10.1501 +a->setShortcut ( Qt::Key_U );
10.1502 +a->setShortcutContext (Qt::WindowShortcut);
10.1503 +actionListBranches.append(a);
10.1504 +addAction(a);
10.1505 +connect( a, SIGNAL( triggered() ), this, SLOT( editURL() ) );
10.1506 +actionURL=a;
10.1507 +
10.1508 +a = new QAction(QPixmap(), tr( "Edit local URL...","Edit menu"), this);
10.1509 +a->setStatusTip ( tr( "Edit local URL" ) );
10.1510 +//a->setShortcut (Qt::SHIFT + Qt::Key_U );
10.1511 +a->setShortcutContext (Qt::WindowShortcut);
10.1512 +actionListBranches.append(a);
10.1513 +addAction(a);
10.1514 +connect( a, SIGNAL( triggered() ), this, SLOT( editLocalURL() ) );
10.1515 +actionLocalURL=a;
10.1516 +
10.1517 +a = new QAction( tr( "Use heading for URL","Edit menu" ), this);
10.1518 +a->setStatusTip ( tr( "Use heading of selected branch as URL" ));
10.1519 +a->setEnabled (false);
10.1520 +actionListBranches.append(a);
10.1521 +connect( a, SIGNAL( triggered() ), this, SLOT( editHeading2URL() ) );
10.1522 +actionHeading2URL=a;
10.1523 +
10.1524 +a = new QAction(tr( "Create URL to Novell Bugzilla","Edit menu" ), this);
10.1525 +a->setStatusTip ( tr( "Create URL to Novell Bugzilla" ));
10.1526 +a->setEnabled (false);
10.1527 +actionListBranches.append(a);
10.1528 +a->setShortcut ( Qt::Key_B );
10.1529 +a->setShortcutContext (Qt::WindowShortcut);
10.1530 +addAction(a);
10.1531 +connect( a, SIGNAL( triggered() ), this, SLOT( editBugzilla2URL() ) );
10.1532 +actionBugzilla2URL=a;
10.1533 +
10.1534 +a = new QAction(tr( "Create URL to Novell FATE","Edit menu" ), this);
10.1535 +a->setStatusTip ( tr( "Create URL to Novell FATE" ));
10.1536 +a->setEnabled (false);
10.1537 +actionListBranches.append(a);
10.1538 +connect( a, SIGNAL( triggered() ), this, SLOT( editFATE2URL() ) );
10.1539 +actionFATE2URL=a;
10.1540 +
10.1541 +a = new QAction(QPixmap(flagsPath+"flag-vymlink.png"), tr( "Open linked map","Edit menu" ), this);
10.1542 +a->setStatusTip ( tr( "Jump to another vym map, if needed load it first" ));
10.1543 +tb->addAction (a);
10.1544 +a->setEnabled (false);
10.1545 +connect( a, SIGNAL( triggered() ), this, SLOT( editOpenVymLink() ) );
10.1546 +actionOpenVymLink=a;
10.1547 +
10.1548 +a = new QAction(QPixmap(), tr( "Open all vym links in subtree","Edit menu" ), this);
10.1549 +a->setStatusTip ( tr( "Open all vym links in subtree" ));
10.1550 +a->setEnabled (false);
10.1551 +actionListBranches.append(a);
10.1552 +connect( a, SIGNAL( triggered() ), this, SLOT( editOpenMultipleVymLinks() ) );
10.1553 +actionOpenMultipleVymLinks=a;
10.1554 +
10.1555 +
10.1556 +a = new QAction(tr( "Edit vym link...","Edit menu" ), this);
10.1557 +a->setEnabled (false);
10.1558 +a->setStatusTip ( tr( "Edit link to another vym map" ));
10.1559 +connect( a, SIGNAL( triggered() ), this, SLOT( editVymLink() ) );
10.1560 +actionListBranches.append(a);
10.1561 +actionVymLink=a;
10.1562 +
10.1563 +a = new QAction(tr( "Delete vym link","Edit menu" ),this);
10.1564 +a->setStatusTip ( tr( "Delete link to another vym map" ));
10.1565 +a->setEnabled (false);
10.1566 +connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteVymLink() ) );
10.1567 +actionDeleteVymLink=a;
10.1568 +
10.1569 +a = new QAction(QPixmap(flagsPath+"flag-hideexport.png"), tr( "Hide in exports","Edit menu" ), this);
10.1570 +a->setStatusTip ( tr( "Hide object in exports" ) );
10.1571 +a->setShortcut (Qt::Key_H );
10.1572 +a->setToggleAction(true);
10.1573 +tb->addAction (a);
10.1574 +a->setEnabled (false);
10.1575 +connect( a, SIGNAL( triggered() ), this, SLOT( editToggleHideExport() ) );
10.1576 +actionToggleHideExport=a;
10.1577 +
10.1578 +a = new QAction(tr( "Add timestamp","Edit menu" ), this);
10.1579 +a->setStatusTip ( tr( "Add timestamp" ));
10.1580 +a->setEnabled (false);
10.1581 +actionListBranches.append(a);
10.1582 +a->setShortcut ( Qt::Key_T ); // Add timestamp
10.1583 +a->setShortcutContext (Qt::WindowShortcut);
10.1584 +addAction(a);
10.1585 +connect( a, SIGNAL( triggered() ), this, SLOT( editAddTimestamp() ) );
10.1586 +actionAddTimestamp=a;
10.1587 +
10.1588 +a = new QAction(tr( "Edit Map Info...","Edit menu" ),this);
10.1589 +a->setStatusTip ( tr( "Edit Map Info" ));
10.1590 +a->setEnabled (true);
10.1591 +connect( a, SIGNAL( triggered() ), this, SLOT( editMapInfo() ) );
10.1592 +actionMapInfo=a;
10.1593 +
10.1594 +// Import at selection (adding to selection)
10.1595 +a = new QAction( tr( "Add map (insert)","Edit menu" ),this);
10.1596 +a->setStatusTip (tr( "Add map at selection" ));
10.1597 +connect( a, SIGNAL( triggered() ), this, SLOT( editImportAdd() ) );
10.1598 +a->setEnabled (false);
10.1599 +actionListBranches.append(a);
10.1600 +actionImportAdd=a;
10.1601 +
10.1602 +// Import at selection (replacing selection)
10.1603 +a = new QAction( tr( "Add map (replace)","Edit menu" ), this);
10.1604 +a->setStatusTip (tr( "Replace selection with map" ));
10.1605 +connect( a, SIGNAL( triggered() ), this, SLOT( editImportReplace() ) );
10.1606 +a->setEnabled (false);
10.1607 +actionListBranches.append(a);
10.1608 +actionImportReplace=a;
10.1609 +
10.1610 +// Save selection
10.1611 +a = new QAction( tr( "Save selection","Edit menu" ), this);
10.1612 +a->setStatusTip (tr( "Save selection" ));
10.1613 +connect( a, SIGNAL( triggered() ), this, SLOT( editSaveBranch() ) );
10.1614 +a->setEnabled (false);
10.1615 +actionListBranches.append(a);
10.1616 +actionSaveBranch=a;
10.1617 +
10.1618 +// Only remove branch, not its children
10.1619 +a = new QAction(tr( "Remove only branch ","Edit menu" ), this);
10.1620 +a->setStatusTip ( tr( "Remove only branch and keep its children" ));
10.1621 +a->setShortcut (Qt::ALT + Qt::Key_Delete );
10.1622 +connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteKeepChildren() ) );
10.1623 +a->setEnabled (false);
10.1624 +addAction (a);
10.1625 +actionListBranches.append(a);
10.1626 +actionDeleteKeepChildren=a;
10.1627 +
10.1628 +// Only remove children of a branch
10.1629 +a = new QAction( tr( "Remove children","Edit menu" ), this);
10.1630 +a->setStatusTip (tr( "Remove children of branch" ));
10.1631 +a->setShortcut (Qt::SHIFT + Qt::Key_Delete );
10.1632 +connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteChildren() ) );
10.1633 +a->setEnabled (false);
10.1634 +actionListBranches.append(a);
10.1635 +actionDeleteChildren=a;
10.1636 +
10.1637 +a = new QAction( tr( "Add Image...","Edit menu" ), this);
10.1638 +a->setStatusTip (tr( "Add Image" ));
10.1639 +connect( a, SIGNAL( triggered() ), this, SLOT( editLoadImage() ) );
10.1640 +actionLoadImage=a;
10.1641 +
10.1642 +a = new QAction( tr( "Property window","Dialog to edit properties of selection" )+QString ("..."), this);
10.1643 +a->setStatusTip (tr( "Set properties for selection" ));
10.1644 +a->setShortcut ( Qt::CTRL + Qt::Key_I ); //Property window
10.1645 +a->setShortcutContext (Qt::WindowShortcut);
10.1646 +a->setToggleAction (true);
10.1647 +addAction (a);
10.1648 +connect( a, SIGNAL( triggered() ), this, SLOT( windowToggleProperty() ) );
10.1649 +actionViewTogglePropertyWindow=a;
10.1650 }
10.1651
10.1652 // Format Actions
10.1653 void Main::setupFormatActions()
10.1654 {
10.1655 - QMenu *formatMenu = menuBar()->addMenu (tr ("F&ormat","Format menu"));
10.1656 -
10.1657 - QToolBar *tb = addToolBar( tr("Format Actions","Format Toolbar name"));
10.1658 - tb->setObjectName ("formatTB");
10.1659 - QAction *a;
10.1660 - QPixmap pix( 16,16);
10.1661 - pix.fill (Qt::black);
10.1662 - a= new QAction(pix, tr( "Set &Color" )+QString("..."), this);
10.1663 - a->setStatusTip ( tr( "Set Color" ));
10.1664 - connect( a, SIGNAL( triggered() ), this, SLOT( formatSelectColor() ) );
10.1665 - a->addTo( tb );
10.1666 - formatMenu->addAction (a);
10.1667 - actionFormatColor=a;
10.1668 - a= new QAction( QPixmap(iconPath+"formatcolorpicker.png"), tr( "Pic&k color","Edit menu" ), this);
10.1669 - a->setStatusTip (tr( "Pick color\nHint: You can pick a color from another branch and color using CTRL+Left Button" ) );
10.1670 - a->setShortcut (Qt::CTRL + Qt::Key_K );
10.1671 - connect( a, SIGNAL( triggered() ), this, SLOT( formatPickColor() ) );
10.1672 - a->setEnabled (false);
10.1673 - a->addTo( tb );
10.1674 - formatMenu->addAction (a);
10.1675 - actionListBranches.append(a);
10.1676 - actionFormatPickColor=a;
10.1677 -
10.1678 - a= new QAction(QPixmap(iconPath+"formatcolorbranch.png"), tr( "Color &branch","Edit menu" ), this);
10.1679 - a->setStatusTip ( tr( "Color branch" ) );
10.1680 - a->setShortcut (Qt::CTRL + Qt::Key_B);
10.1681 - connect( a, SIGNAL( triggered() ), this, SLOT( formatColorBranch() ) );
10.1682 - a->setEnabled (false);
10.1683 - a->addTo( tb );
10.1684 - formatMenu->addAction (a);
10.1685 - actionListBranches.append(a);
10.1686 - actionFormatColorSubtree=a;
10.1687 -
10.1688 - a= new QAction(QPixmap(iconPath+"formatcolorsubtree.png"), tr( "Color sub&tree","Edit menu" ), this);
10.1689 - a->setStatusTip ( tr( "Color Subtree" ));
10.1690 - //FIXME-2 switch back to that a->setShortcut (Qt::CTRL + Qt::Key_T); // Color subtree
10.1691 - connect( a, SIGNAL( triggered() ), this, SLOT( formatColorSubtree() ) );
10.1692 - a->setEnabled (false);
10.1693 - formatMenu->addAction (a);
10.1694 - a->addTo( tb );
10.1695 - actionListBranches.append(a);
10.1696 - actionFormatColorSubtree=a;
10.1697 -
10.1698 - formatMenu->addSeparator();
10.1699 - actionGroupFormatLinkStyles=new QActionGroup ( this);
10.1700 - actionGroupFormatLinkStyles->setExclusive (true);
10.1701 - a= new QAction( tr( "Linkstyle Line" ), actionGroupFormatLinkStyles);
10.1702 - a->setStatusTip (tr( "Line" ));
10.1703 - a->setToggleAction(true);
10.1704 - connect( a, SIGNAL( triggered() ), this, SLOT( formatLinkStyleLine() ) );
10.1705 - formatMenu->addAction (a);
10.1706 - actionFormatLinkStyleLine=a;
10.1707 - a= new QAction( tr( "Linkstyle Curve" ), actionGroupFormatLinkStyles);
10.1708 - a->setStatusTip (tr( "Line" ));
10.1709 - a->setToggleAction(true);
10.1710 - connect( a, SIGNAL( triggered() ), this, SLOT( formatLinkStyleParabel() ) );
10.1711 - formatMenu->addAction (a);
10.1712 - actionFormatLinkStyleParabel=a;
10.1713 - a= new QAction( tr( "Linkstyle Thick Line" ), actionGroupFormatLinkStyles );
10.1714 - a->setStatusTip (tr( "PolyLine" ));
10.1715 - a->setToggleAction(true);
10.1716 - connect( a, SIGNAL( triggered() ), this, SLOT( formatLinkStylePolyLine() ) );
10.1717 - formatMenu->addAction (a);
10.1718 - actionFormatLinkStylePolyLine=a;
10.1719 - a= new QAction( tr( "Linkstyle Thick Curve" ), actionGroupFormatLinkStyles);
10.1720 - a->setStatusTip (tr( "PolyParabel" ) );
10.1721 - a->setToggleAction(true);
10.1722 - a->setChecked (true);
10.1723 - connect( a, SIGNAL( triggered() ), this, SLOT( formatLinkStylePolyParabel() ) );
10.1724 - formatMenu->addAction (a);
10.1725 - actionFormatLinkStylePolyParabel=a;
10.1726 -
10.1727 - a = new QAction( tr( "Hide link if object is not selected","Branch attribute" ), this);
10.1728 - a->setStatusTip (tr( "Hide link" ));
10.1729 - a->setToggleAction(true);
10.1730 - connect( a, SIGNAL( triggered() ), this, SLOT( formatHideLinkUnselected() ) );
10.1731 - actionFormatHideLinkUnselected=a;
10.1732 -
10.1733 - formatMenu->addSeparator();
10.1734 - a= new QAction( tr( "&Use color of heading for link","Branch attribute" ), this);
10.1735 - a->setStatusTip (tr( "Use same color for links and headings" ));
10.1736 - a->setToggleAction(true);
10.1737 - connect( a, SIGNAL( triggered() ), this, SLOT( formatToggleLinkColorHint() ) );
10.1738 - formatMenu->addAction (a);
10.1739 - actionFormatLinkColorHint=a;
10.1740 -
10.1741 - pix.fill (Qt::white);
10.1742 - a= new QAction( pix, tr( "Set &Link Color"+QString("...") ), this );
10.1743 - a->setStatusTip (tr( "Set Link Color" ));
10.1744 - formatMenu->addAction (a);
10.1745 - connect( a, SIGNAL( triggered() ), this, SLOT( formatSelectLinkColor() ) );
10.1746 - actionFormatLinkColor=a;
10.1747 -
10.1748 - a= new QAction( pix, tr( "Set &Selection Color"+QString("...") ), this );
10.1749 - a->setStatusTip (tr( "Set Selection Color" ));
10.1750 - formatMenu->addAction (a);
10.1751 - connect( a, SIGNAL( triggered() ), this, SLOT( formatSelectSelectionColor() ) );
10.1752 - actionFormatSelectionColor=a;
10.1753 -
10.1754 - a= new QAction( pix, tr( "Set &Background Color" )+QString("..."), this );
10.1755 - a->setStatusTip (tr( "Set Background Color" ));
10.1756 - formatMenu->addAction (a);
10.1757 - connect( a, SIGNAL( triggered() ), this, SLOT( formatSelectBackColor() ) );
10.1758 - actionFormatBackColor=a;
10.1759 -
10.1760 - a= new QAction( pix, tr( "Set &Background image" )+QString("..."), this );
10.1761 - a->setStatusTip (tr( "Set Background image" ));
10.1762 - formatMenu->addAction (a);
10.1763 - connect( a, SIGNAL( triggered() ), this, SLOT( formatSelectBackImage() ) );
10.1764 - actionFormatBackImage=a;
10.1765 +QMenu *formatMenu = menuBar()->addMenu (tr ("F&ormat","Format menu"));
10.1766 +
10.1767 +QToolBar *tb = addToolBar( tr("Format Actions","Format Toolbar name"));
10.1768 +tb->setObjectName ("formatTB");
10.1769 +QAction *a;
10.1770 +QPixmap pix( 16,16);
10.1771 +pix.fill (Qt::black);
10.1772 +a= new QAction(pix, tr( "Set &Color" )+QString("..."), this);
10.1773 +a->setStatusTip ( tr( "Set Color" ));
10.1774 +connect( a, SIGNAL( triggered() ), this, SLOT( formatSelectColor() ) );
10.1775 +a->addTo( tb );
10.1776 +formatMenu->addAction (a);
10.1777 +actionFormatColor=a;
10.1778 +a= new QAction( QPixmap(iconPath+"formatcolorpicker.png"), tr( "Pic&k color","Edit menu" ), this);
10.1779 +a->setStatusTip (tr( "Pick color\nHint: You can pick a color from another branch and color using CTRL+Left Button" ) );
10.1780 +a->setShortcut (Qt::CTRL + Qt::Key_K );
10.1781 +connect( a, SIGNAL( triggered() ), this, SLOT( formatPickColor() ) );
10.1782 +a->setEnabled (false);
10.1783 +a->addTo( tb );
10.1784 +formatMenu->addAction (a);
10.1785 +actionListBranches.append(a);
10.1786 +actionFormatPickColor=a;
10.1787 +
10.1788 +a= new QAction(QPixmap(iconPath+"formatcolorbranch.png"), tr( "Color &branch","Edit menu" ), this);
10.1789 +a->setStatusTip ( tr( "Color branch" ) );
10.1790 +a->setShortcut (Qt::CTRL + Qt::Key_B);
10.1791 +connect( a, SIGNAL( triggered() ), this, SLOT( formatColorBranch() ) );
10.1792 +a->setEnabled (false);
10.1793 +a->addTo( tb );
10.1794 +formatMenu->addAction (a);
10.1795 +actionListBranches.append(a);
10.1796 +actionFormatColorSubtree=a;
10.1797 +
10.1798 +a= new QAction(QPixmap(iconPath+"formatcolorsubtree.png"), tr( "Color sub&tree","Edit menu" ), this);
10.1799 +a->setStatusTip ( tr( "Color Subtree" ));
10.1800 +//FIXME-2 switch back to that a->setShortcut (Qt::CTRL + Qt::Key_T); // Color subtree
10.1801 +connect( a, SIGNAL( triggered() ), this, SLOT( formatColorSubtree() ) );
10.1802 +a->setEnabled (false);
10.1803 +formatMenu->addAction (a);
10.1804 +a->addTo( tb );
10.1805 +actionListBranches.append(a);
10.1806 +actionFormatColorSubtree=a;
10.1807 +
10.1808 +formatMenu->addSeparator();
10.1809 +actionGroupFormatLinkStyles=new QActionGroup ( this);
10.1810 +actionGroupFormatLinkStyles->setExclusive (true);
10.1811 +a= new QAction( tr( "Linkstyle Line" ), actionGroupFormatLinkStyles);
10.1812 +a->setStatusTip (tr( "Line" ));
10.1813 +a->setToggleAction(true);
10.1814 +connect( a, SIGNAL( triggered() ), this, SLOT( formatLinkStyleLine() ) );
10.1815 +formatMenu->addAction (a);
10.1816 +actionFormatLinkStyleLine=a;
10.1817 +a= new QAction( tr( "Linkstyle Curve" ), actionGroupFormatLinkStyles);
10.1818 +a->setStatusTip (tr( "Line" ));
10.1819 +a->setToggleAction(true);
10.1820 +connect( a, SIGNAL( triggered() ), this, SLOT( formatLinkStyleParabel() ) );
10.1821 +formatMenu->addAction (a);
10.1822 +actionFormatLinkStyleParabel=a;
10.1823 +a= new QAction( tr( "Linkstyle Thick Line" ), actionGroupFormatLinkStyles );
10.1824 +a->setStatusTip (tr( "PolyLine" ));
10.1825 +a->setToggleAction(true);
10.1826 +connect( a, SIGNAL( triggered() ), this, SLOT( formatLinkStylePolyLine() ) );
10.1827 +formatMenu->addAction (a);
10.1828 +actionFormatLinkStylePolyLine=a;
10.1829 +a= new QAction( tr( "Linkstyle Thick Curve" ), actionGroupFormatLinkStyles);
10.1830 +a->setStatusTip (tr( "PolyParabel" ) );
10.1831 +a->setToggleAction(true);
10.1832 +a->setChecked (true);
10.1833 +connect( a, SIGNAL( triggered() ), this, SLOT( formatLinkStylePolyParabel() ) );
10.1834 +formatMenu->addAction (a);
10.1835 +actionFormatLinkStylePolyParabel=a;
10.1836 +
10.1837 +a = new QAction( tr( "Hide link if object is not selected","Branch attribute" ), this);
10.1838 +a->setStatusTip (tr( "Hide link" ));
10.1839 +a->setToggleAction(true);
10.1840 +connect( a, SIGNAL( triggered() ), this, SLOT( formatHideLinkUnselected() ) );
10.1841 +actionFormatHideLinkUnselected=a;
10.1842 +
10.1843 +formatMenu->addSeparator();
10.1844 +a= new QAction( tr( "&Use color of heading for link","Branch attribute" ), this);
10.1845 +a->setStatusTip (tr( "Use same color for links and headings" ));
10.1846 +a->setToggleAction(true);
10.1847 +connect( a, SIGNAL( triggered() ), this, SLOT( formatToggleLinkColorHint() ) );
10.1848 +formatMenu->addAction (a);
10.1849 +actionFormatLinkColorHint=a;
10.1850 +
10.1851 +pix.fill (Qt::white);
10.1852 +a= new QAction( pix, tr( "Set &Link Color"+QString("...") ), this );
10.1853 +a->setStatusTip (tr( "Set Link Color" ));
10.1854 +formatMenu->addAction (a);
10.1855 +connect( a, SIGNAL( triggered() ), this, SLOT( formatSelectLinkColor() ) );
10.1856 +actionFormatLinkColor=a;
10.1857 +
10.1858 +a= new QAction( pix, tr( "Set &Selection Color"+QString("...") ), this );
10.1859 +a->setStatusTip (tr( "Set Selection Color" ));
10.1860 +formatMenu->addAction (a);
10.1861 +connect( a, SIGNAL( triggered() ), this, SLOT( formatSelectSelectionColor() ) );
10.1862 +actionFormatSelectionColor=a;
10.1863 +
10.1864 +a= new QAction( pix, tr( "Set &Background Color" )+QString("..."), this );
10.1865 +a->setStatusTip (tr( "Set Background Color" ));
10.1866 +formatMenu->addAction (a);
10.1867 +connect( a, SIGNAL( triggered() ), this, SLOT( formatSelectBackColor() ) );
10.1868 +actionFormatBackColor=a;
10.1869 +
10.1870 +a= new QAction( pix, tr( "Set &Background image" )+QString("..."), this );
10.1871 +a->setStatusTip (tr( "Set Background image" ));
10.1872 +formatMenu->addAction (a);
10.1873 +connect( a, SIGNAL( triggered() ), this, SLOT( formatSelectBackImage() ) );
10.1874 +actionFormatBackImage=a;
10.1875 }
10.1876
10.1877 // View Actions
10.1878 void Main::setupViewActions()
10.1879 {
10.1880 - QToolBar *tb = addToolBar( tr("View Actions","View Toolbar name") );
10.1881 - tb->setLabel( "View Actions" );
10.1882 - tb->setObjectName ("viewTB");
10.1883 - QMenu *viewMenu = menuBar()->addMenu ( tr( "&View" ));
10.1884 -
10.1885 - Switchboard switchboard; //FIXME-1 testing...
10.1886 -
10.1887 - QAction *a;
10.1888 - a = new QAction(QPixmap(iconPath+"viewmag-reset.png"), tr( "reset Zoom","View action" ), this);
10.1889 - a->setStatusTip ( tr( "Zoom reset" ) );
10.1890 - a->setShortcut (Qt::CTRL + Qt::Key_0); // Reset zoom
10.1891 - switchboard.addConnection(a,"CTRL+0");
10.1892 - a->addTo( tb );
10.1893 - viewMenu->addAction (a);
10.1894 - connect( a, SIGNAL( triggered() ), this, SLOT(viewZoomReset() ) );
10.1895 -
10.1896 - a = new QAction( QPixmap(iconPath+"viewmag+.png"), tr( "Zoom in","View action" ), this);
10.1897 - a->setStatusTip (tr( "Zoom in" ));
10.1898 - switchboard.addConnection(a,"CTRL++");
10.1899 - a->addTo( tb );
10.1900 - viewMenu->addAction (a);
10.1901 - connect( a, SIGNAL( triggered() ), this, SLOT(viewZoomIn() ) );
10.1902 -
10.1903 - a = new QAction( QPixmap(iconPath+"viewmag-.png"), tr( "Zoom out","View action" ), this);
10.1904 - a->setStatusTip (tr( "Zoom out" ));
10.1905 - switchboard.addConnection(a,"CTRL+-");
10.1906 - a->addTo( tb );
10.1907 - viewMenu->addAction (a);
10.1908 - connect( a, SIGNAL( triggered() ), this, SLOT( viewZoomOut() ) );
10.1909 -
10.1910 - a = new QAction( QPixmap(iconPath+"viewshowsel.png"), tr( "Show selection","View action" ), this);
10.1911 - a->setStatusTip (tr( "Show selection" ));
10.1912 - switchboard.addConnection(a,".");
10.1913 - a->addTo( tb );
10.1914 - viewMenu->addAction (a);
10.1915 - connect( a, SIGNAL( triggered() ), this, SLOT( viewCenter() ) );
10.1916 -
10.1917 - viewMenu->addSeparator();
10.1918 -
10.1919 - a = new QAction(QPixmap(flagsPath+"flag-note.png"), tr( "Show Note Editor","View action" ),this);
10.1920 - a->setStatusTip ( tr( "Show Note Editor" ));
10.1921 - a->setShortcut ( Qt::CTRL + Qt::Key_E ); // Toggle Note Editor
10.1922 - a->setToggleAction(true);
10.1923 - a->addTo( tb );
10.1924 - viewMenu->addAction (a);
10.1925 - connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleNoteEditor() ) );
10.1926 - actionViewToggleNoteEditor=a;
10.1927 -
10.1928 - a = new QAction(QPixmap(iconPath+"history.png"), tr( "History Window","View action" ),this );
10.1929 - a->setStatusTip ( tr( "Show History Window" ));
10.1930 - a->setShortcut ( Qt::CTRL + Qt::Key_H ); // Toggle history window
10.1931 - a->setToggleAction(true);
10.1932 - a->addTo( tb );
10.1933 - viewMenu->addAction (a);
10.1934 - connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleHistory() ) );
10.1935 - actionViewToggleHistoryWindow=a;
10.1936 -
10.1937 - viewMenu->addAction (actionViewTogglePropertyWindow);
10.1938 -
10.1939 - viewMenu->addSeparator();
10.1940 -
10.1941 - a = new QAction(tr( "Antialiasing","View action" ),this );
10.1942 - a->setStatusTip ( tr( "Antialiasing" ));
10.1943 - a->setToggleAction(true);
10.1944 - a->setChecked (settings.value("/mainwindow/view/AntiAlias",true).toBool());
10.1945 - viewMenu->addAction (a);
10.1946 - connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleAntiAlias() ) );
10.1947 - actionViewToggleAntiAlias=a;
10.1948 -
10.1949 - a = new QAction(tr( "Smooth pixmap transformations","View action" ),this );
10.1950 - a->setStatusTip (a->text());
10.1951 - a->setToggleAction(true);
10.1952 - a->setChecked (settings.value("/mainwindow/view/SmoothPixmapTransformation",true).toBool());
10.1953 - viewMenu->addAction (a);
10.1954 - connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleSmoothPixmap() ) );
10.1955 - actionViewToggleSmoothPixmapTransform=a;
10.1956 -
10.1957 - a = new QAction(tr( "Next Map","View action" ), this);
10.1958 - a->setStatusTip (a->text());
10.1959 - a->setShortcut (Qt::ALT + Qt::Key_N );
10.1960 - viewMenu->addAction (a);
10.1961 - connect( a, SIGNAL( triggered() ), this, SLOT(windowNextEditor() ) );
10.1962 -
10.1963 - a = new QAction (tr( "Previous Map","View action" ), this );
10.1964 - a->setStatusTip (a->text());
10.1965 - a->setShortcut (Qt::ALT + Qt::Key_P );
10.1966 - viewMenu->addAction (a);
10.1967 - connect( a, SIGNAL( triggered() ), this, SLOT(windowPreviousEditor() ) );
10.1968 -
10.1969 - switchboard.print();
10.1970 +QToolBar *tb = addToolBar( tr("View Actions","View Toolbar name") );
10.1971 +tb->setLabel( "View Actions" );
10.1972 +tb->setObjectName ("viewTB");
10.1973 +QMenu *viewMenu = menuBar()->addMenu ( tr( "&View" ));
10.1974 +
10.1975 +Switchboard switchboard; //FIXME-1 testing...
10.1976 +
10.1977 +QAction *a;
10.1978 +a = new QAction(QPixmap(iconPath+"viewmag-reset.png"), tr( "reset Zoom","View action" ), this);
10.1979 +a->setStatusTip ( tr( "Zoom reset" ) );
10.1980 +a->setShortcut (Qt::CTRL + Qt::Key_0); // Reset zoom
10.1981 +switchboard.addConnection(a,"CTRL+0");
10.1982 +a->addTo( tb );
10.1983 +viewMenu->addAction (a);
10.1984 +connect( a, SIGNAL( triggered() ), this, SLOT(viewZoomReset() ) );
10.1985 +
10.1986 +a = new QAction( QPixmap(iconPath+"viewmag+.png"), tr( "Zoom in","View action" ), this);
10.1987 +a->setStatusTip (tr( "Zoom in" ));
10.1988 +switchboard.addConnection(a,"CTRL++");
10.1989 +a->addTo( tb );
10.1990 +viewMenu->addAction (a);
10.1991 +connect( a, SIGNAL( triggered() ), this, SLOT(viewZoomIn() ) );
10.1992 +
10.1993 +a = new QAction( QPixmap(iconPath+"viewmag-.png"), tr( "Zoom out","View action" ), this);
10.1994 +a->setStatusTip (tr( "Zoom out" ));
10.1995 +switchboard.addConnection(a,"CTRL+-");
10.1996 +a->addTo( tb );
10.1997 +viewMenu->addAction (a);
10.1998 +connect( a, SIGNAL( triggered() ), this, SLOT( viewZoomOut() ) );
10.1999 +
10.2000 +a = new QAction( QPixmap(iconPath+"viewshowsel.png"), tr( "Show selection","View action" ), this);
10.2001 +a->setStatusTip (tr( "Show selection" ));
10.2002 +switchboard.addConnection(a,".");
10.2003 +a->addTo( tb );
10.2004 +viewMenu->addAction (a);
10.2005 +connect( a, SIGNAL( triggered() ), this, SLOT( viewCenter() ) );
10.2006 +
10.2007 +viewMenu->addSeparator();
10.2008 +
10.2009 +a = new QAction(QPixmap(flagsPath+"flag-note.png"), tr( "Show Note Editor","View action" ),this);
10.2010 +a->setStatusTip ( tr( "Show Note Editor" ));
10.2011 +a->setShortcut ( Qt::CTRL + Qt::Key_E ); // Toggle Note Editor
10.2012 +a->setToggleAction(true);
10.2013 +a->addTo( tb );
10.2014 +viewMenu->addAction (a);
10.2015 +connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleNoteEditor() ) );
10.2016 +actionViewToggleNoteEditor=a;
10.2017 +
10.2018 +a = new QAction(QPixmap(iconPath+"history.png"), tr( "History Window","View action" ),this );
10.2019 +a->setStatusTip ( tr( "Show History Window" ));
10.2020 +a->setShortcut ( Qt::CTRL + Qt::Key_H ); // Toggle history window
10.2021 +a->setToggleAction(true);
10.2022 +a->addTo( tb );
10.2023 +viewMenu->addAction (a);
10.2024 +connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleHistory() ) );
10.2025 +actionViewToggleHistoryWindow=a;
10.2026 +
10.2027 +viewMenu->addAction (actionViewTogglePropertyWindow);
10.2028 +
10.2029 +viewMenu->addSeparator();
10.2030 +
10.2031 +a = new QAction(tr( "Antialiasing","View action" ),this );
10.2032 +a->setStatusTip ( tr( "Antialiasing" ));
10.2033 +a->setToggleAction(true);
10.2034 +a->setChecked (settings.value("/mainwindow/view/AntiAlias",true).toBool());
10.2035 +viewMenu->addAction (a);
10.2036 +connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleAntiAlias() ) );
10.2037 +actionViewToggleAntiAlias=a;
10.2038 +
10.2039 +a = new QAction(tr( "Smooth pixmap transformations","View action" ),this );
10.2040 +a->setStatusTip (a->text());
10.2041 +a->setToggleAction(true);
10.2042 +a->setChecked (settings.value("/mainwindow/view/SmoothPixmapTransformation",true).toBool());
10.2043 +viewMenu->addAction (a);
10.2044 +connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleSmoothPixmap() ) );
10.2045 +actionViewToggleSmoothPixmapTransform=a;
10.2046 +
10.2047 +a = new QAction(tr( "Next Map","View action" ), this);
10.2048 +a->setStatusTip (a->text());
10.2049 +a->setShortcut (Qt::ALT + Qt::Key_N );
10.2050 +viewMenu->addAction (a);
10.2051 +connect( a, SIGNAL( triggered() ), this, SLOT(windowNextEditor() ) );
10.2052 +
10.2053 +a = new QAction (tr( "Previous Map","View action" ), this );
10.2054 +a->setStatusTip (a->text());
10.2055 +a->setShortcut (Qt::ALT + Qt::Key_P );
10.2056 +viewMenu->addAction (a);
10.2057 +connect( a, SIGNAL( triggered() ), this, SLOT(windowPreviousEditor() ) );
10.2058 +
10.2059 +switchboard.print();
10.2060 }
10.2061
10.2062 // Mode Actions
10.2063 void Main::setupModeActions()
10.2064 {
10.2065 - //QPopupMenu *menu = new QPopupMenu( this );
10.2066 - //menuBar()->insertItem( tr( "&Mode (using modifiers)" ), menu );
10.2067 -
10.2068 - QToolBar *tb = addToolBar( tr ("Modes when using modifiers","Modifier Toolbar name") );
10.2069 - tb->setObjectName ("modesTB");
10.2070 - QAction *a;
10.2071 - actionGroupModModes=new QActionGroup ( this);
10.2072 - actionGroupModModes->setExclusive (true);
10.2073 - a= new QAction( QPixmap(iconPath+"modecolor.png"), tr( "Use modifier to color branches","Mode modifier" ), actionGroupModModes);
10.2074 - a->setShortcut (Qt::Key_J);
10.2075 - a->setStatusTip ( tr( "Use modifier to color branches" ));
10.2076 - a->setToggleAction(true);
10.2077 - a->addTo (tb);
10.2078 - a->setChecked(true);
10.2079 - actionModModeColor=a;
10.2080 -
10.2081 - a= new QAction( QPixmap(iconPath+"modecopy.png"), tr( "Use modifier to copy","Mode modifier" ), actionGroupModModes );
10.2082 - a->setShortcut( Qt::Key_K);
10.2083 - a->setStatusTip( tr( "Use modifier to copy" ));
10.2084 - a->setToggleAction(true);
10.2085 - a->addTo (tb);
10.2086 - actionModModeCopy=a;
10.2087 -
10.2088 - a= new QAction(QPixmap(iconPath+"modelink.png"), tr( "Use modifier to draw xLinks","Mode modifier" ), actionGroupModModes );
10.2089 - a->setShortcut (Qt::Key_L);
10.2090 - a->setStatusTip( tr( "Use modifier to draw xLinks" ));
10.2091 - a->setToggleAction(true);
10.2092 - a->addTo (tb);
10.2093 - actionModModeXLink=a;
10.2094 +//QPopupMenu *menu = new QPopupMenu( this );
10.2095 +//menuBar()->insertItem( tr( "&Mode (using modifiers)" ), menu );
10.2096 +
10.2097 +QToolBar *tb = addToolBar( tr ("Modes when using modifiers","Modifier Toolbar name") );
10.2098 +tb->setObjectName ("modesTB");
10.2099 +QAction *a;
10.2100 +actionGroupModModes=new QActionGroup ( this);
10.2101 +actionGroupModModes->setExclusive (true);
10.2102 +a= new QAction( QPixmap(iconPath+"modecolor.png"), tr( "Use modifier to color branches","Mode modifier" ), actionGroupModModes);
10.2103 +a->setShortcut (Qt::Key_J);
10.2104 +a->setStatusTip ( tr( "Use modifier to color branches" ));
10.2105 +a->setToggleAction(true);
10.2106 +a->addTo (tb);
10.2107 +a->setChecked(true);
10.2108 +actionModModeColor=a;
10.2109 +
10.2110 +a= new QAction( QPixmap(iconPath+"modecopy.png"), tr( "Use modifier to copy","Mode modifier" ), actionGroupModModes );
10.2111 +a->setShortcut( Qt::Key_K);
10.2112 +a->setStatusTip( tr( "Use modifier to copy" ));
10.2113 +a->setToggleAction(true);
10.2114 +a->addTo (tb);
10.2115 +actionModModeCopy=a;
10.2116 +
10.2117 +a= new QAction(QPixmap(iconPath+"modelink.png"), tr( "Use modifier to draw xLinks","Mode modifier" ), actionGroupModModes );
10.2118 +a->setShortcut (Qt::Key_L);
10.2119 +a->setStatusTip( tr( "Use modifier to draw xLinks" ));
10.2120 +a->setToggleAction(true);
10.2121 +a->addTo (tb);
10.2122 +actionModModeXLink=a;
10.2123 }
10.2124
10.2125 // Flag Actions
10.2126 void Main::setupFlagActions()
10.2127 {
10.2128 - // Create System Flags
10.2129 - QToolBar *tb=NULL;
10.2130 -
10.2131 - Flag *flag=new Flag;;
10.2132 - flag->setVisible(true);
10.2133 -
10.2134 - flag->load(QPixmap(flagsPath+"flag-note.png"));
10.2135 - setupFlag (flag,tb,"system-note",tr("Note","SystemFlag"));
10.2136 -
10.2137 - flag->load(QPixmap(flagsPath+"flag-url.png"));
10.2138 - setupFlag (flag,tb,"system-url",tr("URL to Document ","SystemFlag"));
10.2139 -
10.2140 - flag->load(QPixmap(flagsPath+"flag-vymlink.png"));
10.2141 - setupFlag (flag,tb,"system-vymLink",tr("Link to another vym map","SystemFlag"));
10.2142 -
10.2143 - flag->load(QPixmap(flagsPath+"flag-scrolled-right.png"));
10.2144 - setupFlag (flag,tb,"system-scrolledright",tr("subtree is scrolled","SystemFlag"));
10.2145 -
10.2146 - flag->load(QPixmap(flagsPath+"flag-tmpUnscrolled-right.png"));
10.2147 - setupFlag (flag,tb,"system-tmpUnscrolledRight",tr("subtree is temporary scrolled","SystemFlag"));
10.2148 -
10.2149 - flag->load(QPixmap(flagsPath+"flag-hideexport.png"));
10.2150 - setupFlag (flag,tb,"system-hideInExport",tr("Hide object in exported maps","SystemFlag"));
10.2151 -
10.2152 - // Create Standard Flags
10.2153 - tb=addToolBar (tr ("Standard Flags","Standard Flag Toolbar"));
10.2154 - tb->setObjectName ("standardFlagTB");
10.2155 - standardFlagsMaster->setToolBar (tb);
10.2156 -
10.2157 - flag->load(flagsPath+"flag-exclamationmark.png");
10.2158 - flag->setGroup("standard-mark");
10.2159 - setupFlag (flag,tb,"exclamationmark",tr("Take care!","Standardflag"));
10.2160 -
10.2161 - flag->load(flagsPath+"flag-questionmark.png");
10.2162 - flag->setGroup("standard-mark");
10.2163 - setupFlag (flag,tb,"questionmark",tr("Really?","Standardflag"));
10.2164 -
10.2165 - flag->load(flagsPath+"flag-hook-green.png");
10.2166 - flag->setGroup("standard-hook");
10.2167 - setupFlag (flag,tb,"hook-green",tr("ok!","Standardflag"));
10.2168 -
10.2169 - flag->load(flagsPath+"flag-cross-red.png");
10.2170 - flag->setGroup("standard-hook");
10.2171 - setupFlag (flag,tb,"cross-red",tr("Not ok!","Standardflag"));
10.2172 - flag->unsetGroup();
10.2173 -
10.2174 - flag->load(flagsPath+"flag-stopsign.png");
10.2175 - setupFlag (flag,tb,"stopsign",tr("This won't work!","Standardflag"));
10.2176 -
10.2177 - flag->load(flagsPath+"flag-smiley-good.png");
10.2178 - flag->setGroup("standard-smiley");
10.2179 - setupFlag (flag,tb,"smiley-good",tr("Good","Standardflag"));
10.2180 -
10.2181 - flag->load(flagsPath+"flag-smiley-sad.png");
10.2182 - flag->setGroup("standard-smiley");
10.2183 - setupFlag (flag,tb,"smiley-sad",tr("Bad","Standardflag"));
10.2184 -
10.2185 - flag->load(flagsPath+"flag-smiley-omg.png");
10.2186 - flag->setGroup("standard-smiley");
10.2187 - setupFlag (flag,tb,"smiley-omb",tr("Oh no!","Standardflag"));
10.2188 - // Original omg.png (in KDE emoticons)
10.2189 - flag->unsetGroup();
10.2190 -
10.2191 - flag->load(flagsPath+"flag-kalarm.png");
10.2192 - setupFlag (flag,tb,"clock",tr("Time critical","Standardflag"));
10.2193 -
10.2194 - flag->load(flagsPath+"flag-phone.png");
10.2195 - setupFlag (flag,tb,"phone",tr("Call...","Standardflag"));
10.2196 -
10.2197 - flag->load(flagsPath+"flag-lamp.png");
10.2198 - setupFlag (flag,tb,"lamp",tr("Idea!","Standardflag"));
10.2199 -
10.2200 - flag->load(flagsPath+"flag-arrow-up.png");
10.2201 - flag->setGroup("standard-arrow");
10.2202 - setupFlag (flag,tb,"arrow-up",tr("Important","Standardflag"));
10.2203 -
10.2204 - flag->load(flagsPath+"flag-arrow-down.png");
10.2205 - flag->setGroup("standard-arrow");
10.2206 - setupFlag (flag,tb,"arrow-down",tr("Unimportant","Standardflag"));
10.2207 -
10.2208 - flag->load(flagsPath+"flag-arrow-2up.png");
10.2209 - flag->setGroup("standard-arrow");
10.2210 - setupFlag (flag,tb,"2arrow-up",tr("Very important!","Standardflag"));
10.2211 -
10.2212 - flag->load(flagsPath+"flag-arrow-2down.png");
10.2213 - flag->setGroup("standard-arrow");
10.2214 - setupFlag (flag,tb,"2arrow-down",tr("Very unimportant!","Standardflag"));
10.2215 - flag->unsetGroup();
10.2216 -
10.2217 - flag->load(flagsPath+"flag-thumb-up.png");
10.2218 - flag->setGroup("standard-thumb");
10.2219 - setupFlag (flag,tb,"thumb-up",tr("I like this","Standardflag"));
10.2220 -
10.2221 - flag->load(flagsPath+"flag-thumb-down.png");
10.2222 - flag->setGroup("standard-thumb");
10.2223 - setupFlag (flag,tb,"thumb-down",tr("I do not like this","Standardflag"));
10.2224 - flag->unsetGroup();
10.2225 -
10.2226 - flag->load(flagsPath+"flag-rose.png");
10.2227 - setupFlag (flag,tb,"rose",tr("Rose","Standardflag"));
10.2228 -
10.2229 - flag->load(flagsPath+"flag-heart.png");
10.2230 - setupFlag (flag,tb,"heart",tr("I just love...","Standardflag"));
10.2231 -
10.2232 - flag->load(flagsPath+"flag-present.png");
10.2233 - setupFlag (flag,tb,"present",tr("Surprise!","Standardflag"));
10.2234 -
10.2235 - flag->load(flagsPath+"flag-flash.png");
10.2236 - setupFlag (flag,tb,"flash",tr("Dangerous","Standardflag"));
10.2237 -
10.2238 - // Original: xsldbg_output.png
10.2239 - flag->load(flagsPath+"flag-info.png");
10.2240 - setupFlag (flag,tb,"info",tr("Info","Standardflag"));
10.2241 -
10.2242 - // Original khelpcenter.png
10.2243 - flag->load(flagsPath+"flag-lifebelt.png");
10.2244 - setupFlag (flag,tb,"lifebelt",tr("This will help","Standardflag"));
10.2245 -
10.2246 - // Freemind flags
10.2247 - flag->setVisible(false);
10.2248 - flag->load(flagsPath+"freemind/warning.png");
10.2249 - setupFlag (flag,tb, "freemind-warning",tr("Important","Freemind-Flag"));
10.2250 -
10.2251 - for (int i=1; i<8; i++)
10.2252 - {
10.2253 - flag->load(flagsPath+QString("freemind/priority-%1.png").arg(i));
10.2254 - setupFlag (flag,tb, QString("freemind-priority-%1").arg(i),tr("Priority","Freemind-Flag"));
10.2255 - }
10.2256 -
10.2257 - flag->load(flagsPath+"freemind/back.png");
10.2258 - setupFlag (flag,tb,"freemind-back",tr("Back","Freemind-Flag"));
10.2259 -
10.2260 - flag->load(flagsPath+"freemind/forward.png");
10.2261 - setupFlag (flag,tb,"freemind-forward",tr("forward","Freemind-Flag"));
10.2262 -
10.2263 - flag->load(flagsPath+"freemind/attach.png");
10.2264 - setupFlag (flag,tb,"freemind-attach",tr("Look here","Freemind-Flag"));
10.2265 -
10.2266 - flag->load(flagsPath+"freemind/clanbomber.png");
10.2267 - setupFlag (flag,tb,"freemind-clanbomber",tr("Dangerous","Freemind-Flag"));
10.2268 -
10.2269 - flag->load(flagsPath+"freemind/desktopnew.png");
10.2270 - setupFlag (flag,tb,"freemind-desktopnew",tr("Don't flagrget","Freemind-Flag"));
10.2271 -
10.2272 - flag->load(flagsPath+"freemind/flag.png");
10.2273 - setupFlag (flag,tb,"freemind-flag",tr("Flag","Freemind-Flag"));
10.2274 -
10.2275 -
10.2276 - flag->load(flagsPath+"freemind/gohome.png");
10.2277 - setupFlag (flag,tb,"freemind-gohome",tr("Home","Freemind-Flag"));
10.2278 -
10.2279 -
10.2280 - flag->load(flagsPath+"freemind/kaddressbook.png");
10.2281 - setupFlag (flag,tb,"freemind-kaddressbook",tr("Telephone","Freemind-Flag"));
10.2282 -
10.2283 - flag->load(flagsPath+"freemind/knotify.png");
10.2284 - setupFlag (flag,tb,"freemind-knotify",tr("Music","Freemind-Flag"));
10.2285 -
10.2286 - flag->load(flagsPath+"freemind/korn.png");
10.2287 - setupFlag (flag,tb,"freemind-korn",tr("Mailbox","Freemind-Flag"));
10.2288 -
10.2289 - flag->load(flagsPath+"freemind/mail.png");
10.2290 - setupFlag (flag,tb,"freemind-mail",tr("Maix","Freemind-Flag"));
10.2291 -
10.2292 - flag->load(flagsPath+"freemind/password.png");
10.2293 - setupFlag (flag,tb,"freemind-password",tr("Password","Freemind-Flag"));
10.2294 -
10.2295 - flag->load(flagsPath+"freemind/pencil.png");
10.2296 - setupFlag (flag,tb,"freemind-pencil",tr("To be improved","Freemind-Flag"));
10.2297 -
10.2298 - flag->load(flagsPath+"freemind/stop.png");
10.2299 - setupFlag (flag,tb,"freemind-stop",tr("Stop","Freemind-Flag"));
10.2300 -
10.2301 - flag->load(flagsPath+"freemind/wizard.png");
10.2302 - setupFlag (flag,tb,"freemind-wizard",tr("Magic","Freemind-Flag"));
10.2303 -
10.2304 - flag->load(flagsPath+"freemind/xmag.png");
10.2305 - setupFlag (flag,tb,"freemind-xmag",tr("To be discussed","Freemind-Flag"));
10.2306 -
10.2307 - flag->load(flagsPath+"freemind/bell.png");
10.2308 - setupFlag (flag,tb,"freemind-bell",tr("Reminder","Freemind-Flag"));
10.2309 -
10.2310 - flag->load(flagsPath+"freemind/bookmark.png");
10.2311 - setupFlag (flag,tb,"freemind-bookmark",tr("Excellent","Freemind-Flag"));
10.2312 -
10.2313 - flag->load(flagsPath+"freemind/penguin.png");
10.2314 - setupFlag (flag,tb,"freemind-penguin",tr("Linux","Freemind-Flag"));
10.2315 -
10.2316 - flag->load(flagsPath+"freemind/licq.png");
10.2317 - setupFlag (flag,tb,"freemind-licq",tr("Sweet","Freemind-Flag"));
10.2318 +// Create System Flags
10.2319 +QToolBar *tb=NULL;
10.2320 +
10.2321 +Flag *flag=new Flag;;
10.2322 +flag->setVisible(true);
10.2323 +
10.2324 +flag->load(QPixmap(flagsPath+"flag-note.png"));
10.2325 +setupFlag (flag,tb,"system-note",tr("Note","SystemFlag"));
10.2326 +
10.2327 +flag->load(QPixmap(flagsPath+"flag-url.png"));
10.2328 +setupFlag (flag,tb,"system-url",tr("URL to Document ","SystemFlag"));
10.2329 +
10.2330 +flag->load(QPixmap(flagsPath+"flag-vymlink.png"));
10.2331 +setupFlag (flag,tb,"system-vymLink",tr("Link to another vym map","SystemFlag"));
10.2332 +
10.2333 +flag->load(QPixmap(flagsPath+"flag-scrolled-right.png"));
10.2334 +setupFlag (flag,tb,"system-scrolledright",tr("subtree is scrolled","SystemFlag"));
10.2335 +
10.2336 +flag->load(QPixmap(flagsPath+"flag-tmpUnscrolled-right.png"));
10.2337 +setupFlag (flag,tb,"system-tmpUnscrolledRight",tr("subtree is temporary scrolled","SystemFlag"));
10.2338 +
10.2339 +flag->load(QPixmap(flagsPath+"flag-hideexport.png"));
10.2340 +setupFlag (flag,tb,"system-hideInExport",tr("Hide object in exported maps","SystemFlag"));
10.2341 +
10.2342 +// Create Standard Flags
10.2343 +tb=addToolBar (tr ("Standard Flags","Standard Flag Toolbar"));
10.2344 +tb->setObjectName ("standardFlagTB");
10.2345 +standardFlagsMaster->setToolBar (tb);
10.2346 +
10.2347 +flag->load(flagsPath+"flag-exclamationmark.png");
10.2348 +flag->setGroup("standard-mark");
10.2349 +setupFlag (flag,tb,"exclamationmark",tr("Take care!","Standardflag"));
10.2350 +
10.2351 +flag->load(flagsPath+"flag-questionmark.png");
10.2352 +flag->setGroup("standard-mark");
10.2353 +setupFlag (flag,tb,"questionmark",tr("Really?","Standardflag"));
10.2354 +
10.2355 +flag->load(flagsPath+"flag-hook-green.png");
10.2356 +flag->setGroup("standard-hook");
10.2357 +setupFlag (flag,tb,"hook-green",tr("ok!","Standardflag"));
10.2358 +
10.2359 +flag->load(flagsPath+"flag-cross-red.png");
10.2360 +flag->setGroup("standard-hook");
10.2361 +setupFlag (flag,tb,"cross-red",tr("Not ok!","Standardflag"));
10.2362 +flag->unsetGroup();
10.2363 +
10.2364 +flag->load(flagsPath+"flag-stopsign.png");
10.2365 +setupFlag (flag,tb,"stopsign",tr("This won't work!","Standardflag"));
10.2366 +
10.2367 +flag->load(flagsPath+"flag-smiley-good.png");
10.2368 +flag->setGroup("standard-smiley");
10.2369 +setupFlag (flag,tb,"smiley-good",tr("Good","Standardflag"));
10.2370 +
10.2371 +flag->load(flagsPath+"flag-smiley-sad.png");
10.2372 +flag->setGroup("standard-smiley");
10.2373 +setupFlag (flag,tb,"smiley-sad",tr("Bad","Standardflag"));
10.2374 +
10.2375 +flag->load(flagsPath+"flag-smiley-omg.png");
10.2376 +flag->setGroup("standard-smiley");
10.2377 +setupFlag (flag,tb,"smiley-omb",tr("Oh no!","Standardflag"));
10.2378 +// Original omg.png (in KDE emoticons)
10.2379 +flag->unsetGroup();
10.2380 +
10.2381 +flag->load(flagsPath+"flag-kalarm.png");
10.2382 +setupFlag (flag,tb,"clock",tr("Time critical","Standardflag"));
10.2383 +
10.2384 +flag->load(flagsPath+"flag-phone.png");
10.2385 +setupFlag (flag,tb,"phone",tr("Call...","Standardflag"));
10.2386 +
10.2387 +flag->load(flagsPath+"flag-lamp.png");
10.2388 +setupFlag (flag,tb,"lamp",tr("Idea!","Standardflag"));
10.2389 +
10.2390 +flag->load(flagsPath+"flag-arrow-up.png");
10.2391 +flag->setGroup("standard-arrow");
10.2392 +setupFlag (flag,tb,"arrow-up",tr("Important","Standardflag"));
10.2393 +
10.2394 +flag->load(flagsPath+"flag-arrow-down.png");
10.2395 +flag->setGroup("standard-arrow");
10.2396 +setupFlag (flag,tb,"arrow-down",tr("Unimportant","Standardflag"));
10.2397 +
10.2398 +flag->load(flagsPath+"flag-arrow-2up.png");
10.2399 +flag->setGroup("standard-arrow");
10.2400 +setupFlag (flag,tb,"2arrow-up",tr("Very important!","Standardflag"));
10.2401 +
10.2402 +flag->load(flagsPath+"flag-arrow-2down.png");
10.2403 +flag->setGroup("standard-arrow");
10.2404 +setupFlag (flag,tb,"2arrow-down",tr("Very unimportant!","Standardflag"));
10.2405 +flag->unsetGroup();
10.2406 +
10.2407 +flag->load(flagsPath+"flag-thumb-up.png");
10.2408 +flag->setGroup("standard-thumb");
10.2409 +setupFlag (flag,tb,"thumb-up",tr("I like this","Standardflag"));
10.2410 +
10.2411 +flag->load(flagsPath+"flag-thumb-down.png");
10.2412 +flag->setGroup("standard-thumb");
10.2413 +setupFlag (flag,tb,"thumb-down",tr("I do not like this","Standardflag"));
10.2414 +flag->unsetGroup();
10.2415 +
10.2416 +flag->load(flagsPath+"flag-rose.png");
10.2417 +setupFlag (flag,tb,"rose",tr("Rose","Standardflag"));
10.2418 +
10.2419 +flag->load(flagsPath+"flag-heart.png");
10.2420 +setupFlag (flag,tb,"heart",tr("I just love...","Standardflag"));
10.2421 +
10.2422 +flag->load(flagsPath+"flag-present.png");
10.2423 +setupFlag (flag,tb,"present",tr("Surprise!","Standardflag"));
10.2424 +
10.2425 +flag->load(flagsPath+"flag-flash.png");
10.2426 +setupFlag (flag,tb,"flash",tr("Dangerous","Standardflag"));
10.2427 +
10.2428 +// Original: xsldbg_output.png
10.2429 +flag->load(flagsPath+"flag-info.png");
10.2430 +setupFlag (flag,tb,"info",tr("Info","Standardflag"));
10.2431 +
10.2432 +// Original khelpcenter.png
10.2433 +flag->load(flagsPath+"flag-lifebelt.png");
10.2434 +setupFlag (flag,tb,"lifebelt",tr("This will help","Standardflag"));
10.2435 +
10.2436 +// Freemind flags
10.2437 +flag->setVisible(false);
10.2438 +flag->load(flagsPath+"freemind/warning.png");
10.2439 +setupFlag (flag,tb, "freemind-warning",tr("Important","Freemind-Flag"));
10.2440 +
10.2441 +for (int i=1; i<8; i++)
10.2442 +{
10.2443 + flag->load(flagsPath+QString("freemind/priority-%1.png").arg(i));
10.2444 + setupFlag (flag,tb, QString("freemind-priority-%1").arg(i),tr("Priority","Freemind-Flag"));
10.2445 +}
10.2446 +
10.2447 +flag->load(flagsPath+"freemind/back.png");
10.2448 +setupFlag (flag,tb,"freemind-back",tr("Back","Freemind-Flag"));
10.2449 +
10.2450 +flag->load(flagsPath+"freemind/forward.png");
10.2451 +setupFlag (flag,tb,"freemind-forward",tr("forward","Freemind-Flag"));
10.2452 +
10.2453 +flag->load(flagsPath+"freemind/attach.png");
10.2454 +setupFlag (flag,tb,"freemind-attach",tr("Look here","Freemind-Flag"));
10.2455 +
10.2456 +flag->load(flagsPath+"freemind/clanbomber.png");
10.2457 +setupFlag (flag,tb,"freemind-clanbomber",tr("Dangerous","Freemind-Flag"));
10.2458 +
10.2459 +flag->load(flagsPath+"freemind/desktopnew.png");
10.2460 +setupFlag (flag,tb,"freemind-desktopnew",tr("Don't flagrget","Freemind-Flag"));
10.2461 +
10.2462 +flag->load(flagsPath+"freemind/flag.png");
10.2463 +setupFlag (flag,tb,"freemind-flag",tr("Flag","Freemind-Flag"));
10.2464 +
10.2465 +
10.2466 +flag->load(flagsPath+"freemind/gohome.png");
10.2467 +setupFlag (flag,tb,"freemind-gohome",tr("Home","Freemind-Flag"));
10.2468 +
10.2469 +
10.2470 +flag->load(flagsPath+"freemind/kaddressbook.png");
10.2471 +setupFlag (flag,tb,"freemind-kaddressbook",tr("Telephone","Freemind-Flag"));
10.2472 +
10.2473 +flag->load(flagsPath+"freemind/knotify.png");
10.2474 +setupFlag (flag,tb,"freemind-knotify",tr("Music","Freemind-Flag"));
10.2475 +
10.2476 +flag->load(flagsPath+"freemind/korn.png");
10.2477 +setupFlag (flag,tb,"freemind-korn",tr("Mailbox","Freemind-Flag"));
10.2478 +
10.2479 +flag->load(flagsPath+"freemind/mail.png");
10.2480 +setupFlag (flag,tb,"freemind-mail",tr("Maix","Freemind-Flag"));
10.2481 +
10.2482 +flag->load(flagsPath+"freemind/password.png");
10.2483 +setupFlag (flag,tb,"freemind-password",tr("Password","Freemind-Flag"));
10.2484 +
10.2485 +flag->load(flagsPath+"freemind/pencil.png");
10.2486 +setupFlag (flag,tb,"freemind-pencil",tr("To be improved","Freemind-Flag"));
10.2487 +
10.2488 +flag->load(flagsPath+"freemind/stop.png");
10.2489 +setupFlag (flag,tb,"freemind-stop",tr("Stop","Freemind-Flag"));
10.2490 +
10.2491 +flag->load(flagsPath+"freemind/wizard.png");
10.2492 +setupFlag (flag,tb,"freemind-wizard",tr("Magic","Freemind-Flag"));
10.2493 +
10.2494 +flag->load(flagsPath+"freemind/xmag.png");
10.2495 +setupFlag (flag,tb,"freemind-xmag",tr("To be discussed","Freemind-Flag"));
10.2496 +
10.2497 +flag->load(flagsPath+"freemind/bell.png");
10.2498 +setupFlag (flag,tb,"freemind-bell",tr("Reminder","Freemind-Flag"));
10.2499 +
10.2500 +flag->load(flagsPath+"freemind/bookmark.png");
10.2501 +setupFlag (flag,tb,"freemind-bookmark",tr("Excellent","Freemind-Flag"));
10.2502 +
10.2503 +flag->load(flagsPath+"freemind/penguin.png");
10.2504 +setupFlag (flag,tb,"freemind-penguin",tr("Linux","Freemind-Flag"));
10.2505 +
10.2506 +flag->load(flagsPath+"freemind/licq.png");
10.2507 +setupFlag (flag,tb,"freemind-licq",tr("Sweet","Freemind-Flag"));
10.2508 }
10.2509
10.2510 void Main::setupFlag (Flag *flag, QToolBar *tb, const QString &name, const QString &tooltip)
10.2511 {
10.2512 - flag->setName(name);
10.2513 - flag->setToolTip (tooltip);
10.2514 - QAction *a;
10.2515 - if (tb)
10.2516 - {
10.2517 - a=new QAction (flag->getPixmap(),name,this);
10.2518 - // StandardFlag
10.2519 - tb->addAction (a);
10.2520 - flag->setAction (a);
10.2521 - a->setVisible (flag->isVisible());
10.2522 - a->setCheckable(true);
10.2523 - a->setObjectName(name);
10.2524 - a->setToolTip(tooltip);
10.2525 - connect (a, SIGNAL( triggered() ), this, SLOT( standardFlagChanged() ) );
10.2526 - standardFlagsMaster->addFlag (flag);
10.2527 - } else
10.2528 - {
10.2529 - // SystemFlag
10.2530 - systemFlagsMaster->addFlag (flag);
10.2531 - }
10.2532 +flag->setName(name);
10.2533 +flag->setToolTip (tooltip);
10.2534 +QAction *a;
10.2535 +if (tb)
10.2536 +{
10.2537 + a=new QAction (flag->getPixmap(),name,this);
10.2538 + // StandardFlag
10.2539 + tb->addAction (a);
10.2540 + flag->setAction (a);
10.2541 + a->setVisible (flag->isVisible());
10.2542 + a->setCheckable(true);
10.2543 + a->setObjectName(name);
10.2544 + a->setToolTip(tooltip);
10.2545 + connect (a, SIGNAL( triggered() ), this, SLOT( standardFlagChanged() ) );
10.2546 + standardFlagsMaster->addFlag (flag);
10.2547 +} else
10.2548 +{
10.2549 + // SystemFlag
10.2550 + systemFlagsMaster->addFlag (flag);
10.2551 +}
10.2552 }
10.2553
10.2554 // Network Actions
10.2555 void Main::setupNetworkActions()
10.2556 {
10.2557 - if (!settings.value( "/mainwindow/showTestMenu",false).toBool() )
10.2558 - return;
10.2559 - QMenu *netMenu = menuBar()->addMenu( "Network" );
10.2560 -
10.2561 - QAction *a;
10.2562 -
10.2563 - a = new QAction( "Start TCPserver for MapEditor",this);
10.2564 - //a->setStatusTip ( "Set application to open pdf files"));
10.2565 - //a->setShortcut ( Qt::ALT + Qt::Key_T ); //New TCP server
10.2566 - connect( a, SIGNAL( triggered() ), this, SLOT( networkStartServer() ) );
10.2567 - netMenu->addAction (a);
10.2568 -
10.2569 - a = new QAction( "Connect MapEditor to server",this);
10.2570 - //a->setStatusTip ( "Set application to open pdf files"));
10.2571 - a->setShortcut ( Qt::ALT + Qt::Key_C ); // Connect to server
10.2572 - connect( a, SIGNAL( triggered() ), this, SLOT( networkConnect() ) );
10.2573 - netMenu->addAction (a);
10.2574 +if (!settings.value( "/mainwindow/showTestMenu",false).toBool() )
10.2575 + return;
10.2576 +QMenu *netMenu = menuBar()->addMenu( "Network" );
10.2577 +
10.2578 +QAction *a;
10.2579 +
10.2580 +a = new QAction( "Start TCPserver for MapEditor",this);
10.2581 +//a->setStatusTip ( "Set application to open pdf files"));
10.2582 +//a->setShortcut ( Qt::ALT + Qt::Key_T ); //New TCP server
10.2583 +connect( a, SIGNAL( triggered() ), this, SLOT( networkStartServer() ) );
10.2584 +netMenu->addAction (a);
10.2585 +
10.2586 +a = new QAction( "Connect MapEditor to server",this);
10.2587 +//a->setStatusTip ( "Set application to open pdf files"));
10.2588 +a->setShortcut ( Qt::ALT + Qt::Key_C ); // Connect to server
10.2589 +connect( a, SIGNAL( triggered() ), this, SLOT( networkConnect() ) );
10.2590 +netMenu->addAction (a);
10.2591 }
10.2592 -
10.2593 +
10.2594 // Settings Actions
10.2595 void Main::setupSettingsActions()
10.2596 {
10.2597 - QMenu *settingsMenu = menuBar()->addMenu( tr( "&Settings" ));
10.2598 -
10.2599 - QAction *a;
10.2600 -
10.2601 - a = new QAction( tr( "Set application to open pdf files","Settings action"), this);
10.2602 - a->setStatusTip ( tr( "Set application to open pdf files"));
10.2603 - connect( a, SIGNAL( triggered() ), this, SLOT( settingsPDF() ) );
10.2604 - settingsMenu->addAction (a);
10.2605 -
10.2606 - a = new QAction( tr( "Set application to open external links","Settings action"), this);
10.2607 - a->setStatusTip( tr( "Set application to open external links"));
10.2608 - connect( a, SIGNAL( triggered() ), this, SLOT( settingsURL() ) );
10.2609 - settingsMenu->addAction (a);
10.2610 -
10.2611 - a = new QAction( tr( "Set path for macros","Settings action")+"...", this);
10.2612 - a->setStatusTip( tr( "Set path for macros"));
10.2613 - connect( a, SIGNAL( triggered() ), this, SLOT( settingsMacroDir() ) );
10.2614 - settingsMenu->addAction (a);
10.2615 -
10.2616 - a = new QAction( tr( "Set number of undo levels","Settings action")+"...", this);
10.2617 - a->setStatusTip( tr( "Set number of undo levels"));
10.2618 - connect( a, SIGNAL( triggered() ), this, SLOT( settingsUndoLevels() ) );
10.2619 - settingsMenu->addAction (a);
10.2620 -
10.2621 - settingsMenu->addSeparator();
10.2622 -
10.2623 - a = new QAction( tr( "Autosave","Settings action"), this);
10.2624 - a->setStatusTip( tr( "Autosave"));
10.2625 - a->setToggleAction(true);
10.2626 - a->setChecked ( settings.value ("/mainwindow/autosave/use",false).toBool());
10.2627 - connect( a, SIGNAL( triggered() ), this, SLOT( settingsAutosaveToggle() ) );
10.2628 - settingsMenu->addAction (a);
10.2629 - actionSettingsAutosaveToggle=a;
10.2630 -
10.2631 - a = new QAction( tr( "Autosave time","Settings action")+"...", this);
10.2632 - a->setStatusTip( tr( "Autosave time"));
10.2633 - connect( a, SIGNAL( triggered() ), this, SLOT( settingsAutosaveTime() ) );
10.2634 - settingsMenu->addAction (a);
10.2635 - actionSettingsAutosaveTime=a;
10.2636 -
10.2637 - a = new QAction( tr( "Write backup file on save","Settings action"), this);
10.2638 - a->setStatusTip( tr( "Write backup file on save"));
10.2639 - a->setToggleAction(true);
10.2640 - a->setChecked ( settings.value ("/mainwindow/writeBackupFile",false).toBool());
10.2641 - connect( a, SIGNAL( triggered() ), this, SLOT( settingsWriteBackupFileToggle() ) );
10.2642 - settingsMenu->addAction (a);
10.2643 - actionSettingsWriteBackupFile=a;
10.2644 -
10.2645 - settingsMenu->addSeparator();
10.2646 -
10.2647 - a = new QAction( tr( "Edit branch after adding it","Settings action" ), this );
10.2648 - a->setStatusTip( tr( "Edit branch after adding it" ));
10.2649 - a->setToggleAction(true);
10.2650 - a->setChecked ( settings.value ("/mapeditor/editmode/autoEditNewBranch",true).toBool());
10.2651 - settingsMenu->addAction (a);
10.2652 - actionSettingsAutoEditNewBranch=a;
10.2653 -
10.2654 - a= new QAction( tr( "Select branch after adding it","Settings action" ), this );
10.2655 - a->setStatusTip( tr( "Select branch after adding it" ));
10.2656 - a->setToggleAction(true);
10.2657 - a->setChecked ( settings.value ("/mapeditor/editmode/autoSelectNewBranch",false).toBool() );
10.2658 - settingsMenu->addAction (a);
10.2659 - actionSettingsAutoSelectNewBranch=a;
10.2660 -
10.2661 - a= new QAction(tr( "Select existing heading","Settings action" ), this);
10.2662 - a->setStatusTip( tr( "Select heading before editing" ));
10.2663 - a->setToggleAction(true);
10.2664 - a->setChecked ( settings.value ("/mapeditor/editmode/autoSelectText",true).toBool() );
10.2665 - settingsMenu->addAction (a);
10.2666 - actionSettingsAutoSelectText=a;
10.2667 -
10.2668 - a= new QAction( tr( "Delete key","Settings action" ), this);
10.2669 - a->setStatusTip( tr( "Delete key for deleting branches" ));
10.2670 - a->setToggleAction(true);
10.2671 - a->setChecked ( settings.value ("/mapeditor/editmode/useDelKey",true).toBool() );
10.2672 - settingsMenu->addAction (a);
10.2673 - connect( a, SIGNAL( triggered() ), this, SLOT( settingsToggleDelKey() ) );
10.2674 - actionSettingsUseDelKey=a;
10.2675 -
10.2676 - a= new QAction( tr( "Exclusive flags","Settings action" ), this);
10.2677 - a->setStatusTip( tr( "Use exclusive flags in flag toolbars" ));
10.2678 - a->setToggleAction(true);
10.2679 - a->setChecked ( settings.value ("/mapeditor/editmode/useFlagGroups",true).toBool() );
10.2680 - settingsMenu->addAction (a);
10.2681 - actionSettingsUseFlagGroups=a;
10.2682 -
10.2683 - a= new QAction( tr( "Use hide flags","Settings action" ), this);
10.2684 - a->setStatusTip( tr( "Use hide flag during exports " ));
10.2685 - a->setToggleAction(true);
10.2686 - a->setChecked ( settings.value ("/export/useHideExport",true).toBool() );
10.2687 - settingsMenu->addAction (a);
10.2688 - actionSettingsUseHideExport=a;
10.2689 -
10.2690 - a = new QAction( tr( "Animation","Settings action"), this);
10.2691 - a->setStatusTip( tr( "Animation"));
10.2692 - a->setToggleAction(true);
10.2693 - a->setChecked (settings.value("/animation/use",true).toBool() );
10.2694 - connect( a, SIGNAL( triggered() ), this, SLOT( settingsToggleAnimation() ) );
10.2695 - settingsMenu->addAction (a);
10.2696 - actionSettingsUseAnimation=a;
10.2697 +QMenu *settingsMenu = menuBar()->addMenu( tr( "&Settings" ));
10.2698 +
10.2699 +QAction *a;
10.2700 +
10.2701 +a = new QAction( tr( "Set application to open pdf files","Settings action"), this);
10.2702 +a->setStatusTip ( tr( "Set application to open pdf files"));
10.2703 +connect( a, SIGNAL( triggered() ), this, SLOT( settingsPDF() ) );
10.2704 +settingsMenu->addAction (a);
10.2705 +
10.2706 +a = new QAction( tr( "Set application to open external links","Settings action"), this);
10.2707 +a->setStatusTip( tr( "Set application to open external links"));
10.2708 +connect( a, SIGNAL( triggered() ), this, SLOT( settingsURL() ) );
10.2709 +settingsMenu->addAction (a);
10.2710 +
10.2711 +a = new QAction( tr( "Set path for macros","Settings action")+"...", this);
10.2712 +a->setStatusTip( tr( "Set path for macros"));
10.2713 +connect( a, SIGNAL( triggered() ), this, SLOT( settingsMacroDir() ) );
10.2714 +settingsMenu->addAction (a);
10.2715 +
10.2716 +a = new QAction( tr( "Set number of undo levels","Settings action")+"...", this);
10.2717 +a->setStatusTip( tr( "Set number of undo levels"));
10.2718 +connect( a, SIGNAL( triggered() ), this, SLOT( settingsUndoLevels() ) );
10.2719 +settingsMenu->addAction (a);
10.2720 +
10.2721 +settingsMenu->addSeparator();
10.2722 +
10.2723 +a = new QAction( tr( "Autosave","Settings action"), this);
10.2724 +a->setStatusTip( tr( "Autosave"));
10.2725 +a->setToggleAction(true);
10.2726 +a->setChecked ( settings.value ("/mainwindow/autosave/use",false).toBool());
10.2727 +connect( a, SIGNAL( triggered() ), this, SLOT( settingsAutosaveToggle() ) );
10.2728 +settingsMenu->addAction (a);
10.2729 +actionSettingsAutosaveToggle=a;
10.2730 +
10.2731 +a = new QAction( tr( "Autosave time","Settings action")+"...", this);
10.2732 +a->setStatusTip( tr( "Autosave time"));
10.2733 +connect( a, SIGNAL( triggered() ), this, SLOT( settingsAutosaveTime() ) );
10.2734 +settingsMenu->addAction (a);
10.2735 +actionSettingsAutosaveTime=a;
10.2736 +
10.2737 +a = new QAction( tr( "Write backup file on save","Settings action"), this);
10.2738 +a->setStatusTip( tr( "Write backup file on save"));
10.2739 +a->setToggleAction(true);
10.2740 +a->setChecked ( settings.value ("/mainwindow/writeBackupFile",false).toBool());
10.2741 +connect( a, SIGNAL( triggered() ), this, SLOT( settingsWriteBackupFileToggle() ) );
10.2742 +settingsMenu->addAction (a);
10.2743 +actionSettingsWriteBackupFile=a;
10.2744 +
10.2745 +settingsMenu->addSeparator();
10.2746 +
10.2747 +a = new QAction( tr( "Edit branch after adding it","Settings action" ), this );
10.2748 +a->setStatusTip( tr( "Edit branch after adding it" ));
10.2749 +a->setToggleAction(true);
10.2750 +a->setChecked ( settings.value ("/mapeditor/editmode/autoEditNewBranch",true).toBool());
10.2751 +settingsMenu->addAction (a);
10.2752 +actionSettingsAutoEditNewBranch=a;
10.2753 +
10.2754 +a= new QAction( tr( "Select branch after adding it","Settings action" ), this );
10.2755 +a->setStatusTip( tr( "Select branch after adding it" ));
10.2756 +a->setToggleAction(true);
10.2757 +a->setChecked ( settings.value ("/mapeditor/editmode/autoSelectNewBranch",false).toBool() );
10.2758 +settingsMenu->addAction (a);
10.2759 +actionSettingsAutoSelectNewBranch=a;
10.2760 +
10.2761 +a= new QAction(tr( "Select existing heading","Settings action" ), this);
10.2762 +a->setStatusTip( tr( "Select heading before editing" ));
10.2763 +a->setToggleAction(true);
10.2764 +a->setChecked ( settings.value ("/mapeditor/editmode/autoSelectText",true).toBool() );
10.2765 +settingsMenu->addAction (a);
10.2766 +actionSettingsAutoSelectText=a;
10.2767 +
10.2768 +a= new QAction( tr( "Delete key","Settings action" ), this);
10.2769 +a->setStatusTip( tr( "Delete key for deleting branches" ));
10.2770 +a->setToggleAction(true);
10.2771 +a->setChecked ( settings.value ("/mapeditor/editmode/useDelKey",true).toBool() );
10.2772 +settingsMenu->addAction (a);
10.2773 +connect( a, SIGNAL( triggered() ), this, SLOT( settingsToggleDelKey() ) );
10.2774 +actionSettingsUseDelKey=a;
10.2775 +
10.2776 +a= new QAction( tr( "Exclusive flags","Settings action" ), this);
10.2777 +a->setStatusTip( tr( "Use exclusive flags in flag toolbars" ));
10.2778 +a->setToggleAction(true);
10.2779 +a->setChecked ( settings.value ("/mapeditor/editmode/useFlagGroups",true).toBool() );
10.2780 +settingsMenu->addAction (a);
10.2781 +actionSettingsUseFlagGroups=a;
10.2782 +
10.2783 +a= new QAction( tr( "Use hide flags","Settings action" ), this);
10.2784 +a->setStatusTip( tr( "Use hide flag during exports " ));
10.2785 +a->setToggleAction(true);
10.2786 +a->setChecked ( settings.value ("/export/useHideExport",true).toBool() );
10.2787 +settingsMenu->addAction (a);
10.2788 +actionSettingsUseHideExport=a;
10.2789 +
10.2790 +a = new QAction( tr( "Animation","Settings action"), this);
10.2791 +a->setStatusTip( tr( "Animation"));
10.2792 +a->setToggleAction(true);
10.2793 +a->setChecked (settings.value("/animation/use",true).toBool() );
10.2794 +connect( a, SIGNAL( triggered() ), this, SLOT( settingsToggleAnimation() ) );
10.2795 +settingsMenu->addAction (a);
10.2796 +actionSettingsUseAnimation=a;
10.2797 }
10.2798
10.2799 // Test Actions
10.2800 void Main::setupTestActions()
10.2801 {
10.2802 - QMenu *testMenu = menuBar()->addMenu( tr( "&Test" ));
10.2803 -
10.2804 - QAction *a;
10.2805 - a = new QAction( "Test function 1" , this);
10.2806 - a->setStatusTip( "Call test function 1" );
10.2807 - a->setShortcut (Qt::CTRL + Qt::Key_T); // Test function 1 //FIXME-2 originally: color subtree
10.2808 - testMenu->addAction (a);
10.2809 - connect( a, SIGNAL( triggered() ), this, SLOT( testFunction1() ) );
10.2810 -
10.2811 - a = new QAction( "Test function 2" , this);
10.2812 - a->setStatusTip( "Call test function 2" );
10.2813 - a->setShortcut (Qt::SHIFT + Qt::Key_T); // Test function 2
10.2814 - testMenu->addAction (a);
10.2815 - connect( a, SIGNAL( triggered() ), this, SLOT( testFunction2() ) );
10.2816 -
10.2817 - a = new QAction( "Command" , this);
10.2818 - a->setStatusTip( "Enter command to call in editor" );
10.2819 - connect( a, SIGNAL( triggered() ), this, SLOT( testCommand() ) );
10.2820 - testMenu->addAction (a);
10.2821 +QMenu *testMenu = menuBar()->addMenu( tr( "&Test" ));
10.2822 +
10.2823 +QAction *a;
10.2824 +a = new QAction( "Test function 1" , this);
10.2825 +a->setStatusTip( "Call test function 1" );
10.2826 +a->setShortcut (Qt::CTRL + Qt::Key_T); // Test function 1 //FIXME-2 originally: color subtree
10.2827 +testMenu->addAction (a);
10.2828 +connect( a, SIGNAL( triggered() ), this, SLOT( testFunction1() ) );
10.2829 +
10.2830 +a = new QAction( "Test function 2" , this);
10.2831 +a->setStatusTip( "Call test function 2" );
10.2832 +a->setShortcut (Qt::SHIFT + Qt::Key_T); // Test function 2
10.2833 +testMenu->addAction (a);
10.2834 +connect( a, SIGNAL( triggered() ), this, SLOT( testFunction2() ) );
10.2835 +
10.2836 +a = new QAction( "Command" , this);
10.2837 +a->setStatusTip( "Enter command to call in editor" );
10.2838 +connect( a, SIGNAL( triggered() ), this, SLOT( testCommand() ) );
10.2839 +testMenu->addAction (a);
10.2840 }
10.2841
10.2842 // Help Actions
10.2843 void Main::setupHelpActions()
10.2844 {
10.2845 - QMenu *helpMenu = menuBar()->addMenu ( tr( "&Help","Help menubar entry" ));
10.2846 -
10.2847 - QAction *a;
10.2848 - a = new QAction( tr( "Open VYM Documentation (pdf) ","Help action" ), this );
10.2849 - a->setStatusTip( tr( "Open VYM Documentation (pdf)" ));
10.2850 - connect( a, SIGNAL( triggered() ), this, SLOT( helpDoc() ) );
10.2851 - helpMenu->addAction (a);
10.2852 -
10.2853 - a = new QAction( tr( "Open VYM example maps ","Help action" ), this );
10.2854 - a->setStatusTip( tr( "Open VYM example maps " ));
10.2855 - connect( a, SIGNAL( triggered() ), this, SLOT( helpDemo() ) );
10.2856 - helpMenu->addAction (a);
10.2857 -
10.2858 - a = new QAction( tr( "About VYM","Help action" ), this);
10.2859 - a->setStatusTip( tr( "About VYM")+vymName);
10.2860 - connect( a, SIGNAL( triggered() ), this, SLOT( helpAbout() ) );
10.2861 - helpMenu->addAction (a);
10.2862 -
10.2863 - a = new QAction( tr( "About QT","Help action" ), this);
10.2864 - a->setStatusTip( tr( "Information about QT toolkit" ));
10.2865 - connect( a, SIGNAL( triggered() ), this, SLOT( helpAboutQT() ) );
10.2866 - helpMenu->addAction (a);
10.2867 +QMenu *helpMenu = menuBar()->addMenu ( tr( "&Help","Help menubar entry" ));
10.2868 +
10.2869 +QAction *a;
10.2870 +a = new QAction( tr( "Open VYM Documentation (pdf) ","Help action" ), this );
10.2871 +a->setStatusTip( tr( "Open VYM Documentation (pdf)" ));
10.2872 +connect( a, SIGNAL( triggered() ), this, SLOT( helpDoc() ) );
10.2873 +helpMenu->addAction (a);
10.2874 +
10.2875 +a = new QAction( tr( "Open VYM example maps ","Help action" ), this );
10.2876 +a->setStatusTip( tr( "Open VYM example maps " ));
10.2877 +connect( a, SIGNAL( triggered() ), this, SLOT( helpDemo() ) );
10.2878 +helpMenu->addAction (a);
10.2879 +
10.2880 +a = new QAction( tr( "About VYM","Help action" ), this);
10.2881 +a->setStatusTip( tr( "About VYM")+vymName);
10.2882 +connect( a, SIGNAL( triggered() ), this, SLOT( helpAbout() ) );
10.2883 +helpMenu->addAction (a);
10.2884 +
10.2885 +a = new QAction( tr( "About QT","Help action" ), this);
10.2886 +a->setStatusTip( tr( "Information about QT toolkit" ));
10.2887 +connect( a, SIGNAL( triggered() ), this, SLOT( helpAboutQT() ) );
10.2888 +helpMenu->addAction (a);
10.2889 }
10.2890
10.2891 // Context Menus
10.2892 void Main::setupContextMenus()
10.2893 {
10.2894 - QAction*a;
10.2895 -
10.2896 - // Context Menu for branch or mapcenter
10.2897 - branchContextMenu =new QMenu (this);
10.2898 - branchContextMenu->addAction (actionViewTogglePropertyWindow);
10.2899 +QAction*a;
10.2900 +
10.2901 +// Context Menu for branch or mapcenter
10.2902 +branchContextMenu =new QMenu (this);
10.2903 +branchContextMenu->addAction (actionViewTogglePropertyWindow);
10.2904 +branchContextMenu->addSeparator();
10.2905 +
10.2906 + // Submenu "Add"
10.2907 + branchAddContextMenu =branchContextMenu->addMenu (tr("Add"));
10.2908 + branchAddContextMenu->addAction (actionPaste );
10.2909 + branchAddContextMenu->addAction ( actionAddMapCenter );
10.2910 + branchAddContextMenu->addAction ( actionAddBranch );
10.2911 + branchAddContextMenu->addAction ( actionAddBranchBefore );
10.2912 + branchAddContextMenu->addAction ( actionAddBranchAbove);
10.2913 + branchAddContextMenu->addAction ( actionAddBranchBelow );
10.2914 + branchAddContextMenu->addSeparator();
10.2915 + branchAddContextMenu->addAction ( actionImportAdd );
10.2916 + branchAddContextMenu->addAction ( actionImportReplace );
10.2917 +
10.2918 + // Submenu "Remove"
10.2919 + branchRemoveContextMenu =branchContextMenu->addMenu (tr ("Remove","Context menu name"));
10.2920 + branchRemoveContextMenu->addAction (actionCut);
10.2921 + branchRemoveContextMenu->addAction ( actionDelete );
10.2922 + branchRemoveContextMenu->addAction ( actionDeleteKeepChildren );
10.2923 + branchRemoveContextMenu->addAction ( actionDeleteChildren );
10.2924 +
10.2925 +
10.2926 +actionSaveBranch->addTo( branchContextMenu );
10.2927 +actionFileNewCopy->addTo (branchContextMenu );
10.2928 +actionDetach->addTo (branchContextMenu );
10.2929 +
10.2930 +branchContextMenu->addSeparator();
10.2931 +branchContextMenu->addAction ( actionLoadImage);
10.2932 +
10.2933 +// Submenu for Links (URLs, vymLinks)
10.2934 +branchLinksContextMenu =new QMenu (this);
10.2935 +
10.2936 branchContextMenu->addSeparator();
10.2937 -
10.2938 - // Submenu "Add"
10.2939 - branchAddContextMenu =branchContextMenu->addMenu (tr("Add"));
10.2940 - branchAddContextMenu->addAction (actionPaste );
10.2941 - branchAddContextMenu->addAction ( actionAddMapCenter );
10.2942 - branchAddContextMenu->addAction ( actionAddBranch );
10.2943 - branchAddContextMenu->addAction ( actionAddBranchBefore );
10.2944 - branchAddContextMenu->addAction ( actionAddBranchAbove);
10.2945 - branchAddContextMenu->addAction ( actionAddBranchBelow );
10.2946 - branchAddContextMenu->addSeparator();
10.2947 - branchAddContextMenu->addAction ( actionImportAdd );
10.2948 - branchAddContextMenu->addAction ( actionImportReplace );
10.2949 -
10.2950 - // Submenu "Remove"
10.2951 - branchRemoveContextMenu =branchContextMenu->addMenu (tr ("Remove","Context menu name"));
10.2952 - branchRemoveContextMenu->addAction (actionCut);
10.2953 - branchRemoveContextMenu->addAction ( actionDelete );
10.2954 - branchRemoveContextMenu->addAction ( actionDeleteKeepChildren );
10.2955 - branchRemoveContextMenu->addAction ( actionDeleteChildren );
10.2956 -
10.2957 -
10.2958 - actionSaveBranch->addTo( branchContextMenu );
10.2959 - actionFileNewCopy->addTo (branchContextMenu );
10.2960 - actionDetach->addTo (branchContextMenu );
10.2961 -
10.2962 - branchContextMenu->addSeparator();
10.2963 - branchContextMenu->addAction ( actionLoadImage);
10.2964 -
10.2965 - // Submenu for Links (URLs, vymLinks)
10.2966 - branchLinksContextMenu =new QMenu (this);
10.2967 -
10.2968 - branchContextMenu->addSeparator();
10.2969 - branchLinksContextMenu=branchContextMenu->addMenu(tr("References (URLs, vymLinks, ...)","Context menu name"));
10.2970 - branchLinksContextMenu->addAction ( actionOpenURL );
10.2971 - branchLinksContextMenu->addAction ( actionOpenURLTab );
10.2972 - branchLinksContextMenu->addAction ( actionOpenMultipleURLTabs );
10.2973 - branchLinksContextMenu->addAction ( actionURL );
10.2974 - branchLinksContextMenu->addAction ( actionLocalURL );
10.2975 - branchLinksContextMenu->addAction ( actionHeading2URL );
10.2976 - branchLinksContextMenu->addAction ( actionBugzilla2URL );
10.2977 - if (settings.value( "/mainwindow/showTestMenu",false).toBool() )
10.2978 - {
10.2979 - branchLinksContextMenu->addAction ( actionFATE2URL );
10.2980 - }
10.2981 - branchLinksContextMenu->addSeparator();
10.2982 - branchLinksContextMenu->addAction ( actionOpenVymLink );
10.2983 - branchLinksContextMenu->addAction ( actionOpenMultipleVymLinks );
10.2984 - branchLinksContextMenu->addAction ( actionVymLink );
10.2985 - branchLinksContextMenu->addAction ( actionDeleteVymLink );
10.2986 -
10.2987 -
10.2988 - // Context Menu for XLinks in a branch menu
10.2989 - // This will be populated "on demand" in MapEditor::updateActions
10.2990 - branchContextMenu->addSeparator();
10.2991 - branchXLinksContextMenuEdit =branchContextMenu->addMenu (tr ("Edit XLink","Context menu name"));
10.2992 - branchXLinksContextMenuFollow =branchContextMenu->addMenu (tr ("Follow XLink","Context menu name"));
10.2993 - connect( branchXLinksContextMenuFollow, SIGNAL( triggered(QAction *) ), this, SLOT( editFollowXLink(QAction * ) ) );
10.2994 - connect( branchXLinksContextMenuEdit, SIGNAL( triggered(QAction *) ), this, SLOT( editEditXLink(QAction * ) ) );
10.2995 -
10.2996 + branchLinksContextMenu=branchContextMenu->addMenu(tr("References (URLs, vymLinks, ...)","Context menu name"));
10.2997 + branchLinksContextMenu->addAction ( actionOpenURL );
10.2998 + branchLinksContextMenu->addAction ( actionOpenURLTab );
10.2999 + branchLinksContextMenu->addAction ( actionOpenMultipleURLTabs );
10.3000 + branchLinksContextMenu->addAction ( actionURL );
10.3001 + branchLinksContextMenu->addAction ( actionLocalURL );
10.3002 + branchLinksContextMenu->addAction ( actionHeading2URL );
10.3003 + branchLinksContextMenu->addAction ( actionBugzilla2URL );
10.3004 + if (settings.value( "/mainwindow/showTestMenu",false).toBool() )
10.3005 + {
10.3006 + branchLinksContextMenu->addAction ( actionFATE2URL );
10.3007 + }
10.3008 + branchLinksContextMenu->addSeparator();
10.3009 + branchLinksContextMenu->addAction ( actionOpenVymLink );
10.3010 + branchLinksContextMenu->addAction ( actionOpenMultipleVymLinks );
10.3011 + branchLinksContextMenu->addAction ( actionVymLink );
10.3012 + branchLinksContextMenu->addAction ( actionDeleteVymLink );
10.3013
10.3014 - // Context menu for floatimage
10.3015 - floatimageContextMenu =new QMenu (this);
10.3016 - a= new QAction (tr ("Save image","Context action"),this);
10.3017 - connect (a, SIGNAL (triggered()), this, SLOT (editSaveImage()));
10.3018 - floatimageContextMenu->addAction (a);
10.3019 -
10.3020 - floatimageContextMenu->addSeparator();
10.3021 - actionCopy->addTo( floatimageContextMenu );
10.3022 - actionCut->addTo( floatimageContextMenu );
10.3023 -
10.3024 - floatimageContextMenu->addSeparator();
10.3025 - floatimageContextMenu->addAction ( actionFormatHideLinkUnselected );
10.3026 -
10.3027 -
10.3028 - // Context menu for canvas
10.3029 - canvasContextMenu =new QMenu (this);
10.3030 - actionAddMapCenter->addTo( canvasContextMenu );
10.3031 - actionMapInfo->addTo( canvasContextMenu );
10.3032 - canvasContextMenu->insertSeparator();
10.3033 - actionGroupFormatLinkStyles->addTo( canvasContextMenu );
10.3034 - canvasContextMenu->insertSeparator();
10.3035 - actionFormatLinkColorHint->addTo( canvasContextMenu );
10.3036 - actionFormatLinkColor->addTo( canvasContextMenu );
10.3037 - actionFormatSelectionColor->addTo( canvasContextMenu );
10.3038 - actionFormatBackColor->addTo( canvasContextMenu );
10.3039 - // actionFormatBackImage->addTo( canvasContextMenu ); //FIXME-4 makes vym too slow: postponed for later version
10.3040 -
10.3041 - // Menu for last opened files
10.3042 - // Create actions
10.3043 - for (int i = 0; i < MaxRecentFiles; ++i)
10.3044 - {
10.3045 - recentFileActions[i] = new QAction(this);
10.3046 - recentFileActions[i]->setVisible(false);
10.3047 - fileLastMapsMenu->addAction(recentFileActions[i]);
10.3048 - connect(recentFileActions[i], SIGNAL(triggered()),
10.3049 - this, SLOT(fileLoadRecent()));
10.3050 - }
10.3051 - setupRecentMapsMenu();
10.3052 +
10.3053 +// Context Menu for XLinks in a branch menu
10.3054 +// This will be populated "on demand" in MapEditor::updateActions
10.3055 +branchContextMenu->addSeparator();
10.3056 +branchXLinksContextMenuEdit =branchContextMenu->addMenu (tr ("Edit XLink","Context menu name"));
10.3057 +branchXLinksContextMenuFollow =branchContextMenu->addMenu (tr ("Follow XLink","Context menu name"));
10.3058 +connect( branchXLinksContextMenuFollow, SIGNAL( triggered(QAction *) ), this, SLOT( editFollowXLink(QAction * ) ) );
10.3059 +connect( branchXLinksContextMenuEdit, SIGNAL( triggered(QAction *) ), this, SLOT( editEditXLink(QAction * ) ) );
10.3060 +
10.3061 +
10.3062 +// Context menu for floatimage
10.3063 +floatimageContextMenu =new QMenu (this);
10.3064 +a= new QAction (tr ("Save image","Context action"),this);
10.3065 +connect (a, SIGNAL (triggered()), this, SLOT (editSaveImage()));
10.3066 +floatimageContextMenu->addAction (a);
10.3067 +
10.3068 +floatimageContextMenu->addSeparator();
10.3069 +actionCopy->addTo( floatimageContextMenu );
10.3070 +actionCut->addTo( floatimageContextMenu );
10.3071 +
10.3072 +floatimageContextMenu->addSeparator();
10.3073 +floatimageContextMenu->addAction ( actionFormatHideLinkUnselected );
10.3074 +
10.3075 +
10.3076 +// Context menu for canvas
10.3077 +canvasContextMenu =new QMenu (this);
10.3078 +actionAddMapCenter->addTo( canvasContextMenu );
10.3079 +actionMapInfo->addTo( canvasContextMenu );
10.3080 +canvasContextMenu->insertSeparator();
10.3081 +actionGroupFormatLinkStyles->addTo( canvasContextMenu );
10.3082 +canvasContextMenu->insertSeparator();
10.3083 +actionFormatLinkColorHint->addTo( canvasContextMenu );
10.3084 +actionFormatLinkColor->addTo( canvasContextMenu );
10.3085 +actionFormatSelectionColor->addTo( canvasContextMenu );
10.3086 +actionFormatBackColor->addTo( canvasContextMenu );
10.3087 +// actionFormatBackImage->addTo( canvasContextMenu ); //FIXME-4 makes vym too slow: postponed for later version
10.3088 +
10.3089 +// Menu for last opened files
10.3090 +// Create actions
10.3091 +for (int i = 0; i < MaxRecentFiles; ++i)
10.3092 +{
10.3093 + recentFileActions[i] = new QAction(this);
10.3094 + recentFileActions[i]->setVisible(false);
10.3095 + fileLastMapsMenu->addAction(recentFileActions[i]);
10.3096 + connect(recentFileActions[i], SIGNAL(triggered()),
10.3097 + this, SLOT(fileLoadRecent()));
10.3098 +}
10.3099 +setupRecentMapsMenu();
10.3100 }
10.3101
10.3102 void Main::setupRecentMapsMenu()
10.3103 {
10.3104 - QStringList files = settings.value("/mainwindow/recentFileList").toStringList();
10.3105 -
10.3106 - int numRecentFiles = qMin(files.size(), (int)MaxRecentFiles);
10.3107 -
10.3108 - for (int i = 0; i < numRecentFiles; ++i) {
10.3109 - QString text = tr("&%1 %2").arg(i + 1).arg(files[i]);
10.3110 - recentFileActions[i]->setText(text);
10.3111 - recentFileActions[i]->setData(files[i]);
10.3112 - recentFileActions[i]->setVisible(true);
10.3113 - }
10.3114 - for (int j = numRecentFiles; j < MaxRecentFiles; ++j)
10.3115 - recentFileActions[j]->setVisible(false);
10.3116 +QStringList files = settings.value("/mainwindow/recentFileList").toStringList();
10.3117 +
10.3118 +int numRecentFiles = qMin(files.size(), (int)MaxRecentFiles);
10.3119 +
10.3120 +for (int i = 0; i < numRecentFiles; ++i) {
10.3121 + QString text = tr("&%1 %2").arg(i + 1).arg(files[i]);
10.3122 + recentFileActions[i]->setText(text);
10.3123 + recentFileActions[i]->setData(files[i]);
10.3124 + recentFileActions[i]->setVisible(true);
10.3125 +}
10.3126 +for (int j = numRecentFiles; j < MaxRecentFiles; ++j)
10.3127 + recentFileActions[j]->setVisible(false);
10.3128 }
10.3129
10.3130 void Main::setupMacros()
10.3131 {
10.3132 - for (int i = 0; i <= 11; i++)
10.3133 - {
10.3134 - macroActions[i] = new QAction(this);
10.3135 - macroActions[i]->setData(i);
10.3136 - addAction (macroActions[i]);
10.3137 - connect(macroActions[i], SIGNAL(triggered()),
10.3138 - this, SLOT(callMacro()));
10.3139 - }
10.3140 - macroActions[0]->setShortcut ( Qt::Key_F1 );
10.3141 - macroActions[1]->setShortcut ( Qt::Key_F2 );
10.3142 - macroActions[2]->setShortcut ( Qt::Key_F3 );
10.3143 - macroActions[3]->setShortcut ( Qt::Key_F4 );
10.3144 - macroActions[4]->setShortcut ( Qt::Key_F5 );
10.3145 - macroActions[5]->setShortcut ( Qt::Key_F6 );
10.3146 - macroActions[6]->setShortcut ( Qt::Key_F7 );
10.3147 - macroActions[7]->setShortcut ( Qt::Key_F8 );
10.3148 - macroActions[8]->setShortcut ( Qt::Key_F9 );
10.3149 - macroActions[9]->setShortcut ( Qt::Key_F10 );
10.3150 - macroActions[10]->setShortcut ( Qt::Key_F11 );
10.3151 - macroActions[11]->setShortcut ( Qt::Key_F12 );
10.3152 +for (int i = 0; i <= 11; i++)
10.3153 +{
10.3154 + macroActions[i] = new QAction(this);
10.3155 + macroActions[i]->setData(i);
10.3156 + addAction (macroActions[i]);
10.3157 + connect(macroActions[i], SIGNAL(triggered()),
10.3158 + this, SLOT(callMacro()));
10.3159 +}
10.3160 +macroActions[0]->setShortcut ( Qt::Key_F1 );
10.3161 +macroActions[1]->setShortcut ( Qt::Key_F2 );
10.3162 +macroActions[2]->setShortcut ( Qt::Key_F3 );
10.3163 +macroActions[3]->setShortcut ( Qt::Key_F4 );
10.3164 +macroActions[4]->setShortcut ( Qt::Key_F5 );
10.3165 +macroActions[5]->setShortcut ( Qt::Key_F6 );
10.3166 +macroActions[6]->setShortcut ( Qt::Key_F7 );
10.3167 +macroActions[7]->setShortcut ( Qt::Key_F8 );
10.3168 +macroActions[8]->setShortcut ( Qt::Key_F9 );
10.3169 +macroActions[9]->setShortcut ( Qt::Key_F10 );
10.3170 +macroActions[10]->setShortcut ( Qt::Key_F11 );
10.3171 +macroActions[11]->setShortcut ( Qt::Key_F12 );
10.3172 }
10.3173
10.3174 void Main::hideEvent (QHideEvent * )
10.3175 {
10.3176 - if (!textEditor->isMinimized() ) textEditor->hide();
10.3177 +if (!textEditor->isMinimized() ) textEditor->hide();
10.3178 }
10.3179
10.3180 void Main::showEvent (QShowEvent * )
10.3181 {
10.3182 - if (actionViewToggleNoteEditor->isOn()) textEditor->showNormal();
10.3183 +if (actionViewToggleNoteEditor->isOn()) textEditor->showNormal();
10.3184 }
10.3185
10.3186
10.3187 MapEditor* Main::currentMapEditor() const
10.3188 {
10.3189 - if ( tabWidget->currentPage())
10.3190 - return vymViews.at(tabWidget->currentIndex())->getMapEditor();
10.3191 - return NULL;
10.3192 +if ( tabWidget->currentPage())
10.3193 + return vymViews.at(tabWidget->currentIndex())->getMapEditor();
10.3194 +return NULL;
10.3195 }
10.3196
10.3197 VymModel* Main::currentModel() const
10.3198 {
10.3199 - if ( tabWidget->currentPage())
10.3200 - return vymViews.at(tabWidget->currentIndex())->getModel();
10.3201 - return NULL;
10.3202 +if ( tabWidget->currentPage())
10.3203 + return vymViews.at(tabWidget->currentIndex())->getModel();
10.3204 +return NULL;
10.3205 }
10.3206
10.3207
10.3208 void Main::editorChanged(QWidget *)
10.3209 {
10.3210 - // Unselect all possibly selected objects
10.3211 - // (Important to update note editor)
10.3212 - VymModel *m;
10.3213 - for (int i=0;i<=tabWidget->count() -1;i++)
10.3214 - {
10.3215 - m= vymViews.at(i)->getModel();
10.3216 - if (m) m->unselect();
10.3217 - }
10.3218 - m=currentModel();
10.3219 - if (m) m->reselect();
10.3220 -
10.3221 - // Update actions to in menus and toolbars according to editor
10.3222 - updateActions();
10.3223 +// Unselect all possibly selected objects
10.3224 +// (Important to update note editor)
10.3225 +VymModel *m;
10.3226 +for (int i=0;i<=tabWidget->count() -1;i++)
10.3227 +{
10.3228 + m= vymViews.at(i)->getModel();
10.3229 + if (m) m->unselect();
10.3230 +}
10.3231 +m=currentModel();
10.3232 +if (m) m->reselect();
10.3233 +
10.3234 +// Update actions to in menus and toolbars according to editor
10.3235 +updateActions();
10.3236 }
10.3237
10.3238 void Main::fileNew()
10.3239 {
10.3240 - VymModel *vm=new VymModel;
10.3241 -
10.3242 +VymModel *vm=new VymModel;
10.3243 +
10.3244 +/////////////////////////////////////
10.3245 new ModelTest(vm, this); //FIXME-3
10.3246 -
10.3247 -
10.3248 - VymView *vv=new VymView (vm);
10.3249 - vymViews.append (vv);
10.3250 - tabWidget->addTab (vv,tr("unnamed","MainWindow: name for new and empty file"));
10.3251 - tabWidget->setCurrentIndex (vymViews.count() );
10.3252 - vv->initFocus();
10.3253 -
10.3254 - // Create MapCenter for empty map
10.3255 - vm->addMapCenter();
10.3256 - vm->makeDefault();
10.3257 -
10.3258 - // For the very first map we do not have flagrows yet...
10.3259 - vm->select("mc:");
10.3260 +/////////////////////////////////////
10.3261 +
10.3262 +
10.3263 +VymView *vv=new VymView (vm);
10.3264 +vymViews.append (vv);
10.3265 +tabWidget->addTab (vv,tr("unnamed","MainWindow: name for new and empty file"));
10.3266 +tabWidget->setCurrentIndex (vymViews.count() );
10.3267 +vv->initFocus();
10.3268 +
10.3269 +// Create MapCenter for empty map
10.3270 +vm->addMapCenter();
10.3271 +vm->makeDefault();
10.3272 +
10.3273 +// For the very first map we do not have flagrows yet...
10.3274 +vm->select("mc:");
10.3275 }
10.3276
10.3277 void Main::fileNewCopy()
10.3278 {
10.3279 - QString fn="unnamed";
10.3280 - VymModel *srcModel=currentModel();
10.3281 - if (srcModel)
10.3282 +QString fn="unnamed";
10.3283 +VymModel *srcModel=currentModel();
10.3284 +if (srcModel)
10.3285 +{
10.3286 + srcModel->copy();
10.3287 + fileNew();
10.3288 + VymModel *dstModel=vymViews.last()->getModel();
10.3289 + dstModel->select("mc:");
10.3290 + dstModel->load (clipboardDir+"/"+clipboardFile,ImportReplace, VymMap);
10.3291 +}
10.3292 +}
10.3293 +
10.3294 +ErrorCode Main::fileLoad(QString fn, const LoadMode &lmode, const FileType &ftype)
10.3295 +{
10.3296 +ErrorCode err=success;
10.3297 +
10.3298 +// fn is usually the archive, mapfile the file after uncompressing
10.3299 +QString mapfile;
10.3300 +
10.3301 +// Make fn absolute (needed for unzip)
10.3302 +fn=QDir (fn).absPath();
10.3303 +
10.3304 +VymModel *vm;
10.3305 +
10.3306 +if (lmode==NewMap)
10.3307 +{
10.3308 + // Check, if map is already loaded
10.3309 + int i=0;
10.3310 + while (i<=tabWidget->count() -1)
10.3311 {
10.3312 - srcModel->copy();
10.3313 - fileNew();
10.3314 - VymModel *dstModel=vymViews.last()->getModel();
10.3315 - dstModel->select("mc:");
10.3316 - dstModel->load (clipboardDir+"/"+clipboardFile,ImportReplace, VymMap);
10.3317 + if (vymViews.at(i)->getModel()->getFilePath() == fn)
10.3318 + {
10.3319 + // Already there, ask for confirmation
10.3320 + QMessageBox mb( vymName,
10.3321 + tr("The map %1\nis already opened."
10.3322 + "Opening the same map in multiple editors may lead \n"
10.3323 + "to confusion when finishing working with vym."
10.3324 + "Do you want to").arg(fn),
10.3325 + QMessageBox::Warning,
10.3326 + QMessageBox::Yes | QMessageBox::Default,
10.3327 + QMessageBox::Cancel | QMessageBox::Escape,
10.3328 + QMessageBox::NoButton);
10.3329 + mb.setButtonText( QMessageBox::Yes, tr("Open anyway") );
10.3330 + mb.setButtonText( QMessageBox::Cancel, tr("Cancel"));
10.3331 + switch( mb.exec() )
10.3332 + {
10.3333 + case QMessageBox::Yes:
10.3334 + // end loop and load anyway
10.3335 + i=tabWidget->count();
10.3336 + break;
10.3337 + case QMessageBox::Cancel:
10.3338 + // do nothing
10.3339 + return aborted;
10.3340 + break;
10.3341 + }
10.3342 + }
10.3343 + i++;
10.3344 }
10.3345 }
10.3346
10.3347 -ErrorCode Main::fileLoad(QString fn, const LoadMode &lmode, const FileType &ftype)
10.3348 -{
10.3349 - ErrorCode err=success;
10.3350 -
10.3351 - // fn is usually the archive, mapfile the file after uncompressing
10.3352 - QString mapfile;
10.3353 -
10.3354 - // Make fn absolute (needed for unzip)
10.3355 - fn=QDir (fn).absPath();
10.3356 -
10.3357 - VymModel *vm;
10.3358 -
10.3359 - if (lmode==NewMap)
10.3360 - {
10.3361 - // Check, if map is already loaded
10.3362 - int i=0;
10.3363 - while (i<=tabWidget->count() -1)
10.3364 - {
10.3365 - if (vymViews.at(i)->getModel()->getFilePath() == fn)
10.3366 - {
10.3367 - // Already there, ask for confirmation
10.3368 - QMessageBox mb( vymName,
10.3369 - tr("The map %1\nis already opened."
10.3370 - "Opening the same map in multiple editors may lead \n"
10.3371 - "to confusion when finishing working with vym."
10.3372 - "Do you want to").arg(fn),
10.3373 - QMessageBox::Warning,
10.3374 - QMessageBox::Yes | QMessageBox::Default,
10.3375 - QMessageBox::Cancel | QMessageBox::Escape,
10.3376 - QMessageBox::NoButton);
10.3377 - mb.setButtonText( QMessageBox::Yes, tr("Open anyway") );
10.3378 - mb.setButtonText( QMessageBox::Cancel, tr("Cancel"));
10.3379 - switch( mb.exec() )
10.3380 - {
10.3381 - case QMessageBox::Yes:
10.3382 - // end loop and load anyway
10.3383 - i=tabWidget->count();
10.3384 - break;
10.3385 - case QMessageBox::Cancel:
10.3386 - // do nothing
10.3387 - return aborted;
10.3388 - break;
10.3389 - }
10.3390 - }
10.3391 - i++;
10.3392 - }
10.3393 - }
10.3394 -
10.3395 - int tabIndex=tabWidget->currentPageIndex();
10.3396 +int tabIndex=tabWidget->currentPageIndex();
10.3397
10.3398 // Try to load map
10.3399 if ( !fn.isEmpty() )
10.3400 @@ -2231,6 +2238,12 @@
10.3401 if (m) m->exportImage();
10.3402 }
10.3403
10.3404 +void Main::fileExportAO()
10.3405 +{
10.3406 + VymModel *m=currentModel();
10.3407 + if (m) m->exportAO();
10.3408 +}
10.3409 +
10.3410 void Main::fileExportASCII()
10.3411 {
10.3412 VymModel *m=currentModel();
10.3413 @@ -2382,13 +2395,16 @@
10.3414 vymViews.removeAt (tabWidget->currentIndex() );
10.3415 tabWidget->removeTab (tabWidget->currentIndex() );
10.3416
10.3417 - // Remove mapEditor/model FIXME-5
10.3418 + // Remove mapEditor/model FIXME-3 Huh? seems to work now...
10.3419 // Better would be delete (me), but then we could have a Qt error:
10.3420 // "QObject: Do not delete object, 'MapEditor', during its event handler!"
10.3421 // So we only remove data now and call deconstructor when vym closes later
10.3422 // this needs to be moved to vymview... me->clear();
10.3423 // some model->clear is needed to free up memory ...
10.3424
10.3425 + delete (m->getMapEditor());
10.3426 + delete (m);
10.3427 +
10.3428 updateActions();
10.3429 }
10.3430 }
11.1 --- a/mainwindow.h Tue Nov 17 08:24:59 2009 +0000
11.2 +++ b/mainwindow.h Wed Nov 25 10:58:21 2009 +0000
11.3 @@ -97,6 +97,7 @@
11.4 void fileExportXML();
11.5 void fileExportXHTML();
11.6 void fileExportImage();
11.7 + void fileExportAO();
11.8 void fileExportASCII();
11.9 void fileExportCSV();
11.10 void fileExportLaTeX();
12.1 --- a/mapeditor.cpp Tue Nov 17 08:24:59 2009 +0000
12.2 +++ b/mapeditor.cpp Wed Nov 25 10:58:21 2009 +0000
12.3 @@ -998,11 +998,11 @@
12.4
12.5 void MapEditor::mousePressEvent(QMouseEvent* e)
12.6 {
12.7 -cout << "ME::mousePressed\n";
12.8 +//cout << "ME::mousePressed\n"; //FIXME-3
12.9 // Ignore right clicks, these will go to context menus
12.10 if (e->button() == Qt::RightButton )
12.11 {
12.12 - cout << " ME::ignoring right mouse event...\n";
12.13 + //cout << " ME::ignoring right mouse event...\n";
12.14 e->ignore();
12.15 return;
12.16 }
12.17 @@ -1010,7 +1010,7 @@
12.18 //Ignore clicks while editing heading
12.19 if (model->isSelectionBlocked() )
12.20 {
12.21 - cout << " ME::ignoring other mouse event...\n";
12.22 + //cout << " ME::ignoring other mouse event...\n";
12.23 e->ignore();
12.24 return;
12.25 }
12.26 @@ -1622,6 +1622,8 @@
12.27 QList <TreeItem*> treeItemsNew;
12.28 QList <TreeItem*> treeItemsOld;
12.29
12.30 + QModelIndex newIndex;
12.31 +
12.32 bool do_reposition=false;
12.33
12.34 QModelIndex ix;
12.35 @@ -1670,6 +1672,8 @@
12.36 QModelIndex ix=newsel.indexes().first();
12.37 if (ix.isValid() )
12.38 {
12.39 + newIndex=ix;
12.40 +
12.41 // Temporary unscroll if necessary
12.42 TreeItem *ti= static_cast<TreeItem*>(ix.internalPointer());
12.43 if (ti->isBranchLikeType() )
12.44 @@ -1686,7 +1690,6 @@
12.45 ((MapItem*)ti)->getLMO()->updateVisibility();
12.46 }
12.47 }
12.48 - // FIXME-3 cout << "ME::updateSel doRepos="<<do_reposition<<endl;
12.49 if (do_reposition) model->reposition();
12.50
12.51 // Reduce rectangles
13.1 --- a/tex/vym.changelog Tue Nov 17 08:24:59 2009 +0000
13.2 +++ b/tex/vym.changelog Wed Nov 25 10:58:21 2009 +0000
13.3 @@ -1,3 +1,9 @@
13.4 +-------------------------------------------------------------------
13.5 +Tue Nov 24 22:34:42 CET 2009 - vym@insilmaril.de
13.6 +
13.7 +- Bugfix: Automatic scrolling to new selected items didn't work
13.8 + reliable when item had scrolled parents
13.9 +
13.10 -------------------------------------------------------------------
13.11 Wed Nov 11 10:32:29 CET 2009 - vym@insilmaril.de
13.12
14.1 --- a/texteditor.cpp Tue Nov 17 08:24:59 2009 +0000
14.2 +++ b/texteditor.cpp Wed Nov 25 10:58:21 2009 +0000
14.3 @@ -64,11 +64,11 @@
14.4
14.5 varFont.fromString( settings.value
14.6 ("/satellite/noteeditor/fonts/varFont",
14.7 - "Nimbus Sans l,14,-1,5,48,0,0,0,0,0").toString()
14.8 + "Nimbus Sans l,10,-1,5,48,0,0,0,0,0").toString()
14.9 );
14.10 fixedFont.fromString (settings.value(
14.11 "/satellite/noteeditor/fonts/fixedFont",
14.12 - "Courier,12,-1,5,48,0,0,0,1,0").toString()
14.13 + "Courier,10-1,5,48,0,0,0,1,0").toString()
14.14 );
14.15 QString s=settings.value ("/satellite/noteeditor/fonts/fonthintDefault","variable").toString();
14.16 if (s == "fixed")
15.1 --- a/version.h Tue Nov 17 08:24:59 2009 +0000
15.2 +++ b/version.h Wed Nov 25 10:58:21 2009 +0000
15.3 @@ -7,7 +7,7 @@
15.4 #define __VYM_VERSION "1.13.0"
15.5 //#define __VYM_CODENAME "Codename: RC-1"
15.6 #define __VYM_CODENAME "Codename: development version, not for production!"
15.7 -#define __VYM_BUILD_DATE "2009-11-16"
15.8 +#define __VYM_BUILD_DATE "2009-11-24"
15.9
15.10
15.11 bool checkVersion(const QString &);
16.1 --- a/vymmodel.cpp Tue Nov 17 08:24:59 2009 +0000
16.2 +++ b/vymmodel.cpp Wed Nov 25 10:58:21 2009 +0000
16.3 @@ -53,7 +53,7 @@
16.4
16.5 VymModel::VymModel()
16.6 {
16.7 -// cout << "Const VymModel\n";
16.8 + //cout << "Const VymModel\n";
16.9 init();
16.10 rootItem->setModel (this);
16.11 }
16.12 @@ -61,7 +61,7 @@
16.13
16.14 VymModel::~VymModel()
16.15 {
16.16 - cout << "Destr VymModel\n";
16.17 + //cout << "Destr VymModel\n";
16.18 autosaveTimer->stop();
16.19 fileChangedTimer->stop();
16.20 clear();
16.21 @@ -3233,6 +3233,21 @@
16.22 deleteChildren();
16.23 }
16.24 /////////////////////////////////////////////////////////////////////
16.25 + } else if (com=="exportAO")
16.26 + {
16.27 + QString fname="";
16.28 + ok=true;
16.29 + if (parser.parCount()>=1)
16.30 + // Hey, we even have a filename
16.31 + fname=parser.parString(ok,0);
16.32 + if (!ok)
16.33 + {
16.34 + parser.setError (Aborted,"Could not read filename");
16.35 + } else
16.36 + {
16.37 + exportAO (fname,false);
16.38 + }
16.39 + /////////////////////////////////////////////////////////////////////
16.40 } else if (com=="exportASCII")
16.41 {
16.42 QString fname="";
16.43 @@ -3982,7 +3997,7 @@
16.44 return returnValue;
16.45 }
16.46
16.47 -void VymModel::runScript (QString script)
16.48 +QVariant VymModel::runScript (const QString &script)
16.49 {
16.50 parser.setScript (script);
16.51 parser.runScript();
16.52 @@ -3995,6 +4010,7 @@
16.53 if (!noErr) //FIXME-3 need dialog box here
16.54 cout << "VM::runScript aborted:\n"<<errMsg.toStdString()<<endl;
16.55 }
16.56 + return r;
16.57 }
16.58
16.59 void VymModel::setExportMode (bool b)
16.60 @@ -4077,6 +4093,30 @@
16.61 setExportMode (false);
16.62 }
16.63
16.64 +void VymModel::exportAO (QString fname,bool askName)
16.65 +{
16.66 + ExportAO ex;
16.67 + ex.setModel (this);
16.68 + if (fname=="")
16.69 + ex.setFile (mapName+".txt");
16.70 + else
16.71 + ex.setFile (fname);
16.72 +
16.73 + if (askName)
16.74 + {
16.75 + //ex.addFilter ("TXT (*.txt)");
16.76 + ex.setDir(lastImageDir);
16.77 + //ex.setCaption(vymName+ " -" +tr("Export as A&O report")+" "+tr("(still experimental)"));
16.78 + ex.execDialog() ;
16.79 + }
16.80 + if (!ex.canceled())
16.81 + {
16.82 + setExportMode(true);
16.83 + ex.doExport();
16.84 + setExportMode(false);
16.85 + }
16.86 +}
16.87 +
16.88 void VymModel::exportASCII(QString fname,bool askName)
16.89 {
16.90 ExportASCII ex;
17.1 --- a/vymmodel.h Tue Nov 17 08:24:59 2009 +0000
17.2 +++ b/vymmodel.h Wed Nov 25 10:58:21 2009 +0000
17.3 @@ -404,7 +404,7 @@
17.4 QVariant parseAtom (const QString &atom, bool &noError, QString &errorMsg);
17.5
17.6 /* \brief Runs the script */
17.7 - void runScript (QString script);
17.8 + QVariant runScript (const QString &script);
17.9
17.10 private:
17.11 Parser parser;
17.12 @@ -426,6 +426,9 @@
17.13 /*! Export as XTML to directory */
17.14 void exportXML(QString dir="", bool askForName=true);
17.15
17.16 + /*! Export as A&O report text to file */
17.17 + void exportAO (QString fname="",bool askForName=true);
17.18 +
17.19 /*! Export as ASCII text to file */
17.20 void exportASCII (QString fname="",bool askForName=true);
17.21
18.1 --- a/vymview.cpp Tue Nov 17 08:24:59 2009 +0000
18.2 +++ b/vymview.cpp Wed Nov 25 10:58:21 2009 +0000
18.3 @@ -49,9 +49,11 @@
18.4 this,SLOT (changeSelection(const QItemSelection &,const QItemSelection &)));
18.5
18.6 // Tell MapEditor to update selection
18.7 + /* FIXME-3 done implicit here in VymView
18.8 connect (
18.9 selModel, SIGNAL (selectionChanged(const QItemSelection &, const QItemSelection &)),
18.10 mapEditor,SLOT (updateSelection(const QItemSelection &,const QItemSelection &)));
18.11 + */
18.12
18.13 // FIXME-2 testing, if that reenables updating selbox during animation
18.14 connect (
18.15 @@ -121,13 +123,12 @@
18.16 mapEditor->setFocus();
18.17 }
18.18
18.19 -void VymView::changeSelection (const QItemSelection &newsel, const QItemSelection &oldsel)
18.20 +void VymView::changeSelection (const QItemSelection &newsel, const QItemSelection &oldsel)
18.21 {
18.22 - // Notify mainwindow to update satellites like NoteEditor, if needed (model==currenModel...)
18.23 - mainWindow->changeSelection (model,newsel,oldsel); // FIXME-5 maybe connect VymModel <-> MainWindow directly?
18.24 - // would require to also get current model in mainWindow
18.25 + //cout << "VV::changeSelection newsel.count="<<newsel.indexes().count()<<endl;
18.26
18.27 - //cout << "VV::changeSelection newsel.count="<<newsel.indexes().count()<<endl;
18.28 + mainWindow->changeSelection (model,newsel,oldsel);
18.29 + mapEditor->updateSelection (newsel,oldsel);
18.30
18.31 if (newsel.indexes().count()>0)
18.32 {
18.33 @@ -137,10 +138,12 @@
18.34 treeEditor->getProxyModel()->mapSelectionFromSource (newsel),
18.35 QItemSelectionModel::ClearAndSelect );
18.36 */
18.37 +
18.38 QModelIndex ix=newsel.indexes().first();
18.39 selModel->setCurrentIndex (ix,QItemSelectionModel::ClearAndSelect );
18.40 treeEditor->setCurrentIndex (ix);
18.41 showSelection();
18.42 +
18.43 }
18.44 }
18.45
18.46 @@ -256,6 +259,6 @@
18.47 {
18.48 QModelIndex ix=model->getSelectedIndex();
18.49 treeEditor->scrollTo( ix, QAbstractItemView::EnsureVisible);
18.50 - mapEditor->scrollTo ( ix);
18.51 + mapEditor->scrollTo ( ix); // FIXME-3 also called from MapEditor::updateSelection...
18.52 }
18.53