[glom] Glade files: Remove adjustment objects, simplifying window instantiation.



commit ee489705669480403ef559786556369703d4ea04
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Mar 25 10:17:41 2010 +0100

    Glade files: Remove adjustment objects, simplifying window instantiation.
    
    * glom/glom_developer.glade: Remove useless (default, empty) adjustment
        objects, so we can load the windows with GtkBuilder without specifying
        them. Recent versions of Glade no longer seem to create these when they
        would just have default values.
    * glom/base_db.cc:
    * glom/frame_glom.cc:
    * glom/glom.glade:
    * glom/mode_design/fields/dialog_fielddefinition.cc:
    * glom/mode_design/layout/layout_item_dialogs/dialog_field_layout.c
    c:
    * glom/mode_design/layout/layout_item_dialogs/dialog_formatting.cc:
    * glom/mode_design/print_layouts/dialog_text_formatting.cc:
        Don't provide the id of the adjustment, removing the silly workaround.

 ChangeLog                                          |   18 ++++++++++++++++++
 glom/base_db.cc                                    |   10 +---------
 glom/frame_glom.cc                                 |   10 +---------
 glom/glom.glade                                    |    7 -------
 glom/glom_developer.glade                          |   13 -------------
 glom/mode_design/fields/dialog_fielddefinition.cc  |   10 +---------
 .../layout_item_dialogs/dialog_field_layout.cc     |   10 +---------
 .../layout_item_dialogs/dialog_formatting.cc       |   10 +---------
 .../print_layouts/dialog_text_formatting.cc        |   10 +---------
 9 files changed, 24 insertions(+), 74 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9584e9a..00487b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2010-03-25  Murray Cumming  <murrayc murrayc com>
+
+    Glade files: Remove adjustment objects, simplifying window instantiation.
+
+	* glom/glom_developer.glade: Remove useless (default, empty) adjustment 
+    objects, so we can load the windows with GtkBuilder without specifying 
+    them. Recent versions of Glade no longer seem to create these when they 
+    would just have default values.
+	* glom/base_db.cc:
+	* glom/frame_glom.cc:
+	* glom/glom.glade:
+	* glom/mode_design/fields/dialog_fielddefinition.cc:
+	* glom/mode_design/layout/layout_item_dialogs/dialog_field_layout.c
+	c:
+	* glom/mode_design/layout/layout_item_dialogs/dialog_formatting.cc:
+	* glom/mode_design/print_layouts/dialog_text_formatting.cc:
+    Don't provide the id of the adjustment, removing the silly workaround.
+
 2010-03-24  Daniel Borgmann  <danielb openismus com>
 
 	Don't show error dialog when user cancels template creation.
diff --git a/glom/base_db.cc b/glom/base_db.cc
index ef44ea1..fffd102 100644
--- a/glom/base_db.cc
+++ b/glom/base_db.cc
@@ -2062,15 +2062,7 @@ sharedptr<LayoutItem_Notebook> Base_DB::offer_notebook(const sharedptr<LayoutIte
 
   try
   {
-    //GtkBuilder can't find top-level objects (GtkAdjustments in this case),
-    //that one top-level object references.
-    //See http://bugzilla.gnome.org/show_bug.cgi?id=575714
-    //so we need to this silliness. murrayc.
-    std::list<Glib::ustring> builder_ids;
-    builder_ids.push_back("dialog_notebook");
-    builder_ids.push_back("adjustment2");
-
-    Glib::RefPtr<Gtk::Builder> refXml = Gtk::Builder::create_from_file(Utils::get_glade_file_path("glom_developer.glade"), builder_ids);
+    Glib::RefPtr<Gtk::Builder> refXml = Gtk::Builder::create_from_file(Utils::get_glade_file_path("glom_developer.glade"), "box_formatting");
 
     Dialog_Notebook* dialog = 0;
     refXml->get_widget_derived("dialog_notebook", dialog);
diff --git a/glom/frame_glom.cc b/glom/frame_glom.cc
index c72b9bd..0166c03 100644
--- a/glom/frame_glom.cc
+++ b/glom/frame_glom.cc
@@ -888,16 +888,8 @@ void Frame_Glom::on_menu_file_import()
     {
       file_chooser.hide();
 
-      //GtkBuilder can't find top-level objects (GtkAdjustments in this case),
-      //that one top-level object references.
-      //See http://bugzilla.gnome.org/show_bug.cgi?id=575714
-      //so we need to this silliness. murrayc.
-      std::list<Glib::ustring> builder_ids;
-      builder_ids.push_back("dialog_import_csv");
-      builder_ids.push_back("adjustment1");
-
       Dialog_Import_CSV* dialog = 0;
-      Glib::RefPtr<Gtk::Builder> refXml = Gtk::Builder::create_from_file(Utils::get_glade_file_path("glom.glade"), builder_ids);
+      Glib::RefPtr<Gtk::Builder> refXml = Gtk::Builder::create_from_file(Utils::get_glade_file_path("glom.glade"), "dialog_import_csv");
       refXml->get_widget_derived("dialog_import_csv", dialog);
       add_view(dialog);
 
diff --git a/glom/glom.glade b/glom/glom.glade
index f7a0e51..b01322a 100644
--- a/glom/glom.glade
+++ b/glom/glom.glade
@@ -1285,7 +1285,6 @@
                                   <object class="GtkSpinButton" id="import_csv_sample_rows">
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
-                                    <property name="adjustment">adjustment1</property>
                                     <property name="climb_rate">1</property>
                                   </object>
                                 </child>
@@ -1722,12 +1721,6 @@ The data in the field was not recognized. Please try to correct the data or reve
       <action-widget response="-5">import_csv_progress_ok_button</action-widget>
     </action-widgets>
   </object>
-  <object class="GtkAdjustment" id="adjustment1">
-    <property name="value">5</property>
-    <property name="upper">100</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
-  </object>
   <object class="GtkTextBuffer" id="textbuffer1"/>
   <object class="GtkDialog" id="dialog_image_progress">
     <property name="border_width">5</property>
diff --git a/glom/glom_developer.glade b/glom/glom_developer.glade
index 20d720e..2ec9065 100644
--- a/glom/glom_developer.glade
+++ b/glom/glom_developer.glade
@@ -6678,7 +6678,6 @@ Which user should be added to this group?</property>
                       <object class="GtkSpinButton" id="spinbutton_format_text_multiline_height">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
-                        <property name="adjustment">adjustment2</property>
                         <property name="climb_rate">1</property>
                         <property name="numeric">True</property>
                       </object>
@@ -10084,7 +10083,6 @@ What name should this module have?</property>
               <object class="GtkSpinButton" id="spin_columns">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="adjustment">adjustment1</property>
                 <property name="numeric">True</property>
               </object>
               <packing>
@@ -10390,15 +10388,4 @@ What name should this module have?</property>
       <action-widget response="-5">button_close</action-widget>
     </action-widgets>
   </object>
-  <object class="GtkAdjustment" id="adjustment1">
-    <property name="upper">10</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">2</property>
-  </object>
-  <object class="GtkAdjustment" id="adjustment2">
-    <property name="upper">100</property>
-    <property name="value">3</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
-  </object>
 </interface>
diff --git a/glom/mode_design/fields/dialog_fielddefinition.cc b/glom/mode_design/fields/dialog_fielddefinition.cc
index 8ad13e3..83a306a 100644
--- a/glom/mode_design/fields/dialog_fielddefinition.cc
+++ b/glom/mode_design/fields/dialog_fielddefinition.cc
@@ -83,18 +83,10 @@ Dialog_FieldDefinition::Dialog_FieldDefinition(BaseObjectType* cobject, const Gl
   //Get the place to put the Formatting stuff:
   builder->get_widget("box_formatting_placeholder", m_box_formatting_placeholder);
 
-  //GtkBuilder can't find top-level objects (GtkAdjustments in this case),
-  //that one top-level object references.
-  //See http://bugzilla.gnome.org/show_bug.cgi?id=575714
-  //so we need to this silliness. murrayc.
-  std::list<Glib::ustring> builder_ids;
-  builder_ids.push_back("box_formatting");
-  builder_ids.push_back("adjustment2");
-
   //Get the formatting stuff:
   try
   {
-    Glib::RefPtr<Gtk::Builder> refXmlFormatting = Gtk::Builder::create_from_file(Utils::get_glade_file_path("glom_developer.glade"), builder_ids);
+    Glib::RefPtr<Gtk::Builder> refXmlFormatting = Gtk::Builder::create_from_file(Utils::get_glade_file_path("glom_developer.glade"), "box_formatting");
     refXmlFormatting->get_widget_derived("box_formatting", m_box_formatting);
   }
   catch(const Gtk::BuilderError& ex)
diff --git a/glom/mode_design/layout/layout_item_dialogs/dialog_field_layout.cc b/glom/mode_design/layout/layout_item_dialogs/dialog_field_layout.cc
index bd2ee16..a2bb9df 100644
--- a/glom/mode_design/layout/layout_item_dialogs/dialog_field_layout.cc
+++ b/glom/mode_design/layout/layout_item_dialogs/dialog_field_layout.cc
@@ -50,18 +50,10 @@ Dialog_FieldLayout::Dialog_FieldLayout(BaseObjectType* cobject, const Glib::RefP
   builder->get_widget("radiobutton_use_custom", m_radiobutton_custom_formatting);
   builder->get_widget("box_formatting_placeholder", m_box_formatting_placeholder);
 
-  //GtkBuilder can't find top-level objects (GtkAdjustments in this case),
-  //that one top-level object references.
-  //See http://bugzilla.gnome.org/show_bug.cgi?id=575714
-  //so we need to this silliness. murrayc.
-  std::list<Glib::ustring> builder_ids;
-  builder_ids.push_back("box_formatting");
-  builder_ids.push_back("adjustment2");
-
   //Get the formatting stuff:
   try
   {
-    Glib::RefPtr<Gtk::Builder> refXmlFormatting = Gtk::Builder::create_from_file(Utils::get_glade_file_path("glom_developer.glade"), builder_ids);
+    Glib::RefPtr<Gtk::Builder> refXmlFormatting = Gtk::Builder::create_from_file(Utils::get_glade_file_path("glom_developer.glade"), "box_formatting");
     refXmlFormatting->get_widget_derived("box_formatting", m_box_formatting);
   }
   catch(const Gtk::BuilderError& ex)
diff --git a/glom/mode_design/layout/layout_item_dialogs/dialog_formatting.cc b/glom/mode_design/layout/layout_item_dialogs/dialog_formatting.cc
index 8feffcb..d769521 100644
--- a/glom/mode_design/layout/layout_item_dialogs/dialog_formatting.cc
+++ b/glom/mode_design/layout/layout_item_dialogs/dialog_formatting.cc
@@ -32,18 +32,10 @@ Dialog_Formatting::Dialog_Formatting()
   set_title(_("Formatting"));
   set_border_width(6);
 
-  //GtkBuilder can't find top-level objects (GtkAdjustments in this case),
-  //that one top-level object references.
-  //See http://bugzilla.gnome.org/show_bug.cgi?id=575714
-  //so we need to this silliness. murrayc.
-  std::list<Glib::ustring> builder_ids;
-  builder_ids.push_back("box_formatting");
-  builder_ids.push_back("adjustment2");
-
   //Get the formatting stuff:
   try
   {
-    Glib::RefPtr<Gtk::Builder> refXmlFormatting = Gtk::Builder::create_from_file(Utils::get_glade_file_path("glom_developer.glade"), builder_ids);
+    Glib::RefPtr<Gtk::Builder> refXmlFormatting = Gtk::Builder::create_from_file(Utils::get_glade_file_path("glom_developer.glade"), "box_formatting");
     refXmlFormatting->get_widget_derived("box_formatting", m_box_formatting);
   }
   catch(const Gtk::BuilderError& ex)
diff --git a/glom/mode_design/print_layouts/dialog_text_formatting.cc b/glom/mode_design/print_layouts/dialog_text_formatting.cc
index cfc7c92..2aa2462 100644
--- a/glom/mode_design/print_layouts/dialog_text_formatting.cc
+++ b/glom/mode_design/print_layouts/dialog_text_formatting.cc
@@ -39,18 +39,10 @@ Dialog_TextFormatting::Dialog_TextFormatting(BaseObjectType* cobject, const Glib
   //Get the place to put the Formatting stuff:
   builder->get_widget("box_formatting_placeholder", m_box_formatting_placeholder);
  
-  //GtkBuilder can't find top-level objects (GtkAdjustments in this case),
-  //that one top-level object references.
-  //See http://bugzilla.gnome.org/show_bug.cgi?id=575714
-  //so we need to this silliness. murrayc.
-  std::list<Glib::ustring> builder_ids;
-  builder_ids.push_back("box_formatting");
-  builder_ids.push_back("adjustment2");
- 
   //Get the formatting stuff:
   try
   {
-    Glib::RefPtr<Gtk::Builder> refXmlFormatting = Gtk::Builder::create_from_file(Utils::get_glade_file_path("glom_developer.glade"), builder_ids);
+    Glib::RefPtr<Gtk::Builder> refXmlFormatting = Gtk::Builder::create_from_file(Utils::get_glade_file_path("glom_developer.glade"), "box_formatting");
     refXmlFormatting->get_widget_derived("box_formatting", m_box_formatting);
   }
   catch(const Gtk::BuilderError& ex)



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