diff options
author | Chris Toshok <toshok@helixcode.com> | 2000-09-30 04:36:03 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2000-09-30 04:36:03 +0800 |
commit | c237eba138cda7af87e718e19fe08453fc9602da (patch) | |
tree | cd0405a01c48995a8b650e52fb986724b479e3a1 /mail | |
parent | 7d63b93c516dd80bfc703e92c1502e55ae3c1f97 (diff) | |
download | gsoc2013-evolution-c237eba138cda7af87e718e19fe08453fc9602da.tar.gz gsoc2013-evolution-c237eba138cda7af87e718e19fe08453fc9602da.tar.zst gsoc2013-evolution-c237eba138cda7af87e718e19fe08453fc9602da.zip |
nuked.
2000-09-29 Chris Toshok <toshok@helixcode.com>
* subscribe-control-factory.c, subscribe-control-factory.h: nuked.
* subscribe-control.c, subscribe-control.h: lots of changes. we
now pop up a dialog, and will have a storage set view on our left
side, like the shell does.
* mail.h: add prototype for manage_subscriptions.
* mail-callbacks.c (manage_subscriptions): new function, pops up
the subscribe dialog.
* folder-browser-factory.c: add the verb for managing
subscriptions.
* Makefile.am (evolution_mail_SOURCES): add subscribe-control.[ch]
again.
svn path=/trunk/; revision=5637
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 19 | ||||
-rw-r--r-- | mail/Makefile.am | 2 | ||||
-rw-r--r-- | mail/folder-browser-factory.c | 1 | ||||
-rw-r--r-- | mail/mail-callbacks.c | 10 | ||||
-rw-r--r-- | mail/mail.h | 1 | ||||
-rw-r--r-- | mail/subscribe-control-factory.c | 227 | ||||
-rw-r--r-- | mail/subscribe-control-factory.h | 21 | ||||
-rw-r--r-- | mail/subscribe-control.c | 239 | ||||
-rw-r--r-- | mail/subscribe-control.h | 39 |
9 files changed, 227 insertions, 332 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 9afa70433f..f71ae71812 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,22 @@ +2000-09-29 Chris Toshok <toshok@helixcode.com> + + * subscribe-control-factory.c, subscribe-control-factory.h: nuked. + + * subscribe-control.c, subscribe-control.h: lots of changes. we + now pop up a dialog, and will have a storage set view on our left + side, like the shell does. + + * mail.h: add prototype for manage_subscriptions. + + * mail-callbacks.c (manage_subscriptions): new function, pops up + the subscribe dialog. + + * folder-browser-factory.c: add the verb for managing + subscriptions. + + * Makefile.am (evolution_mail_SOURCES): add subscribe-control.[ch] + again. + 2000-09-28 Chris Toshok <toshok@helixcode.com> * subscribe-control.h (subscribe_search): added prototype. diff --git a/mail/Makefile.am b/mail/Makefile.am index 83ae9cf4be..33cb58cf21 100644 --- a/mail/Makefile.am +++ b/mail/Makefile.am @@ -78,6 +78,8 @@ evolution_mail_SOURCES = \ message-thread.c \ message-thread.h \ session.c \ + subscribe-control.c \ + subscribe-control.h \ mail.h evolution_mail_LDADD = \ diff --git a/mail/folder-browser-factory.c b/mail/folder-browser-factory.c index 82d12c76ef..ef62d888a5 100644 --- a/mail/folder-browser-factory.c +++ b/mail/folder-browser-factory.c @@ -87,6 +87,7 @@ BonoboUIVerb verbs [] = { BONOBO_UI_VERB ("SetMailFilter", filter_edit), BONOBO_UI_VERB ("VFolderEdit", vfolder_edit_vfolders), BONOBO_UI_VERB ("SetMailConfig", providers_config), + BONOBO_UI_VERB ("SetSubscribe", manage_subscriptions), BONOBO_UI_VERB ("SetForgetPwd", forget_passwords), /* Message Menu */ diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index b513e2478a..118dc5d4bb 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -37,6 +37,7 @@ #include "mail-ops.h" #include "mail-local.h" #include "folder-browser.h" +#include "subscribe-control.h" #include "filter/filter-editor.h" #include "filter/filter-driver.h" #include <gal/e-table/e-table.h> @@ -723,6 +724,15 @@ providers_config (BonoboUIHandler *uih, void *user_data, const char *path) } void +manage_subscriptions (BonoboUIHandler *uih, void *user_data, const char *path) +{ + /* XXX pass in the selected storage */ + GtkWidget *subscribe = subscribe_control_new (); + + gtk_widget_show (subscribe); +} + +void mail_print_msg (MailDisplay *md) { GnomePrintMaster *print_master; diff --git a/mail/mail.h b/mail/mail.h index 84e4e9679a..679782231f 100644 --- a/mail/mail.h +++ b/mail/mail.h @@ -96,6 +96,7 @@ void expunge_folder (BonoboUIHandler *uih, void *user_data, const char *path); void filter_edit (BonoboUIHandler *uih, void *user_data, const char *path); void vfolder_edit_vfolders (BonoboUIHandler *uih, void *user_data, const char *path); void providers_config (BonoboUIHandler *uih, void *user_data, const char *path); +void manage_subscriptions (BonoboUIHandler *uih, void *user_data, const char *path); void configure_folder (BonoboUIHandler *uih, void *user_data, const char *path); diff --git a/mail/subscribe-control-factory.c b/mail/subscribe-control-factory.c deleted file mode 100644 index 9ab6748d46..0000000000 --- a/mail/subscribe-control-factory.c +++ /dev/null @@ -1,227 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * subscribe-control-factory.c: A Bonobo Control factory for Subscribe Controls - * - * Author: - * Chris Toshok (toshok@helixcode.com) - * - * (C) 2000 Helix Code, Inc. - */ - -#include <config.h> - -#include <gnome.h> -#include <bonobo/bonobo-main.h> -#include <bonobo/bonobo-object.h> -#include <bonobo/bonobo-generic-factory.h> -#include <bonobo/bonobo-control.h> -#include <bonobo/bonobo-ui-component.h> - -#include <gal/util/e-util.h> -#include <gal/widgets/e-gui-utils.h> - -#include "subscribe-control-factory.h" - -#include "subscribe-control.h" -#include "mail.h" -#include "shell/Evolution.h" -#include "mail-config.h" -#include "mail-ops.h" - -/* The Subscribe BonoboControls we have. */ -static GList *control_list = NULL; - -/* - * Add with 'subscribe_control' - */ -static BonoboUIVerb verbs [] = { - /* Edit Menu */ - BONOBO_UI_VERB ("EditSelectAll", subscribe_select_all), - BONOBO_UI_VERB ("EditUnSelectAll", subscribe_unselect_all), - - /* Folder Menu */ - BONOBO_UI_VERB ("SubscribeFolder", subscribe_folder), - BONOBO_UI_VERB ("UnsubscribeFolder", unsubscribe_folder), - - /* Toolbar Specific */ - BONOBO_UI_VERB ("RefreshList", subscribe_refresh_list), - - BONOBO_UI_VERB_END -}; - -static void -set_pixmap (Bonobo_UIContainer container, - const char *xml_path, - const char *icon) -{ - char *path; - GdkPixbuf *pixbuf; - - path = g_concat_dir_and_file (EVOLUTION_DATADIR "/images/evolution/buttons", icon); - - pixbuf = gdk_pixbuf_new_from_file (path); - g_return_if_fail (pixbuf != NULL); - - bonobo_ui_util_set_pixbuf (container, xml_path, pixbuf); - - gdk_pixbuf_unref (pixbuf); - - g_free (path); -} - -static void -update_pixmaps (Bonobo_UIContainer container) -{ - set_pixmap (container, "/Toolbar/SubscribeFolder", "fetch-mail.png"); /* XXX */ - set_pixmap (container, "/Toolbar/UnsubscribeFolder", "compose-message.png"); /* XXX */ - set_pixmap (container, "/Toolbar/RefreshList", "forward.png"); /* XXX */ -} - -static GtkWidget* -make_folder_search_widget (GtkSignalFunc start_search_func, - gpointer user_data_for_search) -{ - GtkWidget *search_vbox = gtk_vbox_new (FALSE, 0); - GtkWidget *search_entry = gtk_entry_new (); - - if (start_search_func) { - gtk_signal_connect (GTK_OBJECT (search_entry), "activate", - start_search_func, - user_data_for_search); - } - - /* add the search entry to the our search_vbox */ - gtk_box_pack_start (GTK_BOX (search_vbox), search_entry, - FALSE, TRUE, 3); - gtk_box_pack_start (GTK_BOX (search_vbox), - gtk_label_new(_("Display Folders containing")), - FALSE, TRUE, 0); - - return search_vbox; -} - -static void -control_activate (BonoboControl *control, BonoboUIHandler *uih, - SubscribeControl *sc) -{ - GtkWidget *subscribe_control; - BonoboUIComponent *component; - Bonobo_UIContainer container; - GtkWidget *folder_search_widget; - BonoboControl *search_control; - - container = bonobo_control_get_remote_ui_handler (control); - bonobo_ui_handler_set_container (uih, container); - bonobo_object_release_unref (container, NULL); - - g_assert (container == bonobo_ui_compat_get_container (uih)); - g_return_if_fail (container != CORBA_OBJECT_NIL); - - subscribe_control = bonobo_control_get_widget (control); - - component = bonobo_ui_compat_get_component (uih); - bonobo_ui_component_add_verb_list_with_data ( - component, verbs, subscribe_control); - - bonobo_ui_container_freeze (container, NULL); - - bonobo_ui_util_set_ui ( - component, container, - EVOLUTION_DATADIR, "evolution-subscribe.xml", - "evolution-mail"); - - update_pixmaps (container); - - folder_search_widget = make_folder_search_widget (subscribe_search, sc); - gtk_widget_show_all (folder_search_widget); - search_control = bonobo_control_new (folder_search_widget); - - bonobo_ui_container_object_set (container, - "/Toolbar/FolderSearch", - bonobo_object_corba_objref (BONOBO_OBJECT (search_control)), - NULL); - - bonobo_ui_container_thaw (container, NULL); -} - -static void -control_deactivate (BonoboControl *control, - BonoboUIHandler *uih, - SubscribeControl *subscribe) -{ - g_warning ("In subscribe control_deactivate"); - bonobo_ui_component_rm ( - bonobo_ui_compat_get_component (uih), - bonobo_ui_compat_get_container (uih), "/", NULL); - - bonobo_ui_handler_unset_container (uih); -} - -static void -control_activate_cb (BonoboControl *control, - gboolean activate, - gpointer user_data) -{ - BonoboUIHandler *uih; - - uih = bonobo_control_get_ui_handler (control); - g_assert (uih); - - if (activate) - control_activate (control, uih, user_data); - else - control_deactivate (control, uih, user_data); -} - -static void -control_destroy_cb (BonoboControl *control, - gpointer user_data) -{ - GtkWidget *subscribe_control = user_data; - - control_list = g_list_remove (control_list, control); - - gtk_object_destroy (GTK_OBJECT (subscribe_control)); -} - -BonoboControl * -subscribe_control_factory_new_control (const char *uri, - const Evolution_Shell shell) -{ - BonoboControl *control; - GtkWidget *subscribe_control; - - subscribe_control = subscribe_control_new (shell); - if (subscribe_control == NULL) - return NULL; - - if (!subscribe_control_set_uri (SUBSCRIBE_CONTROL (subscribe_control), uri)) { - gtk_object_sink (GTK_OBJECT (subscribe_control)); - return NULL; - } - - gtk_widget_show (subscribe_control); - - control = bonobo_control_new (subscribe_control); - - if (control == NULL) { - gtk_object_destroy (GTK_OBJECT (subscribe_control)); - return NULL; - } - - gtk_signal_connect (GTK_OBJECT (control), "activate", - control_activate_cb, subscribe_control); - - gtk_signal_connect (GTK_OBJECT (control), "destroy", - control_destroy_cb, subscribe_control); - - control_list = g_list_prepend (control_list, control); - - return control; -} - -GList * -subscribe_control_factory_get_control_list (void) -{ - return control_list; -} diff --git a/mail/subscribe-control-factory.h b/mail/subscribe-control-factory.h deleted file mode 100644 index 7c1eaa0b18..0000000000 --- a/mail/subscribe-control-factory.h +++ /dev/null @@ -1,21 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * subscribe-control-factory.h: A Bonobo Control factory for Subscribe Controls - * - * Author: - * Chris Toshok (toshok@helixcode.com) - * - * (C) 2000 Helix Code, Inc. - */ - -#ifndef _SUBSCRIBE_CONTROL_FACTORY_H -#define _SUBSCRIBE_CONTROL_FACTORY_H - -#include <bonobo.h> -#include "Evolution.h" - -BonoboControl *subscribe_control_factory_new_control (const char *uri, - const Evolution_Shell shell); -GList *subscribe_control_factory_get_control_list (void); - -#endif /* _SUBSCRIBE_CONTROL_FACTORY_H */ diff --git a/mail/subscribe-control.c b/mail/subscribe-control.c index f3cb52f284..5204c10d6b 100644 --- a/mail/subscribe-control.c +++ b/mail/subscribe-control.c @@ -19,11 +19,22 @@ #include <gal/e-table/e-cell-toggle.h> #include <gal/e-table/e-table-scrolled.h> #include <gal/e-table/e-tree-simple.h> +#include <gal/e-paned/e-hpaned.h> +#include <bonobo/bonobo-main.h> +#include <bonobo/bonobo-object.h> +#include <bonobo/bonobo-generic-factory.h> +#include <bonobo/bonobo-control.h> +#include <bonobo/bonobo-ui-component.h> +#include <bonobo/bonobo-ui-util.h> #include "art/empty.xpm" #include "art/mark.xpm" -#define PARENT_TYPE (gtk_table_get_type ()) +#define DEFAULT_STORAGE_SET_WIDTH 150 +#define DEFAULT_WIDTH 500 +#define DEFAULT_HEIGHT 300 + +#define PARENT_TYPE (gtk_object_get_type ()) #define ETABLE_SPEC "<ETableSpecification> \ <columns-shown> \ @@ -61,13 +72,101 @@ typedef struct { static GtkObjectClass *subscribe_control_parent_class; -void +static void subscribe_close (BonoboUIHandler *uih, void *user_data, const char *path); +static void subscribe_select_all (BonoboUIHandler *uih, void *user_data, const char *path); +static void subscribe_unselect_all (BonoboUIHandler *uih, void *user_data, const char *path); +static void subscribe_folder (GtkWidget *widget, gpointer user_data); +static void unsubscribe_folder (GtkWidget *widget, gpointer user_data); +static void subscribe_refresh_list (GtkWidget *widget, gpointer user_data); +static void subscribe_search (GtkWidget *widget, gpointer user_data); + +static BonoboUIVerb verbs [] = { + /* File Menu */ + BONOBO_UI_VERB ("FileCloseWin", subscribe_close), + + /* Edit Menu */ + BONOBO_UI_VERB ("EditSelectAll", subscribe_select_all), + BONOBO_UI_VERB ("EditUnSelectAll", subscribe_unselect_all), + + /* Folder Menu / Toolbar */ + BONOBO_UI_VERB ("SubscribeFolder", subscribe_folder), + BONOBO_UI_VERB ("UnsubscribeFolder", unsubscribe_folder), + + /* Toolbar Specific */ + BONOBO_UI_VERB ("RefreshList", subscribe_refresh_list), + + BONOBO_UI_VERB_END +}; + +static void +set_pixmap (Bonobo_UIContainer container, + const char *xml_path, + const char *icon) +{ + char *path; + GdkPixbuf *pixbuf; + + path = g_concat_dir_and_file (EVOLUTION_DATADIR "/images/evolution/buttons", icon); + + pixbuf = gdk_pixbuf_new_from_file (path); + g_return_if_fail (pixbuf != NULL); + + bonobo_ui_util_set_pixbuf (container, xml_path, pixbuf); + + gdk_pixbuf_unref (pixbuf); + + g_free (path); +} + +static void +update_pixmaps (Bonobo_UIContainer container) +{ + set_pixmap (container, "/Toolbar/SubscribeFolder", "fetch-mail.png"); /* XXX */ + set_pixmap (container, "/Toolbar/UnsubscribeFolder", "compose-message.png"); /* XXX */ + set_pixmap (container, "/Toolbar/RefreshList", "forward.png"); /* XXX */ +} + +static GtkWidget* +make_folder_search_widget (GtkSignalFunc start_search_func, + gpointer user_data_for_search) +{ + GtkWidget *search_hbox = gtk_hbox_new (FALSE, 0); + GtkWidget *search_entry = gtk_entry_new (); + + if (start_search_func) { + gtk_signal_connect (GTK_OBJECT (search_entry), "activate", + start_search_func, + user_data_for_search); + } + + /* add the search entry to the our search_vbox */ + gtk_box_pack_start (GTK_BOX (search_hbox), + gtk_label_new(_("Display folders containing:")), + FALSE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (search_hbox), search_entry, + FALSE, TRUE, 3); + + return search_hbox; +} + + + +static void +subscribe_close (BonoboUIHandler *uih, + void *user_data, const char *path) +{ + SubscribeControl *sc = (SubscribeControl*)user_data; + + gtk_widget_destroy (sc->app); +} + +static void subscribe_select_all (BonoboUIHandler *uih, void *user_data, const char *path) { } -void +static void subscribe_unselect_all (BonoboUIHandler *uih, void *user_data, const char *path) { @@ -88,12 +187,12 @@ subscribe_folder_foreach (int model_row, gpointer closure) e_tree_model_node_changed (sc->model, node); } -void +static void subscribe_folder (GtkWidget *widget, gpointer user_data) { SubscribeControl *sc = SUBSCRIBE_CONTROL (user_data); - e_table_selected_row_foreach (E_TABLE_SCROLLED(sc->table)->table, + e_table_selected_row_foreach (E_TABLE_SCROLLED(sc->etable)->table, subscribe_folder_foreach, sc); } @@ -113,22 +212,22 @@ unsubscribe_folder_foreach (int model_row, gpointer closure) } -void +static void unsubscribe_folder (GtkWidget *widget, gpointer user_data) { SubscribeControl *sc = SUBSCRIBE_CONTROL (user_data); - e_table_selected_row_foreach (E_TABLE_SCROLLED(sc->table)->table, + e_table_selected_row_foreach (E_TABLE_SCROLLED(sc->etable)->table, unsubscribe_folder_foreach, sc); } -void +static void subscribe_refresh_list (GtkWidget *widget, gpointer user_data) { printf ("subscribe_refresh_list\n"); } -void +static void subscribe_search (GtkWidget *widget, gpointer user_data) { char* search_pattern = e_utf8_gtk_entry_get_text(GTK_ENTRY(widget)); @@ -138,14 +237,6 @@ subscribe_search (GtkWidget *widget, gpointer user_data) g_free (search_pattern); } -gboolean -subscribe_control_set_uri (SubscribeControl *subscribe_control, - const char *uri) -{ - printf ("set_uri (%s) called\n", uri); - return TRUE; -} - /* HTML Helpers */ static void @@ -296,12 +387,70 @@ subscribe_control_gui_init (SubscribeControl *sc) ECell *cells[3]; ETableHeader *e_table_header; GdkPixbuf *toggles[2]; + BonoboUIComponent *component; + Bonobo_UIContainer container; + GtkWidget *folder_search_widget; + BonoboControl *search_control; + GtkWidget *bonobo_win; + + /* Construct the app */ + bonobo_win = bonobo_win_new ("subscribe-dialog", "Subscribe"); + + sc->storage_set_view = gtk_label_new ("Storage Set View"); + sc->table = gtk_table_new (1, 2, FALSE); + + sc->hpaned = e_hpaned_new (); + e_paned_add1 (E_PANED (sc->hpaned), sc->storage_set_view); + e_paned_add2 (E_PANED (sc->hpaned), sc->table); + e_paned_set_position (E_PANED (sc->hpaned), DEFAULT_STORAGE_SET_WIDTH); + + bonobo_win_set_contents (BONOBO_WIN (bonobo_win), sc->hpaned); + gtk_widget_destroy (sc->app); + sc->app = bonobo_win; + + /* Build the menu and toolbar */ + sc->uih = bonobo_ui_handler_new (); + if (!sc->uih) { + g_message ("subscribe_control_gui_init(): eeeeek, could not create the UI handler!"); + return; + } + + bonobo_ui_handler_set_app (sc->uih, BONOBO_WIN (sc->app)); + + /* set up the bonobo stuff */ + component = bonobo_ui_compat_get_component (sc->uih); + container = bonobo_ui_compat_get_container (sc->uih); + + bonobo_ui_component_add_verb_list_with_data ( + component, verbs, sc); + + bonobo_ui_container_freeze (container, NULL); + bonobo_ui_util_set_ui (component, container, + EVOLUTION_DATADIR, + "evolution-subscribe.xml", + "evolution-subscribe"); + + update_pixmaps (container); + + folder_search_widget = make_folder_search_widget (subscribe_search, sc); + gtk_widget_show_all (folder_search_widget); + search_control = bonobo_control_new (folder_search_widget); + + bonobo_ui_container_object_set (container, + "/Toolbar/FolderSearch", + bonobo_object_corba_objref (BONOBO_OBJECT (search_control)), + NULL); + + bonobo_ui_container_thaw (container, NULL); + + + /* set our our contents */ sc->description = html_new (TRUE); put_html (GTK_HTML (sc->description), EXAMPLE_DESCR); gtk_table_attach ( - GTK_TABLE (sc), sc->description->parent->parent, + GTK_TABLE (sc->table), sc->description->parent->parent, 0, 1, 0, 1, GTK_FILL | GTK_EXPAND, 0, @@ -361,38 +510,38 @@ subscribe_control_gui_init (SubscribeControl *sc) e_table_header_add_column (e_table_header, ecol, i); } - sc->table = e_table_scrolled_new (e_table_header, E_TABLE_MODEL(sc->model), ETABLE_SPEC); + sc->etable = e_table_scrolled_new (e_table_header, E_TABLE_MODEL(sc->model), ETABLE_SPEC); - gtk_object_set (GTK_OBJECT (E_TABLE_SCROLLED (sc->table)->table), + gtk_object_set (GTK_OBJECT (E_TABLE_SCROLLED (sc->etable)->table), "cursor_mode", E_TABLE_CURSOR_LINE, NULL); gtk_table_attach ( - GTK_TABLE (sc), sc->table, + GTK_TABLE (sc->table), sc->etable, 0, 1, 1, 3, GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 0, 0); - - gtk_widget_show (GTK_WIDGET (sc->table)); - gtk_widget_show (GTK_WIDGET(sc)); + + gtk_widget_show (sc->description); + gtk_widget_show (sc->etable); + gtk_widget_show (sc->table); + gtk_widget_show (sc->storage_set_view); + gtk_widget_show (sc->hpaned); + + /* FIXME: Session management and stuff? */ + gtk_window_set_default_size ( + GTK_WINDOW (sc->app), + DEFAULT_WIDTH, DEFAULT_HEIGHT); } static void subscribe_control_destroy (GtkObject *object) { SubscribeControl *subscribe_control; - CORBA_Environment ev; subscribe_control = SUBSCRIBE_CONTROL (object); - CORBA_exception_init (&ev); - - if (subscribe_control->shell != CORBA_OBJECT_NIL) - CORBA_Object_release (subscribe_control->shell, &ev); - - CORBA_exception_free (&ev); - subscribe_control_parent_class->destroy (object); } @@ -415,12 +564,6 @@ subscribe_control_construct (GtkObject *object) SubscribeControl *sc = SUBSCRIBE_CONTROL (object); /* - * Setup parent class fields. - */ - GTK_TABLE (sc)->homogeneous = FALSE; - gtk_table_resize (GTK_TABLE (sc), 1, 2); - - /* * Our instance data */ @@ -428,31 +571,15 @@ subscribe_control_construct (GtkObject *object) } GtkWidget * -subscribe_control_new (const Evolution_Shell shell) +subscribe_control_new () { - static int serial = 0; - CORBA_Environment ev; SubscribeControl *subscribe_control; - CORBA_exception_init (&ev); - subscribe_control = gtk_type_new (subscribe_control_get_type ()); subscribe_control_construct (GTK_OBJECT (subscribe_control)); - subscribe_control->uri = NULL; - subscribe_control->serial = serial++; - - subscribe_control->shell = CORBA_Object_duplicate (shell, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - subscribe_control->shell = CORBA_OBJECT_NIL; - gtk_widget_destroy (GTK_WIDGET (subscribe_control)); - CORBA_exception_free (&ev); - return NULL; - } - - CORBA_exception_free (&ev); - return GTK_WIDGET (subscribe_control); + return GTK_WIDGET (subscribe_control->app); } E_MAKE_TYPE (subscribe_control, "SubscribeControl", SubscribeControl, subscribe_control_class_init, subscribe_control_init, PARENT_TYPE); diff --git a/mail/subscribe-control.h b/mail/subscribe-control.h index 1822f32980..18a47dd73e 100644 --- a/mail/subscribe-control.h +++ b/mail/subscribe-control.h @@ -7,7 +7,7 @@ #include "mail-types.h" #include <gtk/gtktable.h> #include <gal/e-table/e-tree-model.h> -#include <bonobo/bonobo-ui-handler.h> +#include <bonobo/bonobo-ui-compat.h> #include <bonobo/bonobo-property-bag.h> #include "shell/Evolution.h" @@ -19,44 +19,27 @@ #define IS_SUBSCRIBE_CONTROL_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), SUBSCRIBE_CONTROL_TYPE)) struct _SubscribeControl { - GtkTable parent; - - BonoboPropertyBag *properties; - - Evolution_Shell shell; - - /* This is a kludge for the toolbar problem. */ - int serial; + GtkObject parent; - /* - * The current URI being displayed by the SubscribeControl - */ - char *uri; - gboolean is_news; + BonoboUIHandler *uih; - GtkWidget *description; + GtkWidget *app; + + GtkWidget *storage_set_view; + GtkWidget *hpaned; GtkWidget *table; + GtkWidget *description; + GtkWidget *etable; ETreeModel *model; ETreePath *root; }; typedef struct { - GtkTableClass parent_class; + GtkObjectClass parent_class; } SubscribeControlClass; GtkType subscribe_control_get_type (void); -GtkWidget *subscribe_control_new (const Evolution_Shell shell); - -gboolean subscribe_control_set_uri (SubscribeControl *subscribe_control, - const char *uri); - -/* menu/toolbar callbacks */ -void subscribe_select_all (BonoboUIHandler *uih, void *user_data, const char *path); -void subscribe_unselect_all (BonoboUIHandler *uih, void *user_data, const char *path); -void subscribe_folder (GtkWidget *widget, gpointer user_data); -void unsubscribe_folder (GtkWidget *widget, gpointer user_data); -void subscribe_refresh_list (GtkWidget *widget, gpointer user_data); -void subscribe_search (GtkWidget *widget, gpointer user_data); +GtkWidget *subscribe_control_new (void); #endif /* _SUBSCRIBE_CONTROL_H_ */ |