From fc25352620643c857c34f9b1f2aae278d771368b Mon Sep 17 00:00:00 2001 From: Alain Date: Tue, 19 Dec 2023 05:18:46 -0500 Subject: [PATCH] Add social links --- core/Constants.vala | 3 + core/Util.vala | 2 +- data/io.github.alainm23.planify.gresource.xml | 5 +- .../{planner-mail-dark.svg => mail-dark.svg} | 0 ...{planner-mail-light.svg => mail-light.svg} | 0 data/resources/icons/settings/telegram.svg | 43 +++++++++++++++ .../Preferences/PreferencesWindow.vala | 55 +++++++++++++++++++ src/Layouts/ProjectRow.vala | 2 +- 8 files changed, 106 insertions(+), 4 deletions(-) rename data/resources/icons/{planner-mail-dark.svg => mail-dark.svg} (100%) rename data/resources/icons/{planner-mail-light.svg => mail-light.svg} (100%) create mode 100644 data/resources/icons/settings/telegram.svg diff --git a/core/Constants.vala b/core/Constants.vala index a95ec7fb7..63f818c15 100644 --- a/core/Constants.vala +++ b/core/Constants.vala @@ -12,4 +12,7 @@ namespace Constants { public const int PRIORITY_2 = 3; public const int PRIORITY_3 = 2; public const int PRIORITY_4 = 1; + public const string TWITTER_URL = "https://twitter.com/useplanify"; + public const string CONTACT_US = "alainmh23@gmail.com"; + public const string TELEGRAM_GROUP = "https://t.me/+cArNTCbdT3xmOTcx"; } \ No newline at end of file diff --git a/core/Util.vala b/core/Util.vala index 2b8969055..f36707569 100644 --- a/core/Util.vala +++ b/core/Util.vala @@ -729,7 +729,7 @@ public class Util : GLib.Object { _dynamic_icons.set ("planner-bell", true); _dynamic_icons.set ("sidebar-left", true); _dynamic_icons.set ("sidebar-right", true); - _dynamic_icons.set ("planner-mail", true); + _dynamic_icons.set ("mail", true); _dynamic_icons.set ("planner-note", true); _dynamic_icons.set ("planner-settings-sliders", true); _dynamic_icons.set ("planner-list", true); diff --git a/data/io.github.alainm23.planify.gresource.xml b/data/io.github.alainm23.planify.gresource.xml index 9acffbf9e..e8453540a 100644 --- a/data/io.github.alainm23.planify.gresource.xml +++ b/data/io.github.alainm23.planify.gresource.xml @@ -47,6 +47,7 @@ resources/icons/settings/light-bulb.svg resources/icons/settings/archive-plus.svg resources/icons/settings/sidebar.svg + resources/icons/settings/telegram.svg resources/icons/planner-calendar-light.svg resources/icons/planner-calendar-dark.svg @@ -80,8 +81,8 @@ resources/icons/sidebar-left-light.svg resources/icons/sidebar-right-dark.svg resources/icons/sidebar-right-light.svg - resources/icons/planner-mail-light.svg - resources/icons/planner-mail-dark.svg + resources/icons/mail-light.svg + resources/icons/mail-dark.svg resources/icons/planner-note-light.svg resources/icons/planner-note-dark.svg resources/icons/planner-settings-sliders-dark.svg diff --git a/data/resources/icons/planner-mail-dark.svg b/data/resources/icons/mail-dark.svg similarity index 100% rename from data/resources/icons/planner-mail-dark.svg rename to data/resources/icons/mail-dark.svg diff --git a/data/resources/icons/planner-mail-light.svg b/data/resources/icons/mail-light.svg similarity index 100% rename from data/resources/icons/planner-mail-light.svg rename to data/resources/icons/mail-light.svg diff --git a/data/resources/icons/settings/telegram.svg b/data/resources/icons/settings/telegram.svg new file mode 100644 index 000000000..6b4765680 --- /dev/null +++ b/data/resources/icons/settings/telegram.svg @@ -0,0 +1,43 @@ + + + + + + diff --git a/src/Dialogs/Preferences/PreferencesWindow.vala b/src/Dialogs/Preferences/PreferencesWindow.vala index a71810d1c..8fe17fa08 100644 --- a/src/Dialogs/Preferences/PreferencesWindow.vala +++ b/src/Dialogs/Preferences/PreferencesWindow.vala @@ -111,6 +111,61 @@ public class Dialogs.Preferences.PreferencesWindow : Adw.PreferencesWindow { page.add (personalization_group); + var reach_us_group = new Adw.PreferencesGroup (); + reach_us_group.title = _("Reach Us"); + + var contact_us_row = new Adw.ActionRow (); + contact_us_row.activatable = true; + contact_us_row.add_prefix (generate_icon ("planner-mail")); + contact_us_row.add_suffix (generate_icon ("pan-end-symbolic", 16)); + contact_us_row.title = _("Contact us"); + contact_us_row.subtitle = _("Request a feature or ask us anything."); + + contact_us_row.activated.connect (() => { + string uri = "mailto:?subject=%s".printf (Constants.CONTACT_US); + + try { + AppInfo.launch_default_for_uri (uri, null); + } catch (Error e) { + warning ("%s\n", e.message); + } + }); + + var tweet_us_row = new Adw.ActionRow (); + tweet_us_row.activatable = true; + tweet_us_row.add_prefix (generate_icon ("planner-annotation-dots")); + tweet_us_row.add_suffix (generate_icon ("pan-end-symbolic", 16)); + tweet_us_row.title = _("Tweet us"); + tweet_us_row.subtitle = _("Share some love."); + + tweet_us_row.activated.connect (() => { + try { + AppInfo.launch_default_for_uri (Constants.TWITTER_URL, null); + } catch (Error e) { + warning ("%s\n", e.message); + } + }); + + var telegram_row = new Adw.ActionRow (); + telegram_row.activatable = true; + telegram_row.add_prefix (generate_icon ("telegram")); + telegram_row.add_suffix (generate_icon ("pan-end-symbolic", 16)); + telegram_row.title = _("Telegram"); + telegram_row.subtitle = _("Discuss and share your feedback."); + + telegram_row.activated.connect (() => { + try { + AppInfo.launch_default_for_uri (Constants.TELEGRAM_GROUP, null); + } catch (Error e) { + warning ("%s\n", e.message); + } + }); + + reach_us_group.add (contact_us_row); + reach_us_group.add (tweet_us_row); + reach_us_group.add (telegram_row); + page.add (reach_us_group); + // Support Group var support_group = new Adw.PreferencesGroup (); support_group.title = _("Support"); diff --git a/src/Layouts/ProjectRow.vala b/src/Layouts/ProjectRow.vala index 2c554fa58..3a75a89ba 100644 --- a/src/Layouts/ProjectRow.vala +++ b/src/Layouts/ProjectRow.vala @@ -422,7 +422,7 @@ public class Layouts.ProjectRow : Gtk.ListBoxRow { delete_item.add_css_class ("menu-item-danger"); var share_markdown_item = new Widgets.ContextMenu.MenuItem (_("Share"), "share"); - var share_email_item = new Widgets.ContextMenu.MenuItem (_("Send by e-mail"), "planner-mail"); + var share_email_item = new Widgets.ContextMenu.MenuItem (_("Send by e-mail"), "mail"); var menu_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0); menu_box.margin_top = menu_box.margin_bottom = 3;