evolution r34847 - trunk/shell



Author: sragavan
Date: Fri Jan 18 06:53:39 2008
New Revision: 34847
URL: http://svn.gnome.org/viewvc/evolution?rev=34847&view=rev

Log:
2008-01-18  Srinivasa Ragavan  <sragavan novell com>

	** Fix for bug #329712

	* e-shell-window-commands.c: (update_offline_menu_item):
	* e-shell-window.c: (update_offline_toggle_status),
	(update_send_receive_sensitivity),
	(offline_toggle_clicked_callback):
	* e-shell.c: (e_shell_construct), (e_shell_save_settings),
	(set_line_status):
	* e-shell.h: Add a new state to maintian forced offline.



Modified:
   trunk/shell/ChangeLog
   trunk/shell/e-shell-window-commands.c
   trunk/shell/e-shell-window.c
   trunk/shell/e-shell.c
   trunk/shell/e-shell.h

Modified: trunk/shell/e-shell-window-commands.c
==============================================================================
--- trunk/shell/e-shell-window-commands.c	(original)
+++ trunk/shell/e-shell-window-commands.c	Fri Jan 18 06:53:39 2008
@@ -883,6 +883,7 @@
 
 	switch (line_status) {
 	case E_SHELL_LINE_STATUS_OFFLINE:
+	case E_SHELL_LINE_STATUS_FORCED_OFFLINE:
 		bonobo_ui_component_set_prop (ui_component,
 					      "/menu/File/ToggleOffline",
 					      "label", _("_Work Online"), NULL);

Modified: trunk/shell/e-shell-window.c
==============================================================================
--- trunk/shell/e-shell-window.c	(original)
+++ trunk/shell/e-shell-window.c	Fri Jan 18 06:53:39 2008
@@ -389,6 +389,7 @@
 		flags = ES_MENU_SHELL_OFFLINE;
 		break;
 	case E_SHELL_LINE_STATUS_OFFLINE:
+	case E_SHELL_LINE_STATUS_FORCED_OFFLINE:
 		icon        = OFFLINE_ICON;
 		sensitive   = TRUE;
 		tooltip     = _("Evolution is currently offline. "
@@ -414,7 +415,8 @@
 static void
 update_send_receive_sensitivity (EShellWindow *window)
 {
-	if (e_shell_get_line_status (window->priv->shell.eshell) == E_SHELL_LINE_STATUS_OFFLINE)
+	if (e_shell_get_line_status (window->priv->shell.eshell) == E_SHELL_LINE_STATUS_OFFLINE || 
+		e_shell_get_line_status (window->priv->shell.eshell) == E_SHELL_LINE_STATUS_FORCED_OFFLINE)
 		bonobo_ui_component_set_prop (window->priv->ui_component,
 					      "/commands/SendReceive",
 					      "sensitive", "0", NULL);
@@ -484,6 +486,7 @@
 		e_shell_go_offline (priv->shell.eshell, window, GNOME_Evolution_USER_OFFLINE);
 		break;
 	case E_SHELL_LINE_STATUS_OFFLINE:
+	case E_SHELL_LINE_STATUS_FORCED_OFFLINE:
 		e_shell_go_online (priv->shell.eshell, window, GNOME_Evolution_USER_ONLINE);
 		break;
 	default:

Modified: trunk/shell/e-shell.c
==============================================================================
--- trunk/shell/e-shell.c	(original)
+++ trunk/shell/e-shell.c	Fri Jan 18 06:53:39 2008
@@ -716,6 +716,8 @@
 
 	if (start_online)
 		e_shell_go_online (shell, NULL, GNOME_Evolution_USER_ONLINE);
+	else
+		e_shell_go_online (shell, NULL, GNOME_Evolution_FORCED_OFFLINE);
 
 	return E_SHELL_CONSTRUCT_RESULT_OK;
 }
@@ -1029,7 +1031,7 @@
 	GConfClient *client;
 	gboolean is_offline;
 
-	is_offline = ( e_shell_get_line_status (shell) == E_SHELL_LINE_STATUS_OFFLINE );
+	is_offline = ( e_shell_get_line_status (shell) == E_SHELL_LINE_STATUS_OFFLINE || e_shell_get_line_status (shell) == E_SHELL_LINE_STATUS_FORCED_OFFLINE);
 
 	client = gconf_client_get_default ();
 	gconf_client_set_bool (client, "/apps/evolution/shell/start_offline", is_offline, NULL);
@@ -1131,16 +1133,19 @@
 	CORBA_Environment ev;
 	GConfClient *client;
 	gboolean status;
+	gboolean forced = FALSE;
 
 	priv = shell->priv;
 
-	if (shell_state == GNOME_Evolution_FORCED_OFFLINE || shell_state == GNOME_Evolution_USER_OFFLINE)
+	if (shell_state == GNOME_Evolution_FORCED_OFFLINE || shell_state == GNOME_Evolution_USER_OFFLINE) {
 		status = FALSE;
-	else
+		if (shell_state == GNOME_Evolution_FORCED_OFFLINE)
+			forced = TRUE;
+	} else
 		status = TRUE;
 
 	if ((status && priv->line_status == E_SHELL_LINE_STATUS_ONLINE)
-	    || (!status && priv->line_status != E_SHELL_LINE_STATUS_ONLINE))
+	    || (!status && priv->line_status == shell_state))
 		return;
 
 	/* we use 'going offline' to mean 'changing status' now */
@@ -1151,7 +1156,7 @@
 	gconf_client_set_bool (client, "/apps/evolution/shell/start_offline", !status, NULL);
 	g_object_unref (client);
 
-	priv->line_status_working = status?E_SHELL_LINE_STATUS_ONLINE:E_SHELL_LINE_STATUS_OFFLINE;
+	priv->line_status_working = status?E_SHELL_LINE_STATUS_ONLINE: forced?E_SHELL_LINE_STATUS_FORCED_OFFLINE:E_SHELL_LINE_STATUS_OFFLINE;
 	/* we start at 2: setLineStatus could recursively call back, we therefore
 	   `need to not complete till we're really complete */
 	priv->line_status_pending += 2;

Modified: trunk/shell/e-shell.h
==============================================================================
--- trunk/shell/e-shell.h	(original)
+++ trunk/shell/e-shell.h	Fri Jan 18 06:53:39 2008
@@ -51,7 +51,8 @@
 enum _EShellLineStatus {
 	E_SHELL_LINE_STATUS_ONLINE,
 	E_SHELL_LINE_STATUS_GOING_OFFLINE, /* NB: really means changing state in either direction */
-	E_SHELL_LINE_STATUS_OFFLINE
+	E_SHELL_LINE_STATUS_OFFLINE,
+	E_SHELL_LINE_STATUS_FORCED_OFFLINE
 };
 typedef enum _EShellLineStatus EShellLineStatus;
 



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