From: <ste...@us...> - 2012-11-10 01:17:17
|
Revision: 3127 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=3127&view=rev Author: stef145g Date: 2012-11-10 01:17:11 +0000 (Sat, 10 Nov 2012) Log Message: ----------- Fix balance displayed Modified Paths: -------------- trunk/mmex/src/mmcheckingpanel.cpp Modified: trunk/mmex/src/mmcheckingpanel.cpp =================================================================== --- trunk/mmex/src/mmcheckingpanel.cpp 2012-11-09 22:04:36 UTC (rev 3126) +++ trunk/mmex/src/mmcheckingpanel.cpp 2012-11-10 01:17:11 UTC (rev 3127) @@ -578,7 +578,7 @@ wxStaticText* itemStaticText17 = new wxStaticText( headerPanel, ID_PANEL_CHECKING_STATIC_BALHEADER4, _("Displayed Bal: ")); wxStaticText* itemStaticText18 = new wxStaticText( headerPanel, - ID_PANEL_CHECKING_STATIC_BALHEADER5, wxT("$")); + ID_PANEL_CHECKING_STATIC_BALHEADER5, wxT("$"), wxDefaultPosition, wxSize(120,-1)); wxFlexGridSizer* balances_header = new wxFlexGridSizer(0,8,5,10); itemBoxSizerVHeader->Add(balances_header); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-11-23 17:19:46
|
Revision: 3151 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=3151&view=rev Author: vomikan Date: 2012-11-23 17:19:39 +0000 (Fri, 23 Nov 2012) Log Message: ----------- raw sql removed Modified Paths: -------------- trunk/mmex/src/mmcheckingpanel.cpp Modified: trunk/mmex/src/mmcheckingpanel.cpp =================================================================== --- trunk/mmex/src/mmcheckingpanel.cpp 2012-11-20 17:45:15 UTC (rev 3150) +++ trunk/mmex/src/mmcheckingpanel.cpp 2012-11-23 17:19:39 UTC (rev 3151) @@ -736,64 +736,39 @@ //---------------------------------------------------------------------------- wxString mmCheckingPanel::getMiniInfoStr(int selIndex) const { - char sql[] = - "select ta.accountname as INTOACC, " - "a.accountname as FROMACC, c.transcode as TRANSCODE, " - "c.TRANSAMOUNT as TRANSAMOUNT, TOTRANSAMOUNT, " - "cf.pfx_symbol as PFX_SYMBOL, cf.sfx_symbol as SFX_SYMBOL, " - "tcf.pfx_symbol as TOPFX_SYMBOL, tcf.sfx_symbol as TOSFX_SYMBOL, " - "cf.CURRENCYNAME as CURRENCYNAME, tcf.CURRENCYNAME as TOCURRENCYNAME, " - "cf.CURRENCYID as CURRENCYID, tcf.CURRENCYID as TOCURRENCYID, " - "cf.BASECONVRATE as BASECONVRATE, " - "tcf.BASECONVRATE as TOBASECONVRATE, " - "c.ACCOUNTID as ACCOUNTID, " - "c.TOACCOUNTID as TOACCOUNTID, " - "i.infovalue as BASECURRENCYID " - "from checkingaccount_v1 c " - "left join accountlist_v1 ta on ta.ACCOUNTID=c.TOACCOUNTID " - "left join accountlist_v1 a on a.ACCOUNTID=c.ACCOUNTID " - "left join currencyformats_v1 tcf on tcf.currencyid=ta.currencyid " - "left join currencyformats_v1 cf on cf.currencyid=a.currencyid " - "left join infotable_v1 i on i.infoname='BASECURRENCYID' " - "where c.transid = ? "; + int accountId = m_trans[selIndex]->accountID_; + int toaccountId = m_trans[selIndex]->toAccountID_; + wxString intoaccStr = core_->accountList_.GetAccountName(toaccountId); + wxString fromaccStr = core_->accountList_.GetAccountName(accountId); + int basecurrencyid = core_->currencyList_.getBaseCurrencySettings(); + wxString transcodeStr = m_trans[selIndex]->transType_; - wxSQLite3Statement st = core_->db_.get()->PrepareStatement(sql); - st.Bind(1, m_trans[selIndex]->transactionID()); - - wxSQLite3ResultSet q1 = st.ExecuteQuery(); - - wxString intoaccStr = q1.GetString(wxT("INTOACC")); - wxString fromaccStr = q1.GetString(wxT("FROMACC")); - int basecurrencyid = q1.GetInt(wxT("BASECURRENCYID")); - wxString transcodeStr = q1.GetString(wxT("TRANSCODE")); - - wxString cursfxStr = q1.GetString(wxT("SFX_SYMBOL")); - wxString tocursfxStr = q1.GetString(wxT("TOSFX_SYMBOL")); - wxString curpfxStr = q1.GetString(wxT("PFX_SYMBOL")); - wxString tocurpfxStr = q1.GetString(wxT("TOPFX_SYMBOL")); - wxString currencynameStr = q1.GetString(wxT("CURRENCYNAME")); - wxString tocurrencynameStr = q1.GetString(wxT("TOCURRENCYNAME")); - int currencyid = q1.GetInt(wxT("CURRENCYID")); - double amount = q1.GetDouble(wxT("TRANSAMOUNT")); + double amount = m_trans[selIndex]->amt_; wxString amountStr; - double convrate = q1.GetDouble(wxT("BASECONVRATE")); - double toconvrate = q1.GetDouble(wxT("TOBASECONVRATE")); - int accountId = q1.GetInt(wxT("ACCOUNTID")); - int toaccountId = q1.GetInt(wxT("TOACCOUNTID")); + double convrate = core_->accountList_.getAccountBaseCurrencyConvRate(accountId); + double toconvrate = core_->accountList_.getAccountBaseCurrencyConvRate(toaccountId); + boost::shared_ptr<mmCurrency> pCurrency = core_->accountList_.getCurrencyWeakPtr(accountId).lock(); + int currencyid = pCurrency->currencyID_; + wxString curpfxStr = pCurrency->pfxSymbol_; + wxString cursfxStr = pCurrency->sfxSymbol_; + wxString infoStr = wxT(""); if (transcodeStr == TRANS_TYPE_TRANSFER_STR) { - int tocurrencyid = q1.GetInt(wxT("TOCURRENCYID")); - double toamount = q1.GetDouble(wxT("TOTRANSAMOUNT")); + boost::shared_ptr<mmCurrency> pCurrencyPtr = core_->accountList_.getCurrencyWeakPtr(toaccountId).lock(); + wxASSERT(pCurrencyPtr); + wxString tocurpfxStr = pCurrencyPtr->pfxSymbol_; + wxString tocursfxStr = pCurrencyPtr->sfxSymbol_; + + int tocurrencyid = pCurrencyPtr->currencyID_; + double toamount = m_trans[selIndex]->toAmt_; wxString toamountStr; double convertion = 0.0; if (toamount != 0.0 && amount != 0.0) convertion = ( convrate < toconvrate ? amount/toamount : toamount/amount); wxString convertionStr; - boost::shared_ptr<mmCurrency> pCurrencyPtr = core_->accountList_.getCurrencyWeakPtr(toaccountId).lock(); - wxASSERT(pCurrencyPtr); mmex::CurrencyFormatter::instance().loadSettings(*pCurrencyPtr); mmex::formatDoubleToCurrency(toamount, toamountStr); mmex::formatDoubleToCurrencyEdit(convertion, convertionStr); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-11-24 22:25:58
|
Revision: 3155 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=3155&view=rev Author: vomikan Date: 2012-11-24 22:25:51 +0000 (Sat, 24 Nov 2012) Log Message: ----------- fix for top visible item Modified Paths: -------------- trunk/mmex/src/mmcheckingpanel.cpp Modified: trunk/mmex/src/mmcheckingpanel.cpp =================================================================== --- trunk/mmex/src/mmcheckingpanel.cpp 2012-11-24 22:25:25 UTC (rev 3154) +++ trunk/mmex/src/mmcheckingpanel.cpp 2012-11-24 22:25:51 UTC (rev 3155) @@ -324,7 +324,7 @@ void OnViewSplitTransaction(wxCommandEvent& event); long m_selectedIndex; long m_selectedForCopy; - void refreshVisualList(const int trans_id = -1); + void refreshVisualList(const int trans_id = -1, long topItemIndex = -1); private: DECLARE_NO_COPY_CLASS(TransactionListCtrl) @@ -363,6 +363,7 @@ // Returns the account ID by user selection int destinationAccountID(wxString accName); + long topItemIndex_; }; //---------------------------------------------------------------------------- @@ -760,7 +761,7 @@ wxASSERT(pCurrencyPtr); wxString tocurpfxStr = pCurrencyPtr->pfxSymbol_; wxString tocursfxStr = pCurrencyPtr->sfxSymbol_; - + int tocurrencyid = pCurrencyPtr->currencyID_; double toamount = m_trans[selIndex]->toAmt_; wxString toamountStr; @@ -1411,7 +1412,7 @@ else wxASSERT(false); int transID = OnMarkTransactionDB(status); - refreshVisualList(transID); + refreshVisualList(transID, topItemIndex_); } //---------------------------------------------------------------------------- @@ -1678,7 +1679,7 @@ //find the topmost visible item - this will be used to set // where to display the list again after refresh -// long topItemIndex = GetTopItem(); + topItemIndex_ = GetTopItem() + GetCountPerPage() -1; //Read status of the selected transaction wxString status = m_cp->m_trans[m_selectedIndex]->status_; @@ -1744,7 +1745,7 @@ m_cp->core_->db_.get()->Commit(); int transID = m_cp->m_trans[m_selectedIndex]->transactionID(); - refreshVisualList(transID); + refreshVisualList(transID, topItemIndex_); } //---------------------------------------------------------------------------- @@ -1791,12 +1792,16 @@ } //---------------------------------------------------------------------------- -void TransactionListCtrl::refreshVisualList(const int trans_id) +void TransactionListCtrl::refreshVisualList(const int trans_id, long topItemIndex) { m_cp->initVirtualListControl(trans_id); + if (topItemIndex >= (long)m_cp->m_trans.size()) + topItemIndex = g_asc ? (long)m_cp->m_trans.size() - 1 : 0; + if (m_selectedIndex >= (long)m_cp->m_trans.size() || m_selectedIndex < 0) m_selectedIndex = g_asc ? (long)m_cp->m_trans.size() - 1 : 0; + if (m_cp->m_trans.size() > 0) { RefreshItems(0, m_cp->m_trans.size() - 1); } @@ -1807,8 +1812,12 @@ { SetItemState(m_selectedIndex, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); SetItemState(m_selectedIndex, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED); - EnsureVisible(m_selectedIndex); + if (topItemIndex > -1) + EnsureVisible(topItemIndex); + else + EnsureVisible(m_selectedIndex); } + m_cp->updateExtraTransactionData(m_selectedIndex); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-11-24 22:57:48
|
Revision: 3157 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=3157&view=rev Author: vomikan Date: 2012-11-24 22:57:40 +0000 (Sat, 24 Nov 2012) Log Message: ----------- fix Modified Paths: -------------- trunk/mmex/src/mmcheckingpanel.cpp Modified: trunk/mmex/src/mmcheckingpanel.cpp =================================================================== --- trunk/mmex/src/mmcheckingpanel.cpp 2012-11-24 22:26:45 UTC (rev 3156) +++ trunk/mmex/src/mmcheckingpanel.cpp 2012-11-24 22:57:40 UTC (rev 3157) @@ -747,7 +747,6 @@ double amount = m_trans[selIndex]->amt_; wxString amountStr; double convrate = core_->accountList_.getAccountBaseCurrencyConvRate(accountId); - double toconvrate = core_->accountList_.getAccountBaseCurrencyConvRate(toaccountId); boost::shared_ptr<mmCurrency> pCurrency = core_->accountList_.getCurrencyWeakPtr(accountId).lock(); int currencyid = pCurrency->currencyID_; @@ -757,6 +756,7 @@ wxString infoStr = wxT(""); if (transcodeStr == TRANS_TYPE_TRANSFER_STR) { + double toconvrate = core_->accountList_.getAccountBaseCurrencyConvRate(toaccountId); boost::shared_ptr<mmCurrency> pCurrencyPtr = core_->accountList_.getCurrencyWeakPtr(toaccountId).lock(); wxASSERT(pCurrencyPtr); wxString tocurpfxStr = pCurrencyPtr->pfxSymbol_; @@ -820,15 +820,15 @@ { //load settings for base currency wxString currencyName = core_->currencyList_.getCurrencyName(basecurrencyid); - boost::shared_ptr<mmCurrency> pCurrency = core_->currencyList_.getCurrencySharedPtr(currencyName); - wxASSERT(pCurrency); + boost::shared_ptr<mmCurrency> pCurrencyBase = core_->currencyList_.getCurrencySharedPtr(currencyName); + wxASSERT(pCurrencyBase); wxString basecuramountStr; - mmDBWrapper::loadCurrencySettings(core_->db_.get(), pCurrency->currencyID_); + mmDBWrapper::loadCurrencySettings(core_->db_.get(), pCurrencyBase->currencyID_); mmex::formatDoubleToCurrency(amount*convrate, basecuramountStr); - pCurrency = core_->accountList_.getCurrencyWeakPtr(accountId).lock(); - wxASSERT(pCurrency); - mmex::CurrencyFormatter::instance().loadSettings(*pCurrency); + pCurrencyBase = core_->accountList_.getCurrencyWeakPtr(accountId).lock(); + wxASSERT(pCurrencyBase); + mmex::CurrencyFormatter::instance().loadSettings(*pCurrencyBase); mmex::formatDoubleToCurrency(amount, amountStr); //output This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2012-12-08 02:40:01
|
Revision: 3177 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=3177&view=rev Author: stef145g Date: 2012-12-08 02:39:54 +0000 (Sat, 08 Dec 2012) Log Message: ----------- Field alignment adjustment of Number and Payee fields Modified Paths: -------------- trunk/mmex/src/mmcheckingpanel.cpp Modified: trunk/mmex/src/mmcheckingpanel.cpp =================================================================== --- trunk/mmex/src/mmcheckingpanel.cpp 2012-12-07 21:49:33 UTC (rev 3176) +++ trunk/mmex/src/mmcheckingpanel.cpp 2012-12-08 02:39:54 UTC (rev 3177) @@ -86,9 +86,9 @@ const wxString def_data[3*COL_MAX] = { - wxTRANSLATE("Date"), wxT("80"), wxT("L"), - wxTRANSLATE("Number"), wxT("-2"), wxT("R"), - wxTRANSLATE("Payee"), wxT("150"), wxT("L"), + wxTRANSLATE(" Date"), wxT("80"), wxT("L"), + wxTRANSLATE("Number"), wxT("-2"), wxT("L"), + wxTRANSLATE(" Payee"), wxT("150"), wxT("L"), wxTRANSLATE("Status"), wxT("-2"), wxT("L"), wxTRANSLATE("Category"), wxT("-2"), wxT("L"), wxTRANSLATE("Withdrawal"), wxT("-2"), wxT("R"), @@ -1576,6 +1576,10 @@ else res = ICON_TRANS_DEPOSIT; } + else + { + res = ICON_TRANS_TRANSFER; + } } return res; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-12-08 12:13:12
|
Revision: 3179 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=3179&view=rev Author: vomikan Date: 2012-12-08 12:13:05 +0000 (Sat, 08 Dec 2012) Log Message: ----------- fix Modified Paths: -------------- trunk/mmex/src/mmcheckingpanel.cpp Modified: trunk/mmex/src/mmcheckingpanel.cpp =================================================================== --- trunk/mmex/src/mmcheckingpanel.cpp 2012-12-08 08:35:28 UTC (rev 3178) +++ trunk/mmex/src/mmcheckingpanel.cpp 2012-12-08 12:13:05 UTC (rev 3179) @@ -609,6 +609,9 @@ m_imageList->Add(wxBitmap(wxImage(duplicate_xpm).Scale(16, 16))); m_imageList->Add(wxBitmap(wxImage(trans_from_xpm).Scale(16, 16))); m_imageList->Add(wxBitmap(wxImage(trans_into_xpm).Scale(16, 16))); + wxImage EmptyImage = wxBitmap('0', 1, 1).ConvertToImage().Scale(16, 16); + EmptyImage.SetMaskColour(255,255,255); + m_imageList->Add(EmptyImage); m_listCtrlAccount = new TransactionListCtrl( this, itemSplitterWindow10, ID_PANEL_CHECKING_LISTCTRL_ACCT, wxDefaultPosition, wxDefaultSize, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-12-08 14:07:16
|
Revision: 3180 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=3180&view=rev Author: vomikan Date: 2012-12-08 14:07:09 +0000 (Sat, 08 Dec 2012) Log Message: ----------- update Modified Paths: -------------- trunk/mmex/src/mmcheckingpanel.cpp Modified: trunk/mmex/src/mmcheckingpanel.cpp =================================================================== --- trunk/mmex/src/mmcheckingpanel.cpp 2012-12-08 12:13:05 UTC (rev 3179) +++ trunk/mmex/src/mmcheckingpanel.cpp 2012-12-08 14:07:09 UTC (rev 3180) @@ -600,18 +600,16 @@ wxSize imageSize(16, 16); m_imageList.reset(new wxImageList(imageSize.GetWidth(), imageSize.GetHeight())); - m_imageList->Add(wxBitmap(wxImage(reconciled_xpm).Scale(16, 16))); - m_imageList->Add(wxBitmap(wxImage(void_xpm).Scale(16, 16))); - m_imageList->Add(wxBitmap(wxImage(flag_xpm).Scale(16, 16))); - m_imageList->Add(wxBitmap(wxImage(unreconciled_xpm).Scale(16, 16))); - m_imageList->Add(wxBitmap(wxImage(uparrow_xpm).Scale(16, 16))); - m_imageList->Add(wxBitmap(wxImage(downarrow_xpm).Scale(16, 16))); - m_imageList->Add(wxBitmap(wxImage(duplicate_xpm).Scale(16, 16))); - m_imageList->Add(wxBitmap(wxImage(trans_from_xpm).Scale(16, 16))); - m_imageList->Add(wxBitmap(wxImage(trans_into_xpm).Scale(16, 16))); - wxImage EmptyImage = wxBitmap('0', 1, 1).ConvertToImage().Scale(16, 16); - EmptyImage.SetMaskColour(255,255,255); - m_imageList->Add(EmptyImage); + m_imageList->Add(wxImage(reconciled_xpm).Scale(16, 16)); + m_imageList->Add(wxImage(void_xpm).Scale(16, 16)); + m_imageList->Add(wxImage(flag_xpm).Scale(16, 16)); + m_imageList->Add(wxImage(unreconciled_xpm).Scale(16, 16)); + m_imageList->Add(wxImage(uparrow_xpm).Scale(16, 16)); + m_imageList->Add(wxImage(downarrow_xpm).Scale(16, 16)); + m_imageList->Add(wxImage(duplicate_xpm).Scale(16, 16)); + m_imageList->Add(wxImage(trans_from_xpm).Scale(16, 16)); + m_imageList->Add(wxImage(trans_into_xpm).Scale(16, 16)); + m_imageList->Add(wxBitmap('\t', 1, 1).ConvertToImage().Scale(16, 16), wxColour(255,255,255)); m_listCtrlAccount = new TransactionListCtrl( this, itemSplitterWindow10, ID_PANEL_CHECKING_LISTCTRL_ACCT, wxDefaultPosition, wxDefaultSize, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-12-11 21:23:51
|
Revision: 3186 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=3186&view=rev Author: vomikan Date: 2012-12-11 21:23:44 +0000 (Tue, 11 Dec 2012) Log Message: ----------- Commited just for show a bug. wxListCtrl can't proper show transparent background Modified Paths: -------------- trunk/mmex/src/mmcheckingpanel.cpp Modified: trunk/mmex/src/mmcheckingpanel.cpp =================================================================== --- trunk/mmex/src/mmcheckingpanel.cpp 2012-12-11 17:34:06 UTC (rev 3185) +++ trunk/mmex/src/mmcheckingpanel.cpp 2012-12-11 21:23:44 UTC (rev 3186) @@ -609,8 +609,12 @@ m_imageList->Add(wxImage(duplicate_xpm).Scale(16, 16)); m_imageList->Add(wxImage(trans_from_xpm).Scale(16, 16)); m_imageList->Add(wxImage(trans_into_xpm).Scale(16, 16)); - m_imageList->Add(wxImage(empty_xpm).Scale(16, 16)); + wxBitmap icon(empty_xpm); + wxMask* pMask = new wxMask( icon, wxColor( 0, 0, 0 ) ); + icon.SetMask( pMask ); + m_imageList->Add(icon); + m_listCtrlAccount = new TransactionListCtrl( this, itemSplitterWindow10, ID_PANEL_CHECKING_LISTCTRL_ACCT, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_HRULES | wxLC_VRULES | wxLC_VIRTUAL | wxLC_SINGLE_SEL); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-12-11 23:05:50
|
Revision: 3188 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=3188&view=rev Author: vomikan Date: 2012-12-11 23:05:44 +0000 (Tue, 11 Dec 2012) Log Message: ----------- update Modified Paths: -------------- trunk/mmex/src/mmcheckingpanel.cpp Modified: trunk/mmex/src/mmcheckingpanel.cpp =================================================================== --- trunk/mmex/src/mmcheckingpanel.cpp 2012-12-11 22:46:43 UTC (rev 3187) +++ trunk/mmex/src/mmcheckingpanel.cpp 2012-12-11 23:05:44 UTC (rev 3188) @@ -86,9 +86,9 @@ const wxString def_data[3*COL_MAX] = { - wxTRANSLATE(" Date"), wxT("80"), wxT("L"), + wxString(wxTRANSLATE("Date")).Prepend(wxT(" ")), wxT("80"), wxT("L"), wxTRANSLATE("Number"), wxT("-2"), wxT("L"), - wxTRANSLATE(" Payee"), wxT("150"), wxT("L"), + wxString(wxTRANSLATE("Payee")).Prepend(wxT(" ")), wxT("150"), wxT("L"), wxTRANSLATE("Status"), wxT("-2"), wxT("L"), wxTRANSLATE("Category"), wxT("-2"), wxT("L"), wxTRANSLATE("Withdrawal"), wxT("-2"), wxT("R"), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-12-21 11:18:10
|
Revision: 3233 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=3233&view=rev Author: vomikan Date: 2012-12-21 11:18:00 +0000 (Fri, 21 Dec 2012) Log Message: ----------- fix for move transfer transactions Modified Paths: -------------- trunk/mmex/src/mmcheckingpanel.cpp Modified: trunk/mmex/src/mmcheckingpanel.cpp =================================================================== --- trunk/mmex/src/mmcheckingpanel.cpp 2012-12-21 10:54:15 UTC (rev 3232) +++ trunk/mmex/src/mmcheckingpanel.cpp 2012-12-21 11:18:00 UTC (rev 3233) @@ -1819,7 +1819,11 @@ // Called only when moving a deposit/withdraw transaction to a new account. int TransactionListCtrl::destinationAccountID(wxString accName) { - wxArrayString as = m_cp->core_->accountList_.getAccountsName(m_cp->accountID()); + int account_id = m_cp->m_trans[m_selectedIndex]->accountID_; + if (m_cp->accountID() == m_cp->m_trans[m_selectedIndex]->accountID_ + && m_cp->m_trans[m_selectedIndex]->transType_ == TRANS_TYPE_TRANSFER_STR) + account_id = m_cp->m_trans[m_selectedIndex]->toAccountID_; + wxArrayString as = m_cp->core_->accountList_.getAccountsName(account_id); wxString headerMsg = _("Moving Transaction from ") + accName + _(" to..."); wxSingleChoiceDialog scd(this, _("Select the destination Account "), headerMsg , as); @@ -1837,7 +1841,8 @@ void TransactionListCtrl::OnMoveTransaction(wxCommandEvent& /*event*/) { if (m_selectedIndex < 0) return; - int toAccountID = destinationAccountID(m_cp->m_trans[m_selectedIndex]->fromAccountStr_); + wxString sDestAccount = m_cp->m_trans[m_selectedIndex]->fromAccountStr_; + int toAccountID = destinationAccountID(sDestAccount); if ( toAccountID != -1 ) { boost::shared_ptr<mmBankTransaction> pTransaction; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-01-09 12:07:50
|
Revision: 3319 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=3319&view=rev Author: vomikan Date: 2013-01-09 12:07:44 +0000 (Wed, 09 Jan 2013) Log Message: ----------- update Modified Paths: -------------- trunk/mmex/src/mmcheckingpanel.cpp Modified: trunk/mmex/src/mmcheckingpanel.cpp =================================================================== --- trunk/mmex/src/mmcheckingpanel.cpp 2013-01-09 11:51:53 UTC (rev 3318) +++ trunk/mmex/src/mmcheckingpanel.cpp 2013-01-09 12:07:44 UTC (rev 3319) @@ -1390,10 +1390,10 @@ int transID = OnMarkTransactionDB(status); - if (m_cp->transFilterActive_ || (m_cp->m_currentView != VIEW_TRANS_ALL_STR)) - refreshVisualList(transID, topItemIndex_); - else - m_cp->m_listCtrlAccount->RefreshItems(m_selectedIndex, m_selectedIndex); + if (m_cp->transFilterActive_ || (m_cp->m_currentView != VIEW_TRANS_ALL_STR)) + refreshVisualList(transID, topItemIndex_); + else + m_cp->m_listCtrlAccount->RefreshItems(m_selectedIndex, m_selectedIndex); } //---------------------------------------------------------------------------- @@ -1532,8 +1532,8 @@ item_text.Prepend(wxT("< ")); } else item_text.Prepend(wxT(" ")); - } - return item_text; + } + return item_text; } //---------------------------------------------------------------------------- @@ -1806,10 +1806,10 @@ int TransactionListCtrl::destinationAccountID(wxString accName) { int account_id = m_cp->m_trans[m_selectedIndex]->accountID_; - if (m_cp->accountID() == m_cp->m_trans[m_selectedIndex]->accountID_ - && m_cp->m_trans[m_selectedIndex]->transType_ == TRANS_TYPE_TRANSFER_STR) - account_id = m_cp->m_trans[m_selectedIndex]->toAccountID_; - wxArrayString as = m_cp->core_->accountList_.getAccountsName(account_id); + if (m_cp->accountID() == m_cp->m_trans[m_selectedIndex]->accountID_ + && m_cp->m_trans[m_selectedIndex]->transType_ == TRANS_TYPE_TRANSFER_STR) + account_id = m_cp->m_trans[m_selectedIndex]->toAccountID_; + wxArrayString as = m_cp->core_->accountList_.getAccountsName(account_id); wxString headerMsg = _("Moving Transaction from ") + accName + _(" to..."); wxSingleChoiceDialog scd(this, _("Select the destination Account "), headerMsg , as); @@ -1827,7 +1827,7 @@ void TransactionListCtrl::OnMoveTransaction(wxCommandEvent& /*event*/) { if (m_selectedIndex < 0) return; - wxString sDestAccount = m_cp->m_trans[m_selectedIndex]->fromAccountStr_; + wxString sDestAccount = m_cp->m_trans[m_selectedIndex]->fromAccountStr_; int toAccountID = destinationAccountID(sDestAccount); if ( toAccountID != -1 ) { @@ -1918,7 +1918,7 @@ //wxString searchString = event.GetString().c_str(); wxSearchCtrl* st = (wxSearchCtrl*)FindWindow(wxID_FIND); - wxString search_string = st->GetValue().Lower(); + wxString search_string = st->GetValue().Lower().Append(wxT("*")); if (search_string.IsEmpty()) return; @@ -1994,6 +1994,6 @@ { bitmapTransFilter_->Enable(active || transFilterActive_); statTextTransFilter_->Enable(active || transFilterActive_); - bitmapMainFilter_->Enable(!transFilterActive_); + bitmapMainFilter_->Enable(!transFilterActive_); stxtMainFilter_->Enable(!transFilterActive_); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-01-09 14:31:04
|
Revision: 3321 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=3321&view=rev Author: vomikan Date: 2013-01-09 14:30:57 +0000 (Wed, 09 Jan 2013) Log Message: ----------- UI alignment Modified Paths: -------------- trunk/mmex/src/mmcheckingpanel.cpp Modified: trunk/mmex/src/mmcheckingpanel.cpp =================================================================== --- trunk/mmex/src/mmcheckingpanel.cpp 2013-01-09 12:30:54 UTC (rev 3320) +++ trunk/mmex/src/mmcheckingpanel.cpp 2013-01-09 14:30:57 UTC (rev 3321) @@ -549,19 +549,19 @@ bitmapMainFilter_->Connect(wxID_ANY, wxEVT_LEFT_DOWN, wxMouseEventHandler(mmCheckingPanel::OnMouseLeftDown), NULL, this); stxtMainFilter_ = new wxStaticText( headerPanel, wxID_ANY, wxT("")); - itemFlexGridSizerHHeader2->Add(stxtMainFilter_, 0, wxALIGN_CENTER_VERTICAL); + itemFlexGridSizerHHeader2->Add(stxtMainFilter_, 0, wxCENTER); itemFlexGridSizerHHeader2->AddSpacer(20); bitmapTransFilter_ = new wxStaticBitmap( headerPanel, ID_PANEL_CHECKING_STATIC_BITMAP_FILTER, itemStaticBitmap); - itemFlexGridSizerHHeader2->Add(bitmapTransFilter_, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 150); + itemFlexGridSizerHHeader2->Add(bitmapTransFilter_, 0, wxCENTER|wxLEFT, 150); bitmapTransFilter_->Connect(wxID_ANY, wxEVT_LEFT_DOWN, wxMouseEventHandler(mmCheckingPanel::OnFilterTransactions), NULL, this); bitmapTransFilter_->Connect(wxID_ANY, wxEVT_RIGHT_DOWN, wxMouseEventHandler(mmCheckingPanel::OnFilterTransactions), NULL, this); statTextTransFilter_ = new wxStaticText( headerPanel, wxID_ANY, _("Transaction Filter")); - itemFlexGridSizerHHeader2->Add(statTextTransFilter_, 0, wxALIGN_CENTER_VERTICAL); + itemFlexGridSizerHHeader2->Add(statTextTransFilter_, 0, wxCENTER); SetTransactionFilterState(false); wxStaticText* itemStaticText12 = new wxStaticText( headerPanel, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-02-11 10:09:48
|
Revision: 3460 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=3460&view=rev Author: vomikan Date: 2013-02-11 10:09:41 +0000 (Mon, 11 Feb 2013) Log Message: ----------- fix for wrong to_account_id value for non transfer transactions Modified Paths: -------------- trunk/mmex/src/mmcheckingpanel.cpp Modified: trunk/mmex/src/mmcheckingpanel.cpp =================================================================== --- trunk/mmex/src/mmcheckingpanel.cpp 2013-02-10 21:25:00 UTC (rev 3459) +++ trunk/mmex/src/mmcheckingpanel.cpp 2013-02-11 10:09:41 UTC (rev 3460) @@ -950,8 +950,10 @@ for (size_t i = 0; i < core_->bTransactionList_.transactions_.size(); ++i) { boost::shared_ptr<mmBankTransaction> pBankTransaction = core_->bTransactionList_.transactions_[i]; - if ((pBankTransaction->accountID_ != m_AccountID) && (pBankTransaction->toAccountID_ != m_AccountID)) - continue; + if (pBankTransaction->accountID_ != m_AccountID + && (pBankTransaction->toAccountID_ != m_AccountID + || pBankTransaction->transType_ != wxT("Transfer"))) + continue; pBankTransaction->updateAllData(core_, m_AccountID, pCurrency); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-02-13 11:14:47
|
Revision: 3473 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=3473&view=rev Author: vomikan Date: 2013-02-13 11:14:38 +0000 (Wed, 13 Feb 2013) Log Message: ----------- fix Modified Paths: -------------- trunk/mmex/src/mmcheckingpanel.cpp Modified: trunk/mmex/src/mmcheckingpanel.cpp =================================================================== --- trunk/mmex/src/mmcheckingpanel.cpp 2013-02-13 10:46:17 UTC (rev 3472) +++ trunk/mmex/src/mmcheckingpanel.cpp 2013-02-13 11:14:38 UTC (rev 3473) @@ -951,7 +951,7 @@ { boost::shared_ptr<mmBankTransaction> pBankTransaction = core_->bTransactionList_.transactions_[i]; if (pBankTransaction->accountID_ != m_AccountID - && (pBankTransaction->toAccountID_ != m_AccountID + && (pBankTransaction->toAccountID_ != m_AccountID || pBankTransaction->transType_ != wxT("Transfer"))) continue; @@ -1383,29 +1383,19 @@ { int evt = event.GetId(); wxString status = wxT(""); - if (evt == MENU_TREEPOPUP_MARKRECONCILED) status = wxT("R"); - else if (evt == MENU_TREEPOPUP_MARKUNRECONCILED) status = wxT(""); - else if (evt == MENU_TREEPOPUP_MARKVOID) status = wxT("V"); + if (evt == MENU_TREEPOPUP_MARKRECONCILED) status = wxT("R"); + else if (evt == MENU_TREEPOPUP_MARKUNRECONCILED) status = wxT(""); + else if (evt == MENU_TREEPOPUP_MARKVOID) status = wxT("V"); else if (evt == MENU_TREEPOPUP_MARK_ADD_FLAG_FOLLOWUP) status = wxT("F"); - else if (evt == MENU_TREEPOPUP_MARKDUPLICATE) status = wxT("D"); + else if (evt == MENU_TREEPOPUP_MARKDUPLICATE) status = wxT("D"); else wxASSERT(false); int transID = OnMarkTransactionDB(status); - if (m_cp->transFilterActive_ - || (VIEW_TRANS_ALL_STR - + VIEW_TRANS_TODAY_STR - + VIEW_TRANS_CURRENT_MONTH_STR - + VIEW_TRANS_LAST_30_DAYS_STR - + VIEW_TRANS_LAST_90_DAYS_STR - + VIEW_TRANS_LAST_MONTH_STR - + VIEW_TRANS_LAST_3MONTHS_STR).Contains(m_cp->currentView_)) - { - m_cp->m_listCtrlAccount->RefreshItems(m_selectedIndex, m_selectedIndex); - m_cp->setAccountSummary(); - } - else - refreshVisualList(transID, topItemIndex_); + refreshVisualList(transID, topItemIndex_); + //TODO: blinkings may be avoided + //m_cp->m_listCtrlAccount->RefreshItems(m_selectedIndex, m_selectedIndex); + //m_cp->setAccountSummary(); } //---------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-02-18 14:51:05
|
Revision: 3511 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=3511&view=rev Author: vomikan Date: 2013-02-18 14:50:57 +0000 (Mon, 18 Feb 2013) Log Message: ----------- update Modified Paths: -------------- trunk/mmex/src/mmcheckingpanel.cpp Modified: trunk/mmex/src/mmcheckingpanel.cpp =================================================================== --- trunk/mmex/src/mmcheckingpanel.cpp 2013-02-18 12:56:14 UTC (rev 3510) +++ trunk/mmex/src/mmcheckingpanel.cpp 2013-02-18 14:50:57 UTC (rev 3511) @@ -1173,9 +1173,9 @@ if (evt != MENU_VIEW_ALLTRANSACTIONS && transFilterActive_) { wxString messageStr; - messageStr << _("Transaction Filter")<< _(" will interfere with this filtering.") << wxT("\n\n"); - messageStr << _("Please deactivate: ") << _("Transaction Filter"); - wxMessageBox(messageStr,_("Transaction Filter"),wxICON_WARNING); + messageStr << _("Transaction Filter will interfere with this filtering.") << wxT("\n\n"); + messageStr << _("Please deactivate Transaction Filter"); + wxMessageBox(messageStr, _("Transaction Filter"), wxOK|wxICON_WARNING); return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-02-18 15:15:24
|
Revision: 3512 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=3512&view=rev Author: vomikan Date: 2013-02-18 15:15:14 +0000 (Mon, 18 Feb 2013) Log Message: ----------- update Modified Paths: -------------- trunk/mmex/src/mmcheckingpanel.cpp Modified: trunk/mmex/src/mmcheckingpanel.cpp =================================================================== --- trunk/mmex/src/mmcheckingpanel.cpp 2013-02-18 14:50:57 UTC (rev 3511) +++ trunk/mmex/src/mmcheckingpanel.cpp 2013-02-18 15:15:14 UTC (rev 3512) @@ -938,7 +938,7 @@ wxASSERT(pCurrency); pCurrency->loadCurrencySettings(); - header_text_->SetLabel(_("Account View : ") + pAccount->name_); + header_text_->SetLabel(wxString(_("Account View : %s"), pAccount->name_.c_str())); filteredBalance_ = 0.0; @@ -955,7 +955,7 @@ boost::shared_ptr<mmBankTransaction> pBankTransaction = core_->bTransactionList_.transactions_[i]; if (pBankTransaction->accountID_ != m_AccountID && (pBankTransaction->toAccountID_ != m_AccountID - || pBankTransaction->transType_ != wxT("Transfer"))) + || pBankTransaction->transType_ != TRANS_TYPE_TRANSFER_STR)) continue; pBankTransaction->updateAllData(core_, m_AccountID, pCurrency); @@ -1581,7 +1581,7 @@ bool ok = m_cp && idx < m_cp->m_trans.size(); mmBankTransaction *tr = ok ? m_cp->m_trans[idx] : 0; - bool in_the_future = tr && tr->date_ > wxDateTime::Now(); + bool in_the_future = tr && tr->date_ > wxDateTime::Now().GetDateOnly(); TransactionListCtrl &self = *const_cast<TransactionListCtrl*>(this); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-05-12 10:03:22
|
Revision: 3895 http://sourceforge.net/p/moneymanagerex/code/3895 Author: vomikan Date: 2013-05-12 10:03:19 +0000 (Sun, 12 May 2013) Log Message: ----------- Right click menu fix Modified Paths: -------------- trunk/mmex/src/mmcheckingpanel.cpp Modified: trunk/mmex/src/mmcheckingpanel.cpp =================================================================== --- trunk/mmex/src/mmcheckingpanel.cpp 2013-05-12 04:14:14 UTC (rev 3894) +++ trunk/mmex/src/mmcheckingpanel.cpp 2013-05-12 10:03:19 UTC (rev 3895) @@ -149,7 +149,7 @@ virtual int OnGetItemColumnImage(long item, long column) const; virtual wxListItemAttr *OnGetItemAttr(long item) const; - void OnItemRightClick(wxListEvent& event); + void OnListRightClick(wxMouseEvent& event); void OnItemResize(wxListEvent& event); void OnListItemSelected(wxListEvent& event); void OnListItemDeselected(wxListEvent& event); @@ -165,7 +165,7 @@ /* Sort Columns */ void OnColClick(wxListEvent& event); - /// Called when moving a transaction to a new account. + /// Called when moving a transaction to a new account. int DestinationAccountID(); long topItemIndex_; }; @@ -187,7 +187,8 @@ EVT_LIST_ITEM_SELECTED(ID_PANEL_CHECKING_LISTCTRL_ACCT, TransactionListCtrl::OnListItemSelected) EVT_LIST_ITEM_DESELECTED(ID_PANEL_CHECKING_LISTCTRL_ACCT, TransactionListCtrl::OnListItemDeselected) EVT_LIST_ITEM_ACTIVATED(ID_PANEL_CHECKING_LISTCTRL_ACCT, TransactionListCtrl::OnListItemActivated) - EVT_LIST_ITEM_RIGHT_CLICK(ID_PANEL_CHECKING_LISTCTRL_ACCT, TransactionListCtrl::OnItemRightClick) + //EVT_LIST_ITEM_RIGHT_CLICK(ID_PANEL_CHECKING_LISTCTRL_ACCT, TransactionListCtrl::OnItemRightClick) + EVT_MOUSE_EVENTS(TransactionListCtrl::OnListRightClick) EVT_LIST_COL_END_DRAG(ID_PANEL_CHECKING_LISTCTRL_ACCT, TransactionListCtrl::OnItemResize) EVT_LIST_COL_CLICK(ID_PANEL_CHECKING_LISTCTRL_ACCT, TransactionListCtrl::OnColClick) EVT_LIST_KEY_DOWN(ID_PANEL_CHECKING_LISTCTRL_ACCT, TransactionListCtrl::OnListKeyDown) @@ -1057,10 +1058,18 @@ int current_width = m_cp->m_listCtrlAccount->GetColumnWidth(i); m_cp->core_->iniSettings_->SetIntSetting(parameter_name, current_width); } -void TransactionListCtrl::OnItemRightClick(wxListEvent& event) +void TransactionListCtrl::OnListRightClick(wxMouseEvent& event) { - m_selectedIndex = event.GetIndex(); + if (event.GetButton() != wxMOUSE_BTN_RIGHT) + { + event.Skip(); + return; + } + + //TODO: + //GET Selected Item status if not wxLIST_STATE_FOCUSED then m_selectedIndex = -1 + wxMenu menu; menu.Append(MENU_TREEPOPUP_NEW, _("&New Transaction")); menu.AppendSeparator(); @@ -1114,7 +1123,7 @@ subGlobalOpMenu->Append(MENU_TREEPOPUP_MARKDUPLICATE_ALL, _("as Duplicate")); menu.Append(MENU_SUBMENU_MARK_ALL, _("Mark all being viewed"), subGlobalOpMenu); - PopupMenu(&menu, event.GetPoint()); + PopupMenu(&menu, event.GetPosition()); } //---------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-05-12 15:07:56
|
Revision: 3896 http://sourceforge.net/p/moneymanagerex/code/3896 Author: vomikan Date: 2013-05-12 15:07:50 +0000 (Sun, 12 May 2013) Log Message: ----------- Hide right click menu items if no list items selected Modified Paths: -------------- trunk/mmex/src/mmcheckingpanel.cpp Modified: trunk/mmex/src/mmcheckingpanel.cpp =================================================================== --- trunk/mmex/src/mmcheckingpanel.cpp 2013-05-12 10:03:19 UTC (rev 3895) +++ trunk/mmex/src/mmcheckingpanel.cpp 2013-05-12 15:07:50 UTC (rev 3896) @@ -1067,35 +1067,37 @@ return; } - //TODO: - //GET Selected Item status if not wxLIST_STATE_FOCUSED then m_selectedIndex = -1 - + long selectedIndex = m_selectedIndex; + if (m_cp->m_listCtrlAccount->GetItemState(m_selectedIndex, wxLIST_STATE_SELECTED) == 0) + selectedIndex = -1; + bool hide_menu_item = (selectedIndex < 0); + wxMenu menu; menu.Append(MENU_TREEPOPUP_NEW, _("&New Transaction")); menu.AppendSeparator(); menu.Append(MENU_TREEPOPUP_EDIT, _("&Edit Transaction")); - if (m_selectedIndex < 0) menu.Enable(MENU_TREEPOPUP_EDIT, false); + if (hide_menu_item) menu.Enable(MENU_TREEPOPUP_EDIT, false); menu.Append(MENU_ON_COPY_TRANSACTION, _("&Copy Transaction")); - if (m_selectedIndex <0) menu.Enable(MENU_ON_COPY_TRANSACTION, false); + if (hide_menu_item) menu.Enable(MENU_ON_COPY_TRANSACTION, false); menu.Append(MENU_ON_DUPLICATE_TRANSACTION, _("D&uplicate Transaction")); - if (m_selectedIndex <0) menu.Enable(MENU_ON_DUPLICATE_TRANSACTION, false); + if (hide_menu_item) menu.Enable(MENU_ON_DUPLICATE_TRANSACTION, false); menu.Append(MENU_TREEPOPUP_MOVE, _("&Move Transaction")); - if (m_selectedIndex <0 || (m_cp->core_->accountList_.getNumBankAccounts() < 2)) + if (hide_menu_item || (m_cp->core_->accountList_.getNumBankAccounts() < 2)) menu.Enable(MENU_TREEPOPUP_MOVE, false); menu.Append(MENU_ON_PASTE_TRANSACTION, _("&Paste Transaction")); - if (m_selectedForCopy <0) menu.Enable(MENU_ON_PASTE_TRANSACTION, false); + if (m_selectedForCopy < 0) menu.Enable(MENU_ON_PASTE_TRANSACTION, false); menu.AppendSeparator(); menu.Append(MENU_TREEPOPUP_VIEW_SPLIT_CATEGORIES, _("&View Split Categories")); - if (m_selectedIndex <0 || (m_cp->m_trans[m_selectedIndex]->categID_ > -1)) + if (hide_menu_item || (m_cp->m_trans[m_selectedIndex]->categID_ > -1)) menu.Enable(MENU_TREEPOPUP_VIEW_SPLIT_CATEGORIES, false); menu.AppendSeparator(); wxMenu* subGlobalOpMenuDelete = new wxMenu; subGlobalOpMenuDelete->Append(MENU_TREEPOPUP_DELETE, _("&Delete Transaction")); - if (m_selectedIndex <0) subGlobalOpMenuDelete->Enable(MENU_TREEPOPUP_DELETE, false); + if (hide_menu_item) subGlobalOpMenuDelete->Enable(MENU_TREEPOPUP_DELETE, false); subGlobalOpMenuDelete->AppendSeparator(); subGlobalOpMenuDelete->Append(MENU_TREEPOPUP_DELETE_VIEWED, _("Delete all transactions in current view")); subGlobalOpMenuDelete->Append(MENU_TREEPOPUP_DELETE_FLAGGED, _("Delete Viewed \"Follow Up\" Trans.")); @@ -1104,15 +1106,15 @@ menu.AppendSeparator(); menu.Append(MENU_TREEPOPUP_MARKRECONCILED, _("Mark As &Reconciled")); - if (m_selectedIndex <0) menu.Enable(MENU_TREEPOPUP_MARKRECONCILED, false); + if (hide_menu_item) menu.Enable(MENU_TREEPOPUP_MARKRECONCILED, false); menu.Append(MENU_TREEPOPUP_MARKUNRECONCILED, _("Mark As &Unreconciled")); - if (m_selectedIndex <0) menu.Enable(MENU_TREEPOPUP_MARKUNRECONCILED, false); + if (hide_menu_item) menu.Enable(MENU_TREEPOPUP_MARKUNRECONCILED, false); menu.Append(MENU_TREEPOPUP_MARKVOID, _("Mark As &Void")); - if (m_selectedIndex <0) menu.Enable(MENU_TREEPOPUP_MARKVOID, false); + if (hide_menu_item) menu.Enable(MENU_TREEPOPUP_MARKVOID, false); menu.Append(MENU_TREEPOPUP_MARK_ADD_FLAG_FOLLOWUP, _("Mark For &Followup")); - if (m_selectedIndex <0) menu.Enable(MENU_TREEPOPUP_MARK_ADD_FLAG_FOLLOWUP, false); + if (hide_menu_item) menu.Enable(MENU_TREEPOPUP_MARK_ADD_FLAG_FOLLOWUP, false); menu.Append(MENU_TREEPOPUP_MARKDUPLICATE, _("Mark As &Duplicate")); - if (m_selectedIndex <0) menu.Enable(MENU_TREEPOPUP_MARKDUPLICATE, false); + if (hide_menu_item) menu.Enable(MENU_TREEPOPUP_MARKDUPLICATE, false); menu.AppendSeparator(); wxMenu* subGlobalOpMenu = new wxMenu; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-05-18 07:00:53
|
Revision: 3931 http://sourceforge.net/p/moneymanagerex/code/3931 Author: vomikan Date: 2013-05-18 07:00:51 +0000 (Sat, 18 May 2013) Log Message: ----------- fix for crash if a transaction deleted Modified Paths: -------------- trunk/mmex/src/mmcheckingpanel.cpp Modified: trunk/mmex/src/mmcheckingpanel.cpp =================================================================== --- trunk/mmex/src/mmcheckingpanel.cpp 2013-05-18 06:59:42 UTC (rev 3930) +++ trunk/mmex/src/mmcheckingpanel.cpp 2013-05-18 07:00:51 UTC (rev 3931) @@ -128,7 +128,7 @@ void OnViewSplitTransaction(wxCommandEvent& event); long m_selectedIndex; long m_selectedForCopy; - void refreshVisualList(const int trans_id = -1, long topItemIndex = -1); + void refreshVisualList(const int trans_id = -1); private: DECLARE_NO_COPY_CLASS(TransactionListCtrl) @@ -1151,7 +1151,7 @@ int transID = OnMarkTransactionDB(status); - refreshVisualList(transID, topItemIndex_); + refreshVisualList(transID); //TODO: blinkings may be avoided //m_cp->m_listCtrlAccount->RefreshItems(m_selectedIndex, m_selectedIndex); //m_cp->setAccountSummary(); @@ -1407,6 +1407,7 @@ std::shared_ptr<mmCurrency> pCurrencyPtr = m_cp->core_->accountList_.getCurrencySharedPtr(m_cp->m_AccountID); //pCopiedTrans->updateAllData(m_cp->core_, m_cp->m_AccountID, pCurrencyPtr, true); int transID = pCopiedTrans->transactionID(); + topItemIndex_ = m_selectedIndex; refreshVisualList(transID); } //---------------------------------------------------------------------------- @@ -1469,25 +1470,29 @@ if (GetSelectedItemCount() < 1) return; //ask if they really want to delete - wxMessageDialog msgDlg(this,_("Do you really want to delete the selected transaction?"), - _("Confirm Transaction Deletion"), wxYES_NO | wxNO_DEFAULT | wxICON_EXCLAMATION); + wxMessageDialog msgDlg(this + , _("Do you really want to delete the selected transaction?") + , _("Confirm Transaction Deletion") + , wxYES_NO | wxNO_DEFAULT | wxICON_EXCLAMATION); - if (msgDlg.ShowModal() != wxID_YES) - return; - - if ((m_selectedForCopy > -1) && (m_selectedForCopy == m_cp->m_trans[m_selectedIndex]->transactionID())) - m_selectedForCopy = -1; - - m_cp->core_->db_.get()->Begin(); - for (size_t i=0; i<m_cp->m_trans.size(); ++i ) - { - if (m_cp->m_listCtrlAccount->GetItemState(i, wxLIST_STATE_SELECTED) == wxLIST_STATE_SELECTED) - m_cp->core_->bTransactionList_.deleteTransaction(m_cp->m_AccountID, m_cp->m_trans[i]->transactionID()); + if (msgDlg.ShowModal() == wxID_YES) + { + m_cp->core_->db_.get()->Begin(); + for (size_t i = 0; i < m_cp->m_trans.size(); ++i ) + { + long transID = m_cp->m_trans[i]->transactionID(); + if (m_cp->m_listCtrlAccount->GetItemState(i, wxLIST_STATE_SELECTED) == wxLIST_STATE_SELECTED) + { + m_cp->core_->bTransactionList_.deleteTransaction(m_cp->m_AccountID, transID); + if (i <= topItemIndex_) topItemIndex_--; + m_selectedIndex--; + if (m_selectedForCopy == transID) m_selectedForCopy = -1; + } + } + m_cp->core_->db_.get()->Commit(); + + refreshVisualList(); } - m_cp->core_->db_.get()->Commit(); - - int transID = m_cp->m_trans[m_selectedIndex]->transactionID(); - refreshVisualList(transID, topItemIndex_); } //---------------------------------------------------------------------------- @@ -1532,12 +1537,12 @@ } //---------------------------------------------------------------------------- -void TransactionListCtrl::refreshVisualList(const int trans_id, long topItemIndex) +void TransactionListCtrl::refreshVisualList(const int trans_id) { m_cp->initVirtualListControl(trans_id); - if (topItemIndex >= (long)m_cp->m_trans.size()) - topItemIndex = g_asc ? (long)m_cp->m_trans.size() - 1 : 0; + if (topItemIndex_ >= (long)m_cp->m_trans.size()) + topItemIndex_ = g_asc ? (long)m_cp->m_trans.size() - 1 : 0; if (m_selectedIndex >= (long)m_cp->m_trans.size() || m_selectedIndex < 0) m_selectedIndex = g_asc ? (long)m_cp->m_trans.size() - 1 : 0; @@ -1552,12 +1557,10 @@ { SetItemState(m_selectedIndex, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); SetItemState(m_selectedIndex, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED); - if (topItemIndex > -1) - EnsureVisible(topItemIndex); - else - EnsureVisible(m_selectedIndex); + if (topItemIndex_ < 0) topItemIndex_ = m_selectedIndex; } - + if (m_cp->m_trans.size() > 0) EnsureVisible(topItemIndex_); + m_cp->updateExtraTransactionData(m_selectedIndex); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |