X-Git-Url: https://git.sven.stormbind.net/?a=blobdiff_plain;f=shortcuts.cpp;fp=shortcuts.cpp;h=0000000000000000000000000000000000000000;hb=d483bd8e6523c23c6f1d8908a2e0611c2bc9ff4f;hp=ae8b4a4802afe99962939b3a28e4fa032f324827;hpb=7dfa3fe589d1722d49681f42cdb0bf1e6efb5223;p=sven%2Fvym.git diff --git a/shortcuts.cpp b/shortcuts.cpp deleted file mode 100644 index ae8b4a4..0000000 --- a/shortcuts.cpp +++ /dev/null @@ -1,113 +0,0 @@ -#include -#include - -#include -using namespace std; - -#include "shortcuts.h" - -///////////////////////////////////////////////////////////////// -// KeySwitch -///////////////////////////////////////////////////////////////// -KeySwitch::KeySwitch ( - const QString &kIdentifier, - const QString &kName, - const QString &kGroup, - const QString &kTag, - const QKeySequence &kseq) -{ - identifier = kIdentifier; - name = kName; - group = kGroup; - tag = kTag; - keySequence = kseq; -} - -///////////////////////////////////////////////////////////////// -// Switchboard -///////////////////////////////////////////////////////////////// -Switchboard::Switchboard () -{ -} - -void Switchboard::addGroup( QString gIdentifier, QString gName) -{ - if (groups.contains(gIdentifier)) - { - qDebug() << "Warning switchboard: Shortcut group " << gIdentifier << " already exists"; - return; - } - groups.insert(gIdentifier, gName); -} - -void Switchboard::addSwitch( QString identifier, QString scope, QAction *action, QString tag) -{ - if (!switches.contains(identifier)) - { - KeySwitch ksw(identifier, action->text(), scope, tag, action->shortcut()); - switches.insert(scope, ksw); - } else - qDebug() << "Warning switchboard::addSwitch warning: Existing idenifier " << identifier; -} - -QString Switchboard::getASCII() -{ - QString s; - QString g; - foreach (g, switches.uniqueKeys()) - { - s += "Scope " + g +":\n"; - QList values=switches.values(g); - for (int i=0; i values=actions.values(g); - for (int i=0;itext(); - QString sc=values.at(i)->shortcut().toString(); - desc=desc.remove('&'); - desc=desc.remove("..."); - s+= QString(" %1: %2\n").arg(sc,12).arg(desc); - } - } - */ - return s; -} - -void Switchboard::printASCII () -{ - cout < values=actions.values(g); - for (int i=0;ishortcut().toString().isEmpty()) - { - QString desc=values.at(i)->text(); - QString sc=values.at(i)->shortcut().toString(); - desc=desc.remove('&'); - desc=desc.remove("..."); - cout << qPrintable( QString(" %1& %2").arg(sc,12).arg(desc) )<