[gtk+] printing: Some fixes to the print dialog



commit 8e1ef3620ae2ac0b4384c90377473045d8ba1896
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Oct 6 22:33:24 2017 -0400

    printing: Some fixes to the print dialog
    
    Hide widgets that are meant to be hidden initially, and use
    the right spin button apis.

 gtk/gtkprintunixdialog.c     |    7 +++++--
 gtk/ui/gtkprintunixdialog.ui |    1 -
 2 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkprintunixdialog.c b/gtk/gtkprintunixdialog.c
index 5a31fd5..8f27f7d 100644
--- a/gtk/gtkprintunixdialog.c
+++ b/gtk/gtkprintunixdialog.c
@@ -745,6 +745,9 @@ gtk_print_unix_dialog_init (GtkPrintUnixDialog *dialog)
   widget = gtk_dialog_get_widget_for_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
   gtk_widget_set_sensitive (widget, FALSE);
 
+  gtk_widget_set_visible (priv->selection_radio, FALSE);
+  gtk_widget_set_visible (priv->conflicts_widget, FALSE);
+
   /* Treeview auxiliary functions need to be setup here */
   gtk_tree_model_filter_set_visible_func (priv->printer_list_filter,
                                           (GtkTreeModelFilterVisibleFunc) is_printer_active,
@@ -1663,7 +1666,7 @@ update_dialog_from_capabilities (GtkPrintUnixDialog *dialog)
   const gchar *copies;
   GtkWidget *button;
 
-  copies = gtk_entry_get_text (GTK_ENTRY (priv->copies_spin));
+  copies = gtk_spin_button_get_text (GTK_SPIN_BUTTON (priv->copies_spin));
   can_collate = (*copies != '\0' && atoi (copies) > 1);
 
   caps = priv->manual_capabilities | priv->printer_capabilities;
@@ -2558,7 +2561,7 @@ dialog_get_n_copies (GtkPrintUnixDialog *dialog)
 
   adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (priv->copies_spin));
 
-  text = gtk_entry_get_text (GTK_ENTRY (priv->copies_spin));
+  text = gtk_spin_button_get_text (GTK_SPIN_BUTTON (priv->copies_spin));
   n_copies = g_ascii_strtoull (text, &endptr, 0);
 
   if (gtk_widget_is_sensitive (dialog->priv->copies_spin))
diff --git a/gtk/ui/gtkprintunixdialog.ui b/gtk/ui/gtkprintunixdialog.ui
index d2076f0..c61a380 100644
--- a/gtk/ui/gtkprintunixdialog.ui
+++ b/gtk/ui/gtkprintunixdialog.ui
@@ -330,7 +330,6 @@
                                     <property name="visible">1</property>
                                     <property name="can-focus">1</property>
                                     <property name="valign">baseline</property>
-                                    <property name="activates-default">1</property>
                                     <property name="adjustment">copies_spin_adjustment</property>
                                     <signal name="changed" handler="update_dialog_from_capabilities" 
object="GtkPrintUnixDialog" swapped="yes"/>
                                     <signal name="value-changed" handler="update_dialog_from_capabilities" 
object="GtkPrintUnixDialog" swapped="yes"/>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]