Skip to content

Commit 7dd9639

Browse files
small details
1 parent 7db97be commit 7dd9639

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

pygeoapi_config_dialog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def on_button_clicked(self, button):
153153
)
154154

155155
# before saving, show diff with "Procced" and "Cancel" options
156-
if self._diff_original_and_current_data():
156+
if file_path and self._diff_original_and_current_data():
157157
self.save_to_file(file_path)
158158

159159
elif button == self.buttonBox.button(QDialogButtonBox.Open):

pygeoapi_config_dialog_base.ui

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,10 +338,13 @@
338338
<item>
339339

340340
<widget class="QListWidget" name="listWidgetLogRotation">
341+
<property name="horizontalScrollBarPolicy">
342+
<enum>Qt::ScrollBarAlwaysOff</enum>
343+
</property>
341344
<property name="maximumSize">
342345
<size>
343346
<width>1000</width>
344-
<height>40</height>
347+
<height>22</height>
345348
</size>
346349
</property>
347350
<property name="editTriggers">
@@ -896,6 +899,9 @@
896899
<item>
897900

898901
<widget class="QListWidget" name="listWidgetApiRules">
902+
<property name="horizontalScrollBarPolicy">
903+
<enum>Qt::ScrollBarAlwaysOff</enum>
904+
</property>
899905
<property name="maximumSize">
900906
<size>
901907
<width>1000</width>
@@ -928,6 +934,9 @@
928934
<item>
929935

930936
<widget class="QListWidget" name="listWidgetServerManager">
937+
<property name="horizontalScrollBarPolicy">
938+
<enum>Qt::ScrollBarAlwaysOff</enum>
939+
</property>
931940
<property name="maximumSize">
932941
<size>
933942
<width>1000</width>
@@ -2748,6 +2757,9 @@
27482757
</item>
27492758
<item row="0" column="1">
27502759
<widget class="QListWidget" name="listWidgetResLinkedData">
2760+
<property name="horizontalScrollBarPolicy">
2761+
<enum>Qt::ScrollBarAlwaysOff</enum>
2762+
</property>
27512763
<property name="maximumSize">
27522764
<size>
27532765
<width>1000</width>

ui_widgets/WarningDialog.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from datetime import datetime
12
import json
23
from PyQt5.QtWidgets import (
34
QDialog,
@@ -9,6 +10,13 @@
910
from PyQt5.QtCore import Qt
1011

1112

13+
def default_serializer(obj):
14+
"""Convert unsupported objects to serializable types."""
15+
if isinstance(obj, datetime):
16+
return obj.strftime("%Y-%m-%dT%H:%M:%SZ")
17+
return str(obj) # fallback for anything else
18+
19+
1220
class ReadOnlyTextDialog(QDialog):
1321
def __init__(
1422
self, parent=None, title="Message", text="", add_true_false_btns=False
@@ -26,7 +34,9 @@ def __init__(
2634
text_edit.setMinimumSize(200, 200) # adjust size as needed
2735

2836
if isinstance(text, dict):
29-
formatted = json.dumps(text, indent=4, ensure_ascii=False)
37+
formatted = json.dumps(
38+
text, indent=4, ensure_ascii=False, default=default_serializer
39+
)
3040
else:
3141
formatted = str(text)
3242

0 commit comments

Comments
 (0)