Commit 33ec8371 authored by Murray Cumming's avatar Murray Cumming
Browse files

Box_DB_Table_Definition: Add back n_default_formatting_apply() and use it.

This was mistakenly removed in this commit:
https://git.gnome.org/browse/glom/commit/glom/mode_design/fields/box_db_table_definition.cc?id=8969ae3050f4fbfc004712b066423d3f24da8556
but it should have just been corrected properly instead.

This lets people actually change the default field formatting again,
fixing bug #763348 (m.rick.mac)

This seems to have been broken since 2013-10:
https://git.gnome.org/browse/glom/commit/glom/mode_design/fields/box_db_table_definition.cc?id=2bb23a44
parent e5037270
......@@ -54,7 +54,7 @@ void Box_DB_Table_Definition::init()
if(m_dialog_default_formatting)
{
add_view(m_dialog_default_formatting);
m_dialog_default_formatting->signal_apply().connect(sigc::mem_fun(*this, &Box_DB_Table_Definition::on_field_definition_apply));
m_dialog_default_formatting->signal_apply().connect(sigc::mem_fun(*this, &Box_DB_Table_Definition::on_default_formatting_apply));
}
pack_start(m_AddDel);
......@@ -541,6 +541,26 @@ void Box_DB_Table_Definition::on_field_definition_apply()
m_dialog_field_definition->hide();
}
void Box_DB_Table_Definition::on_default_formatting_apply()
{
std::shared_ptr<Field> field_New = m_dialog_default_formatting->get_field();
if(*m_Field_BeingEdited != *field_New)
{
const auto bcontinue = check_field_change(m_Field_BeingEdited, field_New);
if(bcontinue)
{
change_definition(m_Field_BeingEdited, field_New);
m_Field_BeingEdited = field_New;
}
//Update the list:
fill_from_database();
}
m_dialog_default_formatting->hide();
}
std::shared_ptr<Field> Box_DB_Table_Definition::change_definition(const std::shared_ptr<const Field>& fieldOld, const std::shared_ptr<const Field>& field)
{
BusyCursor busy_cursor(get_app_window());
......
......@@ -57,6 +57,7 @@ private:
void on_adddel_extra(const Gtk::TreeModel::iterator& row);
void on_field_definition_apply();
void on_default_formatting_apply();
bool check_field_change(const std::shared_ptr<const Field>& field_old, const std::shared_ptr<const Field>& field_new);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment