From 42e703bf9876432056a556fc0dbc1c3f5ac01976 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Sun, 6 Dec 2015 19:11:35 +0100 Subject: version 1.0 release candidate successfully tested for about one week. --- mainwindow.cpp | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) (limited to 'mainwindow.cpp') diff --git a/mainwindow.cpp b/mainwindow.cpp index b27876c..812efeb 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1,21 +1,11 @@ #include "mainwindow.h" #include "ui_mainwindow.h" #include - +/* void MainWindow::onNetworkConfigurationChanged() { - qDebug() << "configuration changed\n"; - if(this->mgr->isOnline()) - { - if(this->ui->comboBox->count() == 0) - { - this->updateSpaceList(); - this->updateStatus(); - } - else - this->updateStatus(); - } } +*/ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), @@ -36,7 +26,7 @@ MainWindow::MainWindow(QWidget *parent) : this->timer = new QTimer(); - this->connect(this->timer, SIGNAL(timeout()), this, SLOT(updateSpaceList())); + this->connect(this->timer, SIGNAL(timeout()), this, SLOT(updateStatus())); // update every five minutes... this->timer->start(60000 * 5); @@ -44,14 +34,38 @@ MainWindow::MainWindow(QWidget *parent) : //this->currentIcon = new QIcon(this->pixmap); this->mgr = new QNetworkConfigurationManager(); + /* + connect(this->mgr, + SIGNAL(configurationChanged(const QNetworkConfiguration &)), + this, + SLOT(onNetworkConfigurationChanged())); + */ + /* connect(this->mgr, SIGNAL(configurationChanged(const QNetworkConfiguration &)), this, SLOT(onNetworkConfigurationChanged())); + */ + connect(this->mgr, &QNetworkConfigurationManager::configurationChanged, + [=] + { + qDebug() << "configuration changed" << endl; + if(this->mgr->isOnline()) + { + if(this->ui->comboBox->count() == 0) + { + this->updateSpaceList(); + this->updateStatus(); + } + else + this->updateStatus(); + } + }); connect(this->mgr, &QNetworkConfigurationManager::onlineStateChanged, [=] (bool b) { + qDebug() << "QNetworkConfigurationManager::onlineStateChanged\n" << endl; if(!b) { this->qsystemtrayicon->setIcon(QIcon::fromTheme("network-error")); -- cgit v1.2.3