Commit 1bb5edec authored by Laurent Montel's avatar Laurent Montel 😁

Port to new connect api

parent d076f589
......@@ -51,7 +51,7 @@ FleetDlg::FleetDlg( QWidget *parent,
update();
setMainWidget( m_fleetTable );
connect( this, SIGNAL(okClicked()), this, SLOT(accept()) );
connect(this, &FleetDlg::okClicked, this, &FleetDlg::accept);
}
......
......@@ -40,7 +40,7 @@ ScoreDlg::ScoreDlg( QWidget *parent, const QString& title, QList<Player *> playe
m_standingsWidget = new StandingsWidget(this, players);
setMainWidget( m_standingsWidget );
connect( this, SIGNAL(okClicked()), this, SLOT(accept()) );
connect(this, &ScoreDlg::okClicked, this, &ScoreDlg::accept);
}
......
......@@ -160,14 +160,10 @@ GameView::GameView(QWidget *parent, Game *game, QDockWidget *messagesDock, QDock
//**********************************************************************
// Set up signal/slot connections
//**********************************************************************
connect( m_mapScene, SIGNAL( planetSelected(Planet *) ),
this, SLOT(planetSelected(Planet *)) );
connect( m_shipCountEdit, SIGNAL(returnPressed()),
this, SLOT(newShipCount()) );
connect( m_standingOrder, SIGNAL(clicked()),
this, SLOT(standingOrdersClicked()) );
connect( m_endTurnBtn, SIGNAL( clicked() ),
this, SLOT( nextPlayer() ) );
connect(m_mapScene, &MapScene::planetSelected, this, &GameView::planetSelected);
connect(m_shipCountEdit, &QLineEdit::returnPressed, this, &GameView::newShipCount);
connect(m_standingOrder, &QCheckBox::clicked, this, &GameView::standingOrdersClicked);
connect(m_endTurnBtn, &QPushButton::clicked, this, &GameView::nextPlayer);
changeGameView();
}
......@@ -501,10 +497,10 @@ GameView::startNewGame()
LocalPlayer *local = qobject_cast<LocalPlayer*>(player);
if (local)
connect(local, SIGNAL(canPlay()), this, SLOT(turnPreparation()));
connect(local, &LocalPlayer::canPlay, this, &GameView::turnPreparation);
}
connect(m_game, SIGNAL(finished()), this, SLOT(gameOver()));
connect(m_game, &Game::finished, this, &GameView::gameOver);
m_game->start();
// Fix all the widgets to run a new game.
......
......@@ -81,7 +81,7 @@ public:
virtual ~GameView();
bool confirmNewGame();
protected slots:
public slots:
bool shutdownGame();
void planetSelected( Planet * );
void newShipCount();
......
......@@ -123,8 +123,8 @@ MainWindow::setupActions()
// the GUI, regardless of currently visible in an active tab or invisible
// in a not currently active tab.
connect(m_messagesAction, SIGNAL(triggered(bool)), m_messagesDock, SLOT(setVisible(bool)));
connect(m_messagesDock, SIGNAL(visibilityChanged(bool)), this, SLOT(updateMessagesActionSlot()));
connect(m_messagesAction, &QAction::triggered, m_messagesDock, &QDockWidget::setVisible);
connect(m_messagesDock, &QDockWidget::visibilityChanged, this, &MainWindow::updateMessagesActionSlot);
// docking area - standings
......@@ -139,8 +139,8 @@ MainWindow::setupActions()
m_standingsAction->setCheckable(true);
m_standingsAction->setChecked(m_standingsDock->isVisible());
connect(m_standingsAction, SIGNAL(triggered(bool)), m_standingsDock, SLOT(setVisible(bool)));
connect(m_standingsDock, SIGNAL(visibilityChanged(bool)), this, SLOT(updateStandingsActionSlot()));
connect(m_standingsAction, &QAction::triggered, m_standingsDock, &QDockWidget::setVisible);
connect(m_standingsDock, &QDockWidget::visibilityChanged, this, &MainWindow::updateStandingsActionSlot);
}
......@@ -151,19 +151,13 @@ MainWindow::setupGameView()
m_gameView = new GameView(this, m_game, m_messagesDock, m_standingsDock);
setCentralWidget( m_gameView );
connect ( m_game, SIGNAL( gameMsg(const KLocalizedString &,
Player *, Planet *,
Player * ) ),
m_gameView, SLOT( gameMsg(const KLocalizedString &,
Player *, Planet *,
Player * ) ) );
connect (m_gameView, SIGNAL( newGUIState( GUIState )),
this, SLOT( guiStateChange( GUIState ) ) );
connect(m_measureAction, SIGNAL(triggered(bool)), m_gameView, SLOT( measureDistance() ));
connect(m_fleetAction, SIGNAL(triggered(bool)), m_gameView, SLOT( showFleets() ));
connect(m_endTurnAction, SIGNAL(triggered()), m_gameView, SLOT(nextPlayer()));
connect(m_endGameAction, SIGNAL(triggered()), m_gameView, SLOT(shutdownGame()));
connect(m_game, &Game::gameMsg, m_gameView, &GameView::gameMsg);
connect(m_gameView, &GameView::newGUIState, this, &MainWindow::guiStateChange);
connect(m_measureAction, &QAction::triggered, m_gameView, &GameView::measureDistance);
connect(m_fleetAction, &QAction::triggered, m_gameView, &GameView::showFleets);
connect(m_endTurnAction, &QAction::triggered, m_gameView, &GameView::nextPlayer);
connect(m_endGameAction, &QAction::triggered, m_gameView, &GameView::shutdownGame);
}
......
......@@ -46,7 +46,7 @@ Planet::Planet( const QString &planetName, Sector *sector, Player *initialOwner,
{
KRandomSequence r;
m_planetLook = r.getLong(10);
connect(&m_homeFleet, SIGNAL(update()), this, SIGNAL(update()));
connect(&m_homeFleet, &DefenseFleet::update, this, &Planet::update);
m_sector->setPlanet( this );
}
......
......@@ -54,7 +54,7 @@ void Sector::setPlanet( Planet *planet )
{
m_planet = planet;
connect( m_planet, SIGNAL( update() ), this, SLOT( childPlanetUpdate() ) );
connect(m_planet, &Planet::update, this, &Sector::childPlanetUpdate);
emit update();
}
......
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