def _create_about_dialog(self): builder = pygubu.Builder(translator) uifile = os.path.join(FILE_PATH, "ui/about_dialog.ui") builder.add_from_file(uifile) builder.add_resource_path(os.path.join(FILE_PATH, "images")) dialog = builder.get_object('aboutdialog', self.master.winfo_toplevel()) entry = builder.get_object('version') txt = entry.cget('text') txt = txt.replace('%version%', str(pygubu.__version__)) entry.configure(text=txt) def on_ok_execute(): dialog.close() builder.connect_callbacks({'on_ok_execute': on_ok_execute}) return dialog
def _create_about_dialog(self): builder = pygubu.Builder(translator) builder.add_from_file(str(DESIGNER_DIR / "ui" / "about_dialog.ui")) builder.add_resource_path(str(DESIGNER_DIR / "images")) dialog = builder.get_object('aboutdialog', self.mainwindow) entry = builder.get_object('version') txt = entry.cget('text') txt = txt.replace('%version%', str(pygubu.__version__)) entry.configure(text=txt) entry = builder.get_object('designer_version') txt = entry.cget('text') txt = txt.replace('%version%', str(pygubudesigner.__version__)) entry.configure(text=txt) def on_ok_execute(): dialog.close() def on_gpl3_clicked(e): url = 'https://www.gnu.org/licenses/gpl-3.0.html' webbrowser.open_new_tab(url) def on_mit_clicked(e): url = 'https://opensource.org/licenses/MIT' webbrowser.open_new_tab(url) def on_moreinfo_clicked(e): url = 'https://github.com/alejandroautalan/pygubu-designer' webbrowser.open_new_tab(url) dialog_callbacks = { 'on_ok_execute': on_ok_execute, 'on_gpl3_clicked': on_gpl3_clicked, 'on_mit_clicked': on_mit_clicked, 'on_moreinfo_clicked': on_moreinfo_clicked, } builder.connect_callbacks(dialog_callbacks) return dialog