def __init__(self): super().__init__() # Create all dialogs self.about_dialog = AboutDialog() self.tutorial_dialog = HelpDialog() self.size_warning = SizeWarning() self.source_warning = SourceCodeWarning() self.about_dialog.hide() self.tutorial_dialog.hide() self.size_warning.hide() self.source_warning.hide() # Read config file to find out if this is first run configpath = str( Path.home()) + "/.config/codeblock_visual_studio/config" configread = configparser.ConfigParser() config = configread.read(configpath) if len(config) == 0: # First Run, open tutorial and autogenerate config os.makedirs(os.path.dirname(configpath), exist_ok=True) with open(configpath, 'w') as f: f.write("") self.tutorial_dialog.exec_() # Bind buttons to functions and initialize varibales self.bind() self.classViewFileIndex = {} self.lines = [] self.lint = () self.go_ahead = True self.class_list = {}
def on_about(self): about_dialog = AboutDialog(self.root) # make window modal about_dialog.wait_visibility() about_dialog.focus_set() about_dialog.grab_set() about_dialog.transient(self.root)
def show_about_dialog(self, parent=None): if not self.__about_dialog: self.__about_dialog = AboutDialog() self.__about_dialog.connect("destroy", self.on_about_dialog_destroy) self.__about_dialog.set_transient_for(parent) self.__about_dialog.present()
def showAbout(self): """Run method that loads and starts the plugin""" locale = self.locale if not locale in ['en', 'de', 'it', 'fr']: locale = 'en' if self.aboutWidget is None: self.aboutWidget = AboutDialog(locale, self.iface.mainWindow()) self.aboutWidget.show() self.aboutWidget.raise_()
def _about_dialog_default(self): """ Trait initializer. """ about_dialog = AboutDialog( parent = self.workbench.active_window.control, image = ImageResource('about'), additions = ['RadPy version: ' + self.version] ) return about_dialog
def show_about_dialog(self, *args): d = AboutDialog(self, window_title='About Binary Code Translator', about_title='Binary Code Translator', content='Developed and written by:\n' '\tDenniel Luis Saway Sadian ' '(https://denniel-sadian.github.io)\n\n' 'Date of creation:\n' '\tMarch 10, 2018\n\n' 'Description:\n' '\tThis app can translate text to binary and ' 'binary to text.', image='binary.png') d.wm_iconbitmap('binary.ico') d.mainloop() return args
def __init__(self, iface): """Constructor. :param iface: An interface instance that will be passed to this class which provides the hook by which you can manipulate the QGIS application at run time. :type iface: QgsInterface """ # Save reference to the QGIS interface self.iface = iface # initialize plugin directory self.plugin_dir = os.path.dirname(__file__).decode( sys.getfilesystemencoding()) # initialize locale self.translator = QTranslator() self.locale = Locale.get_locale() locale_path = os.path.join( self.plugin_dir, 'i18n', 'QuickMapServices_{}.qm'.format(self.locale)) if os.path.exists(locale_path): self.translator.load(locale_path) if qVersion() > '4.3.3': QCoreApplication.installTranslator(self.translator) self.custom_translator = CustomTranslator() QCoreApplication.installTranslator(self.custom_translator) # Create the dialog (after translation) and keep reference self.info_dlg = AboutDialog() # Check Contrib and User dirs try: ExtraSources.check_extra_dirs() except: error_message = self.tr( 'Extra dirs for %s can\'t be created: %s %s') % ( PluginSettings.product_name(), sys.exc_type, sys.exc_value) self.iface.messageBar().pushMessage(self.tr('Error'), error_message, level=QgsMessageBar.CRITICAL) # Declare instance attributes self.service_actions = [] self.service_layers = [] # TODO: id and smart remove self._scales_list = None
def show_about(self, *args): window = AboutDialog( self, window_title='About Tailoring Management System', about_title='Tailoring Management System', content='Developed and written by:\n' '\tDenniel Luis Saway Sadian ' '(https://denniel-sadian.github.io)\n\n' 'Date of creation:\n' '\tJuly 15, 2018\n\n' 'Description:\n' "\tThis application's purpose is to be used in shops that " "stitch clothes. They don't have to use papers to write down " "their clients' information", image='tms.png') window.wm_iconbitmap('tms.ico') window.mainloop() return args
def __init__(self, iface): # Save reference to the QGIS interface self.iface = iface # initialize plugin directory self.plugin_dir = os.path.dirname(__file__) # initialize locale locale = QSettings().value("locale/userLocale")[0:2] localePath = os.path.join(self.plugin_dir, "i18n", "openlayers_{}.qm".format(locale)) if os.path.exists(localePath): self.translator = QTranslator() self.translator.load(localePath) if qVersion() > '4.3.3': QCoreApplication.installTranslator(self.translator) self._olLayerTypeRegistry = WebLayerTypeRegistry(self) self.olOverview = OLOverview(iface, self._olLayerTypeRegistry) self.dlgAbout = AboutDialog()
def show_about(self, *args): window = AboutDialog( self, window_title='About LyricsManager', about_title='Lyrics Manager', content='Developed and written by:\n' '\tDenniel Luis Saway Sadian ' '(https://denniel-sadian.github.io)\n\n' 'Date of creation:\n' '\tJanuary 9, 2018\n\n' 'Description:\n' '\tThis application lets you store, create and view ' 'your favorite lyrics. It is written completely in ' 'Python Programming Language and uses Tkinter as ' 'its GUI framework.', image='lm.png') window.wm_iconbitmap('ic.ico') window.mainloop() return args
def __init__(self, iface): """Constructor. :param iface: An interface instance that will be passed to this class which provides the hook by which you can manipulate the QGIS application at run time. :type iface: QgsInterface """ # Save reference to the QGIS interface self.iface = iface # initialize plugin directory self.plugin_dir = os.path.dirname(__file__) # initialize locale self.translator = QTranslator() self.locale = QSettings().value('locale/userLocale')[0:2] locale_path = os.path.join( self.plugin_dir, 'i18n', 'QuickMapServices_{}.qm'.format(self.locale)) if os.path.exists(locale_path): self.translator.load(locale_path) if qVersion() > '4.3.3': QCoreApplication.installTranslator(self.translator) self.custom_translator = CustomTranslator() QCoreApplication.installTranslator(self.custom_translator) # Create the dialog (after translation) and keep reference self.settings_dlg = SettingsDialog() self.info_dlg = AboutDialog() # Declare instance attributes self.service_actions = [] self.service_layers = [] # TODO: id and smart remove self._scales_list = None # TileLayer assets self.crs3857 = None self.downloadTimeout = 30 # TODO: settings self.navigationMessagesEnabled = Qt.Checked # TODO: settings self.pluginName = 'QuickMapServices'
def f1(self, *args): AboutDialog(self.master, window_title='About Gaseous', about_title='Gaseous', content='Developed and written by:\n' '\tDenniel Luis Saway Sadian ' '(https://denniel-sadian.github.io)\n\n' 'Date of creation:\n' '\tJanuary 21, 2018\n\n' 'Description:\n' '\tThis application is written for quicker solving ' 'of gas problems. When using this application,' ' make sure that all the givens are compatible ' 'with each other. For example, if the initial ' 'volume is in liters, the final volume must be in ' 'liters as well. The desired unit for temperature ' 'is kelvin. This app has a built-in unit converter, ' 'so conversion is easy.\n' '\tThis application is written completely in Python ' 'Programming Language. It uses Tkinter as the GUI ' 'Framework.', image='gas.png').mainloop() return args
def show_about(self): dlg = AboutDialog(self.context, self) dlg.exec_()
def show_about(self): self.init_window_flags(allow_top=False) AboutDialog().exec() self.init_window_flags(allow_top=True) self.show()
def __init__(self): ''' Constructor ''' self.dlg = AboutDialog()
def about(self): ad = AboutDialog() ad.display()
def open_about(self): about_dialog = AboutDialog(self) about_dialog.exec()
def _on_about(self, event): dlg = AboutDialog() dlg.ShowModal() dlg.Destroy()
def show_about(self): d = AboutDialog(self.root) self.root.wait_window(d.top)
def __init__(self, iface, parentMnu): # Save reference to the QGIS interface self.iface = iface self.parentMnu = parentMnu # initialize plugin directory # self.plugin_dir = os.path.dirname(__file__) # # initialize locale # locale = QSettings().value("locale/userLocale")[0:2] # localePath = os.path.join(self.plugin_dir, "i18n", "openlayers_{}.qm".format(locale)) # # if os.path.exists(localePath): # self.translator = QTranslator() # self.translator.load(localePath) # # if qVersion() > '4.3.3': # QCoreApplication.installTranslator(self.translator) self._olLayerTypeRegistry = WebLayerTypeRegistry(self) self.olOverview = OLOverview(iface, self._olLayerTypeRegistry) self.dlgAbout = AboutDialog() # def initGui(self): self._olMenu = self.parentMnu.addMenu("OpenLayers") # self._olMenu.setIcon(QIcon(":/plugins/openlayers/openlayers.png")) # Overview self.overviewAddAction = QAction("OpenLayers Overview", self.iface) self.overviewAddAction.setCheckable(True) self.overviewAddAction.setChecked(False) QObject.connect(self.overviewAddAction, SIGNAL("toggled(bool)"), self.olOverview.setVisible) self._olMenu.addAction(self.overviewAddAction) self._actionAbout = QAction("Terms of Service / About", self.iface) QObject.connect(self._actionAbout, SIGNAL("triggered()"), self.dlgAbout, SLOT("show()")) #? self._actionAbout.triggered.connect(self.dlgAbout, SLOT("show()")) self._olMenu.addAction(self._actionAbout) self._olLayerTypeRegistry.register(OlGooglePhysicalLayer()) self._olLayerTypeRegistry.register(OlGoogleStreetsLayer()) self._olLayerTypeRegistry.register(OlGoogleHybridLayer()) self._olLayerTypeRegistry.register(OlGoogleSatelliteLayer()) self._olLayerTypeRegistry.register(OlOpenStreetMapLayer()) self._olLayerTypeRegistry.register(OlOpenCycleMapLayer()) self._olLayerTypeRegistry.register(OlOCMLandscapeLayer()) self._olLayerTypeRegistry.register(OlOCMPublicTransportLayer()) self._olLayerTypeRegistry.register(OlOSMHumanitarianDataModelLayer()) self._olLayerTypeRegistry.register(OlBingRoadLayer()) self._olLayerTypeRegistry.register(OlBingAerialLayer()) self._olLayerTypeRegistry.register(OlBingAerialLabelledLayer()) self._olLayerTypeRegistry.register(OlOSMStamenTonerLayer()) self._olLayerTypeRegistry.register(OlOSMStamenTonerLiteLayer()) self._olLayerTypeRegistry.register(OlOSMStamenWatercolorLayer()) self._olLayerTypeRegistry.register(OlOSMStamenTerrainLayer()) self._olLayerTypeRegistry.register(OlMapQuestOSMLayer()) self._olLayerTypeRegistry.register(OlMapQuestOpenAerialLayer()) self._olLayerTypeRegistry.register(OlAppleiPhotoMapLayer()) for group in self._olLayerTypeRegistry.groups(): groupMenu = group.menu() for layer in self._olLayerTypeRegistry.groupLayerTypes(group): layer.addMenuEntry(groupMenu, self.iface) self._olMenu.addMenu(groupMenu) #Create Web menu, if it doesn't exist yet # self.iface.addPluginToWebMenu("_tmp", self._actionAbout) # self._menu = self.iface.menuBar() # self.parentMnu.addMenu(self._olMenu) # self.iface.removePluginWebMenu("_tmp", self._actionAbout) # Register plugin layer type self.pluginLayerType = OpenlayersPluginLayerType( self.iface, self.setReferenceLayer, self._olLayerTypeRegistry) QgsPluginLayerRegistry.instance().addPluginLayerType( self.pluginLayerType) QObject.connect(QgsProject.instance(), SIGNAL("readProject(const QDomDocument &)"), self.projectLoaded) self.setGDALProxy()
def _onActionAboutTriggered(self): dialog = AboutDialog(self) dialog.exec_()
def __init__(self, iface): # Save reference to the QGIS interface self.iface = iface # setup locale pluginDir = os.path.dirname(__file__) localePath = "" locale = QSettings().value("locale/userLocale")[0:2] if QFileInfo(pluginDir).exists(): localePath = pluginDir + "/i18n/openlayers_" + locale + ".qm" if QFileInfo(localePath).exists(): self.translator = QTranslator() self.translator.load(localePath) if qVersion() > '4.3.3': QCoreApplication.installTranslator(self.translator) # Layers self.olLayerTypeRegistry = OlLayerTypeRegistry() self.olLayerTypeRegistry.add( OlLayerType(self, 'Google Physical', 'google_icon.png', 'google_physical.html', True)) self.olLayerTypeRegistry.add( OlLayerType(self, 'Google Streets', 'google_icon.png', 'google_streets.html', True)) self.olLayerTypeRegistry.add( OlLayerType(self, 'Google Hybrid', 'google_icon.png', 'google_hybrid.html', True)) self.olLayerTypeRegistry.add( OlLayerType(self, 'Google Satellite', 'google_icon.png', 'google_satellite.html', True)) self.olLayerTypeRegistry.add( OlLayerType(self, 'OpenStreetMap', 'osm_icon.png', 'osm.html', True)) self.olLayerTypeRegistry.add( OlLayerType(self, 'OpenCycleMap', 'osm_icon.png', 'ocm.html', True)) self.olLayerTypeRegistry.add( OlLayerType(self, 'OCM Landscape', 'osm_icon.png', 'ocm_landscape.html', True)) self.olLayerTypeRegistry.add( OlLayerType(self, 'OCM Public Transport', 'osm_icon.png', 'ocm_transport.html', True)) self.olLayerTypeRegistry.add( OlLayerType(self, 'Yahoo Street', 'yahoo_icon.png', 'yahoo_street.html')) self.olLayerTypeRegistry.add( OlLayerType(self, 'Yahoo Hybrid', 'yahoo_icon.png', 'yahoo_hybrid.html')) self.olLayerTypeRegistry.add( OlLayerType(self, 'Yahoo Satellite', 'yahoo_icon.png', 'yahoo_satellite.html')) self.olLayerTypeRegistry.add( OlLayerType(self, 'Bing Road', 'bing_icon.png', 'bing_road.html', True)) self.olLayerTypeRegistry.add( OlLayerType(self, 'Bing Aerial', 'bing_icon.png', 'bing_aerial.html', True)) self.olLayerTypeRegistry.add( OlLayerType(self, 'Bing Aerial with labels', 'bing_icon.png', 'bing_aerial-labels.html', True)) self.olLayerTypeRegistry.add( OlLayerType(self, 'Apple iPhoto map', 'apple_icon.png', 'apple.html', True)) self.olLayerTypeRegistry.add( OlLayerType(self, 'Stamen Toner/OSM', 'stamen_icon.png', 'stamen_toner.html', True)) self.olLayerTypeRegistry.add( OlLayerType(self, 'Stamen Watercolor/OSM', 'stamen_icon.png', 'stamen_watercolor.html', True)) self.olLayerTypeRegistry.add( OlLayerType(self, 'Stamen Terrain-USA/OSM', 'stamen_icon.png', 'stamen_terrain.html', True)) self.olLayerTypeRegistry.add( OlLayerType(self, 'hgis wig 500k', 'hgis_icon.png', 'hgis_wig500k.html', True)) self.olLayerTypeRegistry.add( OlLayerType(self, 'hgis wig 300k', 'hgis_icon.png', 'hgis_wig300k.html', True)) self.olLayerTypeRegistry.add( OlLayerType(self, 'hgis wig 100k', 'hgis_icon.png', 'hgis_wig100k.html', True)) self.olLayerTypeRegistry.add( OlLayerType(self, 'hgis wig 25k', 'hgis_icon.png', 'hgis_wig25k.html', True)) self.olLayerTypeRegistry.add( OlLayerType(self, 'hgis mb 25k', 'hgis_icon.png', 'hgis_mb25k.html', True)) self.olLayerTypeRegistry.add( OlLayerType(self, 'hgis ukvme 300k', 'hgis_icon.png', 'hgis_ukvme300k.html', True)) self.olLayerTypeRegistry.add( OlLayerType(self, 'hgis kdr 100k', 'hgis_icon.png', 'hgis_kdr100k.html', True)) self.olLayerTypeRegistry.add( OlLayerType(self, 'hgis kdwr 100k', 'hgis_icon.png', 'hgis_kdwr100k.html', True)) self.olLayerTypeRegistry.add( OlLayerType(self, 'hgis kdr_gb 100k', 'hgis_icon.png', 'hgis_kdr_gb100k.html', True)) # Overview self.olOverview = OLOverview(iface, self.olLayerTypeRegistry) self.dlgAbout = AboutDialog(iface)
def about(self): print("about") ad = AboutDialog() ad.display()