[glom/maemo5] Maemo: Find: Use only the details view.



commit ebf27700a0f51aa5deb03b83a5a78a2474d65df2
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon Sep 28 16:07:49 2009 +0200

    Maemo: Find: Use only the details view.
    
    * glom/mode_find/notebook_find.[h|cc]: Hide the list view (and tabs) on Maemo.
    This needs to be a separate window too.

 ChangeLog                       |    7 +++++++
 glom/mode_data/notebook_data.cc |    2 +-
 glom/mode_find/notebook_find.cc |   29 ++++++++++++++++++++++-------
 glom/mode_find/notebook_find.h  |    4 ++++
 4 files changed, 34 insertions(+), 8 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 3abb514..8bf9d89 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2009-09-28  Murray Cumming  <murrayc murrayc com>
 
+	Maemo: Find: Use only the details view.
+	
+	* glom/mode_find/notebook_find.[h|cc]: Hide the list view (and tabs) on Maemo.
+	This needs to be a separate window too.
+
+2009-09-28  Murray Cumming  <murrayc murrayc com>
+
 	Maemo: Show the table name in the AppMenu. Added a Find Button.
 	
 	* glom/application.cc: update_window_title(): Update the picker button here 
diff --git a/glom/mode_data/notebook_data.cc b/glom/mode_data/notebook_data.cc
index 8f9f42d..c6fe000 100644
--- a/glom/mode_data/notebook_data.cc
+++ b/glom/mode_data/notebook_data.cc
@@ -86,7 +86,7 @@ Notebook_Data::Notebook_Data()
 #endif //GLOM_ENABLE_CLIENT_ONLY
 
 #ifdef GLOM_ENABLE_MAEMO
-  //TODO: Actually, show the details in a separate window.
+  //On Maemo we show the details in a separate window.
   set_show_tabs(false);
 #endif //GLOM_ENABLE_MAEMO
 }
diff --git a/glom/mode_find/notebook_find.cc b/glom/mode_find/notebook_find.cc
index f56efa6..605c740 100644
--- a/glom/mode_find/notebook_find.cc
+++ b/glom/mode_find/notebook_find.cc
@@ -28,37 +28,50 @@ Notebook_Find::Notebook_Find()
 : m_iPage_Details(0),
   m_iPage_List(0)
 {
-
+  #ifndef GLOM_ENABLE_MAEMO
   pages().push_back(Gtk::Notebook_Helpers::TabElem(m_Box_List, _("List")));
+  m_Box_List.signal_find_criteria.connect(sigc::mem_fun(*this, &Notebook_Find::on_page_find_criteria));
   m_iPage_List = 0;
+  m_iPage_Details = 1;
+  
+  //Fill composite view:
+  add_view(&m_Box_List);
+  #endif //GLOM_ENABLE_MAEMO
 
   pages().push_back(Gtk::Notebook_Helpers::TabElem(m_Box_Details, _("Details")));
-  m_iPage_Details = 1;
 
   set_current_page(m_iPage_Details); //Show the details page by default. It's more obvious for a Find.
   //TODO: Show the same layout that is being edited at the time that the mode was changed.
 
   //Connect Signals:
-  m_Box_List.signal_find_criteria.connect(sigc::mem_fun(*this, &Notebook_Find::on_page_find_criteria));
   m_Box_Details.signal_find_criteria.connect(sigc::mem_fun(*this, &Notebook_Find::on_page_find_criteria));
 
-  //Fill composite view:
-  add_view(&m_Box_List);
   add_view(&m_Box_Details);
 
   show_all_children();
+  
+  #ifdef GLOM_ENABLE_MAEMO
+  set_show_tabs(false);
+  #endif //GLOM_ENABLE_MAEMO
 }
 
 Notebook_Find::~Notebook_Find()
 {
+  #ifndef GLOM_ENABLE_MAEMO
   remove_view(&m_Box_List);
+  #endif
+  
   remove_view(&m_Box_Details);
 }
 
 bool Notebook_Find::init_db_details(const Glib::ustring& table_name, const Glib::ustring& layout_platform)
 {
-  bool result = m_Box_List.init_db_details(table_name, layout_platform);
-
+  bool result = true;
+   
+  #ifndef GLOM_ENABLE_MAEMO
+  result = m_Box_List.init_db_details(table_name, layout_platform);
+  #endif
+  
   m_Box_Details.init_db_details(table_name, layout_platform);
 
   return result;
@@ -72,9 +85,11 @@ void Notebook_Find::on_page_find_criteria(const Glib::ustring& where_clause)
 
 void Notebook_Find::set_current_view(Notebook_Data::dataview view)
 {
+  #ifndef GLOM_ENABLE_MAEMO
   if(view == Notebook_Data::DATA_VIEW_List)
     set_current_page(m_iPage_List);
   else
+  #endif //GLOM_ENABLE_MAEMO
     set_current_page(m_iPage_Details);
 }
 
diff --git a/glom/mode_find/notebook_find.h b/glom/mode_find/notebook_find.h
index acba9b2..a91d7fd 100644
--- a/glom/mode_find/notebook_find.h
+++ b/glom/mode_find/notebook_find.h
@@ -51,7 +51,11 @@ private:
   void on_page_find_criteria(const Glib::ustring& where_clause);
 
   //Member widgets:
+  #ifndef GLOM_ENABLE_MAEMO
+  //The list view has no way to enter data on Maemo:
   Box_Data_List_Find m_Box_List;
+  #endif //GLOM_ENABLE_MAEMO
+  
   Box_Data_Details_Find m_Box_Details;
 
   guint m_iPage_Details, m_iPage_List;



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