Skip to content

Commit

Permalink
Merge pull request #164 from geotribu/feature/add-mastodon-author-acc…
Browse files Browse the repository at this point in the history
…ount

feature(authoring): ajoute le compte Mastodon
  • Loading branch information
Guts authored Apr 29, 2024
2 parents cf3b1c7 + 8369262 commit b223478
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 6 deletions.
2 changes: 2 additions & 0 deletions qtribu/gui/wdg_authoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def load_settings(self) -> dict:
self.lne_github_account.setText(settings.author_github)
self.lne_linkedin_account.setText(settings.author_linkedin)
self.lne_twitter_account.setText(settings.author_twitter)
self.lne_mastodon_account.setText(settings.author_mastodon)

def save_settings(self) -> None:
"""Save form text into QgsSettings."""
Expand All @@ -55,6 +56,7 @@ def save_settings(self) -> None:
settings.author_github = self.lne_github_account.text()
settings.author_linkedin = self.lne_linkedin_account.text()
settings.author_twitter = self.lne_twitter_account.text()
settings.author_mastodon = self.lne_mastodon_account.text()

# save it
self.plg_settings.save_from_object(settings)
38 changes: 32 additions & 6 deletions qtribu/gui/wdg_authoring.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>350</width>
<height>225</height>
<width>505</width>
<height>255</height>
</rect>
</property>
<property name="minimumSize">
Expand Down Expand Up @@ -43,6 +43,9 @@
<property name="flat">
<bool>true</bool>
</property>
<property name="syncGroup">
<string notr="true"/>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="lbl_firstname">
Expand Down Expand Up @@ -131,6 +134,9 @@
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="lne_github_account">
<property name="inputMethodHints">
<set>Qt::ImhUrlCharactersOnly</set>
</property>
<property name="placeholderText">
<string notr="true">https://github.com/geotribu</string>
</property>
Expand All @@ -139,7 +145,7 @@
</property>
</widget>
</item>
<item row="4" column="0">
<item row="5" column="0">
<widget class="QLabel" name="lbl_linked_account">
<property name="toolTip">
<string>Used during broadcasting to credit author.</string>
Expand All @@ -149,7 +155,7 @@
</property>
</widget>
</item>
<item row="4" column="1">
<item row="5" column="1">
<widget class="QLineEdit" name="lne_linkedin_account">
<property name="placeholderText">
<string notr="true">https://www.linkedin.com/in/pierredupont/</string>
Expand All @@ -159,7 +165,7 @@
</property>
</widget>
</item>
<item row="5" column="0">
<item row="6" column="0">
<widget class="QLabel" name="lbl_twitter_account">
<property name="toolTip">
<string>Used during broadcasting to credit author.</string>
Expand All @@ -169,7 +175,7 @@
</property>
</widget>
</item>
<item row="5" column="1">
<item row="6" column="1">
<widget class="QLineEdit" name="lne_twitter_account">
<property name="placeholderText">
<string notr="true">https://twitter.com/geotribu</string>
Expand All @@ -179,6 +185,26 @@
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="lbl_mastodon_account">
<property name="text">
<string>Mastodon account:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="lne_mastodon_account">
<property name="inputMethodHints">
<set>Qt::ImhUrlCharactersOnly</set>
</property>
<property name="placeholderText">
<string notr="true">https://mapstodon.space/@geotribu</string>
</property>
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down
1 change: 1 addition & 0 deletions qtribu/toolbelt/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class PlgSettingsStructure:
author_github: str = ""
author_linkedin: str = ""
author_twitter: str = ""
author_mastodon: str = ""

@property
def browser_as_str(self) -> str:
Expand Down

0 comments on commit b223478

Please sign in to comment.