diff --git a/app/properties.py b/app/properties.py
index a6f3a1a9..b27984d2 100644
--- a/app/properties.py
+++ b/app/properties.py
@@ -45,6 +45,7 @@ def get_default_settings():
"services_path": "/etc/enigma2/", "user_bouquet_path": "/etc/enigma2/",
"satellites_xml_path": "/etc/tuxbox/", "data_dir_path": DATA_PATH + "enigma2/",
"picons_path": "/usr/share/enigma2/picon", "picons_dir_path": DATA_PATH + "enigma2/picons/",
+ "backup_dir_path": DATA_PATH + "enigma2/backup/",
"backup_before_save": True, "backup_before_downloading": True,
"v5_support": False, "http_api_support": False,
"use_colors": True, "new_color": "rgb(255,230,204)", "extra_color": "rgb(179,230,204)"},
@@ -55,6 +56,7 @@ def get_default_settings():
"services_path": "/var/tuxbox/config/zapit/", "user_bouquet_path": "/var/tuxbox/config/zapit/",
"satellites_xml_path": "/var/tuxbox/config/", "data_dir_path": DATA_PATH + "neutrino/",
"picons_path": "/usr/share/tuxbox/neutrino/icons/logo/", "picons_dir_path": DATA_PATH + "neutrino/picons/",
+ "backup_dir_path": DATA_PATH + "neutrino/backup/",
"backup_before_save": True, "backup_before_downloading": True},
"profile": Profile.ENIGMA_2.value}
diff --git a/app/ui/backup.py b/app/ui/backup.py
index 09603d9d..6f611c11 100644
--- a/app/ui/backup.py
+++ b/app/ui/backup.py
@@ -7,7 +7,7 @@ from datetime import datetime
from enum import Enum
from app.commons import run_idle
-from app.properties import Profile
+from app.properties import Profile, get_default_settings
from app.ui.dialogs import show_dialog, DialogType
from app.ui.main_helper import append_text_to_tview
from .uicommons import Gtk, Gdk, UI_RESOURCES_PATH
@@ -19,22 +19,25 @@ class RestoreType(Enum):
class BackupDialog:
- def __init__(self, transient, data_path, profile, callback):
+ def __init__(self, transient, options, profile, callback):
handlers = {"on_restore_bouquets": self.on_restore_bouquets,
"on_restore_all": self.on_restore_all,
"on_remove": self.on_remove,
"on_view_popup_menu": self.on_view_popup_menu,
"on_info_button_toggled": self.on_info_button_toggled,
"on_info_bar_close": self.on_info_bar_close,
- "on_cursor_changed": self.on_cursor_changed}
+ "on_cursor_changed": self.on_cursor_changed,
+ "on_resize": self.on_resize}
builder = Gtk.Builder()
builder.set_translation_domain("demon-editor")
builder.add_from_file(UI_RESOURCES_PATH + "backup_dialog.glade")
builder.connect_signals(handlers)
- self._data_path = data_path
- self._backup_path = data_path + "backup/"
+ def_settings = get_default_settings().get(profile.value)
+ self._options = options.get(profile.value)
+ self._data_path = options.get("data_dir_path", def_settings["data_dir_path"])
+ self._backup_path = options.get("backup_dir_path", def_settings["backup_dir_path"])
self._profile = profile
self._open_data_callback = callback
self._dialog_window = builder.get_object("dialog_window")
@@ -46,6 +49,11 @@ class BackupDialog:
self._info_check_button = builder.get_object("info_check_button")
self._info_bar = builder.get_object("info_bar")
self._message_label = builder.get_object("message_label")
+ # Setting the last size of the dialog window if it was saved
+ window_size = self._options.get("backup_tool_window_size", None)
+ if window_size:
+ self._dialog_window.resize(*window_size)
+
self.init_data()
def show(self):
@@ -157,6 +165,10 @@ class BackupDialog:
self.show_info_message("Done!", Gtk.MessageType.INFO)
self._open_data_callback(self._data_path)
+ def on_resize(self, window):
+ if self._options:
+ self._options["backup_tool_window_size"] = window.get_size()
+
def backup_data(path):
""" Creating data backup from a folder at the specified path """
diff --git a/app/ui/backup_dialog.glade b/app/ui/backup_dialog.glade
index 94c95b86..87da6f06 100644
--- a/app/ui/backup_dialog.glade
+++ b/app/ui/backup_dialog.glade
@@ -50,6 +50,7 @@ Author: Dmitriy Yefremov
True
document-revert
center
+