aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLarry Ewing <lewing@ximian.com>2004-01-13 00:51:55 +0800
committerLarry Ewing <lewing@src.gnome.org>2004-01-13 00:51:55 +0800
commit922de49f1d4cdb6fe0044fd19d11f8ed5391a4fb (patch)
tree0fc7421b4e68123a10cda6898f1eadc1b82a9668
parentb84544d2cc122d6afc2721eb2a1366a6e3f2ba9c (diff)
downloadgsoc2013-evolution-922de49f1d4cdb6fe0044fd19d11f8ed5391a4fb.tar.gz
gsoc2013-evolution-922de49f1d4cdb6fe0044fd19d11f8ed5391a4fb.tar.zst
gsoc2013-evolution-922de49f1d4cdb6fe0044fd19d11f8ed5391a4fb.zip
fix up the controls factory location.
2004-01-12 Larry Ewing <lewing@ximian.com> * GNOME_Evolution_Mail.server.in.in: fix up the controls factory location. * mail-component.c (mail_control_new): add new interface for getting a mail control with a folder_uri property bag. (get_prop): pbag get method. (set_prop): pbag set method. svn path=/trunk/; revision=24171
-rw-r--r--mail/ChangeLog10
-rw-r--r--mail/GNOME_Evolution_Mail.server.in.in30
-rw-r--r--mail/mail-component.c79
3 files changed, 104 insertions, 15 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 3de054e03f..ddb65d5891 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,13 @@
+2004-01-12 Larry Ewing <lewing@ximian.com>
+
+ * GNOME_Evolution_Mail.server.in.in: fix up the controls factory
+ location.
+
+ * mail-component.c (mail_control_new): add new interface for
+ getting a mail control with a folder_uri property bag.
+ (get_prop): pbag get method.
+ (set_prop): pbag set method.
+
2004-01-11 Jeffrey Stedfast <fejj@ximian.com>
* em-migrate.c (cp): Don't O_TRUNC the dest file, instead use
diff --git a/mail/GNOME_Evolution_Mail.server.in.in b/mail/GNOME_Evolution_Mail.server.in.in
index 36e48bce0d..d482615e30 100644
--- a/mail/GNOME_Evolution_Mail.server.in.in
+++ b/mail/GNOME_Evolution_Mail.server.in.in
@@ -15,20 +15,6 @@
_value="Evolution Mail"/>
</oaf_server>
- <!-- (control) -->
- <oaf_server iid="OAFIID:GNOME_Evolution_Mail_Control:@VERSION@"
- type="factory"
- location="OAFIID:GNOME_Evolution_Mail_ControlFactory:@VERSION@">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:BonoboControl/evolution-mail:@VERSION@"/>
- <item value="IDL:GNOME/Control:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution Mail folder viewer"/>
- </oaf_server>
-
<!-- Component Interface -->
<oaf_server iid="OAFIID:GNOME_Evolution_Mail_Component:@VERSION@"
@@ -90,8 +76,22 @@
_value="Evolution Mail composer"/>
</oaf_server>
- <!-- Startup Wizard -->
+ <!-- (control) -->
+ <oaf_server iid="OAFIID:GNOME_Evolution_Mail_Control:@VERSION@"
+ type="factory"
+ location="OAFIID:GNOME_Evolution_Mail_Factory:@VERSION@">
+
+ <oaf_attribute name="repo_ids" type="stringv">
+ <item value="IDL:BonoboControl/evolution-mail-control:@VERSION@"/>
+ <item value="IDL:GNOME/Control:1.0"/>
+ </oaf_attribute>
+ <oaf_attribute name="name" type="string"
+ _value="Evolution Mail folder viewer"/>
+
+ </oaf_server>
+
+ <!-- Startup Wizard -->
<!-- (wizard) -->
<oaf_server iid="OAFIID:GNOME_Evolution_Mail_Wizard:@VERSION@"
type="factory"
diff --git a/mail/mail-component.c b/mail/mail-component.c
index 00715d7970..1faa15068d 100644
--- a/mail/mail-component.c
+++ b/mail/mail-component.c
@@ -235,6 +235,55 @@ folder_selected_cb (EMFolderTree *emft, const char *path, const char *uri, EMFol
em_folder_view_set_folder_uri (view, uri);
}
+#define PROPERTY_FOLDER_URI "folder_uri"
+#define PROPERTY_FOLDER_URI_IDX 1
+
+static void
+set_prop (BonoboPropertyBag *bag,
+ const BonoboArg *arg,
+ guint arg_id,
+ CORBA_Environment *ev,
+ gpointer user_data)
+{
+ EMFolderView *view = (EMFolderView *)bonobo_control_get_widget (user_data);
+ const gchar *uri;
+
+ switch (arg_id) {
+ case PROPERTY_FOLDER_URI_IDX:
+ uri = BONOBO_ARG_GET_STRING (arg);
+
+ g_warning ("XXX setting uri blah=\"%s\"\n", uri);
+
+ em_folder_view_set_folder_uri (view, uri);
+ break;
+ default:
+ g_warning ("Unhandled arg %d\n", arg_id);
+ break;
+ }
+}
+
+static void
+get_prop (BonoboPropertyBag *bag,
+ BonoboArg *arg,
+ guint arg_id,
+ CORBA_Environment *ev,
+ gpointer user_data)
+{
+ GtkWidget *widget = bonobo_control_get_widget (user_data);
+ EMFolderView *view = (EMFolderView *)widget;
+
+ switch (arg_id) {
+ case PROPERTY_FOLDER_URI_IDX:
+ if (view->folder_uri)
+ BONOBO_ARG_SET_STRING (arg, view->folder_uri);
+ else
+ BONOBO_ARG_SET_STRING (arg, "");
+ break;
+ default:
+ g_warning ("Unhandled arg %d\n", arg_id);
+ }
+}
+
static void
view_control_activate_cb (BonoboControl *control, gboolean activate, EMFolderView *view)
{
@@ -512,6 +561,36 @@ mail_component_init (MailComponent *component)
/* Public API. */
+BonoboControl *
+mail_control_new (void)
+{
+ BonoboControl *view_control;
+ GtkWidget *view_widget;
+ BonoboPropertyBag *pbag;
+
+ view_widget = em_folder_browser_new ();
+ gtk_widget_show (view_widget);
+
+ view_control = bonobo_control_new (view_widget);
+ pbag = bonobo_property_bag_new (get_prop, set_prop, view_control);
+
+ bonobo_property_bag_add (pbag,
+ PROPERTY_FOLDER_URI,
+ PROPERTY_FOLDER_URI_IDX,
+ BONOBO_ARG_STRING,
+ NULL,
+ _("URI of the mail source that the view will display"),
+ 0);
+
+ bonobo_control_set_properties (view_control,
+ bonobo_object_corba_objref (BONOBO_OBJECT (pbag)),
+ NULL);
+ bonobo_object_unref (BONOBO_OBJECT (pbag));
+
+ g_signal_connect (view_control, "activate", G_CALLBACK (view_control_activate_cb), view_widget);
+
+ return view_control;
+}
MailComponent *
mail_component_peek (void)