Skip to content

Commit d4dceca

Browse files
committed
add(settings): option to accept editorial policy
1 parent b5f0804 commit d4dceca

File tree

5 files changed

+159
-91
lines changed

5 files changed

+159
-91
lines changed

qtribu/gui/dlg_settings.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
__uri_tracker__,
2424
__version__,
2525
)
26+
from qtribu.constants import contribution_guides_base_url
2627
from qtribu.toolbelt import PlgLogger, PlgOptionsManager
2728
from qtribu.toolbelt.commons import open_url_in_browser
2829
from qtribu.toolbelt.preferences import PlgSettingsStructure
@@ -78,6 +79,20 @@ def __init__(self, parent=None):
7879
self.btn_reset.setIcon(QIcon(QgsApplication.iconPath("mActionUndo.svg")))
7980
self.btn_reset.pressed.connect(self.reset_settings)
8081

82+
# contributing
83+
self.btn_license_open.pressed.connect(
84+
partial(
85+
open_url_in_browser,
86+
f"{contribution_guides_base_url}guides/licensing/#licence-par-defaut",
87+
)
88+
)
89+
self.btn_editorial_policy_open.pressed.connect(
90+
partial(
91+
open_url_in_browser,
92+
f"{contribution_guides_base_url}requirements/#ligne-editoriale",
93+
)
94+
)
95+
8196
# load previously saved settings
8297
self.load_settings()
8398

qtribu/gui/dlg_settings.ui

Lines changed: 81 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>879</width>
10-
<height>474</height>
9+
<width>702</width>
10+
<height>557</height>
1111
</rect>
1212
</property>
1313
<property name="sizePolicy">
@@ -42,8 +42,8 @@
4242
<rect>
4343
<x>0</x>
4444
<y>0</y>
45-
<width>859</width>
46-
<height>454</height>
45+
<width>682</width>
46+
<height>537</height>
4747
</rect>
4848
</property>
4949
<layout class="QVBoxLayout" name="verticalLayout_3">
@@ -100,7 +100,7 @@
100100
</size>
101101
</property>
102102
<property name="title">
103-
<string>Features</string>
103+
<string>Feed</string>
104104
</property>
105105
<layout class="QGridLayout" name="gridLayout_2">
106106
<item row="4" column="1">
@@ -271,20 +271,7 @@
271271
</property>
272272
</widget>
273273
</item>
274-
<item row="6" column="0">
275-
<widget class="QCheckBox" name="chb_license_global_accept">
276-
<property name="minimumSize">
277-
<size>
278-
<width>0</width>
279-
<height>25</height>
280-
</size>
281-
</property>
282-
<property name="text">
283-
<string>Accept publication license globally</string>
284-
</property>
285-
</widget>
286-
</item>
287-
<item row="7" column="0">
274+
<item row="7" column="0" colspan="2">
288275
<widget class="QCheckBox" name="chb_integration_news_feed">
289276
<property name="sizePolicy">
290277
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
@@ -316,7 +303,81 @@
316303
</widget>
317304
</item>
318305
<item>
319-
<widget class="AuthoringWidget" name="wdg_author" native="true"/>
306+
<widget class="QGroupBox" name="grp_contribution">
307+
<property name="title">
308+
<string>Contributing</string>
309+
</property>
310+
<layout class="QGridLayout" name="gridLayout_3">
311+
<item row="0" column="0" colspan="2">
312+
<widget class="QCheckBox" name="chb_license_global_accept">
313+
<property name="minimumSize">
314+
<size>
315+
<width>0</width>
316+
<height>25</height>
317+
</size>
318+
</property>
319+
<property name="text">
320+
<string>Accept publication license globally</string>
321+
</property>
322+
</widget>
323+
</item>
324+
<item row="0" column="2">
325+
<widget class="QPushButton" name="btn_license_open">
326+
<property name="autoFillBackground">
327+
<bool>true</bool>
328+
</property>
329+
<property name="text">
330+
<string>Open GeoRDP publication license</string>
331+
</property>
332+
<property name="autoDefault">
333+
<bool>false</bool>
334+
</property>
335+
<property name="flat">
336+
<bool>false</bool>
337+
</property>
338+
</widget>
339+
</item>
340+
<item row="2" column="2">
341+
<widget class="QPushButton" name="btn_editorial_policy_open">
342+
<property name="autoFillBackground">
343+
<bool>true</bool>
344+
</property>
345+
<property name="text">
346+
<string>Open editorial policy</string>
347+
</property>
348+
<property name="autoDefault">
349+
<bool>false</bool>
350+
</property>
351+
<property name="flat">
352+
<bool>false</bool>
353+
</property>
354+
</widget>
355+
</item>
356+
<item row="2" column="0" colspan="2">
357+
<widget class="QCheckBox" name="chb_editorial_policy_accept">
358+
<property name="text">
359+
<string>I have read and understood the editorial policy</string>
360+
</property>
361+
</widget>
362+
</item>
363+
<item row="3" column="0" colspan="3">
364+
<widget class="AuthoringWidget" name="wdg_author" native="true"/>
365+
</item>
366+
</layout>
367+
</widget>
368+
</item>
369+
<item>
370+
<spacer name="verticalSpacer">
371+
<property name="orientation">
372+
<enum>Qt::Vertical</enum>
373+
</property>
374+
<property name="sizeHint" stdset="0">
375+
<size>
376+
<width>20</width>
377+
<height>40</height>
378+
</size>
379+
</property>
380+
</spacer>
320381
</item>
321382
<item>
322383
<widget class="QGroupBox" name="grp_misc">
@@ -413,12 +474,6 @@
413474
<height>25</height>
414475
</size>
415476
</property>
416-
<property name="maximumSize">
417-
<size>
418-
<width>16777215</width>
419-
<height>30</height>
420-
</size>
421-
</property>
422477
<property name="text">
423478
<string>Report an issue</string>
424479
</property>
@@ -436,12 +491,6 @@
436491
<height>25</height>
437492
</size>
438493
</property>
439-
<property name="maximumSize">
440-
<size>
441-
<width>16777215</width>
442-
<height>30</height>
443-
</size>
444-
</property>
445494
<property name="text">
446495
<string>Help</string>
447496
</property>
@@ -455,12 +504,6 @@
455504
<height>25</height>
456505
</size>
457506
</property>
458-
<property name="maximumSize">
459-
<size>
460-
<width>1000</width>
461-
<height>30</height>
462-
</size>
463-
</property>
464507
<property name="autoFillBackground">
465508
<bool>true</bool>
466509
</property>

qtribu/resources/i18n/plugin_translation.pro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ SOURCES = ../../constants.py \
2020
../../logic/splash_changer.py \
2121
../../logic/web_viewer.py \
2222
../../plugin_main.py \
23-
../../tasks/dizzy.py \
2423
../../toolbelt/application_folder.py \
2524
../../toolbelt/commons.py \
2625
../../toolbelt/file_stats.py \

0 commit comments

Comments
 (0)