def show_about(self, pkg): """ Show an about dialog for plugin. We use a field __about__ """ about_func = None try: module = self.__cache_import(pkg) about_func = module.__about__ except Exception: pass # Instead using types def t(): pass if isinstance(about_func, type(t)): about_func() else: d = Core().about_dialog(pkg) d.run() d.hide() d.destroy()
def __on_activate(self, widget): mainwnd = Core().mainwindow if mainwnd.flags() & gtk.VISIBLE: self.wndpos = mainwnd.get_position() mainwnd.hide() else: mainwnd.move(*self.wndpos) mainwnd.show()
def __on_activate(self, widget): mainwnd = Core().mainwindow if mainwnd.flags() & gtk.VISIBLE: self.wndpos = mainwnd.get_position() mainwnd.hide() else: mainwnd.move(*self.wndpos) mainwnd.show()