glom r1604 - in trunk: . glom glom/mode_data glom/mode_find



Author: murrayc
Date: Tue May  6 12:32:38 2008
New Revision: 1604
URL: http://svn.gnome.org/viewvc/glom?rev=1604&view=rev

Log:
2008-05-06  Murray Cumming  <murrayc murrayc com>

* glom/mode_data/notebook_data.cc: init_db_details():
Fix an if to avoid showing the list view when we want the details view, 
just because the details view is already showing.
* glom/mode_data/notebook_data.h 
* glom/mode_find/notebook_find.h 
* glom/notebook_glom.h: Removed some unnecessary virtuals.

Modified:
   trunk/ChangeLog
   trunk/glom/frame_glom.cc
   trunk/glom/frame_glom.h
   trunk/glom/mode_data/notebook_data.cc
   trunk/glom/mode_data/notebook_data.h
   trunk/glom/mode_find/notebook_find.h
   trunk/glom/notebook_glom.h

Modified: trunk/glom/frame_glom.cc
==============================================================================
--- trunk/glom/frame_glom.cc	(original)
+++ trunk/glom/frame_glom.cc	Tue May  6 12:32:38 2008
@@ -395,6 +395,7 @@
             found_set.m_sort_clause.push_back( type_pair_sort_field(layout_item_sort, true /* ascending */) );
         }
 
+        //Show the wanted records in the notebook, showing details for a particular record if wanted:
         m_Notebook_Data.init_db_details(found_set, primary_key_value_for_details);
         set_mode_widget(m_Notebook_Data);
 
@@ -2077,8 +2078,8 @@
 
 void Frame_Glom::on_notebook_data_record_details_requested(const Glib::ustring& table_name, Gnome::Gda::Value primary_key_value)
 {
+  //Specifying a primary key value causes the details tab to be shown:
   show_table(table_name, primary_key_value);
-  //m_Notebook_Data.show_details(primary_key_value);
 }
 
 void Frame_Glom::update_records_count()

Modified: trunk/glom/frame_glom.h
==============================================================================
--- trunk/glom/frame_glom.h	(original)
+++ trunk/glom/frame_glom.h	Tue May  6 12:32:38 2008
@@ -173,7 +173,13 @@
 
   //virtual void set_document(Document_Glom* pDocument); //override
 
+  /** Show the table, possibly selecting a particular record, possibly showing that in the details tab.
+   *
+   * @param table_name The database table to show.
+   * @param primary_key_value_for_details If specified, switch to the details view, and show this record.
+   */
   void show_table(const Glib::ustring& table_name, const Gnome::Gda::Value& primary_key_value_for_details = Gnome::Gda::Value());
+    
   void show_table_title();
   void update_table_in_document_from_database();
 

Modified: trunk/glom/mode_data/notebook_data.cc
==============================================================================
--- trunk/glom/mode_data/notebook_data.cc	(original)
+++ trunk/glom/mode_data/notebook_data.cc	Tue May  6 12:32:38 2008
@@ -68,7 +68,7 @@
 bool Notebook_Data::init_db_details(const FoundSet& found_set, const Gnome::Gda::Value& primary_key_value_for_details)
 {
   m_table_name = found_set.m_table_name;
-  //std::cout << "Notebook_Data::init_db_details: table_name=" << m_table_name << std::endl;
+  //std::cout << "Notebook_Data::init_db_details: table_name=" << m_table_name << ", primary_key_value_for_details=" << primary_key_value_for_details.to_string() << std::endl;
 
   const bool details_record_specified = !Conversions::value_is_empty(primary_key_value_for_details);
 
@@ -142,6 +142,8 @@
 
         m_Box_Details.init_db_details(found_set, primary_key_for_details);
       }
+      else
+        std::cerr << "Notebook_Data::init_db_details(): document is NULL" << std::endl;
     //}
   }
 
@@ -151,9 +153,11 @@
 
   //Select the last-viewed layout, or the details layout, if a specific details record was specified:
   const dataview current_view = get_current_view();
-  if(details_record_specified && (current_view != DATA_VIEW_Details))
+  
+  if(details_record_specified)
   {
-    set_current_view(DATA_VIEW_Details);
+    if(current_view != DATA_VIEW_Details)
+      set_current_view(DATA_VIEW_Details);
   }
   else
   {

Modified: trunk/glom/mode_data/notebook_data.h
==============================================================================
--- trunk/glom/mode_data/notebook_data.h	(original)
+++ trunk/glom/mode_data/notebook_data.h	Tue May  6 12:32:38 2008
@@ -34,8 +34,12 @@
   Notebook_Data();
   virtual ~Notebook_Data();
 
-  //Create the layout for the database structure, and fill it with data.
-  virtual bool init_db_details(const FoundSet& found_set, const Gnome::Gda::Value& primary_key_value_for_details = Gnome::Gda::Value());
+  /** Create the layout for the database structure, and fill it with data.
+   * @param found_set Specifies a found sub-set of the table's records, or all records.
+   * @param primary_key_value_for_details Specifies a single record to show in the details tab, if specified.
+   * @result true if the operation was successful.
+   */
+  bool init_db_details(const FoundSet& found_set, const Gnome::Gda::Value& primary_key_value_for_details = Gnome::Gda::Value());
 
   ///Get the existing where clause, previously supplied to init_db_details().
   FoundSet get_found_set() const;
@@ -44,9 +48,9 @@
   FoundSet get_found_set_details() const;
 
   ///Show the details for a particular record, without affecting the list view:
-  virtual void show_details(const Gnome::Gda::Value& primary_key_value);
+  void show_details(const Gnome::Gda::Value& primary_key_value);
 
-  virtual void select_page_for_find_results(); //Details for 1, List for > 1.
+  void select_page_for_find_results(); //Details for 1, List for > 1.
 
 #ifndef GLOM_ENABLE_CLIENT_ONLY
   virtual void do_menu_developer_layout(); //override
@@ -70,7 +74,7 @@
 
 protected:
 
-  ///Show the counts of all records and found records:
+  ///Show the counts of all records and found records.
   void update_records_count();
 
   //Signal handlers:

Modified: trunk/glom/mode_find/notebook_find.h
==============================================================================
--- trunk/glom/mode_find/notebook_find.h	(original)
+++ trunk/glom/mode_find/notebook_find.h	Tue May  6 12:32:38 2008
@@ -34,7 +34,7 @@
   Notebook_Find();
   virtual ~Notebook_Find();
 
-  virtual bool init_db_details(const Glib::ustring& table_name);
+  bool init_db_details(const Glib::ustring& table_name);
 
   void set_current_view(Notebook_Data::dataview view);
 
@@ -48,7 +48,7 @@
 
 
   //Signal handlers:
-  virtual void on_page_find_criteria(const Glib::ustring& where_clause);
+  void on_page_find_criteria(const Glib::ustring& where_clause);
 
   //Member widgets:
   Box_Data_List_Find m_Box_List;

Modified: trunk/glom/notebook_glom.h
==============================================================================
--- trunk/glom/notebook_glom.h	(original)
+++ trunk/glom/notebook_glom.h	Tue May  6 12:32:38 2008
@@ -44,18 +44,19 @@
   //typedef sigc::signal<void, guint> type_signal_leave_page;
   // type_signal_leave_page signal_leave_page();
 
+  //Overridden by derived classes:
   virtual void do_menu_developer_layout();
   virtual void do_menu_file_print();
 
 protected:
 
-  virtual void on_show();
+  void on_show();
 
   Gtk::Window* get_app_window();
 
   //Signal handlers:
-  virtual void on_switch_page_handler(GtkNotebookPage* pPage, guint uiPageNumber);  //The _handler suffix is to avoid overriding the base class's method.
-  virtual void on_leave_page(guint uiPageNumber);
+  void on_switch_page_handler(GtkNotebookPage* pPage, guint uiPageNumber);  //The _handler suffix is to avoid overriding the base class's method.
+  void on_leave_page(guint uiPageNumber);
 
   //type_signal_leave_page m_signal_leave_page; //Signals when the user leaves a page.
 



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