Skip to content

Commit a4031c0

Browse files
committed
Remove UI for irrecoverable carbon URL.
1 parent 434143f commit a4031c0

File tree

2 files changed

+14
-33
lines changed

2 files changed

+14
-33
lines changed

src/cplus_plugin/gui/settings/carbon_options.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,6 @@ def save_settings(self) -> None:
205205
Settings.IRRECOVERABLE_CARBON_LOCAL_SOURCE,
206206
self.fw_irrecoverable_carbon.filePath(),
207207
)
208-
settings_manager.set_value(
209-
Settings.IRRECOVERABLE_CARBON_ONLINE_SOURCE, self.txt_ic_url.text()
210-
)
211208
settings_manager.set_value(
212209
Settings.IRRECOVERABLE_CARBON_ONLINE_LOCAL_PATH,
213210
self.fw_save_online_file.filePath(),
@@ -258,11 +255,6 @@ def load_settings(self):
258255
)
259256

260257
# Online config
261-
self.txt_ic_url.setText(
262-
settings_manager.get_value(
263-
Settings.IRRECOVERABLE_CARBON_ONLINE_SOURCE, default=""
264-
)
265-
)
266258
self.fw_save_online_file.setFilePath(
267259
settings_manager.get_value(
268260
Settings.IRRECOVERABLE_CARBON_ONLINE_LOCAL_PATH, default=""
@@ -371,7 +363,9 @@ def validate_irrecoverable_carbon_url(self) -> bool:
371363
well-formed.
372364
:rtype: bool
373365
"""
374-
dataset_url = self.txt_ic_url.text()
366+
dataset_url = settings_manager.get_value(
367+
Settings.IRRECOVERABLE_CARBON_ONLINE_SOURCE, default="", setting_type=str
368+
)
375369
if not dataset_url:
376370
self.message_bar.pushWarning(
377371
tr("CPLUS - Irrecoverable carbon dataset"), tr("URL not defined")

src/cplus_plugin/ui/carbon_settings.ui

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -120,44 +120,31 @@
120120
<property name="bottomMargin">
121121
<number>5</number>
122122
</property>
123-
<item row="0" column="0">
124-
<widget class="QLabel" name="label">
123+
<item row="1" column="1">
124+
<widget class="QPushButton" name="btn_ic_download">
125+
<property name="toolTip">
126+
<string>Initiate new download or refesh previous download in the background</string>
127+
</property>
125128
<property name="text">
126-
<string>URL</string>
129+
<string>Start download</string>
127130
</property>
128131
</widget>
129132
</item>
130133
<item row="0" column="1" colspan="2">
131-
<widget class="QLineEdit" name="txt_ic_url">
134+
<widget class="QgsFileWidget" name="fw_save_online_file">
132135
<property name="toolTip">
133-
<string>Do not include the bbox PARAM, it will be automatically appended based on the current scenario extent</string>
134-
</property>
135-
<property name="placeholderText">
136-
<string>Specify the URL to fetch the dataset in the CI server</string>
136+
<string>Specify the local path for saving the downloaded file</string>
137137
</property>
138138
</widget>
139139
</item>
140-
<item row="1" column="0">
140+
<item row="0" column="0">
141141
<widget class="QLabel" name="label_2">
142142
<property name="text">
143-
<string>Save as</string>
144-
</property>
145-
</widget>
146-
</item>
147-
<item row="1" column="1" colspan="2">
148-
<widget class="QgsFileWidget" name="fw_save_online_file"/>
149-
</item>
150-
<item row="2" column="1">
151-
<widget class="QPushButton" name="btn_ic_download">
152-
<property name="toolTip">
153-
<string>Initiate new download or refesh previous download in the background</string>
154-
</property>
155-
<property name="text">
156-
<string>Start download</string>
143+
<string>Save file as</string>
157144
</property>
158145
</widget>
159146
</item>
160-
<item row="2" column="2">
147+
<item row="1" column="2">
161148
<layout class="QHBoxLayout" name="horizontalLayout_8">
162149
<property name="spacing">
163150
<number>4</number>

0 commit comments

Comments
 (0)