Commit 3d2a1d02 authored by Luigi Toscano's avatar Luigi Toscano
Browse files

Fix: show the real shortcut which (re)starts the game

Previously the default shortcut was always shown.

Reviewed on IRC by Andrius Štikonas and Albert Astals Cid.
parent 4f18d950
......@@ -73,8 +73,6 @@
#define MAX_ENERGY 99.9
#define MAX_VELOCITY 20
#define GAME_START_SHORTCUT Qt::Key_Space
#define ID_EXPLOSION 1351
#define ID_MINE1 1352
#define ID_MINE2 1353
......
......@@ -521,7 +521,7 @@ void MyMainView::newRound()
//field.update();
QString str = i18n("Press %1 to start",
QKeySequence(GAME_START_SHORTCUT).toString(QKeySequence::NativeText));
actionCollection->action("game_start")->shortcut().toString(QKeySequence::NativeText));
emit(setStatusText(str,IDS_MAIN));
emit(setStatusText( QLatin1String( "" ), IDS_PAUSE ));
stop( );
......@@ -589,7 +589,7 @@ void MyMainView::timerEvent(QTimerEvent *event)
textSprite->setPos(QPointF((width()-textSprite->boundingRect().width()) / 2,height()/2-90));
QString str = i18n("Press %1 for new round",
QKeySequence(GAME_START_SHORTCUT).toString(QKeySequence::NativeText));
actionCollection->action("game_start")->shortcut().toString(QKeySequence::NativeText));
emit(setStatusText(str,IDS_MAIN));
stop( );
}
......
......@@ -105,7 +105,7 @@ void MyTopLevelWidget::setupActions()
QAction *gameStart = actionCollection()->addAction( QLatin1String( "game_start" ) );
gameStart->setText( i18nc( "start game","Start" ) );
connect(gameStart, SIGNAL(triggered(bool)), playfield, SLOT(start()));
gameStart->setShortcut(GAME_START_SHORTCUT);
gameStart->setShortcut(Qt::Key_Space);
playfield->addAction(gameStart);
KStandardAction::preferences(playfield, SLOT(gameSetup()), actionCollection());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment