diff options
author | Dan Winship <danw@src.gnome.org> | 2000-04-01 02:34:59 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2000-04-01 02:34:59 +0800 |
commit | 7e4f187a1034cc352278f0fa5c3ca0321dbda4cc (patch) | |
tree | ebd786c95a4140157d5c031243add479c2dbcc04 | |
parent | fb80c3b9a1b00c2eb17d29293cbd9877e456f7ba (diff) | |
download | gsoc2013-evolution-7e4f187a1034cc352278f0fa5c3ca0321dbda4cc.tar.gz gsoc2013-evolution-7e4f187a1034cc352278f0fa5c3ca0321dbda4cc.tar.zst gsoc2013-evolution-7e4f187a1034cc352278f0fa5c3ca0321dbda4cc.zip |
Update for shortcut bar changes.
* shell/e-shortcut.c (e_shortcut_bar_view_new, shell_icon_cb):
Update for shortcut bar changes.
* shell/e-folder.h: add E_FOLDER_SUMMARY
* shell/e-shell.c (e_shell_setup_default_folders): make the
"Today" icon be of type E_FOLDER_SUMMARY, not E_FOLDER_MAIL.
svn path=/trunk/; revision=2269
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | shell/e-folder.h | 1 | ||||
-rw-r--r-- | shell/e-shell.c | 2 | ||||
-rw-r--r-- | shell/e-shortcut.c | 49 |
4 files changed, 58 insertions, 3 deletions
@@ -1,3 +1,12 @@ +2000-03-31 Dan Winship <danw@helixcode.com> + + * shell/e-shortcut.c (e_shortcut_bar_view_new, shell_icon_cb): + Update for shortcut bar changes. + + * shell/e-folder.h: add E_FOLDER_SUMMARY + * shell/e-shell.c (e_shell_setup_default_folders): make the + "Today" icon be of type E_FOLDER_SUMMARY, not E_FOLDER_MAIL. + 2000-03-31 Damon Chaplin <damon@helixcode.com> * widgets/shortcut-bar/e-shortcut-bar.[hc]: added support for a diff --git a/shell/e-folder.h b/shell/e-folder.h index f631191013..147399268b 100644 --- a/shell/e-folder.h +++ b/shell/e-folder.h @@ -23,6 +23,7 @@ typedef enum { } EFolderDragDropAction; typedef enum { + E_FOLDER_SUMMARY, E_FOLDER_MAIL, E_FOLDER_CONTACTS, E_FOLDER_CALENDAR, diff --git a/shell/e-shell.c b/shell/e-shell.c index f706723f37..2713df3921 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -254,7 +254,7 @@ static void e_shell_setup_default_folders (EShell *eshell) { eshell->default_folders.summary = e_folder_new ( - E_FOLDER_MAIL, "internal:summary", _("Today"), _("Executive Summary"), + E_FOLDER_SUMMARY, "internal:summary", _("Today"), _("Executive Summary"), NULL, "internal:"); eshell->default_folders.inbox = e_folder_new ( E_FOLDER_MAIL, "internal:inbox", _("Inbox"), _("New mail messages"), diff --git a/shell/e-shortcut.c b/shell/e-shortcut.c index 767f9e4067..5386efb182 100644 --- a/shell/e-shortcut.c +++ b/shell/e-shortcut.c @@ -298,8 +298,12 @@ populate_group (EShortcutBarModel *bm, EShortcutGroup *esg, EShortcutBar *shortc char *type = NULL; switch (folder->type){ + case E_FOLDER_SUMMARY: + type = "summary:"; + break; + case E_FOLDER_MAIL: - type = "folder:"; + type = "mail:"; break; case E_FOLDER_CONTACTS: @@ -342,12 +346,51 @@ populate_from_model (EShortcutBarModel *bm, EShortcutBar *shortcut_bar) } +static struct { + char *prefix, *path; + GdkPixbuf *image; +} shell_icons[] = { + { "summary:", "evolution/evolution-today.png", NULL }, + { "mail:", "evolution/evolution-inbox.png", NULL }, + { "calendar:", "evolution/evolution-calendar.png", NULL }, + { "contacts:", "evolution/evolution-contacts.png", NULL }, + { "notes:", "evolution/evolution-notes.png", NULL }, + { "todo:", "evolution/evolution-tasks.png", NULL } +}; +#define NSHELL_ICONS (sizeof (shell_icons) / sizeof (shell_icons[0])) + +static GdkPixbuf * +shell_icon_cb (EShortcutBar *shortcut_bar, gchar *url) +{ + int i; + + for (i = 0; i < NSHELL_ICONS; i++) { + if (!strncmp (shell_icons[i].prefix, url, + strlen (shell_icons[i].prefix))) { + if (!shell_icons[i].image) { + char *pixmap_path; + + pixmap_path = gnome_pixmap_file (shell_icons[i].path); + if (pixmap_path) + shell_icons[i].image = gdk_pixbuf_new_from_file (pixmap_path); + else { + g_warning ("Couldn't find pixmap: %s", + pixmap_path); + } + } + return shell_icons[i].image; + } + } + + return NULL; +} + static void view_destroyed (EShortcutBar *shortcut_bar, EShortcutBarModel *bm) { bm->views = g_slist_remove (bm->views, shortcut_bar); } - + GtkWidget * e_shortcut_bar_view_new (EShortcutBarModel *bm) { @@ -357,6 +400,8 @@ e_shortcut_bar_view_new (EShortcutBarModel *bm) gtk_widget_push_colormap (gdk_rgb_get_cmap ()); shortcut_bar = e_shortcut_bar_new (); + e_shortcut_bar_set_icon_callback (E_SHORTCUT_BAR (shortcut_bar), + shell_icon_cb); gtk_widget_pop_visual (); gtk_widget_pop_colormap (); |