summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Maass <mase@mase1.setho.org>2013-11-11 15:07:50 (GMT)
committerThomas Maass <mase@mase1.setho.org>2013-11-11 15:07:50 (GMT)
commit74e0ae521c5f5c11102a33f0ba557b720e48c9ac (patch)
tree9f214d7aad742a8a3fd4bceb8069d13e139dc2ff
parent9261f5584ca87fc14bcb3b61c4c69928d976c0bf (diff)
downloadvdr-plugin-hddarchive-74e0ae521c5f5c11102a33f0ba557b720e48c9ac.tar.gz
vdr-plugin-hddarchive-74e0ae521c5f5c11102a33f0ba557b720e48c9ac.tar.bz2
Added original recmenu replacement.
-rw-r--r--hddarchive.c15
-rw-r--r--po/de_DE.po8
-rwxr-xr-xsetup.c24
-rwxr-xr-xsetup.h4
4 files changed, 42 insertions, 9 deletions
diff --git a/hddarchive.c b/hddarchive.c
index 5e2b7b1..882c702 100644
--- a/hddarchive.c
+++ b/hddarchive.c
@@ -31,7 +31,7 @@ class cPluginHddarchive : public cPlugin {
virtual void MainThreadHook(void);
virtual cString Active(void);
virtual time_t WakeupTime(void);
- virtual const char *MainMenuEntry(void) { return tr(MAINMENUENTRY); }
+ virtual const char *MainMenuEntry(void) { return HddArchiveConfig.HideMainmenuEntry ? NULL : MAINMENUENTRY; }
virtual cOsdObject *MainMenuAction(void);
virtual cMenuSetupPage *SetupMenu(void);
virtual bool SetupParse(const char *Name, const char *Value);
@@ -119,6 +119,19 @@ struct Hddarchive_play_v1_0
bool cPluginHddarchive::Service(const char *Id, void *Data)
{
+ if (!Id)
+ return false;
+
+ if (HddArchiveConfig.ReplaceRecmenu && !strcmp(Id, "MainMenuHooksPatch-v1.0::osRecordings"))
+ {
+ if (!Data)
+ return true;
+ cOsdMenu **menu = (cOsdMenu**)Data;
+ if (menu)
+ *menu = (cOsdMenu*)MainMenuAction();
+ return true;
+ }
+
if (!strcmp(Id, "Hddarchive-archiveid_v1.0")) {
if (Data == NULL)
return true;
diff --git a/po/de_DE.po b/po/de_DE.po
index c193f9a..e374598 100644
--- a/po/de_DE.po
+++ b/po/de_DE.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-hddarchive 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2013-10-28 15:28+0100\n"
+"POT-Creation-Date: 2013-11-11 16:00+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Thomas Maass <mase@setho.org>\n"
"Language-Team: \n"
@@ -72,6 +72,12 @@ msgstr "Fehler beim Löschen der Aufzeichnung!"
msgid "Recording commands"
msgstr "Befehle für Aufzeichnungen"
+msgid "Hide main menu entry"
+msgstr "Hauptmenüeintrag ausblenden"
+
+msgid "Replace original recmenu"
+msgstr "Originales Aufzeichnungsmenü ersetzen"
+
msgid "Archive device"
msgstr "Archiv Gerät"
diff --git a/setup.c b/setup.c
index 5093d50..114a574 100755
--- a/setup.c
+++ b/setup.c
@@ -12,6 +12,8 @@
cHddArchiveConfig::cHddArchiveConfig()
{
+ HideMainmenuEntry = false;
+ ReplaceRecmenu = false;
strcpy(ArchiveDevice, "/dev/usb0");
strcpy(ArchiveMountpoint, "/media/usb0");
}
@@ -22,13 +24,17 @@ cHddArchiveConfig::~cHddArchiveConfig()
bool cHddArchiveConfig::SetupParse(const char *Name, const char *Value)
{
- if (!strcasecmp(Name, "ArchiveDevice"))
- strn0cpy(ArchiveDevice, Value, sizeof(ArchiveDevice));
- else if (!strcasecmp(Name, "ArchiveMountpoint"))
- strn0cpy(ArchiveMountpoint, Value, sizeof(ArchiveMountpoint));
- else
- return false;
- return true;
+ if (!strcasecmp(Name, "HideMainmenuEntry"))
+ HideMainmenuEntry = atoi(Value);
+ else if (!strcasecmp(Name, "ReplaceRecmenu"))
+ ReplaceRecmenu = atoi(Value);
+ else if (!strcasecmp(Name, "ArchiveDevice"))
+ strn0cpy(ArchiveDevice, Value, sizeof(ArchiveDevice));
+ else if (!strcasecmp(Name, "ArchiveMountpoint"))
+ strn0cpy(ArchiveMountpoint, Value, sizeof(ArchiveMountpoint));
+ else
+ return false;
+ return true;
}
// --- cHddArchiveSetup --------------------------------------------------------
@@ -45,6 +51,8 @@ cHddArchiveSetup::~cHddArchiveSetup()
void cHddArchiveSetup::Setup(void)
{
+ Add(new cMenuEditBoolItem(tr("Hide main menu entry"), &tmpHddArchiveConfig.HideMainmenuEntry));
+ Add(new cMenuEditBoolItem(tr("Replace original recmenu"), &tmpHddArchiveConfig.ReplaceRecmenu));
Add(new cMenuEditStrItem(tr("Archive device"), tmpHddArchiveConfig.ArchiveDevice, sizeof(tmpHddArchiveConfig.ArchiveDevice)));
Add(new cMenuEditStrItem(tr("Archive mountpoint"), tmpHddArchiveConfig.ArchiveMountpoint, sizeof(tmpHddArchiveConfig.ArchiveMountpoint)));
}
@@ -52,6 +60,8 @@ void cHddArchiveSetup::Setup(void)
void cHddArchiveSetup::Store(void)
{
HddArchiveConfig = tmpHddArchiveConfig;
+ SetupStore("HideMainmenuEntry", HddArchiveConfig.HideMainmenuEntry);
+ SetupStore("ReplaceRecmenu", HddArchiveConfig.ReplaceRecmenu);
SetupStore("ArchiveDevice", HddArchiveConfig.ArchiveDevice);
SetupStore("ArchiveMountpoint", HddArchiveConfig.ArchiveMountpoint);
}
diff --git a/setup.h b/setup.h
index 0b4d7cf..4af9286 100755
--- a/setup.h
+++ b/setup.h
@@ -17,6 +17,8 @@ class cHddArchiveConfig
cHddArchiveConfig();
~cHddArchiveConfig();
bool SetupParse(const char *Name, const char *Value);
+ int HideMainmenuEntry;
+ int ReplaceRecmenu;
char ArchiveDevice[NAME_MAX + 1];
char ArchiveMountpoint[NAME_MAX + 1];
};
@@ -26,6 +28,8 @@ class cHddArchiveSetup : public cMenuSetupPage
public:
cHddArchiveSetup();
virtual ~cHddArchiveSetup();
+ int HideMainmenuEntry;
+ int ReplaceRecmenu;
char ArchiveDevice[NAME_MAX + 1];
char ArchiveMountpoint[NAME_MAX + 1];
private: