aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-03-02 03:30:14 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-03-02 07:16:07 +0800
commit4ff90f2bfd95337040616cae4b3bdddff033b5d6 (patch)
tree37d3acd7835e4366cc367dc904e43915c7c11f9b /calendar
parent977be20ced747224c0e08d565f961f0fa8d0baf8 (diff)
downloadgsoc2013-evolution-4ff90f2bfd95337040616cae4b3bdddff033b5d6.tar
gsoc2013-evolution-4ff90f2bfd95337040616cae4b3bdddff033b5d6.tar.gz
gsoc2013-evolution-4ff90f2bfd95337040616cae4b3bdddff033b5d6.tar.bz2
gsoc2013-evolution-4ff90f2bfd95337040616cae4b3bdddff033b5d6.tar.lz
gsoc2013-evolution-4ff90f2bfd95337040616cae4b3bdddff033b5d6.tar.xz
gsoc2013-evolution-4ff90f2bfd95337040616cae4b3bdddff033b5d6.tar.zst
gsoc2013-evolution-4ff90f2bfd95337040616cae4b3bdddff033b5d6.zip
Use EClientComboBox where appropriate.
Basically any place where we use both EClient and ESourceComboBox.
Diffstat (limited to 'calendar')
-rw-r--r--calendar/gui/dialogs/alarm-dialog.c12
-rw-r--r--calendar/gui/dialogs/alarm-dialog.h4
-rw-r--r--calendar/gui/dialogs/alarm-list-dialog.c17
-rw-r--r--calendar/gui/dialogs/alarm-list-dialog.h6
-rw-r--r--calendar/gui/dialogs/e-delegate-dialog.c12
-rw-r--r--calendar/gui/dialogs/e-delegate-dialog.h7
-rw-r--r--calendar/gui/dialogs/event-page.c71
-rw-r--r--calendar/gui/dialogs/event-page.ui4
-rw-r--r--calendar/gui/dialogs/memo-page.c59
-rw-r--r--calendar/gui/dialogs/memo-page.ui4
-rw-r--r--calendar/gui/dialogs/task-page.c58
-rw-r--r--calendar/gui/dialogs/task-page.ui2
-rw-r--r--calendar/gui/e-meeting-list-view.c6
13 files changed, 124 insertions, 138 deletions
diff --git a/calendar/gui/dialogs/alarm-dialog.c b/calendar/gui/dialogs/alarm-dialog.c
index d88fd12fb6..42411f9af7 100644
--- a/calendar/gui/dialogs/alarm-dialog.c
+++ b/calendar/gui/dialogs/alarm-dialog.c
@@ -35,8 +35,6 @@
#include <libical/icalattach.h>
-#include "e-util/e-util.h"
-
#include "../calendar-config.h"
#include "comp-editor-util.h"
#include "alarm-dialog.h"
@@ -50,7 +48,7 @@ typedef struct {
/* The client */
ECalClient *cal_client;
- ESourceRegistry *registry;
+ EClientCache *client_cache;
/* Toplevel */
GtkWidget *toplevel;
@@ -911,7 +909,7 @@ setup_select_names (Dialog *dialog)
ENameSelectorModel *name_selector_model;
ENameSelectorDialog *name_selector_dialog;
- dialog->name_selector = e_name_selector_new (dialog->registry);
+ dialog->name_selector = e_name_selector_new (dialog->client_cache);
e_name_selector_load_books (dialog->name_selector);
name_selector_model = e_name_selector_peek_model (dialog->name_selector);
@@ -1216,7 +1214,7 @@ init_widgets (Dialog *dialog)
gboolean
alarm_dialog_run (GtkWidget *parent,
- ESourceRegistry *registry,
+ EClientCache *client_cache,
ECalClient *cal_client,
ECalComponentAlarm *alarm)
{
@@ -1224,12 +1222,12 @@ alarm_dialog_run (GtkWidget *parent,
GtkWidget *container;
gint response_id;
- g_return_val_if_fail (E_IS_SOURCE_REGISTRY (registry), FALSE);
+ g_return_val_if_fail (E_IS_CLIENT_CACHE (client_cache), FALSE);
g_return_val_if_fail (alarm != NULL, FALSE);
dialog.alarm = alarm;
dialog.cal_client = cal_client;
- dialog.registry = registry;
+ dialog.client_cache = client_cache;
dialog.builder = gtk_builder_new ();
e_load_ui_builder_definition (dialog.builder, "alarm-dialog.ui");
diff --git a/calendar/gui/dialogs/alarm-dialog.h b/calendar/gui/dialogs/alarm-dialog.h
index 79c85bf18b..14653b3334 100644
--- a/calendar/gui/dialogs/alarm-dialog.h
+++ b/calendar/gui/dialogs/alarm-dialog.h
@@ -32,10 +32,12 @@
#include <libecal/libecal.h>
+#include <e-util/e-util.h>
+
G_BEGIN_DECLS
gboolean alarm_dialog_run (GtkWidget *parent,
- ESourceRegistry *registry,
+ EClientCache *client_cache,
ECalClient *cal_client,
ECalComponentAlarm *alarm);
diff --git a/calendar/gui/dialogs/alarm-list-dialog.c b/calendar/gui/dialogs/alarm-list-dialog.c
index 78c53a32a6..ea17b92d0d 100644
--- a/calendar/gui/dialogs/alarm-list-dialog.c
+++ b/calendar/gui/dialogs/alarm-list-dialog.c
@@ -34,14 +34,13 @@
#include <gtk/gtk.h>
#include <glib/gi18n.h>
-#include "e-util/e-util.h"
#include "e-util/e-util-private.h"
#include "alarm-dialog.h"
#include "alarm-list-dialog.h"
typedef struct {
GtkBuilder *builder;
- ESourceRegistry *registry;
+ EClientCache *client_cache;
/* The client */
ECalClient *cal_client;
@@ -125,7 +124,7 @@ add_clicked_cb (GtkButton *button,
icalproperty_set_x_name (icalprop, "X-EVOLUTION-NEEDS-DESCRIPTION");
icalcomponent_add_property (icalcomp, icalprop);
- if (alarm_dialog_run (dialog->toplevel, dialog->registry, dialog->cal_client, alarm)) {
+ if (alarm_dialog_run (dialog->toplevel, dialog->client_cache, dialog->cal_client, alarm)) {
e_alarm_list_append (dialog->list_store, &iter, alarm);
gtk_tree_selection_select_iter (gtk_tree_view_get_selection (view), &iter);
} else {
@@ -158,7 +157,7 @@ edit_clicked_cb (GtkButton *button,
alarm = (ECalComponentAlarm *) e_alarm_list_get_alarm (dialog->list_store, &iter);
path = gtk_tree_model_get_path (GTK_TREE_MODEL (dialog->list_store), &iter);
- if (alarm_dialog_run (dialog->toplevel, dialog->registry, dialog->cal_client, alarm)) {
+ if (alarm_dialog_run (dialog->toplevel, dialog->client_cache, dialog->cal_client, alarm)) {
gtk_tree_selection_select_iter (gtk_tree_view_get_selection (view), &iter);
gtk_tree_model_row_changed (GTK_TREE_MODEL (dialog->list_store), path, &iter);
}
@@ -264,7 +263,7 @@ init_widgets (Dialog *dialog)
gboolean
alarm_list_dialog_run (GtkWidget *parent,
- ESourceRegistry *registry,
+ EClientCache *client_cache,
ECalClient *cal_client,
EAlarmList *list_store)
{
@@ -272,9 +271,9 @@ alarm_list_dialog_run (GtkWidget *parent,
GtkWidget *container;
gint response_id;
- g_return_val_if_fail (E_IS_SOURCE_REGISTRY (registry), FALSE);
+ g_return_val_if_fail (E_IS_CLIENT_CACHE (client_cache), FALSE);
- dialog.registry = registry;
+ dialog.client_cache = client_cache;
dialog.cal_client = cal_client;
dialog.list_store = list_store;
@@ -315,14 +314,14 @@ alarm_list_dialog_run (GtkWidget *parent,
}
GtkWidget *
-alarm_list_dialog_peek (ESourceRegistry *registry,
+alarm_list_dialog_peek (EClientCache *client_cache,
ECalClient *cal_client,
EAlarmList *list_store)
{
Dialog *dialog;
dialog = (Dialog *) g_new (Dialog, 1);
- dialog->registry = registry;
+ dialog->client_cache = client_cache;
dialog->cal_client = cal_client;
dialog->list_store = list_store;
diff --git a/calendar/gui/dialogs/alarm-list-dialog.h b/calendar/gui/dialogs/alarm-list-dialog.h
index 289d887b92..5fc8aa3b77 100644
--- a/calendar/gui/dialogs/alarm-list-dialog.h
+++ b/calendar/gui/dialogs/alarm-list-dialog.h
@@ -32,15 +32,17 @@
#include <libecal/libecal.h>
+#include <e-util/e-util.h>
+
#include "../e-alarm-list.h"
G_BEGIN_DECLS
gboolean alarm_list_dialog_run (GtkWidget *parent,
- ESourceRegistry *registry,
+ EClientCache *client_cache,
ECalClient *cal_client,
EAlarmList *list_store);
-GtkWidget * alarm_list_dialog_peek (ESourceRegistry *registry,
+GtkWidget * alarm_list_dialog_peek (EClientCache *client_cache,
ECalClient *cal_client,
EAlarmList *list_store);
void alarm_list_dialog_set_client (GtkWidget *dlg_box,
diff --git a/calendar/gui/dialogs/e-delegate-dialog.c b/calendar/gui/dialogs/e-delegate-dialog.c
index 9c5e17f59e..366d978e0e 100644
--- a/calendar/gui/dialogs/e-delegate-dialog.c
+++ b/calendar/gui/dialogs/e-delegate-dialog.c
@@ -101,7 +101,7 @@ e_delegate_dialog_init (EDelegateDialog *edd)
EDelegateDialog *
e_delegate_dialog_construct (EDelegateDialog *edd,
- ESourceRegistry *registry,
+ EClientCache *client_cache,
const gchar *name,
const gchar *address)
{
@@ -112,7 +112,7 @@ e_delegate_dialog_construct (EDelegateDialog *edd,
ENameSelectorDialog *name_selector_dialog;
g_return_val_if_fail (E_IS_DELEGATE_DIALOG (edd), NULL);
- g_return_val_if_fail (E_IS_SOURCE_REGISTRY (registry), NULL);
+ g_return_val_if_fail (E_IS_CLIENT_CACHE (client_cache), NULL);
priv = edd->priv;
@@ -126,7 +126,7 @@ e_delegate_dialog_construct (EDelegateDialog *edd,
goto error;
}
- priv->name_selector = e_name_selector_new (registry);
+ priv->name_selector = e_name_selector_new (client_cache);
e_name_selector_load_books (priv->name_selector);
name_selector_model = e_name_selector_peek_model (priv->name_selector);
e_name_selector_model_add_section (name_selector_model, section_name, section_name, NULL);
@@ -214,18 +214,18 @@ addressbook_response_cb (GtkWidget *widget,
* editor could not be created.
**/
EDelegateDialog *
-e_delegate_dialog_new (ESourceRegistry *registry,
+e_delegate_dialog_new (EClientCache *client_cache,
const gchar *name,
const gchar *address)
{
EDelegateDialog *edd;
- g_return_val_if_fail (E_IS_SOURCE_REGISTRY (registry), NULL);
+ g_return_val_if_fail (E_IS_CLIENT_CACHE (client_cache), NULL);
edd = g_object_new (E_TYPE_DELEGATE_DIALOG, NULL);
return e_delegate_dialog_construct (
- E_DELEGATE_DIALOG (edd), registry, name, address);
+ E_DELEGATE_DIALOG (edd), client_cache, name, address);
}
gchar *
diff --git a/calendar/gui/dialogs/e-delegate-dialog.h b/calendar/gui/dialogs/e-delegate-dialog.h
index 245e1fed2e..8a9b38e5ca 100644
--- a/calendar/gui/dialogs/e-delegate-dialog.h
+++ b/calendar/gui/dialogs/e-delegate-dialog.h
@@ -24,8 +24,7 @@
#ifndef E_DELEGATE_DIALOG_H
#define E_DELEGATE_DIALOG_H
-#include <gtk/gtk.h>
-#include <libedataserver/libedataserver.h>
+#include <e-util/e-util.h>
/* Standard GObject macros */
#define E_TYPE_DELEGATE_DIALOG \
@@ -64,11 +63,11 @@ struct _EDelegateDialogClass {
GType e_delegate_dialog_get_type (void);
EDelegateDialog *
e_delegate_dialog_construct (EDelegateDialog *etd,
- ESourceRegistry *registry,
+ EClientCache *client_cache,
const gchar *name,
const gchar *address);
EDelegateDialog *
- e_delegate_dialog_new (ESourceRegistry *registry,
+ e_delegate_dialog_new (EClientCache *client_cache,
const gchar *name,
const gchar *address);
gchar * e_delegate_dialog_get_delegate (EDelegateDialog *etd);
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c
index dfe3368be9..6225eb7a47 100644
--- a/calendar/gui/dialogs/event-page.c
+++ b/calendar/gui/dialogs/event-page.c
@@ -141,7 +141,7 @@ struct _EventPagePrivate {
GtkWidget *categories_btn;
GtkWidget *categories;
- GtkWidget *source_combo_box;
+ GtkWidget *client_combo_box;
/* Meeting related items */
GtkWidget *list_box;
@@ -681,7 +681,7 @@ sensitize_widgets (EventPage *epage)
gtk_editable_set_editable (GTK_EDITABLE (priv->categories), !read_only);
if (delegate) {
- gtk_widget_set_sensitive (priv->source_combo_box, FALSE);
+ gtk_widget_set_sensitive (priv->client_combo_box, FALSE);
}
gtk_widget_set_sensitive (priv->organizer, !read_only);
@@ -707,7 +707,7 @@ sensitize_widgets (EventPage *epage)
gtk_widget_hide (priv->attendee_box);
gtk_widget_hide (priv->organizer);
gtk_label_set_text_with_mnemonic ((GtkLabel *) priv->org_cal_label, _("_Calendar:"));
- gtk_label_set_mnemonic_widget ((GtkLabel *) priv->org_cal_label, priv->source_combo_box);
+ gtk_label_set_mnemonic_widget ((GtkLabel *) priv->org_cal_label, priv->client_combo_box);
} else {
gtk_widget_show (priv->calendar_label);
gtk_widget_show (priv->list_box);
@@ -1369,7 +1369,7 @@ event_page_fill_widgets (CompEditorPage *page,
/* Source */
e_source_combo_box_set_active (
- E_SOURCE_COMBO_BOX (priv->source_combo_box),
+ E_SOURCE_COMBO_BOX (priv->client_combo_box),
e_client_get_source (E_CLIENT (client)));
e_cal_component_get_uid (comp, &uid);
@@ -2535,7 +2535,7 @@ static gboolean
get_widgets (EventPage *epage)
{
EShell *shell;
- ESourceRegistry *registry;
+ EClientCache *client_cache;
CompEditor *editor;
CompEditorPage *page = COMP_EDITOR_PAGE (epage);
GtkEntryCompletion *completion;
@@ -2552,7 +2552,7 @@ get_widgets (EventPage *epage)
editor = comp_editor_page_get_editor (page);
shell = comp_editor_get_shell (editor);
- registry = e_shell_get_registry (shell);
+ client_cache = e_shell_get_client_cache (shell);
priv->main = GW ("event-page");
if (!priv->main)
@@ -2645,9 +2645,9 @@ get_widgets (EventPage *epage)
priv->description = GW ("description");
- priv->source_combo_box = GW ("source");
- e_source_combo_box_set_registry (
- E_SOURCE_COMBO_BOX (priv->source_combo_box), registry);
+ priv->client_combo_box = GW ("client-combo-box");
+ e_client_combo_box_set_client_cache (
+ E_CLIENT_COMBO_BOX (priv->client_combo_box), client_cache);
completion = e_category_completion_new ();
gtk_entry_set_completion (GTK_ENTRY (priv->categories), completion);
@@ -2971,7 +2971,7 @@ event_page_send_options_clicked_cb (EventPage *epage)
if (!priv->sod) {
priv->sod = e_send_options_dialog_new ();
source = e_source_combo_box_ref_active (
- E_SOURCE_COMBO_BOX (priv->source_combo_box));
+ E_SOURCE_COMBO_BOX (priv->client_combo_box));
e_send_options_utils_set_default_data (
priv->sod, source, "calendar");
priv->sod->data->initialized = TRUE;
@@ -2987,18 +2987,21 @@ event_page_send_options_clicked_cb (EventPage *epage)
}
static void
-epage_client_connect_cb (GObject *source_object,
- GAsyncResult *result,
- gpointer user_data)
+epage_get_client_cb (GObject *source_object,
+ GAsyncResult *result,
+ gpointer user_data)
{
EClient *client;
+ EClientComboBox *combo_box;
EventPage *epage = user_data;
EventPagePrivate *priv;
CompEditor *editor;
GError *error = NULL;
- client = e_client_cache_get_client_finish (
- E_CLIENT_CACHE (source_object), result, &error);
+ combo_box = E_CLIENT_COMBO_BOX (source_object);
+
+ client = e_client_combo_box_get_client_finish (
+ combo_box, result, &error);
/* Sanity check. */
g_return_if_fail (
@@ -3021,7 +3024,7 @@ epage_client_connect_cb (GObject *source_object,
old_client = comp_editor_get_client (editor);
e_source_combo_box_set_active (
- E_SOURCE_COMBO_BOX (priv->source_combo_box),
+ E_SOURCE_COMBO_BOX (combo_box),
e_client_get_source (E_CLIENT (old_client)));
dialog = gtk_message_dialog_new (
@@ -3064,19 +3067,16 @@ epage_client_connect_cb (GObject *source_object,
}
static void
-source_changed_cb (ESourceComboBox *source_combo_box,
- EventPage *epage)
+combo_box_changed_cb (ESourceComboBox *combo_box,
+ EventPage *epage)
{
EventPagePrivate *priv = epage->priv;
- EClientCache *client_cache;
- CompEditor *editor;
ESource *source;
- EShell *shell;
if (comp_editor_page_get_updating (COMP_EDITOR_PAGE (epage)))
return;
- source = e_source_combo_box_ref_active (source_combo_box);
+ source = e_source_combo_box_ref_active (combo_box);
g_return_if_fail (source != NULL);
if (priv->connect_cancellable != NULL) {
@@ -3085,15 +3085,10 @@ source_changed_cb (ESourceComboBox *source_combo_box,
}
priv->connect_cancellable = g_cancellable_new ();
- editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (epage));
- shell = comp_editor_get_shell (editor);
- client_cache = e_shell_get_client_cache (shell);
-
- e_client_cache_get_client (
- client_cache, source,
- E_SOURCE_EXTENSION_CALENDAR,
- priv->connect_cancellable,
- epage_client_connect_cb, epage);
+ e_client_combo_box_get_client (
+ E_CLIENT_COMBO_BOX (combo_box),
+ source, priv->connect_cancellable,
+ epage_get_client_cb, epage);
g_object_unref (source);
}
@@ -3259,7 +3254,7 @@ init_widgets (EventPage *epage)
EventPagePrivate *priv = epage->priv;
EShell *shell;
CompEditor *editor;
- ESourceRegistry *registry;
+ EClientCache *client_cache;
GtkTextBuffer *text_buffer;
icaltimezone *zone;
gchar *combo_label = NULL;
@@ -3275,7 +3270,7 @@ init_widgets (EventPage *epage)
shell = comp_editor_get_shell (editor);
client = comp_editor_get_client (editor);
- registry = e_shell_get_registry (shell);
+ client_cache = e_shell_get_client_cache (shell);
/* Make sure the EDateEdit widgets use our timezones to get the
* current time. */
@@ -3318,10 +3313,10 @@ init_widgets (EventPage *epage)
priv->categories_btn, "clicked",
G_CALLBACK (categories_clicked_cb), epage);
- /* Source selector */
+ /* Client selector */
g_signal_connect (
- priv->source_combo_box, "changed",
- G_CALLBACK (source_changed_cb), epage);
+ priv->client_combo_box, "changed",
+ G_CALLBACK (combo_box_changed_cb), epage);
/* Alarms */
priv->alarm_list_store = e_alarm_list_new ();
@@ -3401,7 +3396,7 @@ init_widgets (EventPage *epage)
priv->alarm_dialog, "delete-event",
G_CALLBACK (alarm_dialog_delete_event_cb), priv->alarm_dialog);
priv->alarm_list_dlg_widget = alarm_list_dialog_peek (
- registry, client, priv->alarm_list_store);
+ client_cache, client, priv->alarm_list_store);
gtk_widget_reparent (priv->alarm_list_dlg_widget, priv->alarm_box);
gtk_widget_show_all (priv->alarm_list_dlg_widget);
gtk_widget_hide (priv->alarm_dialog);
@@ -3528,7 +3523,7 @@ init_widgets (EventPage *epage)
priv->categories, "changed",
G_CALLBACK (comp_editor_page_changed), epage);
g_signal_connect_swapped (
- priv->source_combo_box, "changed",
+ priv->client_combo_box, "changed",
G_CALLBACK (comp_editor_page_changed), epage);
g_signal_connect_swapped (
priv->start_timezone, "changed",
diff --git a/calendar/gui/dialogs/event-page.ui b/calendar/gui/dialogs/event-page.ui
index c1c328b4c0..804457575f 100644
--- a/calendar/gui/dialogs/event-page.ui
+++ b/calendar/gui/dialogs/event-page.ui
@@ -767,7 +767,7 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
- <property name="mnemonic_widget">source</property>
+ <property name="mnemonic_widget">client-combo-box</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
@@ -779,7 +779,7 @@
</packing>
</child>
<child>
- <object class="ESourceComboBox" type-func="e_source_combo_box_get_type" id="source">
+ <object class="EClientComboBox" type-func="e_client_combo_box_get_type" id="client-combo-box">
<property name="extension-name">Calendar</property>
<property name="show-colors">True</property>
<property name="visible">True</property>
diff --git a/calendar/gui/dialogs/memo-page.c b/calendar/gui/dialogs/memo-page.c
index 9224d5cf4b..7c33ec6864 100644
--- a/calendar/gui/dialogs/memo-page.c
+++ b/calendar/gui/dialogs/memo-page.c
@@ -78,7 +78,7 @@ struct _MemoPagePrivate {
GtkWidget *categories_btn;
GtkWidget *categories;
- GtkWidget *source_combo_box;
+ GtkWidget *client_combo_box;
gchar **address_strings;
gchar *fallback_address;
@@ -367,7 +367,7 @@ memo_page_fill_widgets (CompEditorPage *page,
/* Source */
e_source_combo_box_set_active (
- E_SOURCE_COMBO_BOX (priv->source_combo_box),
+ E_SOURCE_COMBO_BOX (priv->client_combo_box),
e_client_get_source (E_CLIENT (client)));
if (priv->to_entry && (flags & COMP_EDITOR_IS_SHARED) && !(flags & COMP_EDITOR_NEW_ITEM))
@@ -840,7 +840,7 @@ static gboolean
get_widgets (MemoPage *mpage)
{
EShell *shell;
- ESourceRegistry *registry;
+ EClientCache *client_cache;
CompEditor *editor;
CompEditorPage *page = COMP_EDITOR_PAGE (mpage);
GtkEntryCompletion *completion;
@@ -855,7 +855,7 @@ get_widgets (MemoPage *mpage)
editor = comp_editor_page_get_editor (page);
shell = comp_editor_get_shell (editor);
- registry = e_shell_get_registry (shell);
+ client_cache = e_shell_get_client_cache (shell);
priv->main = GW ("memo-page");
if (!priv->main) {
@@ -897,9 +897,9 @@ get_widgets (MemoPage *mpage)
priv->categories_btn = GW ("categories-button");
priv->categories = GW ("categories");
- priv->source_combo_box = GW ("source");
- e_source_combo_box_set_registry (
- E_SOURCE_COMBO_BOX (priv->source_combo_box), registry);
+ priv->client_combo_box = GW ("client-combo-box");
+ e_client_combo_box_set_client_cache (
+ E_CLIENT_COMBO_BOX (priv->client_combo_box), client_cache);
#undef GW
completion = e_category_completion_new ();
@@ -941,18 +941,20 @@ categories_clicked_cb (GtkWidget *button,
}
static void
-mpage_client_connect_cb (GObject *source_object,
- GAsyncResult *result,
- gpointer user_data)
+mpage_get_client_cb (GObject *source_object,
+ GAsyncResult *result,
+ gpointer user_data)
{
EClient *client;
+ EClientComboBox *combo_box;
MemoPage *mpage = user_data;
- MemoPagePrivate *priv;
CompEditor *editor;
GError *error = NULL;
- client = e_client_cache_get_client_finish (
- E_CLIENT_CACHE (source_object), result, &error);
+ combo_box = E_CLIENT_COMBO_BOX (source_object);
+
+ client = e_client_combo_box_get_client_finish (
+ combo_box, result, &error);
/* Sanity check. */
g_return_if_fail (
@@ -966,7 +968,6 @@ mpage_client_connect_cb (GObject *source_object,
}
editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (mpage));
- priv = mpage->priv;
if (error != NULL) {
GtkWidget *dialog;
@@ -975,7 +976,7 @@ mpage_client_connect_cb (GObject *source_object,
old_client = comp_editor_get_client (editor);
e_source_combo_box_set_active (
- E_SOURCE_COMBO_BOX (priv->source_combo_box),
+ E_SOURCE_COMBO_BOX (combo_box),
e_client_get_source (E_CLIENT (old_client)));
dialog = gtk_message_dialog_new (
@@ -1016,19 +1017,16 @@ mpage_client_connect_cb (GObject *source_object,
}
static void
-source_changed_cb (ESourceComboBox *source_combo_box,
+source_changed_cb (ESourceComboBox *combo_box,
MemoPage *mpage)
{
MemoPagePrivate *priv = mpage->priv;
- EClientCache *client_cache;
- CompEditor *editor;
ESource *source;
- EShell *shell;
if (comp_editor_page_get_updating (COMP_EDITOR_PAGE (mpage)))
return;
- source = e_source_combo_box_ref_active (source_combo_box);
+ source = e_source_combo_box_ref_active (combo_box);
g_return_if_fail (source != NULL);
if (priv->connect_cancellable != NULL) {
@@ -1037,15 +1035,10 @@ source_changed_cb (ESourceComboBox *source_combo_box,
}
priv->connect_cancellable = g_cancellable_new ();
- editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (mpage));
- shell = comp_editor_get_shell (editor);
- client_cache = e_shell_get_client_cache (shell);
-
- e_client_cache_get_client (
- client_cache, source,
- E_SOURCE_EXTENSION_MEMO_LIST,
- priv->connect_cancellable,
- mpage_client_connect_cb, mpage);
+ e_client_combo_box_get_client (
+ E_CLIENT_COMBO_BOX (combo_box),
+ source, priv->connect_cancellable,
+ mpage_get_client_cb, mpage);
g_object_unref (source);
}
@@ -1123,7 +1116,7 @@ init_widgets (MemoPage *mpage)
/* Source selector */
g_signal_connect (
- priv->source_combo_box, "changed",
+ priv->client_combo_box, "changed",
G_CALLBACK (source_changed_cb), mpage);
/* Connect the default signal handler to use to make sure the "changed"
@@ -1143,7 +1136,7 @@ init_widgets (MemoPage *mpage)
G_CALLBACK (comp_editor_page_changed), mpage);
g_signal_connect_swapped (
- priv->source_combo_box, "changed",
+ priv->client_combo_box, "changed",
G_CALLBACK (comp_editor_page_changed), mpage);
g_signal_connect_swapped (
@@ -1239,6 +1232,7 @@ memo_page_construct (MemoPage *mpage)
CompEditor *editor;
CompEditorFlags flags;
ESourceRegistry *registry;
+ EClientCache *client_cache;
priv = mpage->priv;
@@ -1248,6 +1242,7 @@ memo_page_construct (MemoPage *mpage)
shell = comp_editor_get_shell (editor);
registry = e_shell_get_registry (shell);
+ client_cache = e_shell_get_client_cache (shell);
/* Make sure our custom widget classes are registered with
* GType before we load the GtkBuilder definition file. */
@@ -1291,7 +1286,7 @@ memo_page_construct (MemoPage *mpage)
gtk_widget_show (priv->org_label);
gtk_widget_show (priv->org_combo);
- priv->name_selector = e_name_selector_new (registry);
+ priv->name_selector = e_name_selector_new (client_cache);
priv->to_entry = get_to_entry (priv->name_selector);
gtk_container_add ((GtkContainer *) priv->to_hbox, priv->to_entry);
gtk_widget_show (priv->to_hbox);
diff --git a/calendar/gui/dialogs/memo-page.ui b/calendar/gui/dialogs/memo-page.ui
index c0e25d9748..e10e8faace 100644
--- a/calendar/gui/dialogs/memo-page.ui
+++ b/calendar/gui/dialogs/memo-page.ui
@@ -183,7 +183,7 @@
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
- <object class="ESourceComboBox" type-func="e_source_combo_box_get_type" id="source">
+ <object class="EClientComboBox" type-func="e_client_combo_box_get_type" id="client-combo-box">
<property name="extension-name">Memo List</property>
<property name="show-colors">True</property>
<property name="visible">True</property>
@@ -240,7 +240,7 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
- <property name="mnemonic_widget">source</property>
+ <property name="mnemonic_widget">client-combo-box</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c
index 31f99f8c14..8cd35bda7e 100644
--- a/calendar/gui/dialogs/task-page.c
+++ b/calendar/gui/dialogs/task-page.c
@@ -86,7 +86,7 @@ struct _TaskPagePrivate {
GtkWidget *categories_btn;
GtkWidget *categories;
- GtkWidget *source_combo_box;
+ GtkWidget *client_combo_box;
/* Meeting related items */
GtkWidget *list_box;
@@ -334,7 +334,7 @@ sensitize_widgets (TaskPage *tpage)
gtk_widget_hide (priv->organizer);
gtk_widget_hide (priv->invite);
gtk_label_set_text_with_mnemonic (GTK_LABEL (priv->org_cal_label), _("_List:"));
- gtk_label_set_mnemonic_widget (GTK_LABEL (priv->org_cal_label), priv->source_combo_box);
+ gtk_label_set_mnemonic_widget (GTK_LABEL (priv->org_cal_label), priv->client_combo_box);
} else {
gtk_widget_show (priv->invite);
gtk_widget_show (priv->calendar_label);
@@ -637,7 +637,7 @@ task_page_fill_widgets (CompEditorPage *page,
/* Source */
e_source_combo_box_set_active (
- E_SOURCE_COMBO_BOX (priv->source_combo_box),
+ E_SOURCE_COMBO_BOX (priv->client_combo_box),
e_client_get_source (E_CLIENT (client)));
e_client_get_backend_property_sync (E_CLIENT (client), CAL_BACKEND_PROPERTY_CAL_EMAIL_ADDRESS, &backend_addr, NULL, NULL);
@@ -1450,7 +1450,7 @@ static gboolean
get_widgets (TaskPage *tpage)
{
EShell *shell;
- ESourceRegistry *registry;
+ EClientCache *client_cache;
CompEditor *editor;
CompEditorPage *page = COMP_EDITOR_PAGE (tpage);
GtkEntryCompletion *completion;
@@ -1465,7 +1465,7 @@ get_widgets (TaskPage *tpage)
editor = comp_editor_page_get_editor (page);
shell = comp_editor_get_shell (editor);
- registry = e_shell_get_registry (shell);
+ client_cache = e_shell_get_client_cache (shell);
priv->main = e_builder_get_widget (priv->builder, "task-page");
if (!priv->main)
@@ -1528,11 +1528,12 @@ get_widgets (TaskPage *tpage)
gtk_container_add (GTK_CONTAINER (sw), GTK_WIDGET (priv->list_view));
gtk_box_pack_start (GTK_BOX (priv->list_box), sw, TRUE, TRUE, 0);
- priv->source_combo_box = e_builder_get_widget (priv->builder, "source");
- e_source_combo_box_set_registry (
- E_SOURCE_COMBO_BOX (priv->source_combo_box), registry);
+ priv->client_combo_box = e_builder_get_widget (
+ priv->builder, "client-combo-box");
+ e_client_combo_box_set_client_cache (
+ E_CLIENT_COMBO_BOX (priv->client_combo_box), client_cache);
- gtk_label_set_mnemonic_widget (GTK_LABEL (priv->calendar_label), priv->source_combo_box);
+ gtk_label_set_mnemonic_widget (GTK_LABEL (priv->calendar_label), priv->client_combo_box);
completion = e_category_completion_new ();
gtk_entry_set_completion (GTK_ENTRY (priv->categories), completion);
@@ -1784,18 +1785,21 @@ due_date_changed_cb (TaskPage *tpage)
}
static void
-tpage_client_connect_cb (GObject *source_object,
- GAsyncResult *result,
- gpointer user_data)
+tpage_get_client_cb (GObject *source_object,
+ GAsyncResult *result,
+ gpointer user_data)
{
EClient *client;
+ EClientComboBox *combo_box;
TaskPage *tpage = user_data;
TaskPagePrivate *priv;
CompEditor *editor;
GError *error = NULL;
- client = e_client_cache_get_client_finish (
- E_CLIENT_CACHE (source_object), result, &error);
+ combo_box = E_CLIENT_COMBO_BOX (source_object);
+
+ client = e_client_combo_box_get_client_finish (
+ combo_box, result, &error);
/* Sanity check. */
g_return_if_fail (
@@ -1817,7 +1821,7 @@ tpage_client_connect_cb (GObject *source_object,
old_client = comp_editor_get_client (editor);
e_source_combo_box_set_active (
- E_SOURCE_COMBO_BOX (priv->source_combo_box),
+ E_SOURCE_COMBO_BOX (combo_box),
e_client_get_source (E_CLIENT (old_client)));
dialog = gtk_message_dialog_new (
@@ -1861,19 +1865,16 @@ tpage_client_connect_cb (GObject *source_object,
}
static void
-source_changed_cb (ESourceComboBox *source_combo_box,
+source_changed_cb (ESourceComboBox *combo_box,
TaskPage *tpage)
{
TaskPagePrivate *priv = tpage->priv;
- EClientCache *client_cache;
- CompEditor *editor;
ESource *source;
- EShell *shell;
if (comp_editor_page_get_updating (COMP_EDITOR_PAGE (tpage)))
return;
- source = e_source_combo_box_ref_active (source_combo_box);
+ source = e_source_combo_box_ref_active (combo_box);
g_return_if_fail (source != NULL);
if (priv->connect_cancellable != NULL) {
@@ -1882,15 +1883,10 @@ source_changed_cb (ESourceComboBox *source_combo_box,
}
priv->connect_cancellable = g_cancellable_new ();
- editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (tpage));
- shell = comp_editor_get_shell (editor);
- client_cache = e_shell_get_client_cache (shell);
-
- e_client_cache_get_client (
- client_cache, source,
- E_SOURCE_EXTENSION_TASK_LIST,
- priv->connect_cancellable,
- tpage_client_connect_cb, tpage);
+ e_client_combo_box_get_client (
+ E_CLIENT_COMBO_BOX (combo_box),
+ source, priv->connect_cancellable,
+ tpage_get_client_cb, tpage);
g_object_unref (source);
}
@@ -1919,7 +1915,7 @@ task_page_send_options_clicked_cb (TaskPage *tpage)
priv->sod = e_send_options_dialog_new ();
priv->sod->data->initialized = TRUE;
source = e_source_combo_box_ref_active (
- E_SOURCE_COMBO_BOX (priv->source_combo_box));
+ E_SOURCE_COMBO_BOX (priv->client_combo_box));
e_send_options_utils_set_default_data (
priv->sod, source, "task");
g_object_unref (source);
@@ -1996,7 +1992,7 @@ init_widgets (TaskPage *tpage)
/* Source selector */
g_signal_connect (
- priv->source_combo_box, "changed",
+ priv->client_combo_box, "changed",
G_CALLBACK (source_changed_cb), tpage);
/* Connect the default signal handler to use to make sure the "changed"
diff --git a/calendar/gui/dialogs/task-page.ui b/calendar/gui/dialogs/task-page.ui
index 0603f44de4..79ab45043f 100644
--- a/calendar/gui/dialogs/task-page.ui
+++ b/calendar/gui/dialogs/task-page.ui
@@ -438,7 +438,7 @@
</packing>
</child>
<child>
- <object class="ESourceComboBox" type-func="e_source_combo_box_get_type" id="source">
+ <object class="EClientComboBox" type-func="e_client_combo_box_get_type" id="client-combo-box">
<property name="extension-name">Task List</property>
<property name="show-colors">True</property>
<property name="visible">True</property>
diff --git a/calendar/gui/e-meeting-list-view.c b/calendar/gui/e-meeting-list-view.c
index 50999c767b..6d6414aab1 100644
--- a/calendar/gui/e-meeting-list-view.c
+++ b/calendar/gui/e-meeting-list-view.c
@@ -143,7 +143,7 @@ static void
e_meeting_list_view_init (EMeetingListView *view)
{
ENameSelectorDialog *name_selector_dialog;
- ESourceRegistry *registry;
+ EClientCache *client_cache;
EShell *shell;
gint i;
@@ -153,9 +153,9 @@ e_meeting_list_view_init (EMeetingListView *view)
/* FIXME Refactor this so we don't need e_shell_get_default(). */
shell = e_shell_get_default ();
- registry = e_shell_get_registry (shell);
+ client_cache = e_shell_get_client_cache (shell);
- view->priv->name_selector = e_name_selector_new (registry);
+ view->priv->name_selector = e_name_selector_new (client_cache);
for (i = 0; sections[i]; i++)
add_section (view->priv->name_selector, sections[i]);