[glom] ComboChoices: Renamed set_choices() to set_choices_fixed()
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] ComboChoices: Renamed set_choices() to set_choices_fixed()
- Date: Thu, 23 Sep 2010 08:27:31 +0000 (UTC)
commit f2e5dcb2f64ca16b15902f0b4bf209ff40f68f3e
Author: Murray Cumming <murrayc murrayc com>
Date: Wed Sep 22 11:19:28 2010 +0200
ComboChoices: Renamed set_choices() to set_choices_fixed()
* glom/mode_data/datawidget/combochoices.h: Rename set_choices() to
set_choices_fixed() to make code clearer.
* glom/mode_data/datawidget/combo_as_radio_buttons.[h|cc]
* glom/mode_data/datawidget/combochoiceswithtreemodel.[h|cc]
* glom/mode_data/datawidget/datawidget.cc:
* glom/mode_data/db_adddel/db_adddel.cc: Adapted.
ChangeLog | 35 +++++++++++++-------
.../mode_data/datawidget/combo_as_radio_buttons.cc | 2 +-
glom/mode_data/datawidget/combo_as_radio_buttons.h | 2 +-
glom/mode_data/datawidget/combochoices.h | 10 ++++-
.../datawidget/combochoiceswithtreemodel.cc | 2 +-
.../datawidget/combochoiceswithtreemodel.h | 2 +-
glom/mode_data/datawidget/datawidget.cc | 4 +-
glom/mode_data/db_adddel/db_adddel.cc | 2 +-
8 files changed, 38 insertions(+), 21 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index eba07a7..ade5487 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,21 @@
+2010-09-22 Murray Cumming <murrayc murrayc com>
+
+ ComboChoices: Renamed set_choices() to set_choices_fixed()
+
+ * glom/mode_data/datawidget/combochoices.h: Rename set_choices() to
+ set_choices_fixed() to make code clearer.
+ * glom/mode_data/datawidget/combo_as_radio_buttons.[h|cc]
+ * glom/mode_data/datawidget/combochoiceswithtreemodel.[h|cc]
+ * glom/mode_data/datawidget/datawidget.cc:
+ * glom/mode_data/db_adddel/db_adddel.cc: Adapted.
+
2010-09-18 Murray Cumming <murrayc murrayc com>
Split Base_DB_Table_Data into a read-only base class.
* glom/Makefile_glom.am:
* po/POTFILES.in:
- * glom/base_db_table_data_readonly.[h|cc]: Created this new class from
+ * glom/base_db_table_data_readonly.[h|cc]: Created this new class from
parts of:
* glom/base_db_table_data.[h|cc]: which now derives from it.
This let us use it for classes that do not allow the user to change the data.
@@ -14,7 +25,7 @@
Fix the build with gtkmm 3 from git master.
- * glom/utility_widgets/flowtable.cc: Use SizeRequest::get_size() instead
+ * glom/utility_widgets/flowtable.cc: Use SizeRequest::get_size() instead
Gtk::Widget::size_request(), removed in gtkmm 3.
2010-09-15 Murray Cumming <murrayc murrayc com>
@@ -22,7 +33,7 @@
Replace use of ALIGN_LEFT/RIGHT/TOP/BOTTOM with START/END.
* glom/mode_data/flowtablewithfields.cc:
- * glom/print_layout/canvas_layout_item.cc: Use only the non-deprecated
+ * glom/print_layout/canvas_layout_item.cc: Use only the non-deprecated
enum values.
2010-09-11 Murray Cumming <murrayc murrayc com>
@@ -30,27 +41,27 @@
DbAddDel: Cleanup: Rename glom_db_treemodel.[h|cc] to treemodel_db.[h|cc].
* glom/mode_data/db_adddel/glom_db_treemodel.[h|cc]:
- * glom/mode_data/db_adddel/treemodel_db.[h|cc]: Also rename the class from
+ * glom/mode_data/db_adddel/treemodel_db.[h|cc]: Also rename the class from
DbTreeModel to TreeModelDb to match.
2010-09-11 Murray Cumming <murrayc murrayc com>
Choices combo widgets: Improve the API.
- * glom/mode_data/datawidget/combochoiceswithtreemodel.[h|cc]:
+ * glom/mode_data/datawidget/combochoiceswithtreemodel.[h|cc]:
Make create_model() non virtual, instead adding a pure virtual use_model().
- * glom/mode_data/datawidget/combo.[h|cc]:
- * glom/mode_data/datawidget/comboentry.[h|cc]:
- * glom/mode_data/db_adddel/cellrenderer_dblist.[h|cc]: Change the
+ * glom/mode_data/datawidget/combo.[h|cc]:
+ * glom/mode_data/datawidget/comboentry.[h|cc]:
+ * glom/mode_data/db_adddel/cellrenderer_dblist.[h|cc]: Change the
create_model() overrides to use_model() overrides.
2010-09-11 Murray Cumming <murrayc murrayc com>
Choices combo widgets: Initial work to make the model generic.
- * glom/mode_data/datawidget/combochoiceswithtreemodel.[h|cc]: Change
- m_refModel to a generic TreeModel, make it private ,and add a
- get_choices_model() accessor, as a step to optionally using a db-based
+ * glom/mode_data/datawidget/combochoiceswithtreemodel.[h|cc]: Change
+ m_refModel to a generic TreeModel, make it private ,and add a
+ get_choices_model() accessor, as a step to optionally using a db-based
treemodel like Db_AddDel.
* glom/mode_data/datawidget/combo.cc:
* glom/mode_data/datawidget/comboentry.cc:
@@ -60,7 +71,7 @@
Moved the Db_AddDel code.
- * glom/utility_widgets/db_adddel/*.[h|cc]: Moved this to
+ * glom/utility_widgets/db_adddel/*.[h|cc]: Moved this to
* glom/mode_data/db_adddel/ because that is where it is used.
2010-09-10 Murray Cumming <murrayc murrayc com>
diff --git a/glom/mode_data/datawidget/combo_as_radio_buttons.cc b/glom/mode_data/datawidget/combo_as_radio_buttons.cc
index ed96c1d..de781dd 100644
--- a/glom/mode_data/datawidget/combo_as_radio_buttons.cc
+++ b/glom/mode_data/datawidget/combo_as_radio_buttons.cc
@@ -119,7 +119,7 @@ void ComboAsRadioButtons::set_choices_with_second(const type_list_values_with_se
}
}
-void ComboAsRadioButtons::set_choices(const FieldFormatting::type_list_values& list_values)
+void ComboAsRadioButtons::set_choices_fixed(const FieldFormatting::type_list_values& list_values)
{
//Clear existing buttons:
for(type_map_buttons::iterator iter = m_map_buttons.begin();
diff --git a/glom/mode_data/datawidget/combo_as_radio_buttons.h b/glom/mode_data/datawidget/combo_as_radio_buttons.h
index c3a63dc..fd26438 100644
--- a/glom/mode_data/datawidget/combo_as_radio_buttons.h
+++ b/glom/mode_data/datawidget/combo_as_radio_buttons.h
@@ -48,7 +48,7 @@ public:
virtual ~ComboAsRadioButtons();
- virtual void set_choices(const FieldFormatting::type_list_values& list_values);
+ virtual void set_choices_fixed(const FieldFormatting::type_list_values& list_values);
virtual void set_read_only(bool read_only = true);
diff --git a/glom/mode_data/datawidget/combochoices.h b/glom/mode_data/datawidget/combochoices.h
index 5b0776b..664776b 100644
--- a/glom/mode_data/datawidget/combochoices.h
+++ b/glom/mode_data/datawidget/combochoices.h
@@ -46,9 +46,15 @@ public:
virtual ~ComboChoices();
- virtual void set_choices(const FieldFormatting::type_list_values& list_values) = 0;
+ /** Set a list of choice values, for instance for a list of custom choices.
+ * You should first call set_layout_item() to provide formatting details.
+ */
+ virtual void set_choices_fixed(const FieldFormatting::type_list_values& list_values) = 0;
- /**
+ /** Show the list of related chocie values based on the LayoutItem's formatting choices.
+ * You should first call set_layout_item() to provide that formatting detail,
+ * so the widget knows what choices to show, and how to format them.
+ *
* See also refresh_data_from_database_with_foreign_key().
*/
void set_choices_related(const Document* document);
diff --git a/glom/mode_data/datawidget/combochoiceswithtreemodel.cc b/glom/mode_data/datawidget/combochoiceswithtreemodel.cc
index 4aba921..6007132 100644
--- a/glom/mode_data/datawidget/combochoiceswithtreemodel.cc
+++ b/glom/mode_data/datawidget/combochoiceswithtreemodel.cc
@@ -169,7 +169,7 @@ void ComboChoicesWithTreeModel::set_choices_with_second(const type_list_values_w
}
-void ComboChoicesWithTreeModel::set_choices(const FieldFormatting::type_list_values& list_values)
+void ComboChoicesWithTreeModel::set_choices_fixed(const FieldFormatting::type_list_values& list_values)
{
create_model(1);
diff --git a/glom/mode_data/datawidget/combochoiceswithtreemodel.h b/glom/mode_data/datawidget/combochoiceswithtreemodel.h
index 219893e..643b66b 100644
--- a/glom/mode_data/datawidget/combochoiceswithtreemodel.h
+++ b/glom/mode_data/datawidget/combochoiceswithtreemodel.h
@@ -37,7 +37,7 @@ public:
virtual ~ComboChoicesWithTreeModel();
- virtual void set_choices(const FieldFormatting::type_list_values& list_values);
+ virtual void set_choices_fixed(const FieldFormatting::type_list_values& list_values);
//Not named get_model(), to avoid clashing with ComboBox::get_model().
Glib::RefPtr<Gtk::TreeModel> get_choices_model();
diff --git a/glom/mode_data/datawidget/datawidget.cc b/glom/mode_data/datawidget/datawidget.cc
index fcb0185..c94720c 100644
--- a/glom/mode_data/datawidget/datawidget.cc
+++ b/glom/mode_data/datawidget/datawidget.cc
@@ -120,10 +120,10 @@ DataWidget::DataWidget(const sharedptr<LayoutItem_Field>& field, const Glib::ust
if(field->get_formatting_used().get_has_custom_choices())
{
- //set_choices() needs this, for the numeric layout:
+ //set_choices_fixed() needs this, for the numeric layout:
combo->set_layout_item( get_layout_item(), table_name);
- combo->set_choices( field->get_formatting_used().get_choices_custom() );
+ combo->set_choices_fixed( field->get_formatting_used().get_choices_custom() );
}
else if(field->get_formatting_used().get_has_related_choices())
{
diff --git a/glom/mode_data/db_adddel/db_adddel.cc b/glom/mode_data/db_adddel/db_adddel.cc
index 1771c52..545c7ac 100644
--- a/glom/mode_data/db_adddel/db_adddel.cc
+++ b/glom/mode_data/db_adddel/db_adddel.cc
@@ -822,7 +822,7 @@ Gtk::CellRenderer* DbAddDel::construct_specified_columns_cellrenderer(const shar
if(item_field && item_field->get_formatting_used().get_has_custom_choices())
{
- //set_choices() needs this, for the numeric layout:
+ //set_choices_fixed() needs this, for the numeric layout:
//pCellRendererCombo->set_layout_item(get_layout_item()->clone(), table_name); //TODO_Performance: We only need this for the numerical format.
const FieldFormatting::type_list_values list_values = item_field->get_formatting_used().get_choices_custom();
for(FieldFormatting::type_list_values::const_iterator iter = list_values.begin(); iter != list_values.end(); ++iter)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]