mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 08:34:52 -07:00
Merge branch 'master' into fix_1387
Conflicts: cockatrice/CMakeLists.txt cockatrice/src/tab_game.h cockatrice/src/tab_room.cpp
This commit is contained in:
commit
e9bad2cacb
31 changed files with 2989 additions and 428 deletions
|
|
@ -123,14 +123,14 @@ DeckViewContainer::DeckViewContainer(int _playerId, TabGame *parent)
|
|||
setLayout(deckViewLayout);
|
||||
|
||||
retranslateUi();
|
||||
connect(&settingsCache->shortcuts(), SIGNAL(shortCutchanged()),this,SLOT(refreshShortcuts()));
|
||||
refreshShortcuts();
|
||||
}
|
||||
|
||||
void DeckViewContainer::retranslateUi()
|
||||
{
|
||||
loadLocalButton->setText(tr("Load local deck"));
|
||||
loadLocalButton->setShortcut(QKeySequence("Ctrl+O"));
|
||||
loadRemoteButton->setText(tr("Load deck from server"));
|
||||
loadRemoteButton->setShortcut(QKeySequence("Ctrl+Alt+O"));
|
||||
readyStartButton->setText(tr("Ready to s&tart"));
|
||||
updateSideboardLockButtonText();
|
||||
}
|
||||
|
|
@ -151,6 +151,58 @@ void DeckViewContainer::updateSideboardLockButtonText()
|
|||
sideboardLockButton->setText(tr("S&ideboard locked"));
|
||||
}
|
||||
|
||||
void DeckViewContainer::refreshShortcuts()
|
||||
{
|
||||
loadLocalButton->setShortcut(settingsCache->shortcuts().getSingleShortcut("DeckViewContainer/loadLocalButton"));
|
||||
loadRemoteButton->setShortcut(settingsCache->shortcuts().getSingleShortcut("DeckViewContainer/loadRemoteButton"));
|
||||
}
|
||||
|
||||
void TabGame::refreshShortcuts()
|
||||
{
|
||||
for (int i = 0; i < phaseActions.size(); ++i) {
|
||||
QAction *temp = phaseActions.at(i);
|
||||
switch (i) {
|
||||
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: ;
|
||||
}
|
||||
}
|
||||
|
||||
if (aNextPhase) {
|
||||
aNextPhase->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aNextPhase"));
|
||||
}
|
||||
if (aNextTurn) {
|
||||
aNextTurn->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aNextTurn"));
|
||||
}
|
||||
if (aRemoveLocalArrows) {
|
||||
aRemoveLocalArrows->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aRemoveLocalArrows"));
|
||||
}
|
||||
if (aRotateViewCW) {
|
||||
aRotateViewCW->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aRotateViewCW"));
|
||||
}
|
||||
if (aRotateViewCCW) {
|
||||
aRotateViewCCW->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aRotateViewCCW"));
|
||||
}
|
||||
if (aConcede) {
|
||||
aConcede->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aConcede"));
|
||||
}
|
||||
if (aLeaveGame) {
|
||||
aLeaveGame->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aLeaveGame"));
|
||||
}
|
||||
if (aCloseReplay) {
|
||||
aCloseReplay->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aCloseReplay"));
|
||||
}
|
||||
}
|
||||
|
||||
void DeckViewContainer::loadLocalDeck()
|
||||
{
|
||||
QFileDialog dialog(this, tr("Load deck"));
|
||||
|
|
@ -362,6 +414,8 @@ TabGame::TabGame(TabSupervisor *_tabSupervisor, GameReplay *_replay)
|
|||
addTabMenu(gameMenu);
|
||||
|
||||
retranslateUi();
|
||||
connect(&settingsCache->shortcuts(), SIGNAL(shortCutchanged()),this,SLOT(refreshShortcuts()));
|
||||
refreshShortcuts();
|
||||
setLayout(superMainLayout);
|
||||
|
||||
splitter->restoreState(settingsCache->getTabGameSplitterSizes());
|
||||
|
|
@ -472,18 +526,10 @@ TabGame::TabGame(TabSupervisor *_tabSupervisor, QList<AbstractClient *> &_client
|
|||
for (int i = 0; i < phasesToolbar->phaseCount(); ++i) {
|
||||
QAction *temp = new QAction(QString(), this);
|
||||
connect(temp, SIGNAL(triggered()), this, SLOT(actPhaseAction()));
|
||||
switch (i) {
|
||||
case 0: temp->setShortcut(QKeySequence("F5")); break;
|
||||
case 2: temp->setShortcut(QKeySequence("F6")); break;
|
||||
case 3: temp->setShortcut(QKeySequence("F7")); break;
|
||||
case 4: temp->setShortcut(QKeySequence("F8")); break;
|
||||
case 9: temp->setShortcut(QKeySequence("F9")); break;
|
||||
case 10: temp->setShortcut(QKeySequence("F10")); break;
|
||||
default: ;
|
||||
}
|
||||
phasesMenu->addAction(temp);
|
||||
phaseActions.append(temp);
|
||||
}
|
||||
|
||||
phasesMenu->addSeparator();
|
||||
phasesMenu->addAction(aNextPhase);
|
||||
|
||||
|
|
@ -502,6 +548,8 @@ TabGame::TabGame(TabSupervisor *_tabSupervisor, QList<AbstractClient *> &_client
|
|||
addTabMenu(gameMenu);
|
||||
|
||||
retranslateUi();
|
||||
connect(&settingsCache->shortcuts(), SIGNAL(shortCutchanged()),this,SLOT(refreshShortcuts()));
|
||||
refreshShortcuts();
|
||||
setLayout(mainLayout);
|
||||
|
||||
splitter->restoreState(settingsCache->getTabGameSplitterSizes());
|
||||
|
|
@ -560,37 +608,29 @@ void TabGame::retranslateUi()
|
|||
gameMenu->setTitle(tr("&Game"));
|
||||
if (aNextPhase) {
|
||||
aNextPhase->setText(tr("Next &phase"));
|
||||
aNextPhase->setShortcuts(QList<QKeySequence>() << QKeySequence("Ctrl+Space") << QKeySequence("Tab"));
|
||||
}
|
||||
if (aNextTurn) {
|
||||
aNextTurn->setText(tr("Next &turn"));
|
||||
aNextTurn->setShortcuts(QList<QKeySequence>() << QKeySequence("Ctrl+Return") << QKeySequence("Ctrl+Enter"));
|
||||
}
|
||||
if (aRemoveLocalArrows) {
|
||||
aRemoveLocalArrows->setText(tr("&Remove all local arrows"));
|
||||
aRemoveLocalArrows->setShortcut(QKeySequence("Ctrl+R"));
|
||||
}
|
||||
if (aRotateViewCW) {
|
||||
aRotateViewCW->setText(tr("Rotate View Cl&ockwise"));
|
||||
aRotateViewCW->setShortcut(QKeySequence("Ctrl+]"));
|
||||
}
|
||||
if (aRotateViewCCW) {
|
||||
aRotateViewCCW->setText(tr("Rotate View Co&unterclockwise"));
|
||||
aRotateViewCCW->setShortcut(QKeySequence("Ctrl+["));
|
||||
}
|
||||
if (aGameInfo)
|
||||
aGameInfo->setText(tr("Game &information"));
|
||||
if (aConcede) {
|
||||
aConcede->setText(tr("&Concede"));
|
||||
aConcede->setShortcut(QKeySequence("F2"));
|
||||
}
|
||||
if (aLeaveGame) {
|
||||
aLeaveGame->setText(tr("&Leave game"));
|
||||
aLeaveGame->setShortcut(QKeySequence("Ctrl+Q"));
|
||||
}
|
||||
if (aCloseReplay) {
|
||||
aCloseReplay->setText(tr("C&lose replay"));
|
||||
aCloseReplay->setShortcut(QKeySequence("Ctrl+Q"));
|
||||
}
|
||||
|
||||
if (sayLabel)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue