From df0a9497795d6970119890b78f17069400a44abb Mon Sep 17 00:00:00 2001 From: Andrew Bibb Date: Sun, 18 Sep 2016 09:41:09 -0400 Subject: [PATCH] fixed #151 --- apps/cmstapp/code/control_box/controlbox.cpp | 23 +++++++-- apps/cmstapp/code/control_box/controlbox.h | 1 + .../cmstapp/code/control_box/ui/controlbox.ui | 50 ++++++++++++++----- apps/resource.h | 2 +- text/changelog.txt | 2 + 5 files changed, 60 insertions(+), 18 deletions(-) diff --git a/apps/cmstapp/code/control_box/controlbox.cpp b/apps/cmstapp/code/control_box/controlbox.cpp index 31f6255f..bb8668f5 100755 --- a/apps/cmstapp/code/control_box/controlbox.cpp +++ b/apps/cmstapp/code/control_box/controlbox.cpp @@ -952,6 +952,7 @@ void ControlBox::dbsServicesChanged(QList vlist, QList 0) { if (services_list.at(0).objmap.value("Type") == "vpn") managerRescan(CMST::Manager_Services); } + updateDisplayWidgets(); return; @@ -1164,8 +1165,9 @@ void ControlBox::dbsTechnologyPropertyChanged(QString name, QDBusVariant dbvalue return; } -// Slot to rescan all WiFi technologies. Called from the -// ui.pushButton_rescan control. +// Slot to rescan all WiFi technologies. Called when ui.actionRescan +// is triggered. Action is called from rescanwifi buttons and from +// the context menu. // Results signaled by manager.ServicesChanged(), except for peer // services which will be signaled by manager.PeersChanged() void ControlBox::scanWiFi() @@ -1177,13 +1179,12 @@ void ControlBox::scanWiFi() for (int row = 0; row < technologies_list.size(); ++row) { if (technologies_list.at(row).objmap.value("Type").toString() == "wifi") { if (technologies_list.at(row).objmap.value("Powered").toBool() ) { - ui.pushButton_rescan->setDisabled(true); + setStateRescan(false); ui.tableWidget_services->setCurrentIndex(QModelIndex()); // first cell becomes selected once pushbutton is disabled qApp->processEvents(); // needed to promply disable the button QDBusInterface* iface_tech = new QDBusInterface(DBUS_CON_SERVICE, technologies_list.at(row).objpath.path(), "net.connman.Technology", QDBusConnection::systemBus(), this); iface_tech->setTimeout( 8 * 1000); // full 25 second timeout is a bit much when there is a problem QDBusMessage reply = iface_tech->call(QDBus::AutoDetect, "Scan"); - if (shared::processReply(reply) != QDBusMessage::InvalidMessage) ui.pushButton_rescan->setEnabled(true); iface_tech->deleteLater(); } // if the wifi was powered } // if the list item is wifi @@ -1699,7 +1700,7 @@ void ControlBox::assembleTabStatus() ui.tableWidget_technologies->showColumn(5); ui.pushButton_IDPass->setHidden(false); } - + for (int row = 0; row < technologies_list.size(); ++row) { QTableWidgetItem* qtwi00 = new QTableWidgetItem(); st = technologies_list.at(row).objmap.value("Name").toString(); @@ -1959,6 +1960,7 @@ void ControlBox::assembleTabWireless() ui.pushButton_connect->setEnabled(b_enable); ui.pushButton_disconnect->setEnabled(b_enable); ui.pushButton_remove->setEnabled(b_enable); + setStateRescan(b_enable); return; } @@ -3013,3 +3015,14 @@ void ControlBox::iconColorChanged(const QString& col) return; } +// +// Slot to set the enabled/disabled state of the rescan wifi controls +void ControlBox::setStateRescan(bool state) +{ + ui.pushButton_rescanwifi01->setEnabled(state); + ui.pushButton_rescanwifi02->setEnabled(state); + ui.actionRescan->setEnabled(state); + + return; +} + diff --git a/apps/cmstapp/code/control_box/controlbox.h b/apps/cmstapp/code/control_box/controlbox.h index 744e26b3..4b5253a2 100755 --- a/apps/cmstapp/code/control_box/controlbox.h +++ b/apps/cmstapp/code/control_box/controlbox.h @@ -211,6 +211,7 @@ class ControlBox : public QDialog void cleanUp(); void callColorDialog(); void iconColorChanged(const QString&); + void setStateRescan(bool); }; #endif diff --git a/apps/cmstapp/code/control_box/ui/controlbox.ui b/apps/cmstapp/code/control_box/ui/controlbox.ui index 12ecdfe8..d9dea84c 100644 --- a/apps/cmstapp/code/control_box/ui/controlbox.ui +++ b/apps/cmstapp/code/control_box/ui/controlbox.ui @@ -290,7 +290,7 @@ - + <html><head/><body><p>Force a rescan of all WiFi technologies. This is similar to issuing the command <span style=" font-weight:600;">connmanctl scan wifi</span> from the command line.</p><p>The button will become inactive while the scan is occuring.</p></body></html> @@ -523,8 +523,8 @@ 0 0 - 98 - 60 + 647 + 353 @@ -720,6 +720,16 @@ + + + + <html><head/><body><p>Force a rescan of all WiFi technologies. This is similar to issuing the command <span style=" font-weight:600;">connmanctl scan wifi</span> from the command line.</p><p>The button will become inactive while the scan is occuring.</p></body></html> + + + Resc&an + + + @@ -895,8 +905,8 @@ 0 0 - 112 - 286 + 647 + 431 @@ -935,8 +945,8 @@ 0 0 - 98 - 46 + 603 + 141 @@ -991,8 +1001,8 @@ 0 0 - 98 - 46 + 603 + 140 @@ -1747,8 +1757,8 @@ 0 0 - 98 - 412 + 537 + 431 @@ -1961,7 +1971,7 @@ - pushButton_rescan + pushButton_rescanwifi01 clicked() actionRescan trigger() @@ -2120,5 +2130,21 @@ + + pushButton_rescanwifi02 + clicked() + actionRescan + trigger() + + + 329 + 83 + + + -1 + -1 + + + diff --git a/apps/resource.h b/apps/resource.h index 04e96cc2..689d3132 100755 --- a/apps/resource.h +++ b/apps/resource.h @@ -35,7 +35,7 @@ DEALINGS IN THE SOFTWARE. ///////////////////////////////// Program Values /////////////////////// // // Program Info (may be visible, but don't mark for tranalation) -#define VERSION "2016.08.11-1" +#define VERSION "2016.09.18-1" #define RELEASE_DATE "3 April 2016" #define COPYRIGHT_DATE "2013-2016" diff --git a/text/changelog.txt b/text/changelog.txt index 33b28a86..5faa561f 100644 --- a/text/changelog.txt +++ b/text/changelog.txt @@ -5,6 +5,8 @@
  • New commandline option to disable VPN support (issue #144).
  • Fixed showing error dialog when connect is selected from the tray icon (issue #143).
  • Provisioning editor and properties editor nameserver and timeserver fields will now accept domain names in addition to IPv4 and IPv6 addresses (issue #146).
  • +
  • Added wifi rescan button to Wifi tab (issue #151).
  • +
  • Wifi rescan controls disabled during scans and if there is no powered Wifi technology found.
  • 2016.04.03