Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syncing Page #302

Merged
merged 2 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading