diff --git a/mythtv/libs/libmythui/mythuispinbox.cpp b/mythtv/libs/libmythui/mythuispinbox.cpp
index f22156a..88dd461 100644
|
a
|
b
|
void MythUISpinBox::SetRange(int low, int high, int step, uint pageMultiple)
|
| 83 | 83 | SetPositionArrowStates(); |
| 84 | 84 | } |
| 85 | 85 | |
| | 86 | |
| | 87 | /** |
| | 88 | * \brief Add a special label for a value of the spinbox, it does not need to be in the range |
| | 89 | * |
| | 90 | * \param label The text displayed |
| | 91 | * \param value The value associated to this label |
| | 92 | */ |
| | 93 | void MythUISpinBox::AddSelection (QString label, int value) |
| | 94 | { |
| | 95 | MythUIButtonListItem * item = GetItemByData(value); |
| | 96 | if (item) |
| | 97 | { |
| | 98 | item->SetText(label); |
| | 99 | } |
| | 100 | else |
| | 101 | { |
| | 102 | int insertPos=-1; |
| | 103 | |
| | 104 | for (int pos = 0; pos < m_itemList.size();pos++) |
| | 105 | { |
| | 106 | item = m_itemList.at(pos); |
| | 107 | if (item->GetData().toInt()>value) |
| | 108 | { |
| | 109 | insertPos = pos; |
| | 110 | break; |
| | 111 | } |
| | 112 | } |
| | 113 | |
| | 114 | item = new MythUIButtonListItem(this, label, qVariantFromValue(value), |
| | 115 | insertPos); |
| | 116 | } |
| | 117 | } |
| | 118 | |
| 86 | 119 | /** |
| 87 | 120 | * \copydoc MythUIType::ParseElement() |
| 88 | 121 | */ |
diff --git a/mythtv/libs/libmythui/mythuispinbox.h b/mythtv/libs/libmythui/mythuispinbox.h
index 451530f..0fa03e8 100644
|
a
|
b
|
class MUI_PUBLIC MythUISpinBox : public MythUIButtonList
|
| 24 | 24 | |
| 25 | 25 | void SetValue(int val) { SetValueByData(val); } |
| 26 | 26 | void SetValue(const QString &val) { SetValueByData(val.toInt()); } |
| | 27 | void AddSelection (QString label, int value); |
| 27 | 28 | QString GetValue(void) const { return GetDataValue().toString(); } |
| 28 | 29 | int GetIntValue(void) const { return GetDataValue().toInt(); } |
| 29 | 30 | |