Removed 2nd arg from ShortcutsSettings::getShortcut
This commit is contained in:
parent
1ca89e0b09
commit
d3d6f70496
12 changed files with 117 additions and 196 deletions
|
@ -66,17 +66,9 @@ void AbstractCounter::retranslateUi()
|
|||
void AbstractCounter::setShortcutsActive()
|
||||
{
|
||||
if (name == "life") {
|
||||
aSet->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aSet",
|
||||
QKeySequence("Ctrl+L")));
|
||||
|
||||
aDec->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aDec",
|
||||
QKeySequence("F11")));
|
||||
|
||||
aInc->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aInc",
|
||||
QKeySequence("F12")));
|
||||
aSet->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aSet"));
|
||||
aDec->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aDec"));
|
||||
aInc->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aInc"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,8 +19,7 @@ DlgLoadDeckFromClipboard::DlgLoadDeckFromClipboard(QWidget *parent)
|
|||
|
||||
refreshButton = new QPushButton(tr("&Refresh"));
|
||||
refreshButton->setShortcut(settingsCache->shortcuts().getSingleShortcut(
|
||||
"DlgLoadDeckFromClipboard/refreshButton",
|
||||
QKeySequence("F5")));
|
||||
"DlgLoadDeckFromClipboard/refreshButton"));
|
||||
connect(refreshButton, SIGNAL(clicked()), this, SLOT(actRefresh()));
|
||||
|
||||
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||
|
|
|
@ -21,8 +21,7 @@ GameView::GameView(QGraphicsScene *scene, QWidget *parent)
|
|||
|
||||
aCloseMostRecentZoneView = new QAction(this);
|
||||
aCloseMostRecentZoneView->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aCloseMostRecentZoneView",
|
||||
QKeySequence("Esc")));
|
||||
"Player/aCloseMostRecentZoneView"));
|
||||
connect(aCloseMostRecentZoneView, SIGNAL(triggered()), scene, SLOT(closeMostRecentZoneView()));
|
||||
addAction(aCloseMostRecentZoneView);
|
||||
|
||||
|
|
|
@ -683,79 +683,61 @@ void Player::retranslateUi()
|
|||
}
|
||||
|
||||
aPlay->setText(tr("&Play"));
|
||||
aPlay->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aPlay", QKeySequence()));
|
||||
aPlay->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aPlay"));
|
||||
|
||||
aHide->setText(tr("&Hide"));
|
||||
aPlayFacedown->setText(tr("Play &Face Down"));
|
||||
|
||||
aTap->setText(tr("&Tap"));
|
||||
aTap->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aTap", QKeySequence()));
|
||||
aTap->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aTap"));
|
||||
|
||||
aUntap->setText(tr("&Untap"));
|
||||
aUntap->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aUntap", QKeySequence()));
|
||||
aUntap->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aUntap"));
|
||||
|
||||
aDoesntUntap->setText(tr("Toggle &normal untapping"));
|
||||
aDoesntUntap->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aDoesntUntap", QKeySequence()));
|
||||
aDoesntUntap->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aDoesntUntap"));
|
||||
|
||||
aFlip->setText(tr("&Flip"));
|
||||
aFlip->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aFlip", QKeySequence()));
|
||||
aFlip->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aFlip"));
|
||||
|
||||
aPeek->setText(tr("&Peek at card face"));
|
||||
aPeek->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aPeek", QKeySequence()));
|
||||
aPeek->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aPeek"));
|
||||
|
||||
aClone->setText(tr("&Clone"));
|
||||
aClone->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aClone", QKeySequence("Ctrl+J")));
|
||||
aClone->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aClone"));
|
||||
|
||||
aAttach->setText(tr("Attac&h to card..."));
|
||||
aAttach->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aAttach", QKeySequence("Ctrl+A")));
|
||||
aAttach->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aAttach"));
|
||||
|
||||
aUnattach->setText(tr("Unattac&h"));
|
||||
aUnattach->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aUnattach", QKeySequence()));
|
||||
aUnattach->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aUnattach"));
|
||||
|
||||
aDrawArrow->setText(tr("&Draw arrow..."));
|
||||
aDrawArrow->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aDrawArrow", QKeySequence()));
|
||||
aDrawArrow->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aDrawArrow"));
|
||||
|
||||
aIncP->setText(tr("&Increase power"));
|
||||
aIncP->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/IncP", QKeySequence("Ctrl++")));
|
||||
aIncP->setShortcuts(settingsCache->shortcuts().getShortcut("Player/IncP"));
|
||||
|
||||
aDecP->setText(tr("&Decrease power"));
|
||||
aDecP->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aDecP", QKeySequence("Ctrl+-")));
|
||||
aDecP->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aDecP"));
|
||||
|
||||
aIncT->setText(tr("I&ncrease toughness"));
|
||||
aIncT->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aIncT", QKeySequence("Alt++")));
|
||||
aIncT->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aIncT"));
|
||||
|
||||
aDecT->setText(tr("D&ecrease toughness"));
|
||||
aDecT->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aDecT", QKeySequence("Alt+-")));
|
||||
aDecT->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aDecT"));
|
||||
|
||||
aIncPT->setText(tr("In&crease power and toughness"));
|
||||
aIncPT->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aIncPT", QKeySequence("Ctrl+Alt++")));
|
||||
aIncPT->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aIncPT"));
|
||||
|
||||
aDecPT->setText(tr("Dec&rease power and toughness"));
|
||||
aDecPT->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aDecPT", QKeySequence("Ctrl+Alt+-")));
|
||||
aDecPT->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aDecPT"));
|
||||
|
||||
aSetPT->setText(tr("Set &power and toughness..."));
|
||||
aSetPT->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aSetPT", QKeySequence("Ctrl+P")));
|
||||
aSetPT->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aSetPT"));
|
||||
|
||||
aSetAnnotation->setText(tr("&Set annotation..."));
|
||||
aSetAnnotation->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aSetAnnotation", QKeySequence()));
|
||||
aSetAnnotation->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aSetAnnotation"));
|
||||
|
||||
QStringList counterColors;
|
||||
counterColors.append(tr("Red"));
|
||||
|
@ -764,27 +746,27 @@ void Player::retranslateUi()
|
|||
|
||||
QList<QKeySequence> addCCShortCuts;
|
||||
addCCShortCuts.append(settingsCache->shortcuts().getSingleShortcut(
|
||||
"Player/aCCRed", QKeySequence()));
|
||||
"Player/aCCRed"));
|
||||
addCCShortCuts.append(settingsCache->shortcuts().getSingleShortcut(
|
||||
"Player/aCCYellow", QKeySequence()));
|
||||
"Player/aCCYellow"));
|
||||
addCCShortCuts.append(settingsCache->shortcuts().getSingleShortcut(
|
||||
"Player/aCCGreen", QKeySequence()));
|
||||
"Player/aCCGreen"));
|
||||
|
||||
QList<QKeySequence> removeCCShortCuts;
|
||||
removeCCShortCuts.append(settingsCache->shortcuts().getSingleShortcut(
|
||||
"Player/aRCRed", QKeySequence()));
|
||||
"Player/aRCRed"));
|
||||
removeCCShortCuts.append(settingsCache->shortcuts().getSingleShortcut(
|
||||
"Player/aRCYellow", QKeySequence()));
|
||||
"Player/aRCYellow"));
|
||||
removeCCShortCuts.append(settingsCache->shortcuts().getSingleShortcut(
|
||||
"Player/aRCGreen", QKeySequence()));
|
||||
"Player/aRCGreen"));
|
||||
|
||||
QList<QKeySequence> setCCShortCuts;
|
||||
setCCShortCuts.append(settingsCache->shortcuts().getSingleShortcut(
|
||||
"Player/aSCRed", QKeySequence()));
|
||||
"Player/aSCRed"));
|
||||
setCCShortCuts.append(settingsCache->shortcuts().getSingleShortcut(
|
||||
"Player/aSCYellow", QKeySequence()));
|
||||
"Player/aSCYellow"));
|
||||
setCCShortCuts.append(settingsCache->shortcuts().getSingleShortcut(
|
||||
"Player/aSCGreen", QKeySequence()));
|
||||
"Player/aSCGreen"));
|
||||
|
||||
for (int i = 0; i < aAddCounter.size(); ++i){
|
||||
aAddCounter[i]->setText(tr("&Add counter (%1)").arg(counterColors[i]));
|
||||
|
@ -801,23 +783,23 @@ void Player::retranslateUi()
|
|||
|
||||
aMoveToTopLibrary->setText(tr("&Top of library"));
|
||||
aMoveToTopLibrary->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aMoveToTopLibrary", QKeySequence()));
|
||||
"Player/aMoveToTopLibrary"));
|
||||
|
||||
aMoveToBottomLibrary->setText(tr("&Bottom of library"));
|
||||
aMoveToBottomLibrary->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aMoveToBottomLibrary", QKeySequence()));
|
||||
"Player/aMoveToBottomLibrary"));
|
||||
|
||||
aMoveToHand->setText(tr("&Hand"));
|
||||
aMoveToHand->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aMoveToHand", QKeySequence()));
|
||||
"Player/aMoveToHand"));
|
||||
|
||||
aMoveToGraveyard->setText(tr("&Graveyard"));
|
||||
aMoveToGraveyard->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aMoveToGraveyard", QKeySequence("Ctrl+Del")));
|
||||
"Player/aMoveToGraveyard"));
|
||||
|
||||
aMoveToExile->setText(tr("&Exile"));
|
||||
aMoveToExile->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aMoveToExile", QKeySequence()));
|
||||
"Player/aMoveToExile"));
|
||||
|
||||
QMapIterator<QString, CardZone *> zoneIterator(zones);
|
||||
while (zoneIterator.hasNext())
|
||||
|
@ -829,52 +811,49 @@ void Player::setShortcutsActive()
|
|||
shortcutsActive = true;
|
||||
|
||||
aViewSideboard->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aViewSideboard", QKeySequence("Ctrl+F3")));
|
||||
"Player/aViewSideboard"));
|
||||
|
||||
aViewLibrary->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aViewLibrary", QKeySequence("F3")));
|
||||
"Player/aViewLibrary"));
|
||||
|
||||
aViewTopCards->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aViewTopCards", QKeySequence("Ctrl+W")));
|
||||
"Player/aViewTopCards"));
|
||||
|
||||
aViewGraveyard->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aViewGraveyard", QKeySequence("F4")));
|
||||
"Player/aViewGraveyard"));
|
||||
|
||||
aViewRfg->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aViewRfg", QKeySequence()));
|
||||
"Player/aViewRfg"));
|
||||
|
||||
aDrawCard->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aDrawCard", QKeySequence("Ctrl+D")));
|
||||
"Player/aDrawCard"));
|
||||
|
||||
aDrawCards->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aDrawCards", QKeySequence("Ctrl+E")));
|
||||
"Player/aDrawCards"));
|
||||
|
||||
aUndoDraw->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aUndoDraw", QKeySequence("Ctrl+Shift+D")));
|
||||
"Player/aUndoDraw"));
|
||||
|
||||
aMulligan->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aMulligan", QKeySequence("Ctrl+M")));
|
||||
"Player/aMulligan"));
|
||||
|
||||
aShuffle->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aShuffle", QKeySequence("Ctrl+S")));
|
||||
"Player/aShuffle"));
|
||||
|
||||
aUntapAll->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aUntapAll", QKeySequence("Ctrl+U")));
|
||||
"Player/aUntapAll"));
|
||||
|
||||
aRollDie->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aRollDie", QKeySequence("Ctrl+I")));
|
||||
"Player/aRollDie"));
|
||||
|
||||
aCreateToken->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aCreateToken",
|
||||
QKeySequence("Ctrl+T")));
|
||||
"Player/aCreateToken"));
|
||||
|
||||
aCreateAnotherToken->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aCreateAnotherToken",
|
||||
QKeySequence("Ctrl+G")));
|
||||
"Player/aCreateAnotherToken"));
|
||||
|
||||
aAlwaysRevealTopCard->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aAlwaysRevealTopCard",
|
||||
QKeySequence("Ctrl+N")));
|
||||
"Player/aAlwaysRevealTopCard"));
|
||||
|
||||
QMapIterator<int, AbstractCounter *> counterIterator(counters);
|
||||
while (counterIterator.hasNext())
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
#include <QKeyEvent>
|
||||
#include <QToolTip>
|
||||
|
||||
SecuenceEdit::SecuenceEdit(QString name, QWidget *parent) : QWidget(parent)
|
||||
SecuenceEdit::SecuenceEdit(QString _shorcutName, QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
this->shorcutName = name;
|
||||
shorcutName = _shorcutName;
|
||||
currentKey = 0;
|
||||
maxKeys = 4;
|
||||
keys = 0;
|
||||
|
@ -37,7 +37,7 @@ SecuenceEdit::SecuenceEdit(QString name, QWidget *parent) : QWidget(parent)
|
|||
connect(defaultButton,SIGNAL(clicked()),this,SLOT(restoreDefault()));
|
||||
lineEdit->installEventFilter(this);
|
||||
|
||||
lineEdit->setText(settingsCache->shortcuts().getShortcutString(name));
|
||||
lineEdit->setText(settingsCache->shortcuts().getShortcutString(shorcutName));
|
||||
}
|
||||
|
||||
QString SecuenceEdit::getSecuence()
|
||||
|
|
|
@ -12,7 +12,7 @@ class SecuenceEdit : public QWidget
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SecuenceEdit(QString shorcutName, QWidget *parent = 0);
|
||||
SecuenceEdit(QString _shorcutName, QWidget *parent = 0);
|
||||
QString getSecuence();
|
||||
signals:
|
||||
|
||||
|
|
|
@ -23,43 +23,20 @@ ShortcutsSettings::ShortcutsSettings(QString settingsPath, QObject *parent) : QO
|
|||
shortCuts.insert(*it, secuenceList);
|
||||
}
|
||||
shortCutsFile.endGroup();
|
||||
|
||||
shortCutsFile.beginGroup("Defaults");
|
||||
const QStringList defaultKeys = shortCutsFile.allKeys();
|
||||
for(QStringList::const_iterator it = defaultKeys.constBegin(); it != defaultKeys.constEnd(); ++it)
|
||||
{
|
||||
QString stringSecuence = shortCutsFile.value(*it).toString();
|
||||
QList<QKeySequence> secuenceList = parseSecuenceString(stringSecuence);
|
||||
defaultShortCuts.insert(*it, secuenceList);
|
||||
}
|
||||
shortCutsFile.endGroup();
|
||||
}
|
||||
}
|
||||
|
||||
QList<QKeySequence> ShortcutsSettings::getShortcut(QString name, QList<QKeySequence> defaultShortCut)
|
||||
QList<QKeySequence> ShortcutsSettings::getShortcut(QString name)
|
||||
{
|
||||
if(shortCuts.contains(name))
|
||||
return shortCuts.value(name);
|
||||
|
||||
setShortcuts(name, defaultShortCut);
|
||||
|
||||
defaultShortCuts[name] = defaultShortCut;
|
||||
|
||||
QSettings shortCutsFile(settingsFilePath, QSettings::IniFormat);
|
||||
shortCutsFile.beginGroup("Defaults");
|
||||
shortCutsFile.setValue(name, stringifySecuence(defaultShortCut));
|
||||
shortCutsFile.endGroup();
|
||||
return defaultShortCut;
|
||||
return defaultShortCuts.value(name, QList<QKeySequence>());
|
||||
}
|
||||
|
||||
QList<QKeySequence> ShortcutsSettings::getShortcut(QString name, QKeySequence defaultShortCut)
|
||||
QKeySequence ShortcutsSettings::getSingleShortcut(QString name)
|
||||
{
|
||||
return getShortcut(name, QList<QKeySequence>() << defaultShortCut);
|
||||
}
|
||||
|
||||
QKeySequence ShortcutsSettings::getSingleShortcut(QString name, QKeySequence defaultShortCut)
|
||||
{
|
||||
return getShortcut(name,defaultShortCut).at(0);
|
||||
return getShortcut(name).at(0);
|
||||
}
|
||||
|
||||
QString ShortcutsSettings::getDefaultShortcutString(QString name)
|
||||
|
@ -244,5 +221,7 @@ void ShortcutsSettings::fillDefaultShorcuts()
|
|||
defaultShortCuts["Player/phase7"] = parseSecuenceString("");
|
||||
defaultShortCuts["Player/phase8"] = parseSecuenceString("");
|
||||
defaultShortCuts["Player/phase9"] = parseSecuenceString("F9");
|
||||
defaultShortCuts["tab_room/aClearChat"] = parseSecuenceString("F12");
|
||||
defaultShortCuts["DlgLoadDeckFromClipboard/refreshButton"] = parseSecuenceString("F5");
|
||||
}
|
||||
|
||||
|
|
|
@ -13,9 +13,8 @@ public:
|
|||
ShortcutsSettings(QString settingsFilePath, QObject *parent = 0);
|
||||
~ShortcutsSettings() { }
|
||||
|
||||
QList<QKeySequence> getShortcut(QString name, QList<QKeySequence> defaultShortCut);
|
||||
QList<QKeySequence> getShortcut(QString name, QKeySequence defaultShortCut);
|
||||
QKeySequence getSingleShortcut(QString name, QKeySequence defaultShortCut);
|
||||
QList<QKeySequence> getShortcut(QString name);
|
||||
QKeySequence getSingleShortcut(QString name);
|
||||
|
||||
QString getDefaultShortcutString(QString name);
|
||||
QString getShortcutString(QString name);
|
||||
|
|
|
@ -258,26 +258,23 @@ void TabDeckEditor::createMenus()
|
|||
aNewDeck = new QAction(QString(), this);
|
||||
connect(aNewDeck, SIGNAL(triggered()), this, SLOT(actNewDeck()));
|
||||
aNewDeck->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"TabDeckEditor/aNewDeck",
|
||||
QKeySequence::New));
|
||||
"TabDeckEditor/aNewDeck"));
|
||||
|
||||
aLoadDeck = new QAction(QString(), this);
|
||||
connect(aLoadDeck, SIGNAL(triggered()), this, SLOT(actLoadDeck()));
|
||||
aLoadDeck->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"TabDeckEditor/aLoadDeck",
|
||||
QKeySequence::Open));
|
||||
"TabDeckEditor/aLoadDeck"));
|
||||
|
||||
aSaveDeck = new QAction(QString(), this);
|
||||
connect(aSaveDeck, SIGNAL(triggered()), this, SLOT(actSaveDeck()));
|
||||
aSaveDeck->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"TabDeckEditor/aSaveDeck",
|
||||
QKeySequence::Save));
|
||||
"TabDeckEditor/aSaveDeck"));
|
||||
|
||||
aSaveDeckAs = new QAction(QString(), this);
|
||||
connect(aSaveDeckAs, SIGNAL(triggered()), this, SLOT(actSaveDeckAs()));
|
||||
aSaveDeckAs->setShortcuts(QKeySequence::SaveAs);
|
||||
aSaveDeckAs->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"TabDeckEditor/aSaveDeckAs", QKeySequence()));
|
||||
"TabDeckEditor/aSaveDeckAs"));
|
||||
|
||||
aOpenCustomsetsFolder = new QAction(QString(), this);
|
||||
connect(aOpenCustomsetsFolder, SIGNAL(triggered()), this, SLOT(actOpenCustomsetsFolder()));
|
||||
|
@ -285,49 +282,46 @@ void TabDeckEditor::createMenus()
|
|||
aLoadDeckFromClipboard = new QAction(QString(), this);
|
||||
connect(aLoadDeckFromClipboard, SIGNAL(triggered()), this, SLOT(actLoadDeckFromClipboard()));
|
||||
aLoadDeckFromClipboard->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"TabDeckEditor/aLoadDeckFromClipboard",
|
||||
QKeySequence::Paste));
|
||||
"TabDeckEditor/aLoadDeckFromClipboard"));
|
||||
|
||||
aSaveDeckToClipboard = new QAction(QString(), this);
|
||||
connect(aSaveDeckToClipboard, SIGNAL(triggered()), this, SLOT(actSaveDeckToClipboard()));
|
||||
aSaveDeckToClipboard->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"TabDeckEditor/aSaveDeckToClipboard",
|
||||
QKeySequence::Copy));
|
||||
"TabDeckEditor/aSaveDeckToClipboard"));
|
||||
|
||||
aPrintDeck = new QAction(QString(), this);
|
||||
connect(aPrintDeck, SIGNAL(triggered()), this, SLOT(actPrintDeck()));
|
||||
aPrintDeck->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"TabDeckEditor/aPrintDeck",QKeySequence::Print));
|
||||
"TabDeckEditor/aPrintDeck"));
|
||||
|
||||
aAnalyzeDeck = new QAction(QString(), this);
|
||||
connect(aAnalyzeDeck, SIGNAL(triggered()), this, SLOT(actAnalyzeDeck()));
|
||||
aAnalyzeDeck->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"TabDeckEditor/aAnalyzeDeck", QKeySequence()));
|
||||
"TabDeckEditor/aAnalyzeDeck"));
|
||||
|
||||
aClose = new QAction(QString(), this);
|
||||
connect(aClose, SIGNAL(triggered()), this, SLOT(closeRequest()));
|
||||
aClose->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"TabDeckEditor/aClose", QKeySequence()));
|
||||
aClose->setShortcuts(settingsCache->shortcuts().getShortcut("TabDeckEditor/aClose"));
|
||||
|
||||
aOpenCustomFolder = new QAction(QString(), this);
|
||||
connect(aOpenCustomFolder, SIGNAL(triggered()), this, SLOT(actOpenCustomFolder()));
|
||||
aOpenCustomFolder->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"TabDeckEditor/aOpenCustomFolder", QKeySequence()));
|
||||
"TabDeckEditor/aOpenCustomFolder"));
|
||||
|
||||
aEditSets = new QAction(QString(), this);
|
||||
connect(aEditSets, SIGNAL(triggered()), this, SLOT(actEditSets()));
|
||||
aEditSets->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"TabDeckEditor/aEditSets", QKeySequence()));
|
||||
"TabDeckEditor/aEditSets"));
|
||||
|
||||
aEditTokens = new QAction(QString(), this);
|
||||
connect(aEditTokens, SIGNAL(triggered()), this, SLOT(actEditTokens()));
|
||||
aEditTokens->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"TabDeckEditor/aEditTokens", QKeySequence()));
|
||||
"TabDeckEditor/aEditTokens"));
|
||||
|
||||
aResetLayout = new QAction(QString(), this);
|
||||
connect(aResetLayout,SIGNAL(triggered()),this,SLOT(restartLayout()));
|
||||
aResetLayout->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"TabDeckEditor/aResetLayout", QKeySequence()));
|
||||
"TabDeckEditor/aResetLayout"));
|
||||
|
||||
deckMenu = new QMenu(this);
|
||||
deckMenu->addAction(aNewDeck);
|
||||
|
@ -351,13 +345,13 @@ void TabDeckEditor::createMenus()
|
|||
aClearFilterAll->setIcon(QIcon(":/resources/icon_clearsearch.svg"));
|
||||
connect(aClearFilterAll, SIGNAL(triggered()), this, SLOT(actClearFilterAll()));
|
||||
aClearFilterAll->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"TabDeckEditor/aClearFilterAll", QKeySequence()));
|
||||
"TabDeckEditor/aClearFilterAll"));
|
||||
|
||||
aClearFilterOne = new QAction(QString(), this);
|
||||
aClearFilterOne->setIcon(QIcon(":/resources/decrement.svg"));
|
||||
connect(aClearFilterOne, SIGNAL(triggered()), this, SLOT(actClearFilterOne()));
|
||||
aClearFilterOne->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"TabDeckEditor/aClearFilterOne", QKeySequence()));
|
||||
"TabDeckEditor/aClearFilterOne"));
|
||||
|
||||
dbMenu = new QMenu(this);
|
||||
dbMenu->addAction(aEditSets);
|
||||
|
@ -560,8 +554,7 @@ void TabDeckEditor::retranslateUi()
|
|||
aClearFilterAll->setText(tr("&Clear all filters"));
|
||||
aClearFilterOne->setText(tr("Delete selected"));
|
||||
aClearFilterOne->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"TabDeckEditor/aClearFilterOne",
|
||||
QKeySequence("Backspace")));
|
||||
"TabDeckEditor/aClearFilterOne"));
|
||||
|
||||
nameLabel->setText(tr("Deck &name:"));
|
||||
commentsLabel->setText(tr("&Comments:"));
|
||||
|
@ -582,26 +575,22 @@ void TabDeckEditor::retranslateUi()
|
|||
aOpenCustomsetsFolder->setText(tr("Open custom sets folder"));
|
||||
aClose->setText(tr("&Close"));
|
||||
aClose->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"TabDeckEditor/aClose",
|
||||
QKeySequence("Ctrl+Q")));
|
||||
"TabDeckEditor/aClose"));
|
||||
|
||||
aAddCard->setText(tr("Add card to &maindeck"));
|
||||
aAddCardToSideboard->setText(tr("Add card to &sideboard"));
|
||||
|
||||
aRemoveCard->setText(tr("&Remove row"));
|
||||
aRemoveCard->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"TabDeckEditor/aRemoveCard",
|
||||
QKeySequence("Del")));
|
||||
"TabDeckEditor/aRemoveCard"));
|
||||
|
||||
aIncrement->setText(tr("&Increment number"));
|
||||
aIncrement->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"TabDeckEditor/aIncrement",
|
||||
QKeySequence("+")));
|
||||
"TabDeckEditor/aIncrement"));
|
||||
|
||||
aDecrement->setText(tr("&Decrement number"));
|
||||
aDecrement->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"TabDeckEditor/aDecrement",
|
||||
QKeySequence("-")));
|
||||
"TabDeckEditor/aDecrement"));
|
||||
|
||||
deckMenu->setTitle(tr("&Deck Editor"));
|
||||
dbMenu->setTitle(tr("C&ard Database"));
|
||||
|
|
|
@ -126,12 +126,10 @@ void DeckViewContainer::retranslateUi()
|
|||
{
|
||||
loadLocalButton->setText(tr("Load local deck"));
|
||||
loadLocalButton->setShortcut(settingsCache->shortcuts().getSingleShortcut(
|
||||
"DeckViewContainer/loadLocalButton",
|
||||
QKeySequence("Ctrl+O")));
|
||||
"DeckViewContainer/loadLocalButton"));
|
||||
loadRemoteButton->setText(tr("Load deck from server"));
|
||||
loadRemoteButton->setShortcut(settingsCache->shortcuts().getSingleShortcut(
|
||||
"DeckViewContainer/loadRemoteButton",
|
||||
QKeySequence("Ctrl+Alt+O")));
|
||||
"DeckViewContainer/loadRemoteButton"));
|
||||
readyStartButton->setText(tr("Ready to s&tart"));
|
||||
updateSideboardLockButtonText();
|
||||
}
|
||||
|
@ -473,17 +471,17 @@ TabGame::TabGame(TabSupervisor *_tabSupervisor, QList<AbstractClient *> &_client
|
|||
QAction *temp = new QAction(QString(), this);
|
||||
connect(temp, SIGNAL(triggered()), this, SLOT(actPhaseAction()));
|
||||
switch (i) {
|
||||
case 0: temp->setShortcuts(settingsCache->shortcuts().getShortcut("Player/phase0" ,QKeySequence("F5"))); break;
|
||||
case 1: temp->setShortcuts(settingsCache->shortcuts().getShortcut("Player/phase1" ,QKeySequence())); break;
|
||||
case 2: temp->setShortcuts(settingsCache->shortcuts().getShortcut("Player/phase2" ,QKeySequence("F6"))); break;
|
||||
case 3: temp->setShortcuts(settingsCache->shortcuts().getShortcut("Player/phase3" ,QKeySequence("F7"))); break;
|
||||
case 4: temp->setShortcuts(settingsCache->shortcuts().getShortcut("Player/phase4" ,QKeySequence("F8"))); break;
|
||||
case 5: temp->setShortcuts(settingsCache->shortcuts().getShortcut("Player/phase5" ,QKeySequence())); break;
|
||||
case 6: temp->setShortcuts(settingsCache->shortcuts().getShortcut("Player/phase6" ,QKeySequence())); break;
|
||||
case 7: temp->setShortcuts(settingsCache->shortcuts().getShortcut("Player/phase7" ,QKeySequence())); break;
|
||||
case 8: temp->setShortcuts(settingsCache->shortcuts().getShortcut("Player/phase8" ,QKeySequence())); break;
|
||||
case 9: temp->setShortcuts(settingsCache->shortcuts().getShortcut("Player/phase9" ,QKeySequence("F9"))); break;
|
||||
case 10:temp->setShortcuts(settingsCache->shortcuts().getShortcut("Player/phase10" ,QKeySequence("F10"))); break;
|
||||
case 0: temp->setShortcuts(settingsCache->shortcuts().getShortcut("Player/phase0")); break;
|
||||
case 1: temp->setShortcuts(settingsCache->shortcuts().getShortcut("Player/phase1")); break;
|
||||
case 2: temp->setShortcuts(settingsCache->shortcuts().getShortcut("Player/phase2")); break;
|
||||
case 3: temp->setShortcuts(settingsCache->shortcuts().getShortcut("Player/phase3")); break;
|
||||
case 4: temp->setShortcuts(settingsCache->shortcuts().getShortcut("Player/phase4")); break;
|
||||
case 5: temp->setShortcuts(settingsCache->shortcuts().getShortcut("Player/phase5")); break;
|
||||
case 6: temp->setShortcuts(settingsCache->shortcuts().getShortcut("Player/phase6")); break;
|
||||
case 7: temp->setShortcuts(settingsCache->shortcuts().getShortcut("Player/phase7")); break;
|
||||
case 8: temp->setShortcuts(settingsCache->shortcuts().getShortcut("Player/phase8")); break;
|
||||
case 9: temp->setShortcuts(settingsCache->shortcuts().getShortcut("Player/phase9")); break;
|
||||
case 10:temp->setShortcuts(settingsCache->shortcuts().getShortcut("Player/phase10")); break;
|
||||
default: ;
|
||||
}
|
||||
phasesMenu->addAction(temp);
|
||||
|
@ -555,56 +553,44 @@ void TabGame::retranslateUi()
|
|||
if (aNextPhase) {
|
||||
aNextPhase->setText(tr("Next &phase"));
|
||||
aNextPhase->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aNextPhase",
|
||||
QList<QKeySequence>()
|
||||
<< QKeySequence("Ctrl+Space")
|
||||
<< QKeySequence("Tab")));
|
||||
"Player/aNextPhase"));
|
||||
}
|
||||
if (aNextTurn) {
|
||||
aNextTurn->setText(tr("Next &turn"));
|
||||
aNextTurn->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aNextTurn",
|
||||
QList<QKeySequence>()
|
||||
<< QKeySequence("Ctrl+Return")
|
||||
<< QKeySequence("Ctrl+Enter")));
|
||||
"Player/aNextTurn"));
|
||||
}
|
||||
if (aRemoveLocalArrows) {
|
||||
aRemoveLocalArrows->setText(tr("&Remove all local arrows"));
|
||||
aRemoveLocalArrows->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aRemoveLocalArrows",
|
||||
QKeySequence("Ctrl+R")));
|
||||
"Player/aRemoveLocalArrows"));
|
||||
}
|
||||
if (aRotateViewCW) {
|
||||
aRotateViewCW->setText(tr("Rotate View Cl&ockwise"));
|
||||
aRotateViewCW->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aRotateViewCW",
|
||||
QKeySequence("Ctrl+]")));
|
||||
"Player/aRotateViewCW"));
|
||||
}
|
||||
if (aRotateViewCCW) {
|
||||
aRotateViewCCW->setText(tr("Rotate View Co&unterclockwise"));
|
||||
aRotateViewCCW->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aRotateViewCCW",
|
||||
QKeySequence("Ctrl+[")));
|
||||
"Player/aRotateViewCCW"));
|
||||
}
|
||||
if (aGameInfo)
|
||||
aGameInfo->setText(tr("Game &information"));
|
||||
if (aConcede) {
|
||||
aConcede->setText(tr("&Concede"));
|
||||
aConcede->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aConcede",
|
||||
QKeySequence("F2")));
|
||||
"Player/aConcede"));
|
||||
}
|
||||
if (aLeaveGame) {
|
||||
aLeaveGame->setText(tr("&Leave game"));
|
||||
aLeaveGame->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aLeaveGame",
|
||||
QKeySequence("Ctrl+Q")));
|
||||
"Player/aLeaveGame"));
|
||||
}
|
||||
if (aCloseReplay) {
|
||||
aCloseReplay->setText(tr("C&lose replay"));
|
||||
aCloseReplay->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"Player/aCloseReplay",
|
||||
QKeySequence("Ctrl+Q")));
|
||||
"Player/aCloseReplay"));
|
||||
}
|
||||
|
||||
if (sayLabel)
|
||||
|
|
|
@ -68,7 +68,7 @@ TabRoom::TabRoom(TabSupervisor *_tabSupervisor, AbstractClient *_client, ServerI
|
|||
QMenu *chatSettingsMenu = new QMenu(this);
|
||||
|
||||
aClearChat = chatSettingsMenu->addAction(QString());
|
||||
aClearChat->setShortcuts(settingsCache->shortcuts().getShortcut("tab_room/aClearChat", QKeySequence("F12")));
|
||||
aClearChat->setShortcuts(settingsCache->shortcuts().getShortcut("tab_room/aClearChat"));
|
||||
connect(aClearChat, SIGNAL(triggered()), this, SLOT(actClearChat()));
|
||||
|
||||
chatSettingsMenu->addSeparator();
|
||||
|
@ -416,4 +416,4 @@ void CustomLineEdit::updateCompleterModel(QStringList completionList)
|
|||
model = new QStringListModel();
|
||||
QStringList updatedList = completionList;
|
||||
model->setStringList(updatedList);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -457,39 +457,39 @@ void MainWindow::retranslateUi()
|
|||
|
||||
aConnect->setText(tr("&Connect..."));
|
||||
aConnect->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"MainWindow/aConnect", QKeySequence()));
|
||||
"MainWindow/aConnect"));
|
||||
|
||||
aDisconnect->setText(tr("&Disconnect"));
|
||||
aDisconnect->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"MainWindow/aDisconnect", QKeySequence()));
|
||||
"MainWindow/aDisconnect"));
|
||||
|
||||
aSinglePlayer->setText(tr("Start &local game..."));
|
||||
aSinglePlayer->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"MainWindow/aSinglePlayer", QKeySequence()));
|
||||
"MainWindow/aSinglePlayer"));
|
||||
|
||||
aWatchReplay->setText(tr("&Watch replay..."));
|
||||
aWatchReplay->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"MainWindow/aWatchReplay", QKeySequence()));
|
||||
"MainWindow/aWatchReplay"));
|
||||
|
||||
aDeckEditor->setText(tr("&Deck editor"));
|
||||
aDeckEditor->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"MainWindow/aDeckEditor", QKeySequence()));
|
||||
"MainWindow/aDeckEditor"));
|
||||
|
||||
aFullScreen->setText(tr("&Full screen"));
|
||||
aFullScreen->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"MainWindow/aFullScreen", QKeySequence("Ctrl+F")));
|
||||
"MainWindow/aFullScreen"));
|
||||
|
||||
aRegister->setText(tr("&Register to server..."));
|
||||
aRegister->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"MainWindow/aRegister", QKeySequence()));
|
||||
"MainWindow/aRegister"));
|
||||
|
||||
aSettings->setText(tr("&Settings..."));
|
||||
aSettings->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"MainWindow/aSettings", QKeySequence()));
|
||||
"MainWindow/aSettings"));
|
||||
|
||||
aExit->setText(tr("&Exit"));
|
||||
aExit->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"MainWindow/aExit", QKeySequence()));
|
||||
"MainWindow/aExit"));
|
||||
|
||||
#if defined(__APPLE__) /* For OSX */
|
||||
cockatriceMenu->setTitle(tr("A&ctions"));
|
||||
|
@ -502,8 +502,7 @@ void MainWindow::retranslateUi()
|
|||
|
||||
aCheckCardUpdates->setText(tr("Check for card updates..."));
|
||||
aCheckCardUpdates->setShortcuts(settingsCache->shortcuts().getShortcut(
|
||||
"MainWindow/aCheckCardUpdates",
|
||||
QKeySequence()));
|
||||
"MainWindow/aCheckCardUpdates"));
|
||||
|
||||
tabSupervisor->retranslateUi();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue