diff options
author | Dan Winship <danw@src.gnome.org> | 2000-06-13 03:29:17 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2000-06-13 03:29:17 +0800 |
commit | 860fb187ffb12a9373394b063826a9a3b01cf9b0 (patch) | |
tree | fa888ed69c56994497fcfda8d226039e42c93d78 /mail/folder-browser.c | |
parent | 0931d27d61aa9f0ccc579be8d4c7b3c56bdd684f (diff) | |
download | gsoc2013-evolution-860fb187ffb12a9373394b063826a9a3b01cf9b0.tar gsoc2013-evolution-860fb187ffb12a9373394b063826a9a3b01cf9b0.tar.gz gsoc2013-evolution-860fb187ffb12a9373394b063826a9a3b01cf9b0.tar.bz2 gsoc2013-evolution-860fb187ffb12a9373394b063826a9a3b01cf9b0.tar.lz gsoc2013-evolution-860fb187ffb12a9373394b063826a9a3b01cf9b0.tar.xz gsoc2013-evolution-860fb187ffb12a9373394b063826a9a3b01cf9b0.tar.zst gsoc2013-evolution-860fb187ffb12a9373394b063826a9a3b01cf9b0.zip |
Return the result of folder_browser_load_folder. (get_prop, set_prop,
* folder-browser.c (folder_browser_set_uri): Return the result of
folder_browser_load_folder.
(get_prop, set_prop, folder_browser_properties_init): Remove. No
longer needed.
* folder-browser-factory.c (folder_browser_factory_new_control):
Add a "uri" argument, return NULL if setting it fails.
(folder_browser_factory_new_control): Remove property bag stuff.
(folder_browser_factory_init, folder_browser_factory): Remove
this, since we're using the component factory now.
* component-factory.c (create_view): Update for
folder_browser_factory_new_control change and return NOTFOUND as
appropriate.
* main.c (main): Don't call folder_browser_factory_init.
svn path=/trunk/; revision=3532
Diffstat (limited to 'mail/folder-browser.c')
-rw-r--r-- | mail/folder-browser.c | 77 |
1 files changed, 2 insertions, 75 deletions
diff --git a/mail/folder-browser.c b/mail/folder-browser.c index efb1deaa9e..7a6b751842 100644 --- a/mail/folder-browser.c +++ b/mail/folder-browser.c @@ -21,14 +21,6 @@ static GtkObjectClass *folder_browser_parent_class; -#define PROPERTY_FOLDER_URI "folder_uri" -#define PROPERTY_MESSAGE_PREVIEW "message_preview" - -#define PROPERTY_FOLDER_URI_IDX 1 -#define PROPERTY_MESSAGE_PREVIEW_IDX 2 - - - static void folder_browser_destroy (GtkObject *object) { @@ -151,14 +143,14 @@ folder_browser_load_folder (FolderBrowser *fb, const char *name) #define EQUAL(a,b) (strcmp (a,b) == 0) -void +gboolean folder_browser_set_uri (FolderBrowser *folder_browser, const char *uri) { if (folder_browser->uri) g_free (folder_browser->uri); folder_browser->uri = g_strdup (uri); - folder_browser_load_folder (folder_browser, folder_browser->uri); + return folder_browser_load_folder (folder_browser, folder_browser->uri); } void @@ -170,70 +162,6 @@ folder_browser_set_message_preview (FolderBrowser *folder_browser, gboolean show g_warning ("FIXME: implement me"); } -static void -get_prop (BonoboPropertyBag *bag, - BonoboArg *arg, - guint arg_id, - gpointer user_data) -{ - FolderBrowser *fb = user_data; - - switch (arg_id) { - - case PROPERTY_FOLDER_URI_IDX: - if (fb && fb->uri) - BONOBO_ARG_SET_STRING (arg, fb->uri); - else - BONOBO_ARG_SET_STRING (arg, ""); - break; - - case PROPERTY_MESSAGE_PREVIEW_IDX: - g_warning ("Implement me; no return value"); - BONOBO_ARG_SET_BOOLEAN (arg, FALSE); - break; - - default: - g_warning ("Unhandled arg %d\n", arg_id); - } -} - -static void -set_prop (BonoboPropertyBag *bag, - const BonoboArg *arg, - guint arg_id, - gpointer user_data) -{ - FolderBrowser *fb = user_data; - - switch (arg_id) { - - case PROPERTY_FOLDER_URI_IDX: - folder_browser_set_uri (fb, BONOBO_ARG_GET_STRING (arg)); - break; - - case PROPERTY_MESSAGE_PREVIEW_IDX: - folder_browser_set_message_preview (fb, BONOBO_ARG_GET_BOOLEAN (arg)); - break; - - default: - g_warning ("Unhandled arg %d\n", arg_id); - break; - } -} - -static void -folder_browser_properties_init (FolderBrowser *fb) -{ - fb->properties = bonobo_property_bag_new (get_prop, set_prop, fb); - - bonobo_property_bag_add ( - fb->properties, PROPERTY_FOLDER_URI, PROPERTY_FOLDER_URI_IDX, - BONOBO_ARG_STRING, NULL, _("The URI that the Folder Browser will display"), 0); - bonobo_property_bag_add ( - fb->properties, PROPERTY_MESSAGE_PREVIEW, PROPERTY_MESSAGE_PREVIEW_IDX, - BONOBO_ARG_BOOLEAN, NULL, _("Whether a message preview should be shown"), 0); -} - static char * search_options[] = { "Body or subject contains", "Body contains", @@ -439,7 +367,6 @@ my_folder_browser_init (GtkObject *object) gtk_signal_connect (GTK_OBJECT (fb->message_list->etable), "key_press", GTK_SIGNAL_FUNC (etable_key), fb); - folder_browser_properties_init (fb); folder_browser_gui_init (fb); } |