[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master ceb33b3: Experimentally offer overwrite seman
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master ceb33b3: Experimentally offer overwrite semantics for census paste |
Date: |
Tue, 26 Jun 2018 07:20:51 -0400 (EDT) |
branch: master
commit ceb33b3d5d19cd53615e861a5e68d85d7cea4763
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Experimentally offer overwrite semantics for census paste
---
census_view.cpp | 5 +++--
configurable_settings.cpp | 9 +++++++++
configurable_settings.hpp | 2 ++
install_msw.sh | 1 +
preferences_model.cpp | 3 +++
preferences_model.hpp | 1 +
preferences_view.xrc | 8 ++++++++
7 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/census_view.cpp b/census_view.cpp
index 40f4e1a..b41fe30 100644
--- a/census_view.cpp
+++ b/census_view.cpp
@@ -1848,8 +1848,9 @@ void CensusView::UponPasteCensus(wxCommandEvent&)
selection = 0;
}
else if
- ( contains(global_settings::instance().pyx(), "cut_census")
- && cell_parms() == case_parms()
+ (configurable_settings::instance().census_paste_palimpsestically()
+ || contains(global_settings::instance().pyx(), "cut_census")
+ && cell_parms() == case_parms()
)
{
cell_parms().swap(cells);
diff --git a/configurable_settings.cpp b/configurable_settings.cpp
index 42a5327..7aa56a0 100644
--- a/configurable_settings.cpp
+++ b/configurable_settings.cpp
@@ -132,6 +132,7 @@ std::string const& default_calculation_summary_columns()
configurable_settings::configurable_settings()
:calculation_summary_columns_
(default_calculation_summary_columns())
+ ,census_paste_palimpsestically_ (true
)
,cgi_bin_log_filename_ ("cgi_bin.log"
)
,custom_input_0_filename_ ("custom.ini"
)
,custom_input_1_filename_ ("custom.inix"
)
@@ -190,6 +191,7 @@ configurable_settings& configurable_settings::instance()
void configurable_settings::ascribe_members()
{
ascribe("calculation_summary_columns"
,&configurable_settings::calculation_summary_columns_ );
+ ascribe("census_paste_palimpsestically"
,&configurable_settings::census_paste_palimpsestically_ );
ascribe("cgi_bin_log_filename"
,&configurable_settings::cgi_bin_log_filename_ );
ascribe("custom_input_0_filename"
,&configurable_settings::custom_input_0_filename_ );
ascribe("custom_input_1_filename"
,&configurable_settings::custom_input_1_filename_ );
@@ -314,6 +316,13 @@ std::string const&
configurable_settings::calculation_summary_columns() const
return calculation_summary_columns_;
}
+/// When pasting a census, replace old contents instead of appending.
+
+bool configurable_settings::census_paste_palimpsestically() const
+{
+ return census_paste_palimpsestically_;
+}
+
/// Name of log file used for cgicc's debugging facility.
std::string const& configurable_settings::cgi_bin_log_filename() const
diff --git a/configurable_settings.hpp b/configurable_settings.hpp
index 99e8642..b1cbead 100644
--- a/configurable_settings.hpp
+++ b/configurable_settings.hpp
@@ -51,6 +51,7 @@ class LMI_SO configurable_settings final
void save() const;
std::string const& calculation_summary_columns () const;
+ bool census_paste_palimpsestically () const;
std::string const& cgi_bin_log_filename () const;
std::string const& custom_input_0_filename () const;
std::string const& custom_input_1_filename () const;
@@ -94,6 +95,7 @@ class LMI_SO configurable_settings final
) override;
std::string calculation_summary_columns_;
+ bool census_paste_palimpsestically_;
std::string cgi_bin_log_filename_;
std::string custom_input_0_filename_;
std::string custom_input_1_filename_;
diff --git a/install_msw.sh b/install_msw.sh
index 627db30..dd6ffb8 100755
--- a/install_msw.sh
+++ b/install_msw.sh
@@ -221,6 +221,7 @@ cat >/opt/lmi/data/configurable_settings.xml <<EOF
<?xml version="1.0"?>
<configurable_settings version="2">
<calculation_summary_columns/>
+ <census_paste_palimpsestically>1</census_paste_palimpsestically>
<cgi_bin_log_filename>cgi_bin.log</cgi_bin_log_filename>
<custom_input_0_filename>custom.ini</custom_input_0_filename>
<custom_input_1_filename>custom.inix</custom_input_1_filename>
diff --git a/preferences_model.cpp b/preferences_model.cpp
index 48d76c8..9e11d3a 100644
--- a/preferences_model.cpp
+++ b/preferences_model.cpp
@@ -111,6 +111,7 @@ void PreferencesModel::AscribeMembers()
ascribe("CalculationSummaryColumn09" ,
&PreferencesModel::CalculationSummaryColumn09 );
ascribe("CalculationSummaryColumn10" ,
&PreferencesModel::CalculationSummaryColumn10 );
ascribe("CalculationSummaryColumn11" ,
&PreferencesModel::CalculationSummaryColumn11 );
+ ascribe("CensusPastePalimpsestically" ,
&PreferencesModel::CensusPastePalimpsestically );
ascribe("DefaultInputFilename" ,
&PreferencesModel::DefaultInputFilename );
ascribe("PrintDirectory" ,
&PreferencesModel::PrintDirectory );
ascribe("SecondsToPauseBetweenPrintouts",
&PreferencesModel::SecondsToPauseBetweenPrintouts);
@@ -267,6 +268,7 @@ void PreferencesModel::Load()
}
}
+ CensusPastePalimpsestically = z.census_paste_palimpsestically() ? "Yes"
: "No";
DefaultInputFilename = native_path(z.default_input_filename());
PrintDirectory = native_path(z.print_directory());
SecondsToPauseBetweenPrintouts = z.seconds_to_pause_between_printouts();
@@ -297,6 +299,7 @@ void PreferencesModel::Save() const
configurable_settings& z = configurable_settings::instance();
z["calculation_summary_columns" ] = string_of_column_names();
+ z["census_paste_palimpsestically" ] = value_cast<std::string>("Yes" ==
CensusPastePalimpsestically);
z["default_input_filename" ] =
generic_path(DefaultInputFilename .value());
z["print_directory" ] = generic_path(PrintDirectory
.value());
z["seconds_to_pause_between_printouts"] =
value_cast<std::string>(SecondsToPauseBetweenPrintouts.value());
diff --git a/preferences_model.hpp b/preferences_model.hpp
index dbf25da..41ffca1 100644
--- a/preferences_model.hpp
+++ b/preferences_model.hpp
@@ -79,6 +79,7 @@ class LMI_SO PreferencesModel final
mce_report_column CalculationSummaryColumn09;
mce_report_column CalculationSummaryColumn10;
mce_report_column CalculationSummaryColumn11;
+ mce_yes_or_no CensusPastePalimpsestically;
datum_string DefaultInputFilename;
datum_string PrintDirectory;
tnr_nonnegative_integer SecondsToPauseBetweenPrintouts;
diff --git a/preferences_view.xrc b/preferences_view.xrc
index c9a100d..92206be 100644
--- a/preferences_view.xrc
+++ b/preferences_view.xrc
@@ -292,6 +292,14 @@
</object>
</object>
</object>
+ <object class="sizeritem">
+ <flag>wxALIGN_LEFT</flag>
+ <border>4</border>
+ <object class="wxCheckBox" name="CensusPastePalimpsestically">
+ <label>Overwrite old cells when pasting a census</label>
+ <help>When pasting a census, replace old cells instead of
appending to them</help>
+ </object>
+ </object>
</object>
</object>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lmi-commits] [lmi] master ceb33b3: Experimentally offer overwrite semantics for census paste,
Greg Chicares <=