diff options
-rw-r--r-- | ChangeLog | 24 | ||||
-rw-r--r-- | configure.in | 1 | ||||
-rw-r--r-- | shell/Makefile.am | 2 | ||||
-rw-r--r-- | shell/e-folder-mail.c | 16 | ||||
-rw-r--r-- | shell/e-folder.c | 58 | ||||
-rw-r--r-- | shell/e-folder.h | 26 | ||||
-rw-r--r-- | shell/e-shell-view.c | 69 | ||||
-rw-r--r-- | shell/e-shell-view.h | 14 | ||||
-rw-r--r-- | shell/e-shell.c | 37 | ||||
-rw-r--r-- | shell/e-shell.h | 9 | ||||
-rw-r--r-- | shell/main.c | 2 | ||||
-rw-r--r-- | widgets/Makefile.am | 2 |
12 files changed, 221 insertions, 39 deletions
@@ -1,4 +1,25 @@ -2000-01-14 Christopher James Lahey <clahey@helixcode.com> +2000-01-10 Miguel de Icaza <miguel@gnu.org> + + * widgets/shortcut-bar/e-shortcut-bar.c (e_shortcut_bar_add_item): + Use e_bar_set_item_data. + + Drop item_url; Require image argument; Require user data + argument. + +2000-01-09 Miguel de Icaza <miguel@gnu.org> + + * widgets/shortcut-bar/e-icon-bar.c (e_icon_bar_init): Turn on anti-aliasing. + +2000-01-08 Miguel de Icaza <miguel@gnu.org> + + * widgets/shortcut-bar/e-icon-bar.c (e_icon_bar_add_item): Use + GdkPixbuf here. + (e_icon_bar_get_item_image): ditto and initialize image. + + * widgets/shortcut-bar/e-shortcut-bar.c (e_shortcut_bar_add_item): + Use gdk-pixbuf. + +2000-01-12 <clahey@galapagos.helixcode.com> * widgets/e-text-event-processor-types.h, widgets/e-text-event-processor-emacs-like.c, widgets/e-text.c, @@ -71,6 +92,7 @@ 2000-01-12 Christopher James Lahey <clahey@helixcode.com> +>>>>>>> 1.169 * widgets/e-minicard.c, widgets/e-minicard.h: Added a resize signal for when the card changes height. Made it so that when you press tab inside of a field, it goes to the next field. diff --git a/configure.in b/configure.in index 5f34923127..7d261cc7ce 100644 --- a/configure.in +++ b/configure.in @@ -141,5 +141,6 @@ widgets/Makefile widgets/meeting-time-sel/Makefile widgets/shortcut-bar/Makefile widgets/e-table/Makefile +widgets/toolbar/Makefile shell/Makefile ]) diff --git a/shell/Makefile.am b/shell/Makefile.am index 18e0cce064..e80ba3fde1 100644 --- a/shell/Makefile.am +++ b/shell/Makefile.am @@ -19,8 +19,6 @@ evolution_SOURCES = \ main.c \ e-folder.c \ e-folder.h \ - e-folder-mail.c \ - e-folder-mail.h \ e-init.c \ e-init.h \ e-shell.c \ diff --git a/shell/e-folder-mail.c b/shell/e-folder-mail.c index 72010194c5..9765b7d946 100644 --- a/shell/e-folder-mail.c +++ b/shell/e-folder-mail.c @@ -15,20 +15,6 @@ #define PARENT_TYPE e_folder_get_type () -static const char * -efm_get_type_name (EFolder *efolder) -{ - return _("Folder containing Mail Items"); -} - -static void -e_folder_mail_class_init (GtkObjectClass *object_class) -{ - EFolderClass *efc = (EFolderClass *) object_class; - - efc->get_type_name = efm_get_type_name; -} - static void e_folder_mail_init (GtkObject *object) { @@ -42,7 +28,7 @@ e_folder_mail_new (const char *uri, const char *name, const char *desc, { EFolderMail *efm = gtk_type_new (e_folder_mail_get_type ()); - e_folder_construct (E_FOLDER (efm), uri, name, desc, home_page, view_name); + e_folder_construct (E_FOLDER (efm), E_FOLDER_MAIL, uri, name, desc, home_page, view_name); return E_FOLDER (efm); } diff --git a/shell/e-folder.c b/shell/e-folder.c index 566ead1274..8a7d5dfe6b 100644 --- a/shell/e-folder.c +++ b/shell/e-folder.c @@ -8,6 +8,7 @@ */ #include <config.h> #include <gtk/gtksignal.h> +#include <libgnome/libgnome.h> #include "e-util/e-util.h" #include "e-folder.h" @@ -18,7 +19,7 @@ static GtkObjectClass *parent_class; #define EFC(o) E_FOLDER_CLASS (GTK_OBJECT (o)->klass) enum { - VIEW_CHANGED, + CHANGED, LAST_SIGNAL }; static guint efolder_signals [LAST_SIGNAL] = { 0, }; @@ -47,11 +48,11 @@ e_folder_class_init (GtkObjectClass *object_class) object_class->destroy = e_folder_destroy; - efolder_signals [VIEW_CHANGED] = - gtk_signal_new ("view_changed", + efolder_signals [CHANGED] = + gtk_signal_new ("changed", GTK_RUN_LAST, object_class->type, - GTK_SIGNAL_OFFSET (EFolderClass, view_changed), + GTK_SIGNAL_OFFSET (EFolderClass, changed), gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0); @@ -60,7 +61,12 @@ e_folder_class_init (GtkObjectClass *object_class) object_class, efolder_signals, LAST_SIGNAL); } -E_MAKE_TYPE (e_folder, "EFolder", EFolder, e_folder_class_init, NULL, PARENT_TYPE) +static void +e_folder_init (GtkObject *object) +{ +} + +E_MAKE_TYPE (e_folder, "EFolder", EFolder, e_folder_class_init, e_folder_init, PARENT_TYPE) void e_folder_set_uri (EFolder *efolder, const char *uri) @@ -134,11 +140,28 @@ e_folder_get_type_name (EFolder *efolder) g_return_val_if_fail (efolder != NULL, NULL); g_return_val_if_fail (E_IS_FOLDER (efolder), NULL); - return EFC (efolder)->get_type_name (efolder); + switch (efolder->type){ + case E_FOLDER_MAIL: + return _("A folder containing mail items"); + + case E_FOLDER_CONTACTS: + return _("A folder containing contacts"); + + case E_FOLDER_CALENDAR: + return _("A folder containing calendar entries"); + + case E_FOLDER_TASKS: + return _("A folder containing tasks"); + + default: + g_assert_not_reached (); + } + + return NULL; } void -e_folder_construct (EFolder *efolder, +e_folder_construct (EFolder *efolder, EFolderType type, const char *uri, const char *name, const char *desc, const char *home_page, const char *view_name) @@ -146,6 +169,9 @@ e_folder_construct (EFolder *efolder, g_return_if_fail (efolder != NULL); g_return_if_fail (E_IS_FOLDER (efolder)); + /* EFolders are self-owned */ + GTK_OBJECT_UNSET_FLAGS (GTK_OBJECT (efolder), GTK_FLOATING); + if (uri) efolder->uri = g_strdup (uri); if (name) @@ -156,6 +182,22 @@ e_folder_construct (EFolder *efolder, efolder->home_page = g_strdup (home_page); if (view_name) efolder->view_name = g_strdup (view_name); + + efolder->type = type; +} + +EFolder * +e_folder_new (EFolderType type, + const char *uri, const char *name, + const char *desc, const char *home_page, + const char *view_name) +{ + EFolder *efolder; + + efolder = gtk_type_new (e_folder_get_type ()); + + e_folder_construct (efolder, type, uri, name, desc, home_page, view_name); + return efolder; } const char * @@ -200,5 +242,5 @@ e_folder_set_view_name (EFolder *efolder, const char *view_name) efolder->view_name = g_strdup (view_name); gtk_signal_emit (GTK_OBJECT (efolder), - efolder_signals [VIEW_CHANGED]); + efolder_signals [CHANGED]); } diff --git a/shell/e-folder.h b/shell/e-folder.h index d41a02e6ce..d262859c3d 100644 --- a/shell/e-folder.h +++ b/shell/e-folder.h @@ -15,9 +15,19 @@ typedef enum { E_FOLDER_DND_AS_MOVE_COPY } EFolderDragDropAction; +typedef enum { + E_FOLDER_MAIL, + E_FOLDER_CONTACTS, + E_FOLDER_CALENDAR, + E_FOLDER_TASKS, + E_FOLDER_OTHER +} EFolderType; + typedef struct { GtkObject parent_object; + EFolderType type; + /* * General properties */ @@ -36,19 +46,17 @@ typedef struct { GtkObjectClass parent_class; /* - * Virtual methods + * Notifies views of visible changes in the Efolder */ - /* eg: "Folder containing mail items */ - const char *(*get_type_name) (EFolder *efolder); - - /* - * Signals - */ - void (*view_changed) (EFolder *efolder); + void (*changed) (EFolder *efolder); } EFolderClass; GtkType e_folder_get_type (void); -void e_folder_construct (EFolder *efolder, +void e_folder_construct (EFolder *efolder, EFolderType type, + const char *uri, const char *name, + const char *desc, const char *home_page, + const char *view_name); +EFolder *e_folder_new (EFolderType type, const char *uri, const char *name, const char *desc, const char *home_page, const char *view_name); diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index f57a6add3a..5962e0686f 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -8,6 +8,7 @@ */ #include <config.h> #include <gnome.h> +#include "shortcut-bar/e-shortcut-bar.h" #include "e-util/e-util.h" #include "e-shell-view.h" #include "e-shell-view-menu.h" @@ -34,21 +35,87 @@ e_shell_view_class_init (GtkObjectClass *object_class) parent_class = gtk_type_class (PARENT_TYPE); } +static void +e_shell_view_setup (EShellView *eshell_view) +{ + /* + * FIXME, should load the config if (load_config).... + */ + gtk_window_set_default_size (GTK_WINDOW (eshell_view), 600, 400); +} + +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 ()); + gtk_widget_push_colormap (gdk_rgb_get_cmap ()); + + eshell_view->shortcut_hpaned = gtk_hpaned_new (); + 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_pack1 (GTK_PANED (eshell_view->shortcut_hpaned), + eshell_view->shortcut_bar, FALSE, TRUE); + gtk_widget_show (eshell_view->shortcut_bar); + + gtk_widget_pop_visual (); + gtk_widget_pop_colormap (); + + gnome_app_set_contents (GNOME_APP (eshell_view), eshell_view->shortcut_hpaned); +} + GtkWidget * -e_shell_view_new (EShell *eshell) +e_shell_view_new (EShell *eshell, gboolean show_shortcut_bar) { EShellView *eshell_view; eshell_view = gtk_type_new (e_shell_view_get_type ()); gnome_app_construct (GNOME_APP (eshell_view), "Evolution", "Evolution"); + + e_shell_view_setup (eshell_view); e_shell_view_setup_menus (eshell_view); + if (show_shortcut_bar) + e_shell_view_setup_shortcut_display (eshell_view); + else { + g_error ("Non-shortcut bar code not written yet"); + } + e_shell_register_view (eshell, eshell_view); + + eshell_view->shortcut_displayed = show_shortcut_bar; return (GtkWidget *) eshell_view; } +void +e_shell_view_set_view (EShellView *eshell_view, EFolder *efolder) +{ + if (efolder == NULL){ + printf ("Display executive summary"); + } else { + + } +} + +void +e_shell_view_display_shortcut_bar (EShellView *eshell_view, gboolean display) +{ + g_return_if_fail (eshell_view != NULL); + g_return_if_fail (E_IS_SHELL_VIEW (eshell_view)); + + g_error ("Switching code for the shortcut bar is not written yet"); +} + E_MAKE_TYPE (e_shell_view, "EShellView", EShellView, e_shell_view_class_init, NULL, PARENT_TYPE); void diff --git a/shell/e-shell-view.h b/shell/e-shell-view.h index c5d3b797b5..4011cfc6ac 100644 --- a/shell/e-shell-view.h +++ b/shell/e-shell-view.h @@ -19,16 +19,28 @@ struct _EShellView { /* Our user interface handler */ GnomeUIHandler *uih; + + /* + * + */ + char shortcut_displayed; + GtkWidget *shortcut_hpaned; + GtkWidget *shortcut_bar; + GtkWidget *contents; }; typedef struct { GnomeAppClass parent_class; } EShellViewClass; -GtkWidget *e_shell_view_new (EShell *eshell); +GtkWidget *e_shell_view_new (EShell *eshell, gboolean show_shortcut_bar); GtkType e_shell_view_get_type (void); void e_shell_view_new_folder (EShellView *esv); void e_shell_view_new_shortcut (EShellView *esv); +void e_shell_view_set_view (EShellView *eshell_view, + EFolder *efolder); +void e_shell_view_display_shortcut_bar (EShellView *eshell_view, gboolean display); + #endif /* E_SHELL_VIEW_H */ diff --git a/shell/e-shell.c b/shell/e-shell.c index b066985b1c..53a2df771e 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -9,6 +9,7 @@ */ #include <config.h> #include <gtk/gtkmain.h> +#include <libgnome/libgnome.h> #include "Evolution.h" #include "e-util/e-util.h" #include "e-shell.h" @@ -142,8 +143,21 @@ init_e_shell_corba_class (void) } static void +es_destroy_default_folders (EShell *eshell) +{ + gtk_object_unref (GTK_OBJECT (eshell->default_folders.inbox)); + gtk_object_unref (GTK_OBJECT (eshell->default_folders.outbox)); + gtk_object_unref (GTK_OBJECT (eshell->default_folders.drafts)); + gtk_object_unref (GTK_OBJECT (eshell->default_folders.calendar)); + gtk_object_unref (GTK_OBJECT (eshell->default_folders.tasks)); +} + +static void e_shell_destroy (GtkObject *object) { + EShell *eshell = E_SHELL (object); + + es_destroy_default_folders (eshell); GTK_OBJECT_CLASS (e_shell_parent_class)->destroy (object); } @@ -213,6 +227,26 @@ e_shell_construct (EShell *eshell, GNOME_Evolution_Shell corba_eshell) gnome_object_construct (GNOME_OBJECT (eshell), corba_eshell); } +static void +e_shell_setup_default_folders (EShell *eshell) +{ + eshell->default_folders.inbox = e_folder_new ( + E_FOLDER_MAIL, "internal:inbox", _("Inbox"), _("New mail messages"), + NULL, "internal:mail_view"); + eshell->default_folders.outbox = e_folder_new ( + E_FOLDER_MAIL, "internal:outbox", _("Sent messages"), _("Sent mail messages"), + NULL, "internal:mail_view"); + eshell->default_folders.drafts = e_folder_new ( + E_FOLDER_MAIL, "internal:drafts", _("Drafts"), _("Draft mail messages"), + NULL, "internal:mail_view"); + eshell->default_folders.calendar = e_folder_new ( + E_FOLDER_CALENDAR, "internal:personal_calendar", _("Calendar"), _("Your calendar"), + NULL, "internal:calendar_daily"); + eshell->default_folders.tasks = e_folder_new ( + E_FOLDER_TASKS, "internal:personal_calendar", _("Tasks"), _("Tasks list"), + NULL, "internal:tasks_view"); +} + EShell * e_shell_new (void) { @@ -228,6 +262,9 @@ e_shell_new (void) } e_shell_construct (eshell, corba_eshell); + + e_shell_setup_default_folders (eshell); + return eshell; } diff --git a/shell/e-shell.h b/shell/e-shell.h index c8d59d31b7..7cd5ac08eb 100644 --- a/shell/e-shell.h +++ b/shell/e-shell.h @@ -3,6 +3,7 @@ #include <bonobo/gnome-object.h> #include "evolution.h" +#include "e-folder.h" #define E_SHELL_GOAD_ID "GOADID:GNOME:Evolution:Shell:1.0" #define E_SHELL_FACTORY_GOAD_ID "GOADID:GNOME:Evolution:ShellFactory:1.0" @@ -18,6 +19,14 @@ struct _EShell { /* A list of EShellViews */ GSList *views; + + struct { + EFolder *inbox; + EFolder *outbox; + EFolder *drafts; + EFolder *calendar; + EFolder *tasks; + } default_folders; }; typedef struct { diff --git a/shell/main.c b/shell/main.c index 97a5987049..688591014e 100644 --- a/shell/main.c +++ b/shell/main.c @@ -69,7 +69,7 @@ evolution_boot (void) EShellView *e_shell_view; eshell = e_shell_new (); - e_shell_view = E_SHELL_VIEW (e_shell_view_new (eshell)); + e_shell_view = E_SHELL_VIEW (e_shell_view_new (eshell, TRUE)); gtk_widget_show (GTK_WIDGET (e_shell_view)); } diff --git a/widgets/Makefile.am b/widgets/Makefile.am index 1e2016ef3c..0c8142ede2 100644 --- a/widgets/Makefile.am +++ b/widgets/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = \ - meeting-time-sel shortcut-bar e-table + meeting-time-sel shortcut-bar e-table toolbar INCLUDES = \ -I$(top_srcdir)/camel \ |