From dc5daa69cf9ee2248b0f47d8d193f9bfe3075470 Mon Sep 17 00:00:00 2001 From: Xun Li Date: Wed, 9 Nov 2016 16:55:23 -0600 Subject: [PATCH] report bug to github feature done related issues: #382 #509 #511 --- .../DataViewerEditFieldPropertiesDlg.cpp | 12 +- DataViewer/MergeTableDlg.cpp | 2 +- DialogTools/AdjustYAxisDlg.cpp | 4 +- DialogTools/AutoUpdateDlg.cpp | 6 +- DialogTools/AutoUpdateDlg.h | 2 +- DialogTools/CatClassifDlg.cpp | 7 +- DialogTools/CreatingWeightDlg.cpp | 4 +- DialogTools/FieldNewCalcSpecialDlg.cpp | 6 +- DialogTools/LocaleSetupDlg.h | 2 +- DialogTools/PCPDlg.cpp | 7 - DialogTools/RegressionDlg.cpp | 14 -- DialogTools/ReportBugDlg.cpp | 69 +++---- DialogTools/ReportBugDlg.h | 7 +- Explore/ConnectivityHistView.cpp | 4 +- Explore/LineChartView.cpp | 2 +- Explore/LowessParamDlg.cpp | 2 +- Explore/ScatterNewPlotView.cpp | 4 + GeoDa.cpp | 174 ++++++++++-------- 18 files changed, 167 insertions(+), 161 deletions(-) diff --git a/DataViewer/DataViewerEditFieldPropertiesDlg.cpp b/DataViewer/DataViewerEditFieldPropertiesDlg.cpp index 7483c9f7c..f577e4fe3 100644 --- a/DataViewer/DataViewerEditFieldPropertiesDlg.cpp +++ b/DataViewer/DataViewerEditFieldPropertiesDlg.cpp @@ -573,7 +573,7 @@ void DataViewerEditFieldPropertiesDlg::OnCellChanging( wxGridEvent& ev ) if (col_type == GdaConst::string_type) { if (new_val < min_v || max_v < new_val) { - wxString msg = wxString::Format(_("The length of a string field must be at least %s and at most %s. Keeping original value."), min_v, max_v); + wxString msg = wxString::Format(_("The length of a string field must be at least %d and at most %d. Keeping original value."), min_v, max_v); wxMessageDialog dlg(this, msg, _("Error"), wxOK|wxICON_ERROR); dlg.ShowModal(); ev.Veto(); @@ -590,7 +590,7 @@ void DataViewerEditFieldPropertiesDlg::OnCellChanging( wxGridEvent& ev ) } else if (col_type == GdaConst::long64_type) { if (new_val < min_v || max_v < new_val) { - wxString msg = wxString::Format(_("The length of an integral numeric field must be at least %s and at most %s. Keeping original value."), min_v, max_v); + wxString msg = wxString::Format(_("The length of an integral numeric field must be at least %d and at most %d. Keeping original value."), min_v, max_v); wxMessageDialog dlg(this, msg, _("Error"), wxOK|wxICON_ERROR); dlg.ShowModal(); ev.Veto(); @@ -602,7 +602,7 @@ void DataViewerEditFieldPropertiesDlg::OnCellChanging( wxGridEvent& ev ) } else { // table_int->GetColType(cid) == GdaConst::double_type if (new_val < min_v || max_v < new_val) { - wxString msg = wxString::Format(_("The length of an non-integral numeric field must be at least %s and at most %s. Keeping original value."), min_v, max_v); + wxString msg = wxString::Format(_("The length of an non-integral numeric field must be at least %d and at most %d. Keeping original value."), min_v, max_v); wxMessageDialog dlg(this, msg, _("Error"), wxOK|wxICON_ERROR); dlg.ShowModal(); ev.Veto(); @@ -628,7 +628,7 @@ void DataViewerEditFieldPropertiesDlg::OnCellChanging( wxGridEvent& ev ) min_v = GdaConst::min_dbf_double_decimals; max_v = GdaConst::max_dbf_double_decimals; if (new_val < min_v || max_v < new_val) { - wxString msg = wxString::Format(_("The number of decimal places for a non-integral numeric field must be at least %s and at most %s. Keeping original value."), min_v, max_v); + wxString msg = wxString::Format(_("The number of decimal places for a non-integral numeric field must be at least %d and at most %d. Keeping original value."), min_v, max_v); wxMessageDialog dlg(this, msg, _("Error"), wxOK|wxICON_ERROR); dlg.ShowModal(); ev.Veto(); @@ -654,7 +654,7 @@ void DataViewerEditFieldPropertiesDlg::OnCellChanging( wxGridEvent& ev ) min_v = 0; max_v = GdaConst::max_dbf_double_decimals; if (new_val < min_v || max_v < new_val) { - wxString msg = wxString::Format(_("The number of displayed decimal places for a non-integral numeric field must be at least %s and at most %s. Keeping original value."), min_v, max_v); + wxString msg = wxString::Format(_("The number of displayed decimal places for a non-integral numeric field must be at least %d and at most %d. Keeping original value."), min_v, max_v); wxMessageDialog dlg(this, msg, _("Error"), wxOK|wxICON_ERROR); dlg.ShowModal(); ev.Veto(); @@ -709,7 +709,7 @@ void DataViewerEditFieldPropertiesDlg::OnGridComboBox(wxCommandEvent& ev ) ev.Skip(); wxLogMessage("In DataViewerEditFieldPropertiesDlg::OnGridComboBox"); - wxLogMessage(wxString::Format("%s", sel)); + wxLogMessage(wxString::Format("%d", sel)); } void DataViewerEditFieldPropertiesDlg::OnCellEditorCreated( wxGridEditorCreatedEvent& ev ) diff --git a/DataViewer/MergeTableDlg.cpp b/DataViewer/MergeTableDlg.cpp index 646761225..77fd214bf 100644 --- a/DataViewer/MergeTableDlg.cpp +++ b/DataViewer/MergeTableDlg.cpp @@ -261,7 +261,7 @@ void MergeTableDlg::CheckKeys(wxString key_name, vector& key_vec, } if (key_vec.size() != key_map.size()) { - wxString msg = wxString::Format(_("Chosen table merge key field contains undefined or duplicate values. Key fields must contain valid unique values.\n\nDuplicated values are: \n"), key_name); + wxString msg = wxString::Format(_("Chosen table merge key field %s contains undefined or duplicate values. Key fields must contain valid unique values.\n\nDuplicated values are: \n"), key_name); int count = 0; for (it=dupKeys.begin(); it!=dupKeys.end();it++) { msg << it->first << "\n"; diff --git a/DialogTools/AdjustYAxisDlg.cpp b/DialogTools/AdjustYAxisDlg.cpp index 89bd35996..9bd940969 100644 --- a/DialogTools/AdjustYAxisDlg.cpp +++ b/DialogTools/AdjustYAxisDlg.cpp @@ -41,7 +41,7 @@ AdjustYAxisDlg::AdjustYAxisDlg(double min_val_s, : o_min_val(min_val_s), o_max_val(max_val_s) { - wxLogMessage(wxString::Format("AdjustYAxisDlg with new min_val %s and max_val %s", min_val_s, max_val_s)); + wxLogMessage(wxString::Format("AdjustYAxisDlg with new min_val %f and max_val %f", min_val_s, max_val_s)); s_min_val << min_val_s; s_max_val << max_val_s; @@ -131,7 +131,7 @@ AxisLabelPrecisionDlg::AxisLabelPrecisionDlg(int precision_s, const wxSize& size, long style) { - wxLogMessage(wxString::Format("AxisLabelPrecisionDlg with precision = %s.", precision_s)); + wxLogMessage(wxString::Format("AxisLabelPrecisionDlg with precision = %d.", precision_s)); precision = precision_s; diff --git a/DialogTools/AutoUpdateDlg.cpp b/DialogTools/AutoUpdateDlg.cpp index 7025a99c2..e6e908504 100644 --- a/DialogTools/AutoUpdateDlg.cpp +++ b/DialogTools/AutoUpdateDlg.cpp @@ -270,7 +270,7 @@ AutoUpdateDlg::AutoUpdateDlg(wxWindow* parent, wxString url_update_description = AutoUpdate::GetUpdateUrl(checklist); wxString update_text; - update_text << "A newer version of GeoDa is found. Do you want to update to version "; + update_text << _("A newer version of GeoDa is found. Do you want to update to version "); update_text << version; update_text << "?"; @@ -349,7 +349,7 @@ void AutoUpdateDlg::OnOkClick( wxCommandEvent& event ) int n = (int)lines.size(); int jobs = (n-2) / 3 + 1; // skip first and second lines - wxProgressDialog progressDlg("", "Downloading updates...", + wxProgressDialog progressDlg("", _("Downloading updates..."), jobs, this, wxPD_APP_MODAL | wxPD_AUTO_HIDE); progressDlg.Update(1); if (n > 2 && (n-2) % 3 == 0) { @@ -424,11 +424,13 @@ void AutoUpdateDlg::OnOkClick( wxCommandEvent& event ) void AutoUpdateDlg::OnCancelClick( wxCommandEvent& event ) { + wxLogMessage("Cancel AutoUpdateDlg"); EndDialog(wxID_CANCEL); } void AutoUpdateDlg::OnSkipClick( wxCommandEvent& event ) { + wxLogMessage("Skip AutoUpdateDlg"); EndDialog(wxID_NO); } wxString AutoUpdateDlg::GetVersion() diff --git a/DialogTools/AutoUpdateDlg.h b/DialogTools/AutoUpdateDlg.h index 730e39cc4..10acceadf 100644 --- a/DialogTools/AutoUpdateDlg.h +++ b/DialogTools/AutoUpdateDlg.h @@ -42,7 +42,7 @@ class AutoUpdateDlg: public wxDialog public: AutoUpdateDlg(wxWindow* parent, bool showSkip = false, wxWindowID id = wxID_ANY, - const wxString& title = "GeoDa Update Dialog", + const wxString& title = _("GeoDa Update Dialog"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(580,220)); diff --git a/DialogTools/CatClassifDlg.cpp b/DialogTools/CatClassifDlg.cpp index ce6e60846..b6fadbb5f 100644 --- a/DialogTools/CatClassifDlg.cpp +++ b/DialogTools/CatClassifDlg.cpp @@ -922,8 +922,6 @@ void CatClassifPanel::OnBreaksChoice(wxCommandEvent& event) CatClassification::BreakValsType bv_type = GetBreakValsTypeChoice(); cc_data.break_vals_type = bv_type; - wxLogMessage(wxString::Format(_("choice: %s"), bv_type)); - // Verify that cc data is self-consistent and correct if not. This // will result in all breaks, colors and names being initialized. CatClassification::CorrectCatClassifFromTable(cc_data, table_int); @@ -979,7 +977,7 @@ void CatClassifPanel::OnNumCatsChoice(wxCommandEvent& event) brk_slider->Enable(true); } - wxLogMessage(wxString::Format("choice: %s", new_num_cats)); + wxLogMessage(wxString::Format("choice: %d", new_num_cats)); CatClassification::BreakValsType new_cat_typ = GetBreakValsTypeChoice(); if (new_cat_typ == CatClassification::hinge_15_break_vals || @@ -1026,6 +1024,9 @@ void CatClassifPanel::OnAssocVarChoice(wxCommandEvent& ev) wxLogMessage("CatClassifPanel::OnAssocVarChoice"); wxString cur_fc_str = assoc_var_choice->GetStringSelection(); + + wxLogMessage(cur_fc_str); + bool is_tm_var = table_int->IsColTimeVariant(cur_fc_str); assoc_var_tm_choice->Enable(is_tm_var); if (is_tm_var && assoc_var_tm_choice->GetSelection() == wxNOT_FOUND) { diff --git a/DialogTools/CreatingWeightDlg.cpp b/DialogTools/CreatingWeightDlg.cpp index 18132b737..4ece6814d 100644 --- a/DialogTools/CreatingWeightDlg.cpp +++ b/DialogTools/CreatingWeightDlg.cpp @@ -237,7 +237,7 @@ void CreatingWeightDlg::CreateWeights() return; } if (m_threshold_val*m_thres_delta_factor < m_thres_min) { - wxString msg = wxString::Format(_("The currently entered threshold value of %s is less than %s which is the minimum value for which there will be no neighborless observations (isolates). \n\nPress Yes to proceed anyhow, press No to abort."), m_threshold_val, m_thres_min); + wxString msg = wxString::Format(_("The currently entered threshold value of %f is less than %f which is the minimum value for which there will be no neighborless observations (isolates). \n\nPress Yes to proceed anyhow, press No to abort."), m_threshold_val, m_thres_min); wxMessageDialog dlg(this, msg, _("Warning"), wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION ); if (dlg.ShowModal() != wxID_YES) @@ -347,7 +347,7 @@ void CreatingWeightDlg::CreateWeights() done = true; } else { - wxString s = wxString::Format(_("Error: Maximum number of neighbors %s exceeded."), m_num_obs-1); + wxString s = wxString::Format(_("Error: Maximum number of neighbors %d exceeded."), m_num_obs-1); wxMessageBox(s); } } diff --git a/DialogTools/FieldNewCalcSpecialDlg.cpp b/DialogTools/FieldNewCalcSpecialDlg.cpp index 352db2dbe..5705e001b 100644 --- a/DialogTools/FieldNewCalcSpecialDlg.cpp +++ b/DialogTools/FieldNewCalcSpecialDlg.cpp @@ -172,7 +172,7 @@ void FieldNewCalcSpecialDlg::Apply() } else if (col_type == GdaConst::string_type) { std::vector data(n_rows, wxEmptyString); for (int i=0; iSetColData(result_col, time_list[t], data); @@ -194,7 +194,7 @@ void FieldNewCalcSpecialDlg::Apply() table_int->SetColData(result_col, time_list[t], data); } else if (col_type == GdaConst::string_type) { std::vector data(n_rows, wxEmptyString); - for (int i=0; iSetColData(result_col, time_list[t], data); } table_int->SetColUndefined(result_col, time_list[t], undefined); @@ -212,7 +212,7 @@ void FieldNewCalcSpecialDlg::Apply() table_int->SetColData(result_col, time_list[t], data); } else if (col_type == GdaConst::string_type) { std::vector data(n_rows, wxEmptyString); - for (int i=0; iSetColData(result_col, time_list[t], data); } table_int->SetColUndefined(result_col, time_list[t], undefined); diff --git a/DialogTools/LocaleSetupDlg.h b/DialogTools/LocaleSetupDlg.h index 48001ba41..68a7442fe 100644 --- a/DialogTools/LocaleSetupDlg.h +++ b/DialogTools/LocaleSetupDlg.h @@ -37,7 +37,7 @@ class LocaleSetupDlg: public wxDialog LocaleSetupDlg(wxWindow* parent, bool need_reopen = true, wxWindowID id = wxID_ANY, - const wxString& title = "Setup Locale of GeoDa Table", + const wxString& title = _("Setup Locale of GeoDa Table"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize ); diff --git a/DialogTools/PCPDlg.cpp b/DialogTools/PCPDlg.cpp index d4bb5acdf..04dd7000e 100644 --- a/DialogTools/PCPDlg.cpp +++ b/DialogTools/PCPDlg.cpp @@ -101,7 +101,6 @@ void PCPDlg::OnIncAllClick( wxCommandEvent& ev) void PCPDlg::OnIncOneClick( wxCommandEvent& ev) { - wxLogMessage("Click PCPDlg::OnIncOneClick"); if (m_exclude_list->GetSelection() >= 0) { wxString k = m_exclude_list->GetString(m_exclude_list->GetSelection()); m_include_list->Append(k); @@ -112,13 +111,11 @@ void PCPDlg::OnIncOneClick( wxCommandEvent& ev) void PCPDlg::OnIncListDClick( wxCommandEvent& ev) { - wxLogMessage("Click PCPDlg::OnIncListDClick"); OnExclOneClick(ev); } void PCPDlg::OnExclAllClick( wxCommandEvent& ev) { - wxLogMessage("Click PCPDlg::OnExclAllClick"); for (int i=0, iend=m_include_list->GetCount(); iAppend(m_include_list->GetString(i)); } @@ -128,7 +125,6 @@ void PCPDlg::OnExclAllClick( wxCommandEvent& ev) void PCPDlg::OnExclOneClick( wxCommandEvent& ev) { - wxLogMessage("Click PCPDlg::OnExclOneClick"); if (m_include_list->GetSelection() >= 0) { m_exclude_list-> Append(m_include_list->GetString(m_include_list->GetSelection())); @@ -139,7 +135,6 @@ void PCPDlg::OnExclOneClick( wxCommandEvent& ev) void PCPDlg::OnExclListDClick( wxCommandEvent& ev) { - wxLogMessage("Click PCPDlg::OnExclListDClick"); OnIncOneClick(ev); } @@ -189,7 +184,5 @@ void PCPDlg::OnCancelClick( wxCommandEvent& event ) void PCPDlg::UpdateOkButton() { - wxLogMessage("Click PCPDlg::UpdateOkButton"); - FindWindow(XRCID("wxID_OK"))->Enable(m_include_list->GetCount() >= 2); } diff --git a/DialogTools/RegressionDlg.cpp b/DialogTools/RegressionDlg.cpp index 794e230ed..ff06518da 100644 --- a/DialogTools/RegressionDlg.cpp +++ b/DialogTools/RegressionDlg.cpp @@ -841,8 +841,6 @@ void RegressionDlg::OnSaveToTxtFileClick( wxCommandEvent& event ) void RegressionDlg::OnCListVarinDoubleClicked( wxCommandEvent& event ) { - wxLogMessage("Click RegressionDlg::OnCListVarinDoubleClicked"); - if (lastSelection == 1) { OnCButton1Click(event); } else { @@ -852,15 +850,11 @@ void RegressionDlg::OnCListVarinDoubleClicked( wxCommandEvent& event ) void RegressionDlg::OnCListVaroutDoubleClicked( wxCommandEvent& event ) { - wxLogMessage("Click RegressionDlg::OnCListVaroutDoubleClicked"); - OnCButton3Click(event); } void RegressionDlg::OnCButton1Click( wxCommandEvent& event ) { - wxLogMessage("Click RegressionDlg::OnCButton1Click"); - if (m_varlist->GetCount() > 0) { if (m_varlist->GetSelection() >= 0) { wxString temp = m_dependent->GetValue(); @@ -880,8 +874,6 @@ void RegressionDlg::OnCButton1Click( wxCommandEvent& event ) void RegressionDlg::OnCButton2Click( wxCommandEvent& event ) { - wxLogMessage("Click RegressionDlg::OnCButton2Click"); - if (m_varlist->GetCount() > 0) { if (m_varlist->GetSelection() >= 0) { int cur_sel = m_varlist->GetSelection(); @@ -924,8 +916,6 @@ void RegressionDlg::OnCResetClick( wxCommandEvent& event ) void RegressionDlg::OnCButton3Click( wxCommandEvent& event ) { - wxLogMessage("Click RegressionDlg::OnCButton3Click"); - if (m_independentlist->GetCount() > 0) { if(m_independentlist->GetSelection() >= 0) { int cur_sel = m_independentlist->GetSelection(); @@ -946,8 +936,6 @@ void RegressionDlg::OnCButton3Click( wxCommandEvent& event ) void RegressionDlg::OnCButton4Click( wxCommandEvent& event ) { - wxLogMessage("Click RegressionDlg::OnCButton4Click"); - for (unsigned int i=0; iGetCount(); i++) { m_independentlist->Append(m_varlist->GetString(i)); } @@ -961,8 +949,6 @@ void RegressionDlg::OnCButton4Click( wxCommandEvent& event ) void RegressionDlg::OnCButton5Click( wxCommandEvent& event ) { - wxLogMessage("Click RegressionDlg::OnCButton5Click"); - for (unsigned int i=0; iGetCount(); i++) { m_varlist->Append(m_independentlist->GetString(i)); } diff --git a/DialogTools/ReportBugDlg.cpp b/DialogTools/ReportBugDlg.cpp index 38d2b1163..67e6aa0c4 100644 --- a/DialogTools/ReportBugDlg.cpp +++ b/DialogTools/ReportBugDlg.cpp @@ -17,6 +17,7 @@ * along with this program. If not, see . */ #include +#include #include #include #include @@ -97,7 +98,7 @@ string CreateIssueOnGithub(string& post_data) wxString tester_id = tester_ids[0]; - string url = "https://api.github.com/repos/lixun910/colamap/issues"; + string url = "https://api.github.com/repos/GeoDaCenter/geoda/issues"; wxString header_auth = "Authorization: token " + tester_id; @@ -141,6 +142,7 @@ ReportBugDlg::ReportBugDlg(wxWindow* parent, wxWindowID id, const wxSize& size) : wxDialog(parent, id, title, pos, size) { + wxLogMessage("Open ReportBugDlg."); // // Description: please briefly describe what went wrong // Steps you took before something went wrong (Optional): @@ -223,6 +225,7 @@ ReportBugDlg::~ReportBugDlg() void ReportBugDlg::OnOkClick(wxCommandEvent& event) { + wxLogMessage("In ReportBugDlg::OnOkClick()"); //wxString rst = CreateIssueOnGithub("{\"title\": \"Test reporting bug from GeoDa software\", \"body\": \"We should have one\"}"); wxString title = title_txt_ctrl->GetValue(); @@ -253,29 +256,11 @@ void ReportBugDlg::OnOkClick(wxCommandEvent& event) body << "\\n\\n"; - // parse results - string result = CreateIssue(title, body); + bool result = CreateIssue(title, body); - if (!result.empty()) { - json_spirit::Value v; - try { - if (!json_spirit::read(result, v)) { - throw std::runtime_error("Could not parse title as JSON"); - } - json_spirit::Value url_val; - if (!GdaJson::findValue(v, url_val, "html_url")) { - throw std::runtime_error("could not find url"); - } - wxString url_issue = url_val.get_str(); - ReportResultDlg dlg(this, url_issue); - dlg.ShowModal(); - EndDialog(wxID_OK); - return; - } catch (std::runtime_error e) { - wxString msg; - msg << "JSON parsing failed: "; - msg << e.what(); - } + if (result) { + EndDialog(wxID_OK); + return; } wxMessageDialog msgDlg(this, @@ -284,13 +269,9 @@ void ReportBugDlg::OnOkClick(wxCommandEvent& event) wxOK |wxICON_INFORMATION); msgDlg.ShowModal(); - LOG_MSG("Submit Bug Report Error:"); - LOG_MSG("title:"); - LOG_MSG(title); - LOG_MSG("body:"); - LOG_MSG(body); - LOG_MSG("return from Github:"); - LOG_MSG(result); + wxLogMessage("Submit Bug Report Error:"); + wxLogMessage("title:"); + wxLogMessage(title); } void ReportBugDlg::OnCancelClick(wxCommandEvent& event) @@ -298,7 +279,7 @@ void ReportBugDlg::OnCancelClick(wxCommandEvent& event) } -string ReportBugDlg::CreateIssue(wxString title, wxString body) +bool ReportBugDlg::CreateIssue(wxString title, wxString body) { // get log file to body wxString logger_path; @@ -321,5 +302,29 @@ string ReportBugDlg::CreateIssue(wxString title, wxString body) string msg( json_msg.c_str()); - return CreateIssueOnGithub(msg); + string result = CreateIssueOnGithub(msg); + + // parse results + + if (!result.empty()) { + json_spirit::Value v; + try { + if (!json_spirit::read(result, v)) { + throw std::runtime_error("Could not parse title as JSON"); + } + json_spirit::Value url_val; + if (!GdaJson::findValue(v, url_val, "html_url")) { + throw std::runtime_error("could not find url"); + } + wxString url_issue = url_val.get_str(); + ReportResultDlg dlg(NULL, url_issue); + dlg.ShowModal(); + return true; + } catch (std::runtime_error e) { + wxString msg; + msg << "JSON parsing failed: "; + msg << e.what(); + } + } + return false; } diff --git a/DialogTools/ReportBugDlg.h b/DialogTools/ReportBugDlg.h index a3656b660..afe014760 100644 --- a/DialogTools/ReportBugDlg.h +++ b/DialogTools/ReportBugDlg.h @@ -40,7 +40,7 @@ class ReportResultDlg: public wxDialog ReportResultDlg(wxWindow* parent, wxString issue_url, wxWindowID id = wxID_ANY, - const wxString& title = "Check Bug Report on Github", + const wxString& title = _("Check Bug Report on Github"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize); ~ReportResultDlg(); @@ -53,12 +53,14 @@ class ReportBugDlg : public wxDialog public: ReportBugDlg(wxWindow* parent, wxWindowID id = wxID_ANY, - const wxString& title = "GeoDa Bug Report Dialog", + const wxString& title = _("GeoDa Bug Report Dialog"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(580,450)); ~ReportBugDlg(); + static bool CreateIssue(wxString title, wxString body); + protected: wxString desc_tip; wxString steps_txt; @@ -73,7 +75,6 @@ class ReportBugDlg : public wxDialog void OnOkClick( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event ); - string CreateIssue(wxString title, wxString body); }; #endif diff --git a/Explore/ConnectivityHistView.cpp b/Explore/ConnectivityHistView.cpp index ad63843df..2b3b27e7c 100644 --- a/Explore/ConnectivityHistView.cpp +++ b/Explore/ConnectivityHistView.cpp @@ -343,9 +343,9 @@ void ConnectivityHistCanvas::PopulateCanvas() if (HasIsolates()) { wxString msg; if (num_isolates > 1) { - msg = wxString::Format(_("Warning: %s observations are neighborless."), num_isolates); + msg = wxString::Format(_("Warning: %d observations are neighborless."), num_isolates); } else { - msg = wxString::Format(_("Warning: %s observations is neighborless."), num_isolates); + msg = wxString::Format(_("Warning: %d observations is neighborless."), num_isolates); } s = new GdaShapeText(msg, *GdaConst::small_font, wxRealPoint(((double) x_max)/2.0, y_max), diff --git a/Explore/LineChartView.cpp b/Explore/LineChartView.cpp index ef94836f3..dc743e878 100644 --- a/Explore/LineChartView.cpp +++ b/Explore/LineChartView.cpp @@ -368,7 +368,7 @@ void LineChartFrame::OnSelectionChange() wxString col_name = variable_names[var_selection]; int col = table_int->FindColId(col_name); - wxLogMessage(wxString::Format("var: %s, time1:%s, time2:%s, group1:%s, group2:%s", col_name, time1, time2, group1, group2)); + wxLogMessage(wxString::Format("var: %s, time1:%d, time2:%d, group1:%d, group2:%d", col_name, time1, time2, group1, group2)); std::vector min_vals; std::vector max_vals; diff --git a/Explore/LowessParamDlg.cpp b/Explore/LowessParamDlg.cpp index 0c20290fc..0f12faf54 100644 --- a/Explore/LowessParamDlg.cpp +++ b/Explore/LowessParamDlg.cpp @@ -166,7 +166,7 @@ void LowessParamFrame::OnHelpBtn(wxCommandEvent& ev) { LOG_MSG("In LowessParamFrame::OnHelpBtn"); WebViewHelpWin* win = new WebViewHelpWin(project, GetHelpPageHtml(), NULL, - wxID_ANY, "LOWESS Smoother Help"); + wxID_ANY, _("LOWESS Smoother Help")); } void LowessParamFrame::OnApplyBtn(wxCommandEvent& ev) diff --git a/Explore/ScatterNewPlotView.cpp b/Explore/ScatterNewPlotView.cpp index 781667ded..1ce1de4f2 100644 --- a/Explore/ScatterNewPlotView.cpp +++ b/Explore/ScatterNewPlotView.cpp @@ -84,11 +84,15 @@ BubbleSizeSliderDlg::BubbleSizeSliderDlg (ScatterNewPlotCanvas* _canvas, void BubbleSizeSliderDlg::OnReset(wxCommandEvent& event ) { + wxLogMessage("In BubbleSizeSliderDlg::OnReset()"); + slider->SetValue(0); canvas->UpdateBubbleSize(1); } void BubbleSizeSliderDlg::OnSliderChange( wxScrollEvent & event ) { + wxLogMessage("In BubbleSizeSliderDlg::OnSliderChange()"); + int val = event.GetInt(); if (val == 0){ canvas->UpdateBubbleSize(1); diff --git a/GeoDa.cpp b/GeoDa.cpp index f555e4bcd..5961b3c88 100644 --- a/GeoDa.cpp +++ b/GeoDa.cpp @@ -205,20 +205,6 @@ bool GdaApp::OnInit(void) { if (!wxApp::OnInit()) return false; - - // Setup Logger - wxString exePath = wxStandardPaths::Get().GetExecutablePath(); - wxFileName exeFile(exePath); - wxString exeDir = exeFile.GetPathWithSep(); - wxString loggerFile = exeDir + "logger.txt"; - - if (m_pLogFile == NULL) { - m_pLogFile = fopen( GET_ENCODED_FILENAME(loggerFile), "w+" ); - wxLog::SetActiveTarget(new wxLogStderr(m_pLogFile)); - } - wxLog::EnableLogging(true); - wxLog::DisableTimestamp(); - wxLogMessage("Test"); // initialize OGR connection OGRDataAdapter::GetInstance(); @@ -394,12 +380,30 @@ bool GdaApp::OnInit(void) wxMessageDialog msgDlg(GdaFrame::GetGdaFrame(), msg, ttl, wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION ); if (msgDlg.ShowModal() == wxID_YES) { - wxCommandEvent ev; - GdaFrame::GetGdaFrame()->OnReportBug(ev); + //wxCommandEvent ev; + //GdaFrame::GetGdaFrame()->OnReportBug(ev); + wxString ttl = "Crash Report"; + ReportBugDlg::CreateIssue(ttl, "Details:"); } } } OGRDataAdapter::GetInstance().AddEntry("NoCrash", "false"); + + // Setup new Logger after crash check + wxString exePath = wxStandardPaths::Get().GetExecutablePath(); + wxFileName exeFile(exePath); + wxString exeDir = exeFile.GetPathWithSep(); + wxString loggerFile = exeDir + "logger.txt"; + + if (m_pLogFile == NULL) { + m_pLogFile = fopen( GET_ENCODED_FILENAME(loggerFile), "w+" ); + wxLog::SetActiveTarget(new wxLogStderr(m_pLogFile)); + } + wxLog::EnableLogging(true); + wxLog::DisableTimestamp(); + + // check update in a new thread + CallAfter(&GdaFrame::CheckUpdate); return true; } @@ -674,9 +678,6 @@ GdaFrame::GdaFrame(const wxString& title, const wxPoint& pos, SetMenusToDefault(); UpdateToolbarAndMenus(); SetEncodingCheckmarks(wxFONTENCODING_UTF8); - - // check update in a new thread - CallAfter(&GdaFrame::CheckUpdate); } GdaFrame::~GdaFrame() @@ -951,8 +952,6 @@ void GdaFrame::OnCloseProjectEvt(wxCommandEvent& event) void GdaFrame::UpdateRecentDatasourceMenu() { - wxLogMessage("UpdateRecentDatasourceMenu()"); - try { // update recent opened datasource menu RecentDatasource recent_ds; @@ -1016,7 +1015,7 @@ void GdaFrame::OnRecentDSClick(wxCommandEvent& event) IDataSource* ds = recent_ds.GetDatasource(ds_name); if (ds == NULL) { // raise message dialog show can't connect to datasource - wxString msg = _T("Can't connect to datasource: ") + ds_name; + wxString msg = _("Can't connect to datasource: ") + ds_name; wxMessageDialog dlg (this, msg, "Error", wxOK | wxICON_ERROR); dlg.ShowModal(); return; @@ -3391,7 +3390,7 @@ void GdaFrame::OnOpenQuantile10(wxCommandEvent& e) { OpenQuantile(10); } void GdaFrame::OpenQuantile(int num_cats) { - wxLogMessage(wxString::Format("In GdaFrame::OpenQuantile(%s)", num_cats)); + wxLogMessage(wxString::Format("In GdaFrame::OpenQuantile(%d)", num_cats)); VariableSettingsDlg dlg(project_p, VariableSettingsDlg::univariate); if (dlg.ShowModal() != wxID_OK) return; @@ -3418,7 +3417,7 @@ void GdaFrame::OnQuantile10(wxCommandEvent& e) { ChangeToQuantile(10); } void GdaFrame::ChangeToQuantile(int num_cats) { - wxLogMessage(wxString::Format("In GdaFrame::ChangeToQuantile(%s)", num_cats)); + wxLogMessage(wxString::Format("In GdaFrame::ChangeToQuantile(%d)", num_cats)); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; @@ -3596,7 +3595,7 @@ void GdaFrame::OnOpenNaturalBreaks10(wxCommandEvent& e) {OpenNaturalBreaks(10);} void GdaFrame::OpenNaturalBreaks(int num_cats) { - wxLogMessage(wxString::Format("In GdaFrame::OpenNaturalBreaks(%s)", num_cats)); + wxLogMessage(wxString::Format("In GdaFrame::OpenNaturalBreaks(%d)", num_cats)); VariableSettingsDlg dlg(project_p, VariableSettingsDlg::univariate); if (dlg.ShowModal() != wxID_OK) return; MapFrame* nf = new MapFrame(GdaFrame::gda_frame, project_p, @@ -3622,7 +3621,7 @@ void GdaFrame::OnNaturalBreaks10(wxCommandEvent& e) {ChangeToNaturalBreaks(10);} void GdaFrame::ChangeToNaturalBreaks(int num_cats) { - wxLogMessage(wxString::Format("In GdaFrame::ChangeToNaturalBreaks(%s)", num_cats)); + wxLogMessage(wxString::Format("In GdaFrame::ChangeToNaturalBreaks(%d)", num_cats)); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; wxCommandEvent event; @@ -3664,7 +3663,7 @@ void GdaFrame::OnOpenEqualIntervals10(wxCommandEvent& e) void GdaFrame::OpenEqualIntervals(int num_cats) { - wxLogMessage(wxString::Format("In GdaFrame::OpenEqualIntervals(%s)", num_cats)); + wxLogMessage(wxString::Format("In GdaFrame::OpenEqualIntervals(%d)", num_cats)); VariableSettingsDlg dlg(project_p, VariableSettingsDlg::univariate); if (dlg.ShowModal() != wxID_OK) return; MapFrame* nf = new MapFrame(GdaFrame::gda_frame, project_p, @@ -3700,7 +3699,7 @@ void GdaFrame::OnEqualIntervals10(wxCommandEvent& e) void GdaFrame::ChangeToEqualIntervals(int num_cats) { - wxLogMessage(wxString::Format("In GdaFrame::ChangeToEqualIntervals(%s)", num_cats)); + wxLogMessage(wxString::Format("In GdaFrame::ChangeToEqualIntervals(%d)", num_cats)); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; wxCommandEvent event; @@ -3788,7 +3787,7 @@ void GdaFrame::OnCondVertQuant10(wxCommandEvent& e) void GdaFrame::ChangeToCondVertQuant(int num_cats) { - wxLogMessage(wxString::Format("In GdaFrame::ChangeToCondVertQuant(%s)", num_cats)); + wxLogMessage(wxString::Format("In GdaFrame::ChangeToCondVertQuant(%d)", num_cats)); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (ConditionalNewFrame* f = dynamic_cast(t)) { @@ -3859,7 +3858,7 @@ void GdaFrame::OnCondVertNatBrks10(wxCommandEvent& e) void GdaFrame::ChangeToCondVertNatBrks(int num_cats) { - wxLogMessage(wxString::Format("In GdaFrame::ChangeToCondVertNatBrks(%s)", num_cats)); + wxLogMessage(wxString::Format("In GdaFrame::ChangeToCondVertNatBrks(%d)", num_cats)); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (ConditionalNewFrame* f = dynamic_cast(t)) { @@ -3890,7 +3889,7 @@ void GdaFrame::OnCondVertEquInts10(wxCommandEvent& e) void GdaFrame::ChangeToCondVertEquInts(int num_cats) { - wxLogMessage(wxString::Format("In GdaFrame::ChangeToCondVertEquInts(%s)", num_cats)); + wxLogMessage(wxString::Format("In GdaFrame::ChangeToCondVertEquInts(%d)", num_cats)); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (ConditionalNewFrame* f = dynamic_cast(t)) { @@ -3941,7 +3940,7 @@ void GdaFrame::OnCondHorizQuant10(wxCommandEvent& e) void GdaFrame::ChangeToCondHorizQuant(int num_cats) { - wxLogMessage(wxString::Format("In GdaFrame::ChangeToCondHorizQuant(%s)", num_cats)); + wxLogMessage(wxString::Format("In GdaFrame::ChangeToCondHorizQuant(%d)", num_cats)); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (ConditionalNewFrame* f = dynamic_cast(t)) { @@ -4012,7 +4011,7 @@ void GdaFrame::OnCondHorizNatBrks10(wxCommandEvent& e) void GdaFrame::ChangeToCondHorizNatBrks(int num_cats) { - wxLogMessage(wxString::Format("In GdaFrame::ChangeToCondHorizNatBrks(%s)", num_cats)); + wxLogMessage(wxString::Format("In GdaFrame::ChangeToCondHorizNatBrks(%d)", num_cats)); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (ConditionalNewFrame* f = dynamic_cast(t)) { @@ -4043,7 +4042,7 @@ void GdaFrame::OnCondHorizEquInts10(wxCommandEvent& e) void GdaFrame::ChangeToCondHorizEquInts(int num_cats) { - wxLogMessage(wxString::Format("In GdaFrame::ChangeToCondHorizEquInts(%s)", num_cats)); + wxLogMessage(wxString::Format("In GdaFrame::ChangeToCondHorizEquInts(%d)", num_cats)); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (ConditionalNewFrame* f = dynamic_cast(t)) { @@ -4464,7 +4463,7 @@ void GdaFrame::OnAddMeanCenters(wxCommandEvent& event) void GdaFrame::OnAddCentroids(wxCommandEvent& event) { - wxLogMessage("In OnAddCentroids()"); + wxLogMessage("In GdaFrame::OnAddCentroids()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (MapFrame* f = dynamic_cast(t)) { @@ -4474,7 +4473,7 @@ void GdaFrame::OnAddCentroids(wxCommandEvent& event) void GdaFrame::OnDisplayMeanCenters(wxCommandEvent& event) { - wxLogMessage("In OnDisplayMeanCenters()"); + wxLogMessage("In GdaFrame::OnDisplayMeanCenters()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (MapFrame* f = dynamic_cast(t)) { @@ -4484,7 +4483,7 @@ void GdaFrame::OnDisplayMeanCenters(wxCommandEvent& event) void GdaFrame::OnDisplayCentroids(wxCommandEvent& event) { - wxLogMessage("In OnDisplayCentroids()"); + wxLogMessage("In GdaFrame::OnDisplayCentroids()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (MapFrame* f = dynamic_cast(t)) { @@ -4494,7 +4493,7 @@ void GdaFrame::OnDisplayCentroids(wxCommandEvent& event) void GdaFrame::OnDisplayVoronoiDiagram(wxCommandEvent& event) { - wxLogMessage("In OnDisplayVoronoiDiagram()"); + wxLogMessage("In GdaFrame::OnDisplayVoronoiDiagram()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (MapFrame* f = dynamic_cast(t)) { @@ -4504,7 +4503,7 @@ void GdaFrame::OnDisplayVoronoiDiagram(wxCommandEvent& event) void GdaFrame::OnExportVoronoi(wxCommandEvent& event) { - wxLogMessage("In OnExportVoronoi()"); + wxLogMessage("In GdaFrame::OnExportVoronoi()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (MapFrame* f = dynamic_cast(t)) { @@ -4516,7 +4515,7 @@ void GdaFrame::OnExportVoronoi(wxCommandEvent& event) void GdaFrame::OnExportMeanCntrs(wxCommandEvent& event) { - wxLogMessage("In OnExportMeanCntrs()"); + wxLogMessage("In GdaFrame::OnExportMeanCntrs()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (project_p) project_p->ExportCenters(true); @@ -4524,7 +4523,7 @@ void GdaFrame::OnExportMeanCntrs(wxCommandEvent& event) void GdaFrame::OnExportCentroids(wxCommandEvent& event) { - wxLogMessage("In OnExportCentroids()"); + wxLogMessage("In GdaFrame::OnExportCentroids()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (project_p) project_p->ExportCenters(false); @@ -4532,7 +4531,7 @@ void GdaFrame::OnExportCentroids(wxCommandEvent& event) void GdaFrame::OnSaveVoronoiDupsToTable(wxCommandEvent& event) { - wxLogMessage("In OnSaveVoronoiDupsToTable()"); + wxLogMessage("In GdaFrame::OnSaveVoronoiDupsToTable()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (MapFrame* f = dynamic_cast(t)) { @@ -4544,7 +4543,7 @@ void GdaFrame::OnSaveVoronoiDupsToTable(wxCommandEvent& event) void GdaFrame::OnSaveGetisOrd(wxCommandEvent& event) { - wxLogMessage("In OnSaveGetisOrd()"); + wxLogMessage("In GdaFrame::OnSaveGetisOrd()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (GetisOrdMapFrame* f = dynamic_cast(t)) { @@ -4554,7 +4553,7 @@ void GdaFrame::OnSaveGetisOrd(wxCommandEvent& event) void GdaFrame::OnSaveLisa(wxCommandEvent& event) { - wxLogMessage("In OnSaveLisa()"); + wxLogMessage("In GdaFrame::OnSaveLisa()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (LisaMapFrame* f = dynamic_cast(t)) { @@ -4564,7 +4563,7 @@ void GdaFrame::OnSaveLisa(wxCommandEvent& event) void GdaFrame::OnSelectCores(wxCommandEvent& event) { - wxLogMessage("In OnSelectCores()"); + wxLogMessage("In GdaFrame::OnSelectCores()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (LisaMapFrame* f = dynamic_cast(t)) { @@ -4576,7 +4575,7 @@ void GdaFrame::OnSelectCores(wxCommandEvent& event) void GdaFrame::OnSelectNeighborsOfCores(wxCommandEvent& event) { - wxLogMessage("In OnSelectNeighborsOfCores()"); + wxLogMessage("In GdaFrame::OnSelectNeighborsOfCores()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (LisaMapFrame* f = dynamic_cast(t)) { @@ -4588,7 +4587,7 @@ void GdaFrame::OnSelectNeighborsOfCores(wxCommandEvent& event) void GdaFrame::OnSelectCoresAndNeighbors(wxCommandEvent& event) { - wxLogMessage("In OnSelectCoresAndNeighbors()"); + wxLogMessage("In GdaFrame::OnSelectCoresAndNeighbors()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (LisaMapFrame* f = dynamic_cast(t)) { @@ -4600,7 +4599,7 @@ void GdaFrame::OnSelectCoresAndNeighbors(wxCommandEvent& event) void GdaFrame::OnViewStandardizedData(wxCommandEvent& event) { - wxLogMessage("In OnViewStandardizedData()"); + wxLogMessage("In GdaFrame::OnViewStandardizedData()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (PCPFrame* f = dynamic_cast(t)) { @@ -4614,7 +4613,7 @@ void GdaFrame::OnViewStandardizedData(wxCommandEvent& event) void GdaFrame::OnViewOriginalData(wxCommandEvent& event) { - wxLogMessage("In OnViewOriginalData()"); + wxLogMessage("In GdaFrame::OnViewOriginalData()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (PCPFrame* f = dynamic_cast(t)) { @@ -4628,7 +4627,7 @@ void GdaFrame::OnViewOriginalData(wxCommandEvent& event) void GdaFrame::OnViewLinearSmoother(wxCommandEvent& event) { - wxLogMessage("In OnViewLinearSmoother()"); + wxLogMessage("In GdaFrame::OnViewLinearSmoother()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (ScatterNewPlotFrame* f = dynamic_cast(t)) { @@ -4643,7 +4642,7 @@ void GdaFrame::OnViewLinearSmoother(wxCommandEvent& event) void GdaFrame::OnViewLowessSmoother(wxCommandEvent& event) { - wxLogMessage("In OnViewLowessSmoother()"); + wxLogMessage("In GdaFrame::OnViewLowessSmoother()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (ScatterNewPlotFrame* f = dynamic_cast(t)) { @@ -4660,7 +4659,7 @@ void GdaFrame::OnViewLowessSmoother(wxCommandEvent& event) void GdaFrame::OnEditLowessParams(wxCommandEvent& event) { - wxLogMessage("In OnEditLowessParams()"); + wxLogMessage("In GdaFrame::OnEditLowessParams()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (ScatterNewPlotFrame* f = dynamic_cast(t)) { @@ -4677,7 +4676,7 @@ void GdaFrame::OnEditLowessParams(wxCommandEvent& event) void GdaFrame::OnEditVariables(wxCommandEvent& event) { - wxLogMessage("In OnEditVariables()"); + wxLogMessage("In GdaFrame::OnEditVariables()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (ScatterPlotMatFrame* f = dynamic_cast(t)) { @@ -4693,7 +4692,7 @@ void GdaFrame::OnEditVariables(wxCommandEvent& event) void GdaFrame::OnViewRegimesRegression(wxCommandEvent& event) { - wxLogMessage("In OnViewRegimesRegression()"); + wxLogMessage("In GdaFrame::OnViewRegimesRegression()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (ScatterNewPlotFrame* f = dynamic_cast(t)) { @@ -4707,7 +4706,7 @@ void GdaFrame::OnViewRegimesRegression(wxCommandEvent& event) void GdaFrame::OnViewRegressionSelectedExcluded(wxCommandEvent& event) { - wxLogMessage("In OnViewRegressionSelectedExcluded()"); + wxLogMessage("In GdaFrame::OnViewRegressionSelectedExcluded()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (ScatterNewPlotFrame* f = dynamic_cast(t)) { @@ -4717,7 +4716,7 @@ void GdaFrame::OnViewRegressionSelectedExcluded(wxCommandEvent& event) void GdaFrame::OnViewRegressionSelected(wxCommandEvent& event) { - wxLogMessage("In OnViewRegressionSelected()"); + wxLogMessage("In GdaFrame::OnViewRegressionSelected()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (ScatterNewPlotFrame* f = dynamic_cast(t)) { @@ -4727,7 +4726,7 @@ void GdaFrame::OnViewRegressionSelected(wxCommandEvent& event) void GdaFrame::OnCompareRegimes(wxCommandEvent& event) { - wxLogMessage("In OnCompareRegimes()"); + wxLogMessage("In GdaFrame::OnCompareRegimes()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (LineChartFrame* f = dynamic_cast(t)) { @@ -4737,7 +4736,7 @@ void GdaFrame::OnCompareRegimes(wxCommandEvent& event) void GdaFrame::OnCompareTimePeriods(wxCommandEvent& event) { - wxLogMessage("In OnCompareTimePeriods()"); + wxLogMessage("In GdaFrame::OnCompareTimePeriods()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (LineChartFrame* f = dynamic_cast(t)) { @@ -4747,7 +4746,7 @@ void GdaFrame::OnCompareTimePeriods(wxCommandEvent& event) void GdaFrame::OnCompareRegAndTmPer(wxCommandEvent& event) { - wxLogMessage("In OnCompareRegAndTmPer()"); + wxLogMessage("In GdaFrame::OnCompareRegAndTmPer()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (LineChartFrame* f = dynamic_cast(t)) { @@ -4758,7 +4757,7 @@ void GdaFrame::OnCompareRegAndTmPer(wxCommandEvent& event) void GdaFrame::OnDisplayStatistics(wxCommandEvent& event) { - wxLogMessage("In OnDisplayStatistics()"); + wxLogMessage("In GdaFrame::OnDisplayStatistics()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (ScatterNewPlotFrame* f = dynamic_cast(t)) { @@ -4781,7 +4780,7 @@ void GdaFrame::OnDisplayStatistics(wxCommandEvent& event) void GdaFrame::OnShowAxesThroughOrigin(wxCommandEvent& event) { - wxLogMessage("In OnShowAxesThroughOrigin()"); + wxLogMessage("In GdaFrame::OnShowAxesThroughOrigin()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (ScatterNewPlotFrame* f = dynamic_cast(t)) { @@ -4791,7 +4790,7 @@ void GdaFrame::OnShowAxesThroughOrigin(wxCommandEvent& event) void GdaFrame::OnShowAxes(wxCommandEvent& event) { - wxLogMessage("In OnShowAxes()"); + wxLogMessage("In GdaFrame::OnShowAxes()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (BoxPlotFrame* f = dynamic_cast(t)) { @@ -4813,7 +4812,7 @@ void GdaFrame::OnShowAxes(wxCommandEvent& event) void GdaFrame::OnDisplayAxesScaleValues(wxCommandEvent& event) { - wxLogMessage("In OnDisplayAxesScaleValues()"); + wxLogMessage("In GdaFrame::OnDisplayAxesScaleValues()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (ConditionalScatterPlotFrame* f = @@ -4824,7 +4823,7 @@ void GdaFrame::OnDisplayAxesScaleValues(wxCommandEvent& event) void GdaFrame::OnDisplaySlopeValues(wxCommandEvent& event) { - wxLogMessage("In OnDisplaySlopeValues()"); + wxLogMessage("In GdaFrame::OnDisplaySlopeValues()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; if (ConditionalScatterPlotFrame* f = @@ -4845,25 +4844,25 @@ void GdaFrame::OnTimeSyncVariable(int var_index) void GdaFrame::OnTimeSyncVariable1(wxCommandEvent& event) { - wxLogMessage("In OnTimeSyncVariable1()"); + wxLogMessage("In GdaFrame::OnTimeSyncVariable1()"); OnTimeSyncVariable(0); } void GdaFrame::OnTimeSyncVariable2(wxCommandEvent& event) { - wxLogMessage("In OnTimeSyncVariable2()"); + wxLogMessage("In GdaFrame::OnTimeSyncVariable2()"); OnTimeSyncVariable(1); } void GdaFrame::OnTimeSyncVariable3(wxCommandEvent& event) { - wxLogMessage("In OnTimeSyncVariable3()"); + wxLogMessage("In GdaFrame::OnTimeSyncVariable3()"); OnTimeSyncVariable(2); } void GdaFrame::OnTimeSyncVariable4(wxCommandEvent& event) { - wxLogMessage("In OnTimeSyncVariable4()"); + wxLogMessage("In GdaFrame::OnTimeSyncVariable4()"); OnTimeSyncVariable(3); } @@ -4876,23 +4875,25 @@ void GdaFrame::OnFixedScaleVariable(int var_index) void GdaFrame::OnFixedScaleVariable1(wxCommandEvent& event) { - wxLogMessage("In OnFixedScaleVariable1()"); + wxLogMessage("In GdaFrame::OnFixedScaleVariable1()"); OnFixedScaleVariable(0); } void GdaFrame::OnFixedScaleVariable2(wxCommandEvent& event) { - wxLogMessage("In OnFixedScaleVariable2()"); + wxLogMessage("In GdaFrame::OnFixedScaleVariable2()"); OnFixedScaleVariable(1); } void GdaFrame::OnFixedScaleVariable3(wxCommandEvent& event) { + wxLogMessage("In GdaFrame::OnFixedScaleVariable3()"); OnFixedScaleVariable(2); } void GdaFrame::OnFixedScaleVariable4(wxCommandEvent& event) { + wxLogMessage("In GdaFrame::OnFixedScaleVariable4()"); OnFixedScaleVariable(3); } @@ -4905,56 +4906,67 @@ void GdaFrame::OnPlotsPerView(int plots_per_view) void GdaFrame::OnPlotsPerView1(wxCommandEvent& event) { + wxLogMessage("In GdaFrame::OnPlotsPerView1()"); OnPlotsPerView(1); } void GdaFrame::OnPlotsPerView2(wxCommandEvent& event) { + wxLogMessage("In GdaFrame::OnPlotsPerView2()"); OnPlotsPerView(2); } void GdaFrame::OnPlotsPerView3(wxCommandEvent& event) { + wxLogMessage("In GdaFrame::OnPlotsPerView3()"); OnPlotsPerView(3); } void GdaFrame::OnPlotsPerView4(wxCommandEvent& event) { + wxLogMessage("In GdaFrame::OnPlotsPerView4()"); OnPlotsPerView(4); } void GdaFrame::OnPlotsPerView5(wxCommandEvent& event) { + wxLogMessage("In GdaFrame::OnPlotsPerView5()"); OnPlotsPerView(5); } void GdaFrame::OnPlotsPerView6(wxCommandEvent& event) { + wxLogMessage("In GdaFrame::OnPlotsPerView6()"); OnPlotsPerView(6); } void GdaFrame::OnPlotsPerView7(wxCommandEvent& event) { + wxLogMessage("In GdaFrame::OnPlotsPerView7()"); OnPlotsPerView(7); } void GdaFrame::OnPlotsPerView8(wxCommandEvent& event) { + wxLogMessage("In GdaFrame::OnPlotsPerView8()"); OnPlotsPerView(8); } void GdaFrame::OnPlotsPerView9(wxCommandEvent& event) { + wxLogMessage("In GdaFrame::OnPlotsPerView9()"); OnPlotsPerView(9); } void GdaFrame::OnPlotsPerView10(wxCommandEvent& event) { + wxLogMessage("In GdaFrame::OnPlotsPerView10()"); OnPlotsPerView(10); } void GdaFrame::OnPlotsPerViewOther(wxCommandEvent& event) { + wxLogMessage("In GdaFrame::OnPlotsPerView11()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; t->OnPlotsPerViewOther(); @@ -4962,6 +4974,7 @@ void GdaFrame::OnPlotsPerViewOther(wxCommandEvent& event) void GdaFrame::OnPlotsPerViewAll(wxCommandEvent& event) { + wxLogMessage("In GdaFrame::OnPlotsPerView12()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; t->OnPlotsPerViewAll(); @@ -4969,6 +4982,7 @@ void GdaFrame::OnPlotsPerViewAll(wxCommandEvent& event) void GdaFrame::OnDisplayStatusBar(wxCommandEvent& event) { + wxLogMessage("In GdaFrame::OnDisplayStatusBar()"); TemplateFrame* t = TemplateFrame::GetActiveFrame(); if (!t) return; t->OnDisplayStatusBar(event); @@ -4976,6 +4990,7 @@ void GdaFrame::OnDisplayStatusBar(wxCommandEvent& event) void GdaFrame::OnReportBug(wxCommandEvent& WXUNUSED(event) ) { + wxLogMessage("In GdaFrame::OnReportBug()"); ReportBugDlg bugDlg(this); bugDlg.ShowModal(); @@ -5008,14 +5023,15 @@ void GdaFrame::OnReportBug(wxCommandEvent& WXUNUSED(event) ) void GdaFrame::OnCheckUpdates(wxCommandEvent& WXUNUSED(event) ) { + wxLogMessage("In GdaFrame::OnCheckUpdates()"); wxString version = AutoUpdate::CheckUpdate(); if (!version.IsEmpty()) { AutoUpdateDlg dlg(this); dlg.ShowModal(); } else { wxMessageDialog msgDlg(this, - "Your GeoDa is already up-to-date.", - "No update required", + _("Your GeoDa is already up-to-date."), + _("No update required"), wxOK |wxICON_INFORMATION); msgDlg.ShowModal(); } @@ -5027,11 +5043,15 @@ void GdaFrame::OnCheckTestMode(wxCommandEvent& event) if (!event.IsChecked()) { checked = "yes"; } + + wxLogMessage(_("In GdaFrame::OnCheckTestMode():") + checked); + OGRDataAdapter::GetInstance().AddEntry("test_mode", checked); } void GdaFrame::OnHelpAbout(wxCommandEvent& WXUNUSED(event) ) { + wxLogMessage("In GdaFrame::OnHelpAbout()"); wxDialog dlg; wxXmlResource::Get()->LoadDialog(&dlg, this, "IDD_ABOUTBOX"); @@ -5326,6 +5346,7 @@ bool GdaFrame::GetHtmlMenuItems() bool GdaFrame::GetHtmlMenuItemsJson() { + /* using namespace json_spirit; using namespace GdaJson; @@ -5394,7 +5415,7 @@ bool GdaFrame::GetHtmlMenuItemsJson() msg << "title: " << htmlMenuItems[i].menu_title << ", "; msg << "url: " << htmlMenuItems[i].url; } - + */ return true; } @@ -5463,7 +5484,6 @@ int GdaFrame::sqlite3_GetHtmlMenuItemsCB(void *data, int argc, wxConnectionBase* GdaServer::OnAcceptConnection(const wxString& topic) { - LOG_MSG("In GdaServer::OnAcceptConnection"); if (topic.CmpNoCase("GdaApp") == 0) { // Check there are no modal dialogs active wxWindowList::Node* node = wxTopLevelWindows.GetFirst(); @@ -5485,7 +5505,6 @@ wxConnectionBase* GdaClient::OnMakeConnection() bool GdaConnection::OnExec(const wxString &topic, const wxString &data) { - LOG_MSG("In GdaConnection::OnExec"); GdaFrame* frame = wxDynamicCast(wxGetApp().GetTopWindow(), GdaFrame); wxString filename(data); if (filename.IsEmpty()) { @@ -5499,25 +5518,20 @@ bool GdaConnection::OnExec(const wxString &topic, const wxString &data) LineChartEventDelay::LineChartEventDelay() : lc_frame(0) { - LOG_MSG("In LineChartEventDelay::LineChartEventDelay"); } LineChartEventDelay::LineChartEventDelay(LineChartFrame* lc_frame_, const wxString& cb_name_) : lc_frame(lc_frame_), cb_name(cb_name_) { - LOG_MSG("Created LineChartEventDelay::LineChartEventDelay for callback: " - + cb_name); StartOnce(100); } LineChartEventDelay::~LineChartEventDelay() { - LOG_MSG("In LineChartEventDelay::~LineChartEventDelay"); } void LineChartEventDelay::Notify() { - LOG_MSG("In LineChartEventDelay::Notify"); Stop(); wxCommandEvent ev; if (cb_name == "ID_COMPARE_REGIMES") {