def on_rename(self, user_data): HidePrevention(self.get_toplevel()).prevent() dialog = RenameDialog(self.notebook.guake.window, self.label.get_text()) r = dialog.run() if r == Gtk.ResponseType.ACCEPT: new_text = TabNameUtils.shorten(dialog.get_text(), self.notebook.guake.settings) page_num = self.notebook.find_tab_index_by_label(self) self.notebook.rename_page(page_num, new_text, True) dialog.destroy() HidePrevention(self.get_toplevel()).allow()
def on_rename_tab(self, *args): page_num = self.notebook.find_page_index_by_terminal(self.terminal) tab_text = self.notebook.get_tab_text_index(page_num) dialog = RenameDialog(self.window, tab_text) r = dialog.run() if r == Gtk.ResponseType.ACCEPT: new_text = TabNameUtils.shorten(dialog.get_text(), self.settings) self.notebook.rename_page(page_num, new_text, True) dialog.destroy()