mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
New signal / slot syntax
#88 Not all calls can be replaced by new sytnax (e.g. cannot handle default value arguments)
This commit is contained in:
@@ -114,44 +114,18 @@ void MainWindow::init(GuiModes::CoreMode coreMode)
|
||||
this->m_resPixmapVoiceHigh = QPixmap(":/blackgui/icons/audiovolumehigh.png");
|
||||
this->m_resPixmapVoiceMuted = QPixmap(":/blackgui/icons/audiovolumemuted.png");
|
||||
|
||||
// relay status messages
|
||||
// signal / slots
|
||||
bool connect;
|
||||
connect = this->connect(this->m_contextNetwork, SIGNAL(statusMessage(BlackMisc::CStatusMessage)),
|
||||
this, SLOT(displayStatusMessage(BlackMisc::CStatusMessage)));
|
||||
Q_ASSERT_X(connect, "init", "cannot connect status message");
|
||||
|
||||
connect = this->connect(this->m_contextNetwork, SIGNAL(connectionTerminated()),
|
||||
this, SLOT(connectionTerminated()));
|
||||
Q_ASSERT_X(connect, "init", "cannot connect terminating");
|
||||
|
||||
connect = this->connect(this->m_contextNetwork, SIGNAL(connectionStatusChanged(uint, uint)),
|
||||
this, SLOT(connectionStatusChanged(uint, uint)));
|
||||
Q_ASSERT_X(connect, "init", "cannot connect change connection status");
|
||||
|
||||
connect = this->connect(this->m_contextSettings, SIGNAL(changedNetworkSettings()),
|
||||
this, SLOT(changedNetworkSettings()));
|
||||
Q_ASSERT_X(connect, "init", "cannot connect change network status");
|
||||
|
||||
connect = this->connect(this->m_contextNetwork, SIGNAL(textMessagesReceived(BlackMisc::Network::CTextMessageList)),
|
||||
this, SLOT(appendTextMessagesToGui(BlackMisc::Network::CTextMessageList)));
|
||||
Q_ASSERT_X(connect, "init", "cannot connect text message received");
|
||||
|
||||
connect = this->connect(this->m_timerUpdateAircraftsInRange, SIGNAL(timeout()),
|
||||
this, SLOT(timerBasedUpdates()));
|
||||
Q_ASSERT_X(connect, "init", "cannot connect timer");
|
||||
|
||||
connect = this->connect(this->m_timerUpdateAtcStationsOnline, SIGNAL(timeout()),
|
||||
this, SLOT(timerBasedUpdates()));
|
||||
Q_ASSERT_X(connect, "init", "cannot connect timer");
|
||||
|
||||
connect = this->connect(this->m_timerContextWatchdog, SIGNAL(timeout()),
|
||||
this, SLOT(timerBasedUpdates()));
|
||||
Q_ASSERT_X(connect, "init", "cannot connect timer (watchdog)");
|
||||
|
||||
connect = this->connect(this->m_timerCollectedCockpitUpdates, SIGNAL(timeout()),
|
||||
this, SLOT(sendCockpitUpdates()));
|
||||
Q_ASSERT_X(connect, "init", "cannot connect timer (cockpit updates)");
|
||||
Q_UNUSED(connect);
|
||||
this->connect(this->m_contextNetwork, &IContextNetwork::statusMessage, this, &MainWindow::displayStatusMessage);
|
||||
this->connect(this->m_contextNetwork, &IContextNetwork::connectionTerminated, this, &MainWindow::connectionTerminated);
|
||||
this->connect(this->m_contextNetwork, &IContextNetwork::connectionStatusChanged, this, &MainWindow::connectionStatusChanged);
|
||||
this->connect(this->m_contextSettings, &IContextSettings::changedNetworkSettings, this, &MainWindow::changedNetworkSettings);
|
||||
connect = this->connect(this->m_contextNetwork, SIGNAL(textMessagesReceived(BlackMisc::Network::CTextMessageList)), this, SLOT(appendTextMessagesToGui(BlackMisc::Network::CTextMessageList)));
|
||||
Q_ASSERT(connect);
|
||||
this->connect(this->m_timerUpdateAircraftsInRange, &QTimer::timeout, this, &MainWindow::timerBasedUpdates);
|
||||
this->connect(this->m_timerUpdateAtcStationsOnline, &QTimer::timeout, this, &MainWindow::timerBasedUpdates);
|
||||
this->connect(this->m_timerContextWatchdog, &QTimer::timeout, this, &MainWindow::timerBasedUpdates);
|
||||
this->connect(this->m_timerCollectedCockpitUpdates, &QTimer::timeout, this, &MainWindow::sendCockpitUpdates);
|
||||
|
||||
// start timers
|
||||
this->m_timerUpdateAircraftsInRange->start(10 * 1000);
|
||||
|
||||
Reference in New Issue
Block a user