From cb45158e862ecb70013f552105cc79be68bf09a6 Mon Sep 17 00:00:00 2001 From: Andrew Bibb Date: Thu, 4 Dec 2014 19:17:22 -0500 Subject: [PATCH] touching up for new release --- apps/cmstapp/code/control_box/controlbox.cpp | 22 ++++++++---- apps/cmstapp/code/main.cpp | 35 ++++++++++---------- text/changelog.txt | 2 +- 3 files changed, 35 insertions(+), 24 deletions(-) diff --git a/apps/cmstapp/code/control_box/controlbox.cpp b/apps/cmstapp/code/control_box/controlbox.cpp index e259ff37..77971321 100755 --- a/apps/cmstapp/code/control_box/controlbox.cpp +++ b/apps/cmstapp/code/control_box/controlbox.cpp @@ -171,11 +171,20 @@ ControlBox::ControlBox(const QCommandLineParser& parser, QWidget *parent) // Even then the fix may not work, but for now keep it in. b_usexfce = parser.isSet("use-xfce"); - // set counter update params from command line options if available - // otherwise, default params specified in main.cpp are used - wifi_interval = parser.value("wifi-scan-rate").toUInt(); // number of seconds between wifi scans - counter_accuracy = parser.value("counter-update-kb").toUInt(); // number of kb for counter updates - counter_period = parser.value("counter-update-rate").toUInt(); // number of seconds for counter updates + // set counter update params from command line options if available otherwise + // default params specified in main.cpp are used. Set a minimum value for + // each to maintain program response. + uint minval = 10; + uint setval = parser.value("wifi-scan-rate").toUInt(); + wifi_interval = setval > minval ? setval : minval; // number of seconds between wifi scans + + minval = 256; + setval = parser.value("counter-update-kb").toUInt(); + counter_accuracy = setval > minval ? setval : minval; // number of kb for counter updates + + minval = 5; + setval = parser.value("counter-update-rate").toUInt(); + counter_period = setval > minval ? setval : minval; // number of seconds for counter updates // connect counter signal to the counterUpdated slot before we register the counter, assuming counters are not disabled if (! parser.isSet("disable-counters")) @@ -1402,7 +1411,8 @@ void ControlBox::assemblePage3() // initilize the table ui.tableWidget_wifi->clearContents(); - int rowcount=0; + ui.tableWidget_wifi->setRowCount(0); + int rowcount = 0; // Make sure we got the services_list before we try to work with it. if ( (q8_errors & CMST::Err_Services) != 0x00 ) return; diff --git a/apps/cmstapp/code/main.cpp b/apps/cmstapp/code/main.cpp index 82726d26..4ef9c6ed 100755 --- a/apps/cmstapp/code/main.cpp +++ b/apps/cmstapp/code/main.cpp @@ -48,10 +48,6 @@ void signalhandler(int sig) { return; } - -// uncomment to install translation code -#define USE_TRANSLATIONS - int main(int argc, char *argv[]) { QApplication::setApplicationName(LONG_NAME); @@ -110,19 +106,24 @@ int main(int argc, char *argv[]) // QT5.4 keep the command line option so users start up commands don't break, but make it a NOP. QCommandLineOption useXFCE(QStringList() << "use-xfce", QCoreApplication::translate("main.cpp", "Use XFCE specific code.") ); parser.addOption(useXFCE); - - #ifdef USE_TRANSLATIONS - QTranslator qtTranslator; - qtTranslator.load("qt_" + QLocale::system().name(), - QLibraryInfo::location(QLibraryInfo::TranslationsPath)); - app.installTranslator(&qtTranslator); - - QTranslator cmstTranslator; - if (cmstTranslator.load("cmst_" + QLocale::system().name(), ":/translations/translations" ) ) { - app.installTranslator(&cmstTranslator); - } - #endif - + + // Setup translations + QTranslator qtTranslator; + qtTranslator.load("qt_" + QLocale::system().name(), + QLibraryInfo::location(QLibraryInfo::TranslationsPath)); + app.installTranslator(&qtTranslator); + + QTranslator cmstTranslator; + if (cmstTranslator.load("cmst_" + QLocale::system().name(), ":/translations/translations" ) ) { + app.installTranslator(&cmstTranslator); + } + // else use en_US as it contains Connman strings properized and some singular/plural strings + else if (cmstTranslator.load("cmst_en_US", ":/translations/translations" ) ) { + app.installTranslator(&cmstTranslator); + } + + + // Make sure all the command lines can be parsed parser.process(app); QStringList sl = parser.unknownOptionNames(); if (sl.size() > 0 ) parser.showHelp(1); diff --git a/text/changelog.txt b/text/changelog.txt index 90826eb6..fee0c8d1 100644 --- a/text/changelog.txt +++ b/text/changelog.txt @@ -2,7 +2,7 @@
Change Log

In Progress
2014.11.24