empathy r2225 - trunk/libempathy-gtk
- From: fpeters svn gnome org
- To: svn-commits-list gnome org
- Subject: empathy r2225 - trunk/libempathy-gtk
- Date: Mon, 12 Jan 2009 14:58:31 +0000 (UTC)
Author: fpeters
Date: Mon Jan 12 14:58:31 2009
New Revision: 2225
URL: http://svn.gnome.org/viewvc/empathy?rev=2225&view=rev
Log:
Reuse, and properly destroy, the avatar file chooser dialog.
Fixes bug #548768 (Frederic Peters)
Modified:
trunk/libempathy-gtk/empathy-avatar-chooser.c
Modified: trunk/libempathy-gtk/empathy-avatar-chooser.c
==============================================================================
--- trunk/libempathy-gtk/empathy-avatar-chooser.c (original)
+++ trunk/libempathy-gtk/empathy-avatar-chooser.c Mon Jan 12 14:58:31 2009
@@ -48,6 +48,7 @@
EmpathyContactFactory *contact_factory;
McAccount *account;
EmpathyTpContactFactory *tp_contact_factory;
+ GtkFileChooser *chooser_dialog;
gulong ready_handler_id;
@@ -897,6 +898,8 @@
{
EmpathyAvatarChooserPriv *priv = GET_PRIV (chooser);
+ priv->chooser_dialog = NULL;
+
if (response == GTK_RESPONSE_CANCEL) {
goto out;
}
@@ -942,8 +945,14 @@
const gchar *default_dir = DEFAULT_DIR;
const gchar *pics_dir;
GtkFileFilter *filter;
+ EmpathyAvatarChooserPriv *priv = GET_PRIV (chooser);
+
+ if (priv->chooser_dialog) {
+ gtk_window_present (GTK_WINDOW (priv->chooser_dialog));
+ return;
+ }
- chooser_dialog = GTK_FILE_CHOOSER (
+ priv->chooser_dialog = GTK_FILE_CHOOSER (
gtk_file_chooser_dialog_new (_("Select Your Avatar Image"),
empathy_get_toplevel_window (GTK_WIDGET (chooser)),
GTK_FILE_CHOOSER_ACTION_OPEN,
@@ -954,6 +963,8 @@
GTK_STOCK_OPEN,
GTK_RESPONSE_OK,
NULL));
+ chooser_dialog = priv->chooser_dialog;
+ gtk_window_set_destroy_with_parent (GTK_WINDOW (chooser_dialog), TRUE);
/* Get special dirs */
empathy_conf_get_string (empathy_conf_get (),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]