aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@novell.com>2008-01-18 14:53:39 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2008-01-18 14:53:39 +0800
commitde7843234354f8aec863a80b3d354818603023a6 (patch)
tree77b54a9df027143c18e6db2aed71823de89c3183 /shell
parentcd14d28ca592cccf52c2c886334f266c1ac46359 (diff)
downloadgsoc2013-evolution-de7843234354f8aec863a80b3d354818603023a6.tar
gsoc2013-evolution-de7843234354f8aec863a80b3d354818603023a6.tar.gz
gsoc2013-evolution-de7843234354f8aec863a80b3d354818603023a6.tar.bz2
gsoc2013-evolution-de7843234354f8aec863a80b3d354818603023a6.tar.lz
gsoc2013-evolution-de7843234354f8aec863a80b3d354818603023a6.tar.xz
gsoc2013-evolution-de7843234354f8aec863a80b3d354818603023a6.tar.zst
gsoc2013-evolution-de7843234354f8aec863a80b3d354818603023a6.zip
** Fix for bug #329712
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. svn path=/trunk/; revision=34847
Diffstat (limited to 'shell')
-rw-r--r--shell/ChangeLog12
-rw-r--r--shell/e-shell-window-commands.c1
-rw-r--r--shell/e-shell-window.c5
-rw-r--r--shell/e-shell.c15
-rw-r--r--shell/e-shell.h3
5 files changed, 29 insertions, 7 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 49d0d1f1f8..88f1ca0a10 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,15 @@
+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.
+
2008-01-14 Kjartan Maraas <kmaraas@gnome.org>
* apps_evolution_shell.schemas.in: Add missing punctuation.
diff --git a/shell/e-shell-window-commands.c b/shell/e-shell-window-commands.c
index 7ff4e0e411..d96797793f 100644
--- a/shell/e-shell-window-commands.c
+++ b/shell/e-shell-window-commands.c
@@ -883,6 +883,7 @@ update_offline_menu_item (EShellWindow *shell_window,
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);
diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c
index 7b1c2b2006..ae2c26912f 100644
--- a/shell/e-shell-window.c
+++ b/shell/e-shell-window.c
@@ -389,6 +389,7 @@ update_offline_toggle_status (EShellWindow *window)
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 @@ update_offline_toggle_status (EShellWindow *window)
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 @@ offline_toggle_clicked_callback (GtkButton *button,
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:
diff --git a/shell/e-shell.c b/shell/e-shell.c
index cd34d2e03d..bdab938293 100644
--- a/shell/e-shell.c
+++ b/shell/e-shell.c
@@ -716,6 +716,8 @@ e_shell_construct (EShell *shell,
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 @@ e_shell_save_settings (EShell *shell)
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 @@ set_line_status(EShell *shell, GNOME_Evolution_ShellState shell_state)
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 @@ set_line_status(EShell *shell, GNOME_Evolution_ShellState shell_state)
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;
diff --git a/shell/e-shell.h b/shell/e-shell.h
index 958bb33581..a255edd573 100644
--- a/shell/e-shell.h
+++ b/shell/e-shell.h
@@ -51,7 +51,8 @@ typedef struct _EShellClass EShellClass;
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;