Commit Message
Here is a patch I have compiled from various sources for dvdselect-0.7a.
1) Fixes saving DVDOutputDir variable
2) Fixes compilation for vdr-1.3.18+
3) Prevent VDR locking up upon deleting large files by sending command to AT
4) Confirm deletion of ISOs
5) Reset link in /dev/dvd back to default upon vdr shutdown
Regards,
@@ -84,9 +84,10 @@
void cMenuSetupDVDSelect::Store(void)
{
DVDSelectSetup = data;
- SetupStore( "NameDevice", data.NameDevice);
- SetupStore( "NameOrgDevice", data.NameOrgDevice);
- SetupStore( "ImageDir", data.ImageDir );
- SetupStore( "DVDReadScript", data.DVDReadScript );
- SetupStore( "DVDWriteScript", data.DVDWriteScript );
+ SetupStore( "NameDevice", data.NameDevice );
+ SetupStore( "NameOrgDevice", data.NameOrgDevice );
+ SetupStore( "ImageDir", data.ImageDir );
+ SetupStore( "DVDOutputDir", data.DVDOutputDir );
+ SetupStore( "DVDReadScript", data.DVDReadScript );
+ SetupStore( "DVDWriteScript", data.DVDWriteScript );
}
@@ -21,6 +21,7 @@
class cPluginDVDSelect : public cPlugin {
private:
// Add any member variables or functions you may need here.
+ void Reset(void);
public:
cPluginDVDSelect(void);
virtual ~cPluginDVDSelect();
@@ -51,6 +52,7 @@
{
// Clean up after yourself!
// none needed
+ Reset();
}
const char *cPluginDVDSelect::CommandLineHelp(void)
@@ -68,6 +70,7 @@
{
// Initialize any background activities the plugin shall perform.
RegisterI18n(Phrases);
+ Reset();
return true;
}
@@ -100,4 +103,18 @@
return DVDSelectSetup.SetupParse(Name, Value);
}
+void cPluginDVDSelect::Reset(void)
+{
+ char *device = NULL;
+ char *orgDevice = NULL;
+ char *cmd = NULL;
+
+ asprintf(&device, "%s",DVDSelectSetup.NameDevice);
+ asprintf(&orgDevice, "%s",DVDSelectSetup.NameOrgDevice);
+ asprintf(&cmd, "ln -nfs '%s' '%s' 2> /dev/null", orgDevice, device);
+
+ esyslog(cmd);
+ system(cmd);
+}
+
VDRPLUGINCREATOR(cPluginDVDSelect); // Don't touch this!
@@ -18,7 +18,7 @@
#define SCRIPT_DVDWRITE_CMD "%s '%s'"
#define SCRIPT_DVDREAD_CMD "%s '%s' '%s' '%s'"
-#define RMCMD "rm '%s' 2> /dev/null"
+#define RMCMD "echo \"rm '%s' 2> /dev/null\" | at now"
#define MOUNTCMD "ln -nfs '%s' '%s' 2> /dev/null"
#define RESETCMD "ln -nfs '%s' '%s' 2> /dev/null"
@@ -35,7 +35,12 @@
FILE *p = popen(cmd, "r");
if (p) {
char *s;
+#if VDRVERSNUM >= 10318
+ cReadLine ReadLine;
+ while ( (s = ReadLine.Read(p) ) != NULL ) {
+#else
while ((s = readline(p)) != NULL) {
+#endif
Add(new cMenuDVDItem(s,DVDSelectSetup.ImageDir), &i);
}//while
pclose(p);
@@ -251,9 +256,11 @@
cMenuDVDItem *item = (cMenuDVDItem*)Get(Current());
if (item) {
+ if (Interface->Confirm(tr("Burn DVD?"))) {
asprintf(&cmd, SCRIPT_DVDWRITE_CMD,DVDSelectSetup.DVDWriteScript,item->dateiname);
esyslog(cmd);
rc=system(cmd);
+ }
}
//Nach Scriptausführung Menü ausblenden,
@@ -263,7 +270,7 @@
void cDVDList::SetHelp() {
- cOsdMenu::SetHelp(tr("start"),tr("dvdwritescript"),tr("delete"),tr("reset"));
+ cOsdMenu::SetHelp(tr("start"),tr("burn"),tr("delete"),tr("reset"));
}