Skip to content

Commit

Permalink
touching up for new release
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-bibb committed Dec 5, 2014
1 parent c1c5075 commit cb45158
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 24 deletions.
22 changes: 16 additions & 6 deletions apps/cmstapp/code/control_box/controlbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down Expand Up @@ -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;
Expand Down
35 changes: 18 additions & 17 deletions apps/cmstapp/code/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion text/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<b><center>Change Log</center></b>
<br><b>In Progress</b>
<ul>
<li>Adding translations (Russian in progress).</li>
<li>Adding translations (Russian Complete).</li>
</ul>
<br><b>2014.11.24</b>
<ul>
Expand Down

0 comments on commit cb45158

Please sign in to comment.