diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2003-12-27 03:38:41 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2003-12-27 03:38:41 +0800 |
commit | bde4c29f92204eafbe4f953353730946486dc474 (patch) | |
tree | 822ba7bc78a850e21bd7fd77d659e307536dfb4e /src | |
parent | b413be462d88491c049f4744952047547fde20cb (diff) | |
download | gsoc2013-epiphany-bde4c29f92204eafbe4f953353730946486dc474.tar gsoc2013-epiphany-bde4c29f92204eafbe4f953353730946486dc474.tar.gz gsoc2013-epiphany-bde4c29f92204eafbe4f953353730946486dc474.tar.bz2 gsoc2013-epiphany-bde4c29f92204eafbe4f953353730946486dc474.tar.lz gsoc2013-epiphany-bde4c29f92204eafbe4f953353730946486dc474.tar.xz gsoc2013-epiphany-bde4c29f92204eafbe4f953353730946486dc474.tar.zst gsoc2013-epiphany-bde4c29f92204eafbe4f953353730946486dc474.zip |
One download directory chooser is enough.
2003-12-26 Christian Persch <chpe@cvs.gnome.org>
* src/prefs-dialog.c: (prefs_dialog_finalize),
(prefs_download_path_button_clicked_cb):
One download directory chooser is enough.
Diffstat (limited to 'src')
-rw-r--r-- | src/prefs-dialog.c | 47 |
1 files changed, 31 insertions, 16 deletions
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c index 75f26dc79..f8d699e59 100644 --- a/src/prefs-dialog.c +++ b/src/prefs-dialog.c @@ -76,7 +76,7 @@ void prefs_homepage_blank_button_clicked_cb (GtkWidget *button, void prefs_language_more_button_clicked_cb (GtkWidget *button, EphyDialog *dialog); void prefs_download_path_button_clicked_cb (GtkWidget *button, - EphyDialog *dialog); + PrefsDialog *dialog); void language_editor_add_button_clicked_cb (GtkWidget *button, PrefsDialog *pd); void language_editor_remove_button_clicked_cb (GtkWidget *button, @@ -326,6 +326,7 @@ enum struct PrefsDialogPrivate { + GtkWidget *download_dir_chooser; GtkTreeView *lang_treeview; GtkTreeModel *lang_model; EphyDialog *add_lang_dialog; @@ -378,6 +379,13 @@ prefs_dialog_finalize (GObject *object) g_object_unref (dialog->priv->add_lang_dialog); } + if (dialog->priv->download_dir_chooser != NULL) + { + g_object_remove_weak_pointer + (G_OBJECT (dialog->priv->download_dir_chooser), + (gpointer *) &dialog->priv->download_dir_chooser); + } + G_OBJECT_CLASS (parent_class)->finalize (object); } @@ -1299,22 +1307,29 @@ download_path_response_cb (GtkDialog *fc, gint response, EphyDialog *dialog) void prefs_download_path_button_clicked_cb (GtkWidget *button, - EphyDialog *dialog) + PrefsDialog *dialog) { - GtkWidget *parent; - EphyFileChooser *fc; - - parent = ephy_dialog_get_control (dialog, properties[WINDOW_PROP].id); - - fc = ephy_file_chooser_new (_("Select a directory"), - GTK_WIDGET (parent), - GTK_FILE_CHOOSER_ACTION_OPEN, - NULL); - gtk_file_chooser_set_folder_mode (GTK_FILE_CHOOSER (fc), TRUE); + if (dialog->priv->download_dir_chooser == NULL) + { + GtkWidget *parent; + EphyFileChooser *fc; - g_signal_connect (GTK_DIALOG (fc), "response", - G_CALLBACK (download_path_response_cb), - dialog); + parent = ephy_dialog_get_control + (EPHY_DIALOG (dialog), properties[WINDOW_PROP].id); + + fc = ephy_file_chooser_new (_("Select a directory"), + GTK_WIDGET (parent), + GTK_FILE_CHOOSER_ACTION_OPEN, + NULL); + gtk_file_chooser_set_folder_mode (GTK_FILE_CHOOSER (fc), TRUE); + + g_signal_connect (GTK_DIALOG (fc), "response", + G_CALLBACK (download_path_response_cb), + dialog); + dialog->priv->download_dir_chooser = GTK_WIDGET (fc); + g_object_add_weak_pointer + (G_OBJECT (fc), (gpointer *) &dialog->priv->download_dir_chooser); + } - gtk_widget_show (GTK_WIDGET (fc)); + gtk_widget_show (dialog->priv->download_dir_chooser); } |