summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2012-02-20 13:00:48 +0100
committerAlexander Larsson <alexl@redhat.com>2012-02-20 13:00:48 +0100
commit8698a9409380552a6ef63ffb0f7da6351e444c51 (patch)
treebefd24043204af6f52c16d323adb23f0026e9623 /src
parent52aa12b4d29701a5f3db6b662bc0de294188edac (diff)
downloadgnome-contacts-8698a9409380552a6ef63ffb0f7da6351e444c51.tar.gz
Make link messages somewhat cleaner
Diffstat (limited to 'src')
-rw-r--r--src/contacts-app.vala9
-rw-r--r--src/contacts-contact-pane.vala5
-rw-r--r--src/contacts-link-dialog.vala4
3 files changed, 11 insertions, 7 deletions
diff --git a/src/contacts-app.vala b/src/contacts-app.vala
index 2c53f20..b264a24 100644
--- a/src/contacts-app.vala
+++ b/src/contacts-app.vala
@@ -417,14 +417,19 @@ public class Contacts.App : Gtk.Application {
{ null }
};
- private void contacts_linked (string main_contact, string linked_contact, LinkOperation operation) {
+ private void contacts_linked (string? main_contact, string linked_contact, LinkOperation operation) {
var notification = new Gtk.Notification ();
var g = new Grid ();
g.set_column_spacing (8);
notification.add (g);
- string msg = _("%s linked to %s").printf (main_contact, linked_contact);
+ string msg;
+ if (main_contact != null)
+ msg = _("%s linked to %s").printf (main_contact, linked_contact);
+ else
+ msg = _("%s linked to the contact").printf (linked_contact);
+
var b = new Button.from_stock (Stock.UNDO);
g.add (new Label (msg));
g.add (b);
diff --git a/src/contacts-contact-pane.vala b/src/contacts-contact-pane.vala
index 71ae710..7fdc29d 100644
--- a/src/contacts-contact-pane.vala
+++ b/src/contacts-contact-pane.vala
@@ -1732,7 +1732,7 @@ public class Contacts.ContactPane : ScrolledWindow {
call_button.set_sensitive (callable);
}
- public signal void contacts_linked (string main_contact, string linked_contact, LinkOperation operation);
+ public signal void contacts_linked (string? main_contact, string linked_contact, LinkOperation operation);
public void add_suggestion (Contact c) {
var row = new FieldRow (row_group, this);
@@ -1778,11 +1778,10 @@ public class Contacts.ContactPane : ScrolledWindow {
var no = new Button.with_label (_("No"));
yes.clicked.connect ( () => {
- var main_contact = contact.display_name;
var linked_contact = c.display_name;
link_contacts.begin (contact, c, (obj, result) => {
var operation = link_contacts.end (result);
- this.contacts_linked (main_contact, linked_contact, operation);
+ this.contacts_linked (null, linked_contact, operation);
});
row.destroy ();
});
diff --git a/src/contacts-link-dialog.vala b/src/contacts-link-dialog.vala
index 7a3ec1f..44714a5 100644
--- a/src/contacts-link-dialog.vala
+++ b/src/contacts-link-dialog.vala
@@ -33,7 +33,7 @@ public class Contacts.LinkDialog : Dialog {
private Grid persona_grid;
private uint filter_entry_changed_id;
- public signal void contacts_linked (string main_contact, string linked_contact, LinkOperation operation);
+ public signal void contacts_linked (string? main_contact, string linked_contact, LinkOperation operation);
private void update_contact () {
// Remove previous personas
@@ -84,7 +84,7 @@ public class Contacts.LinkDialog : Dialog {
var undo_bar = new InfoBar.with_buttons (_("Undo"), ResponseType.APPLY, null);
undo_bar.set_message_type (MessageType.INFO);
var container = (undo_bar.get_content_area () as Container);
- var message_label = new Label (_("%s linked to %s").printf (selected_contact_name, contact.display_name));
+ var message_label = new Label (_("%s linked to the contact").printf (selected_contact_name));
//TODO, do something smarter here.
message_label.set_ellipsize (Pango.EllipsizeMode.END);
container.add (message_label);