From a2ec6f1e1fc1fee8b941084c1ad0f3fd8f0c587e Mon Sep 17 00:00:00 2001 From: DYefremov Date: Wed, 30 Jan 2019 09:10:43 +0300 Subject: [PATCH] small changes of moving from keyboard --- app/ui/main_app_window.py | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/app/ui/main_app_window.py b/app/ui/main_app_window.py index 539e2b7c..d4ccd2f1 100644 --- a/app/ui/main_app_window.py +++ b/app/ui/main_app_window.py @@ -73,8 +73,6 @@ class Application(Gtk.Application): "on_bouquets_selection": self.on_bouquets_selection, "on_satellite_editor_show": self.on_satellite_editor_show, "on_services_selection": self.on_services_selection, - "on_up": self.on_up, - "on_down": self.on_down, "on_fav_cut": self.on_fav_cut, "on_bouquets_cut": self.on_bouquets_cut, "on_services_copy": self.on_services_copy, @@ -328,12 +326,6 @@ class Application(Gtk.Application): """ Stores new size properties for app window after resize """ self._options["window_size"] = window.get_size() - def on_up(self, item): - self.move_items(Gdk.KEY_Up) - - def on_down(self, item): - self.move_items(Gdk.KEY_Down) - @run_idle def on_about_app(self, item): show_dialog(DialogType.ABOUT, self._main_window) @@ -1043,11 +1035,14 @@ class Application(Gtk.Application): key_code = event.hardware_keycode if not KeyboardKey.value_exist(key_code): return + key = KeyboardKey(key_code) ctrl = event.state & Gdk.ModifierType.CONTROL_MASK model_name, model = get_model_data(view) - if ctrl and key is KeyboardKey.C: + if ctrl and key in MOVE_KEYS: + self.move_items(key) + elif ctrl and key is KeyboardKey.C: if model_name == self._SERVICE_LIST_NAME: self.on_copy(view, ViewTarget.FAV) elif model_name == self._FAV_LIST_NAME: @@ -1072,14 +1067,12 @@ class Application(Gtk.Application): key_code = event.hardware_keycode if not KeyboardKey.value_exist(key_code): return + key = KeyboardKey(key_code) ctrl = event.state & Gdk.ModifierType.CONTROL_MASK - alt = event.state & Gdk.ModifierType.MOD1_MASK model_name, model = get_model_data(view) - if ctrl and key in MOVE_KEYS: - self.move_items(key) - elif ctrl and key is KeyboardKey.INSERT: + if ctrl and key is KeyboardKey.INSERT: # Move items from app to fav list if model_name == self._SERVICE_LIST_NAME: self.on_to_fav_copy(view)