def setup(self): # Add the Tasks view make_interactive( self.get_view, category="Views", name="open Tasks") # Create a HUD widget and add it to the toolbar self.HUD = HUD_Widget() self.HUD.hbox.show_all() pygps.get_widget_by_name("toolbar-box").pack_end( self.HUD.hbox, False, False, 3 )
def open_and_yield(self): """ Compatible with run_test_driver, to be used in a yield statement view = Outline_View() yield view.open_and_yield() """ yield self._open_and_yield('open Outline') self.tree = get_widget_by_name("Outline View Tree")
def open_and_yield(self, force=False): self.report_mdi = GPS.MDI.get("Analysis Report") if (self.report_mdi is None) or force: yield self._open_and_yield('gnathub display analysis') self.report_mdi = GPS.MDI.get("Analysis Report") self.report = self.report_mdi.pywidget() self.filters = GPS.MDI.get("Filters").pywidget() self.tools = get_widget_by_name( 'gnathub tools editor', self.filters) self.severities = get_widget_by_name( 'gnathub severities editor', self.filters) self.rules = get_widget_by_name( 'gnathub rules editor', self.filters) self.messages_report = get_widget_by_name( 'messages-report', self.report) self.metrics_report = get_widget_by_name( 'metrics-report', self.report)
def open_and_yield(self): """ Compatible with run_test_driver, to be used in a yield statement assistant = ProjectTemplatesAssistant() yield assistant.open_and_yield() ... :param action: the name of the action that will open window """ yield self._open_and_yield('create project from template') self.__assistant = get_widget_by_name("Project Templates Assistant")
def open_and_yield(self): preferences_dialog = Preferences() yield preferences_dialog.open_and_yield() preferences_dialog.select_page("Key Shortcuts") self.editor = get_widget_by_name('Key shortcuts') if self.editor: self.modify_button = get_button_from_label('Modify', self.editor) self.remove_button = get_button_from_label('Remove', self.editor) self.close_button = get_button_from_label('Close')
def save(self): """ Press the Save button, saving the modifications that have been made in the project file and closing the dialog. Use as:: yield dialog.save() """ save_button = get_widget_by_name("project properties edit source") save_button.clicked() yield wait_tasks()
def select_action(self, action): tree = get_widget_by_name('Key shortcuts tree', [self.editor]) GPS.Preference("shortcuts-categories").set(False) # ??? Used to manipulate config menu, but this seems to fail now # toggle_local_config(self.editor, 'Show categories', False) for m in tree.get_model(): if m[0].lower() == action.lower(): tree.get_selection().select_path(m.path) return gps_assert(False, True, action + ' not found in key shortcuts editor')
def open_and_yield(self): preferences_dialog = Preferences() yield preferences_dialog.open_and_yield() preferences_dialog.select_page("Key Shortcuts") self.editor = get_widget_by_name('Key shortcuts') if self.editor: self.modify_button = get_button_from_label('Add', self.editor) self.remove_button = get_button_from_label('Remove', self.editor) self.close_button = get_button_from_label('Close') self.key_theme_combo = get_widgets_by_type(Gtk.ComboBoxText, self.editor)[0]
def select_action(self, action): from GPS import process_all_events tree = get_widget_by_name('Key shortcuts tree', [self.editor]) GPS.Preference("shortcuts-categories").set(False) # ??? Used to manipulate config menu, but this seems to fail now # toggle_local_config(self.editor, 'Show categories', False) for m in tree.get_model(): if m[0].lower() == action.lower(): tree.get_selection().select_path(m.path) return gps_assert(False, True, action + ' not found in key shortcuts editor')
def open_and_yield(self, wait_scan=True): """ Compatible with run_test_driver, to be used in a yield statement editor = Project_Properties_Editor() yield editor.open_and_yield() ... if :param wait_scan: is True, this will wait for GPRconfig to complete its scanning before returning. """ yield self._open_and_yield('open project properties') # Wait for the GPRconfig scan to complete before editing # and/or saving the Project Properties editor if wait_scan: yield wait_tasks() self.treeview = get_widget_by_name('Project Properties Tree', self.dialogs) scenario_selector = get_widget_by_name( 'Project Properties Scenario Selector', self.dialogs) self.scenario_selector_tree = get_widgets_by_type( Gtk.TreeView, scenario_selector)[0]
def __on_chosen(self, widget, theme): """ Called when the theme's button or radio button has been clicked. """ if widget == self.light_theme_radio: self.flow.select_child( self.flow.get_children()[self.LIGHT_RADIO_CHILD_INDEX]) elif widget == self.dark_theme_radio: self.flow.select_child( self.flow.get_children()[self.DARK_RADIO_CHILD_INDEX]) else: # Untoggle the previouly selected theme's button previous_toggled_button = get_widget_by_name( "theme-button-" + color_theme_pref.get(), self.flow) if previous_toggled_button: previous_toggled_button.set_active(False) the_theme_switcher.apply_theme(theme)
def open_and_yield(self, wait_scan=True): """ Compatible with run_test_driver, to be used in a yield statement editor = Project_Properties_Editor() yield editor.open_and_yield() ... if :param wait_scan: is True, this will wait for GPRconfig to complete its scanning before returning. """ yield self._open_and_yield('open project properties') # Wait for the GPRconfig scan to complete before editing # and/or saving the Project Properties editor if wait_scan: yield wait_tasks() self.treeview = get_widget_by_name( 'Project Properties Tree', self.dialogs)
def open_and_yield(self): """ Open the build targets editor dialog, and returns a handle to it. This is compatible with run_test_driver: editor = GPS.BuildTargetsEditor() yield editor.open_and_yield() """ preferences_dialog = Preferences() yield preferences_dialog.open_and_yield() preferences_dialog.select_page("Build Targets") self.editor = get_widget_by_name("Build Targets Editor") self.notebook = pygps.get_widgets_by_type(Gtk.Notebook, self.editor)[0] self.close_button = get_button_from_label("Close", preferences_dialog.dialog) self.apply_button = get_button_from_label("Apply", preferences_dialog.dialog) self.tree = get_widgets_by_type(Gtk.TreeView, self.editor)[0]
def open_and_yield(self, docked=False): """ Open the search dialog, and returns a handle to it. This is compatible with run_test_driver: editor = GPS.Search() yield editor.open_and_yield() """ yield self._open_and_yield("Search") if docked: self.dialog = GPS.MDI.get("Search").pywidget() else: self.dialog = get_window_by_prefix('GNAT Studio - Search -') if self.dialog: combos = get_widgets_by_type(Gtk.ComboBox, self.dialog) self.find = get_button_from_label("Find", self.dialog) self.find_all = get_button_from_label("Find All", self.dialog) self.next = self.find # This is in fact the same button self.replace = get_button_from_label("Replace", self.dialog) self.replace_all = get_button_from_label("Replace All", self.dialog) self.close = get_button_from_label("Close", self.dialog) self.replace_and_find = get_button_from_label( "Replace & Find", self.dialog) self.scope = get_widget_by_name("search scope combo", self.dialog) self.pattern = combos[0].get_child() self.replace_text = combos[1].get_child() self.look_in = combos[3] if len(combos) >= 4 else combos[2] self.previous = get_button_from_label("Previous", self.dialog) toggle_buttons = get_widgets_by_type(Gtk.ToggleButton, self.dialog) self.regexp = toggle_buttons[0] self.case = toggle_buttons[1] self.whole_word = toggle_buttons[2] # Disable confirmation dialog for 'Replace all' button GPS.Preference("Ask-Confirmation-For-Replace-All").set(False)
def open_and_yield(self): """ Open the search dialog, and returns a handle to it. This is compatible with run_test_driver: editor = GPS.Search() yield editor.open_and_yield() """ yield self._open_and_yield("Search") self.dialog = get_window_by_prefix('GPS - Search -') if self.dialog: combos = get_widgets_by_type(Gtk.ComboBox, self.dialog) self.find = get_button_from_label("Find", self.dialog) self.find_all = get_button_from_label("Find All", self.dialog) self.next = self.find # This is in fact the same button self.replace = get_button_from_label("Replace", self.dialog) self.replace_all = get_button_from_label( "Replace All", self.dialog) self.close = get_button_from_label("Close", self.dialog) self.replace_and_find = get_button_from_label( "Replace & Find", self.dialog) self.scope = get_widget_by_name( "search scope combo", self.dialog) self.pattern = combos[0].get_child() self.replace_text = combos[1].get_child() self.look_in = combos[3] if len(combos) >= 4 else combos[2] self.previous = get_button_from_label("Previous", self.dialog) toggle_buttons = get_widgets_by_type(Gtk.ToggleButton, self.dialog) self.regexp = toggle_buttons[0] self.case = toggle_buttons[1] self.whole_word = toggle_buttons[2]
def __init__(self): Tree.__init__(self, get_widget_by_name('Project Explorer Tree'))
def open_and_yield(self): yield self._open_and_yield("/Tools/Views/Project") self.dialog = get_widget_by_name('Project Explorer Tree')
def open_and_yield(self): yield self._open_and_yield('open Bookmarks') self.treeview = get_widget_by_name('Bookmark TreeView')
def open_and_yield(self): yield self._open_and_yield("open project") self.dialog = get_widget_by_name('Project Explorer Tree')