1.1 --- a/core/MenuStyle_Radio.cpp Tue Nov 20 04:36:38 2007 +0000
1.2 +++ b/core/MenuStyle_Radio.cpp Tue Nov 20 17:16:50 2007 +0000
1.3 @@ -206,7 +206,9 @@
1.4 if (m_FreeDisplays.empty())
1.5 {
1.6 display = new CRadioDisplay();
1.7 - } else {
1.8 + }
1.9 + else
1.10 + {
1.11 display = m_FreeDisplays.front();
1.12 m_FreeDisplays.pop();
1.13 display->Reset();
1.14 @@ -214,6 +216,15 @@
1.15 return display;
1.16 }
1.17
1.18 +IMenuPanel *CRadioStyle::MakeRadioDisplay(const char *str, int keys)
1.19 +{
1.20 + CRadioDisplay *pPanel = MakeRadioDisplay(NULL);
1.21 +
1.22 + pPanel->DirectSet(str, keys);
1.23 +
1.24 + return pPanel;
1.25 +}
1.26 +
1.27 void CRadioStyle::FreeRadioDisplay(CRadioDisplay *display)
1.28 {
1.29 m_FreeDisplays.push(display);
1.30 @@ -275,6 +286,13 @@
1.31 keys = 0;
1.32 }
1.33
1.34 +void CRadioDisplay::DirectSet(const char *str, int keymap)
1.35 +{
1.36 + m_Title.clear();
1.37 + m_BufferText.assign(str);
1.38 + keys = keymap;
1.39 +}
1.40 +
1.41 unsigned int CRadioDisplay::GetCurrentKey()
1.42 {
1.43 return m_NextPos;
1.44 @@ -391,11 +409,21 @@
1.45
1.46 void CRadioMenuPlayer::Radio_Init(int keys, const char *title, const char *text)
1.47 {
1.48 - display_len = UTIL_Format(display_pkt,
1.49 - sizeof(display_pkt),
1.50 - "%s\n%s",
1.51 - title,
1.52 - text);
1.53 + if (title[0] != '\0')
1.54 + {
1.55 + display_len = UTIL_Format(display_pkt,
1.56 + sizeof(display_pkt),
1.57 + "%s\n%s",
1.58 + title,
1.59 + text);
1.60 + }
1.61 + else
1.62 + {
1.63 + display_len = UTIL_Format(display_pkt,
1.64 + sizeof(display_pkt),
1.65 + "%s",
1.66 + text);
1.67 + }
1.68 display_keys = keys;
1.69 }
1.70