[gnome-control-center/new-printers-panel] Select a printer when panel loads. Change +/- stock icons to list-add/list-remove icons.
- From: Marek Kašík <mkasik src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/new-printers-panel] Select a printer when panel loads. Change +/- stock icons to list-add/list-remove icons.
- Date: Mon, 20 Dec 2010 11:55:38 +0000 (UTC)
commit 902c5a7d0adf76716eb3bbfede719da7da77d856
Author: Marek Kasik <mkasik redhat com>
Date: Mon Dec 20 12:48:06 2010 +0100
Select a printer when panel loads.
Change +/- stock icons to list-add/list-remove icons.
panels/printers/cc-printers-panel.c | 18 +++++++++++++++---
panels/printers/printers.ui | 8 ++++----
2 files changed, 19 insertions(+), 7 deletions(-)
---
diff --git a/panels/printers/cc-printers-panel.c b/panels/printers/cc-printers-panel.c
index ad9c289..095939b 100644
--- a/panels/printers/cc-printers-panel.c
+++ b/panels/printers/cc-printers-panel.c
@@ -302,6 +302,18 @@ actualize_printers_list (CcPrintersPanel *self)
gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview)),
&selected_iter);
}
+ else
+ {
+ if (priv->num_dests > 0 &&
+ gtk_tree_model_get_iter_first ((GtkTreeModel *) store,
+ &selected_iter))
+ {
+ priv->current_dest = 0;
+ gtk_tree_selection_select_iter (
+ gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview)),
+ &selected_iter);
+ }
+ }
}
static void
@@ -317,15 +329,15 @@ populate_printers_list (CcPrintersPanel *self)
treeview = (GtkWidget*)
gtk_builder_get_object (priv->builder, "printer-treeview");
+ g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview)),
+ "changed", G_CALLBACK (printer_selection_changed_cb), self);
+
actualize_printers_list (self);
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Printer", renderer,
"text", PRINTER_NAME_COLUMN, NULL);
- g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview)),
- "changed", G_CALLBACK (printer_selection_changed_cb), self);
-
gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column);
}
diff --git a/panels/printers/printers.ui b/panels/printers/printers.ui
index 2c9ab60..cd62874 100644
--- a/panels/printers/printers.ui
+++ b/panels/printers/printers.ui
@@ -37,7 +37,7 @@
<property name="tooltip_text" translatable="yes">Add new printer</property>
<property name="label" translatable="yes">AddPrinter</property>
<property name="use_underline">True</property>
- <property name="stock_id">gtk-add</property>
+ <property name="icon_name">list-add</property>
</object>
<packing>
<property name="expand">False</property>
@@ -50,7 +50,7 @@
<property name="tooltip_text" translatable="yes">Remove selected printer</property>
<property name="label" translatable="yes">RemovePrinter</property>
<property name="use_underline">True</property>
- <property name="stock_id">gtk-remove</property>
+ <property name="icon_name">list-remove</property>
</object>
<packing>
<property name="expand">False</property>
@@ -104,7 +104,7 @@
<property name="visible">True</property>
<property name="label" translatable="yes">toolbutton7</property>
<property name="use_underline">True</property>
- <property name="stock_id">gtk-add</property>
+ <property name="icon_name">list-add</property>
</object>
<packing>
<property name="expand">False</property>
@@ -116,7 +116,7 @@
<property name="visible">True</property>
<property name="label" translatable="yes">toolbutton8</property>
<property name="use_underline">True</property>
- <property name="stock_id">gtk-remove</property>
+ <property name="icon_name">list-remove</property>
</object>
<packing>
<property name="expand">False</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]