aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-view-menu.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-05-04 10:47:33 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-05-04 10:47:33 +0800
commitbe2f9a67f63403a95a96e0dfbd72a4c2e68e17c6 (patch)
tree8e7bf2f5fd9f86d8382ebecb5d469cc94e3ebdcf /shell/e-shell-view-menu.c
parent7cfacb2f84e3189bed138326e788ea09bdb25eb8 (diff)
downloadgsoc2013-evolution-be2f9a67f63403a95a96e0dfbd72a4c2e68e17c6.tar.gz
gsoc2013-evolution-be2f9a67f63403a95a96e0dfbd72a4c2e68e17c6.tar.zst
gsoc2013-evolution-be2f9a67f63403a95a96e0dfbd72a4c2e68e17c6.zip
Complete the shell side for supporting off-line operations, getting
the dialog to fully work and the menu item to change its label according to the current status of the line. svn path=/trunk/; revision=9662
Diffstat (limited to 'shell/e-shell-view-menu.c')
-rw-r--r--shell/e-shell-view-menu.c107
1 files changed, 91 insertions, 16 deletions
diff --git a/shell/e-shell-view-menu.c b/shell/e-shell-view-menu.c
index 1c4def05c5..3c97d72bc4 100644
--- a/shell/e-shell-view-menu.c
+++ b/shell/e-shell-view-menu.c
@@ -429,21 +429,23 @@ command_work_offline (BonoboUIComponent *uih,
shell_view = E_SHELL_VIEW (data);
shell = e_shell_view_get_shell (shell_view);
- switch (e_shell_get_line_status (shell)) {
- case E_SHELL_LINE_STATUS_ONLINE:
- g_warning ("Putting the shell offline");
- e_shell_go_offline (shell, shell_view);
- break;
- case E_SHELL_LINE_STATUS_OFFLINE:
- g_warning ("Putting the shell online");
- e_shell_go_online (shell, shell_view);
- break;
- case E_SHELL_LINE_STATUS_GOING_OFFLINE:
- g_warning ("The shell is going off-line already; not doing anything.");
- break;
- default:
- g_assert_not_reached ();
- }
+ g_warning ("Putting the shell offline");
+ e_shell_go_offline (shell, shell_view);
+}
+
+static void
+command_work_online (BonoboUIComponent *uih,
+ void *data,
+ const char *path)
+{
+ EShellView *shell_view;
+ EShell *shell;
+
+ shell_view = E_SHELL_VIEW (data);
+ shell = e_shell_view_get_shell (shell_view);
+
+ g_warning ("Putting the shell online");
+ e_shell_go_online (shell, shell_view);
}
@@ -498,6 +500,7 @@ BonoboUIVerb file_verbs [] = {
BONOBO_UI_VERB ("FileExit", command_quit),
BONOBO_UI_VERB ("WorkOffline", command_work_offline),
+ BONOBO_UI_VERB ("WorkOnline", command_work_online),
BONOBO_UI_VERB_END
};
@@ -516,7 +519,7 @@ static EPixmap pixmaps [] = {
E_PIXMAP ("/menu/File/New/Folder", "folder.xpm"),
E_PIXMAP ("/menu/File/Folder/Folder", "folder.xpm"),
E_PIXMAP ("/menu/File/FileImporter", "import.xpm"),
- E_PIXMAP ("/menu/File/WorkOffline", "work_offline.xpm"),
+ E_PIXMAP ("/menu/File/ToggleOffline", "work_offline.xpm"),
E_PIXMAP_END
};
@@ -542,6 +545,71 @@ menu_do_misc (BonoboUIComponent *component,
}
+/* The Work Online / Work Offline menu item. */
+
+static void
+update_offline_menu_item (EShellView *shell_view,
+ EShellLineStatus line_status)
+{
+ BonoboUIComponent *ui_component;
+
+ ui_component = e_shell_view_get_bonobo_ui_component (shell_view);
+
+ switch (line_status) {
+ case E_SHELL_LINE_STATUS_OFFLINE:
+ bonobo_ui_component_set_prop (ui_component,
+ "/menu/File/ToggleOffline",
+ "label", _("Work online"), NULL);
+ bonobo_ui_component_set_prop (ui_component,
+ "/menu/File/ToggleOffline",
+ "verb", "WorkOnline", NULL);
+ bonobo_ui_component_set_prop (ui_component,
+ "/commands/WorkOnline",
+ "sensitive", "1", NULL);
+ break;
+
+ case E_SHELL_LINE_STATUS_ONLINE:
+ bonobo_ui_component_set_prop (ui_component,
+ "/menu/File/ToggleOffline",
+ "label", _("Work offline"), NULL);
+ bonobo_ui_component_set_prop (ui_component,
+ "/menu/File/ToggleOffline",
+ "verb", "WorkOffline", NULL);
+ bonobo_ui_component_set_prop (ui_component,
+ "/commands/WorkOffline",
+ "sensitive", "1", NULL);
+ break;
+
+ case E_SHELL_LINE_STATUS_GOING_OFFLINE:
+ bonobo_ui_component_set_prop (ui_component,
+ "/menu/File/ToggleOffline",
+ "label", _("Work offline"), NULL);
+ bonobo_ui_component_set_prop (ui_component,
+ "/menu/File/ToggleOffline",
+ "verb", "WorkOffline", NULL);
+ bonobo_ui_component_set_prop (ui_component,
+ "/commands/WorkOffline",
+ "sensitive", "0", NULL);
+ break;
+
+ default:
+ g_assert_not_reached ();
+ }
+}
+
+static void
+shell_line_status_changed_cb (EShell *shell,
+ EShellLineStatus new_status,
+ void *data)
+{
+ EShellView *shell_view;
+
+ shell_view = E_SHELL_VIEW (data);
+
+ update_offline_menu_item (shell_view, new_status);
+}
+
+
#define SHORTCUT_BAR_TOGGLE_PATH "/commands/ViewShortcutBar"
#define FOLDER_BAR_TOGGLE_PATH "/commands/ViewFolderBar"
@@ -549,11 +617,13 @@ void
e_shell_view_menu_setup (EShellView *shell_view)
{
BonoboUIComponent *uic;
+ EShell *shell;
g_return_if_fail (shell_view != NULL);
g_return_if_fail (E_IS_SHELL_VIEW (shell_view));
uic = e_shell_view_get_bonobo_ui_component (shell_view);
+ shell = e_shell_view_get_shell (shell_view);
bonobo_ui_component_add_verb_list_with_data (
uic, file_verbs, shell_view);
@@ -580,4 +650,9 @@ e_shell_view_menu_setup (EShellView *shell_view)
FOLDER_BAR_TOGGLE_PATH);
shortcut_bar_mode_changed_cb (shell_view, e_shell_view_get_shortcut_bar_mode (shell_view),
SHORTCUT_BAR_TOGGLE_PATH);
+
+ /* Set up the work online / work offline menu item. */
+ gtk_signal_connect (GTK_OBJECT (shell), "line_status_changed",
+ GTK_SIGNAL_FUNC (shell_line_status_changed_cb), shell_view);
+ update_offline_menu_item (shell_view, e_shell_get_line_status (shell));
}
git.cgi/freebsd-ports-gnome/commit/sysutils/cdrtools?h=gnome-3.24&id=5e4e37c0578c2c9e0d51d85fe6e4eef74e83c8b0'>Upgrade to 1.8a40.dirk2000-01-193-6/+6 * Upgrade to 1.8a37.dirk1999-12-302-3/+3 * Upgrade to 1.8a36.dirk1999-12-222-3/+3 * - upgrade to cdrecord-1.8a33dirk1999-12-066-4/+15 * Upgrade to 1.8a31.dirk1999-11-092-2/+2 * Upgrade to 1.8a30.dirk1999-10-192-2/+2 * Add a link from cdda2wav to list_audio_tracks.dirk1999-09-252-0/+2 * Respect ${CC} and ${CFLAGS}.dirk1999-09-221-0/+31 * Upgrade to 1.8a29.dirk1999-09-202-3/+3 * Make cdrecord build on alpha (at least).dirk1999-09-192-4/+30 * - upgrade to 1.8a28:dirk1999-09-173-8/+6 * Change MAINTAINER from jmz@FreeBD.org to dirk@FreeBSD.org.dirk1999-09-171-1/+1 * $Id$ -> $FreeBSD$peter1999-08-311-1/+1 * Include audio as a virtual category, this port has an audio ripper too.billf1999-07-011-2/+2 * #4/4 enforcing Caps, no periodhoek1999-06-271-1/+1 * Update to 1.8a22mharo1999-05-312-3/+3 * Update to 1.8a21.obrien1999-05-112-3/+3 * Add more WWW: tagsmharo1999-05-031-2/+2 * Upgrade to 1.8a20obrien1999-04-072-3/+3 * Documentation update.jmz1999-04-032-15/+14 * portlintasami1999-03-281-3/+3 * Fix the path for cdda2wav.1.jmz1999-03-251-3/+2 * Upgrade to version 1.8a.jmz1999-03-243-7/+11 * Add homepage.obrien1998-10-311-0/+1 * Upgrade to version 1.6.1.obrien1998-10-312-6/+4 * Remove the run dependency on mkisofs.jmz1998-10-301-3/+1 * Upgrade to version 1.6.1a4jmz1998-10-072-5/+6 * These manpages removed by Tim Vanderhoek.hoek1998-08-201-1/+0 * Upgrade: cdrecord-1.6a12 -> cdrecord-1.6jmz1998-05-132-6/+5 * Create/delete the /dev/scgx symlink in pkg/PLIST.steve1998-03-291-0/+2 * Symbolic link should be to /dev/scgx instead.steve1998-03-281-2/+2 * Put back the symbloic link creation smashed in the laststeve1998-03-161-1/+2 * Upgrade to version 1.6a12.steve1998-03-163-10/+8 * portlint.asami1997-11-063-6/+4 * I forgot this one during import.jmz1997-11-051-0/+31 * Cdrecord allows you to create CD's on a CD-Recorder.jmz1997-11-054-0/+27