[gnome-contacts] contacts-contact-editor: Notify for current row
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-contacts] contacts-contact-editor: Notify for current row
- Date: Fri, 16 Jan 2015 16:14:07 +0000 (UTC)
commit 3f5a52adb59b34996668e14df2a7101a81835277
Author: Jonas Danielsson <jonas threetimestwo org>
Date: Fri Jan 16 05:48:05 2015 -0500
contacts-contact-editor: Notify for current row
We can not use the row variable in the change handlers,
since the row can change.
https://bugzilla.gnome.org/show_bug.cgi?id=742739
src/contacts-contact-editor.vala | 35 +++++++++++++++++++++--------------
1 files changed, 21 insertions(+), 14 deletions(-)
---
diff --git a/src/contacts-contact-editor.vala b/src/contacts-contact-editor.vala
index f3a8f81..d77db61 100644
--- a/src/contacts-contact-editor.vala
+++ b/src/contacts-contact-editor.vala
@@ -301,13 +301,13 @@ public class Contacts.ContactEditor : Grid {
/* Notify change to upper layer */
combo.changed.connect (() => {
- set_field_changed (row);
+ set_field_changed (get_current_row (combo));
});
value_entry.changed.connect (() => {
- set_field_changed (row);
+ set_field_changed (get_current_row (value_entry));
});
delete_button.clicked.connect (() => {
- remove_row (row);
+ remove_row (get_current_row (delete_button));
});
if (value == "")
@@ -332,10 +332,10 @@ public class Contacts.ContactEditor : Grid {
/* Notify change to upper layer */
value_entry.changed.connect (() => {
- set_field_changed (row);
+ set_field_changed (get_current_row (value_entry));
});
delete_button.clicked.connect_after (() => {
- remove_row (row);
+ remove_row (get_current_row (delete_button));
});
if (value == "")
@@ -368,10 +368,10 @@ public class Contacts.ContactEditor : Grid {
/* Notify change to upper layer */
value_text.get_buffer ().changed.connect (() => {
- set_field_changed (row);
+ set_field_changed (get_current_row (value_text));
});
delete_button.clicked.connect (() => {
- remove_row (row);
+ remove_row (get_current_row (delete_button));
/* eventually will need to check against the details type */
has_notes_row = false;
});
@@ -444,21 +444,21 @@ public class Contacts.ContactEditor : Grid {
/* Notify change to upper layer */
day_spin.changed.connect (() => {
- set_field_changed (row);
+ set_field_changed (get_current_row (day_spin));
});
combo.changed.connect (() => {
- set_field_changed (row);
+ set_field_changed (get_current_row (combo));
/* adjusting day_spin value using selected month constraints*/
fn ();
});
year_spin.changed.connect (() => {
- set_field_changed (row);
+ set_field_changed (get_current_row (year_spin));
fn ();
});
delete_button.clicked.connect (() => {
- remove_row (row);
+ remove_row (get_current_row (delete_button));
has_birthday_row = false;
});
}
@@ -481,13 +481,13 @@ public class Contacts.ContactEditor : Grid {
/* Notify change to upper layer */
combo.changed.connect (() => {
- set_field_changed (row);
+ set_field_changed (get_current_row (combo));
});
value_address.changed.connect (() => {
- set_field_changed (row);
+ set_field_changed (get_current_row (value_address));
});
delete_button.clicked.connect (() => {
- remove_row (row);
+ remove_row (get_current_row (delete_button));
});
focus_widget = value_address;
@@ -702,6 +702,13 @@ public class Contacts.ContactEditor : Grid {
}
}
+ int get_current_row (Widget child) {
+ int row;
+
+ container_grid.child_get (child, "top-attach", out row);
+ return row;
+ }
+
void insert_row_at (int idx) {
foreach (var field_maps in writable_personas.values) {
foreach (var field in field_maps.values) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]