glom r1717 - in trunk: . glom glom/libglom/data_structure/layout glom/libglom/document glom/libglom/python_embed glom/mode_data glom/mode_design/print_layouts glom/mode_find glom/utility_widgets po



Author: murrayc
Date: Wed Nov  5 02:06:48 2008
New Revision: 1717
URL: http://svn.gnome.org/viewvc/glom?rev=1717&view=rev

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

* glom/application.[h|cc]: init_menus(): Added Developer/ActivePlatform 
sub menu.

* glom/libglom/document/document_glom.[h|cc]:
Added set/get_active_layout_platform(), and 
set/get_default_layout_platform().
get_data_layout_groups_default(), get_data_layout_groups_plus_new_fields(),
set/get_data_layout_groups(), get_data_layout_groups_have_any_fields():
Added a layout_platform parameters.
load_after(), save_before(): Save the layout_platform for each layout.
* glom/frame_glom.cc: show_table(), on_menu_file_export():
* glom/mode_data/notebook_data.[h|cc]: init_db_details(),
  on_switch_page_handler():
* glom/mode_data/box_data.[h|cc]: init_db_details(),
  get_table_fields_to_show(), get_data_layout_groups()
* glom/mode_data/box_data_calendar_related.cc: init_db_details(),
  prepare_layout_dialog():
* glom/mode_data/box_data_details.cc: init_db_details(),
  create_layout(), on_button_new(),
  on_flowtable_layout_changed(), print_layout(),
  prepare_layout_dialog():
* glom/mode_data/box_data_list.cc: on_adddel_user_reordered_columns(),
  create_layout_get_layout(), prepare_layout_dialog():
* glom/mode_data/box_data_list_related.cc: init_db_details(), 
  prepare_layout_dialog():
* glom/mode_data/box_data_portal.cc: init_db_details():
* glom/mode_data/dialog_layout.[h|cc]: set_document():
* glom/mode_data/dialog_layout_calendar_related.[h|cc]: set_document():
* glom/mode_data/dialog_layout_details.[h|cc]: set_document(), 
  save_to_document():
* glom/mode_data/dialog_layout_list_related.[h|cc]: set_document():
* glom/mode_find/notebook_find.[h|cc]:
* glom/mode_find/box_data_details_find.[h|cc]:
* glom/mode_find/box_data_list_find.[h|cc]
* glom/utility_widgets/datawidget.cc: offer_related_record_id_find():
* glom/utility_widgets/dialog_choose_id.[h|cc]: on_box_find_criteria(),
  init_db_details():
* glom/utility_widgets/dialog_layoutitem_properties.[h|cc]:

Adapted to changed Document_Glom API, taking note of the active platform.

This allows people to define a different layout to be used when running 
on a Maemo platform.

* glom/libglom/python_embed/py_glom_record.cc:
* glom/libglom/python_embed/py_glom_related.cc:
Added some casts to avoid warnings about literal to char* conversions. 

Modified:
   trunk/ChangeLog
   trunk/glom/application.cc
   trunk/glom/application.h
   trunk/glom/base_db.cc
   trunk/glom/frame_glom.cc
   trunk/glom/libglom/data_structure/layout/layoutitem_field.h
   trunk/glom/libglom/document/document_glom.cc
   trunk/glom/libglom/document/document_glom.h
   trunk/glom/libglom/python_embed/py_glom_record.cc
   trunk/glom/libglom/python_embed/py_glom_related.cc
   trunk/glom/mode_data/box_data.cc
   trunk/glom/mode_data/box_data.h
   trunk/glom/mode_data/box_data_calendar_related.cc
   trunk/glom/mode_data/box_data_details.cc
   trunk/glom/mode_data/box_data_details.h
   trunk/glom/mode_data/box_data_list.cc
   trunk/glom/mode_data/box_data_list_related.cc
   trunk/glom/mode_data/box_data_portal.cc
   trunk/glom/mode_data/dialog_layout.cc
   trunk/glom/mode_data/dialog_layout.h
   trunk/glom/mode_data/dialog_layout_calendar_related.cc
   trunk/glom/mode_data/dialog_layout_calendar_related.h
   trunk/glom/mode_data/dialog_layout_details.cc
   trunk/glom/mode_data/dialog_layout_details.h
   trunk/glom/mode_data/dialog_layout_list_related.cc
   trunk/glom/mode_data/dialog_layout_list_related.h
   trunk/glom/mode_data/notebook_data.cc
   trunk/glom/mode_design/print_layouts/canvas_print_layout.cc
   trunk/glom/mode_find/box_data_details_find.cc
   trunk/glom/mode_find/box_data_details_find.h
   trunk/glom/mode_find/box_data_list_find.cc
   trunk/glom/mode_find/box_data_list_find.h
   trunk/glom/mode_find/notebook_find.cc
   trunk/glom/mode_find/notebook_find.h
   trunk/glom/utility_widgets/checkglom.cc
   trunk/glom/utility_widgets/checkglom.h
   trunk/glom/utility_widgets/datawidget.cc
   trunk/glom/utility_widgets/dialog_choose_id.cc
   trunk/glom/utility_widgets/dialog_choose_id.h
   trunk/glom/utility_widgets/dialog_layoutitem_properties.cc
   trunk/glom/utility_widgets/dialog_layoutitem_properties.h
   trunk/po/Makefile.in.in

Modified: trunk/glom/application.cc
==============================================================================
--- trunk/glom/application.cc	(original)
+++ trunk/glom/application.cc	Wed Nov  5 02:06:48 2008
@@ -485,9 +485,26 @@
   m_listDeveloperActions.push_back(action);
   m_refActionGroup_Others->add(action, sigc::mem_fun(*this, &App_Glom::on_menu_developer_translations));
 
-  action = Gtk::ToggleAction::create("GlomAction_Menu_Developer_ShowLayoutToolbar", _("_Show Layout Toolbar"));
+
+  //"Active Platform" menu:
+  action =  Gtk::Action::create("Glom_Menu_Developer_ActivePlatform", _("_Active Platform"));
+  m_refActionGroup_Others->add(action);
+  Gtk::RadioAction::Group group_active_platform;
+
+  action = Gtk::RadioAction::create(group_active_platform, "GlomAction_Menu_Developer_ActivePlatform_Normal", 
+    _("_Normal"), _("The layout to use for normal desktop environments."));
+  m_listDeveloperActions.push_back(action);
+  m_refActionGroup_Others->add(action, sigc::mem_fun(*this, &App_Glom::on_menu_developer_active_platform_normal));
+
+  action = Gtk::RadioAction::create(group_active_platform, "GlomAction_Menu_Developer_ActivePlatform_Maemo",
+    _("_Maemo"), _("The layout to use for Maemo devices."));
   m_listDeveloperActions.push_back(action);
-  m_refActionGroup_Others->add(action, sigc::mem_fun(*this, &App_Glom::on_menu_developer_show_layout_toolbar));
+  m_refActionGroup_Others->add(action, sigc::mem_fun(*this, &App_Glom::on_menu_developer_active_platform_maemo));
+
+
+  m_action_show_layout_toolbar = Gtk::ToggleAction::create("GlomAction_Menu_Developer_ShowLayoutToolbar", _("_Show Layout Toolbar"));
+  m_listDeveloperActions.push_back(m_action_show_layout_toolbar);
+  m_refActionGroup_Others->add(m_action_show_layout_toolbar, sigc::mem_fun(*this, &App_Glom::on_menu_developer_show_layout_toolbar));
 
 #endif // !GLOM_ENABLE_CLIENT_ONLY
 
@@ -541,6 +558,10 @@
     "        <menuitem action='GlomAction_Menu_Developer_Translations' />"
     "        <menuitem action='GlomAction_Menu_Developer_ChangeLanguage' />"
     "        <separator />"
+    "        <menu action='Glom_Menu_Developer_ActivePlatform'>"
+    "          <menuitem action='GlomAction_Menu_Developer_ActivePlatform_Normal' />"
+    "          <menuitem action='GlomAction_Menu_Developer_ActivePlatform_Maemo' />"
+    "        </menu>"
     "        <menuitem action='GlomAction_Menu_Developer_ShowLayoutToolbar' />"
     "      </menu>"
 #endif // !GLOM_ENABLE_CLIENT_ONLY
@@ -565,11 +586,11 @@
 #ifndef GLOM_ENABLE_CLIENT_ONLY
 void App_Glom::on_menu_userlevel_developer()
 {
-  if(m_pFrame)
-    m_pFrame->on_menu_userlevel_Developer(m_action_menu_userlevel_developer, m_action_menu_userlevel_operator);
-  Glib::RefPtr<Gtk::ToggleAction> action = Glib::RefPtr<Gtk::ToggleAction>::cast_dynamic(
-    m_refActionGroup_Others->get_action ("GlomAction_Menu_Developer_ShowLayoutToolbar"));
-  m_pFrame->show_layout_toolbar(action->get_active());
+  if(!m_pFrame)
+    return;
+
+  m_pFrame->on_menu_userlevel_Developer(m_action_menu_userlevel_developer, m_action_menu_userlevel_operator);
+  m_pFrame->show_layout_toolbar(m_action_show_layout_toolbar->get_active());
 }
 
 void App_Glom::on_menu_userlevel_operator()
@@ -827,8 +848,10 @@
 #else
   std::auto_ptr<Gnome::Glade::XmlError> error;
   Glib::RefPtr<Gnome::Glade::Xml> refXml = Gnome::Glade::Xml::create(Utils::get_glade_file_path("glom.glade"), "window_main", "", error);
-  if(error.get()) return NULL;
+  if(error.get())
+    return 0;
 #endif
+
   App_Glom* pApp_Glom = 0;
   refXml->get_widget_derived("window_main", pApp_Glom);
 
@@ -1930,7 +1953,7 @@
         //const type_vecFields vec_fields = document->get_table_fields(table_name);
 
         //export_data_to_stream() needs a type_list_layout_groups;
-        Document_Glom::type_list_layout_groups sequence = document->get_data_layout_groups_default("list", table_name);
+        Document_Glom::type_list_layout_groups sequence = document->get_data_layout_groups_default("list", table_name, "" /* layout_platform */);
 
         //std::cout << "debug: table_name=" << table_name << std::endl;
 
@@ -2331,11 +2354,27 @@
   }
 }
 
+void App_Glom::on_menu_developer_active_platform_normal()
+{
+  Document_Glom* document = dynamic_cast<Document_Glom*>(get_document());
+  if(document)
+   document->set_active_layout_platform("");
+
+  m_pFrame->show_table_refresh();
+}
+
+void App_Glom::on_menu_developer_active_platform_maemo()
+{
+  Document_Glom* document = dynamic_cast<Document_Glom*>(get_document());
+  if(document)
+   document->set_active_layout_platform("maemo");
+
+  m_pFrame->show_table_refresh();
+}
+
 void App_Glom::on_menu_developer_show_layout_toolbar()
 {
-  Glib::RefPtr<Gtk::ToggleAction> action = Glib::RefPtr<Gtk::ToggleAction>::cast_dynamic(
-    m_refActionGroup_Others->get_action ("GlomAction_Menu_Developer_ShowLayoutToolbar"));
-  m_pFrame->show_layout_toolbar (action->get_active());
+  m_pFrame->show_layout_toolbar(m_action_show_layout_toolbar->get_active());
 }
 
 

Modified: trunk/glom/application.h
==============================================================================
--- trunk/glom/application.h	(original)
+++ trunk/glom/application.h	Wed Nov  5 02:06:48 2008
@@ -105,9 +105,12 @@
   void on_menu_file_save_as_example();
   void on_menu_developer_changelanguage();
   void on_menu_developer_translations();
-  void on_window_translations_hide();
+  void on_menu_developer_active_platform_normal();
+  void on_menu_developer_active_platform_maemo();
   void on_menu_developer_show_layout_toolbar();
 
+  void on_window_translations_hide();
+
   virtual Glib::ustring ui_file_select_save(const Glib::ustring& old_file_uri); //overridden.
   void on_userlevel_changed(AppState::userlevels userlevel);
 
@@ -148,6 +151,7 @@
   Glib::RefPtr<Gtk::Action> m_action_mode_data, m_action_mode_find;
 #ifndef GLOM_ENABLE_CLIENT_ONLY
   Glib::RefPtr<Gtk::RadioAction> m_action_menu_userlevel_developer, m_action_menu_userlevel_operator;
+  Glib::RefPtr<Gtk::ToggleAction> m_action_show_layout_toolbar;
 #endif // !GLOM_ENABLE_CLIENT_ONLY
 
   Gtk::VBox* m_pBoxTop;
@@ -183,7 +187,7 @@
   //we already asked for them when getting the document over the network,
   //so we can use them again when connecting directly to the database:
   Glib::ustring m_temp_username, m_temp_password;
-	
+
   bool m_show_sql_debug;
 };
 

Modified: trunk/glom/base_db.cc
==============================================================================
--- trunk/glom/base_db.cc	(original)
+++ trunk/glom/base_db.cc	Wed Nov  5 02:06:48 2008
@@ -69,10 +69,6 @@
   {
   }
 
-  virtual ~predicate_LayoutItemIsEqual()
-  {
-  }
-
   bool operator() (const sharedptr<const T_Element>& layout_item) const
   {
     if(!m_layout_item && !layout_item)

Modified: trunk/glom/frame_glom.cc
==============================================================================
--- trunk/glom/frame_glom.cc	(original)
+++ trunk/glom/frame_glom.cc	Wed Nov  5 02:06:48 2008
@@ -409,7 +409,7 @@
       case(MODE_Find):
       {
         strMode = _("Find");
-        m_Notebook_Find.init_db_details(m_table_name);
+        m_Notebook_Find.init_db_details(m_table_name, get_document()->get_active_layout_platform());
         set_mode_widget(m_Notebook_Find);
         break;
       }
@@ -519,7 +519,11 @@
 {
   //Start with a sequence based on the Details view:
   //The user can changed this by clicking the button in the FileChooser:
-  Document_Glom::type_list_layout_groups mapGroupSequence =  get_document()->get_data_layout_groups_plus_new_fields("details", m_table_name);
+  Document_Glom* document = get_document();
+  if(!document)
+    return;
+
+  Document_Glom::type_list_layout_groups mapGroupSequence = document->get_data_layout_groups_plus_new_fields("details", document->get_active_layout_platform(), m_table_name);
 
   Gtk::Window* pWindowApp = get_app_window();
   g_assert(pWindowApp);

Modified: trunk/glom/libglom/data_structure/layout/layoutitem_field.h
==============================================================================
--- trunk/glom/libglom/data_structure/layout/layoutitem_field.h	(original)
+++ trunk/glom/libglom/data_structure/layout/layoutitem_field.h	Wed Nov  5 02:06:48 2008
@@ -43,10 +43,6 @@
     m_layout_item = layout_item;
   }
 
-  virtual ~predicate_LayoutItem_Field_IsSameField()
-  {
-  }
-
   bool operator() (const sharedptr<const T_Element>& element)
   {
     const bool result = (m_layout_item->get_name() == element->get_name());

Modified: trunk/glom/libglom/document/document_glom.cc
==============================================================================
--- trunk/glom/libglom/document/document_glom.cc	(original)
+++ trunk/glom/libglom/document/document_glom.cc	Wed Nov  5 02:06:48 2008
@@ -62,6 +62,7 @@
 
 #define GLOM_NODE_DATA_LAYOUTS "data_layouts"
 #define GLOM_NODE_DATA_LAYOUT "data_layout"
+#define GLOM_ATTRIBUTE_LAYOUT_PLATFORM "platform"
 #define GLOM_ATTRIBUTE_PARENT_TABLE_NAME "parent_table"
 
 #define GLOM_NODE_DATA_LAYOUT_NOTEBOOK "data_layout_notebook"
@@ -1340,13 +1341,13 @@
   }
 }
 
-Document_Glom::type_list_layout_groups Document_Glom::get_data_layout_groups_default(const Glib::ustring& layout_name, const Glib::ustring& parent_table_name) const
+Document_Glom::type_list_layout_groups Document_Glom::get_data_layout_groups_default(const Glib::ustring& layout_name, const Glib::ustring& parent_table_name, const Glib::ustring& layout_platform) const
 {
   //std::cout << "debug: Document_Glom::get_data_layout_groups_default(): table_name = " << parent_table_name << std::endl;
 
   type_list_layout_groups result;
 
- //Add one if necessary:
+  //Add one if necessary:
   sharedptr<LayoutGroup> pTopLevel;
   sharedptr<LayoutGroup> pOverview;
   sharedptr<LayoutGroup> pDetails;
@@ -1357,7 +1358,7 @@
   result.push_back(group);
   pTopLevel = group;
 
-  if(layout_name == "details") //The Details default layOut is a bit more complicated.
+  if(layout_name == "details") //The Details default layout is a bit more complicated.
   {
     sharedptr<LayoutGroup> overview = sharedptr<LayoutGroup>::create();;
     overview->set_name("overview");
@@ -1423,9 +1424,9 @@
   return result;
 }
 
-Document_Glom::type_list_layout_groups Document_Glom::get_data_layout_groups_plus_new_fields(const Glib::ustring& layout_name, const Glib::ustring& parent_table_name) const
+Document_Glom::type_list_layout_groups Document_Glom::get_data_layout_groups_plus_new_fields(const Glib::ustring& layout_name, const Glib::ustring& parent_table_name, const Glib::ustring& layout_platform) const
 {
-  type_list_layout_groups result = get_data_layout_groups(layout_name, parent_table_name);
+  type_list_layout_groups result = get_data_layout_groups(layout_name, parent_table_name, layout_platform);
 
   //If there are no fields in the layout, then add a default:
   bool create_default = false;
@@ -1435,18 +1436,18 @@
 
   if(create_default)
   {
-    result = get_data_layout_groups_default(layout_name, parent_table_name);
+    result = get_data_layout_groups_default(layout_name, parent_table_name, layout_platform);
     
     //Store this so we don't have to recreate it next time:
     Document_Glom* nonconst_this = const_cast<Document_Glom*>(this); //TODO: This is not ideal.
-    nonconst_this->set_data_layout_groups(layout_name, parent_table_name, result);
+    nonconst_this->set_data_layout_groups(layout_name, parent_table_name, layout_platform, result);
     nonconst_this->set_modified(false); //This might have happened in operator mode, but in that case we don't really need to save it, or mark the document as unsaved.
   }
 
   return result;  
 }
 
-Document_Glom::type_list_layout_groups Document_Glom::get_data_layout_groups(const Glib::ustring& layout_name, const Glib::ustring& parent_table_name) const
+Document_Glom::type_list_layout_groups Document_Glom::get_data_layout_groups(const Glib::ustring& layout_name, const Glib::ustring& parent_table_name, const Glib::ustring& layout_platform) const
 {
   type_tables::const_iterator iterFind = m_tables.find(parent_table_name);
   if(iterFind != m_tables.end())
@@ -1454,7 +1455,7 @@
     const DocumentTableInfo& info = iterFind->second;
 
     //Look for the layout with this name:
-    DocumentTableInfo::type_layouts::const_iterator iter = std::find_if(info.m_layouts.begin(), info.m_layouts.end(), predicate_Layout<LayoutInfo>(parent_table_name, layout_name));
+    DocumentTableInfo::type_layouts::const_iterator iter = std::find_if(info.m_layouts.begin(), info.m_layouts.end(), predicate_Layout<LayoutInfo>(parent_table_name, layout_name, layout_platform));
     if(iter != info.m_layouts.end())
     {
       return iter->m_layout_groups; //found
@@ -1464,10 +1465,10 @@
   return type_list_layout_groups(); //not found
 }
 
-bool Document_Glom::get_data_layout_groups_have_any_fields(const Glib::ustring& layout_name, const Glib::ustring& parent_table_name) const
+bool Document_Glom::get_data_layout_groups_have_any_fields(const Glib::ustring& layout_name, const Glib::ustring& parent_table_name, const Glib::ustring& layout_platform) const
 {
   //TODO_Performance: This could make the response to some button slow, such as the Add button, which does a check for this.
-  type_list_layout_groups layout_groups = get_data_layout_groups(layout_name, parent_table_name);
+  type_list_layout_groups layout_groups = get_data_layout_groups(layout_name, parent_table_name, layout_platform);
   for(type_list_layout_groups::iterator iter = layout_groups.begin(); iter != layout_groups.end(); ++iter)
   {
     sharedptr<LayoutGroup> layout_group = *iter;
@@ -1478,8 +1479,9 @@
   return false;
 }
 
-void Document_Glom::set_data_layout_groups(const Glib::ustring& layout_name, const Glib::ustring& parent_table_name, const type_list_layout_groups& groups)
+void Document_Glom::set_data_layout_groups(const Glib::ustring& layout_name, const Glib::ustring& parent_table_name, const Glib::ustring& layout_platform, const type_list_layout_groups& groups)
 {
+  std::cout << "DEBUG: Document_Glom::set_data_layout_groups(): layout_name=" << layout_name << ", parent_table_name=" << parent_table_name << ", layout_platform=" << layout_platform << std::endl;
   const Glib::ustring child_table_name = parent_table_name; //TODO: Remove this cruft.
 
   //g_warning("Document_Glom::set_data_layout_groups(): ADDING layout for table %s (child_table=%s), for layout %s", parent_table_name.c_str(), child_table_name.c_str(), layout_name.c_str());
@@ -1494,7 +1496,7 @@
     layout_info.m_layout_name = layout_name;
     layout_info.m_layout_groups = groups;
 
-    DocumentTableInfo::type_layouts::iterator iter = std::find_if(info.m_layouts.begin(), info.m_layouts.end(), predicate_Layout<LayoutInfo>(child_table_name, layout_name));
+    DocumentTableInfo::type_layouts::iterator iter = std::find_if(info.m_layouts.begin(), info.m_layouts.end(), predicate_Layout<LayoutInfo>(child_table_name, layout_name, layout_platform));
     if(iter == info.m_layouts.end())
       info.m_layouts.push_back(layout_info);
     else
@@ -1655,6 +1657,29 @@
   m_signal_userlevel_changed.emit(m_app_state.get_userlevel());
 }
 
+Glib::ustring Document_Glom::get_default_layout_platform()
+{
+  //Make Glom use the special "maemo" layouts if they exist.
+  #ifdef GLOM_ENABLE_MAEMO
+  return "maemo"
+  #else
+  return Glib::ustring();
+  #endif
+}
+
+Glib::ustring Document_Glom::get_active_layout_platform() const
+{
+  if(m_active_layout_platform.empty())
+    return get_default_layout_platform();
+  else
+    return m_active_layout_platform;
+}
+
+void Document_Glom::set_active_layout_platform(const Glib::ustring& layout_platform)
+{
+  m_active_layout_platform = layout_platform;
+}
+
 Glib::ustring Document_Glom::get_default_table() const
 {
   for(type_tables::const_iterator iter = m_tables.begin(); iter != m_tables.end(); ++iter)
@@ -2475,6 +2500,8 @@
               if(node)
               {
                 const Glib::ustring layout_name = get_node_attribute_value(node, GLOM_ATTRIBUTE_NAME);
+                const Glib::ustring layout_platform = get_node_attribute_value(node, GLOM_ATTRIBUTE_LAYOUT_PLATFORM);
+
                 Glib::ustring parent_table = get_node_attribute_value(node, GLOM_ATTRIBUTE_PARENT_TABLE_NAME);
                 if(parent_table.empty())
                   parent_table = table_name; //Deal with the earlier file format that did not include this.
@@ -2506,6 +2533,7 @@
                 LayoutInfo layout_info;
                 layout_info.m_parent_table = parent_table;
                 layout_info.m_layout_name = layout_name;
+                layout_info.m_layout_platform = layout_platform;
                 layout_info.m_layout_groups = layout_groups;
                 doctableinfo.m_layouts.push_back(layout_info);
               }
@@ -3239,6 +3267,7 @@
         {
           xmlpp::Element* nodeLayout = nodeDataLayouts->add_child(GLOM_NODE_DATA_LAYOUT);
           set_node_attribute_value(nodeLayout, GLOM_ATTRIBUTE_NAME, iter->m_layout_name);
+          set_node_attribute_value(nodeLayout, GLOM_ATTRIBUTE_LAYOUT_PLATFORM, iter->m_layout_platform);
           set_node_attribute_value(nodeLayout, GLOM_ATTRIBUTE_PARENT_TABLE_NAME, iter->m_parent_table);
 
           xmlpp::Element* nodeGroups = nodeLayout->add_child(GLOM_NODE_DATA_LAYOUT_GROUPS);

Modified: trunk/glom/libglom/document/document_glom.h
==============================================================================
--- trunk/glom/libglom/document/document_glom.h	(original)
+++ trunk/glom/libglom/document/document_glom.h	Wed Nov  5 02:06:48 2008
@@ -51,24 +51,22 @@
 class predicate_Layout
 {
 public:
-  predicate_Layout(const Glib::ustring& parent_table, const Glib::ustring& layout_name)
+  predicate_Layout(const Glib::ustring& parent_table, const Glib::ustring& layout_name, const Glib::ustring& layout_platform)
   : m_parent_table(parent_table),
-    m_layout_name(layout_name)
-  {
-  }
-
-  virtual ~predicate_Layout()
+    m_layout_name(layout_name),
+    m_layout_platform(layout_platform)
   {
   }
 
   bool operator() (const T_Element& element)
   {
     return (element.m_parent_table == m_parent_table) &&
-           (element.m_layout_name == m_layout_name);
+           (element.m_layout_name == m_layout_name) &&
+           (element.m_layout_platform == m_layout_platform);
   }
 
 protected:
-  Glib::ustring m_parent_table, m_layout_name;
+  Glib::ustring m_parent_table, m_layout_name, m_layout_platform;
 };
 
 class Document_Glom : public Bakery::Document_XML
@@ -191,31 +189,35 @@
   /** Get the layout groups for a layout.
    * @param layout_name The name of the layout, such as list or details.
    * @param parent_table_name The name of the table for which this layout should appear.
+   * @param layout_platform The platform for which this layout should be used. Possible values are an empty string (meaning normal platforms) or "maemo" meaning "normal". 
    * @result A list of layout groups at the top-level of the requested layout.
    */
-  type_list_layout_groups get_data_layout_groups(const Glib::ustring& layout_name, const Glib::ustring& parent_table_name) const;
+  type_list_layout_groups get_data_layout_groups(const Glib::ustring& layout_name, const Glib::ustring& parent_table_name, const Glib::ustring& layout_platform) const;
 
   /** Discover whether there are any fields in the layout.
    * @param layout_name The name of the layout, such as list or details.
    * @param parent_table_name The name of the table for which this layout should appear.
+   * @param layout_platform The platform for which this layout should be used. Possible values are an empty string (meaning normal platforms) or "maemo" meaning "normal". 
    * @result true if there is at least one field in the layout group or its sub groups.
    */
-  bool get_data_layout_groups_have_any_fields(const Glib::ustring& layout_name, const Glib::ustring& parent_table_name) const;
+  bool get_data_layout_groups_have_any_fields(const Glib::ustring& layout_name, const Glib::ustring& parent_table_name, const Glib::ustring& layout_platform) const;
 
   /** Set the layout groups for a layout.
    * @param layout_name The name of the layout, such as list or details.
    * @param parent_table_name The name of the table for which this layout should appear.
+   * @param layout_platform The platform for which this layout should be used. Possible values are an empty string (meaning normal platforms) or "maemo" meaning "normal". 
    * @param groups A list of layout groups at the top-level of the requested layout.
    */
-  void set_data_layout_groups(const Glib::ustring& layout_name, const Glib::ustring& parent_table_name, const type_list_layout_groups& groups);
+  void set_data_layout_groups(const Glib::ustring& layout_name, const Glib::ustring& parent_table_name, const Glib::ustring& layout_platform, const type_list_layout_groups& groups);
 
   /**
    * @para The layout_name, such as "details", "list".
    * @para parent_table_name The name of the table on whose layout the layout appears.
+   * @param layout_platform The platform for which this layout should be used. Possible values are an empty string (meaning normal platforms) or "maemo" meaning "normal". 
    */
-  type_list_layout_groups get_data_layout_groups_plus_new_fields(const Glib::ustring& layout_name, const Glib::ustring& parent_table_name) const;
+  type_list_layout_groups get_data_layout_groups_plus_new_fields(const Glib::ustring& layout_name, const Glib::ustring& parent_table_name, const Glib::ustring& layout_platform) const;
 
-  type_list_layout_groups get_data_layout_groups_default(const Glib::ustring& layout_name, const Glib::ustring& parent_table_name) const;
+  type_list_layout_groups get_data_layout_groups_default(const Glib::ustring& layout_name, const Glib::ustring& parent_table_name, const Glib::ustring& layout_platform) const;
 
   typedef std::list< sharedptr<TranslatableItem> > type_list_translatables;
   type_list_translatables get_translatable_layout_items(const Glib::ustring& table_name);
@@ -355,6 +357,18 @@
 
   void emit_userlevel_changed();
 
+  static Glib::ustring get_default_layout_platform();
+
+  /** This is transitory information, not saved to disk.
+   */
+  Glib::ustring get_active_layout_platform() const;
+
+  /** This is transitory information, not saved to disk.
+   */
+  void set_active_layout_platform(const Glib::ustring& layout_platform);
+
+
+
   void set_parent_window(Gtk::Window* window);
 
   Glib::ustring build_and_get_contents() const;
@@ -438,6 +452,7 @@
   {
   public:
     Glib::ustring m_layout_name;
+    Glib::ustring m_layout_platform; //Empty string (meaning normal platforms), or "maemo", or something else.
     Glib::ustring m_parent_table;
 
     type_list_layout_groups m_layout_groups;
@@ -504,6 +519,8 @@
 
   bool m_opened_from_browse;
 
+  Glib::ustring m_active_layout_platform; //empty (means normal), or "maemo".
+
   Gtk::Window* m_parent_window; //Needed by BusyCursor.
 };
 

Modified: trunk/glom/libglom/python_embed/py_glom_record.cc
==============================================================================
--- trunk/glom/libglom/python_embed/py_glom_record.cc	(original)
+++ trunk/glom/libglom/python_embed/py_glom_record.cc	Wed Nov  5 02:06:48 2008
@@ -166,13 +166,13 @@
 
 
 static PyGetSetDef Record_getseters[] = {
-    {"related",
+    {(char*)"related",
      (getter)Record__get_related, (setter)0, 0, 0
     },
-    {"connection",
+    {(char*)"connection",
      (getter)Record__get_connection, (setter)0, 0, 0
     },
-    {"table_name",
+    {(char*)"table_name",
      (getter)Record__get_table_name, (setter)0, 0, 0
     },
     {NULL, 0, 0, 0, 0, }  // Sentinel
@@ -258,7 +258,7 @@
 static PyTypeObject pyglom_RecordType = {
     PyObject_HEAD_INIT(NULL)
     0,                         /*ob_size*/
-    "glom.Record",             /*tp_name*/
+    (char*)"glom.Record",             /*tp_name*/
     sizeof(PyGlomRecord), /*tp_basicsize*/
     0,                         /*tp_itemsize*/
     (destructor)Record_dealloc, /*tp_dealloc*/
@@ -277,7 +277,7 @@
     0,                         /*tp_setattro*/
     0,                         /*tp_as_buffer*/
     Py_TPFLAGS_DEFAULT,        /*tp_flags*/
-    "Glom objects",           /* tp_doc */
+    (char*)"Glom objects",           /* tp_doc */
     0,                  /* tp_traverse */
     0,                   /* tp_clear */
     0,                   /* tp_richcompare */

Modified: trunk/glom/libglom/python_embed/py_glom_related.cc
==============================================================================
--- trunk/glom/libglom/python_embed/py_glom_related.cc	(original)
+++ trunk/glom/libglom/python_embed/py_glom_related.cc	Wed Nov  5 02:06:48 2008
@@ -214,7 +214,7 @@
 static PyTypeObject pyglom_RelatedType = {
     PyObject_HEAD_INIT(NULL)
     0,                         /*ob_size*/
-    "glom.Related",             /*tp_name*/
+    (char*)"glom.Related",             /*tp_name*/
     sizeof(PyGlomRelated), /*tp_basicsize*/
     0,                         /*tp_itemsize*/
     (destructor)Related_dealloc, /*tp_dealloc*/
@@ -233,7 +233,7 @@
     0,                         /*tp_setattro*/
     0,                         /*tp_as_buffer*/
     Py_TPFLAGS_DEFAULT,        /*tp_flags*/
-    "Glom objects",           /* tp_doc */
+    (char*)"Glom objects",           /* tp_doc */
     0,                  /* tp_traverse */
     0,                   /* tp_clear */
     0,                   /* tp_richcompare */

Modified: trunk/glom/mode_data/box_data.cc
==============================================================================
--- trunk/glom/mode_data/box_data.cc	(original)
+++ trunk/glom/mode_data/box_data.cc	Wed Nov  5 02:06:48 2008
@@ -61,8 +61,9 @@
 #endif // !GLOM_ENABLE_CLIENT_ONLY
 }
 
-bool Box_Data::init_db_details(const FoundSet& found_set)
+bool Box_Data::init_db_details(const FoundSet& found_set, const Glib::ustring& layout_platform)
 {
+  m_layout_platform = layout_platform;
   m_table_name = found_set.m_table_name;
   m_found_set = found_set;
 
@@ -238,7 +239,7 @@
   const Document_Glom* pDoc = dynamic_cast<const Document_Glom*>(get_document());
   if(pDoc)
   {
-    Document_Glom::type_list_layout_groups mapGroupSequence =  pDoc->get_data_layout_groups_plus_new_fields(m_layout_name, table_name);
+    Document_Glom::type_list_layout_groups mapGroupSequence = pDoc->get_data_layout_groups_plus_new_fields(m_layout_name, table_name, m_layout_platform);
     return get_table_fields_to_show_for_sequence(table_name, mapGroupSequence);
   }
   else
@@ -328,7 +329,7 @@
   }
 }
 
-Document_Glom::type_list_layout_groups Box_Data::get_data_layout_groups(const Glib::ustring& layout)
+Document_Glom::type_list_layout_groups Box_Data::get_data_layout_groups(const Glib::ustring& layout_name, const Glib::ustring& layout_platform)
 {
   Document_Glom::type_list_layout_groups layout_groups;
 
@@ -338,7 +339,7 @@
     if(!m_table_name.empty())
     {
       //Get the layout information from the document:
-      layout_groups = document->get_data_layout_groups_plus_new_fields(layout, m_table_name);
+      layout_groups = document->get_data_layout_groups_plus_new_fields(layout_name, m_table_name, layout_platform);
 
       const Privileges table_privs = Privs::get_current_privs(m_table_name);
 

Modified: trunk/glom/mode_data/box_data.h
==============================================================================
--- trunk/glom/mode_data/box_data.h	(original)
+++ trunk/glom/mode_data/box_data.h	Wed Nov  5 02:06:48 2008
@@ -48,7 +48,7 @@
 
   //TODO: Put this in Base_DB_Table_Data?
   ///Create the layout for the database structure, and fill it with data from the database.
-  virtual bool init_db_details(const FoundSet& found_set);
+  virtual bool init_db_details(const FoundSet& found_set, const Glib::ustring& layout_platform);
 
   //Fill the existing layout with data from the database:
   virtual bool refresh_data_from_database_with_where_clause(const FoundSet& found_set);
@@ -68,6 +68,7 @@
 #ifndef GLOM_ENABLE_CLIENT_ONLY
   void show_layout_dialog();
 #endif // !GLOM_ENABLE_CLIENT_ONLY
+
   Glib::ustring get_layout_name() const;
 
   //Signals:
@@ -104,7 +105,7 @@
 
   /** Get the layout groups, with the Field information filled in.
    */
-  Document_Glom::type_list_layout_groups get_data_layout_groups(const Glib::ustring& layout_name);
+  Document_Glom::type_list_layout_groups get_data_layout_groups(const Glib::ustring& layout_name, const Glib::ustring& layout_platform);
   void fill_layout_group_field_info(const sharedptr<LayoutGroup>& group, const Privileges& table_privs);
 
 
@@ -132,7 +133,12 @@
 #ifndef GLOM_ENABLE_CLIENT_ONLY
   Dialog_Layout* m_pDialogLayout;
 #endif // !GLOM_ENABLE_CLIENT_ONLY
+
+  /// "details" or "list", as specified in the Document's XML.
   Glib::ustring m_layout_name;
+
+  /// Empty string or "maemo" as specified in the Document's XML.
+  Glib::ustring m_layout_platform;
 };
 
 } //namespace Glom

Modified: trunk/glom/mode_data/box_data_calendar_related.cc
==============================================================================
--- trunk/glom/mode_data/box_data_calendar_related.cc	(original)
+++ trunk/glom/mode_data/box_data_calendar_related.cc	Wed Nov  5 02:06:48 2008
@@ -118,7 +118,7 @@
 
   FoundSet found_set;
   found_set.m_table_name = LayoutWidgetBase::m_table_name;
-  return Box_Data::init_db_details(found_set); //Calls create_layout() and fill_from_database().
+  return Box_Data::init_db_details(found_set, "" /* layout_platform */); //Calls create_layout() and fill_from_database().
 }
 
 bool Box_Data_Calendar_Related::fill_from_database()
@@ -359,11 +359,11 @@
   sharedptr<LayoutItem_CalendarPortal> derived_portal = sharedptr<LayoutItem_CalendarPortal>::cast_dynamic(m_portal);
   if(derived_portal && derived_portal->get_has_relationship_name())
   {
-    related_dialog->set_document(m_layout_name, get_document(), derived_portal);
+    related_dialog->set_document(m_layout_name, m_layout_platform, get_document(), derived_portal);
   }
   else
   {
-    related_dialog->set_document(m_layout_name, get_document(), m_parent_table);
+    related_dialog->set_document(m_layout_name, m_layout_platform, get_document(), m_parent_table);
   }
 }
 #endif // !GLOM_ENABLE_CLIENT_ONLY

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	Wed Nov  5 02:06:48 2008
@@ -160,14 +160,14 @@
   }
 }
 
-bool Box_Data_Details::init_db_details(const FoundSet& found_set, const Gnome::Gda::Value& primary_key_value)
+bool Box_Data_Details::init_db_details(const FoundSet& found_set, const Glib::ustring& layout_platform, const Gnome::Gda::Value& primary_key_value)
 {
   //std::cout << "Box_Data_Details::init_db_details(): primary_key_value=" << primary_key_value.to_string() << std::endl;
 
   m_primary_key_value = primary_key_value;
   m_field_primary_key = get_field_primary_key_for_table(found_set.m_table_name);
    
-  const bool result = Box_Data::init_db_details(found_set); //Calls create_layout(), then fill_from_database()
+  const bool result = Box_Data::init_db_details(found_set, layout_platform); //Calls create_layout(), then fill_from_database()
 
   //This is not used much, but we create it anyway:
   m_found_set = found_set; //Not used much.
@@ -203,7 +203,7 @@
     m_FlowTable.set_table(m_table_name); //This allows portals to get full Relationship information
 
     //This map of layout groups will also contain the field information from the database:
-    Document_Glom::type_list_layout_groups layout_groups = get_data_layout_groups(m_layout_name);
+    Document_Glom::type_list_layout_groups layout_groups = get_data_layout_groups(m_layout_name, m_layout_platform);
 
     for(Document_Glom::type_list_layout_groups::const_iterator iter = layout_groups.begin(); iter != layout_groups.end(); ++iter)
     {
@@ -402,7 +402,7 @@
     //Warn the user that they won't see anything if there are no fields on the layout,
     //doing an extra check:
     Document_Glom* document = get_document();
-    if( document && !(document->get_data_layout_groups_have_any_fields(m_layout_name, m_table_name)) )
+    if( document && !(document->get_data_layout_groups_have_any_fields(m_layout_name, m_table_name, m_layout_platform)) )
     {
       Gtk::Window* parent_window = get_app_window();
       if(parent_window)
@@ -604,7 +604,7 @@
   //Store it in the document:
   Document_Glom* document = get_document();
   if(document)
-    document->set_data_layout_groups(m_layout_name, m_table_name, layout_groups);
+    document->set_data_layout_groups(m_layout_name, m_table_name, m_layout_platform, layout_groups);
   //Build the view again from the new layout:
 #endif
   create_layout();
@@ -963,7 +963,7 @@
     //The groups:
     xmlpp::Element* nodeParent = nodeRoot;
 
-    Document_Glom::type_list_layout_groups layout_groups = get_data_layout_groups(m_layout_name);
+    Document_Glom::type_list_layout_groups layout_groups = get_data_layout_groups(m_layout_name, m_layout_platform);
     for(Document_Glom::type_list_layout_groups::const_iterator iter = layout_groups.begin(); iter != layout_groups.end(); ++iter)
     {
       sharedptr<const LayoutGroup> layout_group = *iter;
@@ -990,7 +990,8 @@
 
 void Box_Data_Details::prepare_layout_dialog(Dialog_Layout* dialog)
 {
-  dialog->set_document(m_layout_name, get_document(), m_table_name, m_FieldsShown); //TODO: Use m_TableFields?
+  if(dialog)
+    dialog->set_document(m_layout_name, m_layout_platform, get_document(), m_table_name, m_FieldsShown); //TODO: Use m_TableFields?
 }
 
 void Box_Data_Details::show_layout_toolbar (bool show)

Modified: trunk/glom/mode_data/box_data_details.h
==============================================================================
--- trunk/glom/mode_data/box_data_details.h	(original)
+++ trunk/glom/mode_data/box_data_details.h	Wed Nov  5 02:06:48 2008
@@ -40,7 +40,7 @@
   Box_Data_Details(bool bWithNavButtons = true);
   virtual ~Box_Data_Details();
 
-  virtual bool init_db_details(const FoundSet& found_set, const Gnome::Gda::Value& primary_key_value);
+  virtual bool init_db_details(const FoundSet& found_set, const Glib::ustring& layout_platform, const Gnome::Gda::Value& primary_key_value);
   virtual bool refresh_data_from_database_with_primary_key(const Gnome::Gda::Value& primary_key_value);
   virtual bool refresh_data_from_database_blank();
 

Modified: trunk/glom/mode_data/box_data_list.cc
==============================================================================
--- trunk/glom/mode_data/box_data_list.cc	(original)
+++ trunk/glom/mode_data/box_data_list.cc	Wed Nov  5 02:06:48 2008
@@ -210,7 +210,7 @@
     Document_Glom::type_list_layout_groups mapGroups;
     mapGroups[1] = group;
 
-    pDoc->set_data_layout_groups("list", m_table_name, mapGroups);  
+    pDoc->set_data_layout_groups("list", m_table_name, m_layout_platform, mapGroups);  
   }
 }
 
@@ -443,7 +443,7 @@
 {
   //This method is overriden in Box_Data_List_Related.
 
-  return get_data_layout_groups(m_layout_name); 
+  return get_data_layout_groups(m_layout_name, m_layout_platform); 
 }
 
 void Box_Data_List::create_layout()
@@ -601,7 +601,7 @@
 
 void Box_Data_List::prepare_layout_dialog(Dialog_Layout* dialog)
 {
-  dialog->set_document(m_layout_name, get_document(), m_table_name, m_FieldsShown); //TODO: Use m_TableFields?
+  dialog->set_document(m_layout_name, m_layout_platform, get_document(), m_table_name, m_FieldsShown); //TODO: Use m_TableFields?
 }
 #endif // !GLOM_ENABLE_CLIENT_ONLY
 

Modified: trunk/glom/mode_data/box_data_list_related.cc
==============================================================================
--- trunk/glom/mode_data/box_data_list_related.cc	(original)
+++ trunk/glom/mode_data/box_data_list_related.cc	Wed Nov  5 02:06:48 2008
@@ -117,7 +117,7 @@
   FoundSet found_set;
   found_set.m_table_name = LayoutWidgetBase::m_table_name;
   m_AddDel.set_found_set(found_set);
-  return Box_Data_ManyRecords::init_db_details(found_set); //Calls create_layout() and fill_from_database().
+  return Box_Data_ManyRecords::init_db_details(found_set, "" /* layout_platform */); //Calls create_layout() and fill_from_database().
 }
 
 bool Box_Data_List_Related::fill_from_database()
@@ -345,7 +345,7 @@
   Dialog_Layout_List_Related* related_dialog = dynamic_cast<Dialog_Layout_List_Related*>(dialog);
   g_assert(related_dialog != NULL);
 
-  related_dialog->set_document(m_layout_name, get_document(), m_portal, m_parent_table);
+  related_dialog->set_document(m_layout_name, m_layout_platform, get_document(), m_portal, m_parent_table);
 }
 #endif // !GLOM_ENABLE_CLIENT_ONLY
 

Modified: trunk/glom/mode_data/box_data_portal.cc
==============================================================================
--- trunk/glom/mode_data/box_data_portal.cc	(original)
+++ trunk/glom/mode_data/box_data_portal.cc	Wed Nov  5 02:06:48 2008
@@ -103,7 +103,7 @@
 
   FoundSet found_set;
   found_set.m_table_name = LayoutWidgetBase::m_table_name;
-  return Box_Data::init_db_details(found_set); //Calls create_layout() and fill_from_database().
+  return Box_Data::init_db_details(found_set, m_layout_platform); //Calls create_layout() and fill_from_database().
 }
 
 bool Box_Data_Portal::refresh_data_from_database_with_foreign_key(const Gnome::Gda::Value& foreign_key_value)

Modified: trunk/glom/mode_data/dialog_layout.cc
==============================================================================
--- trunk/glom/mode_data/dialog_layout.cc	(original)
+++ trunk/glom/mode_data/dialog_layout.cc	Wed Nov  5 02:06:48 2008
@@ -50,12 +50,12 @@
 {
 }
 
-void Dialog_Layout::set_document(const Glib::ustring& layout, Document_Glom* /* document */, const Glib::ustring& table_name, const type_vecLayoutFields& /* table_fields */)
+void Dialog_Layout::set_document(const Glib::ustring& layout_name, const Glib::ustring& layout_platform, Document_Glom* /* document */, const Glib::ustring& table_name, const type_vecLayoutFields& /* table_fields */)
 {
   m_modified = false;
 
-  m_layout_name = layout; 
-  //m_document = document;
+  m_layout_name = layout_name;
+  m_layout_platform = layout_platform;
   m_table_name = table_name;
 
   m_modified = false;

Modified: trunk/glom/mode_data/dialog_layout.h
==============================================================================
--- trunk/glom/mode_data/dialog_layout.h	(original)
+++ trunk/glom/mode_data/dialog_layout.h	Wed Nov  5 02:06:48 2008
@@ -38,12 +38,13 @@
   virtual ~Dialog_Layout();
 
   /**
-   * @param layout "list" or "details"
+   * @param layout_name "list" or "details"
+   * @param layout_platform As in the document. Empty or "maemo".
    * @param document The document, so that the dialog can load the previous layout, and save changes.
    * @param table_name The table name.
    * @param table_fields: The actual fields in the table, in case the document does not yet know about them all.
    */
-  virtual void set_document(const Glib::ustring& layout, Document_Glom* document, const Glib::ustring& table_name, const type_vecLayoutFields& table_fields);
+  virtual void set_document(const Glib::ustring& layout_name, const Glib::ustring& layout_platform, Document_Glom* document, const Glib::ustring& table_name, const type_vecLayoutFields& table_fields);
 
   virtual bool get_modified() const;
 
@@ -69,10 +70,8 @@
   Gtk::Label* m_label_table_title;
 
   Glib::ustring m_table_name;
-  Glib::ustring m_layout_name;
-
-
-  //Document_Glom* m_document;  
+  Glib::ustring m_layout_name, m_layout_platform; //As in the document.
+ 
   bool m_modified;
 };
 

Modified: trunk/glom/mode_data/dialog_layout_calendar_related.cc
==============================================================================
--- trunk/glom/mode_data/dialog_layout_calendar_related.cc	(original)
+++ trunk/glom/mode_data/dialog_layout_calendar_related.cc	Wed Nov  5 02:06:48 2008
@@ -90,7 +90,7 @@
 }
 
 
-void Dialog_Layout_Calendar_Related::set_document(const Glib::ustring& layout, Document_Glom* document, const sharedptr<const LayoutItem_CalendarPortal>& portal)
+void Dialog_Layout_Calendar_Related::set_document(const Glib::ustring& layout, const Glib::ustring& layout_platform, Document_Glom* document, const sharedptr<const LayoutItem_CalendarPortal>& portal)
 {
   m_portal = glom_sharedptr_clone(portal);
   
@@ -98,10 +98,10 @@
   if(portal)
     from_table = portal->get_from_table();
 
-  set_document(layout, document, from_table);
+  set_document(layout, layout_platform, document, from_table);
 }
 
-void Dialog_Layout_Calendar_Related::set_document(const Glib::ustring& layout, Document_Glom* document, const Glib::ustring& from_table)
+void Dialog_Layout_Calendar_Related::set_document(const Glib::ustring& layout_name, const Glib::ustring& layout_platform, Document_Glom* document, const Glib::ustring& from_table)
 {
   if(!m_portal)
   {
@@ -111,7 +111,7 @@
   type_vecLayoutFields empty_fields; //Just to satisfy the base class.
 
   
-  Dialog_Layout::set_document(layout, document, from_table, empty_fields);
+  Dialog_Layout::set_document(layout_name, layout_platform, document, from_table, empty_fields);
   //m_table_name is now actually the parent_table_name.
 
   update_ui();

Modified: trunk/glom/mode_data/dialog_layout_calendar_related.h
==============================================================================
--- trunk/glom/mode_data/dialog_layout_calendar_related.h	(original)
+++ trunk/glom/mode_data/dialog_layout_calendar_related.h	Wed Nov  5 02:06:48 2008
@@ -42,9 +42,9 @@
    * @param table_name The table name.
    * @param table_fields: The actual fields in the table, in case the document does not yet know about them all.
    */
-  virtual void set_document(const Glib::ustring& layout, Document_Glom* document, const sharedptr<const LayoutItem_CalendarPortal>& portal);
+  virtual void set_document(const Glib::ustring& layout, const Glib::ustring& layout_platform, Document_Glom* document, const sharedptr<const LayoutItem_CalendarPortal>& portal);
 
-  virtual void set_document(const Glib::ustring& layout, Document_Glom* document, const Glib::ustring& parent_table);
+  virtual void set_document(const Glib::ustring& layout, const Glib::ustring& layout_platform, Document_Glom* document, const Glib::ustring& parent_table);
 
   virtual void update_ui(bool including_relationships_list = true);
 

Modified: trunk/glom/mode_data/dialog_layout_details.cc
==============================================================================
--- trunk/glom/mode_data/dialog_layout_details.cc	(original)
+++ trunk/glom/mode_data/dialog_layout_details.cc	Wed Nov  5 02:06:48 2008
@@ -315,11 +315,11 @@
   }
 }
 
-void Dialog_Layout_Details::set_document(const Glib::ustring& layout, Document_Glom* document, const Glib::ustring& table_name, const type_vecLayoutFields& table_fields)
+void Dialog_Layout_Details::set_document(const Glib::ustring& layout_name, const Glib::ustring& layout_platform, Document_Glom* document, const Glib::ustring& table_name, const type_vecLayoutFields& table_fields)
 {
   m_modified = false;
 
-  Dialog_Layout::set_document(layout, document, table_name, table_fields);
+  Dialog_Layout::set_document(layout_name, layout_platform, document, table_name, table_fields);
 
   //Update the tree models from the document
   if(document)
@@ -328,7 +328,7 @@
     m_label_table_name->set_text(table_name);
     m_entry_table_title->set_text( document->get_table_title(table_name) );
 
-    Document_Glom::type_list_layout_groups list_groups = document->get_data_layout_groups_plus_new_fields(layout, m_table_name);
+    Document_Glom::type_list_layout_groups list_groups = document->get_data_layout_groups_plus_new_fields(m_layout_name, m_table_name, m_layout_platform);
     document->fill_layout_field_details(m_table_name, list_groups); //Update with full field information.
 
     //If no information is stored in the document, add a default group
@@ -1114,7 +1114,7 @@
 
     if(document)
     {
-      document->set_data_layout_groups(m_layout_name, m_table_name, list_groups);
+      document->set_data_layout_groups(m_layout_name, m_table_name, m_layout_platform, list_groups);
       m_modified = false;
     }
   }

Modified: trunk/glom/mode_data/dialog_layout_details.h
==============================================================================
--- trunk/glom/mode_data/dialog_layout_details.h	(original)
+++ trunk/glom/mode_data/dialog_layout_details.h	Wed Nov  5 02:06:48 2008
@@ -34,12 +34,13 @@
   virtual ~Dialog_Layout_Details();
 
   /**
-   * @param layout "list" or "details"
+   * @param layout_name "list" or "details"
+   * @param layout_platform As in the document. Empty or "maemo".
    * @param document The document, so that the dialog can load the previous layout, and save changes.
    * @param table_name The table name.
    * @param table_fields: The actual fields in the table, in case the document does not yet know about them all.
    */
-  virtual void set_document(const Glib::ustring& layout, Document_Glom* document, const Glib::ustring& table_name, const type_vecLayoutFields& table_fields);
+  virtual void set_document(const Glib::ustring& layout_name, const Glib::ustring& layout_platform, Document_Glom* document, const Glib::ustring& table_name, const type_vecLayoutFields& table_fields);
 
 protected:
 

Modified: trunk/glom/mode_data/dialog_layout_list_related.cc
==============================================================================
--- trunk/glom/mode_data/dialog_layout_list_related.cc	(original)
+++ trunk/glom/mode_data/dialog_layout_list_related.cc	Wed Nov  5 02:06:48 2008
@@ -80,7 +80,7 @@
 }
 
 
-void Dialog_Layout_List_Related::set_document(const Glib::ustring& layout, Document_Glom* document, const sharedptr<const LayoutItem_Portal>& portal, const Glib::ustring& from_table)
+void Dialog_Layout_List_Related::set_document(const Glib::ustring& layout_name, const Glib::ustring& layout_platform, Document_Glom* document, const sharedptr<const LayoutItem_Portal>& portal, const Glib::ustring& from_table)
 {
   //Ignore the provided from_table if the portal has one:
   Glib::ustring actual_from_table;
@@ -100,7 +100,7 @@
     m_portal = sharedptr<LayoutItem_Portal>::create(); //The rest of the class assumes that this is not null.
   
   type_vecLayoutFields empty_fields; //Just to satisfy the base class.
-  Dialog_Layout::set_document(layout, document, actual_from_table, empty_fields);
+  Dialog_Layout::set_document(layout_name, layout_platform, document, actual_from_table, empty_fields);
   //m_table_name is now actually the parent_table_name.
 
   update_ui();

Modified: trunk/glom/mode_data/dialog_layout_list_related.h
==============================================================================
--- trunk/glom/mode_data/dialog_layout_list_related.h	(original)
+++ trunk/glom/mode_data/dialog_layout_list_related.h	Wed Nov  5 02:06:48 2008
@@ -35,11 +35,12 @@
   virtual ~Dialog_Layout_List_Related();
 
   /**
-   * @param layout "list" or "details"
+   * @param layout_name "list" or "details"
+   * @param layout_platform As in the document. Empty or "maemo".
    * @param document The document, so that the dialog can load the previous layout, and save changes.
    * @param portal The layout item, which knows its from_table, for instance.
    */
-  virtual void set_document(const Glib::ustring& layout, Document_Glom* document, const sharedptr<const LayoutItem_Portal>& portal, const Glib::ustring& from_table);
+  virtual void set_document(const Glib::ustring& layout_name, const Glib::ustring& layout_platform, Document_Glom* document, const sharedptr<const LayoutItem_Portal>& portal, const Glib::ustring& from_table);
 
   virtual void update_ui(bool including_relationships_list = true);
 

Modified: trunk/glom/mode_data/notebook_data.cc
==============================================================================
--- trunk/glom/mode_data/notebook_data.cc	(original)
+++ trunk/glom/mode_data/notebook_data.cc	Wed Nov  5 02:06:48 2008
@@ -98,7 +98,7 @@
 
     //if(get_current_view() == DATA_VIEW_List)
     //{
-      result = m_Box_List.init_db_details(found_set); //TODO: Select the last selected record.
+      result = m_Box_List.init_db_details(found_set, get_document()->get_active_layout_platform()); //TODO: Select the last selected record.
       //m_Box_List.load_from_document();
     //}
     //else //DATA_VIEW_Details
@@ -145,7 +145,7 @@
           }
         }
 
-        m_Box_Details.init_db_details(found_set, primary_key_for_details);
+        m_Box_Details.init_db_details(found_set, get_document()->get_active_layout_platform(), primary_key_for_details);
       }
       else
         std::cerr << "Notebook_Data::init_db_details(): document is NULL" << std::endl;

Modified: trunk/glom/mode_design/print_layouts/canvas_print_layout.cc
==============================================================================
--- trunk/glom/mode_design/print_layouts/canvas_print_layout.cc	(original)
+++ trunk/glom/mode_design/print_layouts/canvas_print_layout.cc	Wed Nov  5 02:06:48 2008
@@ -310,7 +310,7 @@
 
   add_view(dialog); //Give it access to the document.
 
-  dialog->set_document("TODO_layout_name", get_document(), portal, m_table_name);
+  dialog->set_document("layout_name_unused_for_portals", "", /* layout_platform */ get_document(), portal, m_table_name);
 
   if(parent)
     dialog->set_transient_for(*parent);

Modified: trunk/glom/mode_find/box_data_details_find.cc
==============================================================================
--- trunk/glom/mode_find/box_data_details_find.cc	(original)
+++ trunk/glom/mode_find/box_data_details_find.cc	Wed Nov  5 02:06:48 2008
@@ -41,11 +41,11 @@
 {
 }
 
-bool Box_Data_Details_Find::init_db_details(const Glib::ustring& table_name)
+bool Box_Data_Details_Find::init_db_details(const Glib::ustring& table_name, const Glib::ustring& layout_platform)
 {
   FoundSet found_set;
   found_set.m_table_name = table_name;
-  return Box_Data_Details::init_db_details(found_set, Gnome::Gda::Value());
+  return Box_Data_Details::init_db_details(found_set, layout_platform, Gnome::Gda::Value());
 }
 
 bool Box_Data_Details_Find::fill_from_database()

Modified: trunk/glom/mode_find/box_data_details_find.h
==============================================================================
--- trunk/glom/mode_find/box_data_details_find.h	(original)
+++ trunk/glom/mode_find/box_data_details_find.h	Wed Nov  5 02:06:48 2008
@@ -32,7 +32,7 @@
   Box_Data_Details_Find();
   virtual ~Box_Data_Details_Find();
 
-  virtual bool init_db_details(const Glib::ustring& table_name);
+  virtual bool init_db_details(const Glib::ustring& table_name, const Glib::ustring& layout_platform);
 
   virtual Gtk::Widget* get_default_button(); //override
 

Modified: trunk/glom/mode_find/box_data_list_find.cc
==============================================================================
--- trunk/glom/mode_find/box_data_list_find.cc	(original)
+++ trunk/glom/mode_find/box_data_list_find.cc	Wed Nov  5 02:06:48 2008
@@ -73,11 +73,11 @@
   return &m_Button_Find;
 }
 
-bool Box_Data_List_Find::init_db_details(const Glib::ustring& table_name)
+bool Box_Data_List_Find::init_db_details(const Glib::ustring& table_name, const Glib::ustring& layout_platform)
 {
   FoundSet found_set;
   found_set.m_table_name = table_name;
-  return Box_Data_List::init_db_details(found_set);
+  return Box_Data_List::init_db_details(found_set, layout_platform);
 }
 
 } //namespace Glom

Modified: trunk/glom/mode_find/box_data_list_find.h
==============================================================================
--- trunk/glom/mode_find/box_data_list_find.h	(original)
+++ trunk/glom/mode_find/box_data_list_find.h	Wed Nov  5 02:06:48 2008
@@ -32,7 +32,7 @@
   Box_Data_List_Find();
   virtual ~Box_Data_List_Find();
 
-  virtual bool init_db_details(const Glib::ustring& table_name);
+  virtual bool init_db_details(const Glib::ustring& table_name, const Glib::ustring& layout_platform);
 
   virtual Gtk::Widget* get_default_button(); //override
 

Modified: trunk/glom/mode_find/notebook_find.cc
==============================================================================
--- trunk/glom/mode_find/notebook_find.cc	(original)
+++ trunk/glom/mode_find/notebook_find.cc	Wed Nov  5 02:06:48 2008
@@ -55,11 +55,11 @@
   remove_view(&m_Box_Details);
 }
 
-bool Notebook_Find::init_db_details(const Glib::ustring& table_name)
+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);
+  bool result = m_Box_List.init_db_details(table_name, layout_platform);
 
-  m_Box_Details.init_db_details(table_name);
+  m_Box_Details.init_db_details(table_name, layout_platform);
 
   return result;
 }

Modified: trunk/glom/mode_find/notebook_find.h
==============================================================================
--- trunk/glom/mode_find/notebook_find.h	(original)
+++ trunk/glom/mode_find/notebook_find.h	Wed Nov  5 02:06:48 2008
@@ -34,7 +34,7 @@
   Notebook_Find();
   virtual ~Notebook_Find();
 
-  bool init_db_details(const Glib::ustring& table_name);
+  bool init_db_details(const Glib::ustring& table_name, const Glib::ustring& layout_platform);
 
   void set_current_view(Notebook_Data::dataview view);
 

Modified: trunk/glom/utility_widgets/checkglom.cc
==============================================================================
--- trunk/glom/utility_widgets/checkglom.cc	(original)
+++ trunk/glom/utility_widgets/checkglom.cc	Wed Nov  5 02:06:48 2008
@@ -1,6 +1,6 @@
 /* Glom
  *
- * Copyright (C) 2008 Johannes Schmid
+ * Copyright (C) 2008 Openismus GmbH
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -29,7 +29,7 @@
 namespace Glom
 {
 
-CheckGlom::CheckGlom(Glib::ustring title)
+CheckGlom::CheckGlom(const Glib::ustring& title)
   : Gtk::CheckButton(title)
 {
 #ifndef GLOM_ENABLE_CLIENT_ONLY
@@ -63,7 +63,7 @@
 
     pApp->update_userlevel_ui(); //Update our action's sensitivity. 
 
-    //Only show this popup in developer mode, so operators still see the default GtkCheck context menu.
+    //Only show this popup in developer mode, so operators still see the default GtkCheckButton context menu.
     //TODO: It would be better to add it somehow to the standard context menu.
     if(pApp->get_userlevel() == AppState::USERLEVEL_DEVELOPER)
     {

Modified: trunk/glom/utility_widgets/checkglom.h
==============================================================================
--- trunk/glom/utility_widgets/checkglom.h	(original)
+++ trunk/glom/utility_widgets/checkglom.h	Wed Nov  5 02:06:48 2008
@@ -38,7 +38,7 @@
   public LayoutWidgetField
 {
 public:
-  explicit CheckGlom(Glib::ustring title);
+  explicit CheckGlom(const Glib::ustring& title);
   virtual ~CheckGlom();
 
   virtual void set_value(const Gnome::Gda::Value& value);

Modified: trunk/glom/utility_widgets/datawidget.cc
==============================================================================
--- trunk/glom/utility_widgets/datawidget.cc	(original)
+++ trunk/glom/utility_widgets/datawidget.cc	Wed Nov  5 02:06:48 2008
@@ -848,7 +848,7 @@
     else
       g_warning("get_layout_item() was not a LayoutItem_Field");
 
-    dialog->init_db_details(related_table_name);
+    dialog->init_db_details(related_table_name, get_document()->get_active_layout_platform());
 
 
     int response = dialog->run();

Modified: trunk/glom/utility_widgets/dialog_choose_id.cc
==============================================================================
--- trunk/glom/utility_widgets/dialog_choose_id.cc	(original)
+++ trunk/glom/utility_widgets/dialog_choose_id.cc	Wed Nov  5 02:06:48 2008
@@ -128,7 +128,7 @@
     FoundSet found_set = m_box_select.get_found_set();
     found_set.m_table_name = m_table_name;
     found_set.m_where_clause = where_clause;
-    const bool records_found = m_box_select.init_db_details(found_set);
+    const bool records_found = m_box_select.init_db_details(found_set, m_layout_platform);
     if(!records_found)
     {
       const bool find_again = show_warning_no_records_found(*this);
@@ -170,9 +170,10 @@
   }
 }
 
-bool Dialog_ChooseID::init_db_details(const Glib::ustring& table_name)
+bool Dialog_ChooseID::init_db_details(const Glib::ustring& table_name, const Glib::ustring& layout_platform)
 {
   m_table_name = table_name;
+  m_layout_platform = layout_platform;
 
   m_label_table_name->set_text( get_document()->get_table_title(m_table_name) );
 
@@ -180,7 +181,7 @@
   m_stage = STAGE_FIND;
   update_ui_for_stage();
 
-  bool result = m_box_find.init_db_details(table_name);
+  bool result = m_box_find.init_db_details(table_name, layout_platform);
 
   m_table_name = table_name;
 

Modified: trunk/glom/utility_widgets/dialog_choose_id.h
==============================================================================
--- trunk/glom/utility_widgets/dialog_choose_id.h	(original)
+++ trunk/glom/utility_widgets/dialog_choose_id.h	Wed Nov  5 02:06:48 2008
@@ -39,7 +39,7 @@
   Dialog_ChooseID(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade);
   virtual ~Dialog_ChooseID();
 
-  virtual bool init_db_details(const Glib::ustring& table_name);
+  virtual bool init_db_details(const Glib::ustring& table_name, const Glib::ustring& layout_platform);
 
   bool get_id_chosen(Gnome::Gda::Value& chosen_id) const;
 
@@ -66,6 +66,7 @@
   Gtk::Alignment* m_alignment_parent;
 
   Glib::ustring m_table_name;
+  Glib::ustring m_layout_platform;
 
   Document_Glom* m_document;
   Gnome::Gda::Value m_id_chosen;

Modified: trunk/glom/utility_widgets/dialog_layoutitem_properties.cc
==============================================================================
--- trunk/glom/utility_widgets/dialog_layoutitem_properties.cc	(original)
+++ trunk/glom/utility_widgets/dialog_layoutitem_properties.cc	Wed Nov  5 02:06:48 2008
@@ -36,7 +36,7 @@
 }
 #endif
 
-void Dialog_LayoutItem_Properties::set_label (Glib::ustring label)
+void Dialog_LayoutItem_Properties::set_label(const Glib::ustring& label)
 {
   m_pEntryLabel->set_text(label);
 }

Modified: trunk/glom/utility_widgets/dialog_layoutitem_properties.h
==============================================================================
--- trunk/glom/utility_widgets/dialog_layoutitem_properties.h	(original)
+++ trunk/glom/utility_widgets/dialog_layoutitem_properties.h	Wed Nov  5 02:06:48 2008
@@ -34,7 +34,7 @@
   //virtual ~Dialog_LayoutItem_Properties();
 
   Glib::ustring get_label() const; 
-  void set_label (Glib::ustring label);
+  void set_label(const Glib::ustring& label);
   
 protected:
   Gtk::Entry* m_pEntryLabel;

Modified: trunk/po/Makefile.in.in
==============================================================================
--- trunk/po/Makefile.in.in	(original)
+++ trunk/po/Makefile.in.in	Wed Nov  5 02:06:48 2008
@@ -54,16 +54,16 @@
 
 ALL_LINGUAS = @ALL_LINGUAS@
 
-PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; fi)
+PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi)
 
 USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep ^$$lang$$`"; then printf "$$lang "; fi; done; fi)
 
 USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done)
 
-POFILES=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done)
+POFILES=$(shell LINGUAS="$(PO_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done)
 
-DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(POFILES)
-EXTRA_DISTFILES = POTFILES.skip Makevars LINGUAS
+DISTFILES = Makefile.in.in POTFILES.in $(POFILES)
+EXTRA_DISTFILES = ChangeLog POTFILES.skip Makevars LINGUAS
 
 POTFILES = \
 # This comment gets stripped out



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