[glom] Revert "New ID in progress"
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] Revert "New ID in progress"
- Date: Thu, 29 Dec 2011 08:24:30 +0000 (UTC)
commit 9aa5845b1f08a7eac374cdf3afc1d42d185baaef
Author: Murray Cumming <murrayc murrayc com>
Date: Thu Dec 29 09:24:14 2011 +0100
Revert "New ID in progress"
I did not mean to push this yet.
This reverts commit e3231b2a09cfe2042296411a882e2fb0fd5d257d.
Makefile_glom.am | 4 +-
glom/mode_data/box_data_details.cc | 1 +
glom/mode_data/datawidget/datawidget.cc | 67 ------------
glom/mode_data/datawidget/datawidget.h | 5 -
glom/mode_data/datawidget/dialog_new_record.cc | 90 ----------------
glom/mode_data/datawidget/dialog_new_record.h | 67 ------------
po/POTFILES.in | 1 -
tests/test_glade_derived_instantiation.cc | 34 +++---
ui/operator/dialog_new_record.glade | 133 ------------------------
9 files changed, 18 insertions(+), 384 deletions(-)
---
diff --git a/Makefile_glom.am b/Makefile_glom.am
index ce853b6..b756d3f 100644
--- a/Makefile_glom.am
+++ b/Makefile_glom.am
@@ -173,9 +173,7 @@ glom_source_files = \
glom/mode_data/datawidget/dialog_choose_date.cc \
glom/mode_data/datawidget/dialog_choose_date.h \
glom/mode_data/datawidget/dialog_choose_id.cc \
- glom/mode_data/datawidget/dialog_choose_id.h \
- glom/mode_data/datawidget/dialog_new_record.cc \
- glom/mode_data/datawidget/dialog_new_record.h \
+ glom/mode_data/datawidget/dialog_choose_id.h \
glom/mode_data/datawidget/combo.cc \
glom/mode_data/datawidget/combo.h \
glom/mode_data/datawidget/combochoices.cc \
diff --git a/glom/mode_data/box_data_details.cc b/glom/mode_data/box_data_details.cc
index 8ac054a..3ebfd75 100644
--- a/glom/mode_data/box_data_details.cc
+++ b/glom/mode_data/box_data_details.cc
@@ -864,6 +864,7 @@ void Box_Data_Details::on_flowtable_field_edited(const sharedptr<const LayoutIte
else
{
//It is not auto-generated:
+
if(m_field_primary_key && strFieldName == m_field_primary_key->get_name()) //if it is the primary key that is being edited.
{
if(!check_entered_value_for_uniqueness(m_table_name, layout_field, field_value, window))
diff --git a/glom/mode_data/datawidget/datawidget.cc b/glom/mode_data/datawidget/datawidget.cc
index 5b21033..39fbd7b 100644
--- a/glom/mode_data/datawidget/datawidget.cc
+++ b/glom/mode_data/datawidget/datawidget.cc
@@ -32,7 +32,6 @@
#include <glom/mode_design/layout/dialog_choose_field.h>
#include <glom/mode_data/datawidget/dialog_choose_id.h>
#include <glom/mode_data/datawidget/dialog_choose_date.h>
-#include <glom/mode_data/datawidget/dialog_new_record.h>
#include <glom/mode_design/layout/layout_item_dialogs/dialog_field_layout.h>
#include <glom/utils_ui.h>
#include <glom/glade_utils.h>
@@ -232,11 +231,6 @@ DataWidget::DataWidget(const sharedptr<LayoutItem_Field>& field, const Glib::ust
button_select->set_tooltip_text(_("Enter search criteria to identify records in the other table, to choose an ID for this field."));
hbox_parent->pack_start(*button_select, Gtk::PACK_SHRINK);
button_select->signal_clicked().connect(sigc::mem_fun(*this, &DataWidget::on_button_select_id));
-
- Gtk::Button* button_new = Gtk::manage(new Gtk::Button(Gtk::Stock::NEW));
- button_new->set_tooltip_text(_("Enter details for a new record in the other table, then use its ID for this field."));
- hbox_parent->pack_start(*button_new, Gtk::PACK_SHRINK);
- button_new->signal_clicked().connect(sigc::mem_fun(*this, &DataWidget::on_button_new_id));
}
}
@@ -593,18 +587,6 @@ const Gtk::Widget* DataWidget::get_data_child_widget() const
}
}
-void DataWidget::on_button_new_id()
-{
- Gnome::Gda::Value chosen_id;
- const bool chosen = offer_related_record_id_new(chosen_id);
- std::cout << "debug: chosen_id=" << chosen_id.to_string() << std::endl;
- if(chosen)
- {
- set_value(chosen_id);
- m_signal_edited.emit(chosen_id);
- }
-}
-
void DataWidget::on_button_choose_date()
{
DataWidgetChildren::Dialog_ChooseDate* dialog = 0;
@@ -686,53 +668,4 @@ bool DataWidget::offer_related_record_id_find(Gnome::Gda::Value& chosen_id)
return result;
}
-
-bool DataWidget::offer_related_record_id_new(Gnome::Gda::Value& chosen_id)
-{
- bool result = false;
-
- //Initialize output variable:
- chosen_id = Gnome::Gda::Value();
-
- DataWidgetChildren::Dialog_NewRecord* dialog = 0;
- Glom::Utils::get_glade_widget_derived_with_warning(dialog);
-
- if(dialog)
- {
- //dialog->set_document(get_document(), table_name, field);
- Gtk::Window* parent = get_application();
- if(parent)
- dialog->set_transient_for(*parent);
- add_view(dialog);
-
- //Discover the related table, in the relationship that uses this ID field:
- Glib::ustring related_table_name;
- sharedptr<const LayoutItem_Field> layoutField = sharedptr<LayoutItem_Field>::cast_dynamic(get_layout_item());
- if(layoutField)
- {
- sharedptr<const Relationship> relationship = get_document()->get_field_used_in_relationship_to_one(m_table_name, layoutField);
- if(relationship)
- related_table_name = relationship->get_to_table();
- }
- else
- g_warning("get_layout_item() was not a LayoutItem_Field");
-
- dialog->init_db_details(related_table_name, Base_DB::get_active_layout_platform(get_document()));
-
-
- const int response = dialog->run();
- dialog->hide();
- if(response == Gtk::RESPONSE_OK)
- {
- //Get the chosen field:
- result = dialog->get_id_chosen(chosen_id);
- }
-
- remove_view(dialog);
- delete dialog;
- }
-
- return result;
-}
-
} //namespace Glom
diff --git a/glom/mode_data/datawidget/datawidget.h b/glom/mode_data/datawidget/datawidget.h
index 6d0d422..16e9000 100644
--- a/glom/mode_data/datawidget/datawidget.h
+++ b/glom/mode_data/datawidget/datawidget.h
@@ -92,7 +92,6 @@ private:
#endif // !GLOM_ENABLE_CLIENT_ONLY
void on_button_open_details();
void on_button_select_id();
- void on_button_new_id();
void on_button_choose_date();
// Don't call it on_style_changed, otherwise we would override a virtual
@@ -116,10 +115,6 @@ private:
*/
bool offer_related_record_id_find(Gnome::Gda::Value& chosen_id);
- /** Show a dialog with Details so that the user can add a new record and then use that ID value to indicate that related record.
- */
- bool offer_related_record_id_new(Gnome::Gda::Value& chosen_id);
-
private:
void update_go_to_details_button_sensitivity();
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 4af0307..f056d39 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -144,7 +144,6 @@ ui/operator/dialog_connection.glade
ui/operator/dialog_data_invalid_format.glade
ui/operator/dialog_existing_or_new.glade
ui/operator/dialog_find_id.glade
-ui/operator/dialog_new_record.glade
ui/operator/dialog_image_load_progress.glade
ui/operator/dialog_image_save_progress.glade
ui/operator/dialog_import_csv.glade
diff --git a/tests/test_glade_derived_instantiation.cc b/tests/test_glade_derived_instantiation.cc
index 98160ac..a7cc090 100644
--- a/tests/test_glade_derived_instantiation.cc
+++ b/tests/test_glade_derived_instantiation.cc
@@ -1,3 +1,19 @@
+#include <glom/glade_utils.h>
+#include <glom/application.h>
+#include <glom/dialog_existing_or_new.h>
+#include <glom/mode_design/print_layouts/box_print_layouts.h>
+#include <glom/mode_design/relationships_overview/dialog_relationships_overview.h>
+#include <glom/mode_design/dialog_relationships.h>
+#include <glom/mode_design/report_layout/dialog_layout_report.h>
+#include <glom/box_reports.h>
+#include <glom/navigation/box_tables.h>
+#include <glom/import_csv/dialog_import_csv.h>
+#include <glom/import_csv/dialog_import_csv_progress.h>
+#include <glom/mode_data/datawidget/dialog_choose_date.h>
+#include <glom/mode_data/datawidget/dialog_choose_id.h>
+#include <glom/utility_widgets/dialog_flowtable.h>
+#include <glom/utility_widgets/dialog_image_load_progress.h>
+#include <glom/utility_widgets/dialog_image_save_progress.h>
/* Glom
*
* Copyright (C) 2010-2011 Murray Cumming
@@ -18,23 +34,6 @@
* Boston, MA 02111-1307, USA.
*/
-#include <glom/glade_utils.h>
-#include <glom/application.h>
-#include <glom/dialog_existing_or_new.h>
-#include <glom/mode_design/print_layouts/box_print_layouts.h>
-#include <glom/mode_design/relationships_overview/dialog_relationships_overview.h>
-#include <glom/mode_design/dialog_relationships.h>
-#include <glom/mode_design/report_layout/dialog_layout_report.h>
-#include <glom/box_reports.h>
-#include <glom/navigation/box_tables.h>
-#include <glom/import_csv/dialog_import_csv.h>
-#include <glom/import_csv/dialog_import_csv_progress.h>
-#include <glom/mode_data/datawidget/dialog_choose_date.h>
-#include <glom/mode_data/datawidget/dialog_choose_id.h>
-#include <glom/mode_data/datawidget/dialog_new_record.h>
-#include <glom/utility_widgets/dialog_flowtable.h>
-#include <glom/utility_widgets/dialog_image_load_progress.h>
-#include <glom/utility_widgets/dialog_image_save_progress.h>
#include <glom/mode_design/layout/dialog_choose_field.h>
#include <glom/mode_design/dialog_add_related_table.h>
#include <glom/mode_design/layout/layout_item_dialogs/dialog_buttonscript.h>
@@ -128,7 +127,6 @@ int main(int argc, char *argv[])
instantiate_widget<Dialog_Import_CSV_Progress>();
instantiate_widget<DataWidgetChildren::Dialog_ChooseID>();
instantiate_widget<DataWidgetChildren::Dialog_ChooseDate>();
- instantiate_widget<DataWidgetChildren::Dialog_NewRecord>();
instantiate_widget<Dialog_InvalidData>();
instantiate_widget<DialogImageLoadProgress>();
instantiate_widget<DialogImageSaveProgress>();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]