Commit a5c29d71 authored by Andrius Štikonas's avatar Andrius Štikonas

Convert some signals to new signal/slot syntax.

parent 153077b5
...@@ -203,7 +203,7 @@ KCardDialog::KCardDialog(KCardWidget *widget) ...@@ -203,7 +203,7 @@ KCardDialog::KCardDialog(KCardWidget *widget)
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true); okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return); okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(buttonBox, &QDialogButtonBox::accepted, this, &KCardDialog::accept);
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(buttonBox, &QDialogButtonBox::rejected, this, &KCardDialog::reject);
mainLayout->addWidget(buttonBox); mainLayout->addWidget(buttonBox);
} }
...@@ -118,8 +118,7 @@ Mainwindow::Mainwindow(QWidget *parent) ...@@ -118,8 +118,7 @@ Mainwindow::Mainwindow(QWidget *parent)
// The LSkat config // The LSkat config
mLSkatConfig = new ConfigTwo(this); mLSkatConfig = new ConfigTwo(this);
connect(mLSkatConfig, SIGNAL(signalInputType(int,InputDeviceType)), connect(mLSkatConfig, &ConfigTwo::signalInputType, this, &Mainwindow::setInputType);
this, SLOT(setInputType(int,InputDeviceType)));
mLSkatConfig->reset(); mLSkatConfig->reset();
// Read game properties and set default values (after config) // Read game properties and set default values (after config)
...@@ -153,8 +152,7 @@ Mainwindow::Mainwindow(QWidget *parent) ...@@ -153,8 +152,7 @@ Mainwindow::Mainwindow(QWidget *parent)
mGameMode = Intro; mGameMode = Intro;
mDisplay = new DisplayIntro(mDeck, mCanvas, mTheme, ADVANCE_PERIOD, mView); mDisplay = new DisplayIntro(mDeck, mCanvas, mTheme, ADVANCE_PERIOD, mView);
setCentralWidget(mView); setCentralWidget(mView);
connect(mView, SIGNAL(signalLeftMousePress(QPoint)), connect(mView, &GameView::signalLeftMousePress, this, &Mainwindow::menuNewLSkatGame);
this, SLOT(menuNewLSkatGame()));
// Create GUI // Create GUI
setupGUI(); setupGUI();
...@@ -391,7 +389,7 @@ void Mainwindow::initGUI() ...@@ -391,7 +389,7 @@ void Mainwindow::initGUI()
// Determine start player // Determine start player
KSelectAction *startPlayerAct = new KSelectAction(i18n("Starting Player"), this); KSelectAction *startPlayerAct = new KSelectAction(i18n("Starting Player"), this);
actionCollection()->addAction(QLatin1String("startplayer"), startPlayerAct); actionCollection()->addAction(QLatin1String("startplayer"), startPlayerAct);
connect(startPlayerAct, SIGNAL(triggered(int)), this, SLOT(menuStartplayer())); connect(startPlayerAct, static_cast<void (KSelectAction::*)(int)>(&KSelectAction::triggered), this, &Mainwindow::menuStartplayer);
startPlayerAct->setToolTip(i18n("Changing starting player...")); startPlayerAct->setToolTip(i18n("Changing starting player..."));
startPlayerAct->setWhatsThis(i18n("Chooses which player begins the next game.")); startPlayerAct->setWhatsThis(i18n("Chooses which player begins the next game."));
QStringList list; QStringList list;
...@@ -404,7 +402,7 @@ void Mainwindow::initGUI() ...@@ -404,7 +402,7 @@ void Mainwindow::initGUI()
// Determine who player player 1 // Determine who player player 1
KSelectAction *player1Act = new KSelectAction(i18n("Player &1 Played By"), this); KSelectAction *player1Act = new KSelectAction(i18n("Player &1 Played By"), this);
actionCollection()->addAction(QLatin1String("player1"), player1Act); actionCollection()->addAction(QLatin1String("player1"), player1Act);
connect(player1Act, SIGNAL(triggered(int)), this, SLOT(menuPlayer1By())); connect(player1Act, static_cast<void (KSelectAction::*)(int)>(&KSelectAction::triggered), this, &Mainwindow::menuPlayer1By);
player1Act->setToolTip(i18n("Changing who plays player 1...")); player1Act->setToolTip(i18n("Changing who plays player 1..."));
player1Act->setWhatsThis(i18n("Changing who plays player 1.")); player1Act->setWhatsThis(i18n("Changing who plays player 1."));
list.clear(); list.clear();
...@@ -416,7 +414,7 @@ void Mainwindow::initGUI() ...@@ -416,7 +414,7 @@ void Mainwindow::initGUI()
// Determine who player player 2 // Determine who player player 2
KSelectAction *player2Act = new KSelectAction(i18n("Player &2 Played By"), this); KSelectAction *player2Act = new KSelectAction(i18n("Player &2 Played By"), this);
actionCollection()->addAction(QLatin1String("player2"), player2Act); actionCollection()->addAction(QLatin1String("player2"), player2Act);
connect(player2Act, SIGNAL(triggered(int)), this, SLOT(menuPlayer2By())); connect(player2Act, static_cast<void (KSelectAction::*)(int)>(&KSelectAction::triggered), this, &Mainwindow::menuPlayer2By);
player2Act->setToolTip(i18n("Changing who plays player 2...")); player2Act->setToolTip(i18n("Changing who plays player 2..."));
player2Act->setWhatsThis(i18n("Changing who plays player 2.")); player2Act->setWhatsThis(i18n("Changing who plays player 2."));
player2Act->setItems(list); player2Act->setItems(list);
...@@ -429,7 +427,7 @@ void Mainwindow::initGUI() ...@@ -429,7 +427,7 @@ void Mainwindow::initGUI()
KSelectAction *themeAct = new KSelectAction(i18n("&Theme"), this); KSelectAction *themeAct = new KSelectAction(i18n("&Theme"), this);
actionCollection()->addAction(QLatin1String("theme"), themeAct); actionCollection()->addAction(QLatin1String("theme"), themeAct);
themeAct->setItems(themes); themeAct->setItems(themes);
connect(themeAct, SIGNAL(triggered(int)), SLOT(changeTheme(int))); connect(themeAct, static_cast<void (KSelectAction::*)(int)>(&KSelectAction::triggered), this, &Mainwindow::changeTheme);
if (global_debug > 0) qCDebug(LSKAT_LOG) << "Setting current theme item to " << mThemeIndexNo; if (global_debug > 0) qCDebug(LSKAT_LOG) << "Setting current theme item to " << mThemeIndexNo;
themeAct->setCurrentItem(mThemeIndexNo); themeAct->setCurrentItem(mThemeIndexNo);
themeAct->setToolTip(i18n("Changing theme...")); themeAct->setToolTip(i18n("Changing theme..."));
...@@ -439,14 +437,14 @@ void Mainwindow::initGUI() ...@@ -439,14 +437,14 @@ void Mainwindow::initGUI()
QAction *action1 = actionCollection()->addAction(QLatin1String("select_carddeck")); QAction *action1 = actionCollection()->addAction(QLatin1String("select_carddeck"));
action1->setText(i18n("Select &Card Deck...")); action1->setText(i18n("Select &Card Deck..."));
actionCollection()->setDefaultShortcut(action1, QKeySequence(Qt::Key_F10)); actionCollection()->setDefaultShortcut(action1, QKeySequence(Qt::Key_F10));
connect(action1, SIGNAL(triggered(bool)), this, SLOT(menuCardDeck())); connect(action1, &QAction::triggered, this, &Mainwindow::menuCardDeck);
action1->setToolTip(i18n("Configure card decks...")); action1->setToolTip(i18n("Configure card decks..."));
action1->setWhatsThis(i18n("Choose how the cards should look.")); action1->setWhatsThis(i18n("Choose how the cards should look."));
// Change player names // Change player names
action = actionCollection()->addAction(QLatin1String("change_names")); action = actionCollection()->addAction(QLatin1String("change_names"));
action->setText(i18n("&Change Player Names...")); action->setText(i18n("&Change Player Names..."));
connect(action, SIGNAL(triggered(bool)), this, SLOT(menuPlayerNames())); connect(action, &QAction::triggered, this, &Mainwindow::menuPlayerNames);
if (global_demo_mode) action->setEnabled(false); if (global_demo_mode) action->setEnabled(false);
} }
...@@ -571,8 +569,8 @@ void Mainwindow::menuNewLSkatGame() ...@@ -571,8 +569,8 @@ void Mainwindow::menuNewLSkatGame()
mDisplay = new DisplayTwo(mDeck, mCanvas, mTheme, ADVANCE_PERIOD, mView); mDisplay = new DisplayTwo(mDeck, mCanvas, mTheme, ADVANCE_PERIOD, mView);
mEngine = new EngineTwo(this, mDeck, (DisplayTwo *)mDisplay); mEngine = new EngineTwo(this, mDeck, (DisplayTwo *)mDisplay);
connect(mEngine, SIGNAL(signalGameOver(int)), this, SLOT(gameOver(int))); connect(mEngine, &AbstractEngine::signalGameOver, this, &Mainwindow::gameOver);
connect(mEngine, SIGNAL(signalNextPlayer(Player*)), this, SLOT(nextPlayer(Player*))); connect(mEngine, &AbstractEngine::signalNextPlayer, this, &Mainwindow::nextPlayer);
// Connect player score widget updates // Connect player score widget updates
connect(p1, SIGNAL(signalUpdate(Player*)), mDisplay, SLOT(updatePlayer(Player*))); connect(p1, SIGNAL(signalUpdate(Player*)), mDisplay, SLOT(updatePlayer(Player*)));
......
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