mirror of
https://github.com/morgan9e/warehouse
synced 2026-04-14 00:04:08 +09:00
Setup loading functions
This commit is contained in:
@@ -31,7 +31,6 @@ template $RemotesPage : Adw.NavigationPage {
|
||||
Adw.ToastOverlay {
|
||||
Stack stack {
|
||||
Adw.StatusPage loading_remotes {
|
||||
visible: false;
|
||||
title: _("Loading Remotes");
|
||||
description: _("This should only take a moment");
|
||||
child:
|
||||
@@ -46,7 +45,6 @@ template $RemotesPage : Adw.NavigationPage {
|
||||
icon-name: "system-search-symbolic";
|
||||
}
|
||||
Adw.StatusPage no_remotes {
|
||||
visible: false;
|
||||
title: _("No Remotes Found");
|
||||
description: _("Warehouse cannot see the current remotes or your system has no remotes added");
|
||||
icon-name: "error-symbolic";
|
||||
|
||||
@@ -23,6 +23,12 @@ class RemotesPage(Adw.NavigationPage):
|
||||
# It is used to determine if a new page should be made or not
|
||||
# This must be set to the created object from within the class's __init__ method
|
||||
instance = None
|
||||
|
||||
def start_loading(self):
|
||||
self.stack.set_visible_child(self.loading_remotes)
|
||||
|
||||
def end_loading(self):
|
||||
self.stack.set_visible_child(self.content_page)
|
||||
|
||||
def __init__(self, main_window, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
@@ -30,6 +36,7 @@ class RemotesPage(Adw.NavigationPage):
|
||||
# Extra Object Creation
|
||||
ms = main_window.main_split
|
||||
self.search_bar.set_key_capture_widget(main_window)
|
||||
self.__class__.instance = self
|
||||
|
||||
# Connections
|
||||
ms.connect("notify::show-sidebar", lambda *_: self.sidebar_button.set_active(ms.get_show_sidebar()))
|
||||
|
||||
Reference in New Issue
Block a user