From 23c4fa133fb527ac24e788eb6d9f763b4b3682c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sim=C3=B3=20Albert=20i=20Beltran?= Date: Fri, 24 May 2024 12:05:50 +0200 Subject: [PATCH 1/2] Syncing Page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Show Syncing Page while first syncronization instead of remaining in Status Page with the message "Create new or import existing one". Signed-off-by: Simó Albert i Beltran --- errands/lib/sync/sync.py | 4 +++- errands/widgets/window.py | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/errands/lib/sync/sync.py b/errands/lib/sync/sync.py index c05b6b40..3da56faf 100644 --- a/errands/lib/sync/sync.py +++ b/errands/lib/sync/sync.py @@ -47,6 +47,8 @@ def sync(self) -> None: self.sync_again = True return self.syncing = True + if State.view_stack.get_visible_child_name() == "errands_status_page": + State.view_stack.set_visible_child_name("errands_syncing_page") GLib.idle_add(State.sidebar.toggle_sync_indicator, True) self.provider.sync() UserData.clean_deleted() @@ -56,7 +58,7 @@ def sync(self) -> None: GLib.idle_add(State.sidebar.toggle_sync_indicator, False) self.syncing = False if ( - State.view_stack.get_visible_child_name() == "errands_status_page" + State.view_stack.get_visible_child_name() == "errands_syncing_page" and UserData.task_lists ): State.view_stack.set_visible_child_name("errands_today_page") diff --git a/errands/widgets/window.py b/errands/widgets/window.py index 518aee11..7b341e61 100644 --- a/errands/widgets/window.py +++ b/errands/widgets/window.py @@ -102,6 +102,27 @@ def __build_ui(self) -> None: title=_("Create new List"), ) + # Syncing Page + self.view_stack.add_titled( + child=ErrandsToolbarView( + top_bars=[Adw.HeaderBar(show_title=False)], + content=ErrandsBox( + orientation=Gtk.Orientation.VERTICAL, + hexpand=True, + valign=Gtk.Align.CENTER, + children=[ + Adw.StatusPage( + title=_("Syncing"), + description=_("First syncronization running"), + icon_name="errands-sync-symbolic", + ), + ], + ), + ), + name="errands_syncing_page", + title=_("Syncing"), + ) + # Toast Overlay self.toast_overlay: Adw.ToastOverlay = Adw.ToastOverlay(child=self.split_view) self.set_content(self.toast_overlay) From 5419621dc894846dc78f135cf1af26276944aec5 Mon Sep 17 00:00:00 2001 From: mrvladus <64690334+mrvladus@users.noreply.github.com> Date: Fri, 24 May 2024 15:12:06 +0300 Subject: [PATCH 2/2] Fix typo --- errands/widgets/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/errands/widgets/window.py b/errands/widgets/window.py index 7b341e61..e7f672fd 100644 --- a/errands/widgets/window.py +++ b/errands/widgets/window.py @@ -113,7 +113,7 @@ def __build_ui(self) -> None: children=[ Adw.StatusPage( title=_("Syncing"), - description=_("First syncronization running"), + description=_("First syncronization is running"), icon_name="errands-sync-symbolic", ), ],