diff --git a/qlyrx.py b/qlyrx.py index 8bb0ee0..6b4f986 100644 --- a/qlyrx.py +++ b/qlyrx.py @@ -147,8 +147,7 @@ def __init__(self, iface): # Must be set in initGui() to survive plugin reloads self.first_start = None - # noinspection PyMethodMayBeStatic - # noinspection PyMethodMayBeStatic + def tr(self, message): """Get the translation for a string using Qt translation API. @@ -265,6 +264,16 @@ def load_vectors(self): self.dlg.layer_select.addItems(vector_layers) + def enableQmlSaving(self): + print(self.dlg.saveQmlCheck.checkState()) + if self.dlg.saveQmlCheck.isChecked(): + self.dlg.QMLSaveLocation.setEnabled(True) + self.dlg.qmlLabel.setEnabled(True) + else: + self.dlg.QMLSaveLocation.setDisabled(True) + self.dlg.qmlLabel.setDisabled(True) + + def read_lyrx(self, file=None): with open(file, mode="r", encoding="utf-8") as json_file: data = json.load(json_file) @@ -1457,7 +1466,7 @@ def run(self): # show the dialog self.dlg.show() self.load_vectors() - + self.dlg.saveQmlCheck.stateChanged.connect(self.enableQmlSaving) # Run the dialog event loop result = self.dlg.exec_() # See if OK was pressed diff --git a/qlyrx.zip b/qlyrx.zip deleted file mode 100644 index a3be239..0000000 Binary files a/qlyrx.zip and /dev/null differ diff --git a/qlyrx_dialog_base.ui b/qlyrx_dialog_base.ui index ee8c34c..c10444b 100644 --- a/qlyrx_dialog_base.ui +++ b/qlyrx_dialog_base.ui @@ -7,7 +7,7 @@ 0 0 436 - 369 + 413 @@ -69,7 +69,7 @@ 10 60 401 - 221 + 271 @@ -222,13 +222,88 @@ + + + + 8 + + + + + true + + + + 0 + 0 + + + + + 359 + 20 + + + + Save style to QML + + + false + + + + + + + + + false + + + .qml save location + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 85 + 20 + + + + + + + + false + + + QML files (*.qml) + + + QgsFileWidget::SaveFile + + + + + + + 60 - 320 + 370 359 24 diff --git a/resources.py b/resources.py index 334e86c..90fa943 100644 --- a/resources.py +++ b/resources.py @@ -984,7 +984,7 @@ \x00\x00\x00\x14\x00\x02\x00\x00\x00\x01\x00\x00\x00\x03\ \x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x24\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ -\x00\x00\x01\x6a\x10\x9a\x10\x3b\ +\x00\x00\x01\x74\xe4\x44\x3e\x4b\ " qt_version = QtCore.qVersion().split('.')