X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=grc%2Fsrc%2Fgui%2FActionHandler.py;h=91dd0fb454e89fb038ef53bd245bf5e34bf4f2b7;hb=88470f93a4d2e9e6d7e5d39dac52115de0e5d1ca;hp=85bfcb34e0e5c21e10fdf3a0458b99f0bdc86b4d;hpb=277aa8d20c9db1c3de915d284db9e420f3d9f2f6;p=debian%2Fgnuradio diff --git a/grc/src/gui/ActionHandler.py b/grc/src/gui/ActionHandler.py index 85bfcb34..91dd0fb4 100644 --- a/grc/src/gui/ActionHandler.py +++ b/grc/src/gui/ActionHandler.py @@ -32,7 +32,7 @@ from .. utils import ParseXML import random from .. platforms.gui.Platform import Platform from MainWindow import MainWindow -from Dialogs import PreferencesDialog, AboutDialog +from Dialogs import AboutDialog from FileDialogs import OpenFlowGraphFileDialog, SaveFlowGraphFileDialog, SaveImageFileDialog gobject.threads_init() @@ -53,9 +53,6 @@ class ActionHandler: """ self.clipboard = None platform = Platform(platform) - #setup icon using icon theme - try: gtk.window_set_default_icon(gtk.IconTheme().load_icon('gnuradio-grc', 256, 0)) - except: pass for action in Actions.get_all_actions(): action.connect('activate', self._handle_actions) #setup the main window self.main_window = MainWindow(self.handle_states, platform) @@ -77,13 +74,13 @@ class ActionHandler: """ Handle key presses from the keyboard and translate key combos into actions. This key press handler is called before the gtk accelerators kick in. - This handler ensures that key presses without a mod mask, only pass to the accelerators - if the flow graph is in focus and something is selected. + This handler ensures that key presses without a mod mask, + only pass to the accelerators if the flow graph is in focus. This function also handles keys that accelerators refuse to handle: left/right, and keys that are not registered with an accelerator: +/-. @return false to let the accelerators handle the key action """ - if self.get_focus_flag() and self.get_flow_graph().is_selected(): + if self.get_focus_flag(): try: self.handle_states({ 'Left': Actions.BLOCK_ROTATE_LEFT, @@ -97,9 +94,9 @@ class ActionHandler: 'KP_Subtract': Actions.PORT_CONTROLLER_DEC, }[gtk.gdk.keyval_name(event.keyval)]) return True - #focus + selection: always return false for accelerator to handle + #focus: always return false for accelerator to handle except: return False - #no focus + selection: only allow accelerator to handle when a mod is used + #no focus: only allow accelerator to handle when a mod is used return not event.state def _quit(self, window, event): @@ -141,9 +138,9 @@ class ActionHandler: Actions.APPLICATION_QUIT, Actions.FLOW_GRAPH_NEW, Actions.FLOW_GRAPH_OPEN, Actions.FLOW_GRAPH_SAVE_AS, Actions.FLOW_GRAPH_CLOSE, Actions.ABOUT_WINDOW_DISPLAY, - Actions.PREFS_WINDOW_DISPLAY, Actions.FLOW_GRAPH_SCREEN_CAPTURE, + Actions.FLOW_GRAPH_SCREEN_CAPTURE, ): Actions.get_action_from_name(action).set_sensitive(True) - if not self.init_file_paths and Preferences.restore_files(): + if not self.init_file_paths: self.init_file_paths = Preferences.files_open() if not self.init_file_paths: self.init_file_paths = [''] for file_path in self.init_file_paths: @@ -240,9 +237,6 @@ class ActionHandler: ################################################## # Window stuff ################################################## - elif state == Actions.PREFS_WINDOW_DISPLAY: - PreferencesDialog() - self.get_flow_graph().update() elif state == Actions.ABOUT_WINDOW_DISPLAY: AboutDialog() ##################################################