aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2003-12-02 12:53:57 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2003-12-02 12:53:57 +0800
commit215a9c0ea3cb222004ff8842b663ea7a77dcb3e5 (patch)
tree3b0e35a8102377c807ad33063082a5b9a9f7813a /addressbook
parentd904b8e0d8f1702e4a32989f0fb0a4c2ba872d29 (diff)
downloadgsoc2013-evolution-215a9c0ea3cb222004ff8842b663ea7a77dcb3e5.tar.gz
gsoc2013-evolution-215a9c0ea3cb222004ff8842b663ea7a77dcb3e5.tar.zst
gsoc2013-evolution-215a9c0ea3cb222004ff8842b663ea7a77dcb3e5.zip
Replace activity_client with activity_id. (set_status_message): Use the
* gui/component/addressbook.c (struct AddressbookView): Replace activity_client with activity_id. (set_status_message): Use the EActivityHandler from the AddressbookComponent. * gui/component/addressbook-component.c (struct _AddressbookComponentPrivate): New member activity_handler. (addressbook_component_init): Init. (impl_dispose): Unref. (addressbook_component_peek_activity_handler): New. (impl_createControls): Return an ETaskBar as the statusbar control and attach it to the activity handler. svn path=/trunk/; revision=23560
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/ChangeLog15
-rw-r--r--addressbook/gui/component/addressbook-component.c41
-rw-r--r--addressbook/gui/component/addressbook-component.h3
-rw-r--r--addressbook/gui/component/addressbook.c32
4 files changed, 62 insertions, 29 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 81713aab1b..da9e784c97 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,5 +1,20 @@
2003-12-01 Ettore Perazzoli <ettore@ximian.com>
+ * gui/component/addressbook.c (struct AddressbookView): Replace
+ activity_client with activity_id.
+ (set_status_message): Use the EActivityHandler from the
+ AddressbookComponent.
+
+ * gui/component/addressbook-component.c (struct
+ _AddressbookComponentPrivate): New member activity_handler.
+ (addressbook_component_init): Init.
+ (impl_dispose): Unref.
+ (addressbook_component_peek_activity_handler): New.
+ (impl_createControls): Return an ETaskBar as the statusbar control
+ and attach it to the activity handler.
+
+2003-12-01 Ettore Perazzoli <ettore@ximian.com>
+
* gui/component/addressbook-component.c (impl_createControls):
Pass a label for the status bar control for now.
diff --git a/addressbook/gui/component/addressbook-component.c b/addressbook/gui/component/addressbook-component.c
index 306a1f6e2b..803ed82d55 100644
--- a/addressbook/gui/component/addressbook-component.c
+++ b/addressbook/gui/component/addressbook-component.c
@@ -33,6 +33,8 @@
#include "widgets/misc/e-source-selector.h"
#include "addressbook/gui/widgets/eab-gui-util.h"
+#include "e-task-bar.h"
+
#include <string.h>
#include <bonobo/bonobo-i18n.h>
#include <gtk/gtkscrolledwindow.h>
@@ -53,6 +55,8 @@ struct _AddressbookComponentPrivate {
GConfClient *gconf_client;
ESourceList *source_list;
GtkWidget *source_selector;
+
+ EActivityHandler *activity_handler;
};
@@ -156,8 +160,10 @@ impl_createControls (PortableServer_Servant servant,
AddressbookComponent *addressbook_component = ADDRESSBOOK_COMPONENT (bonobo_object_from_servant (servant));
GtkWidget *selector;
GtkWidget *selector_scrolled_window;
+ GtkWidget *statusbar_widget;
BonoboControl *sidebar_control;
BonoboControl *view_control;
+ BonoboControl *statusbar_control;
selector = e_source_selector_new (addressbook_component->priv->source_list);
e_source_selector_show_selection (E_SOURCE_SELECTOR (selector), FALSE);
@@ -183,18 +189,16 @@ impl_createControls (PortableServer_Servant servant,
G_OBJECT (addressbook_component), 0);
load_uri_for_selection (E_SOURCE_SELECTOR (selector), view_control);
- *corba_sidebar_control = CORBA_Object_duplicate (BONOBO_OBJREF (sidebar_control), ev);
- *corba_view_control = CORBA_Object_duplicate (BONOBO_OBJREF (view_control), ev);
+ statusbar_widget = e_task_bar_new ();
+ gtk_widget_show (statusbar_widget);
+ statusbar_control = bonobo_control_new (statusbar_widget);
- /* FIXME temporary for testing. */
- {
- GtkWidget *label = gtk_label_new ("Hey hey this is the addressbook");
- BonoboControl *control;
+ e_activity_handler_attach_task_bar (addressbook_component->priv->activity_handler,
+ E_TASK_BAR (statusbar_widget));
- gtk_widget_show (label);
- control = bonobo_control_new (label);
- *corba_statusbar_control = CORBA_Object_duplicate (BONOBO_OBJREF (control), ev);
- }
+ *corba_sidebar_control = CORBA_Object_duplicate (BONOBO_OBJREF (sidebar_control), ev);
+ *corba_view_control = CORBA_Object_duplicate (BONOBO_OBJREF (view_control), ev);
+ *corba_statusbar_control = CORBA_Object_duplicate (BONOBO_OBJREF (statusbar_control), ev);
}
static GNOME_Evolution_CreatableItemTypeList *
@@ -300,6 +304,11 @@ impl_dispose (GObject *object)
priv->gconf_client = NULL;
}
+ if (priv->activity_handler != NULL) {
+ g_object_unref (priv->activity_handler);
+ priv->activity_handler = NULL;
+ }
+
(* G_OBJECT_CLASS (parent_class)->dispose) (object);
}
@@ -347,6 +356,8 @@ addressbook_component_init (AddressbookComponent *component)
priv->source_list = e_source_list_new_for_gconf (priv->gconf_client,
"/apps/evolution/addressbook/sources");
+ priv->activity_handler = e_activity_handler_new ();
+
/* Create default addressbooks if there are no groups */
groups = e_source_list_peek_groups (priv->source_list);
if (!groups) {
@@ -407,4 +418,14 @@ addressbook_component_peek (void)
return component;
}
+
+EActivityHandler *
+addressbook_component_peek_activity_handler (AddressbookComponent *component)
+{
+ g_return_val_if_fail (ADDRESSBOOK_IS_COMPONENT (component), NULL);
+
+ return component->priv->activity_handler;
+}
+
+
BONOBO_TYPE_FUNC_FULL (AddressbookComponent, GNOME_Evolution_Component, PARENT_TYPE, addressbook_component)
diff --git a/addressbook/gui/component/addressbook-component.h b/addressbook/gui/component/addressbook-component.h
index bf72a431d8..f08f54aaaf 100644
--- a/addressbook/gui/component/addressbook-component.h
+++ b/addressbook/gui/component/addressbook-component.h
@@ -26,6 +26,7 @@
#include <bonobo/bonobo-object.h>
#include "Evolution.h"
+#include "e-activity-handler.h"
#define ADDRESSBOOK_TYPE_COMPONENT (addressbook_component_get_type ())
#define ADDRESSBOOK_COMPONENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ADDRESSBOOK_TYPE_COMPONENT, AddressbookComponent))
@@ -55,5 +56,7 @@ GType addressbook_component_get_type (void);
AddressbookComponent *addressbook_component_peek (void);
+EActivityHandler *addressbook_component_peek_activity_handler (AddressbookComponent *component);
+
#endif /* _ADDRESSBOOK_COMPONENT_H_ */
diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c
index 8e8dfa8f5f..e1eb92e9ad 100644
--- a/addressbook/gui/component/addressbook.c
+++ b/addressbook/gui/component/addressbook.c
@@ -42,7 +42,7 @@
#include "e-util/e-passwords.h"
#include "evolution-shell-component-utils.h"
-#include "evolution-activity-client.h"
+#include "e-activity-handler.h"
#include "e-contact-editor.h"
#include "addressbook-config.h"
#include "addressbook.h"
@@ -59,7 +59,7 @@
/* This is used for the addressbook status bar */
#define EVOLUTION_CONTACTS_PROGRESS_IMAGE "evolution-contacts-mini.png"
-static GdkPixbuf *progress_icon[2] = { NULL, NULL };
+static GdkPixbuf *progress_icon = NULL;
#define d(x)
@@ -74,7 +74,7 @@ typedef struct {
gint ecml_changed_id;
GtkWidget *vbox;
EBook *book;
- EvolutionActivityClient *activity;
+ guint activity_id;
BonoboControl *control;
BonoboPropertyBag *properties;
GConfClient *gconf_client;
@@ -913,29 +913,23 @@ retrieve_shell_view_interface_from_control (BonoboControl *control)
static void
set_status_message (EABView *eav, const char *message, AddressbookView *view)
{
+ EActivityHandler *activity_handler = addressbook_component_peek_activity_handler (addressbook_component_peek ());
if (!message || !*message) {
- if (view->activity) {
- g_object_unref (view->activity);
- view->activity = NULL;
- }
- }
-#if 0 /* EPFIXME */
- else if (!view->activity) {
- int display;
+ if (view->activity_id != 0)
+ view->activity_id = 0;
+ } else if (view->activity_id == 0) {
char *clientid = g_strdup_printf ("%p", view);
- if (progress_icon[0] == NULL)
- progress_icon[0] = gdk_pixbuf_new_from_file (EVOLUTION_IMAGESDIR "/" EVOLUTION_CONTACTS_PROGRESS_IMAGE, NULL);
+ if (progress_icon == NULL)
+ progress_icon = gdk_pixbuf_new_from_file (EVOLUTION_IMAGESDIR "/" EVOLUTION_CONTACTS_PROGRESS_IMAGE, NULL);
- view->activity = evolution_activity_client_new (addressbook_component_get_shell_client(), clientid,
- progress_icon, message, TRUE, &display);
+ view->activity_id = e_activity_handler_operation_started (activity_handler, clientid,
+ progress_icon, message, TRUE);
g_free (clientid);
- }
-#endif
- else {
- evolution_activity_client_update (view->activity, message, -1.0);
+ } else {
+ e_activity_handler_operation_progressing (activity_handler, view->activity_id, message, -1.0);
}
}