summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Engel <dengel@mythtv.org>2011-06-25 20:33:21 (GMT)
committer David Engel <dengel@mythtv.org>2011-06-25 20:40:47 (GMT)
commit95b4d9283cba9a8ec902b0f2080cd35778967eb5 (patch)
tree1e1281ad4e308e479ed43ed0a1c473733091802f
parent132c2dc429e8d42eacdab42991a342fe0c5650a7 (diff)
Better handle display of high-numbered cards.
If a card's number was greater than 9, only the first digit was displayed in some situations and caused confusion with some users. Change toQChar(RecStatusType recstatus, uint cardid) to toString(RecStatusType recstatus, uint cardid) and return a string to allow display of the full number. Also, tweak some themes where card numbers are displayed.
-rw-r--r--mythtv/libs/libmyth/programinfo.cpp2
-rw-r--r--mythtv/libs/libmyth/programtypes.cpp11
-rw-r--r--mythtv/libs/libmyth/programtypes.h2
-rw-r--r--mythtv/programs/mythbackend/scheduler.cpp2
-rw-r--r--mythtv/programs/mythfrontend/viewschedulediff.cpp8
-rw-r--r--mythtv/themes/MythCenter-wide/schedule-ui.xml20
-rw-r--r--mythtv/themes/MythCenter/schedule-ui.xml15
-rw-r--r--mythtv/themes/default-wide/schedule-ui.xml18
-rw-r--r--mythtv/themes/default/schedule-ui.xml18
9 files changed, 53 insertions, 43 deletions
diff --git a/mythtv/libs/libmyth/programinfo.cpp b/mythtv/libs/libmyth/programinfo.cpp
index 96ae09e..4739f20 100644
--- a/mythtv/libs/libmyth/programinfo.cpp
+++ b/mythtv/libs/libmyth/programinfo.cpp
@@ -1428,7 +1428,7 @@ void ProgramInfo::ToMap(InfoMap &progMap,
}
progMap["rectypestatus"] = tmp_rec;
- progMap["card"] = toQChar(GetRecordingStatus(), cardid);
+ progMap["card"] = ::toString(GetRecordingStatus(), cardid);
progMap["recpriority"] = recpriority;
progMap["recpriority2"] = recpriority2;
diff --git a/mythtv/libs/libmyth/programtypes.cpp b/mythtv/libs/libmyth/programtypes.cpp
index d18f68d..80c42f7 100644
--- a/mythtv/libs/libmyth/programtypes.cpp
+++ b/mythtv/libs/libmyth/programtypes.cpp
@@ -69,8 +69,8 @@ QString toUIState(RecStatusType recstatus)
return "warning";
}
-/// \brief Converts "recstatus" into a human readable character.
-QChar toQChar(RecStatusType recstatus, uint cardid)
+/// \brief Converts "recstatus" into a human readable string.
+QString toString(RecStatusType recstatus, uint cardid)
{
QString ret = "-";
switch (recstatus)
@@ -82,10 +82,7 @@ QChar toQChar(RecStatusType recstatus, uint cardid)
ret = QObject::tr("R", "RecStatusChar rsRecorded");
break;
case rsRecording:
- if (0 < cardid && cardid < 10)
- ret = QString::number(cardid);
- else
- ret = QObject::tr("R", "RecStatusChar rsCurrentRecording");
+ ret = QString::number(cardid);
break;
case rsTuning:
ret = QObject::tr("t", "RecStatusChar rsTuning");
@@ -152,7 +149,7 @@ QChar toQChar(RecStatusType recstatus, uint cardid)
break;
}
- return (ret.isEmpty()) ? QChar('-') : ret[0];
+ return (ret.isEmpty()) ? QString("-") : ret;
}
/// \brief Converts "recstatus" into a short human readable description.
diff --git a/mythtv/libs/libmyth/programtypes.h b/mythtv/libs/libmyth/programtypes.h
index 7852b25..55041a3 100644
--- a/mythtv/libs/libmyth/programtypes.h
+++ b/mythtv/libs/libmyth/programtypes.h
@@ -213,7 +213,7 @@ typedef enum RecStatusTypes {
rsOtherShowing = 13
} RecStatusType; // note stored in int8_t in ProgramInfo
MPUBLIC QString toUIState(RecStatusType);
-MPUBLIC QChar toQChar(RecStatusType, uint cardid);
+MPUBLIC QString toString(RecStatusType, uint cardid);
MPUBLIC QString toString(RecStatusType, RecordingType);
MPUBLIC QString toDescription(RecStatusType, const QDateTime &recstartts);
diff --git a/mythtv/programs/mythbackend/scheduler.cpp b/mythtv/programs/mythbackend/scheduler.cpp
index eef1d83..071b968 100644
--- a/mythtv/programs/mythbackend/scheduler.cpp
+++ b/mythtv/programs/mythbackend/scheduler.cpp
@@ -523,7 +523,7 @@ void Scheduler::PrintRec(const RecordingInfo *p, const char *prefix)
.arg(p->GetInputID());
outstr += QString("%1 %2 %3")
.arg(toQChar(p->GetRecordingRuleType()))
- .arg(toQChar(p->GetRecordingStatus(), p->GetCardID()))
+ .arg(toString(p->GetRecordingStatus(), p->GetCardID()))
.arg(p->GetRecordingPriority());
if (p->GetRecordingPriority2())
outstr += QString("/%1").arg(p->GetRecordingPriority2());
diff --git a/mythtv/programs/mythfrontend/viewschedulediff.cpp b/mythtv/programs/mythfrontend/viewschedulediff.cpp
index d3e623c..d715222 100644
--- a/mythtv/programs/mythfrontend/viewschedulediff.cpp
+++ b/mythtv/programs/mythfrontend/viewschedulediff.cpp
@@ -305,14 +305,14 @@ void ViewScheduleDiff::updateUIList(void)
item->SetTextFromMap(infoMap, state);
if (s.before)
- item->SetText(toQChar(s.before->GetRecordingStatus(),
- s.before->GetCardID()), "statusbefore");
+ item->SetText(toString(s.before->GetRecordingStatus(),
+ s.before->GetCardID()), "statusbefore");
else
item->SetText("-", "statusbefore");
if (s.after)
- item->SetText(toQChar(s.after->GetRecordingStatus(),
- s.after->GetCardID()), "statusafter");
+ item->SetText(toString(s.after->GetRecordingStatus(),
+ s.after->GetCardID()), "statusafter");
else
item->SetText("-", "statusafter");
}
diff --git a/mythtv/themes/MythCenter-wide/schedule-ui.xml b/mythtv/themes/MythCenter-wide/schedule-ui.xml
index c317c7f..baffc02 100644
--- a/mythtv/themes/MythCenter-wide/schedule-ui.xml
+++ b/mythtv/themes/MythCenter-wide/schedule-ui.xml
@@ -513,10 +513,10 @@
<area>240,2,230,24</area>
</textarea>
<textarea name="title" from="shortstarttimedate">
- <area>480,2,650,24</area>
+ <area>480,2,660,24</area>
</textarea>
<textarea name="card" from="shortstarttimedate">
- <area>1140,2,40,24</area>
+ <area>1150,2,30,24</area>
<align>right,vcenter</align>
</textarea>
</state>
@@ -534,11 +534,11 @@
<area>240,2,230,24</area>
</textarea>
<textarea name="title" from="shortstarttimedate">
- <area>480,2,650,24</area>
+ <area>480,2,660,24</area>
</textarea>
<textarea name="card" from="shortstarttimedate">
- <area>1140,2,40,24</area>
- <align>right,vcenter</align>
+ <area>1150,2,30,24</area>
+ <align>right,vcenter</align>
</textarea>
<shape name="selectbar">
<area>8,0,1180,28</area>
@@ -1175,10 +1175,11 @@
<area>240,2,230,24</area>
</textarea>
<textarea name="titlesubtitle" from="shortstarttimedate">
- <area>480,2,675,24</area>
+ <area>480,2,660,24</area>
</textarea>
<textarea name="card" from="shortstarttimedate">
- <area>1165,2,30,24</area>
+ <area>1150,2,30,24</area>
+ <align>right,vcenter</align>
</textarea>
</state>
<state name="selectedactive" from="active">
@@ -1195,10 +1196,11 @@
<area>240,2,230,24</area>
</textarea>
<textarea name="titlesubtitle" from="shortstarttimedate">
- <area>480,2,675,24</area>
+ <area>480,2,660,24</area>
</textarea>
<textarea name="card" from="shortstarttimedate">
- <area>1165,2,30,24</area>
+ <area>1150,2,30,24</area>
+ <align>right,vcenter</align>
</textarea>
<shape name="selectbar">
<area>8,0,1180,28</area>
diff --git a/mythtv/themes/MythCenter/schedule-ui.xml b/mythtv/themes/MythCenter/schedule-ui.xml
index 369232c..4abfe55 100644
--- a/mythtv/themes/MythCenter/schedule-ui.xml
+++ b/mythtv/themes/MythCenter/schedule-ui.xml
@@ -496,10 +496,11 @@
<area>180,1,155,24</area>
</textarea>
<textarea name="title" from="shortstarttimedate">
- <area>345,1,370,24</area>
+ <area>345,1,365,24</area>
</textarea>
<textarea name="card" from="shortstarttimedate">
- <area>730,1,30,24</area>
+ <area>720,1,30,24</area>
+ <align>right,vcenter</align>
</textarea>
</state>
<state name="selectedactive" from="active">
@@ -511,10 +512,11 @@
<area>180,1,155,24</area>
</textarea>
<textarea name="title" from="shortstarttimedate">
- <area>345,1,370,24</area>
+ <area>345,1,365,24</area>
</textarea>
<textarea name="card" from="shortstarttimedate">
- <area>730,1,30,24</area>
+ <area>720,1,30,24</area>
+ <align>right,vcenter</align>
</textarea>
<shape name="selectbar">
<area>5,-3,751,30</area>
@@ -1255,12 +1257,13 @@
<font>basesmallwhite</font>
</textarea>
<textarea name="titlesubtitle" from="shortstarttimedate">
- <area>340,1,380,24</area>
+ <area>340,1,370,24</area>
<font>basesmallboldblue</font>
</textarea>
<textarea name="card" from="shortstarttimedate">
- <area>730,1,30,24</area>
+ <area>720,1,30,24</area>
<font>basesmallboldblue</font>
+ <align>right,vcenter</align>
</textarea>
</state>
<state name="selectedactive" from="active">
diff --git a/mythtv/themes/default-wide/schedule-ui.xml b/mythtv/themes/default-wide/schedule-ui.xml
index 9ffa169..1009fd0 100644
--- a/mythtv/themes/default-wide/schedule-ui.xml
+++ b/mythtv/themes/default-wide/schedule-ui.xml
@@ -561,10 +561,11 @@
<area>240,1,190,24</area>
</textarea>
<textarea name="titlesubtitle" from="shortstarttimedate">
- <area>440,1,690,24</area>
+ <area>440,1,700,24</area>
</textarea>
<textarea name="card" from="shortstarttimedate">
- <area>1145,1,35,24</area>
+ <area>1150,1,30,24</area>
+ <align>right,vcenter</align>
</textarea>
</state>
<state name="selectedactive" from="active" />
@@ -1151,10 +1152,11 @@
<area>240,1,190,24</area>
</textarea>
<textarea name="titlesubtitle" from="shortstarttimedate">
- <area>440,1,640,24</area>
+ <area>440,1,700,24</area>
</textarea>
<textarea name="card" from="shortstarttimedate">
- <area>1160,1,30,24</area>
+ <area>1150,1,30,24</area>
+ <align>right,vcenter</align>
</textarea>
</state>
<state name="selectedactive" from="active" />
@@ -2093,13 +2095,15 @@
<area>260,1,170,24</area>
</textarea>
<textarea name="titlesubtitle" from="shortstarttimedate">
- <area>440,1,640,24</area>
+ <area>440,1,645,24</area>
</textarea>
<textarea name="statusbefore" from="shortstarttimedate">
- <area>1125,1,30,24</area>
+ <area>1095,1,30,24</area>
+ <align>right,vcenter</align>
</textarea>
<textarea name="statusafter" from="shortstarttimedate">
- <area>1160,1,30,24</area>
+ <area>1135,1,30,24</area>
+ <align>right,vcenter</align>
</textarea>
</state>
<state name="selectedactive" from="active" />
diff --git a/mythtv/themes/default/schedule-ui.xml b/mythtv/themes/default/schedule-ui.xml
index 7db67b0..13482e9 100644
--- a/mythtv/themes/default/schedule-ui.xml
+++ b/mythtv/themes/default/schedule-ui.xml
@@ -494,10 +494,11 @@
<area>190,1,140,24</area>
</textarea>
<textarea name="title" from="shortstarttimedate">
- <area>340,1,380,24</area>
+ <area>340,1,370,24</area>
</textarea>
<textarea name="card" from="shortstarttimedate">
- <area>730,1,30,24</area>
+ <area>720,1,30,24</area>
+ <align>right,vcenter</align>
</textarea>
</state>
<state name="selectedactive" from="active" />
@@ -1218,10 +1219,11 @@
<area>190,1,140,24</area>
</textarea>
<textarea name="titlesubtitle" from="shortstarttimedate">
- <area>340,1,380,24</area>
+ <area>340,1,370,24</area>
</textarea>
<textarea name="card" from="shortstarttimedate">
- <area>730,1,30,24</area>
+ <area>720,1,30,24</area>
+ <align>right,vcenter</align>
</textarea>
</state>
<state name="selectedactive" from="active" />
@@ -2018,13 +2020,15 @@
<area>190,1,140,24</area>
</textarea>
<textarea name="titlesubtitle" from="shortstarttimedate">
- <area>340,1,350,24</area>
+ <area>340,1,330,24</area>
</textarea>
<textarea name="statusbefore" from="shortstarttimedate">
- <area>700,1,30,24</area>
+ <area>680,1,30,24</area>
+ <align>right,vcenter</align>
</textarea>
<textarea name="statusafter" from="shortstarttimedate">
- <area>730,1,30,24</area>
+ <area>720,1,30,24</area>
+ <align>right,vcenter</align>
</textarea>
</state>
<state name="selectedactive" from="active" />