[gnome-contacts/new-design] Add remove row support
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-contacts/new-design] Add remove row support
- Date: Thu, 15 Dec 2011 09:38:15 +0000 (UTC)
commit 5b7bb9db2e9ee2e46bc1bca397f0969d265c58b9
Author: Alexander Larsson <alexl redhat com>
Date: Tue Dec 13 14:56:39 2011 +0100
Add remove row support
src/contacts-contact-pane.vala | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/contacts-contact-pane.vala b/src/contacts-contact-pane.vala
index 1df027d..c45998f 100644
--- a/src/contacts-contact-pane.vala
+++ b/src/contacts-contact-pane.vala
@@ -611,6 +611,11 @@ public abstract class Contacts.FieldSet : Grid {
row.update ();
}
+ public void remove_row (DataFieldRow row) {
+ this.remove (row);
+ data_rows.remove (row);
+ }
+
public virtual Value? get_value () {
return null;
}
@@ -661,6 +666,10 @@ public abstract class Contacts.DataFieldRow : FieldRow {
this.reset ();
this.pack_edit_widgets ();
var b = this.pack_delete_button ();
+ b.clicked.connect ( () => {
+ field_set.remove_row (this);
+ field_set.save ();
+ });
foreach (var w in this.get_children ()) {
if (!w.get_data<bool> ("original-widget"))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]