Skip to content

Commit 3eec79d

Browse files
committed
Misc backports
1 parent ebec240 commit 3eec79d

File tree

4 files changed

+36
-2
lines changed

4 files changed

+36
-2
lines changed

slyr_community/parser/stream.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,7 @@ def read_ascii(self, debug_string: str = "", expected=None, length=None) -> str:
830830
length = (
831831
length if length is not None else unpack("<L", self.io_stream.read(4))[0]
832832
)
833+
833834
self.log("string of length {}".format(int(length)), 4)
834835
if length == 0:
835836
return ""

slyr_community/plugin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ def __init__(self, parent=None):
6565
self.label_mdb_tools_win.hide()
6666

6767
s = QSettings()
68+
6869
self.enable_verbose_log.setChecked(
6970
int(s.value("/plugins/slyr/enable_verbose_log", 0))
7071
)

slyr_community/qgis_plugin/algorithms/convert_annotations.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,28 @@ def shortHelpString(self):
5959
def initAlgorithm(self, config=None):
6060
self.addParameter(QgsProcessingParameterVectorLayer(self.INPUT, "Input layer"))
6161

62-
self.addParameter(
63-
QgsProcessingParameterField(
62+
if Qgis.QGIS_VERSION_INT >= 33400:
63+
field_param = QgsProcessingParameterField(
6464
self.FIELD,
6565
"Element field",
6666
defaultValue="ELEMENT",
6767
parentLayerParameterName=self.INPUT,
68+
type=QgsProcessingParameterField.DataType.Binary,
6869
)
70+
else:
71+
field_param = QgsProcessingParameterField(
72+
self.FIELD,
73+
"Element field",
74+
defaultValue="ELEMENT",
75+
parentLayerParameterName=self.INPUT,
76+
)
77+
field_param.setHelp(
78+
'Select the field containing the ELEMENT data. This is usually the "Element" field, unless a non-standard annotation class structure is in use.'
79+
)
80+
field_param.setFlags(
81+
field_param.flags() | QgsProcessingParameterDefinition.Flag.FlagAdvanced
6982
)
83+
self.addParameter(field_param)
7084

7185
def processAlgorithm(
7286
self, # pylint: disable=too-many-locals,too-many-statements,too-many-branches

slyr_community/qgis_plugin/integrations/lyr_items.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ def handleFileDrop(self, file): # pylint: disable=missing-docstring
7171
elif file.lower().endswith(".lyrx"):
7272
self.open_lyrx(file)
7373
return True
74+
elif file.lower().endswith(".lpkx"):
75+
self.open_lpkx(file)
76+
return True
7477
elif file.lower().endswith(".avl"):
7578
self.open_avl(file)
7679
return True
@@ -303,6 +306,21 @@ def open_lyrx(input_file): # pylint: disable=too-many-locals,too-many-statement
303306
)
304307
return True
305308

309+
@staticmethod
310+
def open_lpkx(input_file): # pylint: disable=too-many-locals,too-many-statements
311+
"""
312+
Opens a LPKX file in the current project
313+
"""
314+
message = '<p>This functionality requires the licensed version of SLYR. Please see <a href="https://north-road.com/slyr/">here</a> for details.</p>'
315+
BrowserUtils.show_warning(
316+
"Licensed version required",
317+
"Convert LPKX",
318+
message,
319+
level=Qgis.Critical,
320+
message_bar=iface.messageBar(),
321+
)
322+
return True
323+
306324
@staticmethod
307325
def open_avl(input_file):
308326
"""

0 commit comments

Comments
 (0)