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 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() """ yield self._open_and_yield('/Build/Settings/Targets') self.dialog = get_window_by_prefix('Target Configuration') self.tree = get_widgets_by_type(Gtk.TreeView, self.dialog)[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 open_and_yield(self): yield self._open_and_yield('/Edit/Preferences...') self.dialog = get_window_by_prefix('GNAT Studio - Preferences -') self.tree = get_widgets_by_type(Gtk.TreeView, self.dialog)[0]
def open_and_yield(self): yield self._open_and_yield('/Edit/Preferences...') self.dialog = get_window_by_prefix('GPS - Preferences -') self.tree = get_widgets_by_type(Gtk.TreeView, self.dialog)[0]