Skip to content

Commit

Permalink
Merge pull request #154 from geotribu/feature/news-feed
Browse files Browse the repository at this point in the history
Fonctionnalité : intègre le dernier contenu publié dans le fil d'actualité de QGIS
  • Loading branch information
Guts authored Mar 13, 2024
2 parents 5404561 + 0c34de0 commit a9f3183
Show file tree
Hide file tree
Showing 7 changed files with 213 additions and 64 deletions.
4 changes: 3 additions & 1 deletion qtribu/gui/dlg_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def apply(self):
settings.browser = self.opt_browser_group.checkedId()
settings.notify_push_info = self.opt_notif_push_msg.isChecked()
settings.notify_push_duration = self.sbx_notif_duration.value()
settings.integration_qgis_news_feed = self.chb_integration_news_feed.isChecked()
settings.license_global_accept = self.chb_license_global_accept.isChecked()

# misc
Expand All @@ -119,6 +120,7 @@ def load_settings(self) -> dict:
self.opt_browser_group.button(settings.browser).setChecked(True)
self.opt_notif_push_msg.setChecked(settings.notify_push_info)
self.sbx_notif_duration.setValue(settings.notify_push_duration)
self.chb_integration_news_feed.setChecked(settings.integration_qgis_news_feed)
self.chb_license_global_accept.setChecked(settings.license_global_accept)

# misc
Expand All @@ -128,7 +130,7 @@ def load_settings(self) -> dict:
def reset_read_history(self):
"""Set latest_content_guid to None."""
new_settings = PlgSettingsStructure(
latest_content_guid=None,
latest_content_guid="",
)

# dump new settings into QgsSettings
Expand Down
138 changes: 86 additions & 52 deletions qtribu/gui/dlg_settings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>697</width>
<width>809</width>
<height>468</height>
</rect>
</property>
Expand Down Expand Up @@ -88,8 +88,8 @@
<string>Features</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="0">
<widget class="QLabel" name="lbl_browser">
<item row="3" column="0">
<widget class="QLabel" name="lbl_notification">
<property name="minimumSize">
<size>
<width>175</width>
Expand All @@ -102,49 +102,58 @@
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>Which web browser to use to display articles.</string>
</property>
<property name="text">
<string>Open in web browser:</string>
<string>Notify for new content:</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="lbl_notification">
<item row="1" column="1">
<widget class="QRadioButton" name="opt_browser_qt">
<property name="minimumSize">
<size>
<width>175</width>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>250</width>
<width>16777215</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>Notify for new content:</string>
<string>Embedded browser</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QPushButton" name="btn_reset_read_history">
<item row="5" column="0">
<widget class="QCheckBox" name="chb_integration_news_feed">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>30</height>
</size>
<property name="toolTip">
<string>The only 'Show QGIS news feed on welcome page' must be checked in General Settings</string>
</property>
<property name="text">
<string>Reset read history</string>
<string>Insert latest item in QGIS news feed</string>
</property>
<property name="shortcut">
<string notr="true"/>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
Expand Down Expand Up @@ -176,6 +185,28 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lbl_browser">
<property name="minimumSize">
<size>
<width>175</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>250</width>
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>Which web browser to use to display articles.</string>
</property>
<property name="text">
<string>Open in web browser:</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QRadioButton" name="opt_browser_os">
<property name="minimumSize">
Expand All @@ -195,8 +226,21 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QRadioButton" name="opt_browser_qt">
<item row="5" column="1">
<widget class="QCheckBox" name="chb_license_global_accept">
<property name="minimumSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="text">
<string>Accept publication license globally</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QPushButton" name="btn_reset_read_history">
<property name="minimumSize">
<size>
<width>0</width>
Expand All @@ -210,10 +254,7 @@
</size>
</property>
<property name="text">
<string>Embedded browser</string>
</property>
<property name="checked">
<bool>true</bool>
<string>Reset read history</string>
</property>
</widget>
</item>
Expand Down Expand Up @@ -256,13 +297,6 @@
</item>
</layout>
</item>
<item row="5" column="0" colspan="4">
<widget class="QCheckBox" name="chb_license_global_accept">
<property name="text">
<string>Accept publication license globally</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down Expand Up @@ -300,8 +334,8 @@
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="1">
<widget class="QLabel" name="lbl_version_saved_value">
<item row="1" column="0">
<widget class="QCheckBox" name="opt_debug">
<property name="minimumSize">
<size>
<width>0</width>
Expand All @@ -314,16 +348,25 @@
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>Enable debug mode.</string>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<property name="locale">
<locale language="English" country="UnitedStates"/>
</property>
<property name="text">
<string notr="true">X.X.x</string>
<string>Debug mode (degraded performances)</string>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<property name="tristate">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="opt_debug">
<item row="2" column="1">
<widget class="QLabel" name="lbl_version_saved_value">
<property name="minimumSize">
<size>
<width>0</width>
Expand All @@ -336,20 +379,11 @@
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>Enable debug mode.</string>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<property name="locale">
<locale language="English" country="UnitedStates"/>
</property>
<property name="text">
<string>Debug mode (degraded performances)</string>
<string notr="true">X.X.x</string>
</property>
<property name="tristate">
<bool>false</bool>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
</property>
</widget>
</item>
Expand Down
1 change: 1 addition & 0 deletions qtribu/logic/custom_datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
field_names=[
"abstract",
"author",
"categories",
"date_pub",
"guid",
"image_length",
Expand Down
Loading

0 comments on commit a9f3183

Please sign in to comment.