Skip to content

Commit

Permalink
Use a static image instead of a spinner during app startup.
Browse files Browse the repository at this point in the history
  • Loading branch information
mtwebster committed May 3, 2024
1 parent 8b38c70 commit 643e58c
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 22 deletions.
19 changes: 6 additions & 13 deletions usr/lib/linuxmint/mintinstall/mintinstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,7 @@ class Application(Gtk.Application):
PAGE_DETAILS = "details"
PAGE_LOADING = "loading"
PAGE_SEARCHING = "searching"
PAGE_GENERATING_CACHE = "generating_cache"

def __init__(self):
super(Application, self).__init__(application_id='com.linuxmint.mintinstall',
Expand Down Expand Up @@ -1003,7 +1004,7 @@ def _init_installer_thread(self):
if self.installer.init_sync():
GLib.idle_add(self.on_installer_ready)
else:
self.loading_label.set_label(_("Generating cache, one moment"))
self.page_stack.set_visible_child_name(self.PAGE_GENERATING_CACHE)
self.installer.init(self.on_installer_ready)

def do_command_line(self, command_line, data=None):
Expand Down Expand Up @@ -1057,9 +1058,7 @@ def handle_command_line_install(self, file):
self.installer.get_pkginfo_from_ref_file(file, self.on_pkginfo_from_uri_complete)

def start_add_new_flatpak_remote(self, file):
self.builder.get_object("loading_spinner").start()
self.loading_label.set_label(_("Generating cache, one moment"))
self.page_stack.set_visible_child_name(self.PAGE_LOADING)
self.page_stack.set_visible_child_name(self.PAGE_GENERATING_CACHE)
self.installer.add_remote_from_repo_file(file, self.add_new_flatpak_remote_finished)

def add_new_flatpak_remote_finished(self, file=None, error=None):
Expand Down Expand Up @@ -1168,7 +1167,6 @@ def create_window(self, starting_page):
self.detail_view_icon.show()
self.builder.get_object("application_icon_holder").add(self.detail_view_icon)

self.loading_label = self.builder.get_object("loading_label")
self.status_label = self.builder.get_object("label_ongoing")
self.progressbar = self.builder.get_object("progressbar1")
self.progress_box = self.builder.get_object("progress_box")
Expand Down Expand Up @@ -1387,11 +1385,9 @@ def list_header_func(row, before, user_data=None):
self.subcat_flowbox.connect("child-activated", self.on_subcategory_selected)

def refresh_cache(self):
self.builder.get_object("loading_spinner").start()
self.refresh_cache_menuitem.set_sensitive(False)

self.page_stack.set_visible_child_name(self.PAGE_LOADING)
self.loading_label.set_label(_("Generating cache, one moment"))
self.page_stack.set_visible_child_name(self.PAGE_GENERATING_CACHE)

self.installer.force_new_cache(self._on_refresh_cache_complete)

Expand All @@ -1409,7 +1405,7 @@ def on_appstream_changed(self, installer):
self.banner_tile.repopulate_tile()

def on_installer_ready(self):
self.loading_label.set_label(_("Loading, please wait"))
self.page_stack.set_visible_child_name(self.PAGE_LOADING)
try:
self.process_matching_packages()

Expand Down Expand Up @@ -2392,8 +2388,6 @@ def apply_aliases(self):
pkginfo.display_name = ALIASES[pkg_name]

def finish_loading_visual(self):
self.builder.get_object("loading_spinner").stop()

if self.page_stack.get_visible_child_name() != self.PAGE_LANDING:
self.page_stack.set_visible_child_name(self.PAGE_LANDING)

Expand Down Expand Up @@ -2566,7 +2560,6 @@ def show_search_results(self, terms):
self.back_button.set_sensitive(True)
self.previous_page = self.PAGE_LANDING
if self.page_stack.get_visible_child_name() != self.PAGE_SEARCHING:
self.builder.get_object("loading_spinner").start()
self.page_stack.set_visible_child_name(self.PAGE_SEARCHING)

termsUpper = terms.upper()
Expand Down Expand Up @@ -2648,7 +2641,6 @@ def idle_search_one_package(pkginfos):

def on_search_results_complete(self, results):
self.page_stack.set_visible_child_name(self.PAGE_LIST)
self.builder.get_object("loading_spinner").stop()
self.show_packages(results, from_search=True)

def on_app_row_activated(self, listbox, row, previous_page):
Expand Down Expand Up @@ -2912,6 +2904,7 @@ def show_package(self, pkginfo, previous_page):
self.builder.get_object("application_version").set_label("")
self.unsafe_box.set_visible(self.flatpak_is_unsafe(pkginfo))

self.builder.get_object("application_dev_name").set_label(_("Unknown maintainer"))
ascomp = self.installer.get_appstream_app_for_pkginfo(pkginfo)

if ascomp is not None:
Expand Down
61 changes: 52 additions & 9 deletions usr/share/linuxmint/mintinstall/mintinstall.glade
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,20 @@
<property name="orientation">vertical</property>
<property name="spacing">10</property>
<child>
<object class="GtkLabel" id="loading_label">
<object class="GtkImage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">image-loading-symbolic</property>
<property name="icon_size">6</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Loading, please wait</property>
Expand All @@ -109,16 +122,45 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="name">loading</property>
<property name="title" translatable="yes">page0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box_generating_cache">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="valign">center</property>
<property name="orientation">vertical</property>
<property name="spacing">10</property>
<child>
<object class="GtkSpinner" id="loading_spinner">
<property name="height-request">50</property>
<object class="GtkSpinner">
<property name="height-request">48</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="active">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Generating cache, one moment</property>
<attributes>
<attribute name="weight" value="bold"/>
<attribute name="scale" value="1.2"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
Expand All @@ -127,7 +169,8 @@
</child>
</object>
<packing>
<property name="name">loading</property>
<property name="name">generating_cache</property>
<property name="position">1</property>
</packing>
</child>
<child>
Expand Down Expand Up @@ -348,7 +391,7 @@
</object>
<packing>
<property name="name">landing</property>
<property name="position">1</property>
<property name="position">2</property>
</packing>
</child>
<child>
Expand Down Expand Up @@ -480,7 +523,7 @@
</object>
<packing>
<property name="name">list</property>
<property name="position">2</property>
<property name="position">3</property>
</packing>
</child>
<child>
Expand Down Expand Up @@ -1793,7 +1836,7 @@
</object>
<packing>
<property name="name">details</property>
<property name="position">3</property>
<property name="position">4</property>
</packing>
</child>
<child>
Expand Down Expand Up @@ -1835,7 +1878,7 @@
</object>
<packing>
<property name="name">searching</property>
<property name="position">4</property>
<property name="position">5</property>
</packing>
</child>
</object>
Expand Down

0 comments on commit 643e58c

Please sign in to comment.