empathy r2265 - trunk/src



Author: fpeters
Date: Fri Jan 30 10:44:08 2009
New Revision: 2265
URL: http://svn.gnome.org/viewvc/empathy?rev=2265&view=rev

Log:
disable chat history menu item when there is no account.
(bug #562554)


Modified:
   trunk/src/empathy-main-window.c

Modified: trunk/src/empathy-main-window.c
==============================================================================
--- trunk/src/empathy-main-window.c	(original)
+++ trunk/src/empathy-main-window.c	Fri Jan 30 10:44:08 2009
@@ -99,6 +99,7 @@
 	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_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 @@
 				       "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 @@
 			  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 @@
 	}
 }
 
+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);
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]