[gnome-scan/gnome-scan-0-6] Set "Scan" button sensitive only if a scanner is selected.



commit dddbce0e3ed52a0a10f497b84f6360565e6a24f3
Author: Philipp Sadleder <philipp sadleder de>
Date:   Wed Jul 8 12:58:22 2009 +0200

    Set "Scan" button sensitive only if a scanner is selected.

 lib/gnome-scan-dialog.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/lib/gnome-scan-dialog.c b/lib/gnome-scan-dialog.c
index 71820be..3410d2b 100644
--- a/lib/gnome-scan-dialog.c
+++ b/lib/gnome-scan-dialog.c
@@ -84,6 +84,7 @@ struct _GnomeScanDialogPrivate
 	
 	/* 	Widgets  */
 	GtkWidget*		notebook;
+	GtkWidget*		scan_button;
 	
 	/* General */
 	GtkWidget*		general_page;
@@ -252,9 +253,11 @@ gnome_scan_dialog_constructor (GType type, guint n, GObjectConstructParam *param
 						   GTK_STOCK_CANCEL,
 						   GTK_RESPONSE_CANCEL);
 	
-	gtk_dialog_add_button (GTK_DIALOG (widget),
+	priv->scan_button = gtk_dialog_add_button (GTK_DIALOG (widget),
 						   GS_STOCK_SCAN,
 						   GTK_RESPONSE_APPLY);
+	gtk_widget_set_sensitive (priv->scan_button, FALSE);
+
 	
 	/* 	Notebook  */
 	priv->notebook = gtk_notebook_new ();
@@ -1000,6 +1003,8 @@ gsd_scanner_selected (GtkTreeSelection *selection, GnomeScanDialog *dialog)
 	gnome_scan_job_set_scanner (priv->preview_job, scanner);
 	
 	g_timeout_add (10, (GSourceFunc) gsd_select_scanner_if_ready, dialog);
+
+	gtk_widget_set_sensitive (priv->scan_button, TRUE);
 }
 
 



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