aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-status-icon.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2007-05-13 03:42:35 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-05-13 03:42:35 +0800
commit67821bbcbabbf55f34b43c87934a0d1d27d25420 (patch)
tree19caae56a85e83baf1d9a64af50c9dc25a60c67d /libempathy-gtk/empathy-status-icon.c
parent321de615c0d7aaecf7f87b31fae65b5b75f0e32e (diff)
downloadgsoc2013-empathy-67821bbcbabbf55f34b43c87934a0d1d27d25420.tar
gsoc2013-empathy-67821bbcbabbf55f34b43c87934a0d1d27d25420.tar.gz
gsoc2013-empathy-67821bbcbabbf55f34b43c87934a0d1d27d25420.tar.bz2
gsoc2013-empathy-67821bbcbabbf55f34b43c87934a0d1d27d25420.tar.lz
gsoc2013-empathy-67821bbcbabbf55f34b43c87934a0d1d27d25420.tar.xz
gsoc2013-empathy-67821bbcbabbf55f34b43c87934a0d1d27d25420.tar.zst
gsoc2013-empathy-67821bbcbabbf55f34b43c87934a0d1d27d25420.zip
[darcs-to-svn @ Save/Resore the visibility of main window and show account dialog if no account is enabled]
svn path=/trunk/; revision=48
Diffstat (limited to 'libempathy-gtk/empathy-status-icon.c')
-rw-r--r--libempathy-gtk/empathy-status-icon.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-status-icon.c b/libempathy-gtk/empathy-status-icon.c
index 0aa0a76a5..5b764c6cf 100644
--- a/libempathy-gtk/empathy-status-icon.c
+++ b/libempathy-gtk/empathy-status-icon.c
@@ -38,6 +38,7 @@
#include "gossip-presence-chooser.h"
#include "gossip-preferences.h"
#include "gossip-ui-utils.h"
+#include "gossip-accounts-dialog.h"
#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
EMPATHY_TYPE_STATUS_ICON, EmpathyStatusIconPriv))
@@ -141,6 +142,8 @@ empathy_status_icon_new (GtkWindow *window)
{
EmpathyStatusIconPriv *priv;
EmpathyStatusIcon *icon;
+ gboolean should_hide;
+ gboolean visible;
g_return_val_if_fail (GTK_IS_WINDOW (window), NULL);
@@ -153,6 +156,15 @@ empathy_status_icon_new (GtkWindow *window)
G_CALLBACK (status_icon_delete_event_cb),
icon);
+ gossip_conf_get_bool (gossip_conf_get (),
+ GOSSIP_PREFS_UI_MAIN_WINDOW_HIDDEN,
+ &should_hide);
+ visible = gossip_window_get_is_visible (window);
+
+ if ((!should_hide && !visible) || (should_hide && visible)) {
+ status_icon_toggle_visibility (icon);
+ }
+
return icon;
}
@@ -201,9 +213,21 @@ status_icon_toggle_visibility (EmpathyStatusIcon *icon)
gossip_conf_set_bool (gossip_conf_get (),
GOSSIP_PREFS_UI_MAIN_WINDOW_HIDDEN, TRUE);
} else {
+ GList *accounts;
+
gossip_window_present (GTK_WINDOW (priv->window), TRUE);
gossip_conf_set_bool (gossip_conf_get (),
GOSSIP_PREFS_UI_MAIN_WINDOW_HIDDEN, FALSE);
+
+ /* Show the accounts dialog if there is no enabled accounts */
+ accounts = mc_accounts_list_by_enabled (TRUE);
+ if (accounts) {
+ mc_accounts_list_free (accounts);
+ } else {
+ gossip_debug (DEBUG_DOMAIN,
+ "No enabled account, Showing account dialog");
+ gossip_accounts_dialog_show ();
+ }
}
}