[glom/maemo5] Maemo: Show the table name in the AppMenu. Added a Find Button.



commit 904bdae97be7234b712b7a570c9bd082658024c6
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon Sep 28 15:54:58 2009 +0200

    Maemo: Show the table name in the AppMenu. Added a Find Button.
    
    * glom/application.cc: update_window_title(): Update the picker button here
    too.
    init_menus(): Add a Find button for the AppMenu.
    * glom/navigation/maemo/pickerbutton_table.cc: set_table_name(): Actually
    set the row as active.
    * glom/dialog_existing_or_new.cc: Make sure the first row is visible,
    even on Maemo. Otherwise it looks strange.

 ChangeLog                                   |   12 ++++++++++++
 glom/application.cc                         |   18 +++++++++++++++++-
 glom/dialog_existing_or_new.cc              |   10 +++++++++-
 glom/import_csv/csv_parser.cc               |    2 +-
 glom/navigation/maemo/pickerbutton_table.cc |    4 ++--
 5 files changed, 41 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 688641c..3abb514 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 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 
+	too.
+	init_menus(): Add a Find button for the AppMenu.
+	* glom/navigation/maemo/pickerbutton_table.cc: set_table_name(): Actually 
+	set the row as active.
+	* glom/dialog_existing_or_new.cc: Make sure the first row is visible, 
+	even on Maemo. Otherwise it looks strange.
+	
+2009-09-28  Murray Cumming  <murrayc murrayc com>
+
 	Initial dialog: Expand the network item.
 
 	* glom/dialog_existing_or_new.cc: Constructor: Expand the Network 
diff --git a/glom/application.cc b/glom/application.cc
index 07d741b..970bfe2 100644
--- a/glom/application.cc
+++ b/glom/application.cc
@@ -364,7 +364,18 @@ void App_Glom::init_menus()
   m_appmenu_button_table.signal_value_changed().connect(
     sigc::mem_fun(*this, &App_Glom::on_appmenu_button_table_value_changed) );
   m_maemo_appmenu.append(m_appmenu_button_table);
-
+  
+  Hildon::Button* find_button = 
+    Gtk::manage(new Hildon::Button(
+      Gtk::Hildon::SIZE_AUTO, 
+      Hildon::BUTTON_ARRANGEMENT_VERTICAL,
+      _("Find"),
+      _("Search for records in the table.")));
+  find_button->show();
+  find_button->signal_clicked().connect(
+    sigc::mem_fun(*m_pFrame, &Frame_Glom::on_menu_Mode_Find) );
+  m_maemo_appmenu.append(*find_button);
+  
   //set_app_menu(*appmenu); //TODO: Use this instead?
   Hildon::Program::get_instance()->set_common_app_menu(m_maemo_appmenu);
 }
@@ -2491,6 +2502,11 @@ void App_Glom::update_window_title()
   strTitle +=  " - " + m_strAppName;
 
   set_title(strTitle);
+  
+  #ifdef GLOM_ENABLE_MAEMO
+  //Update the picker button too:
+  m_appmenu_button_table.set_table_name(table_name);
+  #endif //GLOM_ENABLE_MAEMO
 }
 
 
diff --git a/glom/dialog_existing_or_new.cc b/glom/dialog_existing_or_new.cc
index 5591856..0601a28 100644
--- a/glom/dialog_existing_or_new.cc
+++ b/glom/dialog_existing_or_new.cc
@@ -50,9 +50,12 @@ namespace
 {
 
 const char* RECENT_DUMMY_TEXT = N_("No recently used documents available.");
-const char* TEMPLATE_DUMMY_TEXT = N_("No templates available.");
 const char* NETWORK_DUMMY_TEXT = N_("No sessions found on the local network.");
 
+#ifdef GLOM_ENABLE_CLIENT_ONLY
+const char* TEMPLATE_DUMMY_TEXT = N_("No templates available.");
+#endif
+
 //TODO_Performance: A DomParser or XmlReader might be faster, or even a regex.
 /// Reads the title of an example from the first few characters of the XML.
 class Parser: public xmlpp::SaxParser
@@ -249,6 +252,11 @@ Dialog_ExistingOrNew::Dialog_ExistingOrNew(BaseObjectType* cobject, const Glib::
   m_notebook->set_show_tabs(false);
 #endif /* !GLOM_ENABLE_CLIENT_ONLY */
     
+  //Make sure the first item is visible, 
+  //which is not always the case on Maemo. 
+  m_existing_view->scroll_to_row( 
+    Gtk::TreeModel::Path(m_iter_existing_other) );
+
   update_ui_sensitivity();
 }
 
diff --git a/glom/import_csv/csv_parser.cc b/glom/import_csv/csv_parser.cc
index d901d89..938e2a1 100644
--- a/glom/import_csv/csv_parser.cc
+++ b/glom/import_csv/csv_parser.cc
@@ -511,7 +511,7 @@ void CsvParser::on_buffer_read(const Glib::RefPtr<Gio::AsyncResult>& result)
   const gssize size = m_stream->read_finish(result, error);
   if (!error.get())
   {
-    copy_buffer_and_continue_reading(size)
+    copy_buffer_and_continue_reading(size);
   }
   else
   {
diff --git a/glom/navigation/maemo/pickerbutton_table.cc b/glom/navigation/maemo/pickerbutton_table.cc
index 0ee7ad1..2ff4763 100644
--- a/glom/navigation/maemo/pickerbutton_table.cc
+++ b/glom/navigation/maemo/pickerbutton_table.cc
@@ -92,13 +92,13 @@ void PickerButton_Table::set_table_name(const Glib::ustring& table_name)
 
     if(this_text == table_name)
     {
-      //TODO: set_selected(iter);
+      m_touchselector.set_active(0, iter);
       return; //success
     }
   }
 
   //Not found, so mark it as blank:
-  std::cerr << "PickerButton_Table::set_table_name(): table_name not found in list: " << table_name << std::endl;
+  //std::cerr << "PickerButton_Table::set_table_name(): table_name not found in list: " << table_name << std::endl;
   //TODO: unset_active();
 }
 



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