aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-view.c
diff options
context:
space:
mode:
authorArturo Espinosa <unammx@src.gnome.org>2000-01-17 16:58:29 +0800
committerArturo Espinosa <unammx@src.gnome.org>2000-01-17 16:58:29 +0800
commit173a42036986044bc7907033a299cc1c71aa72e7 (patch)
tree7eb91284a687ae4f0c4e8f1cf4b81dd56249da1d /shell/e-shell-view.c
parent3bdd857a4a69e83841c2fbae83d96101912ebf69 (diff)
downloadgsoc2013-evolution-173a42036986044bc7907033a299cc1c71aa72e7.tar
gsoc2013-evolution-173a42036986044bc7907033a299cc1c71aa72e7.tar.gz
gsoc2013-evolution-173a42036986044bc7907033a299cc1c71aa72e7.tar.bz2
gsoc2013-evolution-173a42036986044bc7907033a299cc1c71aa72e7.tar.lz
gsoc2013-evolution-173a42036986044bc7907033a299cc1c71aa72e7.tar.xz
gsoc2013-evolution-173a42036986044bc7907033a299cc1c71aa72e7.tar.zst
gsoc2013-evolution-173a42036986044bc7907033a299cc1c71aa72e7.zip
Shaping up; Model/view is still not fully setup, but coming, coming
svn path=/trunk/; revision=1580
Diffstat (limited to 'shell/e-shell-view.c')
-rw-r--r--shell/e-shell-view.c81
1 files changed, 72 insertions, 9 deletions
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index 5962e0686f..34438e4556 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -12,6 +12,7 @@
#include "e-util/e-util.h"
#include "e-shell-view.h"
#include "e-shell-view-menu.h"
+#include "e-shell-shortcut.h"
#define PARENT_TYPE gnome_app_get_type ()
@@ -45,12 +46,6 @@ e_shell_view_setup (EShellView *eshell_view)
}
static void
-e_shell_view_load_shortcut_bar (EShellView *eshell_view)
-{
- gtk_paned_set_position (GTK_PANED (eshell_view->shortcut_hpaned), 100);
-}
-
-static void
e_shell_view_setup_shortcut_display (EShellView *eshell_view)
{
gtk_widget_push_visual (gdk_rgb_get_visual ());
@@ -60,7 +55,7 @@ e_shell_view_setup_shortcut_display (EShellView *eshell_view)
gtk_widget_show (eshell_view->shortcut_hpaned);
eshell_view->shortcut_bar = e_shortcut_bar_new ();
- e_shell_view_load_shortcut_bar (eshell_view);
+ gtk_paned_set_position (GTK_PANED (eshell_view->shortcut_hpaned), 100);
gtk_paned_pack1 (GTK_PANED (eshell_view->shortcut_hpaned),
eshell_view->shortcut_bar, FALSE, TRUE);
@@ -70,6 +65,72 @@ e_shell_view_setup_shortcut_display (EShellView *eshell_view)
gtk_widget_pop_colormap ();
gnome_app_set_contents (GNOME_APP (eshell_view), eshell_view->shortcut_hpaned);
+
+ gtk_signal_connect (
+ GTK_OBJECT (eshell_view->shortcut_bar), "item_selected",
+ GTK_SIGNAL_FUNC (shortcut_bar_item_selected), eshell_view);
+
+}
+
+static void
+e_shell_view_load_group (EShell *eshell, EShellView *eshell_view, EShortcutGroup *esg)
+{
+ EShortcutBar *bar = E_SHORTCUT_BAR (eshell_view->shortcut_bar);
+ int group_num, i;
+ const int items = esg->shortcuts->len;
+
+ group_num = e_shortcut_bar_add_group (bar, esg->title);
+ if (esg->small_icons)
+ e_shortcut_bar_set_view_type (bar, group_num, E_ICON_BAR_SMALL_ICONS);
+
+ for (i = 0; i < items; i++){
+ EShortcut *shortcut = E_SHORTCUT (g_array_index (esg->shortcuts, EShortcut *, i));
+ EFolder *folder = shortcut->efolder;
+ char *type = NULL;
+
+ switch (folder->type){
+ case E_FOLDER_MAIL:
+ type = "folder:";
+ break;
+
+ case E_FOLDER_CONTACTS:
+ type = "contacts:";
+ break;
+
+ case E_FOLDER_CALENDAR:
+ type = "calendar:";
+ break;
+
+ case E_FOLDER_TASKS:
+ type = "todo:";
+ break;
+
+ case E_FOLDER_OTHER:
+ type = "file:";
+ break;
+
+ default:
+ g_assert_not_reached ();
+ }
+
+ e_shortcut_bar_add_item (bar, group_num, type, folder->name);
+ }
+}
+
+static void
+e_shell_view_load_shortcut_bar (EShellView *eshell_view)
+{
+ EShell *eshell = eshell_view->eshell;
+ const int groups = eshell->shortcut_groups->len;
+ int i;
+
+ for (i = 0; i < groups; i++){
+ EShortcutGroup *esg;
+
+ esg = g_array_index (eshell->shortcut_groups, EShortcutGroup *, i);
+
+ e_shell_view_load_group (eshell, eshell_view, esg);
+ }
}
GtkWidget *
@@ -81,12 +142,14 @@ e_shell_view_new (EShell *eshell, gboolean show_shortcut_bar)
gnome_app_construct (GNOME_APP (eshell_view), "Evolution", "Evolution");
+ eshell_view->eshell = eshell;
e_shell_view_setup (eshell_view);
e_shell_view_setup_menus (eshell_view);
- if (show_shortcut_bar)
+ if (show_shortcut_bar){
e_shell_view_setup_shortcut_display (eshell_view);
- else {
+ e_shell_view_load_shortcut_bar (eshell_view);
+ } else {
g_error ("Non-shortcut bar code not written yet");
}