# HG changeset patch # User insilmaril # Date 1267095832 0 # Node ID 36eb4b8f409e9198d02f6fef7ca4397855b53d2e # Parent 0bba81dde1bc14dd29c7a041551a8beb047ed3d4 Added dialog for HTML export. Grouping in Switchboard shortcuts diff -r 0bba81dde1bc -r 36eb4b8f409e exporthtmldialog.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/exporthtmldialog.cpp Thu Feb 25 11:03:52 2010 +0000 @@ -0,0 +1,368 @@ +#include "exporthtmldialog.h" + +#include <QFileDialog> +#include <QMessageBox> +#include <QTextStream> + +#include "options.h" +#include "settings.h" +#include "warningdialog.h" + + +extern Options options; +extern QDir vymBaseDir; +extern Settings settings; +extern bool debug; + +ExportHTMLDialog::ExportHTMLDialog(QWidget* parent) : QDialog(parent) +{ + ui.setupUi(this); + + filepath=""; + settingsChanged=false; + scriptProc=new Process; + + // signals and slots connections + connect(ui.browseExportDirButton, SIGNAL(pressed()), this, SLOT(browseDirectoryPressed())); + connect(ui.outputButton, SIGNAL(toggled(bool)), this, SLOT(outputButtonPressed(bool))); + connect(ui.browseCSSButton, SIGNAL(pressed()), this, SLOT(browseCSSPressed())); + connect(ui.imageButton, SIGNAL(toggled(bool)), this, SLOT(imageButtonPressed(bool))); + connect(ui.textColorButton, SIGNAL(toggled(bool)), this, SLOT(textcolorButtonPressed(bool))); + connect(ui.lineEditDir, SIGNAL(textChanged(const QString&)), this, SLOT(dirChanged())); + connect(ui.lineEditCSS, SIGNAL(textChanged(const QString&)), this, SLOT(cssChanged())); + connect(ui.saveSettingsInMapButton, SIGNAL(toggled(bool)), this, SLOT(saveSettingsInMapButtonPressed(bool))); + connect(ui.browsePreExportButton, SIGNAL(pressed()), this, SLOT(browsePreExportButtonPressed())); + connect(ui.lineEditPreScript, SIGNAL(textChanged(const QString&)), this, SLOT(prescriptChanged())); + connect(ui.lineEditPostScript, SIGNAL(textChanged(const QString&)), this, SLOT(postscriptChanged())); + connect(ui.browsePostExportButton, SIGNAL(pressed()), this, SLOT(browsePostExportButtonPressed())); +} + + +void ExportHTMLDialog::readSettings() +{ + + dir=settings.readLocalEntry (filepath,"/export/html/exportDir",vymBaseDir.currentDirPath() ); + ui.lineEditDir->setText(dir); + + if ( settings.readLocalEntry (filepath,"/export/html/useImage","yes")=="yes") + useImage=true; + else + useImage=false; + ui.imageButton->setChecked(useImage); + + if ( settings.readLocalEntry (filepath,"/export/html/useTextColor","no")=="yes") + useTextColor=true; + else + useTextColor=false; + ui.textColorButton->setChecked(useTextColor); + +/* TODO this was used in old html export, is not yet in new stylesheet + if ( settings.readEntry ("/export/html/useHeading","no")=="yes") + useHeading=true; + else + useHeading=false; + checkBox4_2->setChecked(useHeading); +*/ + + if ( settings.readLocalEntry (filepath,"/export/html/saveSettingsInMap","no")=="yes") + saveSettingsInMap=true; + else + saveSettingsInMap=false; + ui.saveSettingsInMapButton->setChecked(saveSettingsInMap); + + if ( settings.readEntry ("/export/html/showOutput","no")=="yes") + showOutput=true; + else + showOutput=false; + ui.outputButton->setChecked(showOutput); + + // For testing better use local styles + const QString defcss(vymBaseDir.path() + "/styles/vym.css"); + if (options.isOn ("local")) + { + css=defcss; + } else + { + css=settings.readLocalEntry + (filepath,"/export/html/css",defcss); + } + ui.lineEditCSS->setText(css); + + prescript=settings.readLocalEntry + (filepath,"/export/html/prescript",""); + ui.lineEditPreScript->setText (prescript); + + postscript=settings.readLocalEntry + (filepath,"/export/html/postscript",""); + ui.lineEditPostScript->setText (postscript); + + if (!prescript.isEmpty() || !postscript.isEmpty()) + { + QMessageBox::warning( 0, tr( "Warning" ),tr( + "The settings saved in the map " + "would like to run scripts:\n\n" + "%1\n\n" + "Please check, if you really\n" + "want to allow this in your system!").arg(prescript+" "+postscript)); + + } +} + +void ExportHTMLDialog::setDir(const QString &d) +{ + dir=d; + if (dir.right(1)!="/") dir+="/"; +} + +void ExportHTMLDialog::dirChanged() +{ + setDir (ui.lineEditDir->text()); + settingsChanged=true; +} + +void ExportHTMLDialog::browseDirectoryPressed() +{ + QFileDialog fd( this); + fd.setMode (QFileDialog::DirectoryOnly); + fd.setCaption(tr("VYM - Export HTML to directory")); + fd.setModal (true); + fd.setDirectory (QDir::current()); + fd.show(); + + if ( fd.exec() == QDialog::Accepted ) + { + QDir dir=fd.selectedFile(); + ui.lineEditDir->setText (dir.path() ); + settingsChanged=true; + } +} + +void ExportHTMLDialog::imageButtonPressed(bool b) +{ + useImage=b; + settingsChanged=true; +} + +void ExportHTMLDialog::textcolorButtonPressed(bool b) +{ + useTextColor=b; + settingsChanged=true; +} + +void ExportHTMLDialog::saveSettingsInMapButtonPressed(bool b) +{ + saveSettingsInMap=b; + settingsChanged=true; +} + +void ExportHTMLDialog::warningsButtonPressed(bool b) +{ + showWarnings=b; + settingsChanged=true; +} + + +void ExportHTMLDialog::outputButtonPressed(bool b) +{ + showOutput=b; + settingsChanged=true; +} + +void ExportHTMLDialog::cssChanged() +{ + css=ui.lineEditCSS->text(); + settingsChanged=true; +} + +QString ExportHTMLDialog::getCSSPath() +{ + return css; +} + +void ExportHTMLDialog::browseCSSPressed() +{ + QFileDialog fd( this); + fd.setModal (true); + fd.setFilter ("Cascading Stylesheet (*.css)"); + fd.setDirectory (QDir::current()); + fd.show(); + + if ( fd.exec() == QDialog::Accepted ) + { + css=fd.selectedFile(); + ui.lineEditCSS->setText (css ); + settingsChanged=true; + } +} + +void ExportHTMLDialog::prescriptChanged() +{ + prescript=ui.lineEditPreScript->text(); + settingsChanged=true; +} + +void ExportHTMLDialog::postscriptChanged() +{ + postscript=ui.lineEditPostScript->text(); + settingsChanged=true; +} + +void ExportHTMLDialog::browsePreExportButtonPressed() +{ + QFileDialog fd( this); + fd.setModal (true); + fd.setFilter ("Scripts (*.sh *.pl *.py *.php)"); + fd.setDirectory (QDir::current()); + fd.show(); + + if ( fd.exec() == QDialog::Accepted ) + { + prescript=fd.selectedFile(); + ui.lineEditPreScript->setText (prescript ); + settingsChanged=true; + } + +} + +void ExportHTMLDialog::browsePostExportButtonPressed() +{ + QFileDialog fd( this); + fd.setModal (true); + fd.setFilter ("Scripts (*.sh *.pl *.py *.php)"); + fd.setDirectory (QDir::current()); + fd.show(); + + if ( fd.exec() == QDialog::Accepted ) + { + postscript=fd.selectedFile(); + ui.lineEditPostScript->setText (postscript ); + settingsChanged=true; + } +} + + +void ExportHTMLDialog::doExport (const QString &mapname) +{ + + // Save options to settings file + // (but don't save at destructor, which + // is called for "cancel", too) + settings.setLocalEntry (filepath,"/export/html/exportDir",dir); + settings.setLocalEntry (filepath,"/export/html/prescript",prescript); + settings.setLocalEntry (filepath,"/export/html/postscript",postscript); + + if (useImage) + settings.setLocalEntry (filepath,"/export/html/useImage","yes"); + else + settings.setLocalEntry (filepath,"/export/html/useImage","no"); + + if (useTextColor) + settings.setLocalEntry (filepath,"/export/html/useTextColor","yes"); + else + settings.setLocalEntry (filepath,"/export/html/useTextColor","no"); + + if (showWarnings) + settings.writeEntry ("/export/html/showWarnings","yes"); + else + settings.writeEntry ("/export/html/showWarnings","no"); + + if (showOutput) + settings.writeEntry ("/export/html/showOutput","yes"); + else + settings.writeEntry ("/export/html/showOutput","no"); + + QString ipath; + ipath=vymBaseDir.path()+"/flags/flag-url-16x16.png"; + if (!options.isOn ("local")) + { + settings.setLocalEntry + (filepath,"/export/html/css",css); + } + + if (!saveSettingsInMap) + settings.clearLocal("/export/html"); + else + settings.setLocalEntry + (filepath,"/export/html/saveSettingsInMap","yes"); + + // Provide a smaller URL-icon to improve Layout //FIXME-1 + QPixmap pm; + if (!pm.load(ipath,"PNG") ) + QMessageBox::warning( 0, tr( "Warning" ),tr("Could not open %1").arg(ipath)); + + + if(!pm.save (dir + "flags/flag-url-16x16.png","PNG")) + QMessageBox::warning( 0, tr( "Warning" ),tr("Could not write %1").arg(ipath)); + + if (!prescript.isEmpty()) runScript (prescript,dir+mapname+".xml"); + + /* FIXME-1 + if (useImage) + p.addStringParam ("imagemap","images/"+mapname+".png"); + if (useTextColor) + p.addStringParam ("use.textcolor","1"); + p.addStringParam ("mapname",mapname+".vym"); + + p.setOutputFile (dir+mapname+".html"); + p.setInputFile (dir+mapname+".xml"); + p.process(); + */ + + if (!postscript.isEmpty()) runScript (postscript,dir+mapname+".html"); + +} + +void ExportHTMLDialog::setFilePath(const QString &s) +{ + filepath=s; +} + +void ExportHTMLDialog::setMapName(const QString &s) +{ + mapname=s; +} + +QString ExportHTMLDialog::getDir() +{ + return dir; +} + +bool ExportHTMLDialog::warnings() +{ + return showWarnings; +} + +bool ExportHTMLDialog::hasChanged() +{ + return settingsChanged; +} + + +void ExportHTMLDialog::runScript(QString spath, QString fpath) +{ + spath.replace ("%f",fpath); + QStringList args=QStringList::split (' ',spath,false); + + //FIXME-1 p.addOutput ("vym is executing: \n" + spath+" "+args.join(" ") ); + scriptProc->start (spath,args); + if (!scriptProc->waitForStarted() ) + { + QMessageBox::critical( 0, tr( "Critical Error" ), + tr("Could not start %1").arg(spath) ); + } else + { + if (!scriptProc->waitForFinished()) + QMessageBox::critical( 0, tr( "Critical Error" ), + tr("%1 didn't exit normally").arg(spath) + + scriptProc->getErrout() ); + else + if (scriptProc->exitStatus()>0) showOutput=true; + + } + /* FIXME-1 + p.addOutput ("\n"); + p.addOutput (scriptProc->getErrout()); + p.addOutput (scriptProc->getStdout()); + */ +} + diff -r 0bba81dde1bc -r 36eb4b8f409e exporthtmldialog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/exporthtmldialog.h Thu Feb 25 11:03:52 2010 +0000 @@ -0,0 +1,66 @@ +#ifndef EXPORTHTMLDIALOG_H +#define EXPORTHTMLDIALOG_H + +#include "ui_exporthtmldialog.h" + +/*! \brief Dialog to export a map as HTML document + +This is an overloaded QDialog with various settings needed to call +convert the vym.xml to a HTML document. +*/ + +class ExportHTMLDialog:public QDialog +{ + Q_OBJECT +public: + ExportHTMLDialog(QWidget* parent = 0); + + virtual QString getDir(); + virtual bool warnings(); + virtual bool hasChanged(); + +public slots: + virtual void readSettings(); + virtual void setDir (const QString&); + virtual void dirChanged(); + virtual void browseDirectoryPressed(); + virtual void imageButtonPressed( bool b ); + virtual void textcolorButtonPressed( bool b ); + virtual void saveSettingsInMapButtonPressed( bool b ); + virtual void warningsButtonPressed( bool b ); + virtual void outputButtonPressed( bool b ); + virtual void cssChanged(); + virtual QString getCSSPath(); + virtual void browseCSSPressed(); + virtual void prescriptChanged(); + virtual void postscriptChanged(); + virtual void browsePreExportButtonPressed(); + virtual void browsePostExportButtonPressed(); + virtual void doExport( const QString & mapname ); + virtual void setFilePath( const QString & s ); + virtual void setMapName( const QString & s ); + +protected: + bool useTextColor; + bool showWarnings; + QString css; + bool useImage; + bool showOutput; + QString dir; + QString filepath; + QString prescript; + QString postscript; + bool settingsChanged; + QString mapname; + bool saveSettingsInMap; + Process *scriptProc; + +private: + Ui::ExportHTMLDialog ui; + void init(); + void destroy(); + void runScript( QString spath, QString fpath ); + +}; + +#endif // EXPORTHTMLDIALOG_H diff -r 0bba81dde1bc -r 36eb4b8f409e exporthtmldialog.ui --- a/exporthtmldialog.ui Fri Feb 19 13:47:03 2010 +0000 +++ b/exporthtmldialog.ui Thu Feb 25 11:03:52 2010 +0000 @@ -1,321 +1,457 @@ -<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> -<class>ExportHTMLDialog</class> -<author>Uwe Drechsel</author> -<widget class="QDialog"> - <property name="name"> - <cstring>ExportHTMLDialog</cstring> - </property> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>375</width> - <height>346</height> - </rect> - </property> - <property name="caption"> - <string>Export HTML</string> - </property> - <property name="modal"> - <bool>false</bool> - </property> - <vbox> - <property name="name"> - <cstring>unnamed</cstring> +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>ExportHTMLDialog</class> + <widget class="QDialog" name="ExportHTMLDialog"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>684</width> + <height>471</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>130</height> + </size> + </property> + <property name="windowTitle"> + <string>Export HTML</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <layout class="QHBoxLayout"> + <property name="spacing"> + <number>6</number> + </property> + <property name="margin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="textLabel1"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Export to directory:</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="lineEditDir"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="browseExportDirButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Browse</string> + </property> + </widget> + </item> + </layout> + </item> + <item> + <widget class="QGroupBox" name="groupBox"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>200</height> + </size> + </property> + <property name="title"> + <string>Options</string> + </property> + <widget class="QWidget" name=""> + <property name="geometry"> + <rect> + <x>20</x> + <y>20</y> + <width>220</width> + <height>106</height> + </rect> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QCheckBox" name="imageButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Include image</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="textColorButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Colored headings in text</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="saveSettingsInMapButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Save settings in map</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="outputButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>show output of external scripts</string> + </property> + </widget> + </item> + </layout> + </widget> + </widget> + </item> + <item> + <widget class="Q3GroupBox" name="groupBox2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title"> + <string>Stylesheets</string> + </property> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <layout class="QGridLayout"> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <item row="0" column="0"> + <layout class="QHBoxLayout"> + <property name="spacing"> + <number>6</number> </property> - <widget class="QLayoutWidget"> - <property name="name"> - <cstring>layout33</cstring> - </property> - <hbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <widget class="QLabel"> - <property name="name"> - <cstring>textLabel1</cstring> - </property> - <property name="text"> - <string>Directory:</string> - </property> - </widget> - <widget class="QLineEdit"> - <property name="name"> - <cstring>lineEdit1</cstring> - </property> - </widget> - <widget class="QPushButton"> - <property name="name"> - <cstring>browseButton</cstring> - </property> - <property name="text"> - <string>Browse</string> - </property> - </widget> - </hbox> - </widget> - <widget class="QButtonGroup"> - <property name="name"> - <cstring>buttonGroup2</cstring> - </property> - <property name="sizePolicy"> - <sizepolicy> - <hsizetype>3</hsizetype> - <vsizetype>5</vsizetype> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>230</height> - </size> - </property> - <property name="title"> - <string>Options</string> - </property> - <vbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <widget class="QCheckBox"> - <property name="name"> - <cstring>checkBox4</cstring> - </property> - <property name="text"> - <string>Include image of map</string> - </property> - </widget> - <widget class="QCheckBox"> - <property name="name"> - <cstring>checkBox5_2</cstring> - </property> - <property name="text"> - <string>create image only</string> - </property> - </widget> - <widget class="QCheckBox"> - <property name="name"> - <cstring>checkBox5</cstring> - </property> - <property name="text"> - <string>use WIKI style</string> - </property> - </widget> - <widget class="QCheckBox"> - <property name="name"> - <cstring>checkBox4_2</cstring> - </property> - <property name="text"> - <string>use heading for URLs (instead of link target)</string> - </property> - </widget> - <widget class="QCheckBox"> - <property name="name"> - <cstring>checkBox6</cstring> - </property> - <property name="text"> - <string>use image of earth to mark URLs in text</string> - </property> - </widget> - <widget class="QCheckBox"> - <property name="name"> - <cstring>checkBox7</cstring> - </property> - <property name="text"> - <string>use default CSS file</string> - </property> - </widget> - <widget class="QCheckBox"> - <property name="name"> - <cstring>checkBox3</cstring> - </property> - <property name="sizePolicy"> - <sizepolicy> - <hsizetype>1</hsizetype> - <vsizetype>0</vsizetype> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>show output of external scripts</string> - </property> - </widget> - </vbox> - </widget> - <spacer> - <property name="name"> - <cstring>spacer6</cstring> - </property> - <property name="orientation"> - <enum>Vertical</enum> - </property> - <property name="sizeType"> - <enum>Expanding</enum> - </property> - <property name="sizeHint"> - <size> - <width>21</width> - <height>60</height> - </size> - </property> - </spacer> - <widget class="QLayoutWidget"> - <property name="name"> - <cstring>layout17</cstring> - </property> - <hbox> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <spacer> - <property name="name"> - <cstring>spacer5</cstring> - </property> - <property name="orientation"> - <enum>Horizontal</enum> - </property> - <property name="sizeType"> - <enum>Expanding</enum> - </property> - <property name="sizeHint"> - <size> - <width>61</width> - <height>21</height> - </size> - </property> - </spacer> - <widget class="QPushButton"> - <property name="name"> - <cstring>pushButton4</cstring> - </property> - <property name="text"> - <string>Export</string> - </property> - <property name="default"> - <bool>true</bool> - </property> - </widget> - <widget class="QPushButton"> - <property name="name"> - <cstring>pushButton5</cstring> - </property> - <property name="text"> - <string>Cancel</string> - </property> - </widget> - </hbox> - </widget> - </vbox> -</widget> -<connections> - <connection> - <sender>pushButton5</sender> - <signal>pressed()</signal> - <receiver>ExportHTMLDialog</receiver> - <slot>reject()</slot> - </connection> - <connection> - <sender>pushButton4</sender> - <signal>clicked()</signal> - <receiver>ExportHTMLDialog</receiver> - <slot>accept()</slot> - </connection> - <connection> - <sender>browseButton</sender> - <signal>pressed()</signal> - <receiver>ExportHTMLDialog</receiver> - <slot>browseDirectory()</slot> - </connection> - <connection> - <sender>checkBox4</sender> - <signal>toggled(bool)</signal> - <receiver>ExportHTMLDialog</receiver> - <slot>includeImage(bool)</slot> - </connection> - <connection> - <sender>checkBox5</sender> - <signal>toggled(bool)</signal> - <receiver>ExportHTMLDialog</receiver> - <slot>useWIKIpressed(bool)</slot> - </connection> - <connection> - <sender>lineEdit1</sender> - <signal>textChanged(const QString&)</signal> - <receiver>ExportHTMLDialog</receiver> - <slot>dirChanged()</slot> - </connection> - <connection> - <sender>checkBox3</sender> - <signal>toggled(bool)</signal> - <receiver>ExportHTMLDialog</receiver> - <slot>showOut(bool)</slot> - </connection> - <connection> - <sender>checkBox4_2</sender> - <signal>toggled(bool)</signal> - <receiver>ExportHTMLDialog</receiver> - <slot>useHeadingPressed(bool)</slot> - </connection> - <connection> - <sender>checkBox5_2</sender> - <signal>toggled(bool)</signal> - <receiver>ExportHTMLDialog</receiver> - <slot>imgOnly(bool)</slot> - </connection> - <connection> - <sender>checkBox6</sender> - <signal>toggled(bool)</signal> - <receiver>ExportHTMLDialog</receiver> - <slot>useURLImagePressed(bool)</slot> - </connection> -</connections> -<includes> - <include location="local" impldecl="in declaration">showtextdialog.h</include> - <include location="global" impldecl="in declaration">qprocess.h</include> - <include location="global" impldecl="in implementation">iostream</include> - <include location="local" impldecl="in implementation">settings.h</include> - <include location="global" impldecl="in implementation">qfiledialog.h</include> - <include location="global" impldecl="in implementation">qmessagebox.h</include> - <include location="local" impldecl="in implementation">file.h</include> - <include location="local" impldecl="in implementation">icons/flag-url.xpm</include> - <include location="local" impldecl="in implementation">exporthtmldialog.ui.h</include> -</includes> -<variables> - <variable>QString css;</variable> - <variable>QString xsl;</variable> - <variable>QString scriptpath;</variable> - <variable>QString stylepath;</variable> - <variable>QString dir;</variable> - <variable>bool image;</variable> - <variable>bool wikistyle;</variable> - <variable>QString script;</variable> - <variable>bool showOutput;</variable> - <variable>QProcess *proc;</variable> - <variable>ShowTextDialog *dia;</variable> - <variable>bool imageOnly;</variable> - <variable>bool useHeading;</variable> - <variable>bool useURLImage;</variable> -</variables> -<slots> - <slot>browseDirectory()</slot> - <slot>useWIKIpressed( bool b )</slot> - <slot>includeImage( bool b )</slot> - <slot>imgOnly( bool b )</slot> - <slot>useHeadingPressed( bool b )</slot> - <slot>useURLImagePressed( bool b )</slot> - <slot>showOut( bool b )</slot> - <slot>dirChanged()</slot> - <slot>doExport( const QString & mapname )</slot> - <slot returnType="QString">getDir()</slot> - <slot>readOutput()</slot> -</slots> -<functions> - <function access="private" specifier="non virtual">init()</function> - <function access="private" specifier="non virtual">destroy()</function> -</functions> -<pixmapinproject/> -<layoutdefaults spacing="6" margin="11"/> -</UI> + <property name="margin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="textLabel1_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>125</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string>CSS:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="lineEditCSS"/> + </item> + <item> + <widget class="QPushButton" name="browseCSSButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Browse</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + </item> + <item> + <widget class="Q3GroupBox" name="groupBox1"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title"> + <string>Scripts</string> + </property> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <layout class="QGridLayout"> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <item row="0" column="0"> + <layout class="QHBoxLayout"> + <property name="spacing"> + <number>6</number> + </property> + <property name="margin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="textLabel1_3"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>125</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string>Before export:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="lineEditPreScript"/> + </item> + <item> + <widget class="QPushButton" name="browsePreExportButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Browse</string> + </property> + </widget> + </item> + </layout> + </item> + <item row="1" column="0"> + <layout class="QHBoxLayout"> + <property name="spacing"> + <number>6</number> + </property> + <property name="margin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="textLabel2_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>125</width> + <height>0</height> + </size> + </property> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> + </property> + <property name="text"> + <string>After Export:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="lineEditPostScript"/> + </item> + <item> + <widget class="QPushButton" name="browsePostExportButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Browse</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + </item> + <item> + <spacer> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::MinimumExpanding</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>41</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QHBoxLayout"> + <item> + <spacer> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Expanding</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>61</width> + <height>21</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="cancelButton"> + <property name="text"> + <string>Cancel</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="exportButton"> + <property name="text"> + <string>Export</string> + </property> + <property name="default"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + <layoutdefault spacing="6" margin="11"/> + <pixmapfunction>qPixmapFromMimeSource</pixmapfunction> + <customwidgets> + <customwidget> + <class>Q3GroupBox</class> + <extends>QGroupBox</extends> + <header>Qt3Support/Q3GroupBox</header> + <container>1</container> + </customwidget> + </customwidgets> + <includes> + <include location="local">xsltproc.h</include> + <include location="local">process.h</include> + </includes> + <resources/> + <connections> + <connection> + <sender>cancelButton</sender> + <signal>clicked()</signal> + <receiver>ExportHTMLDialog</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel"> + <x>459</x> + <y>443</y> + </hint> + <hint type="destinationlabel"> + <x>256</x> + <y>233</y> + </hint> + </hints> + </connection> + <connection> + <sender>exportButton</sender> + <signal>clicked()</signal> + <receiver>ExportHTMLDialog</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel"> + <x>368</x> + <y>443</y> + </hint> + <hint type="destinationlabel"> + <x>256</x> + <y>233</y> + </hint> + </hints> + </connection> + </connections> +</ui> diff -r 0bba81dde1bc -r 36eb4b8f409e exports.cpp --- a/exports.cpp Fri Feb 19 13:47:03 2010 +0000 +++ b/exports.cpp Thu Feb 25 11:03:52 2010 +0000 @@ -8,6 +8,7 @@ #include "warningdialog.h" #include "xsltproc.h" + extern Main *mainWindow; extern QDir vymBaseDir; extern QString vymName; @@ -344,14 +345,11 @@ QString s; QString curIndent(""); int i; - BranchObj *bo; //FIXME-3 still needed? BranchItem *cur=NULL; BranchItem *prev=NULL; cur=model->nextBranch (cur,prev); while (cur) { - bo=(BranchObj*)(cur->getLMO()); - if (!cur->hasHiddenExportParent() ) { // If necessary, write note @@ -487,6 +485,8 @@ noSingulars=true; frameURLs=true; useMapColors=true; + cssFileName="vym.css"; + cssOriginalPath=""; // Is set in VymModel, based on default setting in ExportHTMLDialog if (model &&model->getMapEditor()) offset=model->getMapEditor()->getTotalBBox().topLeft(); @@ -590,8 +590,37 @@ return r; } +void ExportHTML::setCSSPath(const QString &p) +{ + cssOriginalPath=p; +} + void ExportHTML::doExport() { + //FIXME-1 check for errors// Copy CSS file + QFile css_src (cssOriginalPath); + QFile css_dst (outDir.path()+"/"+cssFileName); + if (!css_src.open ( QIODevice::ReadOnly)) + QMessageBox::warning( 0, QObject::tr( "Warning","ExportHTML" ),QObject::tr("Could not open %1","ExportHTML").arg(cssOriginalPath)); + else + { + if (!css_dst.open( QIODevice::WriteOnly)) + QMessageBox::warning( 0, QObject::tr( "Warning" ), QObject::tr("Could not open %1").arg(css_dst.fileName())); + else + { + + QTextStream tsout( &css_dst); + QTextStream tsin ( &css_src); + QString s= tsin.read(); + tsout << s; + css_dst.close(); + } + css_src.close(); + } + + + + // Open file for writing QFile file (outputFile); if ( !file.open( QIODevice::WriteOnly ) ) { @@ -604,7 +633,7 @@ // Write header ts<<"<html><title>"+model->getMapName()<<"</title><body>"; - ts<<" <link rel='stylesheet' id='css.stylesheet' href='vym.css' />\n"; + ts<<" <link rel='stylesheet' id='css.stylesheet' href='"<<cssFileName<<"' />\n"; // Include image ts<<"<center><img src=\""<<model->getMapName()<<".png\" usemap='#imagemap'></center>\n"; diff -r 0bba81dde1bc -r 36eb4b8f409e exports.h --- a/exports.h Fri Feb 19 13:47:03 2010 +0000 +++ b/exports.h Thu Feb 25 11:03:52 2010 +0000 @@ -100,11 +100,14 @@ ExportHTML(); ExportHTML(VymModel *m); virtual void init(); + virtual void setCSSPath(const QString &path); virtual void doExport(); private: QString getBranchText(BranchItem *); QString buildList (BranchItem *); QString imageMap; + QString cssFileName; + QString cssOriginalPath; bool frameURLs; bool noSingulars; diff -r 0bba81dde1bc -r 36eb4b8f409e exportxhtmldialog.ui --- a/exportxhtmldialog.ui Fri Feb 19 13:47:03 2010 +0000 +++ b/exportxhtmldialog.ui Thu Feb 25 11:03:52 2010 +0000 @@ -1,7 +1,8 @@ -<ui version="4.0" > +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> <class>ExportXHTMLDialog</class> - <widget class="QDialog" name="ExportXHTMLDialog" > - <property name="geometry" > + <widget class="QDialog" name="ExportXHTMLDialog"> + <property name="geometry"> <rect> <x>0</x> <y>0</y> @@ -9,50 +10,41 @@ <height>523</height> </rect> </property> - <property name="minimumSize" > + <property name="minimumSize"> <size> <width>0</width> <height>130</height> </size> </property> - <property name="windowTitle" > + <property name="windowTitle"> <string>Export XHTML</string> </property> - <layout class="QVBoxLayout" > + <layout class="QVBoxLayout"> <item> - <layout class="QHBoxLayout" > - <property name="spacing" > + <layout class="QHBoxLayout"> + <property name="spacing"> <number>6</number> </property> - <property name="leftMargin" > - <number>0</number> - </property> - <property name="topMargin" > - <number>0</number> - </property> - <property name="rightMargin" > - <number>0</number> - </property> - <property name="bottomMargin" > + <property name="margin"> <number>0</number> </property> <item> - <widget class="QLabel" name="textLabel1" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > + <widget class="QLabel" name="textLabel1"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="text" > + <property name="text"> <string>Export to directory:</string> </property> </widget> </item> <item> - <widget class="QLineEdit" name="lineEditDir" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > + <widget class="QLineEdit" name="lineEditDir"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -60,14 +52,14 @@ </widget> </item> <item> - <widget class="QPushButton" name="browseExportDirButton" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Fixed" > + <widget class="QPushButton" name="browseExportDirButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="text" > + <property name="text"> <string>Browse</string> </property> </widget> @@ -75,46 +67,27 @@ </layout> </item> <item> - <widget class="Q3ButtonGroup" name="buttonGroup2" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Preferred" > + <widget class="Q3ButtonGroup" name="buttonGroup2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize" > + <property name="minimumSize"> <size> <width>0</width> <height>160</height> </size> </property> - <property name="title" > + <property name="title"> <string>Options</string> </property> - <property name="orientation" > + <property name="orientation"> <enum>Qt::Vertical</enum> </property> - <widget class="QCheckBox" name="outputButton" > - <property name="geometry" > - <rect> - <x>22</x> - <y>156</y> - <width>521</width> - <height>21</height> - </rect> - </property> - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Minimum" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string>show output of external scripts</string> - </property> - </widget> - <widget class="QWidget" name="layoutWidget" > - <property name="geometry" > + <widget class="QWidget" name="layoutWidget"> + <property name="geometry"> <rect> <x>20</x> <y>30</y> @@ -122,189 +95,166 @@ <height>104</height> </rect> </property> - <layout class="QVBoxLayout" > - <property name="spacing" > + <layout class="QVBoxLayout"> + <property name="spacing"> <number>6</number> </property> - <property name="leftMargin" > - <number>0</number> - </property> - <property name="topMargin" > - <number>0</number> - </property> - <property name="rightMargin" > - <number>0</number> - </property> - <property name="bottomMargin" > + <property name="margin"> <number>0</number> </property> <item> - <widget class="QCheckBox" name="imageButton" > - <property name="text" > + <widget class="QCheckBox" name="imageButton"> + <property name="text"> <string>Include image</string> </property> </widget> </item> <item> - <widget class="QCheckBox" name="textColorButton" > - <property name="text" > + <widget class="QCheckBox" name="textColorButton"> + <property name="text"> <string>Colored headings in text</string> </property> </widget> </item> <item> - <widget class="QCheckBox" name="saveSettingsInMapButton" > - <property name="text" > + <widget class="QCheckBox" name="saveSettingsInMapButton"> + <property name="text"> <string>Save settings in map</string> </property> </widget> </item> <item> - <widget class="QCheckBox" name="warningsButton" > - <property name="text" > + <widget class="QCheckBox" name="warningsButton"> + <property name="text"> <string>show warnings of xslt processor</string> </property> </widget> </item> + <item> + <widget class="QCheckBox" name="outputButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>show output of external scripts</string> + </property> + <attribute name="buttonGroup"> + <string/> + </attribute> + </widget> + </item> </layout> </widget> </widget> </item> <item> - <widget class="Q3GroupBox" name="groupBox2" > - <property name="title" > + <widget class="Q3GroupBox" name="groupBox2"> + <property name="title"> <string>Stylesheets</string> </property> - <property name="orientation" > + <property name="orientation"> <enum>Qt::Vertical</enum> </property> - <layout class="QGridLayout" > - <property name="leftMargin" > + <layout class="QGridLayout"> + <property name="margin"> <number>11</number> </property> - <property name="topMargin" > - <number>11</number> - </property> - <property name="rightMargin" > - <number>11</number> - </property> - <property name="bottomMargin" > - <number>11</number> - </property> - <property name="horizontalSpacing" > + <property name="spacing"> <number>6</number> </property> - <property name="verticalSpacing" > - <number>6</number> - </property> - <item row="1" column="0" > - <layout class="QHBoxLayout" > - <property name="spacing" > + <item row="1" column="0"> + <layout class="QHBoxLayout"> + <property name="spacing"> <number>6</number> </property> - <property name="leftMargin" > - <number>0</number> - </property> - <property name="topMargin" > - <number>0</number> - </property> - <property name="rightMargin" > - <number>0</number> - </property> - <property name="bottomMargin" > + <property name="margin"> <number>0</number> </property> <item> - <widget class="QLabel" name="textLabel2" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Fixed" > + <widget class="QLabel" name="textLabel2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize" > + <property name="minimumSize"> <size> <width>125</width> <height>0</height> </size> </property> - <property name="text" > + <property name="text"> <string>XSL:</string> </property> - <property name="alignment" > + <property name="alignment"> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> </property> </widget> </item> <item> - <widget class="QLineEdit" name="lineEditXSL" /> + <widget class="QLineEdit" name="lineEditXSL"/> </item> <item> - <widget class="QPushButton" name="browseXSLButton" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Fixed" > + <widget class="QPushButton" name="browseXSLButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="text" > + <property name="text"> <string>Browse</string> </property> </widget> </item> </layout> </item> - <item row="0" column="0" > - <layout class="QHBoxLayout" > - <property name="spacing" > + <item row="0" column="0"> + <layout class="QHBoxLayout"> + <property name="spacing"> <number>6</number> </property> - <property name="leftMargin" > - <number>0</number> - </property> - <property name="topMargin" > - <number>0</number> - </property> - <property name="rightMargin" > - <number>0</number> - </property> - <property name="bottomMargin" > + <property name="margin"> <number>0</number> </property> <item> - <widget class="QLabel" name="textLabel1_2" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Fixed" > + <widget class="QLabel" name="textLabel1_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize" > + <property name="minimumSize"> <size> <width>125</width> <height>0</height> </size> </property> - <property name="text" > + <property name="text"> <string>CSS:</string> </property> - <property name="alignment" > + <property name="alignment"> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> </property> </widget> </item> <item> - <widget class="QLineEdit" name="lineEditCSS" /> + <widget class="QLineEdit" name="lineEditCSS"/> </item> <item> - <widget class="QPushButton" name="browseCSSButton" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Fixed" > + <widget class="QPushButton" name="browseCSSButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="text" > + <property name="text"> <string>Browse</string> </property> </widget> @@ -315,143 +265,113 @@ </widget> </item> <item> - <widget class="Q3GroupBox" name="groupBox1" > - <property name="title" > + <widget class="Q3GroupBox" name="groupBox1"> + <property name="title"> <string>Scripts</string> </property> - <property name="orientation" > + <property name="orientation"> <enum>Qt::Vertical</enum> </property> - <layout class="QGridLayout" > - <property name="leftMargin" > + <layout class="QGridLayout"> + <property name="margin"> <number>11</number> </property> - <property name="topMargin" > - <number>11</number> - </property> - <property name="rightMargin" > - <number>11</number> - </property> - <property name="bottomMargin" > - <number>11</number> - </property> - <property name="horizontalSpacing" > + <property name="spacing"> <number>6</number> </property> - <property name="verticalSpacing" > - <number>6</number> - </property> - <item row="0" column="0" > - <layout class="QHBoxLayout" > - <property name="spacing" > + <item row="0" column="0"> + <layout class="QHBoxLayout"> + <property name="spacing"> <number>6</number> </property> - <property name="leftMargin" > - <number>0</number> - </property> - <property name="topMargin" > - <number>0</number> - </property> - <property name="rightMargin" > - <number>0</number> - </property> - <property name="bottomMargin" > + <property name="margin"> <number>0</number> </property> <item> - <widget class="QLabel" name="textLabel1_3" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Fixed" > + <widget class="QLabel" name="textLabel1_3"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize" > + <property name="minimumSize"> <size> <width>125</width> <height>0</height> </size> </property> - <property name="text" > + <property name="text"> <string>Before export:</string> </property> - <property name="alignment" > + <property name="alignment"> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> </property> </widget> </item> <item> - <widget class="QLineEdit" name="lineEditPreScript" /> + <widget class="QLineEdit" name="lineEditPreScript"/> </item> <item> - <widget class="QPushButton" name="browsePreExportButton" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Fixed" > + <widget class="QPushButton" name="browsePreExportButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="text" > + <property name="text"> <string>Browse</string> </property> </widget> </item> </layout> </item> - <item row="1" column="0" > - <layout class="QHBoxLayout" > - <property name="spacing" > + <item row="1" column="0"> + <layout class="QHBoxLayout"> + <property name="spacing"> <number>6</number> </property> - <property name="leftMargin" > - <number>0</number> - </property> - <property name="topMargin" > - <number>0</number> - </property> - <property name="rightMargin" > - <number>0</number> - </property> - <property name="bottomMargin" > + <property name="margin"> <number>0</number> </property> <item> - <widget class="QLabel" name="textLabel2_2" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Fixed" > + <widget class="QLabel" name="textLabel2_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize" > + <property name="minimumSize"> <size> <width>125</width> <height>0</height> </size> </property> - <property name="frameShape" > + <property name="frameShape"> <enum>QFrame::NoFrame</enum> </property> - <property name="text" > + <property name="text"> <string>After Export:</string> </property> - <property name="alignment" > + <property name="alignment"> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> </property> </widget> </item> <item> - <widget class="QLineEdit" name="lineEditPostScript" /> + <widget class="QLineEdit" name="lineEditPostScript"/> </item> <item> - <widget class="QPushButton" name="browsePostExportButton" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Fixed" > + <widget class="QPushButton" name="browsePostExportButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="text" > + <property name="text"> <string>Browse</string> </property> </widget> @@ -463,13 +383,13 @@ </item> <item> <spacer> - <property name="orientation" > + <property name="orientation"> <enum>Qt::Vertical</enum> </property> - <property name="sizeType" > + <property name="sizeType"> <enum>QSizePolicy::MinimumExpanding</enum> </property> - <property name="sizeHint" > + <property name="sizeHint" stdset="0"> <size> <width>20</width> <height>41</height> @@ -478,16 +398,16 @@ </spacer> </item> <item> - <layout class="QHBoxLayout" > + <layout class="QHBoxLayout"> <item> <spacer> - <property name="orientation" > + <property name="orientation"> <enum>Qt::Horizontal</enum> </property> - <property name="sizeType" > + <property name="sizeType"> <enum>QSizePolicy::Expanding</enum> </property> - <property name="sizeHint" > + <property name="sizeHint" stdset="0"> <size> <width>61</width> <height>21</height> @@ -496,18 +416,18 @@ </spacer> </item> <item> - <widget class="QPushButton" name="cancelButton" > - <property name="text" > + <widget class="QPushButton" name="cancelButton"> + <property name="text"> <string>Cancel</string> </property> </widget> </item> <item> - <widget class="QPushButton" name="exportButton" > - <property name="text" > + <widget class="QPushButton" name="exportButton"> + <property name="text"> <string>Export</string> </property> - <property name="default" > + <property name="default"> <bool>true</bool> </property> </widget> @@ -516,7 +436,7 @@ </item> </layout> </widget> - <layoutdefault spacing="6" margin="11" /> + <layoutdefault spacing="6" margin="11"/> <pixmapfunction>qPixmapFromMimeSource</pixmapfunction> <customwidgets> <customwidget> @@ -533,8 +453,8 @@ </customwidget> </customwidgets> <includes> - <include location="local" >xsltproc.h</include> - <include location="local" >process.h</include> + <include location="local">xsltproc.h</include> + <include location="local">process.h</include> </includes> <resources/> <connections> @@ -544,11 +464,11 @@ <receiver>ExportXHTMLDialog</receiver> <slot>reject()</slot> <hints> - <hint type="sourcelabel" > + <hint type="sourcelabel"> <x>459</x> <y>443</y> </hint> - <hint type="destinationlabel" > + <hint type="destinationlabel"> <x>256</x> <y>233</y> </hint> @@ -560,11 +480,11 @@ <receiver>ExportXHTMLDialog</receiver> <slot>accept()</slot> <hints> - <hint type="sourcelabel" > + <hint type="sourcelabel"> <x>368</x> <y>443</y> </hint> - <hint type="destinationlabel" > + <hint type="destinationlabel"> <x>256</x> <y>233</y> </hint> diff -r 0bba81dde1bc -r 36eb4b8f409e flagrow.cpp --- a/flagrow.cpp Fri Feb 19 13:47:03 2010 +0000 +++ b/flagrow.cpp Thu Feb 25 11:03:52 2010 +0000 @@ -46,7 +46,7 @@ } -bool FlagRow::isActive (const QString &name) //FIXME-2 regression +bool FlagRow::isActive (const QString &name) { QString n; foreach (n,activeNames) diff -r 0bba81dde1bc -r 36eb4b8f409e geometry.cpp --- a/geometry.cpp Fri Feb 19 13:47:03 2010 +0000 +++ b/geometry.cpp Thu Feb 25 11:03:52 2010 +0000 @@ -48,6 +48,11 @@ return false; } +qreal distance (const QPointF &p, const QPointF &q) +{ + return sqrt (p.x()*q.x() + p.y()*q.y()); +} + Vector::Vector ():QPointF () { } diff -r 0bba81dde1bc -r 36eb4b8f409e geometry.h --- a/geometry.h Fri Feb 19 13:47:03 2010 +0000 +++ b/geometry.h Thu Feb 25 11:03:52 2010 +0000 @@ -5,6 +5,7 @@ QRectF addBBox(QRectF r1, QRectF r2); bool isInBox(const QPointF &p, const QRectF &box); +qreal distance (const QPointF &p, const QPointF &q); class Vector:public QPointF diff -r 0bba81dde1bc -r 36eb4b8f409e main.cpp --- a/main.cpp Fri Feb 19 13:47:03 2010 +0000 +++ b/main.cpp Thu Feb 25 11:03:52 2010 +0000 @@ -202,7 +202,7 @@ #endif //m.resize(m.sizeHint()); - m.setIcon (QPixmap (iconPath+"vym-48x48.png")); + m.setIcon (QPixmap (iconPath+"vym.png")); m.show(); m.fileNew(); // Paint Mainwindow first time diff -r 0bba81dde1bc -r 36eb4b8f409e mainwindow.cpp --- a/mainwindow.cpp Fri Feb 19 13:47:03 2010 +0000 +++ b/mainwindow.cpp Thu Feb 25 11:03:52 2010 +0000 @@ -205,6 +205,8 @@ setupSettingsActions(); setupContextMenus(); setupMacros(); + if (debug) switchboard.print(); + if (settings.value( "/mainwindow/showTestMenu",false).toBool()) setupTestActions(); setupHelpActions(); @@ -341,6 +343,7 @@ a = new QAction(QPixmap( iconPath+"filenew.png"), tr( "&New map","File menu" ),this); a->setStatusTip ( tr( "New map","Status tip File menu" ) ); a->setShortcut ( Qt::CTRL + Qt::Key_N ); //New map + switchboard.addConnection(a,tr("File","Shortcut group")); a->addTo( tb ); fileMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( fileNew() ) ); @@ -348,6 +351,7 @@ a = new QAction(QPixmap( iconPath+"filenewcopy.png"), tr( "&Copy to new map","File menu" ),this); a->setStatusTip ( tr( "Copy selection to mapcenter of a new map","Status tip File menu" ) ); a->setShortcut ( Qt::CTRL +Qt::SHIFT + Qt::Key_N ); //New map + switchboard.addConnection(a,tr("File","Shortcut group")); fileMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( fileNewCopy() ) ); actionFileNewCopy=a; @@ -355,6 +359,7 @@ a = new QAction( QPixmap( iconPath+"fileopen.png"), tr( "&Open..." ,"File menu"),this); a->setStatusTip (tr( "Open","Status tip File menu" ) ); a->setShortcut ( Qt::CTRL + Qt::Key_O ); //Open map + switchboard.addConnection(a,tr("File","Shortcut group")); a->addTo( tb ); fileMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( fileLoad() ) ); @@ -365,6 +370,7 @@ a = new QAction( QPixmap( iconPath+"filesave.png"), tr( "&Save...","File menu" ), this); a->setStatusTip ( tr( "Save","Status tip file menu" )); a->setShortcut (Qt::CTRL + Qt::Key_S ); //Save map + switchboard.addConnection(a,tr("File","Shortcut group")); a->addTo( tb ); fileMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( fileSave() ) ); @@ -372,6 +378,7 @@ a = new QAction( QPixmap(iconPath+"filesaveas.png"), tr( "Save &As...","File menu" ), this); a->setStatusTip (tr( "Save &As","Status tip file menu" ) ); + switchboard.addConnection(a,tr("File","Shortcut group")); fileMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( fileSaveAs() ) ); @@ -381,12 +388,14 @@ a = new QAction(tr("KDE 3 Bookmarks"), this); a->setStatusTip ( tr( "Import %1","Status tip file menu" ).arg(tr("KDE 3 bookmarks"))); + switchboard.addConnection(a,tr("File","Shortcut group")); a->addTo (fileImportMenu); connect( a, SIGNAL( triggered() ), this, SLOT( fileImportKDE3Bookmarks() ) ); a = new QAction(tr("KDE 4 Bookmarks"), this); a->setStatusTip ( tr( "Import %1","Status tip file menu" ).arg(tr("KDE 4 bookmarks"))); a->addTo (fileImportMenu); + switchboard.addConnection(a,tr("File","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( fileImportKDE4Bookmarks() ) ); if (settings.value( "/mainwindow/showTestMenu",false).toBool()) @@ -394,21 +403,25 @@ a = new QAction( QPixmap(), tr("Firefox Bookmarks","File menu"),this); a->setStatusTip (tr( "Import %1","Status tip file menu").arg(tr("Firefox Bookmarks" ) )); a->addTo (fileImportMenu); + switchboard.addConnection(a,tr("File","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( fileImportFirefoxBookmarks() ) ); } a = new QAction("Freemind...",this); a->setStatusTip ( tr( "Import %1","status tip file menu").arg(" Freemind") ); + switchboard.addConnection(a,tr("File","Shortcut group")); fileImportMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( fileImportFreemind() ) ); a = new QAction("Mind Manager...",this); a->setStatusTip ( tr( "Import %1","status tip file menu").arg(" Mind Manager") ); + switchboard.addConnection(a,tr("File","Shortcut group")); fileImportMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( fileImportMM() ) ); a = new QAction( tr( "Import Dir%1","File menu").arg("..."), this); a->setStatusTip (tr( "Import directory structure (experimental)","status tip file menu" ) ); + switchboard.addConnection(a,tr("File","Shortcut group")); fileImportMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( fileImportDir() ) ); @@ -416,17 +429,20 @@ a = new QAction( tr("Image%1","File export menu").arg("..."), this); a->setStatusTip( tr( "Export map as image","status tip file menu" )); + switchboard.addConnection(a,tr("File","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( fileExportImage() ) ); fileExportMenu->addAction (a); a = new QAction( "Open Office...", this); a->setStatusTip( tr( "Export in Open Document Format used e.g. in Open Office ","status tip file menu" )); + switchboard.addConnection(a,tr("File","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( fileExportOOPresentation() ) ); fileExportMenu->addAction (a); a = new QAction( "Webpage (HTML)...",this ); a->setShortcut (Qt::ALT + Qt::Key_X); //Export HTML a->setStatusTip ( tr( "Export as %1","status tip file menu").arg(tr(" webpage (XHTML)","status tip file menu"))); + switchboard.addConnection(a,tr("File","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( fileExportHTML() ) ); fileExportMenu->addAction (a); @@ -438,41 +454,49 @@ a = new QAction( "Text (A&O report)...", this); a->setStatusTip ( tr( "Export as %1").arg("A&O report "+tr("(still experimental)" ))); + switchboard.addConnection(a,tr("File","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( fileExportAO() ) ); fileExportMenu->addAction (a); a = new QAction( "Text (ASCII)...", this); a->setStatusTip ( tr( "Export as %1").arg("ASCII "+tr("(still experimental)" ))); + switchboard.addConnection(a,tr("File","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( fileExportASCII() ) ); fileExportMenu->addAction (a); a = new QAction( "Spreadsheet (CSV)...", this); a->setStatusTip ( tr( "Export as %1").arg("CSV "+tr("(still experimental)" ))); + switchboard.addConnection(a,tr("File","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( fileExportCSV() ) ); fileExportMenu->addAction (a); a = new QAction( tr("KDE 3 Bookmarks","File menu"), this); a->setStatusTip( tr( "Export as %1").arg(tr("KDE 3 Bookmarks" ))); + switchboard.addConnection(a,tr("File","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( fileExportKDE3Bookmarks() ) ); fileExportMenu->addAction (a); a = new QAction( tr("KDE 4 Bookmarks","File menu"), this); a->setStatusTip( tr( "Export as %1").arg(tr("KDE 4 Bookmarks" ))); + switchboard.addConnection(a,tr("File","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( fileExportKDE4Bookmarks() ) ); fileExportMenu->addAction (a); a = new QAction( "Taskjuggler...", this ); a->setStatusTip( tr( "Export as %1").arg("Taskjuggler "+tr("(still experimental)" ))); + switchboard.addConnection(a,tr("File","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( fileExportTaskjuggler() ) ); fileExportMenu->addAction (a); a = new QAction( "LaTeX...", this); a->setStatusTip( tr( "Export as %1").arg("LaTeX "+tr("(still experimental)" ))); + switchboard.addConnection(a,tr("File","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( fileExportLaTeX() ) ); fileExportMenu->addAction (a); a = new QAction( "XML..." , this ); a->setStatusTip (tr( "Export as %1").arg("XML")); + switchboard.addConnection(a,tr("File","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( fileExportXML() ) ); fileExportMenu->addAction (a); @@ -482,6 +506,7 @@ a->setStatusTip ( tr( "Print" ,"File menu") ); a->setShortcut (Qt::CTRL + Qt::Key_P ); //Print map a->addTo( tb ); + switchboard.addConnection(a,tr("File","Shortcut group")); fileMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( filePrint() ) ); actionFilePrint=a; @@ -489,12 +514,14 @@ a = new QAction( QPixmap(iconPath+"fileclose.png"), tr( "&Close Map","File menu" ), this); a->setStatusTip (tr( "Close Map" ) ); a->setShortcut (Qt::CTRL + Qt::Key_W ); //Close map + switchboard.addConnection(a,tr("File","Shortcut group")); fileMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( fileCloseMap() ) ); a = new QAction(QPixmap(iconPath+"exit.png"), tr( "E&xit","File menu")+" "+vymName, this); a->setStatusTip ( tr( "Exit")+" "+vymName ); a->setShortcut (Qt::CTRL + Qt::Key_Q ); //Quit vym + switchboard.addConnection(a,tr("File","Shortcut group")); fileMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( fileExitVYM() ) ); } @@ -515,6 +542,7 @@ a->setStatusTip (tr( "Undo" ) ); a->setShortcut ( Qt::CTRL + Qt::Key_Z ); //Undo last action a->setEnabled (false); + switchboard.addConnection(a,tr("Edit","Shortcut group")); tb->addAction (a); editMenu->addAction (a); actionUndo=a; @@ -522,6 +550,7 @@ a = new QAction( QPixmap( iconPath+"redo.png"), tr( "&Redo","Edit menu" ), this); a->setStatusTip (tr( "Redo" )); a->setShortcut (Qt::CTRL + Qt::Key_Y ); //Redo last action + switchboard.addConnection(a,tr("Edit","Shortcut group")); tb->addAction (a); editMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editRedo() ) ); @@ -532,6 +561,7 @@ a->setStatusTip ( tr( "Copy" ) ); a->setShortcut (Qt::CTRL + Qt::Key_C ); //Copy a->setEnabled (false); + switchboard.addConnection(a,tr("Edit","Shortcut group")); tb->addAction (a); editMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editCopy() ) ); @@ -542,6 +572,7 @@ a->setShortcut (Qt::CTRL + Qt::Key_X ); //Cut a->setEnabled (false); tb->addAction (a); + switchboard.addConnection(a,tr("Edit","Shortcut group")); editMenu->addAction (a); actionCut=a; connect( a, SIGNAL( triggered() ), this, SLOT( editCut() ) ); @@ -552,6 +583,7 @@ a->setShortcut ( Qt::CTRL + Qt::Key_V ); //Paste a->setEnabled (false); tb->addAction (a); + switchboard.addConnection(a,tr("Edit","Shortcut group")); editMenu->addAction (a); actionPaste=a; @@ -560,6 +592,7 @@ a->setStatusTip (tr( "Delete Selection" )); a->setShortcut ( Qt::Key_Delete); //Delete selection a->setShortcutContext (Qt::WindowShortcut); + switchboard.addConnection(a,tr("Edit","Shortcut group")); addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteSelection() ) ); actionDelete=a; @@ -568,6 +601,7 @@ a= new QAction(tr( "Add attribute" ), this); a->setShortcut ( Qt::Key_Q); a->setShortcutContext (Qt::WindowShortcut); + switchboard.addConnection(a,tr("Edit","Shortcut group")); addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editAddAttribute() ) ); actionAddAttribute= a; @@ -577,6 +611,7 @@ a= new QAction(QPixmap(iconPath+"newmapcenter.png"),tr( "Add mapcenter","Canvas context menu" ), this); a->setShortcut ( Qt::Key_M); a->setShortcutContext (Qt::WindowShortcut); + switchboard.addConnection(a,tr("Edit","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( editAddMapCenter() ) ); //actionListBranches.append(a); tb->addAction (a); @@ -588,11 +623,13 @@ alt->setStatusTip ( tr( "Add a branch as child of selection" )); alt->setShortcut (Qt::Key_A); //Add branch alt->setShortcutContext (Qt::WindowShortcut); + switchboard.addConnection(alt,tr("Edit","Shortcut group")); addAction (alt); connect( alt, SIGNAL( triggered() ), this, SLOT( editNewBranch() ) ); a = new QAction(QPixmap(iconPath+"newbranch.png"), tr( "Add branch as child","Edit menu" ), this); a->setStatusTip ( tr( "Add a branch as child of selection" )); a->setShortcut (Qt::Key_Insert); //Add branch + switchboard.addConnection(a,tr("Edit","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranch() ) ); actionListBranches.append(a); #if defined (Q_OS_MACX) @@ -610,6 +647,7 @@ a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" )); a->setShortcut (Qt::ALT + Qt::Key_Insert ); //Insert branch a->setShortcutContext (Qt::WindowShortcut); + switchboard.addConnection(a,tr("Edit","Shortcut group")); addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBefore() ) ); a->setEnabled (false); @@ -619,6 +657,7 @@ a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" )); a->setShortcut ( Qt::ALT + Qt::Key_A ); //Insert branch a->setShortcutContext (Qt::WindowShortcut); + switchboard.addConnection(a,tr("Edit","Shortcut group")); addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBefore() ) ); actionListBranches.append(a); @@ -628,6 +667,7 @@ a->setStatusTip ( tr( "Add a branch above selection" )); a->setShortcut (Qt::SHIFT+Qt::Key_Insert ); //Add branch above a->setShortcutContext (Qt::WindowShortcut); + switchboard.addConnection(a,tr("Edit","Shortcut group")); addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchAbove() ) ); a->setEnabled (false); @@ -637,6 +677,7 @@ a->setStatusTip ( tr( "Add a branch above selection" )); a->setShortcut (Qt::SHIFT+Qt::Key_A ); //Add branch above a->setShortcutContext (Qt::WindowShortcut); + switchboard.addConnection(a,tr("Edit","Shortcut group")); addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchAbove() ) ); actionListBranches.append(a); @@ -646,6 +687,7 @@ a->setStatusTip ( tr( "Add a branch below selection" )); a->setShortcut (Qt::CTRL +Qt::Key_Insert ); //Add branch below a->setShortcutContext (Qt::WindowShortcut); + switchboard.addConnection(a,tr("Edit","Shortcut group")); addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBelow() ) ); a->setEnabled (false); @@ -655,6 +697,7 @@ a->setStatusTip ( tr( "Add a branch below selection" )); a->setShortcut (Qt::CTRL +Qt::Key_A ); // Add branch below a->setShortcutContext (Qt::WindowShortcut); + switchboard.addConnection(a,tr("Edit","Shortcut group")); addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBelow() ) ); actionListBranches.append(a); @@ -663,6 +706,7 @@ a->setStatusTip ( tr( "Move branch up" ) ); a->setShortcut (Qt::Key_PageUp ); // Move branch up a->setEnabled (false); + switchboard.addConnection(a,tr("Edit","Shortcut group")); tb->addAction (a); editMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editMoveUp() ) ); @@ -673,6 +717,7 @@ a->setStatusTip (tr( "Move branch down" ) ); a->setShortcut ( Qt::Key_PageDown ); // Move branch down a->setEnabled (false); + switchboard.addConnection(a,tr("Edit","Shortcut group")); tb->addAction (a); editMenu->addAction (a); actionMoveDown=a; @@ -680,6 +725,7 @@ a = new QAction(QPixmap(), tr( "&Detach","Context menu" ),this); a->setStatusTip ( tr( "Detach branch and use as mapcenter","Context menu" ) ); a->setShortcut ( Qt::Key_D ); // Detach branch + switchboard.addConnection(a,tr("Edit","Shortcut group")); editMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editDetach() ) ); actionDetach=a; @@ -688,6 +734,7 @@ connect( a, SIGNAL( activated() ), this, SLOT( editSortChildren() ) ); a->setEnabled (true); a->addTo( tb ); + switchboard.addConnection(a,tr("Edit","Shortcut group")); editMenu->addAction (a); actionSortChildren=a; @@ -695,12 +742,14 @@ connect( a, SIGNAL( activated() ), this, SLOT( editSortBackChildren() ) ); a->setEnabled (true); a->addTo( tb ); + switchboard.addConnection(a,tr("Edit","Shortcut group")); editMenu->addAction (a); actionSortBackChildren=a; alt = new QAction( QPixmap(flagsPath+"flag-scrolled-right.png"), tr( "Scroll branch","Edit menu" ), this); alt->setShortcut ( Qt::Key_S ); // Scroll branch alt->setStatusTip (tr( "Scroll branch" )); + switchboard.addConnection(alt,tr("Edit","Shortcut group")); connect( alt, SIGNAL( triggered() ), this, SLOT( editToggleScroll() ) ); #if defined(Q_OS_MACX) actionToggleScroll=alt; @@ -719,6 +768,7 @@ a = new QAction( QPixmap(), tr( "Expand all branches","Edit menu" ), this); a->setShortcut ( Qt::SHIFT + Qt::Key_X ); // Expand all branches a->setStatusTip (tr( "Expand all branches" )); + switchboard.addConnection(a,tr("Edit","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( editExpandAll() ) ); actionExpandAll=a; actionExpandAll->setEnabled (false); @@ -730,6 +780,7 @@ a = new QAction( QPixmap(), tr( "Expand one level","Edit menu" ), this); a->setShortcut ( Qt::Key_Greater ); // Expand one level in tree editor + switchboard.addConnection(a,tr("Edit","Shortcut group")); a->setStatusTip (tr( "Expand one level in tree editor" )); connect( a, SIGNAL( triggered() ), this, SLOT( editExpandOneLevel() ) ); a->setEnabled (false); @@ -742,6 +793,7 @@ a = new QAction( QPixmap(), tr( "Collapse one level","Edit menu" ), this); a->setShortcut ( Qt::Key_Less); // Collapse one level in tree editor + switchboard.addConnection(a,tr("Edit","Shortcut group")); a->setStatusTip (tr( "Collapse one level in tree editor" )); connect( a, SIGNAL( triggered() ), this, SLOT( editCollapseOneLevel() ) ); a->setEnabled (false); @@ -754,6 +806,7 @@ a = new QAction( tr( "Unscroll children","Edit menu" ), this); a->setStatusTip (tr( "Unscroll all scrolled branches in selected subtree" )); + switchboard.addConnection(a,tr("Edit","Shortcut group")); editMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editUnscrollChildren() ) ); @@ -762,12 +815,14 @@ a = new QAction( QPixmap(iconPath+"find.png"), tr( "Find...","Edit menu"), this); a->setStatusTip (tr( "Find" ) ); a->setShortcut (Qt::CTRL + Qt::Key_F ); //Find + switchboard.addConnection(a,tr("Edit","Shortcut group")); editMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editOpenFindWidget() ) ); a = new QAction( tr( "Find duplicate URLs","Edit menu"), this); //a->setStatusTip (tr( "Find" ) ); a->setShortcut (Qt::SHIFT + Qt::Key_F); //Find duplicate URLs + switchboard.addConnection(a,tr("Edit","Shortcut group")); if (settings.value( "/mainwindow/showTestMenu",false).toBool() ) editMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editFindDuplicateURLs() ) ); @@ -776,7 +831,7 @@ a = new QAction( QPixmap(flagsPath+"flag-url.png"), tr( "Open URL","Edit menu" ), this); a->setShortcut (Qt::SHIFT + Qt::Key_U ); - a->setShortcut (tr( "Open URL" )); + switchboard.addConnection(a,tr("Edit","Shortcut group")); tb->addAction (a); addAction(a); connect( a, SIGNAL( triggered() ), this, SLOT( editOpenURL() ) ); @@ -785,6 +840,7 @@ a = new QAction( tr( "Open URL in new tab","Edit menu" ), this); a->setStatusTip (tr( "Open URL in new tab" )); //a->setShortcut (Qt::CTRL+Qt::Key_U ); + switchboard.addConnection(a,tr("Edit","Shortcut group")); addAction(a); connect( a, SIGNAL( triggered() ), this, SLOT( editOpenURLTab() ) ); actionOpenURLTab=a; @@ -792,6 +848,7 @@ a = new QAction( tr( "Open all URLs in subtree (including scrolled branches)","Edit menu" ), this); a->setStatusTip (tr( "Open all URLs in subtree (including scrolled branches)" )); a->setShortcut ( Qt::CTRL + Qt::Key_U ); + switchboard.addConnection(a,tr("Edit","Shortcut group")); addAction(a); actionListBranches.append(a); connect( a, SIGNAL( triggered() ), this, SLOT( editOpenMultipleVisURLTabs() ) ); @@ -799,6 +856,7 @@ a = new QAction( tr( "Open all URLs in subtree","Edit menu" ), this); a->setStatusTip (tr( "Open all URLs in subtree" )); + switchboard.addConnection(a,tr("Edit","Shortcut group")); addAction(a); actionListBranches.append(a); connect( a, SIGNAL( triggered() ), this, SLOT( editOpenMultipleURLTabs() ) ); @@ -808,6 +866,7 @@ a->setStatusTip ( tr( "Edit URL" ) ); a->setShortcut ( Qt::Key_U ); a->setShortcutContext (Qt::WindowShortcut); + switchboard.addConnection(a,tr("Edit","Shortcut group")); actionListBranches.append(a); addAction(a); connect( a, SIGNAL( triggered() ), this, SLOT( editURL() ) ); @@ -817,6 +876,7 @@ a->setStatusTip ( tr( "Edit local URL" ) ); //a->setShortcut (Qt::SHIFT + Qt::Key_U ); a->setShortcutContext (Qt::WindowShortcut); + switchboard.addConnection(a,tr("Edit","Shortcut group")); actionListBranches.append(a); addAction(a); connect( a, SIGNAL( triggered() ), this, SLOT( editLocalURL() ) ); @@ -825,6 +885,7 @@ a = new QAction( tr( "Use heading for URL","Edit menu" ), this); a->setStatusTip ( tr( "Use heading of selected branch as URL" )); a->setEnabled (false); + switchboard.addConnection(a,tr("Edit","Shortcut group")); actionListBranches.append(a); connect( a, SIGNAL( triggered() ), this, SLOT( editHeading2URL() ) ); actionHeading2URL=a; @@ -835,6 +896,7 @@ actionListBranches.append(a); a->setShortcut ( Qt::Key_B ); a->setShortcutContext (Qt::WindowShortcut); + switchboard.addConnection(a,tr("Edit","Shortcut group")); addAction(a); connect( a, SIGNAL( triggered() ), this, SLOT( editBugzilla2URL() ) ); actionBugzilla2URL=a; @@ -845,6 +907,7 @@ actionListBranches.append(a); a->setShortcut ( Qt::Key_B + Qt::SHIFT); a->setShortcutContext (Qt::WindowShortcut); + switchboard.addConnection(a,tr("Edit","Shortcut group")); addAction(a); connect( a, SIGNAL( triggered() ), this, SLOT( getBugzillaData() ) ); actionGetBugzillaData=a; @@ -852,6 +915,7 @@ a = new QAction(tr( "Create URL to Novell FATE","Edit menu" ), this); a->setStatusTip ( tr( "Create URL to Novell FATE" )); a->setEnabled (false); + switchboard.addConnection(a,tr("Edit","Shortcut group")); actionListBranches.append(a); connect( a, SIGNAL( triggered() ), this, SLOT( editFATE2URL() ) ); actionFATE2URL=a; @@ -860,12 +924,14 @@ a->setStatusTip ( tr( "Jump to another vym map, if needed load it first" )); tb->addAction (a); a->setEnabled (false); + switchboard.addConnection(a,tr("Edit","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( editOpenVymLink() ) ); actionOpenVymLink=a; a = new QAction(QPixmap(), tr( "Open all vym links in subtree","Edit menu" ), this); a->setStatusTip ( tr( "Open all vym links in subtree" )); a->setEnabled (false); + switchboard.addConnection(a,tr("Edit","Shortcut group")); actionListBranches.append(a); connect( a, SIGNAL( triggered() ), this, SLOT( editOpenMultipleVymLinks() ) ); actionOpenMultipleVymLinks=a; @@ -874,6 +940,7 @@ a = new QAction(tr( "Edit vym link...","Edit menu" ), this); a->setEnabled (false); a->setStatusTip ( tr( "Edit link to another vym map" )); + switchboard.addConnection(a,tr("Edit","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( editVymLink() ) ); actionListBranches.append(a); actionVymLink=a; @@ -881,6 +948,7 @@ a = new QAction(tr( "Delete vym link","Edit menu" ),this); a->setStatusTip ( tr( "Delete link to another vym map" )); a->setEnabled (false); + switchboard.addConnection(a,tr("Edit","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteVymLink() ) ); actionDeleteVymLink=a; @@ -890,6 +958,7 @@ a->setToggleAction(true); tb->addAction (a); a->setEnabled (false); + switchboard.addConnection(a,tr("Edit","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( editToggleHideExport() ) ); actionToggleHideExport=a; @@ -899,6 +968,7 @@ actionListBranches.append(a); a->setShortcut ( Qt::Key_T ); // Add timestamp a->setShortcutContext (Qt::WindowShortcut); + switchboard.addConnection(a,tr("Edit","Shortcut group")); addAction(a); connect( a, SIGNAL( triggered() ), this, SLOT( editAddTimestamp() ) ); actionAddTimestamp=a; @@ -906,6 +976,7 @@ a = new QAction(tr( "Edit Map Info...","Edit menu" ),this); a->setStatusTip ( tr( "Edit Map Info" )); a->setEnabled (true); + switchboard.addConnection(a,tr("Edit","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( editMapInfo() ) ); actionMapInfo=a; @@ -914,12 +985,14 @@ a->setStatusTip (tr( "Add map at selection" )); connect( a, SIGNAL( triggered() ), this, SLOT( editImportAdd() ) ); a->setEnabled (false); + switchboard.addConnection(a,tr("Edit","Shortcut group")); actionListBranches.append(a); actionImportAdd=a; // Import at selection (replacing selection) a = new QAction( tr( "Add map (replace)","Edit menu" ), this); a->setStatusTip (tr( "Replace selection with map" )); + switchboard.addConnection(a,tr("Edit","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( editImportReplace() ) ); a->setEnabled (false); actionListBranches.append(a); @@ -930,6 +1003,7 @@ a->setStatusTip (tr( "Save selection" )); connect( a, SIGNAL( triggered() ), this, SLOT( editSaveBranch() ) ); a->setEnabled (false); + switchboard.addConnection(a,tr("Edit","Shortcut group")); actionListBranches.append(a); actionSaveBranch=a; @@ -939,6 +1013,7 @@ a->setShortcut (Qt::ALT + Qt::Key_Delete ); connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteKeepChildren() ) ); a->setEnabled (false); + switchboard.addConnection(a,tr("Edit","Shortcut group")); addAction (a); actionListBranches.append(a); actionDeleteKeepChildren=a; @@ -947,6 +1022,7 @@ a = new QAction( tr( "Remove children","Edit menu" ), this); a->setStatusTip (tr( "Remove children of branch" )); a->setShortcut (Qt::SHIFT + Qt::Key_Delete ); + switchboard.addConnection(a,tr("Edit","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteChildren() ) ); a->setEnabled (false); actionListBranches.append(a); @@ -954,6 +1030,7 @@ a = new QAction( tr( "Add Image...","Edit menu" ), this); a->setStatusTip (tr( "Add Image" )); + switchboard.addConnection(a,tr("Edit","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( editLoadImage() ) ); actionLoadImage=a; @@ -962,6 +1039,7 @@ a->setShortcut ( Qt::CTRL + Qt::Key_I ); //Property window a->setShortcutContext (Qt::WindowShortcut); a->setToggleAction (true); + switchboard.addConnection(a,tr("View shortcuts","Shortcut group")); addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( windowToggleProperty() ) ); actionViewTogglePropertyWindow=a; @@ -1090,34 +1168,36 @@ tb->setObjectName ("viewTB"); QMenu *viewMenu = menuBar()->addMenu ( tr( "&View" )); - Switchboard switchboard; //FIXME-2 testing... QAction *a; a = new QAction(QPixmap(iconPath+"viewmag-reset.png"), tr( "reset Zoom","View action" ), this); a->setStatusTip ( tr( "Zoom reset" ) ); a->setShortcut (Qt::CTRL + Qt::Key_0); // Reset zoom - switchboard.addConnection(a,"CTRL+0"); + switchboard.addConnection(a,tr("View shortcuts","Shortcut group")); a->addTo( tb ); viewMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT(viewZoomReset() ) ); a = new QAction( QPixmap(iconPath+"viewmag+.png"), tr( "Zoom in","View action" ), this); a->setStatusTip (tr( "Zoom in" )); - switchboard.addConnection(a,"CTRL++"); + a->setShortcut(Qt::CTRL + Qt::Key_Plus); + switchboard.addConnection(a,tr("View shortcuts","Shortcut group")); a->addTo( tb ); viewMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT(viewZoomIn() ) ); a = new QAction( QPixmap(iconPath+"viewmag-.png"), tr( "Zoom out","View action" ), this); a->setStatusTip (tr( "Zoom out" )); - switchboard.addConnection(a,"CTRL+-"); + a->setShortcut(Qt::CTRL + Qt::Key_Minus); + switchboard.addConnection(a,tr("View shortcuts","Shortcut group")); a->addTo( tb ); viewMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( viewZoomOut() ) ); a = new QAction( QPixmap(iconPath+"viewshowsel.png"), tr( "Show selection","View action" ), this); a->setStatusTip (tr( "Show selection" )); - switchboard.addConnection(a,"."); + a->setShortcut(Qt::CTRL + Qt::Key_Period); + switchboard.addConnection(a,tr("View shortcuts","Shortcut group")); a->addTo( tb ); viewMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( viewCenter() ) ); @@ -1127,6 +1207,7 @@ a = new QAction(QPixmap(flagsPath+"flag-note.png"), tr( "Show Note Editor","View action" ),this); a->setStatusTip ( tr( "Show Note Editor" )); a->setShortcut ( Qt::CTRL + Qt::Key_E ); // Toggle Note Editor + switchboard.addConnection(a,tr("View shortcuts","Shortcut group")); a->setToggleAction(true); a->addTo( tb ); viewMenu->addAction (a); @@ -1135,7 +1216,8 @@ a = new QAction(QPixmap(), tr( "Show tree editor","View action" ),this); a->setStatusTip ( tr( "Show tree editor" )); - a->setShortcut ( Qt::CTRL + Qt::Key_T ); // Toggle Note Editor // FIXME-3 originally: color subtree + a->setShortcut ( Qt::CTRL + Qt::Key_T ); // Toggle Tree Editor // FIXME-3 originally: color subtree + switchboard.addConnection(a,tr("View shortcuts","Shortcut group")); a->setToggleAction(true); a->addTo( tb ); viewMenu->addAction (a); @@ -1145,6 +1227,7 @@ a = new QAction(QPixmap(iconPath+"history.png"), tr( "History Window","View action" ),this ); a->setStatusTip ( tr( "Show History Window" )); a->setShortcut ( Qt::CTRL + Qt::Key_H ); // Toggle history window + switchboard.addConnection(a,tr("View shortcuts","Shortcut group")); a->setToggleAction(true); a->addTo( tb ); viewMenu->addAction (a); @@ -1159,6 +1242,7 @@ a->setStatusTip ( tr( "Antialiasing" )); a->setToggleAction(true); a->setChecked (settings.value("/mainwindow/view/AntiAlias",true).toBool()); + switchboard.addConnection(a,tr("View shortcuts","Shortcut group")); viewMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleAntiAlias() ) ); actionViewToggleAntiAlias=a; @@ -1167,6 +1251,7 @@ a->setStatusTip (a->text()); a->setToggleAction(true); a->setChecked (settings.value("/mainwindow/view/SmoothPixmapTransformation",true).toBool()); + switchboard.addConnection(a,tr("View shortcuts","Shortcut group")); viewMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleSmoothPixmap() ) ); actionViewToggleSmoothPixmapTransform=a; @@ -1174,16 +1259,16 @@ a = new QAction(tr( "Next Map","View action" ), this); a->setStatusTip (a->text()); a->setShortcut (Qt::ALT + Qt::Key_N ); + switchboard.addConnection(a,tr("View shortcuts","Shortcut group")); viewMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT(windowNextEditor() ) ); a = new QAction (tr( "Previous Map","View action" ), this ); a->setStatusTip (a->text()); a->setShortcut (Qt::ALT + Qt::Key_P ); + switchboard.addConnection(a,tr("View shortcuts","Shortcut group")); viewMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT(windowPreviousEditor() ) ); - - if (debug) switchboard.print(); } // Mode Actions @@ -1199,6 +1284,7 @@ actionGroupModModes->setExclusive (true); a= new QAction( QPixmap(iconPath+"modecolor.png"), tr( "Use modifier to color branches","Mode modifier" ), actionGroupModModes); a->setShortcut (Qt::Key_J); + switchboard.addConnection(a,tr("Modes","Shortcut group")); a->setStatusTip ( tr( "Use modifier to color branches" )); a->setToggleAction(true); a->addTo (tb); @@ -1207,6 +1293,7 @@ a= new QAction( QPixmap(iconPath+"modecopy.png"), tr( "Use modifier to copy","Mode modifier" ), actionGroupModModes ); a->setShortcut( Qt::Key_K); + switchboard.addConnection(a,tr("Modes","Shortcut group")); a->setStatusTip( tr( "Use modifier to copy" )); a->setToggleAction(true); a->addTo (tb); @@ -1214,6 +1301,7 @@ a= new QAction(QPixmap(iconPath+"modelink.png"), tr( "Use modifier to draw xLinks","Mode modifier" ), actionGroupModModes ); a->setShortcut (Qt::Key_L); + switchboard.addConnection(a,tr("Modes","Shortcut group")); a->setStatusTip( tr( "Use modifier to draw xLinks" )); a->setToggleAction(true); a->addTo (tb); @@ -1458,12 +1546,14 @@ a = new QAction( "Start TCPserver for MapEditor",this); //a->setStatusTip ( "Set application to open pdf files")); //a->setShortcut ( Qt::ALT + Qt::Key_T ); //New TCP server + switchboard.addConnection(a,tr("Network shortcuts","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( networkStartServer() ) ); netMenu->addAction (a); a = new QAction( "Connect MapEditor to server",this); //a->setStatusTip ( "Set application to open pdf files")); a->setShortcut ( Qt::ALT + Qt::Key_C ); // Connect to server + switchboard.addConnection(a,tr("Network shortcuts","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( networkConnect() ) ); netMenu->addAction (a); } @@ -1582,17 +1672,20 @@ a = new QAction( "Test function 1" , this); a->setStatusTip( "Call test function 1" ); a->setShortcut (Qt::SHIFT + Qt::Key_T); // Test function 1 + switchboard.addConnection(a,tr("Test shortcuts","Shortcut group")); testMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( testFunction1() ) ); a = new QAction( "Test function 2" , this); a->setStatusTip( "Call test function 2" ); a->setShortcut (Qt::ALT + Qt::Key_T); // Test function 2 + switchboard.addConnection(a,tr("Test shortcuts","Shortcut group")); testMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( testFunction2() ) ); a = new QAction( "Command" , this); a->setStatusTip( "Enter command to call in editor" ); + switchboard.addConnection(a,tr("Test shortcuts","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( testCommand() ) ); testMenu->addAction (a); } @@ -1605,11 +1698,13 @@ QAction *a; a = new QAction( tr( "Open VYM Documentation (pdf) ","Help action" ), this ); a->setStatusTip( tr( "Open VYM Documentation (pdf)" )); + switchboard.addConnection(a,tr("Help shortcuts","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( helpDoc() ) ); helpMenu->addAction (a); a = new QAction( tr( "Open VYM example maps ","Help action" ), this ); a->setStatusTip( tr( "Open VYM example maps " )); + switchboard.addConnection(a,tr("Help shortcuts","Shortcut group")); connect( a, SIGNAL( triggered() ), this, SLOT( helpDemo() ) ); helpMenu->addAction (a); @@ -1758,6 +1853,7 @@ macroActions[i] = new QAction(this); macroActions[i]->setData(i); addAction (macroActions[i]); + //switchboard.addConnection(macroActions[i],tr("Macro shortcuts","Shortcut group")); connect(macroActions[i], SIGNAL(triggered()), this, SLOT(callMacro())); } diff -r 0bba81dde1bc -r 36eb4b8f409e mainwindow.h --- a/mainwindow.h Fri Feb 19 13:47:03 2010 +0000 +++ b/mainwindow.h Thu Feb 25 11:03:52 2010 +0000 @@ -11,6 +11,7 @@ #include "file.h" #include "historywindow.h" #include "mapeditor.h" +#include "shortcuts.h" #include "simplescripteditor.h" #include "texteditor.h" #include "vymview.h" @@ -280,6 +281,8 @@ QAction *macroActions[12]; QStringList macro; + Switchboard switchboard; + QAction* actionFileNewCopy; QAction* actionFileSave; QAction* actionFilePrint; diff -r 0bba81dde1bc -r 36eb4b8f409e mapeditor.cpp --- a/mapeditor.cpp Fri Feb 19 13:47:03 2010 +0000 +++ b/mapeditor.cpp Thu Feb 25 11:03:52 2010 +0000 @@ -1527,7 +1527,10 @@ } // Draw the original link, before selection was moved around - if (settings.value("/animation/use",true).toBool() && seli->depth()>1) + if (settings.value("/animation/use",true).toBool() + && seli->depth()>1 +// && distance (lmosel->getRelPos(),movingObj_orgRelPos)<3 + ) { lmosel->setRelPos(); // calc relPos first for starting point diff -r 0bba81dde1bc -r 36eb4b8f409e shortcuts.cpp --- a/shortcuts.cpp Fri Feb 19 13:47:03 2010 +0000 +++ b/shortcuts.cpp Thu Feb 25 11:03:52 2010 +0000 @@ -1,8 +1,11 @@ -#include "shortcuts.h" +#include <QDebug> +#include <QMultiMap> #include <iostream> using namespace std; +#include "shortcuts.h" + ///////////////////////////////////////////////////////////////// // Shortcut ///////////////////////////////////////////////////////////////// @@ -17,20 +20,24 @@ { } -void Switchboard::addConnection (QAction *a, const QString &desc) +void Switchboard::addConnection (QAction *a, const QString &group) { - QKeySequence ks=QKeySequence::fromString (desc); - actions.append (a); - if (!desc.isEmpty()) keys.append (new QKeySequence (ks)); - if (a) a->setShortcut (ks); + actions.insert(group,a); } void Switchboard::print () { - for (int i=0;i<actions.size();++i) + QString g; + foreach (g,actions.uniqueKeys()) { - cout <<actions.at(i)->shortcut().toString().toStdString(); - cout << " Action: " <<actions.at(i)->text().toStdString(); + cout <<"Group: "<<g.toStdString()<<endl; + QList <QAction*> values=actions.values(g); + for (int i=0;i<values.size();++i) + { + cout<<QString (" %1: %2") + .arg(values.at(i)->text().left(30),30) + .arg(values.at(i)->shortcut().toString()).toStdString()<<endl; + } cout <<endl; } } diff -r 0bba81dde1bc -r 36eb4b8f409e shortcuts.h --- a/shortcuts.h Fri Feb 19 13:47:03 2010 +0000 +++ b/shortcuts.h Thu Feb 25 11:03:52 2010 +0000 @@ -22,11 +22,9 @@ public: Switchboard (); void addConnection(QAction *a,const QString &s); -// void addFunction (Function, void print(); protected: - QList <QKeySequence*> keys; - QList <QAction*> actions; + QMultiMap <QString,QAction*> actions; }; #endif diff -r 0bba81dde1bc -r 36eb4b8f409e version.h --- a/version.h Fri Feb 19 13:47:03 2010 +0000 +++ b/version.h Thu Feb 25 11:03:52 2010 +0000 @@ -7,7 +7,7 @@ #define __VYM_VERSION "1.13.0" //#define __VYM_CODENAME "Codename: RC-1" #define __VYM_CODENAME "Codename: development version, not for production!" -#define __VYM_BUILD_DATE "2010-02-19" +#define __VYM_BUILD_DATE "2010-02-22" bool checkVersion(const QString &); diff -r 0bba81dde1bc -r 36eb4b8f409e vym.pro --- a/vym.pro Fri Feb 19 13:47:03 2010 +0000 +++ b/vym.pro Thu Feb 25 11:03:52 2010 +0000 @@ -44,6 +44,8 @@ bugagent.h \ editxlinkdialog.h \ exportoofiledialog.h \ + exporthtmldialog.h\ + exporthtmldialog.h\ exportxhtmldialog.h\ exports.h \ extrainfodialog.h \ @@ -111,6 +113,7 @@ editxlinkdialog.cpp \ exportoofiledialog.cpp \ exports.cpp \ + exporthtmldialog.cpp \ exportxhtmldialog.cpp \ extrainfodialog.cpp \ file.cpp \ @@ -165,6 +168,7 @@ FORMS = \ attributewidget.ui \ branchpropwindow.ui \ + exporthtmldialog.ui \ exportxhtmldialog.ui \ extrainfodialog.ui \ editxlinkdialog.ui \ diff -r 0bba81dde1bc -r 36eb4b8f409e vymmodel.cpp --- a/vymmodel.cpp Fri Feb 19 13:47:03 2010 +0000 +++ b/vymmodel.cpp Thu Feb 25 11:03:52 2010 +0000 @@ -9,6 +9,7 @@ #include "bugagent.h" #include "editxlinkdialog.h" #include "exports.h" +#include "exporthtmldialog.h" #include "exportxhtmldialog.h" #include "file.h" #include "geometry.h" // for addBBox @@ -4259,7 +4260,7 @@ void VymModel::exportHTML (const QString &dir, bool askForName) //FIXME-2 own dialogue missing and also option to save settings in map { - ExportXHTMLDialog dia(NULL); + ExportHTMLDialog dia(NULL); dia.setFilePath (filePath ); dia.setMapName (mapName ); dia.readSettings(); @@ -4297,11 +4298,11 @@ ExportHTML ex (this); ex.setFile (d.path()+"/"+mapName+".html"); - cout << "VM::exportHTML writing "<<ex.getFile().toStdString()<<endl; + //qDebug()<< "VM::exportHTML writing "<<ex.getFile(); + ex.setCSSPath(dia.getCSSPath() ); ex.doExport(); setExportMode (false); - //exportXML (dia.getDir(),false ); //dia.doExport(mapName ); //if (dia.hasChanged()) setChanged(); @@ -4694,7 +4695,7 @@ } -void VymModel::animate() +void VymModel::animate() //FIXME-2 animation causes flicker after cut/undo cut ?!? { animationTimer->stop(); BranchObj *bo; @@ -4723,6 +4724,7 @@ void VymModel::startAnimation(BranchObj *bo, const QPointF &start, const QPointF &dest) { + qDebug()<<"Start animation for "<<bo->getTreeItem()<<getHeading(); if (start==dest) return; if (bo && bo->getTreeItem()->depth()>0) {