def open_settings_dialog(self): # open a dialog with settings dialog = SettingsDialog(self, self.profilecon) dialog.exec() # update settings self.configure_plot()
def settings(self): oldMoveToLayer = QSettings().value("/TileLayerPlugin/moveToLayer", 0, type=int) from settingsdialog import SettingsDialog dialog = SettingsDialog(self.iface) accepted = dialog.exec_() if not accepted: return False self.downloadTimeout = dialog.ui.spinBox_downloadTimeout.value() self.navigationMessagesEnabled = dialog.ui.checkBox_NavigationMessages.checkState( ) moveToLayer = dialog.ui.checkBox_MoveToLayer.checkState() if moveToLayer != oldMoveToLayer: if oldMoveToLayer: self.iface.layerToolBar().removeAction(self.action) self.iface.removeAddLayerAction(self.action) else: self.iface.removePluginWebMenu(self.pluginName, self.action) if moveToLayer: self.iface.insertAddLayerAction(self.action) self.iface.layerToolBar().addAction(self.action) else: self.iface.addPluginToWebMenu(self.pluginName, self.action) return True
def openSettings(self): # button signals in SettingsDialog were not working on Win7/64 # if SettingsDialog was created with iface.mainWindow() as parent #self.settingsDialog = SettingsDialog(self.iface.mainWindow()) self.settingsDialog = SettingsDialog() self.settingsDialog.changed.connect(self.spline.settingsChanged) self.settingsDialog.show()
def __init__(self, app=None): #QMainWindow.__init__(self, None) super(MainWindow, self).__init__(None) self.setupUi(self) self.app = app self.iface = backend.pm.Iface() self.busy = QProgressIndicator(self) self.busy.setFixedSize(QSize(20, 20)) self.setWindowIcon( QIcon("/usr/share/package-manager/data/tray-zero.svg")) self.setCentralWidget(MainWidget(self)) self.cw = self.centralWidget() self.settingsDialog = SettingsDialog(self) self.initializeActions() self.initializeStatusBar() self.initializeTray() self.connectMainSignals() self.pdsMessageBox = PMessageBox(self)
def setting(self): from settingsdialog import SettingsDialog dialog = SettingsDialog(self.iface.mainWindow()) dialog.show() if dialog.exec_(): from pluginmanager import PluginManager self.pluginManager = PluginManager()
def titleContextMenu(self, pos): menu = QMenu() menu.setStyleSheet('background: '+self.sets.get('window.menubgcolor','#222')+'; color: '+self.sets.get('window.menucolor','#fff')+'; padding: 6px;') settingsAction = menu.addAction("Настройка") settingsAction.setIcon(QIcon(':/set.png')) menu.addSeparator() addgroupAction = menu.addAction('Добавить группу') addgroupAction.setIcon(QIcon(':/addgroup.png')) menu.addSeparator() quitAction = menu.addAction("Quit") quitAction.setIcon(QIcon(':/quit.png')) action = menu.exec_(self.sender().mapToGlobal(pos)) if action == quitAction: self.onCloseSignal.emit(self) self.close() elif action == settingsAction: dialog = SettingsDialog(self.sets, self) dialog.loadfromsets() if dialog.exec() == 1: dialog.savetosets() self.sets.save() self.applysets() elif action == addgroupAction: shladd, title, withtext = groupedit.groupAdd(self.sets.get('panel.withtext',False)) if shladd: self.glist.addList(title, (0,0),withtext)
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 super(EarthMineQGIS, self).__init__() self.movingfeature = None self.iface = iface self.viewer = None self.canvas = self.iface.mapCanvas() self.settings = QSettings() # initialize plugin directory self.plugin_dir = os.path.dirname(__file__) # initialize locale locale = QSettings().value('locale/userLocale')[0:2] locale_path = os.path.join(self.plugin_dir, 'i18n', 'EarthMineQGIS_{}.qm'.format(locale)) if os.path.exists(locale_path): self.translator = QTranslator() self.translator.load(locale_path) if qVersion() > '4.3.3': QCoreApplication.installTranslator(self.translator) self.pointtool = QgsMapToolEmitPoint(self.canvas) self.pointtool.canvasClicked.connect(self.set_viewer_location) self.settingsdialog = SettingsDialog(self.iface.mainWindow()) self.actions = [] self.menu = self.tr(u'&Earthmine') self.toolbar = self.iface.addToolBar(u'EarthMineQGIS') self.toolbar.setObjectName(u'EarthMineQGIS') self.legend = self.iface.legendInterface() emcolor = QColor(1, 150, 51) self.tempband = QgsRubberBand(self.canvas, QGis.Line) self.tempband.setWidth(5) self.tempband.setColor(emcolor) self.tempbandpoints = QgsRubberBand(self.canvas, QGis.Point) self.tempbandpoints.setWidth(7) self.tempbandpoints.setColor(emcolor) self.movingband = QgsRubberBand(self.canvas, QGis.Point) self.movingband.setWidth(5) self.movingband.setColor(emcolor) self.layersignals = [] self.marker = None
def settings(self): from settingsdialog import SettingsDialog dialog = SettingsDialog(self.iface) dialog.show() accepted = dialog.exec_() if accepted: self.downloadTimeout = dialog.ui.spinBox_downloadTimeout.value() self.navigationMessagesEnabled = dialog.ui.checkBox_NavigationMessages.checkState( )
def settings_button_clicked(self): s = SettingsDialog(self) ret = s.exec_() if ret == 1: Settings.save(s.settings) self.settings = Settings.read() self.refresh_shortcuts()
def settingsDialog(self): dlg = SettingsDialog(self.theme, self.palette().highlight().color().name(), parent=self) dlg.exec() if dlg.theme != self.theme or dlg.hilite_color != self.palette().highlight().color().name(): settings = QSettings(QSettings.IniFormat, QSettings.UserScope, QCoreApplication.organizationName(), QCoreApplication.applicationName()) settings.setValue("theme", dlg.theme) settings.setValue("hiliteColor", dlg.hilite_color) msgBox = QMessageBox() msgBox.setText("Please restart the app to change the theme!") msgBox.exec()
def __init__(self, iface): self.iface = iface self.plugin_dir = os.path.dirname(__file__) self.dlgSettings = SettingsDialog() self.digitizingSetup = DigitizingSetup(self.iface) self.currentMode = None self.currentLayer = None self.isBackgroundSnapping = False self.initSettings()
def settings_dialog(self): """ Opens the settings window allowing the user to manually change the settings in the config file """ logger.info('Opening settings window') if (not SettingsDialog.singleton): SettingsDialog(self.__root, self). \ wm_iconbitmap(ICO) else: logger.warning('Found existing settings window, canceling')
def __init__(self, parent=None): KXmlGuiWindow.__init__(self, parent) self.setupUi(self) self.setWindowIcon(KIcon(":/data/package-manager.png")) self.setCentralWidget(MainWidget(self)) self.settingsDialog = SettingsDialog(self) self.initializeActions() self.initializeStatusBar() self.initializeTray() self.connectMainSignals() self.offlinemanager = OfflineManager() self.connectOfflineSignals()
def __init__(self, app=None): KXmlGuiWindow.__init__(self, None) self.setupUi(self) self.app = app self.iface = backend.pm.Iface() self.busy = QProgressIndicator(self) self.busy.setFixedSize(QSize(20, 20)) self.setWindowIcon(KIcon(":/data/package-manager.png")) self.setCentralWidget(MainWidget(self)) self.cw = self.centralWidget() self.settingsDialog = SettingsDialog(self) self.initializeActions() self.initializeStatusBar() self.initializeTray() self.connectMainSignals() self.pdsMessageBox = PMessageBox(self)
def configureSettings(self): settingsDialog = SettingsDialog(self, self.settingsManager) settingsDialog.show()
def openSettings(self): self.settingsDialog = SettingsDialog() self.settingsDialog.changed.connect(self.spline.settingsChanged) self.settingsDialog.show()
def pluginSettings(self): from settingsdialog import SettingsDialog dialog = SettingsDialog(self) if dialog.exec_(): self.pluginManager.reloadPlugins() self.pages[ppages.PAGE_DEM].initLayerComboBox()
def settings_click_cb(self, widget): dialog = SettingsDialog(widget.get_toplevel()) dialog.show()
def on_actionConfigure_triggered(self): dialog = SettingsDialog(self.programSettings, self) dialog.rowHeightChanged.connect(self.setRowHeight) dialog.exec_()
def showSettings(self): dlg = SettingsDialog(self) dlg.exec_()
def setting(self): from settingsdialog import SettingsDialog dialog = SettingsDialog(self.iface) dialog.show() dialog.exec_()
def openSettings(self): """Open settings dialog and reload settings""" settingsDialog = SettingsDialog(self.settings) settingsDialog.exec_()
parser.add_argument("-s", "--settings", help="Show the settings dialog", action="store_true") parser.add_argument("-i", "--imitate", help="Show and immediately close the main window.", action="store_true") args = parser.parse_args() app = QApplication(sys.argv) if args.settings: from settingsdialog import SettingsDialog g = SettingsDialog() else: try: g = MainUi() except Exception as err: print("An exception has occured!") print( "Try opening the settings dialog with -s parameter and resaving the settings.", "You may have to delete your settings file as last resort.") raise err g.show() if args.imitate: sys.exit() rect = app.desktop().screenGeometry()