Skip to content

Commit c69cc2b

Browse files
authored
Merge branch 'master' into feat/chrono
2 parents 8b36755 + 73475e2 commit c69cc2b

File tree

159 files changed

+27340
-18641
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+27340
-18641
lines changed

.github/workflows/caldav-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
meson test -C build --suite=caldav-integration --print-errorlogs
5757
5858
- name: Upload Meson test log
59-
uses: actions/upload-artifact@v4
59+
uses: actions/upload-artifact@v5
6060
with:
6161
name: meson-test-log
6262
path: build/meson-logs/testlog.txt

.github/workflows/merge.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,16 @@ jobs:
4949
echo >> po/POTFILES
5050
echo "data/resources/ui/shortcuts.ui" >> po/POTFILES
5151
52-
# Update translations
53-
xgettext --files-from=po/POTFILES --directory=. \
54-
--output=po/io.github.alainm23.planify.pot --from-code=UTF-8 \
55-
--keyword=_ --keyword=N_
56-
57-
for lang in $(cat po/LINGUAS); do
58-
msgmerge --update --no-fuzzy-matching --backup=none po/$lang.po po/io.github.alainm23.planify.pot
59-
done
52+
# Update translations preserving metadata
53+
python3 scripts/update_translations.py
6054
6155
- name: Check for real changes
6256
id: check_changes
6357
run: |
64-
# Exclude date-only changes (POT-Creation-Date and PO-Revision-Date)
58+
# Exclude metadata-only changes
6559
if git diff --ignore-matching-lines='^"POT-Creation-Date:' \
6660
--ignore-matching-lines='^"PO-Revision-Date:' \
61+
--ignore-matching-lines='^"Report-Msgid-Bugs-To:' \
6762
--quiet po/; then
6863
echo "has_changes=false" >> $GITHUB_OUTPUT
6964
else
@@ -83,3 +78,11 @@ jobs:
8378
git add po/
8479
git diff --staged --quiet || git commit -m "Update translations"
8580
git push origin master
81+
82+
- name: Notify Weblate of changes
83+
if: steps.check_changes.outputs.has_changes == 'true'
84+
run: |
85+
curl -X POST "https://hosted.weblate.org/api/components/planner/io-github-alainm23-planify/repository/" \
86+
-H "Authorization: Token ${{ secrets.WEBLATE_TOKEN }}" \
87+
-H "Content-Type: application/json" \
88+
-d '{"operation": "pull"}'

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111

1212
steps:
1313
- name: Checkout code
14-
uses: actions/checkout@v4
14+
uses: actions/checkout@v5
1515
with:
1616
fetch-depth: 0
1717

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[![Please do not theme this app](https://stopthemingmy.app/badge.svg)](https://stopthemingmy.app)
22
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](http://www.gnu.org/licenses/gpl-3.0)
33
<a href="https://hosted.weblate.org/engage/planner/">
4-
<img src="https://hosted.weblate.org/widget/planner/translations/svg-badge.svg" alt="Translation status" />
4+
<img src="https://hosted.weblate.org/widget/planner/io-github-alainm23-planify/svg-badge.svg" alt="Estado de la traducción" />
55
</a>
66

77
<div align="center">
@@ -176,4 +176,4 @@ If you find Planify useful, consider supporting its development:
176176
<br><br>
177177
<img src="https://img.shields.io/github/stars/alainm23/planify?style=social" alt="GitHub stars">
178178
<img src="https://img.shields.io/github/forks/alainm23/planify?style=social" alt="GitHub forks">
179-
</div>
179+
</div>

core/Objects/Item.vala

Lines changed: 66 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,18 +1369,42 @@ public class Objects.Item : Objects.BaseObject {
13691369
}
13701370
});
13711371
} else if (project.source_type == SourceType.CALDAV) {
1372-
loading = true;
1373-
var caldav_client = Services.CalDAV.Core.get_default ().get_client (project.source);
1374-
caldav_client.delete_item.begin (this, (obj, res) => {
1375-
HttpResponse response = caldav_client.delete_item.end (res);
1376-
loading = false;
1372+
delete_caldav.begin ();
1373+
}
1374+
}
13771375

1378-
if (response.status) {
1379-
Services.Store.instance ().delete_item (this);
1380-
} else {
1381-
Services.EventBus.get_default ().send_error_toast (response.error_code, response.error);
1382-
}
1383-
});
1376+
private async void delete_caldav () {
1377+
loading = true;
1378+
var caldav_client = Services.CalDAV.Core.get_default ().get_client (project.source);
1379+
1380+
try {
1381+
yield delete_subitems_caldav (this, caldav_client);
1382+
1383+
var response = yield caldav_client.delete_item (this);
1384+
1385+
if (!response.status) {
1386+
throw new IOError.FAILED (response.error);
1387+
}
1388+
1389+
Services.Store.instance ().delete_item (this);
1390+
} catch (Error e) {
1391+
Services.EventBus.get_default ().send_error_toast (0, e.message);
1392+
}
1393+
1394+
loading = false;
1395+
}
1396+
1397+
private async void delete_subitems_caldav (Objects.Item item, Services.CalDAV.CalDAVClient caldav_client) throws Error {
1398+
foreach (Objects.Item subitem in Services.Store.instance ().get_subitems (item)) {
1399+
yield delete_subitems_caldav (subitem, caldav_client);
1400+
1401+
var response = yield caldav_client.delete_item (subitem);
1402+
1403+
if (!response.status) {
1404+
throw new IOError.FAILED (response.error);
1405+
}
1406+
1407+
Services.Store.instance ().delete_item (subitem);
13841408
}
13851409
}
13861410

@@ -1495,12 +1519,12 @@ public class Objects.Item : Objects.BaseObject {
14951519
}
14961520

14971521
public void move (Objects.Project project, string _section_id) {
1498-
loading = true;
1499-
show_item = false;
1500-
15011522
if (project.source_type == SourceType.LOCAL) {
15021523
_move (project.id, _section_id);
15031524
} else if (project.source_type == SourceType.TODOIST) {
1525+
loading = true;
1526+
sensitive = false;
1527+
15041528
string move_id = project.id;
15051529
string move_type = "project_id";
15061530
if (_section_id != "") {
@@ -1511,7 +1535,6 @@ public class Objects.Item : Objects.BaseObject {
15111535
Services.Todoist.get_default ().move_item.begin (this, move_type, move_id, (obj, res) => {
15121536
var response = Services.Todoist.get_default ().move_item.end (res);
15131537
loading = false;
1514-
show_item = true;
15151538

15161539
if (response.status) {
15171540
_move (project.id, _section_id);
@@ -1520,6 +1543,9 @@ public class Objects.Item : Objects.BaseObject {
15201543
}
15211544
});
15221545
} else if (project.source_type == SourceType.CALDAV) {
1546+
loading = true;
1547+
sensitive = false;
1548+
15231549
move_caldav_recursive.begin (project, _section_id);
15241550
}
15251551
}
@@ -1738,4 +1764,29 @@ public class Objects.Item : Objects.BaseObject {
17381764

17391765
return response;
17401766
}
1767+
1768+
public void to_string () {
1769+
print ("_________________________________\n");
1770+
print ("ID: %s\n", id);
1771+
print ("Content: %s\n", content);
1772+
print ("Description: %s\n", description);
1773+
print ("Project ID: %s\n", project_id);
1774+
print ("Section ID: %s\n", section_id);
1775+
print ("Parent ID: %s\n", parent_id);
1776+
print ("Priority: %d (%s)\n", priority, priority_text);
1777+
print ("Checked: %s\n", checked ? "true" : "false");
1778+
print ("Pinned: %s\n", pinned ? "true" : "false");
1779+
print ("Has Due: %s\n", has_due ? "true" : "false");
1780+
if (has_due) {
1781+
print ("Due Date: %s\n", due.date);
1782+
}
1783+
print ("Child Order: %d\n", child_order);
1784+
print ("Added At: %s\n", added_at);
1785+
print ("Completed At: %s\n", completed_at);
1786+
print ("Labels: %d\n", labels.size);
1787+
foreach (var label in labels) {
1788+
print (" - %s\n", label.name);
1789+
}
1790+
print ("---------------------------------\n");
1791+
}
17411792
}

core/Objects/Project.vala

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -753,11 +753,13 @@ public class Objects.Project : Objects.BaseObject {
753753
int items_checked = 0;
754754

755755
foreach (Objects.Item item in Services.Store.instance ().get_items_by_project (this)) {
756-
if (!item.was_archived ()) {
757-
items_total++;
758-
if (item.checked) {
759-
items_checked++;
760-
}
756+
if (!is_archived && item.was_archived ()) {
757+
continue;
758+
}
759+
760+
items_total++;
761+
if (item.checked) {
762+
items_checked++;
761763
}
762764
}
763765

0 commit comments

Comments
 (0)