Prefermenu patch (was: russian translation)
Commit Message
Monchenko Vladimir schrieb:
> It is very good
> plugin, but in my opinion it has one lack: casual pressing can lead to
> erroneous removal or moving of channels. My small daughter sometimes
> does it :) . It will be more convenient if to add function of editing
> prefermenu in plugin setup, and on hot button to leave only a mode of
> switching of channels.
Hope this helps.
Best regards,
Florian Steinel
@@ -51,6 +51,21 @@
// Start any background activities the plugin shall perform.
RegisterI18n(Phrases);
// Default values for setup
+ // Perform the action when selected from the main VDR menu.
+ // Load prefered channels list
+ if(!PreferedChannelsList.Load(AddDirectory(ConfigDirectory(),"prefermenu.conf"))) {
+ // File load failed
+ isyslog("prefermenu.conf file not found");
+ }
+ // Create the "displayed" channel list (which can be sorted)
+ if(!PreferedChannelsListDisplay.Load(AddDirectory(ConfigDirectory(),"prefermenu.conf"))) {
+ // Saving after loading allows to clean the file
+ // File load failed
+ // But just log once
+ } else {
+ // Clean up the file with current VDR channels.conf
+ PreferedChannelsList.Save();
+ }
return true;
}
@@ -61,20 +76,12 @@
cOsdObject *cPluginPrefermenu::MainMenuAction(void)
{
- // Perform the action when selected from the main VDR menu.
- // Load prefered channels list
- if(!PreferedChannelsList.Load(AddDirectory(ConfigDirectory(),"prefermenu.conf"))) {
- // File load failed
- isyslog("prefermenu.conf file not found");
- }
// Create the "displayed" channel list (which can be sorted)
if(!PreferedChannelsListDisplay.Load(AddDirectory(ConfigDirectory(),"prefermenu.conf"))) {
// Saving after loading allows to clean the file
// File load failed
// But just log once
}
- // Clean up the file with current VDR channels.conf
- PreferedChannelsList.Save();
config.height= (config.lines * (LINEHEIGHT+BORDERSIZE+2))+BORDERSIZE;
return new cPreferOsd;
}