diff --git a/wincan2qgep/gui/settings_dialog.py b/wincan2qgep/gui/settings_dialog.py new file mode 100644 index 0000000..1146d4e --- /dev/null +++ b/wincan2qgep/gui/settings_dialog.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +""" +/*************************************************************************** + + QGIS Solothurn Locator Plugin + Copyright (C) 2019 Denis Rouzaud + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +""" + +import os +from qgis.PyQt.QtWidgets import QDialog +from qgis.PyQt.uic import loadUiType + +from wincan2qgep.core.my_settings import MySettings +from wincan2qgep.qgissettingmanager import SettingDialog, UpdateMode + + +DialogUi, _ = loadUiType(os.path.join(os.path.dirname(__file__), '../ui/settings.ui')) + + +class SettingsDialog(QDialog, DialogUi, SettingDialog): + def __init__(self, parent=None): + settings = MySettings() + QDialog.__init__(self, parent) + SettingDialog.__init__(self, setting_manager=settings, mode=UpdateMode.DialogAccept) + self.setupUi(self) + self.settings = settings + self.init_widgets() + diff --git a/wincan2qgep/ui/settings.ui b/wincan2qgep/ui/settings.ui new file mode 100644 index 0000000..efb3153 --- /dev/null +++ b/wincan2qgep/ui/settings.ui @@ -0,0 +1,190 @@ + + + WincanSettings + + + + 0 + 0 + 728 + 830 + + + + Dialog + + + + + + VL damage single class + + + + + + + Damage + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + Maintenance - WS join + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + VL damage channel + + + + + + + + + + + + + + + + Maintenance + + + + + + + + 0 + 0 + + + + Channel + + + + + + + File + + + + + + + + + + Cover + + + + + + + + + + VL WS structure condition + + + + + + + + + + Wastewater structures + + + + + + + + + + + + + + + + + + + + QgsMapLayerComboBox + QComboBox +
qgsmaplayercombobox.h
+
+
+ + + + buttonBox + accepted() + WincanSettings + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + WincanSettings + reject() + + + 316 + 260 + + + 286 + 274 + + + + +
diff --git a/wincan2qgep/wincan2qgep_plugin.py b/wincan2qgep/wincan2qgep_plugin.py index a7b6083..2144139 100644 --- a/wincan2qgep/wincan2qgep_plugin.py +++ b/wincan2qgep/wincan2qgep_plugin.py @@ -24,15 +24,16 @@ #--------------------------------------------------------------------- import os.path -from qgis.PyQt.QtCore import Qt, QObject, QSettings, QCoreApplication, QTranslator, pyqtSlot +from qgis.PyQt.QtCore import Qt, QObject, QSettings, QCoreApplication, QTranslator from qgis.PyQt.QtGui import QIcon, QColor from qgis.PyQt.QtWidgets import QAction, QFileDialog from qgis.core import QgsProject -from qgis.gui import QgsRubberBand, QgsMessageBar, QgisInterface +from qgis.gui import QgsRubberBand, QgisInterface -from .core.my_settings import MySettings -from .core.import_data import ImportData -from .gui.databrowserdialog import DataBrowserDialog +from wincan2qgep.core.my_settings import MySettings +from wincan2qgep.core.import_data import ImportData +from wincan2qgep.gui.databrowserdialog import DataBrowserDialog +from wincan2qgep.gui.settings_dialog import SettingsDialog import wincan2qgep.resources_rc @@ -67,6 +68,12 @@ def initGui(self): self.iface.addPluginToMenu(self.name, self.actions['openInspection']) self.iface.addToolBarIcon(self.actions['openInspection']) + self.actions['openSettings'] = QAction( + self.tr("Settings"), + self.iface.mainWindow()) + self.actions['openSettings'].triggered.connect(self.show_settings) + self.iface.addPluginToMenu(self.name, self.actions['openSettings']) + self.rubber = QgsRubberBand(self.iface.mapCanvas()) self.rubber.setColor(QColor(255, 255, 50, 200)) self.rubber.setIcon(self.rubber.ICON_CIRCLE) @@ -103,4 +110,6 @@ def open_inspection(self): self.dlg = DataBrowserDialog(self.iface, data, parent_path) self.dlg.show() + def show_settings(self): + SettingsDialog().exec_()