aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop/panel-plugins/clock/LClock.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lumina-desktop/panel-plugins/clock/LClock.cpp')
-rw-r--r--lumina-desktop/panel-plugins/clock/LClock.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/lumina-desktop/panel-plugins/clock/LClock.cpp b/lumina-desktop/panel-plugins/clock/LClock.cpp
index 79cae84b..c3eb1451 100644
--- a/lumina-desktop/panel-plugins/clock/LClock.cpp
+++ b/lumina-desktop/panel-plugins/clock/LClock.cpp
@@ -38,10 +38,22 @@ void LClock::updateTime(){
if(useTZ){ CT = CT.toTimeZone(TZ); }
//Now update the display
QString label;
- if(deftime){ label = CT.time().toString(Qt::SystemLocaleShortDate) ; }
- else{ label=CT.toString(timefmt); }
- if(defdate){ labelWidget->setToolTip(CT.date().toString(Qt::SystemLocaleLongDate)); }
- else{ labelWidget->setToolTip(CT.toString(datefmt)); }
+ QString timelabel;
+ QString datelabel;
+ if(deftime){ timelabel = CT.time().toString(Qt::SystemLocaleShortDate) ; }
+ else{ timelabel=CT.toString(timefmt); }
+ if(defdate){ datelabel = CT.date().toString(Qt::SystemLocaleLongDate); }
+ else{ datelabel = CT.toString(datefmt); }
+ if(datetimeorder == "dateonly"){
+ label = datelabel;
+ labelWidget->setToolTip(timelabel);
+ }else if(datetimeorder == "timedate"){
+ label = timelabel + " " + datelabel;
+ }else if(datetimeorder == "datetime"){
+ label = datelabel + " " + timelabel;
+ }else{ label = timelabel;
+ labelWidget->setToolTip(datelabel);
+ }
if( this->layout()->direction() == QBoxLayout::TopToBottom ){
//different routine for vertical text (need newlines instead of spaces)
label.replace(" ","\n");
@@ -54,6 +66,7 @@ void LClock::updateFormats(){
datefmt = LSession::handle()->sessionSettings()->value("DateFormat","").toString();
deftime = timefmt.simplified().isEmpty();
defdate = datefmt.simplified().isEmpty();
+ datetimeorder = LSession::handle()->sessionSettings()->value("DateTimeOrder", "timeonly").toString();
useTZ = LSession::handle()->sessionSettings()->value("CustomTimeZone",false).toBool();
if(useTZ){ TZ = QTimeZone( LSession::handle()->sessionSettings()->value("TimeZoneByteCode", QByteArray()).toByteArray() ); }
bgstack15