X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/574f425cc1ebece0aa5f09fb77a8cb7ad0310a1f..89b408592c0f5756b0049a60832761646477cfa0:/lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py
diff --git a/lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py b/lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py
index 327f08ed..65361adf 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 = """