diff options
Diffstat (limited to 'shell')
-rw-r--r-- | shell/e-folder.c | 13 | ||||
-rw-r--r-- | shell/e-folder.h | 2 | ||||
-rw-r--r-- | shell/e-shell-view.c | 37 | ||||
-rw-r--r-- | shell/e-shell.c | 1 |
4 files changed, 44 insertions, 9 deletions
diff --git a/shell/e-folder.c b/shell/e-folder.c index 62e27cdfad..ba6e10b22e 100644 --- a/shell/e-folder.c +++ b/shell/e-folder.c @@ -165,6 +165,19 @@ e_folder_get_type_name (EFolder *efolder) return NULL; } + +EFolderType +e_folder_get_folder_type (EFolder *efolder) +{ + g_return_val_if_fail (efolder != NULL, E_FOLDER_OTHER); + g_return_val_if_fail (E_IS_FOLDER (efolder), E_FOLDER_OTHER); + + return (efolder->type); +} + + + + void e_folder_construct (EFolder *efolder, EFolderType type, const char *uri, const char *name, diff --git a/shell/e-folder.h b/shell/e-folder.h index 37b0f63862..f631191013 100644 --- a/shell/e-folder.h +++ b/shell/e-folder.h @@ -87,5 +87,7 @@ void e_folder_set_view_name (EFolder *efolder, const char *view_name); const char *e_folder_get_type_name (EFolder *efolder); +EFolderType e_folder_get_folder_type (EFolder *efolder); + #endif /* _E_FOLDER_H_ */ diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index ea5f30897a..10ce194af5 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -73,18 +73,37 @@ e_shell_view_setup_shortcut_display (EShellView *eshell_view) static GtkWidget * get_view (EFolder *efolder) { - GtkWidget *w; - /*char buffer [80]; + GtkWidget *w = NULL; + BonoboControl control; + EFolderType e_folder_type; - sprintf (buffer, "I am the view for %s\n", - e_folder_get_description (efolder)); - w = gtk_label_new (buffer); + + + printf ("I am the view for %s\n", + e_folder_get_description (efolder)); + + - */ - w = bonobo_widget_new_control ("GOADID:Evolution:FolderBrowser:1.0", - NULL); - gtk_widget_show (w); + /* get the folder type */ + e_folder_type = e_folder_get_folder_type (efolder); + + + /* depending on the type of folder, + * we launch a different bonobo component */ + switch (e_folder_type) { + + case E_FOLDER_MAIL : + w = bonobo_widget_new_control ("GOADID:Evolution:FolderBrowser:1.0", + NULL); + break; + + default : + printf ("No bonobo component associated to %s\n", + e_folder_get_description (efolder)); + } + + if (w) gtk_widget_show (w); return w; diff --git a/shell/e-shell.c b/shell/e-shell.c index e78a30e876..ec383746f0 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -9,6 +9,7 @@ * (C) 1999 Miguel de Icaza * (C) 2000 Helix Code, Inc. */ + #include <config.h> #include <gtk/gtkmain.h> #include <libgnome/libgnome.h> |