forked from len0rd/rockbox
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
This commit is contained in:
parent
d367ab41e3
commit
91a0e8a4c2
2 changed files with 138 additions and 20 deletions
|
|
@ -270,6 +270,138 @@ QVariant DeviceState::data(QString tag, int paramCount,
|
||||||
else
|
else
|
||||||
return false;
|
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 =
|
QPair<InputType, QWidget*> found =
|
||||||
inputs.value(tag, QPair<InputType, QWidget*>(Slide, 0));
|
inputs.value(tag, QPair<InputType, QWidget*>(Slide, 0));
|
||||||
|
|
|
||||||
|
|
@ -124,27 +124,13 @@ xf ; Crossfade Type ; combo(Off, Automatic Track Skip Only, Shuffle, Shuffle or
|
||||||
|
|
||||||
[Clock]
|
[Clock]
|
||||||
cc ; Has Realtime Clock ; check ; true
|
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
|
cf ; 24 Hour Format ; check ; true
|
||||||
cH ; 24h Hour ; text ; 09
|
cY ; Year ; spin(1500,2100) ; 2010
|
||||||
ck ; 24h Hour (No Padding) ; text ; 9
|
cm ; Month ; combo(January, February, March, April, May, Jun, July, August, September, October, November, December) ; January
|
||||||
cI ; 12h Hour ; text ; 09
|
day ; Day of Month ; spin(1,31) ; 20
|
||||||
cl ; 12h Hour (No Padding) ; text ; 9
|
?cw ; Day of Week ; combo(Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday) ; Tuesday
|
||||||
cm ; Month (Padded) ; text ; 03
|
hour ; Hour (24h) ; spin(0, 23) ; 12
|
||||||
?cm ; Month (Conditional) ; combo(January, February, March, April, May, Jun, July, August, September, October, November, December) ; January
|
minute ; Minute ; spin(0, 59) ; 25
|
||||||
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
|
|
||||||
|
|
||||||
[Recording Status]
|
[Recording Status]
|
||||||
Rp ; Target Has Recorder ; check ; false
|
Rp ; Target Has Recorder ; check ; false
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue