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 +++++++++++++++++++++++++++------------- mainwindow.h | 2 +- mainwindow.ui | 2 +- 3 files changed, 29 insertions(+), 15 deletions(-) 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")); diff --git a/mainwindow.h b/mainwindow.h index 916f95b..c238fe5 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -62,7 +62,7 @@ private slots: void exitApplication(); //void stateChanged(QNetworkSession::State); //void onlineStateChanged(bool); - void onNetworkConfigurationChanged(); + //void onNetworkConfigurationChanged(); }; #endif // MAINWINDOW_H diff --git a/mainwindow.ui b/mainwindow.ui index be54347..f280ce2 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -443,7 +443,7 @@ actionUpdate_Status triggered() MainWindow - updateSpaceList() + updateStatus() -1 -- cgit v1.2.3