Skip to content

Commit 750352b

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 4441b98 + 0291b13 commit 750352b

Some content is hidden

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

86 files changed

+2263
-2187
lines changed

core/Objects/Item.vala

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1523,6 +1523,7 @@ public class Objects.Item : Objects.BaseObject {
15231523
_move (project.id, _section_id);
15241524
} else if (project.source_type == SourceType.TODOIST) {
15251525
loading = true;
1526+
sensitive = false;
15261527

15271528
string move_id = project.id;
15281529
string move_type = "project_id";
@@ -1543,7 +1544,8 @@ public class Objects.Item : Objects.BaseObject {
15431544
});
15441545
} else if (project.source_type == SourceType.CALDAV) {
15451546
loading = true;
1546-
1547+
sensitive = false;
1548+
15471549
move_caldav_recursive.begin (project, _section_id);
15481550
}
15491551
}
@@ -1762,4 +1764,29 @@ public class Objects.Item : Objects.BaseObject {
17621764

17631765
return response;
17641766
}
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+
}
17651792
}

core/QuickAddCore.vala

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,6 @@ public class Layouts.QuickAddCore : Adw.Bin {
575575
signal_map[event_controller_key.key_pressed.connect ((keyval, keycode, state) => {
576576
if (keyval == Gdk.Key.Control_L || keyval == Gdk.Key.Control_R) {
577577
ctrl_pressed = true;
578-
create_more_button.active = ctrl_pressed;
579578
}
580579

581580
return false;
@@ -584,7 +583,6 @@ public class Layouts.QuickAddCore : Adw.Bin {
584583
signal_map[event_controller_key.key_released.connect ((keyval, keycode, state) => {
585584
if (keyval == Gdk.Key.Control_L || keyval == Gdk.Key.Control_R) {
586585
ctrl_pressed = false;
587-
create_more_button.active = ctrl_pressed;
588586
}
589587
})] = event_controller_key;
590588

@@ -632,9 +630,15 @@ public class Layouts.QuickAddCore : Adw.Bin {
632630
return true;
633631
}));
634632

633+
var toggle_keep_adding_shortcut = new Gtk.Shortcut (Gtk.ShortcutTrigger.parse_string ("<Control>k"), new Gtk.CallbackAction (() => {
634+
create_more_button.active = !create_more_button.active;
635+
return true;
636+
}));
637+
635638
shortcut_controller = new Gtk.ShortcutController ();
636639
shortcut_controller.add_shortcut (open_label_shortcut);
637640
shortcut_controller.add_shortcut (open_reminder_shortcut);
641+
shortcut_controller.add_shortcut (toggle_keep_adding_shortcut);
638642
add_controller (shortcut_controller);
639643

640644
destroy_controller = new Gtk.EventControllerKey ();
@@ -1272,7 +1276,7 @@ public class Layouts.QuickAddCore : Adw.Bin {
12721276
margin_top = 3,
12731277
margin_bottom = 3
12741278
});
1275-
popover_box.append (build_shortcut_widget ("", "#1e63ec", _("Keep adding"), _("Stay open after creating task")));
1279+
popover_box.append (build_shortcut_widget ("Ctrl+K", "#1e63ec", _("Keep adding"), _("Toggle stay open after creating task")));
12761280
popover_box.append (new Widgets.ContextMenu.MenuSeparator () {
12771281
margin_top = 3,
12781282
margin_bottom = 3
@@ -1303,7 +1307,7 @@ public class Layouts.QuickAddCore : Adw.Bin {
13031307

13041308
private Gtk.Widget build_shortcut_widget (string shortcut_key, string color, string title, string subtitle) {
13051309
var shortcut_label = new Gtk.Label (shortcut_key) {
1306-
width_chars = 5,
1310+
width_chars = 6,
13071311
valign = CENTER
13081312
};
13091313
shortcut_label.add_css_class ("caption");

core/Utils/Util.vala

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ We hope you’ll enjoy using Planify!""");
809809
return generator.to_data (null);
810810
}
811811

812-
public async void move_backend_type_item (Objects.Item item, Objects.Project target_project, string parent_id = "") {
812+
public async void move_backend_type_item (Objects.Item item, Objects.Project target_project, string parent_id = "", bool notify = true) {
813813
var new_item = item.duplicate ();
814814
new_item.project_id = target_project.id;
815815
new_item.parent_id = parent_id;
@@ -819,14 +819,14 @@ We hope you’ll enjoy using Planify!""");
819819

820820
if (target_project.source_type == SourceType.LOCAL) {
821821
new_item.id = Util.get_default ().generate_id (new_item);
822-
yield add_final_duplicate_item (new_item, item);
822+
yield add_final_duplicate_item (new_item, item, notify);
823823
} else if (target_project.source_type == SourceType.TODOIST) {
824824
HttpResponse response = yield Services.Todoist.get_default ().add (new_item);
825825
item.loading = false;
826826

827827
if (response.status) {
828828
new_item.id = response.data;
829-
yield add_final_duplicate_item (new_item, item);
829+
yield add_final_duplicate_item (new_item, item, notify);
830830
}
831831
} else if (target_project.source_type == SourceType.CALDAV) {
832832
new_item.id = Util.get_default ().generate_id (new_item);
@@ -836,13 +836,17 @@ We hope you’ll enjoy using Planify!""");
836836
item.loading = false;
837837

838838
if (response.status) {
839-
yield add_final_duplicate_item (new_item, item);
839+
yield add_final_duplicate_item (new_item, item, notify);
840840
}
841841
}
842842
}
843843

844-
public async void add_final_duplicate_item (Objects.Item new_item, Objects.Item item) {
845-
new_item.project.add_item_if_not_exists (new_item);
844+
public async void add_final_duplicate_item (Objects.Item new_item, Objects.Item item, bool notify = true) {
845+
if (new_item.has_parent) {
846+
new_item.parent.add_item_if_not_exists (new_item);
847+
} else {
848+
new_item.project.add_item_if_not_exists (new_item);
849+
}
846850

847851
foreach (Objects.Reminder reminder in item.reminders) {
848852
var _reminder = reminder.duplicate ();
@@ -859,12 +863,14 @@ We hope you’ll enjoy using Planify!""");
859863
}
860864

861865
foreach (Objects.Item subitem in item.items) {
862-
yield move_backend_type_item (subitem, new_item.project, new_item.id);
866+
yield move_backend_type_item (subitem, new_item.project, new_item.id, false);
863867
}
864868

865-
Services.EventBus.get_default ().send_toast (
866-
create_toast (_("Task moved to %s".printf (new_item.project.name)))
867-
);
869+
if (notify) {
870+
Services.EventBus.get_default ().send_toast (
871+
create_toast (_("Task moved to %s".printf (new_item.project.name)))
872+
);
873+
}
868874

869875
item.delete_item ();
870876
}

po/af.po

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ msgstr ""
320320
msgid "Task copied to clipboard"
321321
msgstr ""
322322

323-
#: core/Objects/Item.vala:1609 core/Utils/Util.vala:866
323+
#: core/Objects/Item.vala:1611 core/Utils/Util.vala:871
324324
#, c-format
325325
msgid "Task moved to %s"
326326
msgstr ""
@@ -444,7 +444,7 @@ msgstr ""
444444
msgid "Add Task"
445445
msgstr ""
446446

447-
#: core/QuickAddCore.vala:296 core/QuickAddCore.vala:1275
447+
#: core/QuickAddCore.vala:296 core/QuickAddCore.vala:1279
448448
msgid "Keep adding"
449449
msgstr ""
450450

@@ -458,55 +458,55 @@ msgid ""
458458
"project from Planify."
459459
msgstr ""
460460

461-
#: core/QuickAddCore.vala:1237 src/MainWindow.vala:707
461+
#: core/QuickAddCore.vala:1241 src/MainWindow.vala:707
462462
msgid "Keyboard Shortcuts"
463463
msgstr ""
464464

465-
#: core/QuickAddCore.vala:1243
465+
#: core/QuickAddCore.vala:1247
466466
msgid "Speed up task creation with these shortcuts"
467467
msgstr ""
468468

469-
#: core/QuickAddCore.vala:1257
469+
#: core/QuickAddCore.vala:1261
470470
msgid "Set priority"
471471
msgstr ""
472472

473-
#: core/QuickAddCore.vala:1257
473+
#: core/QuickAddCore.vala:1261
474474
msgid "p1 = highest, p4 = lowest"
475475
msgstr ""
476476

477-
#: core/QuickAddCore.vala:1258
477+
#: core/QuickAddCore.vala:1262
478478
msgid "Add labels"
479479
msgstr ""
480480

481-
#: core/QuickAddCore.vala:1258
481+
#: core/QuickAddCore.vala:1262
482482
msgid "Opens label selector"
483483
msgstr ""
484484

485-
#: core/QuickAddCore.vala:1259
485+
#: core/QuickAddCore.vala:1263
486486
msgid "Assign project"
487487
msgstr ""
488488

489-
#: core/QuickAddCore.vala:1259
489+
#: core/QuickAddCore.vala:1263
490490
msgid "Opens project selector"
491491
msgstr ""
492492

493-
#: core/QuickAddCore.vala:1260
493+
#: core/QuickAddCore.vala:1264
494494
msgid "Set reminder"
495495
msgstr ""
496496

497-
#: core/QuickAddCore.vala:1260
497+
#: core/QuickAddCore.vala:1264
498498
msgid "Opens reminder options"
499499
msgstr ""
500500

501-
#: core/QuickAddCore.vala:1275
502-
msgid "Stay open after creating task"
501+
#: core/QuickAddCore.vala:1279
502+
msgid "Toggle stay open after creating task"
503503
msgstr ""
504504

505-
#: core/QuickAddCore.vala:1281
505+
#: core/QuickAddCore.vala:1285
506506
msgid "Tip"
507507
msgstr ""
508508

509-
#: core/QuickAddCore.vala:1281
509+
#: core/QuickAddCore.vala:1285
510510
msgid "Combine shortcuts in the title field for faster creation"
511511
msgstr ""
512512

@@ -942,43 +942,43 @@ msgstr ""
942942
msgid "🏃‍♀️️Follow Up"
943943
msgstr ""
944944

945-
#: core/Utils/Util.vala:945
945+
#: core/Utils/Util.vala:951
946946
msgid "Task duplicated"
947947
msgstr ""
948948

949-
#: core/Utils/Util.vala:981
949+
#: core/Utils/Util.vala:987
950950
msgid "Section duplicated"
951951
msgstr ""
952952

953-
#: core/Utils/Util.vala:1007 core/Utils/Util.vala:1033
953+
#: core/Utils/Util.vala:1013 core/Utils/Util.vala:1039
954954
msgid "Project duplicated"
955955
msgstr ""
956956

957-
#: core/Utils/Util.vala:1075 src/Dialogs/Preferences/Pages/TaskSetting.vala:153
957+
#: core/Utils/Util.vala:1081 src/Dialogs/Preferences/Pages/TaskSetting.vala:153
958958
msgid "At due time"
959959
msgstr ""
960960

961-
#: core/Utils/Util.vala:1078 src/Dialogs/Preferences/Pages/TaskSetting.vala:154
961+
#: core/Utils/Util.vala:1084 src/Dialogs/Preferences/Pages/TaskSetting.vala:154
962962
msgid "10 minutes before"
963963
msgstr ""
964964

965-
#: core/Utils/Util.vala:1081 src/Dialogs/Preferences/Pages/TaskSetting.vala:155
965+
#: core/Utils/Util.vala:1087 src/Dialogs/Preferences/Pages/TaskSetting.vala:155
966966
msgid "30 minutes before"
967967
msgstr ""
968968

969-
#: core/Utils/Util.vala:1084 src/Dialogs/Preferences/Pages/TaskSetting.vala:156
969+
#: core/Utils/Util.vala:1090 src/Dialogs/Preferences/Pages/TaskSetting.vala:156
970970
msgid "45 minutes before"
971971
msgstr ""
972972

973-
#: core/Utils/Util.vala:1087 src/Dialogs/Preferences/Pages/TaskSetting.vala:157
973+
#: core/Utils/Util.vala:1093 src/Dialogs/Preferences/Pages/TaskSetting.vala:157
974974
msgid "1 hour before"
975975
msgstr ""
976976

977-
#: core/Utils/Util.vala:1090 src/Dialogs/Preferences/Pages/TaskSetting.vala:158
977+
#: core/Utils/Util.vala:1096 src/Dialogs/Preferences/Pages/TaskSetting.vala:158
978978
msgid "2 hours before"
979979
msgstr ""
980980

981-
#: core/Utils/Util.vala:1093 src/Dialogs/Preferences/Pages/TaskSetting.vala:159
981+
#: core/Utils/Util.vala:1099 src/Dialogs/Preferences/Pages/TaskSetting.vala:159
982982
msgid "3 hours before"
983983
msgstr ""
984984

0 commit comments

Comments
 (0)