def about(self, action, parameter): dialog = Gtk.AboutDialog(transient_for=self) dialog.set_logo(GdkPixbuf.Pixbuf.new_from_file('assets/icons/imeditor.png')) dialog.set_program_name('ImEditor') dialog.set_version('0.1') dialog.set_website('https://github.com/ImEditor') dialog.set_authors(['Nathan Seva', 'Hugo Posnic']) dialog.set_comments('GTK Linux Image Editor ') dialog.set_license('Distributed under the GNU GPL(v3) license. \n\n https://github.com/ImEditor/ImEditor/blob/master/LICENSE') dialog.run() dialog.destroy()
def about(self, action, parameter): dialog = Gtk.AboutDialog(transient_for=self) dialog.set_logo( GdkPixbuf.Pixbuf.new_from_file('assets/icons/imeditor.png')) dialog.set_program_name('ImEditor') dialog.set_version('0.1') dialog.set_website('https://github.com/ImEditor') dialog.set_authors(['Nathan Seva', 'Hugo Posnic']) dialog.set_comments('GTK Linux Image Editor ') dialog.set_license( 'Distributed under the GNU GPL(v3) license. \n\n https://github.com/ImEditor/ImEditor/blob/master/LICENSE' ) dialog.run() dialog.destroy()
def close_tab(self, page_num): if not self.editor.images[page_num].get_saved(): dialog = Gtk.MessageDialog(self, 0, Gtk.MessageType.QUESTION, Gtk.ButtonsType.YES_NO, 'Enregistrer les modifications du document ' + self.editor.images[page_num].get_filename() + ' avant la fermeture ?') dialog.format_secondary_text( 'Vos modifications seront perdues si vous ne les enregistrez pas.') response = dialog.run() if response == Gtk.ResponseType.YES: self.editor.file_save_as(None, None) self.notebook.remove_page(page_num) self.editor.close_image(page_num) elif response == Gtk.ResponseType.NO: self.notebook.remove_page(page_num) self.editor.close_image(page_num) dialog.destroy() else: self.notebook.remove_page(page_num) self.editor.close_image(page_num)
def close_tab(self, page_num): if not self.editor.images[page_num].get_saved(): dialog = Gtk.MessageDialog( self, 0, Gtk.MessageType.QUESTION, Gtk.ButtonsType.YES_NO, 'Enregistrer les modifications du document ' + self.editor.images[page_num].get_filename() + ' avant la fermeture ?') dialog.format_secondary_text( 'Vos modifications seront perdues si vous ne les enregistrez pas.' ) response = dialog.run() if response == Gtk.ResponseType.YES: self.editor.file_save_as(None, None) self.notebook.remove_page(page_num) self.editor.close_image(page_num) elif response == Gtk.ResponseType.NO: self.notebook.remove_page(page_num) self.editor.close_image(page_num) dialog.destroy() else: self.notebook.remove_page(page_num) self.editor.close_image(page_num)