Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add social links #1086

Merged
merged 1 commit into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions core/Constants.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "[email protected]";
public const string TELEGRAM_GROUP = "https://t.me/+cArNTCbdT3xmOTcx";
}
2 changes: 1 addition & 1 deletion core/Util.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 3 additions & 2 deletions data/io.github.alainm23.planify.gresource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
<file alias="light-bulb.svg">resources/icons/settings/light-bulb.svg</file>
<file alias="archive-plus.svg">resources/icons/settings/archive-plus.svg</file>
<file alias="sidebar.svg">resources/icons/settings/sidebar.svg</file>
<file alias="telegram.svg">resources/icons/settings/telegram.svg</file>

<file alias="planner-calendar-light.svg">resources/icons/planner-calendar-light.svg</file>
<file alias="planner-calendar-dark.svg">resources/icons/planner-calendar-dark.svg</file>
Expand Down Expand Up @@ -80,8 +81,8 @@
<file alias="sidebar-left-light.svg">resources/icons/sidebar-left-light.svg</file>
<file alias="sidebar-right-dark.svg">resources/icons/sidebar-right-dark.svg</file>
<file alias="sidebar-right-light.svg">resources/icons/sidebar-right-light.svg</file>
<file alias="planner-mail-light.svg">resources/icons/planner-mail-light.svg</file>
<file alias="planner-mail-dark.svg">resources/icons/planner-mail-dark.svg</file>
<file alias="mail-light.svg">resources/icons/mail-light.svg</file>
<file alias="mail-dark.svg">resources/icons/mail-dark.svg</file>
<file alias="planner-note-light.svg">resources/icons/planner-note-light.svg</file>
<file alias="planner-note-dark.svg">resources/icons/planner-note-dark.svg</file>
<file alias="planner-settings-sliders-dark.svg">resources/icons/planner-settings-sliders-dark.svg</file>
Expand Down
43 changes: 43 additions & 0 deletions data/resources/icons/settings/telegram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 55 additions & 0 deletions src/Dialogs/Preferences/PreferencesWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion src/Layouts/ProjectRow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down