# HG changeset patch # User insilmaril # Date 1258446299 0 # Node ID 2a33304714baca715e5ca93a8d19597b4b47cd99 # Parent fc7a93ff97c3379c79cd56f512ff12570b9324a9 added shortcuts.h and .cpp diff -r fc7a93ff97c3 -r 2a33304714ba main.cpp --- a/main.cpp Mon Nov 16 09:47:10 2009 +0000 +++ b/main.cpp Tue Nov 17 08:24:59 2009 +0000 @@ -26,6 +26,7 @@ QString vymVersion; QString vymBuildDate; QString vymCodeName; +QString vymInstanceName; Main *mainWindow; // used in BranchObj::select() @@ -70,6 +71,7 @@ options.add ("debug", Option::Switch, "d", "debug"); options.add ("version", Option::Switch, "v","version"); options.add ("local", Option::Switch, "l", "local"); + options.add ("name", Option::Switch, "n", "name"); options.add ("help", Option::Switch, "h", "help"); options.add ("quit", Option::Switch, "q", "quit"); options.add ("run", Option::String, "r", "run"); @@ -101,7 +103,13 @@ // Register for DBUS if (debug) cout << "PID="< +using namespace std; + +///////////////////////////////////////////////////////////////// +// Shortcut +///////////////////////////////////////////////////////////////// +Shortcut::Shortcut(QWidget *parent) :QShortcut (parent) +{ +} + +///////////////////////////////////////////////////////////////// +// Switchboard +///////////////////////////////////////////////////////////////// +Switchboard::Switchboard () +{ +} + +void Switchboard::addConnection (QAction *a, const QString &desc) +{ + QKeySequence ks=QKeySequence::fromString (desc); + actions.append (a); + if (!desc.isEmpty()) keys.append (new QKeySequence (ks)); + if (a) a->setShortcut (ks); +} + +void Switchboard::print () +{ + for (int i=0;ishortcut().toString().toStdString(); + cout << " Action: " <text().toStdString(); + cout < +#include +#include + +class Shortcut:public QShortcut { +public: + Shortcut(QWidget *parent=NULL); + void setGroup(const QString &); + QString getGroup (); + void setContextName (const QString &); + QString getContextName(); + +protected: + QString group; + QString context; +}; + +class Switchboard { +public: + Switchboard (); + void addConnection(QAction *a,const QString &s); +// void addFunction (Function, + void print(); +protected: + QList keys; + QList actions; +}; + +#endif diff -r fc7a93ff97c3 -r 2a33304714ba version.h --- a/version.h Mon Nov 16 09:47:10 2009 +0000 +++ b/version.h Tue Nov 17 08:24:59 2009 +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 "2009-11-12" +#define __VYM_BUILD_DATE "2009-11-16" bool checkVersion(const QString &); diff -r fc7a93ff97c3 -r 2a33304714ba vymview.cpp --- a/vymview.cpp Mon Nov 16 09:47:10 2009 +0000 +++ b/vymview.cpp Tue Nov 17 08:24:59 2009 +0000 @@ -127,7 +127,7 @@ mainWindow->changeSelection (model,newsel,oldsel); // FIXME-5 maybe connect VymModel <-> MainWindow directly? // would require to also get current model in mainWindow - cout << "VV::changeSelection newsel.count="<