Skip to content

Commit

Permalink
Merge pull request #302 from sim6/syncing_page
Browse files Browse the repository at this point in the history
Syncing Page
  • Loading branch information
mrvladus authored May 24, 2024
2 parents bbc608f + 5419621 commit f814423
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
4 changes: 3 additions & 1 deletion errands/lib/sync/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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")
Expand Down
21 changes: 21 additions & 0 deletions errands/widgets/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f814423

Please sign in to comment.