X-Git-Url: http://code.vuplus.com/gitweb/?a=blobdiff_plain;f=lib%2Fpython%2FPlugins%2FSystemPlugins%2FSoftwareManager%2FBackupRestore.py;h=65361adfa01f262a05a273fb4c04e27e88358e26;hb=daceed220bdfbb2bd48d08372dbb77d450a8be61;hp=947452e920d227aa2d583d4469906a359ba81b78;hpb=d58ca4cf34b7621aea4e2c1ff07bed6b2cd6b763;p=vuplus_dvbapp
diff --git a/lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py b/lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py
index 947452e..65361ad 100755
--- a/lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py
+++ b/lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py
@@ -19,7 +19,7 @@ from datetime import date
config.plugins.configurationbackup = ConfigSubsection()
config.plugins.configurationbackup.backuplocation = ConfigText(default = '/media/hdd/', visible_width = 50, fixed_size = False)
-config.plugins.configurationbackup.backupdirs = ConfigLocations(default=['/etc/enigma2/', '/etc/network/interfaces', '/etc/wpa_supplicant.conf'])
+config.plugins.configurationbackup.backupdirs = ConfigLocations(default=['/etc/enigma2/', '/etc/network/interfaces', '/etc/wpa_supplicant.conf', '/etc/resolv.conf', '/etc/default_gw', '/etc/hostname'])
def getBackupPath():
backuppath = config.plugins.configurationbackup.backuplocation.value
@@ -100,12 +100,12 @@ class BackupSelection(Screen):
skin = """
-
-
-
-
-
-
+
+
+
+
+
+
"""
def __init__(self, session):
@@ -187,11 +187,13 @@ class BackupSelection(Screen):
class RestoreMenu(Screen):
skin = """
-
-
-
-
-
+
+
+
+
+
+
+
"""
def __init__(self, session, plugin_path):
@@ -200,8 +202,7 @@ class RestoreMenu(Screen):
self["canceltext"] = Label(_("Cancel"))
self["restoretext"] = Label(_("Restore"))
- self["restore"] = Pixmap()
- self["cancel"] = Pixmap()
+ self["deletetext"] = Label(_("Delete"))
self.sel = []
self.val = []
@@ -219,7 +220,8 @@ class RestoreMenu(Screen):
self["shortcuts"] = ActionMap(["ShortcutActions"],
{
"red": self.keyCancel,
- "yellow": self.KeyOk,
+ "green": self.KeyOk,
+ "yellow": self.deleteFile,
})
self.flist = []
self["filelist"] = MenuList(self.flist)
@@ -247,7 +249,7 @@ class RestoreMenu(Screen):
def KeyOk(self):
if (self.exe == False) and (self.entry == True):
self.sel = self["filelist"].getCurrent()
- self.val = self.path + self.sel
+ self.val = self.path + "/" + self.sel
self.session.openWithCallback(self.startRestore, MessageBox, _("Are you sure you want to restore\nfollowing backup:\n" + self.sel + "\nSystem will restart after the restore!"))
def keyCancel(self):
@@ -258,8 +260,20 @@ class RestoreMenu(Screen):
self.exe = True
self.session.open(Console, title = _("Restore running"), cmdlist = ["tar -xzvf " + self.path + "/" + self.sel + " -C /", "killall -9 enigma2"])
- def Exit(self):
- self.close()
+ def deleteFile(self):
+ if (self.exe == False) and (self.entry == True):
+ self.sel = self["filelist"].getCurrent()
+ self.val = self.path + "/" + self.sel
+ self.session.openWithCallback(self.startDelete, MessageBox, _("Are you sure you want to delete\nfollowing backup:\n" + self.sel ))
+
+ def startDelete(self, ret = False):
+ if (ret == True):
+ self.exe = True
+ print "removing:",self.val
+ if (path.exists(self.val) == True):
+ remove(self.val)
+ self.exe = False
+ self.fill_list()
class RestoreScreen(Screen, ConfigListScreen):
skin = """
@@ -308,5 +322,3 @@ class RestoreScreen(Screen, ConfigListScreen):
def runAsync(self, finished_cb):
self.finished_cb = finished_cb
self.doRestore()
-
-
\ No newline at end of file