summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Henrik Brautaset Aronsen <subsurface@henrik.synth.no>2013-05-15 21:56:18 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-15 17:08:13 -0400
commit19bebeeb3a2aff843b30dcfb4f80260bc1c16a05 (patch)
tree103352f03bf61bc2b6ae47cc3b489240b0ed0b71
parentac82837a6854cb17c598b4599a17f6e49213487f (diff)
downloadsubsurface-19bebeeb3a2aff843b30dcfb4f80260bc1c16a05.tar.gz
Disable OK button in download dialog when downloading
The button was active while downloading, and that was confusing. Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--download-dialog.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/download-dialog.c b/download-dialog.c
index c4b0c675d..6a55a327c 100644
--- a/download-dialog.c
+++ b/download-dialog.c
@@ -366,7 +366,7 @@ void download_dialog(GtkWidget *w, gpointer data)
{
int result;
char *devname, *ns, *ne;
- GtkWidget *dialog, *button, *hbox, *vbox, *label, *info = NULL;
+ GtkWidget *dialog, *button, *okbutton, *hbox, *vbox, *label, *info = NULL;
GtkComboBox *computer, *device;
GtkTreeIter iter;
device_data_t devicedata = {
@@ -405,12 +405,13 @@ void download_dialog(GtkWidget *w, gpointer data)
gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 6);
g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(prefer_dl_toggle), NULL);
- button = gtk_dialog_get_widget_for_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT);
+ okbutton = gtk_dialog_get_widget_for_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT);
if (!gtk_combo_box_get_active_iter(computer, &iter))
- gtk_widget_set_sensitive(button, FALSE);
+ gtk_widget_set_sensitive(okbutton, FALSE);
repeat:
gtk_widget_show_all(dialog);
+ gtk_widget_set_sensitive(okbutton, TRUE);
result = gtk_dialog_run(GTK_DIALOG(dialog));
switch (result) {
dc_descriptor_t *descriptor;
@@ -427,6 +428,8 @@ repeat:
if (!gtk_combo_box_get_active_iter(computer, &iter))
break;
+ gtk_widget_set_sensitive(okbutton, FALSE);
+
model = gtk_combo_box_get_model(computer);
gtk_tree_model_get(model, &iter,
0, &descriptor,