def update_maximize_button(self): if self.full_screen: self.view['maximize_button'].set_label_widget(gui_helper_label.create_button_label(constants.BUTTON_COLLAPSE)) self.view['maximize_button'].set_tooltip_text("Un-maximize window") else: self.view['maximize_button'].set_label_widget(gui_helper_label.create_button_label(constants.BUTTON_EXP)) self.view['maximize_button'].set_tooltip_text("Maximize window")
def __init__(self): View.__init__(self) self._lock = threading.Lock() ###################################################### # Logging text view ###################################################### self.logging_console_view = LoggingConsoleView() self['console'].pack_start(self.logging_console_view.get_top_widget(), True, True, 0) self.logging_console_view.get_top_widget().show() ###################################################### # initial configuration of the console ###################################################### self['button_follow_logging'].set_active(global_gui_config.get_config_value('CONSOLE_FOLLOW_LOGGING', True)) self['button_show_verbose'].set_active(global_gui_config.get_config_value('LOGGING_SHOW_VERBOSE', True)) self['button_show_debug'].set_active(global_gui_config.get_config_value('LOGGING_SHOW_DEBUG', True)) self['button_show_info'].set_active(global_gui_config.get_config_value('LOGGING_SHOW_INFO', True)) self['button_show_warning'].set_active(global_gui_config.get_config_value('LOGGING_SHOW_WARNING', True)) self['button_show_error'].set_active(global_gui_config.get_config_value('LOGGING_SHOW_ERROR', True)) self['undock_console_button'].set_image(gui_helper_label.create_button_label(constants.BUTTON_UNDOCK)) self['undock_console_button'].set_tooltip_text("Undock debug console widget") self['console_hide_button'].set_image(gui_helper_label.create_button_label(constants.BUTTON_DOWNA)) gui_helper_label.ellipsize_labels_recursively(self['debug_console_button_hbox'])
def __init__(self, title): super().__init__( builder_filename=glade.get_glade_path('undocked_window.glade'), parent='undock_window') toolbar = Gtk.Toolbar() toolbar.props.show_arrow = False fullscreen_icon = label.create_button_label(constants.BUTTON_EXP) self['maximize_button'] = Gtk.ToolButton() self['maximize_button'].set_icon_widget(fullscreen_icon) redock_icon = label.create_button_label(constants.BUTTON_UNDOCK) self['redock_button'] = Gtk.ToolButton() self['redock_button'].set_icon_widget(redock_icon) self['redock_button'].set_tooltip_text("Redock") toolbar.insert(self['maximize_button'], 0) toolbar.insert(self['redock_button'], 1) self['headerbar'].props.title = title self['headerbar'].pack_end(toolbar) self['headerbar'].show_all() self.get_parent_widget().set_titlebar(self['headerbar'])
def __init__(self, title): View.__init__(self) toolbar = Gtk.Toolbar() toolbar.props.show_arrow = False fullscreen_icon = label.create_button_label(constants.BUTTON_EXP) self['maximize_button'] = Gtk.ToolButton() self['maximize_button'].set_icon_widget(fullscreen_icon) redock_icon = label.create_button_label(constants.BUTTON_UNDOCK) self['redock_button'] = Gtk.ToolButton() self['redock_button'].set_icon_widget(redock_icon) self['redock_button'].set_tooltip_text("Redock") toolbar.insert(self['maximize_button'], 0) toolbar.insert(self['redock_button'], 1) self['headerbar'].props.title = title self['headerbar'].pack_end(toolbar) self['headerbar'].show_all() self.get_top_widget().set_titlebar(self['headerbar'])
def __init__(self): View.__init__(self) self.notebook = self['client_notebook'] for i in range(self.notebook.get_n_pages()): child = self.notebook.get_nth_page(i) tab_label = self.notebook.get_tab_label(child) tab_label_text = tab_label.get_text() self.notebook.set_tab_label(child, create_tab_header_label(tab_label_text, self.icons)) self.refresh_btn = self['refresh_conf_btn'] self.refresh_btn.set_image(create_button_label(constants.BUTTON_REFR))
def __init__(self): View.__init__(self) self.get_top_widget().set_events(gtk.gdk.POINTER_MOTION_MASK | gtk.gdk.POINTER_MOTION_HINT_MASK | gtk.gdk.BUTTON_PRESS_MASK) close_label = gui_helper_label.create_button_label( constants.BUTTON_CLOSE) self['close_button'].set_label_widget(close_label) self['close_button'].set_tooltip_text("Close RAFCON") maximize_label = gui_helper_label.create_button_label( constants.BUTTON_EXP) self['maximize_button'].set_label_widget(maximize_label) self['minimize_button'].set_label('_') self['minimize_button'].set_tooltip_text("Minimize main window") redock_label = gui_helper_label.create_button_label( constants.BUTTON_UNDOCK) self['redock_button'].set_label_widget(redock_label) self['redock_button'].set_tooltip_text("Re-Dock widget to main window")
def __init__(self): super().__init__(builder_filename=glade.get_glade_path('main_window.glade'), parent='main_window') if os.getenv("RAFCON_START_MINIMIZED", False): self.get_parent_widget().iconify() # Add gui components by removing their corresponding placeholders defined in the glade file first and then # adding the widgets. self.left_bar_notebooks = [self['upper_notebook'], self['lower_notebook']] ################################################ # Undock Buttons ################################################ self['undock_left_bar_button'].set_image(gui_helper_label.create_button_label(constants.BUTTON_UNDOCK)) self['undock_left_bar_button'].set_tooltip_text("Undock left side bar widget") self['undock_right_bar_button'].set_image(gui_helper_label.create_button_label(constants.BUTTON_UNDOCK)) self['undock_right_bar_button'].set_tooltip_text("Undock right side bar widget") self['collapse_tree_button'].set_image(gui_helper_label.create_button_label(constants.ICON_TREE_FOLD)) self['collapse_tree_button'].set_tooltip_text("Collapse tree of widget") self['show_search_bar'].set_image(gui_helper_label.create_button_label(constants.BUTTON_SHOW_SEARCH_BAR)) self['show_search_bar'].set_tooltip_text("Show state machine search bar") ###################################################### # Library Tree ###################################################### self.library_tree = LibraryTreeView() self.library_tree.show() self['libraries_scrolledwindow'].add(self.library_tree) ###################################################### # Library Usages Tree ###################################################### self.library_usages_tree = LibraryTreeView() self.library_usages_tree.show() self['library_usages_scrolledwindow'].add(self.library_usages_tree) ###################################################### # State Icons ###################################################### self.state_icons = StateIconView() self.state_icons.show() self["state_icons_box"].pack_start(self.state_icons.get_parent_widget(), True, True, 0) ###################################################### # State Machine Tree ###################################################### self.state_machine_tree = StateMachineTreeView() self.state_machine_tree.show() self['states_tree_scrolledwindow'].add(self.state_machine_tree) ###################################################### # Global Variable Manager ###################################################### self.global_var_editor = GlobalVariableEditorView() self.global_var_editor.show() self['global_variables_eventbox'].add(self.global_var_editor.get_parent_widget()) ###################################################### # State Machine History ###################################################### self.state_machine_history = ModificationHistoryView() self.state_machine_history.show() self['history_alignment'].add(self.state_machine_history.get_parent_widget()) ###################################################### # State Machine Execution History ###################################################### self.execution_history = ExecutionHistoryView() self.execution_history.show() self['execution_history_alignment'].add(self.execution_history.get_parent_widget()) ###################################################### # rotate all tab labels by 90 degrees and make detachable ###################################################### self.rotate_and_detach_tab_labels() self['upper_notebook'].set_current_page(0) self['lower_notebook'].set_current_page(0) ###################################################### # State-machines-editor (graphical) ###################################################### self.state_machines_editor = StateMachinesEditorView() self.state_machines_editor.show() self['central_vbox'].pack_start(self.state_machines_editor.get_parent_widget(), True, True, 0) self['central_vbox'].reorder_child(self.state_machines_editor.get_parent_widget(), 1) ###################################################### # Notification Bar ###################################################### self.notification_bar = NotificationBarView() self.notification_bar.show() self['central_vbox'].pack_start(self.notification_bar.get_parent_widget(), False, True, 0) self['central_vbox'].reorder_child(self.notification_bar.get_parent_widget(), 2) ###################################################### # States-editor ###################################################### self.states_editor = StatesEditorView() self['state_editor_eventbox'].add(self.states_editor.get_parent_widget()) self.states_editor.show() ###################################################### # Debug Console ###################################################### self.debug_console_view = DebugConsoleView() self['debug_console_viewport'].add(self.debug_console_view.get_parent_widget()) self.debug_console_view.get_parent_widget().show() # map hide and undock buttons within and debug widget to be usable from main window view with generic naming self['undock_console_button'] = self.debug_console_view['undock_console_button'] self['console_hide_button'] = self.debug_console_view['console_hide_button'] self['console_container'] = self.debug_console_view['console_container'] self['console'] = self.debug_console_view['console'] ################################################## # HeaderBar with MenuBar ################################################## self.menu_bar = MenuBarView() self.menu_bar.show() self['headerbar'].pack_start(self.menu_bar.get_parent_widget()) self['headerbar'].show() self.tool_bar = ToolBarView() self.tool_bar.show() self['top_level_vbox'].remove(self['tool_bar_placeholder']) self['top_level_vbox'].pack_start(self.tool_bar.get_parent_widget(), expand=False, fill=True, padding=0) self['top_level_vbox'].reorder_child(self.tool_bar.get_parent_widget(), 0) ################################################ # Hide Buttons ################################################ self['left_bar_hide_button'].set_image(gui_helper_label.create_button_label(constants.BUTTON_LEFTA)) self['right_bar_hide_button'].set_image(gui_helper_label.create_button_label(constants.BUTTON_RIGHTA)) ################################################ # Return Buttons ################################################ self['left_bar_return_button'].set_image(gui_helper_label.create_button_label(constants.BUTTON_RIGHTA)) self['right_bar_return_button'].set_image(gui_helper_label.create_button_label(constants.BUTTON_LEFTA)) self['console_return_button'].set_image(gui_helper_label.create_button_label(constants.BUTTON_UPA)) # -------------------------------------------------------------------------- # Edit graphical_editor_shortcuts # -------------------------------------------------------------------------- button_start_shortcut = self['button_start_shortcut'] button_start_shortcut.set_tooltip_text('Run') button_stop_shortcut = self['button_stop_shortcut'] button_stop_shortcut.set_tooltip_text('Stop') button_pause_shortcut = self['button_pause_shortcut'] button_pause_shortcut.set_tooltip_text('Pause') button_run_this_state_shortcut = self['button_run_this_state_shortcut'] button_run_this_state_shortcut.set_tooltip_text('Run Selected State') button_run_only_this_state_shortcut = self['button_run_only_this_state_shortcut'] button_run_only_this_state_shortcut.set_tooltip_text('Only Run Selected State') button_start_from_shortcut = self['button_start_from_shortcut'] button_start_from_shortcut.set_tooltip_text('Run From Selected State') button_run_to_shortcut = self['button_run_to_shortcut'] button_run_to_shortcut.set_tooltip_text('Run Until Selected State (Selected State Excluded)') button_step_mode_shortcut = self['button_step_mode_shortcut'] button_step_mode_shortcut.set_tooltip_text('Enter Step Mode') button_step_in_shortcut = self['button_step_in_shortcut'] button_step_in_shortcut.set_tooltip_text('Step Into (One Level In -> Child-State))') button_step_over_shortcut = self['button_step_over_shortcut'] button_step_over_shortcut.set_tooltip_text('Step Over (the next Sibling-State))') button_step_out_shortcut = self['button_step_out_shortcut'] button_step_out_shortcut.set_tooltip_text('Step Out (One Level Up -> Parent-State)') button_step_backward_shortcut = self['button_step_backward_shortcut'] button_step_backward_shortcut.set_tooltip_text('Step Backward') button_start_shortcut.set_label_widget(gui_helper_label.create_button_label(constants.BUTTON_START)) button_stop_shortcut.set_label_widget(gui_helper_label.create_button_label(constants.BUTTON_STOP)) button_pause_shortcut.set_label_widget(gui_helper_label.create_button_label(constants.BUTTON_PAUSE)) button_run_this_state_shortcut.set_label_widget(gui_helper_label.create_button_label(constants.BUTTON_RUN_SELECTED_STATE)) button_run_only_this_state_shortcut.set_label_widget(gui_helper_label.create_button_label(constants.BUTTON_ONLY_RUN_SELECTED_STATE)) button_start_from_shortcut.set_label_widget(gui_helper_label.create_button_label(constants.BUTTON_START_FROM_SELECTED_STATE)) button_run_to_shortcut.set_label_widget(gui_helper_label.create_button_label(constants.BUTTON_RUN_TO_SELECTED_STATE)) button_step_mode_shortcut.set_label_widget(gui_helper_label.create_button_label(constants.BUTTON_STEPM)) button_step_in_shortcut.set_label_widget(gui_helper_label.create_button_label(constants.BUTTON_STEP_INTO)) button_step_over_shortcut.set_label_widget(gui_helper_label.create_button_label(constants.BUTTON_STEP_OVER)) button_step_out_shortcut.set_label_widget(gui_helper_label.create_button_label(constants.BUTTON_STEP_OUT)) button_step_backward_shortcut.set_label_widget(gui_helper_label.create_button_label(constants.BUTTON_BACKW)) self.left_bar_window = UndockedWindowView('left_bar_window') self.right_bar_window = UndockedWindowView('right_bar_window') self.console_window = UndockedWindowView('console_window') gui_helper_label.ellipsize_labels_recursively(self['execution_ticker_text'], Pango.EllipsizeMode.START)
def __init__(self): View.__init__(self) if os.getenv("RAFCON_START_MINIMIZED", False): self.get_top_widget().iconify() # Add gui components by removing their corresponding placeholders defined in the glade file first and then # adding the widgets. self.left_bar_notebooks = [ self['upper_notebook'], self['lower_notebook'] ] ################################################ # Undock Buttons ################################################ self['undock_left_bar_button'].set_image( gui_helper_label.create_button_label(constants.BUTTON_UNDOCK)) self['undock_left_bar_button'].set_tooltip_text( "Undock left side bar widget") self['undock_right_bar_button'].set_image( gui_helper_label.create_button_label(constants.BUTTON_UNDOCK)) self['undock_right_bar_button'].set_tooltip_text( "Undock right side bar widget") self['collapse_tree_button'].set_image( gui_helper_label.create_button_label(constants.BUTTON_COLLAPSE)) self['collapse_tree_button'].set_tooltip_text( "Collapse tree of widget") ###################################################### # Library Tree ###################################################### self.library_tree = LibraryTreeView() self.library_tree.show() self['libraries_alignment'].add(self.library_tree) ###################################################### # State Icons ###################################################### self.state_icons = StateIconView() self.state_icons.show() self["state_icons_box"].pack_start(self.state_icons.get_top_widget()) ###################################################### # State Machine Tree ###################################################### self.state_machine_tree = StateMachineTreeView() self.state_machine_tree.show() self['states_tree_alignment'].add(self.state_machine_tree) ###################################################### # Global Variable Manager ###################################################### self.global_var_editor = GlobalVariableEditorView() self.global_var_editor.show() self['global_variables_alignment'].add( self.global_var_editor.get_top_widget()) ###################################################### # State Machine History ###################################################### self.state_machine_history = ModificationHistoryView() self.state_machine_history.show() self['history_alignment'].add( self.state_machine_history.get_top_widget()) ###################################################### # State Machine Execution History ###################################################### self.execution_history = ExecutionHistoryView() self.execution_history.show() self['execution_history_alignment'].add( self.execution_history.get_top_widget()) ###################################################### # rotate all tab labels by 90 degrees and make detachable ###################################################### self.rotate_and_detach_tab_labels() self['upper_notebook'].set_current_page(0) self['lower_notebook'].set_current_page(0) ###################################################### # State-machines-editor (graphical) ###################################################### self.state_machines_editor = StateMachinesEditorView() self.state_machines_editor.show() self['graphical_editor_vbox'].pack_start( self.state_machines_editor.get_top_widget(), True, True, 0) self['graphical_editor_vbox'].reorder_child( self.state_machines_editor.get_top_widget(), 0) self['graphical_editor_label_event_box'].remove( self['graphical_editor_label']) self['graphical_editor_label_event_box'].set_border_width( constants.GRID_SIZE) graphical_editor_label = gui_helper_label.create_label_with_text_and_spacing( _('GRAPHICAL EDITOR'), font_size=constants.FONT_SIZE_BIG, letter_spacing=constants.LETTER_SPACING_1PT) graphical_editor_label.set_alignment(0, .5) self['graphical_editor_label_event_box'].add(graphical_editor_label) ###################################################### # States-editor ###################################################### self.states_editor = StatesEditorView() self['state_editor_eventbox'].add(self.states_editor.get_top_widget()) self.states_editor.show() self['state_editor_label_hbox'].remove(self['state_editor_label']) self['state_editor_label_hbox'].set_border_width(constants.GRID_SIZE) state_editor_label = gui_helper_label.create_label_with_text_and_spacing( _('STATE EDITOR'), font_size=constants.FONT_SIZE_BIG, letter_spacing=constants.LETTER_SPACING_1PT) state_editor_label.set_alignment(0., 0.) self['state_editor_label_hbox'].add(state_editor_label) ###################################################### # Debug Console ###################################################### self.debug_console_view = DebugConsoleView() self['debug_console_viewport'].add( self.debug_console_view.get_top_widget()) self.debug_console_view.get_top_widget().show() # map hide and undock buttons within and debug widget to be usable from main window view with generic naming self['undock_console_button'] = self.debug_console_view[ 'undock_console_button'] self['console_hide_button'] = self.debug_console_view[ 'console_hide_button'] self['console_container'] = self.debug_console_view[ 'console_container'] self['console'] = self.debug_console_view['console'] ################################################## # menu bar view ################################################## self.top_tool_bar = TopToolBarView() self.top_tool_bar.show() self['top_menu_hbox'].remove(self['top_tool_bar_placeholder']) self['top_menu_hbox'].pack_end(self.top_tool_bar.get_top_widget(), expand=True, fill=True, padding=0) self['top_menu_hbox'].reorder_child(self.top_tool_bar.get_top_widget(), 1) self.menu_bar = MenuBarView(self) self.menu_bar.show() self['top_menu_hbox'].remove(self['menu_bar_placeholder']) self['top_menu_hbox'].pack_start(self.menu_bar.get_top_widget(), expand=False, fill=True, padding=0) self['top_menu_hbox'].reorder_child(self.menu_bar.get_top_widget(), 0) self.tool_bar = ToolBarView() self.tool_bar.show() self['top_level_vbox'].remove(self['tool_bar_placeholder']) self['top_level_vbox'].pack_start(self.tool_bar.get_top_widget(), expand=False, fill=True, padding=0) self['top_level_vbox'].reorder_child(self.tool_bar.get_top_widget(), 1) ################################################ # Hide Buttons ################################################ self['left_bar_hide_button'].set_image( gui_helper_label.create_button_label(constants.BUTTON_LEFTA)) self['right_bar_hide_button'].set_image( gui_helper_label.create_button_label(constants.BUTTON_RIGHTA)) ################################################ # Return Buttons ################################################ self['left_bar_return_button'].set_image( gui_helper_label.create_button_label(constants.BUTTON_RIGHTA)) self['right_bar_return_button'].set_image( gui_helper_label.create_button_label(constants.BUTTON_LEFTA)) self['console_return_button'].set_image( gui_helper_label.create_button_label(constants.BUTTON_UPA)) # -------------------------------------------------------------------------- # Edit graphical_editor_shortcuts # -------------------------------------------------------------------------- button_start_shortcut = self['button_start_shortcut'] button_start_shortcut.set_tooltip_text('Run') button_stop_shortcut = self['button_stop_shortcut'] button_stop_shortcut.set_tooltip_text('Stop') button_pause_shortcut = self['button_pause_shortcut'] button_pause_shortcut.set_tooltip_text('Pause') button_start_from_shortcut = self['button_start_from_shortcut'] button_start_from_shortcut.set_tooltip_text('Run From Selected State') button_run_to_shortcut = self['button_run_to_shortcut'] button_run_to_shortcut.set_tooltip_text( 'Run Until Selected State (Selected State Excluded)') button_step_mode_shortcut = self['button_step_mode_shortcut'] button_step_mode_shortcut.set_tooltip_text('Enter Step Mode') button_step_in_shortcut = self['button_step_in_shortcut'] button_step_in_shortcut.set_tooltip_text( 'Step Into (One Level In -> Child-State))') button_step_over_shortcut = self['button_step_over_shortcut'] button_step_over_shortcut.set_tooltip_text( 'Step Over (the next Sibling-State))') button_step_out_shortcut = self['button_step_out_shortcut'] button_step_out_shortcut.set_tooltip_text( 'Step Out (One Level Up -> Parent-State)') button_step_backward_shortcut = self['button_step_backward_shortcut'] button_step_backward_shortcut.set_tooltip_text('Step Backward') button_start_shortcut.set_label_widget( gui_helper_label.create_button_label(constants.BUTTON_START)) button_stop_shortcut.set_label_widget( gui_helper_label.create_button_label(constants.BUTTON_STOP)) button_pause_shortcut.set_label_widget( gui_helper_label.create_button_label(constants.BUTTON_PAUSE)) button_start_from_shortcut.set_label_widget( gui_helper_label.create_button_label( constants.BUTTON_START_FROM_SELECTED_STATE)) button_run_to_shortcut.set_label_widget( gui_helper_label.create_button_label( constants.BUTTON_RUN_TO_SELECTED_STATE)) button_step_mode_shortcut.set_label_widget( gui_helper_label.create_button_label(constants.BUTTON_STEPM)) button_step_in_shortcut.set_label_widget( gui_helper_label.create_button_label(constants.BUTTON_STEP_INTO)) button_step_over_shortcut.set_label_widget( gui_helper_label.create_button_label(constants.BUTTON_STEP_OVER)) button_step_out_shortcut.set_label_widget( gui_helper_label.create_button_label(constants.BUTTON_STEP_OUT)) button_step_backward_shortcut.set_label_widget( gui_helper_label.create_button_label(constants.BUTTON_BACKW)) # -------------------------------------------------------------------------- self.get_top_widget().set_decorated(False) self['upper_notebook'].set_tab_hborder(constants.TAB_BORDER_WIDTH * 2) self['upper_notebook'].set_tab_vborder(constants.TAB_BORDER_WIDTH * 3) if global_gui_config.get_config_value("USE_ICONS_AS_TAB_LABELS", True): self['lower_notebook'].set_tab_hborder( int(constants.TAB_BORDER_WIDTH * 2 / 1.4)) else: self['lower_notebook'].set_tab_hborder(constants.TAB_BORDER_WIDTH * 2) self['lower_notebook'].set_tab_vborder(constants.TAB_BORDER_WIDTH * 3) self.left_bar_window = UndockedWindowView('left_bar_window') self.right_bar_window = UndockedWindowView('right_bar_window') self.console_window = UndockedWindowView('console_window')