[gnome-control-center/wip/feborges/new-printers-panel] printers: add an empty state for the printer jobs dialog
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/wip/feborges/new-printers-panel] printers: add an empty state for the printer jobs dialog
- Date: Fri, 25 Sep 2015 13:19:05 +0000 (UTC)
commit 2961c866cc21522b24691ad61290365c8c878482
Author: Felipe Borges <feborges redhat com>
Date: Fri Sep 25 15:18:13 2015 +0200
printers: add an empty state for the printer jobs dialog
panels/printers/jobs-dialog.ui | 101 +++++++++++++++++++++++++++-----------
panels/printers/pp-jobs-dialog.c | 4 ++
2 files changed, 76 insertions(+), 29 deletions(-)
---
diff --git a/panels/printers/jobs-dialog.ui b/panels/printers/jobs-dialog.ui
index a3ea797..c47381d 100644
--- a/panels/printers/jobs-dialog.ui
+++ b/panels/printers/jobs-dialog.ui
@@ -33,35 +33,78 @@
</object>
</child>
<child internal-child="vbox">
- <object class="GtkBox" id="dialog-vbox1">
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="border_width">0</property>
- <child>
- <object class="GtkScrolledWindow" id="scrolledwindow">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="vexpand">True</property>
- <property name="hscrollbar-policy">never</property>
- <property name="shadow_type">none</property>
- <child>
- <object class="GtkListBox" id="jobs-listbox">
- <property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="halign">fill</property>
- <property name="valign">fill</property>
- <property name="selection-mode">none</property>
- <child>
- <placeholder/>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
+ <object class="GtkBox" id="dialog-vbox1">
+ <property name="can_focus">False</property>
+ <property name="border_width">0</property>
+ <child>
+ <object class="GtkStack" id="stack">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="vexpand">True</property>
+ <property name="hscrollbar-policy">never</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkListBox" id="jobs-listbox">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="halign">fill</property>
+ <property name="valign">fill</property>
+ <property name="selection-mode">none</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="name">list-jobs-page</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="no-jobs-dialog">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">10</property>
+ <property name="orientation">vertical</property>
+ <property name="valign">center</property>
+ <child>
+ <object class="GtkImage" id="no-printer-image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="valign">start</property>
+ <property name="pixel_size">64</property>
+ <property name="icon_name">printer-symbolic</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="no-printer-label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">No Active Printer Jobs</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="name">no-jobs-page</property>
+ </packing>
+ </child>
+ </object>
</child>
</object>
</child>
diff --git a/panels/printers/pp-jobs-dialog.c b/panels/printers/pp-jobs-dialog.c
index fd4e60e..a8eca40 100644
--- a/panels/printers/pp-jobs-dialog.c
+++ b/panels/printers/pp-jobs-dialog.c
@@ -183,9 +183,13 @@ update_jobs_list_cb (cups_job_t *jobs,
PpJobsDialog *dialog = (PpJobsDialog *) user_data;
GListStore *store;
gint i;
+ GtkStack *stack;
store = g_list_store_new (pp_job_get_type ());
+ stack = (GtkStack*) gtk_builder_get_object (GTK_BUILDER (dialog->builder), "stack");
+ gtk_stack_set_visible_child_name (GTK_STACK (stack), num_of_jobs > 0 ? "list-jobs-page" : "no-jobs-page");
+
if (dialog->num_jobs > 0)
cupsFreeJobs (dialog->num_jobs, dialog->jobs);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]