summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de>2008-01-25 01:09:49 +0100
committerDieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de>2008-01-25 01:09:49 +0100
commit5c5da204386e7a63ed4fac1d458dd10a120470e0 (patch)
treedeb3e5f385ddeee6c1746714859fb1de09177299
parente2496312144175ba6fc030eb9f8f9781590f5e6b (diff)
downloadvdr-plugin-live-5c5da204386e7a63ed4fac1d458dd10a120470e0.tar.gz
vdr-plugin-live-5c5da204386e7a63ed4fac1d458dd10a120470e0.tar.bz2
Fixed bug that the recordings items were not deleted when the tree was
rebuild. This was because of the non weak references to the parent items. Deleting of recordings can be triggered now. It still needs some tweaking on the visual feedback. And possibly a 'undelete' option for the last deleted recording.
-rw-r--r--pages/recordings.ecpp62
-rw-r--r--pages/schedule.ecpp2
-rw-r--r--po/ca_ES.po12
-rw-r--r--po/cs_CZ.po12
-rw-r--r--po/da_DK.po12
-rw-r--r--po/de_DE.po28
-rw-r--r--po/el_GR.po12
-rw-r--r--po/es_ES.po12
-rw-r--r--po/et_EE.po12
-rw-r--r--po/fi_FI.po15
-rw-r--r--po/fr_FR.po16
-rw-r--r--po/hr_HR.po12
-rw-r--r--po/hu_HU.po12
-rw-r--r--po/it_IT.po16
-rw-r--r--po/nl_NL.po14
-rw-r--r--po/nn_NO.po12
-rw-r--r--po/pl_PL.po12
-rw-r--r--po/pt_PT.po12
-rw-r--r--po/ro_RO.po12
-rw-r--r--po/ru_RU.po12
-rw-r--r--po/sl_SI.po12
-rw-r--r--po/sv_SE.po12
-rw-r--r--po/tr_TR.po12
-rw-r--r--recman.cpp26
-rw-r--r--recman.h11
-rw-r--r--tasks.cpp23
-rw-r--r--tasks.h15
27 files changed, 388 insertions, 32 deletions
diff --git a/pages/recordings.ecpp b/pages/recordings.ecpp
index 2acfdc4..b97a18b 100644
--- a/pages/recordings.ecpp
+++ b/pages/recordings.ecpp
@@ -1,4 +1,6 @@
<%pre>
+#include <string>
+
#include <vdr/plugin.h>
#include <vdr/config.h>
@@ -6,26 +8,38 @@
#include "tools.h"
#include "epg_events.h"
-#include "recman.h"
#include "setup.h"
+#include "tasks.h"
+
+#include "recman.h"
using namespace vdrlive;
using namespace std;
</%pre>
<%args>
+ string todel;
</%args>
<%session scope="global">
bool logged_in(false);
</%session>
<%request scope="page">
- RecordingsTreePtr recordingsTree(LiveRecordingsManager()->GetRecordingsTree());
+ string deleteResult;
</%request>
<%include>page_init.eh</%include>
<%cpp>
- if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
+if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
- pageTitle = tr("Recordings");
+pageTitle = tr("Recordings");
+
+if (!todel.empty()) {
+ RemoveRecordingTask task(todel);
+ LiveTaskManager().Execute(task);
+ if (!task.Result())
+ deleteResult = string() + tr("ERROR:") + " " + task.Error();
+ else
+ deleteResult = string() + tr("deleted recording") + ": " + task.RecName();
+}
</%cpp>
<& pageelems.doc_type &>
<html>
@@ -37,18 +51,34 @@ using namespace std;
</head>
<body>
<& pageelems.logo &>
+<%cpp>
+if (! deleteResult.empty()) {
+</%cpp>
+ <& menu active=("recordings") component=("recordings.delete_error") &>
+<%cpp>
+} else {
+</%cpp>
<& menu active=("recordings") &>
+<%cpp>
+}
+</%cpp>
<div class="inhalt">
<div class="boxheader"><div><div><$ tr("List of recordings") $></div></div></div>
-% if (Recordings.Count() == 0) {
+<%cpp>
+ if (Recordings.Count() == 0) {
+</%cpp>
<$ tr("No recordings found") $>
-% } else {
+<%cpp>
+ } else {
+</%cpp>
<div class="recordings">
<ul class="recordingslist" style="display: block;">
<& recordings.recordings_item &>
</ul>
</div>
-% }
+<%cpp>
+ }
+</%cpp>
</div>
</body>
</html>
@@ -62,6 +92,7 @@ using namespace std;
int level = 0;
</%args>
<%cpp>
+RecordingsTreePtr recordingsTree(LiveRecordingsManager()->GetRecordingsTree());
RecordingsMap::iterator iter;
RecordingsMap::iterator end = recordingsTree->end(path);
@@ -113,6 +144,15 @@ for (iter = recordingsTree->begin(path); iter != end; ++iter) {
<# ---------------------------------------------------------------------- #>
+<%def del_rec>
+<%args>
+ string id;
+</%args>
+<%cpp> { </%cpp><a href="recordings.html?todel=<$ id $>" <& tooltip.hint text=(tr("Delete this recording from hard disc!")) &>><img src="<$ LiveSetup().GetThemedLink("img", "del.png") $>" alt="" /></a><%cpp> } </%cpp>
+</%def>
+
+<# ---------------------------------------------------------------------- #>
+
<%def rec_tools>
<%args>
string id;
@@ -120,6 +160,7 @@ for (iter = recordingsTree->begin(path); iter != end; ++iter) {
</%args>
<& pageelems.ajax_action_href action="play_recording" param=(id) tip=(tr("play this recording.")) image="play.png" alt="" &>
<& pageelems.imdb_info_href title=(title) &>
+<& recordings.del_rec id=(id) &>
</%def>
<# ---------------------------------------------------------------------- #>
@@ -189,7 +230,6 @@ for (iter = recordingsTree->begin(path); iter != end; ++iter) {
</%cpp>
<!-- not supported yet ...
<img src="<$ LiveSetup().GetThemedLink("img", "edit.png") $>" alt="" />
- <img src="<$ LiveSetup().GetThemedLink("img", "del.png") $>" alt="" />
-->
</div>
<%cpp>
@@ -201,3 +241,9 @@ for (iter = recordingsTree->begin(path); iter != end; ++iter) {
</%cpp>
</div>
</%def>
+
+<# ---------------------------------------------------------------------- #>
+
+<%def delete_error>
+<%cpp> { </%cpp><$ deleteResult $><%cpp> } </%cpp>
+</%def>
diff --git a/pages/schedule.ecpp b/pages/schedule.ecpp
index 7896f6f..35b892b 100644
--- a/pages/schedule.ecpp
+++ b/pages/schedule.ecpp
@@ -64,7 +64,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
</head>
<body>
<& pageelems.logo &>
- <& menu active=("schedule") component=("schedule.channel_selection")>
+ <& menu active=("schedule") component=("schedule.channel_selection") &>
<div class="inhalt">
<%cpp>
if ( Schedule == 0 ) {
diff --git a/po/ca_ES.po b/po/ca_ES.po
index 39fcc3b..dd849c1 100644
--- a/po/ca_ES.po
+++ b/po/ca_ES.po
@@ -77,6 +77,9 @@ msgstr ""
msgid "Not playing the same recording as from request."
msgstr ""
+msgid "Attempt to delete recording currently in playback."
+msgstr ""
+
msgid "Epg error"
msgstr ""
@@ -563,6 +566,12 @@ msgstr ""
msgid "If you encounter any bugs or would like to suggest new features, please use our bugtracker"
msgstr ""
+msgid "ERROR:"
+msgstr ""
+
+msgid "deleted recording"
+msgstr ""
+
msgid "List of recordings"
msgstr ""
@@ -572,6 +581,9 @@ msgstr ""
msgid "Click to view details."
msgstr ""
+msgid "Delete this recording from hard disc!"
+msgstr ""
+
msgid "play this recording."
msgstr ""
diff --git a/po/cs_CZ.po b/po/cs_CZ.po
index 2338354..38d3848 100644
--- a/po/cs_CZ.po
+++ b/po/cs_CZ.po
@@ -75,6 +75,9 @@ msgstr ""
msgid "Not playing the same recording as from request."
msgstr ""
+msgid "Attempt to delete recording currently in playback."
+msgstr ""
+
msgid "Epg error"
msgstr ""
@@ -561,6 +564,12 @@ msgstr ""
msgid "If you encounter any bugs or would like to suggest new features, please use our bugtracker"
msgstr ""
+msgid "ERROR:"
+msgstr ""
+
+msgid "deleted recording"
+msgstr ""
+
msgid "List of recordings"
msgstr ""
@@ -570,6 +579,9 @@ msgstr ""
msgid "Click to view details."
msgstr ""
+msgid "Delete this recording from hard disc!"
+msgstr ""
+
msgid "play this recording."
msgstr ""
diff --git a/po/da_DK.po b/po/da_DK.po
index f971c80..1412a8b 100644
--- a/po/da_DK.po
+++ b/po/da_DK.po
@@ -75,6 +75,9 @@ msgstr ""
msgid "Not playing the same recording as from request."
msgstr ""
+msgid "Attempt to delete recording currently in playback."
+msgstr ""
+
msgid "Epg error"
msgstr ""
@@ -561,6 +564,12 @@ msgstr ""
msgid "If you encounter any bugs or would like to suggest new features, please use our bugtracker"
msgstr ""
+msgid "ERROR:"
+msgstr ""
+
+msgid "deleted recording"
+msgstr ""
+
msgid "List of recordings"
msgstr ""
@@ -570,6 +579,9 @@ msgstr ""
msgid "Click to view details."
msgstr ""
+msgid "Delete this recording from hard disc!"
+msgstr ""
+
msgid "play this recording."
msgstr ""
diff --git a/po/de_DE.po b/po/de_DE.po
index 9a97d89..7ea1556 100644
--- a/po/de_DE.po
+++ b/po/de_DE.po
@@ -60,22 +60,25 @@ msgid "On archive DVD No."
msgstr "Auf Archiv-DVD Nr."
msgid "Couldn't find channel or no channels available."
-msgstr ""
+msgstr "Kann das Programm nicht finden oder keine vorhanden."
msgid "Couldn't switch to channel."
-msgstr ""
+msgstr "Kann nicht zu dem Programm umschalten."
msgid "Couldn't find recording or no recordings available."
-msgstr ""
+msgstr "Kann die Aufnahme nicht finden oder keine Aufnahmen vorhanden."
msgid "Cannot control playback!"
-msgstr ""
+msgstr "Kann die Wiedergabe nicht steuern."
msgid "Not playing a recording."
-msgstr ""
+msgstr "Es wird keine Aufnahme abgespielt."
msgid "Not playing the same recording as from request."
-msgstr ""
+msgstr "Es wird nicht die selbe Aufnahme abgespielt."
+
+msgid "Attempt to delete recording currently in playback."
+msgstr "Versuch die gerade abgepielte Aufnahme zu löschen."
msgid "Epg error"
msgstr "EPG Fehler"
@@ -87,7 +90,7 @@ msgid "Channel has no schedule"
msgstr "Kanal hat keine Programminfos"
msgid "Wrong event id"
-msgstr ""
+msgstr "Fehlerhafte Sendungs Id"
msgid "Required minimum version of epgsearch: "
msgstr "Benötigte Mindestversion von epgsearch: "
@@ -563,6 +566,12 @@ msgstr "Fehlerberichte und Vorschläge"
msgid "If you encounter any bugs or would like to suggest new features, please use our bugtracker"
msgstr "Für Fehler oder Verbesserungsvorschläge steht unser Bugtracker bereit"
+msgid "ERROR:"
+msgstr "FEHLER:"
+
+msgid "deleted recording"
+msgstr "Gelöschte Aufnahme"
+
msgid "List of recordings"
msgstr "Liste der Aufnahmen"
@@ -572,6 +581,9 @@ msgstr "Keine Aufnahmen vorhanden"
msgid "Click to view details."
msgstr "Für Details klicken."
+msgid "Delete this recording from hard disc!"
+msgstr "Diese Aufnahme von der Festplatte löschen!"
+
msgid "play this recording."
msgstr "Diese Aufnahme abspielen."
@@ -748,5 +760,3 @@ msgstr "Ausführliche Ansicht"
msgid "List view"
msgstr "Listenansicht"
-
-
diff --git a/po/el_GR.po b/po/el_GR.po
index 42121f7..abb34e8 100644
--- a/po/el_GR.po
+++ b/po/el_GR.po
@@ -75,6 +75,9 @@ msgstr ""
msgid "Not playing the same recording as from request."
msgstr ""
+msgid "Attempt to delete recording currently in playback."
+msgstr ""
+
msgid "Epg error"
msgstr ""
@@ -561,6 +564,12 @@ msgstr ""
msgid "If you encounter any bugs or would like to suggest new features, please use our bugtracker"
msgstr ""
+msgid "ERROR:"
+msgstr ""
+
+msgid "deleted recording"
+msgstr ""
+
msgid "List of recordings"
msgstr ""
@@ -570,6 +579,9 @@ msgstr ""
msgid "Click to view details."
msgstr ""
+msgid "Delete this recording from hard disc!"
+msgstr ""
+
msgid "play this recording."
msgstr ""
diff --git a/po/es_ES.po b/po/es_ES.po
index 32fea29..2b2261d 100644
--- a/po/es_ES.po
+++ b/po/es_ES.po
@@ -75,6 +75,9 @@ msgstr ""
msgid "Not playing the same recording as from request."
msgstr ""
+msgid "Attempt to delete recording currently in playback."
+msgstr ""
+
msgid "Epg error"
msgstr ""
@@ -561,6 +564,12 @@ msgstr ""
msgid "If you encounter any bugs or would like to suggest new features, please use our bugtracker"
msgstr ""
+msgid "ERROR:"
+msgstr ""
+
+msgid "deleted recording"
+msgstr ""
+
msgid "List of recordings"
msgstr ""
@@ -570,6 +579,9 @@ msgstr ""
msgid "Click to view details."
msgstr ""
+msgid "Delete this recording from hard disc!"
+msgstr ""
+
msgid "play this recording."
msgstr ""
diff --git a/po/et_EE.po b/po/et_EE.po
index ed429dc..e6f3ded 100644
--- a/po/et_EE.po
+++ b/po/et_EE.po
@@ -75,6 +75,9 @@ msgstr ""
msgid "Not playing the same recording as from request."
msgstr ""
+msgid "Attempt to delete recording currently in playback."
+msgstr ""
+
msgid "Epg error"
msgstr ""
@@ -561,6 +564,12 @@ msgstr ""
msgid "If you encounter any bugs or would like to suggest new features, please use our bugtracker"
msgstr ""
+msgid "ERROR:"
+msgstr ""
+
+msgid "deleted recording"
+msgstr ""
+
msgid "List of recordings"
msgstr ""
@@ -570,6 +579,9 @@ msgstr ""
msgid "Click to view details."
msgstr ""
+msgid "Delete this recording from hard disc!"
+msgstr ""
+
msgid "play this recording."
msgstr ""
diff --git a/po/fi_FI.po b/po/fi_FI.po
index b3784aa..4dad27c 100644
--- a/po/fi_FI.po
+++ b/po/fi_FI.po
@@ -75,6 +75,9 @@ msgstr "Tallennetta ei toisteta."
msgid "Not playing the same recording as from request."
msgstr "Pyydettyä tallennetta ei toisteta."
+msgid "Attempt to delete recording currently in playback."
+msgstr ""
+
msgid "Epg error"
msgstr "Ohjelmaoppaan virhe"
@@ -561,6 +564,13 @@ msgstr "Virheraportoinnit ja parannusehdotukset"
msgid "If you encounter any bugs or would like to suggest new features, please use our bugtracker"
msgstr "Voit raportoida sekä virheet että parannusehdotukset suoraan havaintotietokantaan"
+msgid "ERROR:"
+msgstr ""
+
+#, fuzzy
+msgid "deleted recording"
+msgstr "Sarjatallennus"
+
msgid "List of recordings"
msgstr "Tallennelistaus"
@@ -570,6 +580,10 @@ msgstr "Tallenteita ei löydy"
msgid "Click to view details."
msgstr "Napsauta katsoaksesi lisätietoja."
+#, fuzzy
+msgid "Delete this recording from hard disc!"
+msgstr "Poista tallenteet ... päivän jälkeen"
+
msgid "play this recording."
msgstr "Toista tallenne"
@@ -746,4 +760,3 @@ msgstr "Ruudukkonäkymä"
msgid "List view"
msgstr "Listanäkymä"
-
diff --git a/po/fr_FR.po b/po/fr_FR.po
index 64c71c8..d78e239 100644
--- a/po/fr_FR.po
+++ b/po/fr_FR.po
@@ -79,6 +79,9 @@ msgstr ""
msgid "Not playing the same recording as from request."
msgstr ""
+msgid "Attempt to delete recording currently in playback."
+msgstr ""
+
msgid "Epg error"
msgstr ""
@@ -565,6 +568,13 @@ msgstr "Bogues et suggestions"
msgid "If you encounter any bugs or would like to suggest new features, please use our bugtracker"
msgstr "Si vous rencontrez n'importe quels bogue ou voudriez suggérer de nouveaux dispositifs, employer notre bugtracker svp"
+msgid "ERROR:"
+msgstr ""
+
+#, fuzzy
+msgid "deleted recording"
+msgstr "Enregistrement de série"
+
msgid "List of recordings"
msgstr "Liste des enregistrements"
@@ -574,6 +584,10 @@ msgstr "Pas d'enregistrement"
msgid "Click to view details."
msgstr "Clic pour voire les détails."
+#, fuzzy
+msgid "Delete this recording from hard disc!"
+msgstr "Effacer l'enregistrement après ... jours"
+
msgid "play this recording."
msgstr "lire cette enregistrement."
@@ -751,5 +765,3 @@ msgstr "Vue détailée"
msgid "List view"
msgstr "Vue en liste"
-
-
diff --git a/po/hr_HR.po b/po/hr_HR.po
index 90897ca..33c6d1a 100644
--- a/po/hr_HR.po
+++ b/po/hr_HR.po
@@ -76,6 +76,9 @@ msgstr ""
msgid "Not playing the same recording as from request."
msgstr ""
+msgid "Attempt to delete recording currently in playback."
+msgstr ""
+
msgid "Epg error"
msgstr ""
@@ -562,6 +565,12 @@ msgstr ""
msgid "If you encounter any bugs or would like to suggest new features, please use our bugtracker"
msgstr ""
+msgid "ERROR:"
+msgstr ""
+
+msgid "deleted recording"
+msgstr ""
+
msgid "List of recordings"
msgstr ""
@@ -571,6 +580,9 @@ msgstr ""
msgid "Click to view details."
msgstr ""
+msgid "Delete this recording from hard disc!"
+msgstr ""
+
msgid "play this recording."
msgstr ""
diff --git a/po/hu_HU.po b/po/hu_HU.po
index c10fb6c..2d84f00 100644
--- a/po/hu_HU.po
+++ b/po/hu_HU.po
@@ -76,6 +76,9 @@ msgstr ""
msgid "Not playing the same recording as from request."
msgstr ""
+msgid "Attempt to delete recording currently in playback."
+msgstr ""
+
msgid "Epg error"
msgstr ""
@@ -562,6 +565,12 @@ msgstr ""
msgid "If you encounter any bugs or would like to suggest new features, please use our bugtracker"
msgstr ""
+msgid "ERROR:"
+msgstr ""
+
+msgid "deleted recording"
+msgstr ""
+
msgid "List of recordings"
msgstr ""
@@ -571,6 +580,9 @@ msgstr ""
msgid "Click to view details."
msgstr ""
+msgid "Delete this recording from hard disc!"
+msgstr ""
+
msgid "play this recording."
msgstr ""
diff --git a/po/it_IT.po b/po/it_IT.po
index bb221a5..d2b8c0c 100644
--- a/po/it_IT.po
+++ b/po/it_IT.po
@@ -77,6 +77,9 @@ msgstr "Nessuna registrazione in riproduzione."
msgid "Not playing the same recording as from request."
msgstr "Riproduzione di una registrazione diversa da quella richiesta."
+msgid "Attempt to delete recording currently in playback."
+msgstr ""
+
msgid "Epg error"
msgstr "Errore EPG"
@@ -563,6 +566,13 @@ msgstr "Rapporto errori e proposte"
msgid "If you encounter any bugs or would like to suggest new features, please use our bugtracker"
msgstr "Se riscontri degli errori o vuoi chiedere nuove funzioni utilizza il nostro bugtracker"
+msgid "ERROR:"
+msgstr ""
+
+#, fuzzy
+msgid "deleted recording"
+msgstr "Registrazione serie"
+
msgid "List of recordings"
msgstr "Lista registrazioni"
@@ -572,6 +582,10 @@ msgstr "Nessuna registrazione"
msgid "Click to view details."
msgstr "Clicca per vedere i dettagli."
+#, fuzzy
+msgid "Delete this recording from hard disc!"
+msgstr "Cancella registrazione dopo ... giorni"
+
msgid "play this recording."
msgstr "Riproduci questa registrazione."
@@ -748,5 +762,3 @@ msgstr "Vedi come dettagli"
msgid "List view"
msgstr "Vedi come elenco"
-
-
diff --git a/po/nl_NL.po b/po/nl_NL.po
index a51766c..b8a370a 100644
--- a/po/nl_NL.po
+++ b/po/nl_NL.po
@@ -78,6 +78,9 @@ msgstr ""
msgid "Not playing the same recording as from request."
msgstr ""
+msgid "Attempt to delete recording currently in playback."
+msgstr ""
+
msgid "Epg error"
msgstr ""
@@ -564,6 +567,13 @@ msgstr ""
msgid "If you encounter any bugs or would like to suggest new features, please use our bugtracker"
msgstr ""
+msgid "ERROR:"
+msgstr ""
+
+#, fuzzy
+msgid "deleted recording"
+msgstr "Serie's opnemen"
+
msgid "List of recordings"
msgstr ""
@@ -573,6 +583,9 @@ msgstr ""
msgid "Click to view details."
msgstr ""
+msgid "Delete this recording from hard disc!"
+msgstr ""
+
msgid "play this recording."
msgstr ""
@@ -750,4 +763,3 @@ msgstr ""
msgid "List view"
msgstr ""
-
diff --git a/po/nn_NO.po b/po/nn_NO.po
index dcc1125..3a2c5a2 100644
--- a/po/nn_NO.po
+++ b/po/nn_NO.po
@@ -76,6 +76,9 @@ msgstr ""
msgid "Not playing the same recording as from request."
msgstr ""
+msgid "Attempt to delete recording currently in playback."
+msgstr ""
+
msgid "Epg error"
msgstr ""
@@ -562,6 +565,12 @@ msgstr ""
msgid "If you encounter any bugs or would like to suggest new features, please use our bugtracker"
msgstr ""
+msgid "ERROR:"
+msgstr ""
+
+msgid "deleted recording"
+msgstr ""
+
msgid "List of recordings"
msgstr ""
@@ -571,6 +580,9 @@ msgstr ""
msgid "Click to view details."
msgstr ""
+msgid "Delete this recording from hard disc!"
+msgstr ""
+
msgid "play this recording."
msgstr ""
diff --git a/po/pl_PL.po b/po/pl_PL.po
index 9ba7158..585ddbc 100644
--- a/po/pl_PL.po
+++ b/po/pl_PL.po
@@ -75,6 +75,9 @@ msgstr ""
msgid "Not playing the same recording as from request."
msgstr ""
+msgid "Attempt to delete recording currently in playback."
+msgstr ""
+
msgid "Epg error"
msgstr ""
@@ -561,6 +564,12 @@ msgstr ""
msgid "If you encounter any bugs or would like to suggest new features, please use our bugtracker"
msgstr ""
+msgid "ERROR:"
+msgstr ""
+
+msgid "deleted recording"
+msgstr ""
+
msgid "List of recordings"
msgstr ""
@@ -570,6 +579,9 @@ msgstr ""
msgid "Click to view details."
msgstr ""
+msgid "Delete this recording from hard disc!"
+msgstr ""
+
msgid "play this recording."
msgstr ""
diff --git a/po/pt_PT.po b/po/pt_PT.po
index 40e911e..ba393ae 100644
--- a/po/pt_PT.po
+++ b/po/pt_PT.po
@@ -75,6 +75,9 @@ msgstr ""
msgid "Not playing the same recording as from request."
msgstr ""
+msgid "Attempt to delete recording currently in playback."
+msgstr ""
+
msgid "Epg error"
msgstr ""
@@ -561,6 +564,12 @@ msgstr ""
msgid "If you encounter any bugs or would like to suggest new features, please use our bugtracker"
msgstr ""
+msgid "ERROR:"
+msgstr ""
+
+msgid "deleted recording"
+msgstr ""
+
msgid "List of recordings"
msgstr ""
@@ -570,6 +579,9 @@ msgstr ""
msgid "Click to view details."
msgstr ""
+msgid "Delete this recording from hard disc!"
+msgstr ""
+
msgid "play this recording."
msgstr ""
diff --git a/po/ro_RO.po b/po/ro_RO.po
index 1e60598..707494a 100644
--- a/po/ro_RO.po
+++ b/po/ro_RO.po
@@ -76,6 +76,9 @@ msgstr ""
msgid "Not playing the same recording as from request."
msgstr ""
+msgid "Attempt to delete recording currently in playback."
+msgstr ""
+
msgid "Epg error"
msgstr ""
@@ -562,6 +565,12 @@ msgstr ""
msgid "If you encounter any bugs or would like to suggest new features, please use our bugtracker"
msgstr ""
+msgid "ERROR:"
+msgstr ""
+
+msgid "deleted recording"
+msgstr ""
+
msgid "List of recordings"
msgstr ""
@@ -571,6 +580,9 @@ msgstr ""
msgid "Click to view details."
msgstr ""
+msgid "Delete this recording from hard disc!"
+msgstr ""
+
msgid "play this recording."
msgstr ""
diff --git a/po/ru_RU.po b/po/ru_RU.po
index 7158092..85f6b38 100644
--- a/po/ru_RU.po
+++ b/po/ru_RU.po
@@ -75,6 +75,9 @@ msgstr ""
msgid "Not playing the same recording as from request."
msgstr ""
+msgid "Attempt to delete recording currently in playback."
+msgstr ""
+
msgid "Epg error"
msgstr ""
@@ -561,6 +564,12 @@ msgstr ""
msgid "If you encounter any bugs or would like to suggest new features, please use our bugtracker"
msgstr ""
+msgid "ERROR:"
+msgstr ""
+
+msgid "deleted recording"
+msgstr ""
+
msgid "List of recordings"
msgstr ""
@@ -570,6 +579,9 @@ msgstr ""
msgid "Click to view details."
msgstr ""
+msgid "Delete this recording from hard disc!"
+msgstr ""
+
msgid "play this recording."
msgstr ""
diff --git a/po/sl_SI.po b/po/sl_SI.po
index 87be461..53049c1 100644
--- a/po/sl_SI.po
+++ b/po/sl_SI.po
@@ -76,6 +76,9 @@ msgstr ""
msgid "Not playing the same recording as from request."
msgstr ""
+msgid "Attempt to delete recording currently in playback."
+msgstr ""
+
msgid "Epg error"
msgstr ""
@@ -562,6 +565,12 @@ msgstr ""
msgid "If you encounter any bugs or would like to suggest new features, please use our bugtracker"
msgstr ""
+msgid "ERROR:"
+msgstr ""
+
+msgid "deleted recording"
+msgstr ""
+
msgid "List of recordings"
msgstr ""
@@ -571,6 +580,9 @@ msgstr ""
msgid "Click to view details."
msgstr ""
+msgid "Delete this recording from hard disc!"
+msgstr ""
+
msgid "play this recording."
msgstr ""
diff --git a/po/sv_SE.po b/po/sv_SE.po
index c97fce4..b01dc78 100644
--- a/po/sv_SE.po
+++ b/po/sv_SE.po
@@ -76,6 +76,9 @@ msgstr ""
msgid "Not playing the same recording as from request."
msgstr ""
+msgid "Attempt to delete recording currently in playback."
+msgstr ""
+
msgid "Epg error"
msgstr ""
@@ -562,6 +565,12 @@ msgstr ""
msgid "If you encounter any bugs or would like to suggest new features, please use our bugtracker"
msgstr ""
+msgid "ERROR:"
+msgstr ""
+
+msgid "deleted recording"
+msgstr ""
+
msgid "List of recordings"
msgstr ""
@@ -571,6 +580,9 @@ msgstr ""
msgid "Click to view details."
msgstr ""
+msgid "Delete this recording from hard disc!"
+msgstr ""
+
msgid "play this recording."
msgstr ""
diff --git a/po/tr_TR.po b/po/tr_TR.po
index 356a3f1..810842b 100644
--- a/po/tr_TR.po
+++ b/po/tr_TR.po
@@ -76,6 +76,9 @@ msgstr ""
msgid "Not playing the same recording as from request."
msgstr ""
+msgid "Attempt to delete recording currently in playback."
+msgstr ""
+
msgid "Epg error"
msgstr ""
@@ -562,6 +565,12 @@ msgstr ""
msgid "If you encounter any bugs or would like to suggest new features, please use our bugtracker"
msgstr ""
+msgid "ERROR:"
+msgstr ""
+
+msgid "deleted recording"
+msgstr ""
+
msgid "List of recordings"
msgstr ""
@@ -571,6 +580,9 @@ msgstr ""
msgid "Click to view details."
msgstr ""
+msgid "Delete this recording from hard disc!"
+msgstr ""
+
msgid "play this recording."
msgstr ""
diff --git a/recman.cpp b/recman.cpp
index 153e9dd..c7010e7 100644
--- a/recman.cpp
+++ b/recman.cpp
@@ -90,6 +90,16 @@ namespace vdrlive {
return 0;
}
+ void RecordingsManager::DeleteRecording(cRecording const * recording) const
+ {
+ if (!recording)
+ return;
+
+ string name(recording->FileName());
+ const_cast<cRecording *>(recording)->Delete();
+ Recordings.DelByName(name.c_str());
+ }
+
bool RecordingsManager::IsArchived(cRecording const * recording)
{
string filename = recording->FileName();
@@ -151,7 +161,7 @@ namespace vdrlive {
// StateChanged must be executed every time, so not part of
// the short cut evaluation in the if statement below.
bool stateChanged = Recordings.StateChanged(m_recordingsState);
- if ((!m_recTree) || (!m_recList) || stateChanged) {
+ if (stateChanged || (!m_recTree) || (!m_recList)) {
if (stateChanged) {
m_recTree.reset();
m_recList.reset();
@@ -197,12 +207,12 @@ namespace vdrlive {
RecordingsItem(name, parent),
m_level(level)
{
- esyslog("REC: C: dir %s -> %s", name.c_str(), parent ? parent->Name().c_str() : "ROOT");
+ dsyslog("REC: C: dir %s -> %s", name.c_str(), parent ? parent->Name().c_str() : "ROOT");
}
RecordingsItemDir::~RecordingsItemDir()
{
- esyslog("REC: D: dir %s", Name().c_str());
+ dsyslog("REC: D: dir %s", Name().c_str());
}
@@ -214,12 +224,12 @@ namespace vdrlive {
m_recording(recording),
m_id(id)
{
- esyslog("REC: C: rec %s -> %s", name.c_str(), parent->Name().c_str());
+ dsyslog("REC: C: rec %s -> %s", name.c_str(), parent->Name().c_str());
}
RecordingsItemRec::~RecordingsItemRec()
{
- esyslog("REC: D: rec %s", Name().c_str());
+ dsyslog("REC: D: rec %s", Name().c_str());
}
time_t RecordingsItemRec::StartTime() const
@@ -340,6 +350,12 @@ namespace vdrlive {
/**
* Implementation of class RecordingsTreePtr:
*/
+ RecordingsTreePtr::RecordingsTreePtr() :
+ shared_ptr<RecordingsTree>(),
+ m_recManPtr()
+ {
+ }
+
RecordingsTreePtr::RecordingsTreePtr(RecordingsManagerPtr recManPtr, std::tr1::shared_ptr< RecordingsTree > recTree) :
shared_ptr<RecordingsTree>(recTree),
m_recManPtr(recManPtr)
diff --git a/recman.h b/recman.h
index 0f8b8c5..45265b3 100644
--- a/recman.h
+++ b/recman.h
@@ -25,7 +25,7 @@ namespace vdrlive {
typedef std::tr1::shared_ptr< RecordingsManager > RecordingsManagerPtr;
typedef std::tr1::shared_ptr< RecordingsItem > RecordingsItemPtr;
- // typedef std::tr1::weak_ptr< RecordingsItem > RecordingsItemWeakPtr;
+ typedef std::tr1::weak_ptr< RecordingsItem > RecordingsItemWeakPtr;
typedef std::multimap< std::string, RecordingsItemPtr > RecordingsMap;
@@ -69,6 +69,12 @@ namespace vdrlive {
cRecording const* GetByMd5Hash(std::string const & hash) const;
/**
+ * Delete a recording with the given hash according to
+ * VDRs recording deletion mechanisms.
+ */
+ void DeleteRecording(cRecording const * recording) const;
+
+ /**
* Determine wether the recording has been archived on
* removable media (e.g. DVD-ROM)
*/
@@ -127,7 +133,7 @@ namespace vdrlive {
private:
std::string m_name;
RecordingsMap m_entries;
- RecordingsItemPtr m_parent;
+ RecordingsItemWeakPtr m_parent;
};
@@ -217,6 +223,7 @@ namespace vdrlive {
RecordingsTreePtr(RecordingsManagerPtr recManPtr, std::tr1::shared_ptr< RecordingsTree > recTree);
public:
+ RecordingsTreePtr();
virtual ~RecordingsTreePtr();
private:
diff --git a/tasks.cpp b/tasks.cpp
index d7acaf3..9f20190 100644
--- a/tasks.cpp
+++ b/tasks.cpp
@@ -161,7 +161,7 @@ void BackwardRecordingTask::Action()
RecordingsManagerPtr recordings = LiveRecordingsManager();
cRecording const* recording = recordings->GetByMd5Hash( m_recording );
if ( recording == 0 ) {
- SetError( tr("Couldn't find recording or no recordings available.") );
+ SetError(tr("Couldn't find recording or no recordings available."));
return;
}
@@ -186,6 +186,27 @@ void BackwardRecordingTask::Action()
replayControl->Backward();
}
+
+void RemoveRecordingTask::Action()
+{
+ RecordingsManagerPtr recordings = LiveRecordingsManager();
+ cRecording const * recording = recordings->GetByMd5Hash( m_recording );
+ if ( recording == 0 ) {
+ SetError( tr("Couldn't find recording or no recordings available.") );
+ return;
+ }
+
+ m_recName = recording->Name();
+
+ const char *current = NowReplaying();
+ if (current && (0 == strcmp(current, recording->FileName()))) {
+ SetError(tr("Attempt to delete recording currently in playback."));
+ return;
+ }
+
+ recordings->DeleteRecording(recording);
+}
+
TaskManager::TaskManager()
{
}
diff --git a/tasks.h b/tasks.h
index 2a269fd..787be96 100644
--- a/tasks.h
+++ b/tasks.h
@@ -139,6 +139,21 @@ public:
virtual void Action();
};
+class RemoveRecordingTask: public RecordingTask
+{
+public:
+ explicit RemoveRecordingTask( std::string const& recording )
+ : RecordingTask(recording)
+ {}
+
+ virtual void Action();
+
+ std::string const & RecName() const { return m_recName; }
+
+private:
+ std::string m_recName;
+};
+
TaskManager& LiveTaskManager();