Skip to content

Commit 3855ae5

Browse files
committed
fix #1200 #546
1 parent 0d35020 commit 3855ae5

21 files changed

+362
-63
lines changed

core/Objects/Filters/Anytime.vala

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public class Objects.Filters.Anytime : Objects.BaseObject {
3939

4040
construct {
4141
name = _("Anytime");
42-
keywords = "%s;%s".printf (_("anytime"), _("no date"));
42+
keywords = "%s;%s;%s".printf (_("anytime"), _("filter"), _("no date"));
4343
icon_name = "grid-large-symbolic";
4444
}
4545
}

core/Objects/Filters/Completed.vala

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class Objects.Filters.Completed : Objects.BaseObject {
5656

5757
construct {
5858
name = _("Completed");
59-
keywords = "%s;%s".printf (_("completed"), _("logbook"));
59+
keywords = "%s;%s;%s".printf (_("completed"), _("filter"), _("logbook"));
6060
icon_name = "check-round-outline-symbolic";
6161

6262
Services.Database.get_default ().item_added.connect (() => {

core/Objects/Filters/Labels.vala

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class Objects.Filters.Labels : Objects.BaseObject {
5656

5757
construct {
5858
name = _("Labels");
59-
keywords = "%s".printf (_("labels"));
59+
keywords = "%s;%s".printf (_("labels"), _("filter"));
6060
icon_name = "tag-outline-symbolic";
6161

6262
Services.Database.get_default ().label_added.connect (() => {

core/Objects/Filters/Pinboard.vala

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class Objects.Filters.Pinboard : Objects.BaseObject {
4848

4949
construct {
5050
name = ("Pinboard");
51-
keywords = _("pinboard");
51+
keywords = _("Pinboard") + ";" + _("filter");
5252
icon_name = "pin-symbolic";
5353

5454
Services.Database.get_default ().item_added.connect (() => {

core/Objects/Filters/Priority.vala

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public class Objects.Filters.Priority : Objects.BaseObject {
6464

6565
construct {
6666
name = Util.get_default ().get_priority_title (priority);
67-
keywords = Util.get_default ().get_priority_keywords (priority);
67+
keywords = Util.get_default ().get_priority_keywords (priority) + ";" + _("filter");
6868

6969
Services.Database.get_default ().item_added.connect (() => {
7070
_count = Services.Database.get_default ().get_items_by_priority (priority, false).size;

core/Objects/Filters/Repeating.vala

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Copyright © 2023 Alain M. (https://github.com/alainm23/planify)
3+
*
4+
* This program is free software; you can redistribute it and/or
5+
* modify it under the terms of the GNU General Public
6+
* License as published by the Free Software Foundation; either
7+
* version 3 of the License, or (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+
* General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public
15+
* License along with this program; if not, write to the
16+
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17+
* Boston, MA 02110-1301 USA
18+
*
19+
* Authored by: Alain M. <alainmh23@gmail.com>
20+
*/
21+
22+
public class Objects.Filters.Repeating : Objects.BaseObject {
23+
private static Repeating? _instance;
24+
public static Repeating get_default () {
25+
if (_instance == null) {
26+
_instance = new Repeating ();
27+
}
28+
29+
return _instance;
30+
}
31+
32+
string _view_id;
33+
public string view_id {
34+
get {
35+
_view_id = "repeating-view";
36+
return _view_id;
37+
}
38+
}
39+
40+
construct {
41+
name = _("Repeating");
42+
keywords = "%s;%s".printf (_("repeating"), _("filter"));
43+
icon_name = "arrow-circular-top-right-symbolic";
44+
}
45+
}

core/Objects/Filters/Scheduled.vala

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class Objects.Filters.Scheduled : Objects.BaseObject {
4848

4949
construct {
5050
name = _("Scheduled");
51-
keywords = "%s;%s".printf (_("scheduled"), _("upcoming"));
51+
keywords = "%s;%s;%s".printf (_("scheduled"), _("upcoming"), _("filter"));
5252
icon_name = "month-symbolic";
5353

5454
Services.Database.get_default ().item_added.connect (() => {

core/Objects/Filters/Today.vala

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public class Objects.Filters.Today : Objects.BaseObject {
6464

6565
construct {
6666
name = _("Today");
67-
keywords = _("today");
67+
keywords = _("today") + ";" + _("filter");
6868
icon_name = "star-outline-thick-symbolic";
6969

7070
Services.Database.get_default ().item_added.connect (() => {

core/Objects/Filters/Tomorrow.vala

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public class Objects.Filters.Tomorrow : Objects.BaseObject {
3939

4040
construct {
4141
name = _("Tomorrow");
42-
keywords = "%s;%s".printf (_("tomorrow"), _("date"));
42+
keywords = "%s;%s;%s".printf (_("tomorrow"), _("filter"), _("date"));
4343
icon_name = "today-calendar-symbolic";
4444
}
4545
}

core/Objects/Filters/Unlabeled.vala

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Copyright © 2023 Alain M. (https://github.com/alainm23/planify)
3+
*
4+
* This program is free software; you can redistribute it and/or
5+
* modify it under the terms of the GNU General Public
6+
* License as published by the Free Software Foundation; either
7+
* version 3 of the License, or (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+
* General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public
15+
* License along with this program; if not, write to the
16+
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17+
* Boston, MA 02110-1301 USA
18+
*
19+
* Authored by: Alain M. <alainmh23@gmail.com>
20+
*/
21+
22+
public class Objects.Filters.Unlabeled : Objects.BaseObject {
23+
private static Unlabeled? _instance;
24+
public static Unlabeled get_default () {
25+
if (_instance == null) {
26+
_instance = new Unlabeled ();
27+
}
28+
29+
return _instance;
30+
}
31+
32+
string _view_id;
33+
public string view_id {
34+
get {
35+
_view_id = "unlabeled-view";
36+
return _view_id;
37+
}
38+
}
39+
40+
construct {
41+
name = _("Unlabeled");
42+
keywords = "%s;%s;%s".printf (_("no label"), _("unlabeled"), _("filter"));
43+
icon_name = "tag-outline-remove-symbolic";
44+
}
45+
}

core/Services/Database.vala

+26-6
Original file line numberDiff line numberDiff line change
@@ -1329,6 +1329,19 @@ public class Services.Database : GLib.Object {
13291329
}
13301330
}
13311331

1332+
public Gee.ArrayList<Objects.Item> get_items_repeating (bool checked = true) {
1333+
Gee.ArrayList<Objects.Item> return_value = new Gee.ArrayList<Objects.Item> ();
1334+
lock (_items) {
1335+
foreach (Objects.Item item in items) {
1336+
if (item.has_due && item.due.is_recurring && item.checked == checked) {
1337+
return_value.add (item);
1338+
}
1339+
}
1340+
1341+
return return_value;
1342+
}
1343+
}
1344+
13321345
public Gee.ArrayList<Objects.Item> get_items_by_date_range (GLib.DateTime start_date, GLib.DateTime end_date, bool checked = true) {
13331346
Gee.ArrayList<Objects.Item> return_value = new Gee.ArrayList<Objects.Item> ();
13341347
lock (_items) {
@@ -1390,12 +1403,6 @@ public class Services.Database : GLib.Object {
13901403
}
13911404
}
13921405

1393-
return_value.sort ((a, b) => {
1394-
var completed_a = Util.get_default ().get_date_from_string (a.completed_at);
1395-
var completed_b = Util.get_default ().get_date_from_string (b.completed_at);
1396-
return completed_b.compare (completed_a);
1397-
});
1398-
13991406
return return_value;
14001407
}
14011408
}
@@ -1413,6 +1420,19 @@ public class Services.Database : GLib.Object {
14131420
}
14141421
}
14151422

1423+
public Gee.ArrayList<Objects.Item> get_items_unlabeled (bool checked = true) {
1424+
Gee.ArrayList<Objects.Item> return_value = new Gee.ArrayList<Objects.Item> ();
1425+
lock (_items) {
1426+
foreach (Objects.Item item in items) {
1427+
if (item.labels.size <= 0 && item.checked == checked) {
1428+
return_value.add (item);
1429+
}
1430+
}
1431+
1432+
return return_value;
1433+
}
1434+
}
1435+
14161436
public Gee.ArrayList<Objects.Item> get_items_by_scheduled (bool checked = true) {
14171437
Gee.ArrayList<Objects.Item> return_value = new Gee.ArrayList<Objects.Item> ();
14181438
lock (_items) {

core/meson.build

+3-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ core_files = files(
7171
'Objects/Filters/Completed.vala',
7272
'Objects/Filters/Labels.vala',
7373
'Objects/Filters/Tomorrow.vala',
74-
'Objects/Filters/Anytime.vala'
74+
'Objects/Filters/Anytime.vala',
75+
'Objects/Filters/Repeating.vala',
76+
'Objects/Filters/Unlabeled.vala'
7577
)
7678

7779
core_deps = [

data/io.github.alainm23.planify.appdata.xml.in.in

+13-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,19 @@
6363
<url type="donation">https://www.patreon.com/alainm23</url>
6464
<launchable type="desktop-id">@appid@.desktop</launchable>
6565
<releases>
66-
<release version="4.5.8" date="2024-03-21">
66+
<release version="4.5.10" date="2024-03-25">
67+
<description translatable="no">
68+
<ul>
69+
<li>Tomorrow and Anytime’s filter added from Quick Find.</li>
70+
<li>Completed view added to the sidebar.</li>
71+
<li>Dutch translations added thanks to @Gert-dev.</li>
72+
<li>French translation update thanks to @rene-coty.</li>
73+
<li>Fixed bug with translations not being displayed in Quick Add.</li>
74+
</ul>
75+
</description>
76+
</release>
77+
78+
<release version="4.5.8" date="2024-03-21">
6779
<description translatable="no">
6880
<ul>
6981
<li>Fixed bug that icons are not displayed in Quick Add.</li>

data/io.github.alainm23.planify.gresource.xml

+3
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
<file alias="work-week-symbolic.svg">resources/icons/work-week-symbolic.svg</file>
7878
<file alias="permissions-generic-symbolic.svg">resources/icons/permissions-generic-symbolic.svg</file>
7979
<file alias="grid-large-symbolic.svg">resources/icons/grid-large-symbolic.svg</file>
80+
<file alias="tag-outline-remove-symbolic.svg">resources/icons/tag-outline-remove-symbolic.svg</file>
8081
</gresource>
8182

8283
<gresource prefix="/io/github/alainm23/planify/Devel/icons/scalable/actions">
@@ -131,6 +132,7 @@
131132
<file alias="work-week-symbolic.svg">resources/icons/work-week-symbolic.svg</file>
132133
<file alias="permissions-generic-symbolic.svg">resources/icons/permissions-generic-symbolic.svg</file>
133134
<file alias="grid-large-symbolic.svg">resources/icons/grid-large-symbolic.svg</file>
135+
<file alias="tag-outline-remove-symbolic.svg">resources/icons/tag-outline-remove-symbolic.svg</file>
134136
</gresource>
135137

136138
<gresource prefix="/io/github/alainm23/planify/quick-add/icons/scalable/actions">
@@ -185,5 +187,6 @@
185187
<file alias="work-week-symbolic.svg">resources/icons/work-week-symbolic.svg</file>
186188
<file alias="permissions-generic-symbolic.svg">resources/icons/permissions-generic-symbolic.svg</file>
187189
<file alias="grid-large-symbolic.svg">resources/icons/grid-large-symbolic.svg</file>
190+
<file alias="tag-outline-remove-symbolic.svg">resources/icons/tag-outline-remove-symbolic.svg</file>
188191
</gresource>
189192
</gresources>
Loading

meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
project(
22
'io.github.alainm23.planify',
33
'vala', 'c',
4-
version: '4.5.8'
4+
version: '4.5.10'
55
)
66

77
gnome = import('gnome')

quick-add/App.vala

-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ public class QuickAdd : Adw.Application {
2323
}
2424

2525
protected override void activate () {
26-
GLib.Environment.set_variable ("LANGUAGE", "fr", true);
27-
2826
main_window = new MainWindow (this);
2927
main_window.show ();
3028

src/Dialogs/QuickFind/QuickFind.vala

+9-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ public class Dialogs.QuickFind.QuickFind : Adw.Window {
157157
Objects.Filters.Labels.get_default (),
158158
Objects.Filters.Completed.get_default (),
159159
Objects.Filters.Tomorrow.get_default (),
160-
Objects.Filters.Anytime.get_default ()
160+
Objects.Filters.Anytime.get_default (),
161+
Objects.Filters.Repeating.get_default (),
162+
Objects.Filters.Unlabeled.get_default ()
161163
};
162164

163165
foreach (Objects.BaseObject object in filters) {
@@ -250,6 +252,12 @@ public class Dialogs.QuickFind.QuickFind : Adw.Window {
250252
} else if (base_object is Objects.Filters.Anytime) {
251253
Objects.Filters.Anytime _object = ((Objects.Filters.Anytime) base_object);
252254
Services.EventBus.get_default ().pane_selected (PaneType.FILTER, _object.view_id);
255+
} else if (base_object is Objects.Filters.Repeating) {
256+
Objects.Filters.Repeating _object = ((Objects.Filters.Repeating) base_object);
257+
Services.EventBus.get_default ().pane_selected (PaneType.FILTER, _object.view_id);
258+
} else if (base_object is Objects.Filters.Unlabeled) {
259+
Objects.Filters.Unlabeled _object = ((Objects.Filters.Unlabeled) base_object);
260+
Services.EventBus.get_default ().pane_selected (PaneType.FILTER, _object.view_id);
253261
}
254262
}
255263

src/Dialogs/QuickFind/QuickFindItem.vala

+2-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ public class Dialogs.QuickFind.QuickFindItem : Gtk.ListBoxRow {
119119
} else if (base_object is Objects.Filters.Today || base_object is Objects.Filters.Scheduled ||
120120
base_object is Objects.Filters.Completed || base_object is Objects.Filters.Tomorrow ||
121121
base_object is Objects.Filters.Labels || base_object is Objects.Filters.Scheduled ||
122-
base_object is Objects.Filters.Pinboard || base_object is Objects.Filters.Anytime) {
122+
base_object is Objects.Filters.Pinboard || base_object is Objects.Filters.Anytime ||
123+
base_object is Objects.Filters.Repeating || base_object is Objects.Filters.Unlabeled) {
123124
var filter_icon = new Gtk.Image.from_icon_name (base_object.icon_name) {
124125
valign = Gtk.Align.CENTER,
125126
pixel_size = 16

0 commit comments

Comments
 (0)