From be7850a7e808e48cf7ddcdf6f6bc9f80c0d5c331 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 18 Aug 2015 10:34:24 -0400 Subject: Update the lumina theme engine/class so that custom environment variables may be set/loaded for all apps using the theme engine (including the session - which propagates to new non-lumina applications as well) --- lumina-config/main.cpp | 1 + lumina-config/mainUI.cpp | 17 +++++++------ lumina-config/mainUI.ui | 66 +++++++++++++++++------------------------------- 3 files changed, 33 insertions(+), 51 deletions(-) (limited to 'lumina-config') diff --git a/lumina-config/main.cpp b/lumina-config/main.cpp index 115e793a..12ba0cd1 100644 --- a/lumina-config/main.cpp +++ b/lumina-config/main.cpp @@ -12,6 +12,7 @@ int main(int argc, char ** argv) { + LTHEME::LoadCustomEnvSettings(); LSingleApplication a(argc, argv, "lumina-config"); //loads translations inside constructor if(!a.isPrimaryProcess()){ return 0; } diff --git a/lumina-config/mainUI.cpp b/lumina-config/mainUI.cpp index 6bd6ba07..33b17105 100644 --- a/lumina-config/mainUI.cpp +++ b/lumina-config/mainUI.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +//#include #include #include @@ -202,7 +202,6 @@ void MainUI::setupConnections(){ connect(ui->tool_help_date, SIGNAL(clicked()), this, SLOT(sessionShowDateCodes()) ); connect(ui->line_session_time, SIGNAL(textChanged(QString)), this, SLOT(sessionLoadTimeSample()) ); connect(ui->line_session_date, SIGNAL(textChanged(QString)), this, SLOT(sessionLoadDateSample()) ); - connect(ui->combo_session_timezone, SIGNAL(currentIndexChanged(int)), this, SLOT(sessionoptchanged()) ); connect(ui->combo_session_datetimeorder, SIGNAL(currentIndexChanged(int)), this, SLOT(sessionoptchanged()) ); connect(ui->combo_locale_lang, SIGNAL(currentIndexChanged(int)), this, SLOT(sessionoptchanged()) ); connect(ui->combo_locale_collate, SIGNAL(currentIndexChanged(int)), this, SLOT(sessionoptchanged()) ); @@ -246,7 +245,7 @@ void MainUI::setupMenus(){ //if(cur>=0){ ui->combo_session_cursortheme->setCurrentIndex(cur); } //Available Time zones - ui->combo_session_timezone->clear(); + /*ui->combo_session_timezone->clear(); QList TZList = QTimeZone::availableTimeZoneIds(); QDateTime DT = QDateTime::currentDateTime(); QStringList tzlist; //Need to create a list which can be sorted appropriately @@ -256,6 +255,7 @@ void MainUI::setupMenus(){ QString name = QLocale::countryToString(TZ.country()); if(name.count() > 20){ name = name.left(20)+"..."; } name = QString(tr("%1 (%2)")).arg(name, TZ.abbreviation(DT)); + qDebug() << "Time Zone:" << name << TZ.id(); if(tzlist.filter(name).isEmpty()){ tzlist << name+"::::"+QString::number(i); } @@ -267,7 +267,7 @@ void MainUI::setupMenus(){ //ui->combo_session_timezone->sort(); //Now set the default/system value ui->combo_session_timezone->insertItem(0,tr("System Time")); - + */ //Available localizations QStringList langs = LUtils::knownLocales(); langs.sort(); @@ -1587,14 +1587,15 @@ void MainUI::loadSessionSettings(){ ui->line_session_date->setText( sessionsettings->value("DateFormat","").toString() ); index = ui->combo_session_datetimeorder->findData( sessionsettings->value("DateTimeOrder","timeonly").toString() ); ui->combo_session_datetimeorder->setCurrentIndex(index); - if( !sessionsettings->value("CustomTimeZone", false).toBool() ){ + + /*if( !sessionsettings->value("CustomTimeZone", false).toBool() ){ //System Time selected ui->combo_session_timezone->setCurrentIndex(0); }else{ index = ui->combo_session_timezone->findData( sessionsettings->value("TimeZoneByteCode",QByteArray()).toByteArray() ); if(index>0){ ui->combo_session_timezone->setCurrentIndex(index); } else{ ui->combo_session_timezone->setCurrentIndex(0); } - } + }*/ //Now do the localization settings val = sessionsettings->value("InitLocale/LANG", "").toString(); @@ -1763,14 +1764,14 @@ void MainUI::saveSessionSettings(){ sessionsettings->setValue("TimeFormat", ui->line_session_time->text()); sessionsettings->setValue("DateFormat", ui->line_session_date->text()); sessionsettings->setValue("DateTimeOrder", ui->combo_session_datetimeorder->currentData().toString()); - if( ui->combo_session_timezone->currentIndex()==0){ + /*if( ui->combo_session_timezone->currentIndex()==0){ //System Time selected sessionsettings->setValue("CustomTimeZone", false); sessionsettings->setValue("TimeZoneByteCode", QByteArray()); //clear the value }else{ sessionsettings->setValue("CustomTimeZone", true); sessionsettings->setValue("TimeZoneByteCode", ui->combo_session_timezone->currentData().toByteArray()); //clear the value - } + }*/ //Now do the locale settings sessionsettings->setValue("InitLocale/LANG", ui->combo_locale_lang->currentData().toString() ); diff --git a/lumina-config/mainUI.ui b/lumina-config/mainUI.ui index aa7024d3..5a4324fb 100644 --- a/lumina-config/mainUI.ui +++ b/lumina-config/mainUI.ui @@ -1217,6 +1217,23 @@ + + + + Sample: + + + + + + + + + + Qt::AlignCenter + + + @@ -1244,13 +1261,13 @@ - - + + - + Sample: - Qt::AlignCenter + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter @@ -1264,53 +1281,16 @@ - - - - Sample: - - - - - - - Sample: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - + - Time Zone: + Display Format - - - - 0 - 0 - - - - QComboBox::AdjustToMinimumContentsLength - - - - - - - - Display Format - - - -- cgit