From: <vo...@us...> - 2012-07-08 20:42:40
|
Revision: 2710 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2710&view=rev Author: vomikan Date: 2012-07-08 20:42:33 +0000 (Sun, 08 Jul 2012) Log Message: ----------- update Modified Paths: -------------- branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp branches/0.9.9.0/mmex/src/mmcheckingpanel.h Modified: branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp =================================================================== --- branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp 2012-07-08 10:50:29 UTC (rev 2709) +++ branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp 2012-07-08 20:42:33 UTC (rev 2710) @@ -474,11 +474,6 @@ */ mmCheckingPanel::~mmCheckingPanel() { - try { - saveSettings(); - } catch (...) { - wxASSERT(false); - } } //---------------------------------------------------------------------------- @@ -502,7 +497,6 @@ /* Set up the transaction filter. The transFilter dialog will be destroyed when the checking panel is destroyed. */ transFilterActive_ = false; - settings_change_ = false; transFilterDlg_ = new TransFilterDialog(core_, this); initVirtualListControl(); @@ -513,28 +507,6 @@ } //---------------------------------------------------------------------------- -/* - Save data to ini database. -*/ -void mmCheckingPanel::saveSettings() -{ - if (settings_change_) - { - // sorting column index - inidb_->Begin(); - mmDBWrapper::setINISettingValue(inidb_, wxT("CHECK_SORT_COL"), wxString() << g_sortcol); - - // asc\desc sorting flag - mmDBWrapper::setINISettingValue(inidb_, wxT("CHECK_ASC"), wxString() << g_asc); - - mmDBWrapper::setInfoSettingValue(core_->db_.get(), - wxString::Format(wxT("CHECK_FILTER_ID_%ld"), m_AccountID), m_currentView); - - inidb_->Commit(); - } -} -//---------------------------------------------------------------------------- - void mmCheckingPanel::sortTable() { std::sort(m_trans.begin(), m_trans.end(), TransSort(g_sortcol, g_asc)); @@ -1220,7 +1192,26 @@ } } //---------------------------------------------------------------------------- +void mmCheckingPanel::OnFilterResetToViewAll(wxMouseEvent& event) { + if (m_currentView == VIEW_TRANS_ALL_STR) + { + event.Skip(); + return; + } + + itemStaticTextMainFilter_->SetLabel(_("Viewing all transactions")); + m_currentView = VIEW_TRANS_ALL_STR; + itemStaticBitmap31_->Enable(true); + statTextTransFilter_->Enable(true); + + m_listCtrlAccount->DeleteAllItems(); + initVirtualListControl(); + if (m_trans.size() > 0) + m_listCtrlAccount->RefreshItems(0, static_cast<long>(m_trans.size()) - 1); + +} + void mmCheckingPanel::OnViewPopupSelected(wxCommandEvent& event) { int evt = event.GetId(); @@ -1235,7 +1226,6 @@ } bool show_filter_ = false; - settings_change_ = true; if (evt == MENU_VIEW_ALLTRANSACTIONS) { @@ -1315,6 +1305,12 @@ m_listCtrlAccount->DeleteAllItems(); initVirtualListControl(); + + core_->db_.get()->Begin(); + mmDBWrapper::setInfoSettingValue(core_->db_.get(), + wxString::Format(wxT("CHECK_FILTER_ID_%ld"), m_AccountID), m_currentView); + core_->db_.get()->Commit(); + } void mmCheckingPanel::DeleteViewedTransactions() @@ -1391,28 +1387,6 @@ } -void mmCheckingPanel::OnFilterResetToViewAll(wxMouseEvent& event) { - - if (m_currentView == VIEW_TRANS_ALL_STR) - { - event.Skip(); - return; - } - - settings_change_ = true; - - itemStaticTextMainFilter_->SetLabel(_("Viewing all transactions")); - m_currentView = VIEW_TRANS_ALL_STR; - itemStaticBitmap31_->Enable(true); - statTextTransFilter_->Enable(true); - - m_listCtrlAccount->DeleteAllItems(); - initVirtualListControl(); - if (m_trans.size() > 0) - m_listCtrlAccount->RefreshItems(0, static_cast<long>(m_trans.size()) - 1); - -} - //---------------------------------------------------------------------------- void TransactionListCtrl::OnListItemSelected(wxListEvent& event) @@ -1592,7 +1566,15 @@ m_cp->sortTable(); if (m_cp->m_trans.size() > 0) RefreshItems(0, static_cast<long>(m_cp->m_trans.size()) - 1); // refresh everything - m_cp->settings_change_ = true; + + m_cp->inidb_->Begin(); + mmDBWrapper::setINISettingValue(m_cp->inidb_, wxT("CHECK_SORT_COL"), wxString() << g_sortcol); + + // asc\desc sorting flag + mmDBWrapper::setINISettingValue(m_cp->inidb_, wxT("CHECK_ASC"), wxString() << g_asc); + + m_cp->inidb_->Commit(); + } //---------------------------------------------------------------------------- @@ -2085,7 +2067,7 @@ double amount= 0, deposit = 0, withdrawal = 0; bool valid_amount = mmex::formatCurrencyToDouble(search_string, amount); bool withdrawal_only = false; - if (valid_amount && amount <0) + if (valid_amount && amount <0) { amount = -amount; withdrawal_only = true; Modified: branches/0.9.9.0/mmex/src/mmcheckingpanel.h =================================================================== --- branches/0.9.9.0/mmex/src/mmcheckingpanel.h 2012-07-08 10:50:29 UTC (rev 2709) +++ branches/0.9.9.0/mmex/src/mmcheckingpanel.h 2012-07-08 20:42:33 UTC (rev 2710) @@ -144,8 +144,6 @@ void initVirtualListControl(); void showTips(); void updateExtraTransactionData(int selIndex); - void saveSettings(); - bool settings_change_; /* Getter for Virtual List Control */ wxString getItem(long item, long column) const; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |