[brasero] Don't let the user click on the Add action until the GtkFileChooser spawned was closed.
- From: Philippe Rouquier <philippr src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [brasero] Don't let the user click on the Add action until the GtkFileChooser spawned was closed.
- Date: Fri, 4 Sep 2009 18:17:14 +0000 (UTC)
commit 6d5f2bfd36955c773eff3d2b7dab3514716fc741
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date: Fri Sep 4 14:48:48 2009 +0200
Don't let the user click on the Add action until the GtkFileChooser spawned was closed.
src/brasero-project.c | 23 ++++++++++++++++++++++-
1 files changed, 22 insertions(+), 1 deletions(-)
---
diff --git a/src/brasero-project.c b/src/brasero-project.c
index 3f63441..578cf31 100644
--- a/src/brasero-project.c
+++ b/src/brasero-project.c
@@ -368,7 +368,7 @@ brasero_project_set_add_button_state (BraseroProject *project)
GtkWidget *toplevel;
sensitive = ((!project->priv->current_source || !project->priv->has_focus) &&
- !project->priv->oversized);
+ !project->priv->oversized && !project->priv->chooser );
action = gtk_action_group_get_action (project->priv->project_group, "Add");
gtk_action_set_sensitive (action, sensitive);
@@ -1903,6 +1903,8 @@ static void
brasero_project_file_chooser_activated_cb (GtkWidget *chooser,
BraseroProject *project)
{
+ gboolean sensitive;
+ GtkAction *action;
GSList *uris;
GSList *iter;
@@ -1913,6 +1915,12 @@ brasero_project_file_chooser_activated_cb (GtkWidget *chooser,
uris = gtk_file_chooser_get_uris (GTK_FILE_CHOOSER (chooser));
gtk_widget_destroy (GTK_WIDGET (chooser));
+ sensitive = ((!project->priv->current_source || !project->priv->has_focus) &&
+ !project->priv->oversized);
+
+ action = gtk_action_group_get_action (project->priv->project_group, "Add");
+ gtk_action_set_sensitive (action, sensitive);
+
for (iter = uris; iter; iter = iter->next) {
gchar *uri;
@@ -1928,6 +1936,8 @@ brasero_project_file_chooser_response_cb (GtkWidget *chooser,
GtkResponseType response,
BraseroProject *project)
{
+ gboolean sensitive;
+ GtkAction *action;
GSList *uris;
GSList *iter;
@@ -1944,6 +1954,12 @@ brasero_project_file_chooser_response_cb (GtkWidget *chooser,
uris = gtk_file_chooser_get_uris (GTK_FILE_CHOOSER (chooser));
gtk_widget_destroy (GTK_WIDGET (chooser));
+ sensitive = ((!project->priv->current_source || !project->priv->has_focus) &&
+ !project->priv->oversized);
+
+ action = gtk_action_group_get_action (project->priv->project_group, "Add");
+ gtk_action_set_sensitive (action, sensitive);
+
for (iter = uris; iter; iter = iter->next) {
gchar *uri;
@@ -1986,6 +2002,11 @@ brasero_project_add_uris_cb (GtkAction *action,
return;
}
+ /* set the Add button grey as we don't want
+ * the user to be able to click again until it
+ * the dialog has been closed */
+ gtk_action_set_sensitive (action, FALSE);
+
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (project));
project->priv->chooser = gtk_file_chooser_dialog_new (_("Select Files"),
GTK_WINDOW (toplevel),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]