Commit 22f0ad39 authored by Marek Kašík's avatar Marek Kašík

Select a printer when panel loads.

Change +/- stock icons to list-add/list-remove icons.
parent 2abe2c2e
......@@ -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);
}
......
......@@ -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>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment