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..e7f672fd 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 is 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)