From 6279e37cbaaf42d9294e76295f887fc00d0160a0 Mon Sep 17 00:00:00 2001 From: Alain Date: Sun, 10 Dec 2023 06:11:06 -0500 Subject: [PATCH] Release 4.2 --- README.md | 2 +- {src => core}/Enum.vala | 16 +- {src => core}/Services/Settings.vala | 2 +- core/Utils.vala | 93 +++++++ core/Widgets/DynamicIcon.vala | 91 +++++++ config.vala.in => core/config.vala.in | 0 core/meson.build | 64 +++++ core/planify.deps | 11 + ....github.alainm23.planify.appdata.xml.in.in | 22 +- data/resources/screenshot/screenshot-01.png | Bin 67956 -> 103513 bytes data/resources/screenshot/screenshot-02.png | Bin 84403 -> 90501 bytes data/resources/screenshot/screenshot-03.png | Bin 0 -> 79840 bytes meson.build | 37 ++- quick-add/Enum.vala | 251 ------------------ quick-add/Services/EventBus.vala | 56 ---- quick-add/Services/Settings.vala | 37 --- quick-add/Util.vala | 6 +- quick-add/Widgets/DynamicIcon.vala | 56 ---- quick-add/meson.build | 4 - src/Config.vala.in | 13 + src/MainWindow.vala | 2 +- src/Models/ItemList.vala | 44 --- src/Util.vala | 2 + src/meson.build | 33 +-- 24 files changed, 339 insertions(+), 503 deletions(-) rename {src => core}/Enum.vala (95%) rename {src => core}/Services/Settings.vala (99%) create mode 100644 core/Utils.vala create mode 100644 core/Widgets/DynamicIcon.vala rename config.vala.in => core/config.vala.in (100%) create mode 100644 core/meson.build create mode 100644 core/planify.deps create mode 100644 data/resources/screenshot/screenshot-03.png delete mode 100644 quick-add/Enum.vala delete mode 100644 quick-add/Services/EventBus.vala delete mode 100644 quick-add/Services/Settings.vala delete mode 100644 quick-add/Widgets/DynamicIcon.vala create mode 100644 src/Config.vala.in delete mode 100644 src/Models/ItemList.vala diff --git a/README.md b/README.md index 562563885..89ccf360a 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@

Never worry about forgetting things again

-![Planify Screenshot](https://raw.githubusercontent.com/alainm23/planner/master/data/resources/screenshot/screenshot-01.png) +![Planify Screenshot](https://raw.githubusercontent.com/alainm23/planify/master/data/resources/screenshot/screenshot-01.png) ## Planify is here... diff --git a/src/Enum.vala b/core/Enum.vala similarity index 95% rename from src/Enum.vala rename to core/Enum.vala index ff51b17c4..3397dfe7c 100644 --- a/src/Enum.vala +++ b/core/Enum.vala @@ -43,7 +43,7 @@ public enum ProjectViewStyle { return "board"; default: - assert_not_reached(); + assert_not_reached (); } } } @@ -61,7 +61,7 @@ public enum ProjectIconStyle { return "emoji"; default: - assert_not_reached(); + assert_not_reached (); } } } @@ -95,7 +95,7 @@ public enum FilterType { return "filter"; default: - assert_not_reached(); + assert_not_reached (); } } @@ -114,7 +114,7 @@ public enum FilterType { return _("Pinboard"); default: - assert_not_reached(); + assert_not_reached (); } } } @@ -148,7 +148,7 @@ public enum BackendType { return "caldav"; default: - assert_not_reached(); + assert_not_reached (); } } } @@ -199,7 +199,7 @@ public enum ObjectType { return _("Lists"); default: - assert_not_reached(); + assert_not_reached (); } } } @@ -243,7 +243,7 @@ public enum RecurrencyType { } default: - assert_not_reached(); + assert_not_reached (); } } } @@ -266,7 +266,7 @@ public enum PickerType { return "sections"; default: - assert_not_reached(); + assert_not_reached (); } } } diff --git a/src/Services/Settings.vala b/core/Services/Settings.vala similarity index 99% rename from src/Services/Settings.vala rename to core/Services/Settings.vala index d49907219..16bb0989a 100644 --- a/src/Services/Settings.vala +++ b/core/Services/Settings.vala @@ -34,4 +34,4 @@ public class Services.Settings : GLib.Object { public Settings () { settings = new GLib.Settings ("io.github.alainm23.planify"); } -} \ No newline at end of file +} diff --git a/core/Utils.vala b/core/Utils.vala new file mode 100644 index 000000000..c0d3f0edd --- /dev/null +++ b/core/Utils.vala @@ -0,0 +1,93 @@ +/* +* Copyright © 2023 Alain M. (https://github.com/alainm23/planify) +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public +* License as published by the Free Software Foundation; either +* version 3 of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* General Public License for more details. +* +* You should have received a copy of the GNU General Public +* License along with this program; if not, write to the +* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +* Boston, MA 02110-1301 USA +* +* Authored by: Alain M. +*/ + +public class Utils : GLib.Object { + private static Utils? _instance; + public static Utils get_default () { + if (_instance == null) { + _instance = new Utils (); + } + + return _instance; + } + + public string get_encode_text (string text) { + return GLib.Uri.escape_string (text, null, false); + } + + /* + Icons + */ + + private Gee.HashMap? _dynamic_icons; + public Gee.HashMap dynamic_icons { + get { + if (_dynamic_icons != null) { + return _dynamic_icons; + } + + _dynamic_icons = new Gee.HashMap (); + _dynamic_icons.set ("planner-calendar", true); + _dynamic_icons.set ("planner-search", true); + _dynamic_icons.set ("chevron-right", true); + _dynamic_icons.set ("chevron-down", true); + _dynamic_icons.set ("planner-refresh", true); + _dynamic_icons.set ("planner-edit", true); + _dynamic_icons.set ("planner-trash", true); + _dynamic_icons.set ("planner-star", true); + _dynamic_icons.set ("planner-note", true); + _dynamic_icons.set ("planner-close-circle", true); + _dynamic_icons.set ("planner-check-circle", true); + _dynamic_icons.set ("planner-flag", true); + _dynamic_icons.set ("planner-tag", true); + _dynamic_icons.set ("planner-pinned", true); + _dynamic_icons.set ("planner-settings", true); + _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 ("planner-note", true); + _dynamic_icons.set ("planner-settings-sliders", true); + _dynamic_icons.set ("planner-list", true); + _dynamic_icons.set ("planner-board", true); + _dynamic_icons.set ("color-swatch", true); + _dynamic_icons.set ("emoji-happy", true); + _dynamic_icons.set ("planner-clipboard", true); + _dynamic_icons.set ("planner-copy", true); + _dynamic_icons.set ("planner-rotate", true); + _dynamic_icons.set ("planner-section", true); + _dynamic_icons.set ("unordered-list", true); + _dynamic_icons.set ("ordered-list", true); + _dynamic_icons.set ("menu", true); + _dynamic_icons.set ("share", true); + _dynamic_icons.set ("dropdown", true); + _dynamic_icons.set ("information", true); + _dynamic_icons.set ("dots-vertical", true); + _dynamic_icons.set ("plus", true); + + return _dynamic_icons; + } + } + + public bool is_dynamic_icon (string icon_name) { + return dynamic_icons.has_key (icon_name); + } +} \ No newline at end of file diff --git a/core/Widgets/DynamicIcon.vala b/core/Widgets/DynamicIcon.vala new file mode 100644 index 000000000..0025c72f9 --- /dev/null +++ b/core/Widgets/DynamicIcon.vala @@ -0,0 +1,91 @@ +/* +* Copyright © 2023 Alain M. (https://github.com/alainm23/planify) +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public +* License as published by the Free Software Foundation; either +* version 3 of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* General Public License for more details. +* +* You should have received a copy of the GNU General Public +* License along with this program; if not, write to the +* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +* Boston, MA 02110-1301 USA +* +* Authored by: Alain M. +*/ + +public class Widgets.DynamicIcon : Adw.Bin { + public string icon_name { get; set; default = null; } + public int size { get; set; default = 16; } + + private Gtk.Image icon; + + public DynamicIcon () { + Object( + halign: Gtk.Align.CENTER, + valign: Gtk.Align.CENTER + ); + } + + public DynamicIcon.from_icon_name (string icon_name) { + Object( + halign: Gtk.Align.CENTER, + valign: Gtk.Align.CENTER, + icon_name: icon_name + ); + + generate_icon (); + } + + construct { + icon = new Gtk.Image () { + halign = Gtk.Align.CENTER, + valign = Gtk.Align.CENTER + }; + + child = icon; + + notify["size"].connect (() => { + generate_icon (); + }); + + + + Services.Settings.get_default ().settings.changed.connect ((key) => { + if (key == "system-appearance" || key == "appearance" || key == "dark-mode") { + generate_icon (); + } + }); + } + + public void update_icon_name (string icon_name) { + this.icon_name = icon_name; + generate_icon (); + } + + private void generate_icon () { + if (icon_name == null) { + return; + } + + bool dark_mode = Services.Settings.get_default ().settings.get_boolean ("dark-mode"); + if (Services.Settings.get_default ().settings.get_boolean ("system-appearance")) { + dark_mode = Granite.Settings.get_default ().prefers_color_scheme == Granite.Settings.ColorScheme.DARK; + } + + if (Utils.get_default ().is_dynamic_icon (icon_name)) { + icon.gicon = new ThemedIcon ("%s-%s".printf ( + icon_name, dark_mode ? "dark" : "light" + )); + icon.pixel_size = size; + } else { + icon.gicon = new ThemedIcon (icon_name); + icon.pixel_size = size; + } + } +} \ No newline at end of file diff --git a/config.vala.in b/core/config.vala.in similarity index 100% rename from config.vala.in rename to core/config.vala.in diff --git a/core/meson.build b/core/meson.build new file mode 100644 index 000000000..60b706e4f --- /dev/null +++ b/core/meson.build @@ -0,0 +1,64 @@ +conf_data = configuration_data() +conf_data.set_quoted('APPLICATION_ID', application_id) +conf_data.set_quoted('GETTEXT_PACKAGE', application_id) +conf_data.set_quoted('VERSION', meson.project_version()) +conf_data.set_quoted('LOCALEDIR', get_option('prefix') / get_option('localedir')) +conf_data.set_quoted('PACKAGE_VERSION', meson.project_version()) +conf_data.set_quoted('PREFIX', get_option('prefix')) +conf_data.set_quoted('DATADIR', join_paths (get_option('prefix'), get_option('datadir'))) +conf_data.set_quoted('PROFILE', profile) + +config_file = configure_file( + configuration : conf_data, + input : 'config.vala.in', + output : 'config.vala' +) + +core_files = files( + 'Utils.vala', + 'Enum.vala', + 'Services/Settings.vala', + 'Widgets/DynamicIcon.vala' +) + +core_deps = [ + glib_dep, + gee_dep, + gtk_dep, + sqlite3_dep, + libadwaita_dep, + granite_dep, + json_dep, +] + +core_lib = shared_library( + 'planify', + core_files, + dependencies: [ core_deps, m_dep ], + install: true, + install_dir: [true, join_paths(get_option('includedir'), 'planify'), true], + soversion: '0', + version: '0.1' +) + +core_dep = declare_dependency( + link_with: core_lib, + dependencies: core_deps, + include_directories: include_directories('.') +) + +install_data( + 'planify.deps', + install_dir: join_paths(get_option('datadir'), 'vala', 'vapi') +) + +pkgconfig.generate( + core_lib, + filebase: 'planify', + version: meson.project_version(), + name: 'Planify', + description: 'Extension endpoint to the Planify application', + subdirs: 'planify', + requires: core_deps +) + diff --git a/core/planify.deps b/core/planify.deps new file mode 100644 index 000000000..4d8dc0297 --- /dev/null +++ b/core/planify.deps @@ -0,0 +1,11 @@ +glib-2.0 +gee-0.8 +gtk4 +sqlite3 +libadwaita-1 +webkitgtk-6.0 +granite-7 +json-glib-1.0 +libecal-2.0 +libedataserver-1.2 +libical-glib \ No newline at end of file diff --git a/data/io.github.alainm23.planify.appdata.xml.in.in b/data/io.github.alainm23.planify.appdata.xml.in.in index 3b53808ba..52d603a33 100644 --- a/data/io.github.alainm23.planify.appdata.xml.in.in +++ b/data/io.github.alainm23.planify.appdata.xml.in.in @@ -32,10 +32,13 @@ - https://raw.githubusercontent.com/alainm23/planner/master/data/resources/screenshot/screenshot-01.png + https://raw.githubusercontent.com/alainm23/planify/master/data/resources/screenshot/screenshot-01.png - https://raw.githubusercontent.com/alainm23/planner/master/data/resources/screenshot/screenshot-02.png + https://raw.githubusercontent.com/alainm23/planify/master/data/resources/screenshot/screenshot-02.png + + + https://raw.githubusercontent.com/alainm23/planify/master/data/resources/screenshot/screenshot-03.png @@ -51,6 +54,21 @@ https://useplanner.com/support/ @appid@.desktop + + +
    +
  • Icon size update.
  • +
  • Custom decoration layout support.
  • +
  • Improved colors in light theme.
  • +
  • Sort to-dos by project available.
  • +
  • Ability to configure or decrease the size of the sidebar.
  • +
  • Available configuration to change the start day of the week in the calendar.
  • +
  • Added the functionality to select the home page.
  • +
  • Bugs fixed #1053, #1026, #1042, #1041, #1037, #1035, #1015, #1001, #995, #946, #1055.
  • +
+
+
+