diff options
author | Matti Lehtimäki <matti.lehtimaki@gmail.com> | 2013-04-12 19:33:46 +0300 |
---|---|---|
committer | Matti Lehtimäki <matti.lehtimaki@gmail.com> | 2013-04-12 19:33:46 +0300 |
commit | fac33cd988d6d0c3718ef6e2148d41a4b5141289 (patch) | |
tree | 3314fb0b7bd371207183128322b850025926b53c /setup_menu.c | |
parent | 7ba6bb1e8c96dd52eba6513f37236e63b32b3886 (diff) | |
download | vdr-plugin-epgfixer-fac33cd988d6d0c3718ef6e2148d41a4b5141289.tar.gz vdr-plugin-epgfixer-fac33cd988d6d0c3718ef6e2148d41a4b5141289.tar.bz2 |
Fix crash in config editing menus if using color buttons when config is empty.
Diffstat (limited to 'setup_menu.c')
-rw-r--r-- | setup_menu.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/setup_menu.c b/setup_menu.c index cecae25..59846d2 100644 --- a/setup_menu.c +++ b/setup_menu.c @@ -86,7 +86,10 @@ protected: item = (LISTITEM *)item->Next(); ++i; } - SetHelp(trVDR("Button$On/Off"), trVDR("Button$New"), trVDR("Button$Delete"), tr("Button$Cancel")); + if (list->Count() > 0) + SetHelp(trVDR("Button$On/Off"), trVDR("Button$New"), trVDR("Button$Delete"), tr("Button$Cancel")); + else + SetHelp(NULL,trVDR("Button$New"), NULL, tr("Button$Cancel")); Display(); } public: @@ -111,9 +114,11 @@ public: if (state == osUnknown) { switch (Key) { case kRed: - list->Get(Current())->ToggleEnabled(); - Set(); - Display(); + if (list->Count() > 0) { + list->Get(Current())->ToggleEnabled(); + Set(); + Display(); + } state = osContinue; break; case kGreen: @@ -126,12 +131,14 @@ public: state = osContinue; break; case kYellow: - Store(); - FreeArray(); - list->Del(list->Get(Current()),true); - LoadListToArray(); - Set(); - Display(); + if (list->Count() > 0) { + Store(); + FreeArray(); + list->Del(list->Get(Current()),true); + LoadListToArray(); + Set(); + Display(); + } state = osContinue; break; case kBlue: |