mirror of
https://github.com/DYefremov/DemonEditor.git
synced 2026-05-07 11:07:26 +02:00
minor fixes
This commit is contained in:
@@ -11,7 +11,7 @@ from app.eparser.ecommons import PLS_MODE, get_key_by_value
|
||||
from app.tools.satellites import SatellitesParser, SatelliteSource
|
||||
from .search import SearchProvider
|
||||
from .uicommons import Gtk, Gdk, UI_RESOURCES_PATH, TEXT_DOMAIN, MOVE_KEYS, KeyboardKey, IS_GNOME_SESSION, MOD_MASK
|
||||
from .dialogs import show_dialog, DialogType, get_dialogs_string
|
||||
from .dialogs import show_dialog, DialogType, get_dialogs_string, get_chooser_dialog
|
||||
from .main_helper import move_items, scroll_to, append_text_to_tview, get_base_model, on_popup_menu
|
||||
|
||||
_UI_PATH = UI_RESOURCES_PATH + "satellites_dialog.glade"
|
||||
@@ -84,27 +84,17 @@ class SatellitesDialog:
|
||||
|
||||
@run_idle
|
||||
def on_open(self, model):
|
||||
response = self.get_file_dialog_response(Gtk.FileChooserAction.OPEN)
|
||||
if response == Gtk.ResponseType.CANCEL:
|
||||
response = get_chooser_dialog(self._window, self._settings, "*.xml", "satellites.xml")
|
||||
if response in (Gtk.ResponseType.CANCEL, Gtk.ResponseType.DELETE_EVENT):
|
||||
return
|
||||
|
||||
if not str(response).endswith("satellites.xml"):
|
||||
show_dialog(DialogType.ERROR, self._window, text="No satellites.xml file is selected!")
|
||||
return
|
||||
|
||||
self._data_path = response
|
||||
self.load_satellites_list(model)
|
||||
|
||||
def get_file_dialog_response(self, action: Gtk.FileChooserAction):
|
||||
file_filter = Gtk.FileFilter()
|
||||
file_filter.add_pattern("satellites.xml")
|
||||
file_filter.set_name("satellites.xml")
|
||||
response = show_dialog(dialog_type=DialogType.CHOOSER,
|
||||
transient=self._window,
|
||||
settings=self._settings,
|
||||
action_type=action,
|
||||
file_filter=file_filter)
|
||||
return response
|
||||
|
||||
@staticmethod
|
||||
def on_row_activated(view, path, column):
|
||||
if view.row_expanded(path):
|
||||
|
||||
@@ -671,7 +671,7 @@ class SettingsDialog:
|
||||
|
||||
@run_idle
|
||||
def add_theme(self, path, button):
|
||||
response = get_chooser_dialog(self._dialog, self._settings, "*.tar.*", "")
|
||||
response = get_chooser_dialog(self._dialog, self._settings, "*.xz", "Themes Archive [*.tar.xz]")
|
||||
if response in (Gtk.ResponseType.CANCEL, Gtk.ResponseType.DELETE_EVENT):
|
||||
return
|
||||
self._appearance_box.set_sensitive(False)
|
||||
@@ -683,7 +683,7 @@ class SettingsDialog:
|
||||
from shutil import unpack_archive
|
||||
|
||||
unpack_archive(src, dst)
|
||||
except (KeyError, EOFError) as e:
|
||||
except (KeyError, OSError) as e:
|
||||
self.show_info_message(str(e), Gtk.MessageType.ERROR)
|
||||
else:
|
||||
self.update_theme_button(button, dst)
|
||||
|
||||
Reference in New Issue
Block a user