diff options
author | bertrand <bertrand@helixcode.com> | 2000-03-13 13:04:31 +0800 |
---|---|---|
committer | Bertrand Guiheneuf <bertrand@src.gnome.org> | 2000-03-13 13:04:31 +0800 |
commit | b3800945679e14f8bc6ca2b8f08915e0bd5dd7af (patch) | |
tree | f4ffa4ff7a9e7978503722127160647982058eb7 | |
parent | b21cd06a462253b43a261e6d91d89edb7ce19cf2 (diff) | |
download | gsoc2013-evolution-b3800945679e14f8bc6ca2b8f08915e0bd5dd7af.tar gsoc2013-evolution-b3800945679e14f8bc6ca2b8f08915e0bd5dd7af.tar.gz gsoc2013-evolution-b3800945679e14f8bc6ca2b8f08915e0bd5dd7af.tar.bz2 gsoc2013-evolution-b3800945679e14f8bc6ca2b8f08915e0bd5dd7af.tar.lz gsoc2013-evolution-b3800945679e14f8bc6ca2b8f08915e0bd5dd7af.tar.xz gsoc2013-evolution-b3800945679e14f8bc6ca2b8f08915e0bd5dd7af.tar.zst gsoc2013-evolution-b3800945679e14f8bc6ca2b8f08915e0bd5dd7af.zip |
once we have the bonobo control widget, disable the autoactivation and
2000-03-13 bertrand <bertrand@helixcode.com>
* shell/e-shell-view.c (get_view):
once we have the bonobo control widget,
disable the autoactivation and activate
the control frame.
2000-03-12 bertrand <bertrand@helixcode.com>
* folder-browser-factory.c (folder_browser_factory_init):
name change.
(control_activate_cb): when the control is activated,
it merges its own UI with the remote UIHandler.
(control_add_menu): sample menu merging.
(folder_browser_factory): connect the control "activate" signal.
(Bonobo control / shell view) UIMenu merging.
svn path=/trunk/; revision=2110
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | mail/ChangeLog | 4 | ||||
-rw-r--r-- | mail/folder-browser-factory.c | 38 | ||||
-rw-r--r-- | mail/folder-browser.c | 3 | ||||
-rw-r--r-- | mail/mail-display.c | 2 | ||||
-rw-r--r-- | mail/message-list.c | 77 | ||||
-rw-r--r-- | shell/e-shell-view.c | 21 |
7 files changed, 74 insertions, 78 deletions
@@ -1,3 +1,10 @@ +2000-03-13 bertrand <bertrand@helixcode.com> + + * shell/e-shell-view.c (get_view): + once we have the bonobo control widget, + disable the autoactivation and activate + the control frame. + 2000-03-12 bertrand <bertrand@helixcode.com> * shell/e-shell-view.c (get_view): name change diff --git a/mail/ChangeLog b/mail/ChangeLog index 5ff4a78035..ce3e7bb60c 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -2,6 +2,10 @@ * folder-browser-factory.c (folder_browser_factory_init): name change. + (control_activate_cb): when the control is activated, + it merges its own UI with the remote UIHandler. + (control_add_menu): sample menu merging. + (folder_browser_factory): connect the control "activate" signal. * evolution-mail.gnorba: name changes diff --git a/mail/folder-browser-factory.c b/mail/folder-browser-factory.c index 197cb833ed..ce6dfb4750 100644 --- a/mail/folder-browser-factory.c +++ b/mail/folder-browser-factory.c @@ -94,6 +94,39 @@ development_warning () } + + +static void +control_add_menu (BonoboControl *control) +{ + Bonobo_UIHandler remote_uih; + BonoboUIHandler *uih; + + uih = bonobo_control_get_ui_handler (control); + g_assert (uih); + + remote_uih = bonobo_control_get_remote_ui_handler (control); + bonobo_ui_handler_set_container (uih, remote_uih); + + bonobo_ui_handler_menu_new_item (uih, + "/File/Stuff", N_("_Stuff"), NULL, -1, + BONOBO_UI_HANDLER_PIXMAP_NONE, NULL, 0, 0, + NULL, NULL); + +} + + +static void +control_activate_cb (BonoboControl *control, + gboolean activate, + gpointer user_data) +{ + control_add_menu (control); + +} + + + /* * Creates the Folder Browser, wraps it in a Bonobo Control, and * sets the Bonobo Control properties to point to the Folder Browser @@ -106,6 +139,7 @@ folder_browser_factory (BonoboGenericFactory *factory, void *closure) GtkWidget *folder_browser; gint warning_result; + warning_result = development_warning (); if (warning_result) @@ -127,6 +161,10 @@ folder_browser_factory (BonoboGenericFactory *factory, void *closure) return NULL; } + gtk_signal_connect (GTK_OBJECT (control), "activate", control_activate_cb, NULL); + + + bonobo_control_set_property_bag (control, FOLDER_BROWSER (folder_browser)->properties); diff --git a/mail/folder-browser.c b/mail/folder-browser.c index 130011732b..9a3a8cee9c 100644 --- a/mail/folder-browser.c +++ b/mail/folder-browser.c @@ -58,6 +58,7 @@ folder_browser_load_folder (FolderBrowser *fb, const char *name) CamelException ex; gboolean new_folder_exists = FALSE; + camel_exception_init (&ex); new_folder = camel_store_get_folder (default_session->store, name, &ex); @@ -171,6 +172,8 @@ folder_browser_gui_init (FolderBrowser *fb) gtk_widget_show (fb->message_list_w); gtk_paned_add2 (GTK_PANED (fb->vpaned), GTK_WIDGET (fb->mail_display)); + gtk_paned_set_position (GTK_PANED (fb->vpaned), 200); + gtk_widget_show (GTK_WIDGET (fb->mail_display)); gtk_widget_show (GTK_WIDGET (fb)); diff --git a/mail/mail-display.c b/mail/mail-display.c index 3f5cbd2bcf..2dc02094f1 100644 --- a/mail/mail-display.c +++ b/mail/mail-display.c @@ -239,7 +239,7 @@ mail_display_set_message (MailDisplay *mail_display, * to consecutive call to *_to_html - ber */ camel_formatter = camel_formatter_new (); - + /* * for the moment, camel-formatter deals only with * mime messages, but in the future, it should be diff --git a/mail/message-list.c b/mail/message-list.c index caaede7d3a..c7190c71dd 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -394,75 +394,7 @@ message_list_init_header (MessageList *message_list) -#if 0 -static void -set_header_size (GnomeCanvas *canvas, GtkAllocation *alloc) -{ - printf ("Here\n"); - gnome_canvas_set_scroll_region (canvas, 0, 0, alloc->width, alloc->height); -} -static void -set_content_size (GnomeCanvas *canvas, GtkAllocation *alloc) -{ - printf ("Here2\n"); - gnome_canvas_set_scroll_region (canvas, 0, 0, alloc->width, alloc->height); -} - - -static GtkWidget * -make_etable (MessageList *message_list) -{ - GtkTable *t; - GtkWidget *header, *content; - - t = (GtkTable *) gtk_table_new (0, 0, 0); - gtk_widget_show (GTK_WIDGET (t)); - - gtk_widget_push_visual (gdk_rgb_get_visual ()); - gtk_widget_push_colormap (gdk_rgb_get_cmap ()); - - header = gnome_canvas_new (); - gtk_signal_connect (GTK_OBJECT (header), "size_allocate", - GTK_SIGNAL_FUNC (set_header_size), NULL); - gtk_widget_set_usize (header, 300, 20); - gtk_widget_show (header); - content = gnome_canvas_new (); - gtk_widget_set_usize (content, 300, 20); - gtk_signal_connect (GTK_OBJECT (content), "size_allocate", - GTK_SIGNAL_FUNC (set_content_size), NULL); - gtk_widget_show (content); - - gtk_widget_pop_colormap (); - gtk_widget_pop_visual (); - - gnome_canvas_item_new ( - gnome_canvas_root (GNOME_CANVAS (header)), - e_table_header_item_get_type (), - "ETableHeader", message_list->header_model, - NULL); - - gnome_canvas_item_new ( - gnome_canvas_root (GNOME_CANVAS (content)), - e_table_item_get_type (), - "ETableHeader", message_list->header_model, - "ETableModel", message_list->table_model, - "drawgrid", TRUE, - "drawfocus", TRUE, - "spreadsheet", TRUE, - NULL); - - gtk_table_attach (t, header, - 0, 1, 0, 1, GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 0, 0); - - gtk_table_attach (t, content, - 0, 1, 1, 2, - GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 0, 0); - - - return t; -} -#endif /* * GtkObject::init @@ -471,7 +403,7 @@ static void message_list_init (GtkObject *object) { MessageList *message_list = MESSAGE_LIST (object); - + message_list->table_model = e_table_simple_new ( ml_col_count, ml_row_count, ml_value_at, ml_set_value_at, ml_is_cell_editable, ml_duplicate_value, ml_free_value, @@ -505,9 +437,10 @@ message_list_destroy (GtkObject *object) MessageList *message_list = MESSAGE_LIST (object); int i; + gtk_object_unref (GTK_OBJECT (message_list->table_model)); gtk_object_unref (GTK_OBJECT (message_list->header_model)); - + /* * Renderers */ @@ -521,7 +454,7 @@ message_list_destroy (GtkObject *object) for (i = 0; i < COL_LAST; i++) gtk_object_unref (GTK_OBJECT (message_list->table_cols [i])); - + GTK_OBJECT_CLASS (message_list_parent_class)->destroy (object); } @@ -698,7 +631,7 @@ message_list_set_folder (MessageList *message_list, CamelFolder *camel_folder) printf ("Modelo cambio!\n"); e_table_model_changed (message_list->table_model); - select_msg (message_list, 1); + select_msg (message_list, 0); } GtkWidget * diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index caea4bb6d6..5a75ad74c2 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -71,12 +71,11 @@ e_shell_view_setup_shortcut_display (EShellView *eshell_view) } static GtkWidget * -get_view (EFolder *efolder) +get_view (EFolder *efolder, Bonobo_UIHandler uih) { GtkWidget *w = NULL; - BonoboControl control; EFolderType e_folder_type; - + BonoboControlFrame *control_frame; @@ -95,7 +94,7 @@ get_view (EFolder *efolder) case E_FOLDER_MAIL : w = bonobo_widget_new_control ("control:evolution-mail", - NULL); + uih ); break; default : @@ -103,6 +102,10 @@ get_view (EFolder *efolder) e_folder_get_description (efolder)); } + control_frame = bonobo_widget_get_control_frame (w); + bonobo_control_frame_set_autoactivate (control_frame, FALSE); + bonobo_control_frame_control_activate (control_frame); + if (w) gtk_widget_show (w); return w; @@ -112,7 +115,12 @@ get_view (EFolder *efolder) void e_shell_view_set_view (EShellView *eshell_view, EFolder *efolder) { - GtkWidget *w = get_view (efolder); + GtkWidget *w; + Bonobo_UIHandler uih; + + uih = bonobo_object_corba_objref (BONOBO_OBJECT (eshell_view->uih)); + + w = get_view (efolder, uih); if (eshell_view->contents){ gtk_widget_destroy (eshell_view->contents); @@ -120,6 +128,9 @@ e_shell_view_set_view (EShellView *eshell_view, EFolder *efolder) eshell_view->contents = w; + if (!w) + return; + if (eshell_view->shortcut_displayed){ gtk_paned_pack2 (GTK_PANED (eshell_view->shortcut_hpaned), eshell_view->contents, FALSE, TRUE); |