aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2008-08-08 12:26:12 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-08-08 12:26:12 +0800
commitcea054cd54d84479352a43bbabc19c9ce9af5efb (patch)
treeba02763209ba0f22989024004f57689071603ec5 /addressbook/gui
parent91a6b6899e5568ed34f913bedb538dd6c9e35b32 (diff)
downloadgsoc2013-evolution-cea054cd54d84479352a43bbabc19c9ce9af5efb.tar
gsoc2013-evolution-cea054cd54d84479352a43bbabc19c9ce9af5efb.tar.gz
gsoc2013-evolution-cea054cd54d84479352a43bbabc19c9ce9af5efb.tar.bz2
gsoc2013-evolution-cea054cd54d84479352a43bbabc19c9ce9af5efb.tar.lz
gsoc2013-evolution-cea054cd54d84479352a43bbabc19c9ce9af5efb.tar.xz
gsoc2013-evolution-cea054cd54d84479352a43bbabc19c9ce9af5efb.tar.zst
gsoc2013-evolution-cea054cd54d84479352a43bbabc19c9ce9af5efb.zip
Merge revisions 35747:35930 from trunk.
svn path=/branches/kill-bonobo/; revision=35931
Diffstat (limited to 'addressbook/gui')
-rw-r--r--addressbook/gui/component/GNOME_Evolution_Addressbook.server.in.in2
-rw-r--r--addressbook/gui/component/addressbook-component.c6
-rw-r--r--addressbook/gui/component/addressbook-config.c14
-rw-r--r--addressbook/gui/component/addressbook-view.c2
-rw-r--r--addressbook/gui/component/ldap-config.glade48
-rw-r--r--addressbook/gui/contact-list-editor/contact-list-editor.glade2
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-editor.c10
-rw-r--r--addressbook/gui/merging/eab-contact-duplicate-detected.glade2
-rw-r--r--addressbook/gui/widgets/e-minicard-view.c40
-rw-r--r--addressbook/gui/widgets/e-minicard-view.h1
-rw-r--r--addressbook/gui/widgets/e-minicard.c48
11 files changed, 136 insertions, 39 deletions
diff --git a/addressbook/gui/component/GNOME_Evolution_Addressbook.server.in.in b/addressbook/gui/component/GNOME_Evolution_Addressbook.server.in.in
index feef3bdfc9..4fe2ce7a6a 100644
--- a/addressbook/gui/component/GNOME_Evolution_Addressbook.server.in.in
+++ b/addressbook/gui/component/GNOME_Evolution_Addressbook.server.in.in
@@ -50,7 +50,7 @@
<oaf_attribute name="evolution:button_label" type="string" _value="Contacts"/>
<oaf_attribute name="evolution:button_tooltips" type="string" _value="Contacts"/>
<oaf_attribute name="evolution:button_sort_order" type="string" value="-9"/>
- <oaf_attribute name="evolution:button_icon" type="string" value="stock_addressbook"/>
+ <oaf_attribute name="evolution:button_icon" type="string" value="x-office-address-book"/>
</oaf_server>
diff --git a/addressbook/gui/component/addressbook-component.c b/addressbook/gui/component/addressbook-component.c
index b55cb9bd16..82f00f00c3 100644
--- a/addressbook/gui/component/addressbook-component.c
+++ b/addressbook/gui/component/addressbook-component.c
@@ -226,7 +226,7 @@ impl__get_userCreatableItems (PortableServer_Servant servant,
list->_buffer[0].id = "contact";
list->_buffer[0].description = _("New Contact");
- list->_buffer[0].menuDescription = _("_Contact");
+ list->_buffer[0].menuDescription = (char *) C_("New", "_Contact");
list->_buffer[0].tooltip = _("Create a new contact");
list->_buffer[0].menuShortcut = 'c';
list->_buffer[0].iconName = "contact-new";
@@ -234,7 +234,7 @@ impl__get_userCreatableItems (PortableServer_Servant servant,
list->_buffer[1].id = "contact_list";
list->_buffer[1].description = _("New Contact List");
- list->_buffer[1].menuDescription = _("Contact _List");
+ list->_buffer[1].menuDescription = (char *) C_("New", "Contact _List");
list->_buffer[1].tooltip = _("Create a new contact list");
list->_buffer[1].menuShortcut = 'l';
list->_buffer[1].iconName = "stock_contact-list";
@@ -242,7 +242,7 @@ impl__get_userCreatableItems (PortableServer_Servant servant,
list->_buffer[2].id = "address_book";
list->_buffer[2].description = _("New Address Book");
- list->_buffer[2].menuDescription = _("Address _Book");
+ list->_buffer[2].menuDescription = (char *) C_("New", "Address _Book");
list->_buffer[2].tooltip = _("Create a new address book");
list->_buffer[2].menuShortcut = '\0';
list->_buffer[2].iconName = "address-book-new";
diff --git a/addressbook/gui/component/addressbook-config.c b/addressbook/gui/component/addressbook-config.c
index 76b5dca5c1..2b749a6dd8 100644
--- a/addressbook/gui/component/addressbook-config.c
+++ b/addressbook/gui/component/addressbook-config.c
@@ -111,6 +111,7 @@ struct _AddressbookSourceDialog {
GtkWidget *search_filter;
GtkWidget *timeout_scale;
GtkWidget *limit_spinbutton;
+ GtkWidget *canbrowsecheck;
/* display name page fields */
GtkWidget *display_name;
@@ -925,6 +926,15 @@ limit_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog)
e_source_set_property(sdialog->source, "limit", limit);
}
+static void
+canbrowse_toggled_cb (GtkWidget *toggle_button, ESource *source)
+{
+ if (!source || !toggle_button)
+ return;
+
+ e_source_set_property (source, "can-browse", gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle_button)) ? "1" : NULL);
+}
+
static GtkWidget *
eabc_details_limit(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, void *data)
{
@@ -956,6 +966,10 @@ eabc_details_limit(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, st
gtk_spin_button_set_value((GtkSpinButton *)sdialog->limit_spinbutton, tmp?g_strtod(tmp, NULL):100.0);
g_signal_connect (sdialog->limit_spinbutton, "value_changed", G_CALLBACK (limit_changed_cb), sdialog);
+ sdialog->canbrowsecheck = glade_xml_get_widget (gui, "canbrowsecheck");
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sdialog->canbrowsecheck), e_source_get_property (sdialog->source, "can-browse") && strcmp (e_source_get_property (sdialog->source, "can-browse"), "1") == 0);
+ g_signal_connect (sdialog->canbrowsecheck, "toggled", G_CALLBACK (canbrowse_toggled_cb), sdialog->source);
+
g_object_unref(gui);
return w;
diff --git a/addressbook/gui/component/addressbook-view.c b/addressbook/gui/component/addressbook-view.c
index cb66508eac..3db5bbdf36 100644
--- a/addressbook/gui/component/addressbook-view.c
+++ b/addressbook/gui/component/addressbook-view.c
@@ -1330,7 +1330,7 @@ addressbook_view_init (AddressbookView *view)
e_activity_handler_attach_task_bar (priv->activity_handler,
E_TASK_BAR (priv->statusbar_widget));
- priv->info_widget = e_info_label_new("contact-new");
+ priv->info_widget = e_info_label_new("x-office-address-book");
e_info_label_set_info((EInfoLabel*)priv->info_widget, _("Contacts"), "");
gtk_widget_show (priv->info_widget);
diff --git a/addressbook/gui/component/ldap-config.glade b/addressbook/gui/component/ldap-config.glade
index 1641741075..1e1c4d5fea 100644
--- a/addressbook/gui/component/ldap-config.glade
+++ b/addressbook/gui/component/ldap-config.glade
@@ -1179,7 +1179,7 @@
<child>
<widget class="GtkTable" id="table34">
<property name="visible">True</property>
- <property name="n_rows">2</property>
+ <property name="n_rows">3</property>
<property name="n_columns">3</property>
<property name="homogeneous">False</property>
<property name="row_spacing">6</property>
@@ -1405,6 +1405,28 @@
<property name="y_options">shrink|fill</property>
</packing>
</child>
+
+ <child>
+ <widget class="GtkCheckButton" id="canbrowsecheck">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes" comments="To translators: If enabled, addressbook will only fetch contacts from the server until either set time limit or amount of contacts limit reached">B_rowse this book until limit reached</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="padding">0</property>
@@ -2707,7 +2729,7 @@
<widget class="GtkTable" id="table11">
<property name="border_width">12</property>
<property name="visible">True</property>
- <property name="n_rows">2</property>
+ <property name="n_rows">3</property>
<property name="n_columns">3</property>
<property name="homogeneous">False</property>
<property name="row_spacing">6</property>
@@ -2930,6 +2952,28 @@
<property name="y_options"></property>
</packing>
</child>
+
+ <child>
+ <widget class="GtkCheckButton" id="canbrowsecheck">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes" comments="To translators: If enabled, addressbook will only fetch contacts from the server until either set time limit or amount of contacts limit reached">B_rowse this book until limit reached</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
</widget>
</child>
diff --git a/addressbook/gui/contact-list-editor/contact-list-editor.glade b/addressbook/gui/contact-list-editor/contact-list-editor.glade
index 3402e27542..497be08c85 100644
--- a/addressbook/gui/contact-list-editor/contact-list-editor.glade
+++ b/addressbook/gui/contact-list-editor/contact-list-editor.glade
@@ -28,7 +28,7 @@
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="icon_size">6</property>
- <property name="icon_name">stock_addressbook</property>
+ <property name="icon_name">x-office-address-book</property>
</widget>
<packing>
<property name="left_attach">1</property>
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c
index d3121185a6..7039bb5086 100644
--- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c
+++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c
@@ -1334,6 +1334,7 @@ e_contact_list_editor_get_contact (EContactListEditor *editor)
GtkTreeIter iter;
gboolean iter_valid;
const gchar *text;
+ GSList *attrs = NULL, *a;
g_return_val_if_fail (E_IS_CONTACT_LIST_EDITOR (editor), NULL);
@@ -1367,13 +1368,20 @@ e_contact_list_editor_get_contact (EContactListEditor *editor)
gtk_tree_model_get (model, &iter, 0, &dest, -1);
attr = e_vcard_attribute_new (NULL, EVC_EMAIL);
- e_vcard_add_attribute (E_VCARD (contact), attr);
+ attrs = g_slist_prepend (attrs, attr);
e_destination_export_to_vcard_attribute (dest, attr);
g_object_unref (dest);
iter_valid = gtk_tree_model_iter_next (model, &iter);
}
+ /* Put it in reverse order because e_vcard_add_attribute also uses prepend,
+ but we want to keep order of mails there. Hopefully noone will change
+ the behaviour of the e_vcard_add_attribute. */
+ for (a = attrs; a; a = a->next) {
+ e_vcard_add_attribute (E_VCARD (contact), a->data);
+ }
+
return contact;
}
diff --git a/addressbook/gui/merging/eab-contact-duplicate-detected.glade b/addressbook/gui/merging/eab-contact-duplicate-detected.glade
index 1a85fac29e..70efc737ca 100644
--- a/addressbook/gui/merging/eab-contact-duplicate-detected.glade
+++ b/addressbook/gui/merging/eab-contact-duplicate-detected.glade
@@ -61,7 +61,7 @@
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
- <property name="label">_Merge</property>
+ <property name="label" translatable="yes">_Merge</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
diff --git a/addressbook/gui/widgets/e-minicard-view.c b/addressbook/gui/widgets/e-minicard-view.c
index daa41b1e2f..30a384091d 100644
--- a/addressbook/gui/widgets/e-minicard-view.c
+++ b/addressbook/gui/widgets/e-minicard-view.c
@@ -155,28 +155,34 @@ static void
set_empty_message (EMinicardView *view)
{
char *empty_message;
- gboolean editable = FALSE, perform_initial_query = FALSE;
+ gboolean editable = FALSE, perform_initial_query = FALSE, searching = FALSE;
EBook *book;
if (view->adapter) {
+ EABModel *model = NULL;
+
g_object_get (view->adapter,
"editable", &editable,
+ "model", &model,
NULL);
g_object_get (view->adapter, "book", &book, NULL);
if (!e_book_check_static_capability (book, "do-initial-query"))
perform_initial_query = TRUE;
+
+ searching = model && eab_model_can_stop (model);
}
- if (editable) {
+ if (searching) {
+ empty_message = _("\n\nSearching for the Contacts...");
+ } else if (editable) {
if (perform_initial_query)
empty_message = _("\n\nSearch for the Contact\n\n"
"or double-click here to create a new Contact.");
else
empty_message = _("\n\nThere are no items to show in this view.\n\n"
"Double-click here to create a new Contact.");
- }
- else {
+ } else {
if (perform_initial_query)
empty_message = _("\n\nSearch for the Contact.");
else
@@ -195,6 +201,12 @@ writable_status_change (EABModel *model, gboolean writable, EMinicardView *view)
}
static void
+stop_state_changed (EABModel *model, EMinicardView *view)
+{
+ set_empty_message (view);
+}
+
+static void
adapter_changed (EMinicardView *view)
{
set_empty_message (view);
@@ -216,19 +228,23 @@ e_minicard_view_set_property (GObject *object,
switch (prop_id){
case PROP_ADAPTER:
if (view->adapter) {
- if (view->writable_status_id) {
+ if (view->writable_status_id || view->stop_state_id) {
EABModel *model;
g_object_get (view->adapter,
"model", &model,
NULL);
if (model) {
- g_signal_handler_disconnect (model, view->writable_status_id);
+ if (view->writable_status_id)
+ g_signal_handler_disconnect (model, view->writable_status_id);
+ if (view->stop_state_id)
+ g_signal_handler_disconnect (model, view->stop_state_id);
}
}
g_object_unref (view->adapter);
}
view->writable_status_id = 0;
+ view->stop_state_id = 0;
view->adapter = g_value_get_object (value);
g_object_ref (view->adapter);
adapter_changed (view);
@@ -244,6 +260,9 @@ e_minicard_view_set_property (GObject *object,
view->writable_status_id =
g_signal_connect (model, "writable_status",
G_CALLBACK (writable_status_change), view);
+ view->stop_state_id =
+ g_signal_connect (model, "stop_state_changed",
+ G_CALLBACK (stop_state_changed), view);
}
}
@@ -317,19 +336,23 @@ e_minicard_view_dispose (GObject *object)
}
if (view->adapter) {
- if (view->writable_status_id) {
+ if (view->writable_status_id || view->stop_state_id) {
EABModel *model;
g_object_get (view->adapter,
"model", &model,
NULL);
if (model) {
- g_signal_handler_disconnect (model, view->writable_status_id);
+ if (view->writable_status_id)
+ g_signal_handler_disconnect (model, view->writable_status_id);
+ if (view->stop_state_id)
+ g_signal_handler_disconnect (model, view->stop_state_id);
}
}
g_object_unref (view->adapter);
}
view->writable_status_id = 0;
+ view->stop_state_id = 0;
view->adapter = NULL;
if (G_OBJECT_CLASS(parent_class)->dispose)
@@ -548,6 +571,7 @@ e_minicard_view_init (EMinicardView *view)
view->adapter = NULL;
view->canvas_drag_data_get_id = 0;
view->writable_status_id = 0;
+ view->stop_state_id = 0;
set_empty_message (view);
}
diff --git a/addressbook/gui/widgets/e-minicard-view.h b/addressbook/gui/widgets/e-minicard-view.h
index 1d8eef963c..eb6d07f034 100644
--- a/addressbook/gui/widgets/e-minicard-view.h
+++ b/addressbook/gui/widgets/e-minicard-view.h
@@ -70,6 +70,7 @@ struct _EMinicardView
guint canvas_drag_data_get_id;
guint writable_status_id;
+ guint stop_state_id;
};
struct _EMinicardViewClass
diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c
index b617292a0f..a4bda1ac4a 100644
--- a/addressbook/gui/widgets/e-minicard.c
+++ b/addressbook/gui/widgets/e-minicard.c
@@ -780,21 +780,21 @@ add_field (EMinicard *e_minicard, EContactField field, gdouble left_width)
new_item = e_minicard_label_new(group);
if (e_minicard->contact && e_contact_get (e_minicard->contact, E_CONTACT_IS_LIST))
- gnome_canvas_item_set( new_item,
- "width", e_minicard->width - 4.0,
- "fieldname", is_rtl ? "" : string,
- "field", is_rtl ? string : "",
- "max_field_name_length", left_width,
- "editable", FALSE /* e_minicard->editable */,
- NULL );
+ gnome_canvas_item_set (new_item,
+ "fieldname", is_rtl ? "" : string,
+ "field", is_rtl ? string : "",
+ "max_field_name_length", left_width,
+ "editable", FALSE /* e_minicard->editable */,
+ "width", e_minicard->width - 4.0,
+ NULL );
else
- gnome_canvas_item_set( new_item,
- "width", e_minicard->width - 4.0,
- "fieldname", is_rtl ? string : name,
- "field", is_rtl ? name : string,
- "max_field_name_length", left_width,
- "editable", FALSE /* e_minicard->editable */,
- NULL );
+ gnome_canvas_item_set (new_item,
+ "fieldname", is_rtl ? string : name,
+ "field", is_rtl ? name : string,
+ "max_field_name_length", left_width,
+ "editable", FALSE /* e_minicard->editable */,
+ "width", e_minicard->width - 4.0,
+ NULL );
#ifdef notyet
@@ -831,7 +831,7 @@ get_email_location (EVCardAttribute *attr)
}
static void
-add_email_field (EMinicard *e_minicard, GList *email_list, gdouble left_width, int limit)
+add_email_field (EMinicard *e_minicard, GList *email_list, gdouble left_width, int limit, gboolean is_list)
{
GnomeCanvasItem *new_item;
GnomeCanvasGroup *group;
@@ -850,8 +850,13 @@ add_email_field (EMinicard *e_minicard, GList *email_list, gdouble left_width, i
char *parsed_name = NULL;
gboolean parser_check;
- tmp = get_email_location ((EVCardAttribute *) l->data);
- name = g_strdup_printf ("%s:", tmp);
+ /* do not use name for fields in the contact list */
+ if (is_list) {
+ name = (char *)"";
+ } else {
+ tmp = get_email_location ((EVCardAttribute *) l->data);
+ name = g_strdup_printf ("%s:", tmp);
+ }
parser_check = eab_parse_qp_email ((const gchar *) le->data, &parsed_name, &email);
if (parser_check) {
@@ -864,12 +869,12 @@ add_email_field (EMinicard *e_minicard, GList *email_list, gdouble left_width, i
new_item = e_minicard_label_new(group);
- gnome_canvas_item_set( new_item,
- "width", e_minicard->width - 4.0,
+ gnome_canvas_item_set (new_item,
"fieldname", is_rtl ? string : name,
"field", is_rtl ? name : string,
"max_field_name_length", left_width,
"editable", FALSE /* e_minicard->editable */,
+ "width", e_minicard->width - 4.0,
NULL );
#ifdef notyet
@@ -888,7 +893,8 @@ add_email_field (EMinicard *e_minicard, GList *email_list, gdouble left_width, i
e_minicard->fields = g_list_append( e_minicard->fields, minicard_field);
e_canvas_item_move_absolute(new_item, 2, e_minicard->height);
count++;
- g_free (name);
+ if (!is_list)
+ g_free (name);
g_free (string);
g_free (parsed_name);
g_free (email);
@@ -1005,7 +1011,7 @@ remodel( EMinicard *e_minicard )
limit = 5 - count;
email = e_contact_get_attributes (e_minicard->contact, E_CONTACT_EMAIL);
- add_email_field (e_minicard, email, left_width, limit);
+ add_email_field (e_minicard, email, left_width, limit, is_list);
if (count+limit >5)
count = 5;
else