diff --git a/app/ui/backup.py b/app/ui/backup.py
new file mode 100644
index 00000000..45ef8f37
--- /dev/null
+++ b/app/ui/backup.py
@@ -0,0 +1,41 @@
+import os
+
+from .uicommons import Gtk, UI_RESOURCES_PATH
+
+
+class BackupDialog:
+ def __init__(self, transient, backup_path):
+ handlers = {"on_extract": self.on_extract, "on_remove": self.on_remove}
+
+ builder = Gtk.Builder()
+ builder.set_translation_domain("demon-editor")
+ builder.add_from_file(UI_RESOURCES_PATH + "backup_dialog.glade")
+ builder.connect_signals(handlers)
+
+ self._dialog_window = builder.get_object("dialog_window")
+ self._dialog_window.set_transient_for(transient)
+ self._model = builder.get_object("main_list_store")
+ self._backup_path = backup_path
+ self.init_data()
+
+ def show(self):
+ self._dialog_window.show()
+
+ def init_data(self):
+ try:
+ files = os.listdir(self._backup_path)
+ except FileNotFoundError as e:
+ print(e)
+ else:
+ for file in filter(lambda x: x.endswith(".zip"), files):
+ self._model.append((file.rstrip(".zip"), False))
+
+ def on_extract(self, item):
+ pass
+
+ def on_remove(self, item):
+ pass
+
+
+if __name__ == "__main__":
+ pass
diff --git a/app/ui/backup_dialog.glade b/app/ui/backup_dialog.glade
new file mode 100644
index 00000000..ecacb3bf
--- /dev/null
+++ b/app/ui/backup_dialog.glade
@@ -0,0 +1,106 @@
+
+
+
+
+
+
+
diff --git a/app/ui/main_app_window.py b/app/ui/main_app_window.py
index e05cc1c0..29e70571 100644
--- a/app/ui/main_app_window.py
+++ b/app/ui/main_app_window.py
@@ -17,6 +17,7 @@ from app.eparser.enigma.bouquets import BqServiceType
from app.eparser.neutrino.bouquets import BqType
from app.properties import get_config, write_config, Profile
from app.tools.media import Player
+from app.ui.backup import BackupDialog
from .download_dialog import DownloadDialog
from .iptv import IptvDialog, SearchUnavailableDialog, IptvListConfigurationDialog
from .search import SearchProvider
@@ -104,6 +105,7 @@ class Application(Gtk.Application):
"on_locked": self.on_locked,
"on_model_changed": self.on_model_changed,
"on_import_m3u": self.on_import_m3u,
+ "on_backup_tool_show": self.on_backup_tool_show,
"on_insert_marker": self.on_insert_marker,
"on_fav_press": self.on_fav_press,
"on_locate_in_services": self.on_locate_in_services,
@@ -1248,6 +1250,12 @@ class Application(Gtk.Application):
bq_services.append(ch.fav_id)
next(self.update_bouquet_services(self._fav_model, None, self._bq_selected), False)
+ # ***************** Backup tool ****************#
+
+ def on_backup_tool_show(self, item):
+ """ Shows backup tool dialog """
+ BackupDialog(self._main_window, self._options.get(self._profile).get("data_dir_path", "") + "backup/").show()
+
# ***************** Player *********************#
def on_play_stream(self, item=None):
diff --git a/app/ui/main_window.glade b/app/ui/main_window.glade
index 75c73c8a..962f4868 100644
--- a/app/ui/main_window.glade
+++ b/app/ui/main_window.glade
@@ -735,7 +735,7 @@ Author: Dmitriy Yefremov
vertical
2
-
+
-
+
-
+
-
+
+
+ False
+ True
+ 3
+
+
+
+
@@ -788,7 +802,7 @@ Author: Dmitriy Yefremov
-
+
-
+
-
+
@@ -1001,7 +1015,7 @@ Author: Dmitriy Yefremov
@@ -1034,7 +1048,7 @@ Author: Dmitriy Yefremov
@@ -1055,7 +1069,7 @@ Author: Dmitriy Yefremov
@@ -1111,7 +1125,7 @@ Author: Dmitriy Yefremov
True
False
- go-jump
+ go-jump-symbolic
@@ -1139,7 +1153,7 @@ Author: Dmitriy Yefremov
@@ -1161,7 +1175,7 @@ Author: Dmitriy Yefremov
@@ -1193,14 +1207,14 @@ Author: Dmitriy Yefremov
False
True
- 5
+ 3
@@ -1214,14 +1228,14 @@ Author: Dmitriy Yefremov
False
True
- 6
+ 4
@@ -1235,14 +1249,35 @@ Author: Dmitriy Yefremov
False
True
- 7
+ 5
+
+
+
+
+
+ False
+ True
+ 6
@@ -1446,7 +1481,7 @@ Author: Dmitriy Yefremov
32
True
True
- edit-find-symbolic
+ system-search-symbolic
False
False
@@ -1539,7 +1574,7 @@ Author: Dmitriy Yefremov
32
True
True
- tools-check-spelling
+ tools-check-spelling-symbolic
False
False