[glom/feature_choices_related_layout] In progress



commit d0fef1d58a58ba855034ac1fd2f09ff812857c32
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Sep 7 16:29:09 2010 +0200

    In progress

 glom/mode_design/fields/dialog_fielddefinition.cc  |   15 ++++++++-------
 .../layout/layout_item_dialogs/box_formatting.cc   |    8 ++++++--
 .../layout/layout_item_dialogs/box_formatting.h    |    5 +++++
 3 files changed, 19 insertions(+), 9 deletions(-)
---
diff --git a/glom/mode_design/fields/dialog_fielddefinition.cc b/glom/mode_design/fields/dialog_fielddefinition.cc
index 5d17274..de5a404 100644
--- a/glom/mode_design/fields/dialog_fielddefinition.cc
+++ b/glom/mode_design/fields/dialog_fielddefinition.cc
@@ -45,7 +45,7 @@ Dialog_FieldDefinition::Dialog_FieldDefinition(BaseObjectType* cobject, const Gl
 
   builder->get_widget("checkbutton_unique",  m_pCheck_Unique);
   builder->get_widget("checkbutton_primarykey",  m_pCheck_PrimaryKey);
-  builder->get_widget("checkbutton_autoincrement",  m_pCheck_AutoIncrement);  
+  builder->get_widget("checkbutton_autoincrement",  m_pCheck_AutoIncrement);
 
   builder->get_widget("hbox_default_value_simple",  m_pBox_DefaultValueSimple);
 
@@ -97,6 +97,10 @@ Dialog_FieldDefinition::Dialog_FieldDefinition(BaseObjectType* cobject, const Gl
   on_foreach_connect(*m_pBox_ValueTab);
   on_foreach_connect(*m_box_formatting);
 
+  //Plus an extra signal for the related extra show-also fields:
+  m_box_formatting->signal_modified().connect(
+   sigc::mem_fun(*this, &Dialog_FieldDefinition::on_anything_changed));
+
   Dialog_Properties::set_modified(false);
 
   show_all_children();
@@ -160,7 +164,7 @@ void Dialog_FieldDefinition::set_field(const sharedptr<const Field>& field, cons
   if(!pLabel->get_text().empty())
     m_pBox_DefaultValueSimple->pack_start(*pLabel);
 
-  m_pBox_DefaultValueSimple->pack_end(*m_pDataWidget_DefaultValueSimple, Gtk::PACK_EXPAND_WIDGET); 
+  m_pBox_DefaultValueSimple->pack_end(*m_pDataWidget_DefaultValueSimple, Gtk::PACK_EXPAND_WIDGET);
   m_pDataWidget_DefaultValueSimple->set_value(default_value);
   m_pDataWidget_DefaultValueSimple->show();
 
@@ -220,7 +224,7 @@ sharedptr<Field> Dialog_FieldDefinition::get_field() const
   // const_cast is necessary and save here for the window (jhs)
   sharedptr<SharedConnection> sharedcnc = connect_to_server(const_cast<Dialog_FieldDefinition*>(this));
   Glib::RefPtr<Gnome::Gda::Connection> cnc = sharedcnc->get_gda_connection();
-  
+
   //Get the field info from the widgets:
 
   Glib::RefPtr<Gnome::Gda::Column> fieldInfo = field->get_field_info(); //Preserve previous information.
@@ -372,7 +376,7 @@ void Dialog_FieldDefinition::on_button_edit_calculation()
   //TODO: Share a global instance, to make this quicker?
   Dialog_FieldCalculation* dialog = 0;
   Utils::get_glade_widget_derived_with_warning(dialog);
-  
+
   add_view(dialog); //Give it access to the document.
 
   m_Field->set_calculation( m_pTextView_Calculation->get_buffer()->get_text() );
@@ -389,6 +393,3 @@ void Dialog_FieldDefinition::on_button_edit_calculation()
 }
 
 } //namespace Glom
-
-
-
diff --git a/glom/mode_design/layout/layout_item_dialogs/box_formatting.cc b/glom/mode_design/layout/layout_item_dialogs/box_formatting.cc
index a85ca73..2f46482 100644
--- a/glom/mode_design/layout/layout_item_dialogs/box_formatting.cc
+++ b/glom/mode_design/layout/layout_item_dialogs/box_formatting.cc
@@ -512,11 +512,15 @@ void Box_Formatting::on_button_choices_extra()
       Utils::get_list_of_layout_items_for_display(m_dialog_choices_extra_fields->get_fields());
      m_label_choices_extra_fields->set_text(text_extra_fields);
 
-    //TODO: Mark the dialog as modified.
+    //Tell the parent (which connects directly to all other (regular) widgets):
+    m_signal_modified.emit();
   }
+}
 
 
-  //update_labels();
+Box_Formatting::type_signal_modified Box_Formatting::signal_modified()
+{
+  return m_signal_modified;
 }
 
 } //namespace Glom
diff --git a/glom/mode_design/layout/layout_item_dialogs/box_formatting.h b/glom/mode_design/layout/layout_item_dialogs/box_formatting.h
index e4e5197..350756f 100644
--- a/glom/mode_design/layout/layout_item_dialogs/box_formatting.h
+++ b/glom/mode_design/layout/layout_item_dialogs/box_formatting.h
@@ -63,6 +63,9 @@ public:
   //we hide some stuff:
   void set_is_for_print_layout();
 
+  typedef sigc::signal<void> type_signal_modified;
+  type_signal_modified signal_modified();
+
 private:
   //Signal handlers:
   void on_combo_choices_relationship_changed();
@@ -120,6 +123,8 @@ private:
   bool m_show_numeric;
   bool m_show_choices;
 
+  type_signal_modified m_signal_modified;
+
 
   class AlignmentColumns: public Gtk::TreeModelColumnRecord
   {



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