glom r1402 - in trunk: . glom/mode_data



Author: murrayc
Date: Tue Jan 29 17:32:48 2008
New Revision: 1402
URL: http://svn.gnome.org/viewvc/glom?rev=1402&view=rev

Log:
2008-01-29  Murray Cumming  <murrayc murrayc com>

        * glom/mode_data/box_data_details.cc: on_flowtable_script_button_clicked():
        Make sure that we send the primary key value when refreshing after a button 
        was clicked. This fixes the bug that most of the fields were blanked after 
        clicking a button.


Added:
   trunk/glom/mode_data/box_data_calendar_related.cc
      - copied unchanged from r1389, /trunk/glom/mode_data/box_data_list_related.cc
   trunk/glom/mode_data/box_data_calendar_related.h
      - copied unchanged from r1389, /trunk/glom/mode_data/box_data_list_related.h
Modified:
   trunk/ChangeLog
   trunk/glom/mode_data/box_data_details.cc

Modified: trunk/glom/mode_data/box_data_details.cc
==============================================================================
--- trunk/glom/mode_data/box_data_details.cc	(original)
+++ trunk/glom/mode_data/box_data_details.cc	Tue Jan 29 17:32:48 2008
@@ -220,11 +220,11 @@
 
 bool Box_Data_Details::fill_from_database()
 {
-  //std::cout << "Box_Data_Details::fill_from_database(): m_primary_key_value=" << m_primary_Key_value.to_string() << std::endl;
+  //std::cout << "Box_Data_Details::fill_from_database(): m_primary_key_value=" << m_primary_key_value.to_string() << std::endl;
 
- //Don't try to open a connection if there is no document,
- //for instance, during application destruction.
- if(!get_document())
+  //Don't try to open a connection if there is no document,
+  //for instance, during application destruction.
+  if(!get_document())
     return false;
 
   bool bResult = false;
@@ -606,14 +606,15 @@
     execute_button_script(layout_item, primary_key_value);
 
     //Refresh the view, in case the script changed any data:
-    if(get_primary_key_is_in_foundset(m_found_set, m_primary_key_value)) //Check, because maybe the script deleted the current record, or changed something so that it should no longer be shown in the found set.
+    //(m_primary_key_value seems to be NULL here. We can use primary_key_value instead, but it's a bit strange. murrayc.)
+    if(get_primary_key_is_in_foundset(m_found_set, primary_key_value)) //Check, because maybe the script deleted the current record, or changed something so that it should no longer be shown in the found set.
     {
-      refresh_data_from_database_with_primary_key(m_primary_key_value);
+      refresh_data_from_database_with_primary_key(primary_key_value);
     }
     else
     {
       //Tell the parent to do something appropriate, such as show another record:
-      signal_record_deleted().emit(m_primary_key_value);
+      signal_record_deleted().emit(primary_key_value);
     }
   }
 }



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