diff options
author | Frederic Peters <fpeters@src.gnome.org> | 2009-01-30 18:44:08 +0800 |
---|---|---|
committer | Frederic Peters <fpeters@src.gnome.org> | 2009-01-30 18:44:08 +0800 |
commit | 79feff41d30571ca772d450be6613dbdcf655164 (patch) | |
tree | f25211d4658d0f1a81ae650888b65ced6d17df8c /src/empathy-main-window.c | |
parent | 2c5160bcb91ee9d808f283458b8a7a9740c70672 (diff) | |
download | gsoc2013-empathy-79feff41d30571ca772d450be6613dbdcf655164.tar gsoc2013-empathy-79feff41d30571ca772d450be6613dbdcf655164.tar.gz gsoc2013-empathy-79feff41d30571ca772d450be6613dbdcf655164.tar.bz2 gsoc2013-empathy-79feff41d30571ca772d450be6613dbdcf655164.tar.lz gsoc2013-empathy-79feff41d30571ca772d450be6613dbdcf655164.tar.xz gsoc2013-empathy-79feff41d30571ca772d450be6613dbdcf655164.tar.zst gsoc2013-empathy-79feff41d30571ca772d450be6613dbdcf655164.zip |
disable chat history menu item when there is no account.
(bug #562554)
svn path=/trunk/; revision=2265
Diffstat (limited to 'src/empathy-main-window.c')
-rw-r--r-- | src/empathy-main-window.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c index cafa5f0ae..3bf94a46d 100644 --- a/src/empathy-main-window.c +++ b/src/empathy-main-window.c @@ -99,6 +99,7 @@ typedef struct { GtkWidget *room_join_favorites; GtkWidget *edit_context; GtkWidget *edit_context_separator; + GtkWidget *chat_history_menu_item; guint size_timeout_id; GHashTable *errors; @@ -179,6 +180,9 @@ static void main_window_notify_compact_contact_list_cb (EmpathyConf static void main_window_notify_sort_criterium_cb (EmpathyConf *conf, const gchar *key, EmpathyMainWindow *window); +static void main_window_account_created_or_deleted_cb (EmpathyAccountManager *manager, + McAccount *account, + EmpathyMainWindow *window); static void main_window_flash_stop (EmpathyMainWindow *window) @@ -524,6 +528,7 @@ empathy_main_window_show (void) "edit_context_separator", &window->edit_context_separator, "presence_toolbar", &window->presence_toolbar, "roster_scrolledwindow", &sw, + "chat_history", &window->chat_history_menu_item, NULL); g_free (filename); @@ -650,6 +655,14 @@ empathy_main_window_show (void) G_CALLBACK (main_window_event_removed_cb), window); + g_signal_connect (window->account_manager, "account-created", + G_CALLBACK (main_window_account_created_or_deleted_cb), + window); + g_signal_connect (window->account_manager, "account-deleted", + G_CALLBACK (main_window_account_created_or_deleted_cb), + window); + main_window_account_created_or_deleted_cb (window->account_manager, NULL, window); + l = empathy_event_manager_get_events (window->event_manager); while (l) { main_window_event_added_cb (window->event_manager, @@ -1393,3 +1406,11 @@ main_window_notify_sort_criterium_cb (EmpathyConf *conf, } } +static void +main_window_account_created_or_deleted_cb (EmpathyAccountManager *manager, + McAccount *account, + EmpathyMainWindow *window) +{ + gtk_widget_set_sensitive (GTK_WIDGET (window->chat_history_menu_item), + empathy_account_manager_get_count (manager) > 0); +} |