[glom/maemo5] Maemo: When adding related records, show the foreign key value.



commit 2ce72878963292d5e37b952c97f376f2943291d6
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Oct 16 12:30:49 2009 +0200

    Maemo: When adding related records, show the foreign key value.
    
    * glom/mode_data/box_data_portal.cc: on_maemo_appmenubutton_add():
    Actually show the field value that links the new related record to the
    parent record, though this is a bit hacky and will only work for
    autogenerated keys.

 ChangeLog                         |    9 +++++++++
 glom/mode_data/box_data_portal.cc |    5 ++++-
 2 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 78f95c7..d1c7f2f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2009-10-16  Murray Cumming  <murrayc murrayc com>
 
+	Maemo: When adding related records, show the foreign key value.
+	
+	* glom/mode_data/box_data_portal.cc: on_maemo_appmenubutton_add():
+	Actually show the field value that links the new related record to the 
+	parent record, though this is a bit hacky and will only work for 
+	autogenerated keys.
+
+2009-10-16  Murray Cumming  <murrayc murrayc com>
+
 	Maemo: Actually show new related record in the list.
 	
 	* glom/mode_data/box_data_portal.[h|cc]: on_maemo_appmenubutton_add():
diff --git a/glom/mode_data/box_data_portal.cc b/glom/mode_data/box_data_portal.cc
index 41f08c1..8dc5f4c 100644
--- a/glom/mode_data/box_data_portal.cc
+++ b/glom/mode_data/box_data_portal.cc
@@ -171,11 +171,14 @@ void Box_Data_Portal::on_maemo_appmenubutton_add()
   m_box_maemo_details->do_new_record(); //Doesn't block.
   
   //Make the new record related:
-  //TODO: Test that this works if the primary key is not auto-generated.
+  //TODO: This only makes sense if the primary key is not auto-generated.
   related_record_primary_key_value = 
     m_box_maemo_details->get_primary_key_value_selected();
   make_record_related(related_record_primary_key_value);
   
+  //Show the data in the UI:
+  m_box_maemo_details->refresh_data_from_database_with_primary_key(related_record_primary_key_value);
+  
   m_window_maemo_details->show();
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]