diff options
author | Robert Bieber <robby@bieberphoto.com> | 2010-07-08 19:44:30 +0000 |
---|---|---|
committer | Robert Bieber <robby@bieberphoto.com> | 2010-07-08 19:44:30 +0000 |
commit | 91a0e8a4c2a40811bf2da49522b43895f23b9c41 (patch) | |
tree | 0a26eaa0ad92c2318b7e88e3330a5a26acc8aca2 /utils/themeeditor | |
parent | d367ab41e33119e2b6fac8cfff7d652de08012da (diff) |
Theme Editor: Simplified clock tab in device control panel, now one set of values controls all the cX tags
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27351 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor')
-rw-r--r-- | utils/themeeditor/gui/devicestate.cpp | 132 | ||||
-rw-r--r-- | utils/themeeditor/resources/deviceoptions | 26 |
2 files changed, 138 insertions, 20 deletions
diff --git a/utils/themeeditor/gui/devicestate.cpp b/utils/themeeditor/gui/devicestate.cpp index 8802bd5e87..63d80342c1 100644 --- a/utils/themeeditor/gui/devicestate.cpp +++ b/utils/themeeditor/gui/devicestate.cpp @@ -270,6 +270,138 @@ QVariant DeviceState::data(QString tag, int paramCount, else return false; } + else if(tag == "ce") + { + return data("month"); + } + else if(tag == "cH") + { + int hour = data("hour").toInt(); + if(hour < 10) + return "0" + QString::number(hour); + else + return hour; + } + else if(tag == "cK") + { + return data("hour"); + } + else if(tag == "cI") + { + int hour = data("hour").toInt(); + if(hour > 12) + hour -= 12; + if(hour == 0) + hour = 12; + + if(hour < 10) + return "0" + QString::number(hour); + else + return hour; + } + else if(tag == "cl") + { + int hour = data("hour").toInt(); + if(hour > 12) + hour -= 12; + if(hour == 0) + hour = 12; + + return hour; + } + else if(tag == "cm") + { + int month = data("?cm").toInt() + 1; + if(month < 10) + return "0" + QString::number(month); + else + return month; + } + else if(tag == "cd") + { + int day = data("day").toInt(); + if(day < 10) + return "0" + QString::number(day); + else + return day; + } + else if(tag == "cM") + { + int minute = data("minute").toInt(); + if(minute < 10) + return "0" + QString::number(minute); + else + return minute; + } + else if(tag == "cS") + { + int second = data("second").toInt(); + if(second < 10) + return "0" + QString::number(second); + else + return second; + } + else if(tag == "cy") + { + QString year = data("cY").toString(); + return year.right(2); + } + else if(tag == "cP") + { + if(data("hour").toInt() >= 12) + return "PM"; + else + return "AM"; + } + else if(tag == "cp") + { + if(data("hour").toInt() >= 12) + return "pm"; + else + return "am"; + } + else if(tag == "ca") + { + QString day = data("cw").toString(); + return day.left(3); + } + else if(tag == "cb") + { + int month = data("cm").toInt(); + switch(month) + { + case 1: return "Jan"; + case 2: return "Feb"; + case 3: return "Mar"; + case 4: return "Apr"; + case 5: return "May"; + case 6: return "Jun"; + case 7: return "Jul"; + case 8: return "Aug"; + case 9: return "Sep"; + case 10: return "Oct"; + case 11: return "Nov"; + case 12: return "Dec"; + } + } + else if(tag == "cu") + { + int day = data("?cw").toInt(); + if(day == 0) + day = 7; + return day; + } + else if(tag == "?cu") + { + int day = data("?cw").toInt() - 1; + if(day == -1) + day = 6; + return day; + } + else if(tag == "cw") + { + return data("?cw"); + } QPair<InputType, QWidget*> found = inputs.value(tag, QPair<InputType, QWidget*>(Slide, 0)); diff --git a/utils/themeeditor/resources/deviceoptions b/utils/themeeditor/resources/deviceoptions index 56c7927373..1fb2832d13 100644 --- a/utils/themeeditor/resources/deviceoptions +++ b/utils/themeeditor/resources/deviceoptions @@ -124,27 +124,13 @@ xf ; Crossfade Type ; combo(Off, Automatic Track Skip Only, Shuffle, Shuffle or [Clock] cc ; Has Realtime Clock ; check ; true -cd ; Day of Month ; text ; 05 -ce ; Day of Month (No Padding) ; text ; 5 cf ; 24 Hour Format ; check ; true -cH ; 24h Hour ; text ; 09 -ck ; 24h Hour (No Padding) ; text ; 9 -cI ; 12h Hour ; text ; 09 -cl ; 12h Hour (No Padding) ; text ; 9 -cm ; Month (Padded) ; text ; 03 -?cm ; Month (Conditional) ; combo(January, February, March, April, May, Jun, July, August, September, October, November, December) ; January -cM ; Minute (Padded) ; text ; 29 -cS ; Second (Padded) ; text ; 50 -cy ; Last Two Digits of Year (Padded) ; text ; 09 -cY ; Year ; text ; 2009 -cP ; Uppercase AM or PM ; combo(AM,PM) ; AM -cp ; Lowercase AM or PM ; combo(am,pm) ; am -ca ; Abbreviated Weekday Name ; combo(Sun, Mon, Tue, Thu, Fri, Sat); Tue -cb ; Abbreviated Month Name ; combo(Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec) ; Jan -cu ; Day of Week (1..7, 1 is Monday) ; spin(1,7) ; 2 -?cu ; Day of Week (Monday First, Conditional) ; combo(Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday) ; Tuesday -cw ; Day of Week (0..6, 0 is Sunday) ; spin(0,6) ; 2 -?cw ; Day of Week (Sunday First, Conditional) ; combo(Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday) ; Tuesday +cY ; Year ; spin(1500,2100) ; 2010 +cm ; Month ; combo(January, February, March, April, May, Jun, July, August, September, October, November, December) ; January +day ; Day of Month ; spin(1,31) ; 20 +?cw ; Day of Week ; combo(Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday) ; Tuesday +hour ; Hour (24h) ; spin(0, 23) ; 12 +minute ; Minute ; spin(0, 59) ; 25 [Recording Status] Rp ; Target Has Recorder ; check ; false |