[gnome-software] update dialog: Add a no results page when no update history is available
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] update dialog: Add a no results page when no update history is available
- Date: Sun, 24 May 2015 14:18:12 +0000 (UTC)
commit c8e106edd417c50160cf68ef6825b76c20337af1
Author: Kalev Lember <kalevlember gmail com>
Date: Sun May 24 14:11:13 2015 +0200
update dialog: Add a no results page when no update history is available
src/gs-update-dialog.c | 2 ++
src/gs-update-dialog.ui | 47 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 49 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-update-dialog.c b/src/gs-update-dialog.c
index 874a0ff..b5eb951 100644
--- a/src/gs-update-dialog.c
+++ b/src/gs-update-dialog.c
@@ -188,6 +188,7 @@ get_installed_updates_cb (GsPluginLoader *plugin_loader,
GS_PLUGIN_LOADER_ERROR,
GS_PLUGIN_LOADER_ERROR_NO_RESULTS)) {
g_debug ("no installed updates to show");
+ gtk_stack_set_visible_child_name (GTK_STACK (priv->stack), "empty");
return;
} else if (g_error_matches (error,
G_IO_ERROR,
@@ -198,6 +199,7 @@ get_installed_updates_cb (GsPluginLoader *plugin_loader,
}
g_warning ("failed to get installed updates: %s", error->message);
+ gtk_stack_set_visible_child_name (GTK_STACK (priv->stack), "empty");
return;
}
diff --git a/src/gs-update-dialog.ui b/src/gs-update-dialog.ui
index cfc6276..5771336 100644
--- a/src/gs-update-dialog.ui
+++ b/src/gs-update-dialog.ui
@@ -81,6 +81,53 @@
</packing>
</child>
<child>
+ <object class="GtkBox" id="box_empty">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="spacing">16</property>
+ <property name="orientation">vertical</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ <child>
+ <object class="GtkImage" id="icon_empty">
+ <property name="visible">True</property>
+ <property name="icon_name">gnome-software-symbolic</property>
+ <property name="pixel-size">64</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label_empty">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="justify">center</property>
+ <property name="label" translatable="yes">No updates have been installed on this
system.</property>
+ <property name="wrap">True</property>
+ <property name="max_width_chars">40</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="name">empty</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkBox" id="box7">
<property name="visible">True</property>
<property name="can_focus">False</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]