From: <gua...@us...> - 2014-05-08 07:56:49
|
Revision: 6534 http://sourceforge.net/p/moneymanagerex/code/6534 Author: guanlisheng Date: 2014-05-08 07:56:46 +0000 (Thu, 08 May 2014) Log Message: ----------- split huge function Modified Paths: -------------- trunk/src/mmframe.cpp trunk/src/mmframe.h Modified: trunk/src/mmframe.cpp =================================================================== --- trunk/src/mmframe.cpp 2014-05-08 07:36:03 UTC (rev 6533) +++ trunk/src/mmframe.cpp 2014-05-08 07:56:46 UTC (rev 6534) @@ -818,86 +818,8 @@ navTreeCtrl_->SetItemData(categsOverTime, new mmTreeItemData("Where the Money Goes" , new mmReportCategoryExpensesGoes())); - wxTreeItemId categsOverTimeCalMonth = navTreeCtrl_->AppendItem(categsOverTime - , _("Last Calendar Month"), 4, 4); - navTreeCtrl_->SetItemData(categsOverTimeCalMonth - , new mmTreeItemData("Where the Money Goes - Last Calendar Month" - , new mmReportCategoryExpensesGoesLastMonth())); + this->updateReportCategoryExpensesGoesNavigation(categsOverTime); - if (ignoreFuture) - { - wxTreeItemId categsOverTimeCurrentMonth = navTreeCtrl_->AppendItem(categsOverTime - , _("Current Month to Date"), 4, 4); - navTreeCtrl_->SetItemData(categsOverTimeCurrentMonth - , new mmTreeItemData("Where the Money Goes - Current Month" - , new mmReportCategoryExpensesGoesCurrentMonthToDate())); - } - else - { - wxTreeItemId categsOverTimeCurrentMonth = navTreeCtrl_->AppendItem(categsOverTime - , _("Current Month"), 4, 4); - navTreeCtrl_->SetItemData(categsOverTimeCurrentMonth - , new mmTreeItemData("Where the Money Goes - Current Month" - , new mmReportCategoryExpensesGoesCurrentMonth())); - } - - wxTreeItemId categsOverTimeLast30 = navTreeCtrl_->AppendItem(categsOverTime - , _("Last 30 Days"), 4, 4); - navTreeCtrl_->SetItemData(categsOverTimeLast30 - , new mmTreeItemData("Where the Money Goes - Last 30 Days" - , new mmReportCategoryExpensesGoesLast30Days())); - - wxTreeItemId categsOverTimeLastYear = navTreeCtrl_->AppendItem(categsOverTime, _("Last Year"), 4, 4); - navTreeCtrl_->SetItemData(categsOverTimeLastYear - , new mmTreeItemData("Where the Money Goes - Last Year" - , new mmReportCategoryExpensesGoesLastYear())); - - if (ignoreFuture) - { - wxTreeItemId categsOverTimeCurrentYear = navTreeCtrl_->AppendItem(categsOverTime - , _("Current Year to Date"), 4, 4); - navTreeCtrl_->SetItemData(categsOverTimeCurrentYear - , new mmTreeItemData("Where the Money Goes - Current Year" - , new mmReportCategoryExpensesGoesCurrentYearToDate())); - } - else - { - wxTreeItemId categsOverTimeCurrentYear = navTreeCtrl_->AppendItem(categsOverTime - , _("Current Year"), 4, 4); - navTreeCtrl_->SetItemData(categsOverTimeCurrentYear - , new mmTreeItemData("Where the Money Goes - Current Year" - , new mmReportCategoryExpensesGoesCurrentYear())); - } - - int day = Model_Infotable::instance().GetIntInfo("FINANCIAL_YEAR_START_DAY", 1); - int month = Model_Infotable::instance().GetIntInfo("FINANCIAL_YEAR_START_MONTH", 7); - if (financialYearIsDifferent()) - { - wxTreeItemId categsOverTimeLastFinancialYear = navTreeCtrl_->AppendItem(categsOverTime - , _("Last Financial Year"), 4, 4); - navTreeCtrl_->SetItemData(categsOverTimeLastFinancialYear - , new mmTreeItemData("Where the Money Goes - Last Financial Year" - , new mmReportCategoryExpensesGoesLastFinancialYear(day, month))); - - if (ignoreFuture) - { - wxTreeItemId categsOverTimeCurrentFinancialYear = navTreeCtrl_->AppendItem(categsOverTime - , _("Current Financial Year to Date"), 4, 4); - navTreeCtrl_->SetItemData(categsOverTimeCurrentFinancialYear - , new mmTreeItemData("Where the Money Goes - Current Financial Year" - , new mmReportCategoryExpensesGoesCurrentFinancialYearToDate(day, month))); - } - else - { - wxTreeItemId categsOverTimeCurrentFinancialYear = navTreeCtrl_->AppendItem(categsOverTime - , _("Current Financial Year"), 4, 4); - navTreeCtrl_->SetItemData(categsOverTimeCurrentFinancialYear - , new mmTreeItemData("Where the Money Goes - Current Financial Year" - , new mmReportCategoryExpensesGoesCurrentFinancialYear(day, month))); - } - } - /////////////////////////////////////////////////////////// - wxTreeItemId posCategs = navTreeCtrl_->AppendItem(reports , _("Where the Money Comes From"), 4, 4); navTreeCtrl_->SetItemData(posCategs @@ -956,6 +878,8 @@ , new mmReportCategoryExpensesComesCurrentYear())); } + int day = Model_Infotable::instance().GetIntInfo("FINANCIAL_YEAR_START_DAY", 1); + int month = Model_Infotable::instance().GetIntInfo("FINANCIAL_YEAR_START_MONTH", 7); if (financialYearIsDifferent()) { wxTreeItemId posCategsTimeLastFinancialYear = navTreeCtrl_->AppendItem(posCategs @@ -1393,6 +1317,91 @@ } } + +void mmGUIFrame::updateReportCategoryExpensesGoesNavigation(wxTreeItemId& categsOverTime) +{ + bool ignoreFuture = mmIniOptions::instance().ignoreFutureTransactions_; + + wxTreeItemId categsOverTimeCalMonth = navTreeCtrl_->AppendItem(categsOverTime + , _("Last Calendar Month"), 4, 4); + navTreeCtrl_->SetItemData(categsOverTimeCalMonth + , new mmTreeItemData("Where the Money Goes - Last Calendar Month" + , new mmReportCategoryExpensesGoesLastMonth())); + + if (ignoreFuture) + { + wxTreeItemId categsOverTimeCurrentMonth = navTreeCtrl_->AppendItem(categsOverTime + , _("Current Month to Date"), 4, 4); + navTreeCtrl_->SetItemData(categsOverTimeCurrentMonth + , new mmTreeItemData("Where the Money Goes - Current Month" + , new mmReportCategoryExpensesGoesCurrentMonthToDate())); + } + else + { + wxTreeItemId categsOverTimeCurrentMonth = navTreeCtrl_->AppendItem(categsOverTime + , _("Current Month"), 4, 4); + navTreeCtrl_->SetItemData(categsOverTimeCurrentMonth + , new mmTreeItemData("Where the Money Goes - Current Month" + , new mmReportCategoryExpensesGoesCurrentMonth())); + } + + wxTreeItemId categsOverTimeLast30 = navTreeCtrl_->AppendItem(categsOverTime + , _("Last 30 Days"), 4, 4); + navTreeCtrl_->SetItemData(categsOverTimeLast30 + , new mmTreeItemData("Where the Money Goes - Last 30 Days" + , new mmReportCategoryExpensesGoesLast30Days())); + + wxTreeItemId categsOverTimeLastYear = navTreeCtrl_->AppendItem(categsOverTime, _("Last Year"), 4, 4); + navTreeCtrl_->SetItemData(categsOverTimeLastYear + , new mmTreeItemData("Where the Money Goes - Last Year" + , new mmReportCategoryExpensesGoesLastYear())); + + if (ignoreFuture) + { + wxTreeItemId categsOverTimeCurrentYear = navTreeCtrl_->AppendItem(categsOverTime + , _("Current Year to Date"), 4, 4); + navTreeCtrl_->SetItemData(categsOverTimeCurrentYear + , new mmTreeItemData("Where the Money Goes - Current Year" + , new mmReportCategoryExpensesGoesCurrentYearToDate())); + } + else + { + wxTreeItemId categsOverTimeCurrentYear = navTreeCtrl_->AppendItem(categsOverTime + , _("Current Year"), 4, 4); + navTreeCtrl_->SetItemData(categsOverTimeCurrentYear + , new mmTreeItemData("Where the Money Goes - Current Year" + , new mmReportCategoryExpensesGoesCurrentYear())); + } + + int day = Model_Infotable::instance().GetIntInfo("FINANCIAL_YEAR_START_DAY", 1); + int month = Model_Infotable::instance().GetIntInfo("FINANCIAL_YEAR_START_MONTH", 7); + if (financialYearIsDifferent()) + { + wxTreeItemId categsOverTimeLastFinancialYear = navTreeCtrl_->AppendItem(categsOverTime + , _("Last Financial Year"), 4, 4); + navTreeCtrl_->SetItemData(categsOverTimeLastFinancialYear + , new mmTreeItemData("Where the Money Goes - Last Financial Year" + , new mmReportCategoryExpensesGoesLastFinancialYear(day, month))); + + if (ignoreFuture) + { + wxTreeItemId categsOverTimeCurrentFinancialYear = navTreeCtrl_->AppendItem(categsOverTime + , _("Current Financial Year to Date"), 4, 4); + navTreeCtrl_->SetItemData(categsOverTimeCurrentFinancialYear + , new mmTreeItemData("Where the Money Goes - Current Financial Year" + , new mmReportCategoryExpensesGoesCurrentFinancialYearToDate(day, month))); + } + else + { + wxTreeItemId categsOverTimeCurrentFinancialYear = navTreeCtrl_->AppendItem(categsOverTime + , _("Current Financial Year"), 4, 4); + navTreeCtrl_->SetItemData(categsOverTimeCurrentFinancialYear + , new mmTreeItemData("Where the Money Goes - Current Financial Year" + , new mmReportCategoryExpensesGoesCurrentFinancialYear(day, month))); + } + } +} + //---------------------------------------------------------------------------- void mmGUIFrame::OnTreeItemExpanded(wxTreeEvent& event) Modified: trunk/src/mmframe.h =================================================================== --- trunk/src/mmframe.h 2014-05-08 07:36:03 UTC (rev 6533) +++ trunk/src/mmframe.h 2014-05-08 07:56:46 UTC (rev 6534) @@ -183,6 +183,7 @@ void menuEnableItems(bool enable); void updateNavTreeControl(bool expandTermAccounts = false); void updateReportNavigation(wxTreeItemId& reports, wxTreeItemId& budgeting); + void updateReportCategoryExpensesGoesNavigation(wxTreeItemId& categsOverTime); void showTreePopupMenu(const wxTreeItemId& id, const wxPoint& pt); void showBeginAppDialog(bool fromScratch = false); void SetDataBaseParameters(const wxString& fileName); This was sent by MMEX an easy to use, money management application. |
From: <gua...@us...> - 2014-05-08 08:05:33
|
Revision: 6535 http://sourceforge.net/p/moneymanagerex/code/6535 Author: guanlisheng Date: 2014-05-08 08:05:30 +0000 (Thu, 08 May 2014) Log Message: ----------- split huge function Modified Paths: -------------- trunk/src/mmframe.cpp trunk/src/mmframe.h Modified: trunk/src/mmframe.cpp =================================================================== --- trunk/src/mmframe.cpp 2014-05-08 07:56:46 UTC (rev 6534) +++ trunk/src/mmframe.cpp 2014-05-08 08:05:30 UTC (rev 6535) @@ -812,6 +812,8 @@ void mmGUIFrame::updateReportNavigation(wxTreeItemId& reports, wxTreeItemId& budgeting) { + int day = Model_Infotable::instance().GetIntInfo("FINANCIAL_YEAR_START_DAY", 1); + int month = Model_Infotable::instance().GetIntInfo("FINANCIAL_YEAR_START_MONTH", 7); bool ignoreFuture = mmIniOptions::instance().ignoreFutureTransactions_; wxTreeItemId categsOverTime = navTreeCtrl_->AppendItem(reports , _("Where the Money Goes"), 4, 4); @@ -825,88 +827,9 @@ navTreeCtrl_->SetItemData(posCategs , new mmTreeItemData("Where the Money Comes From" , new mmReportCategoryExpensesComes())); + + this->updateReportCategoryExpensesComesNavigation(posCategs); - wxTreeItemId posCategsCalMonth = navTreeCtrl_->AppendItem(posCategs - , _("Last Calendar Month"), 4, 4); - navTreeCtrl_->SetItemData(posCategsCalMonth - , new mmTreeItemData("Where the Money Comes From - Last Calendar Month" - , new mmReportCategoryExpensesComesLastMonth())); - - if (ignoreFuture) - { - wxTreeItemId posCategsCurrentMonth = navTreeCtrl_->AppendItem(posCategs - , _("Current Month to Date"), 4, 4); - navTreeCtrl_->SetItemData(posCategsCurrentMonth - , new mmTreeItemData("Where the Money Comes From - Current Month" - , new mmReportCategoryExpensesComesCurrentMonthToDate())); - } - else - { - wxTreeItemId posCategsCurrentMonth = navTreeCtrl_->AppendItem(posCategs - , _("Current Month"), 4, 4); - navTreeCtrl_->SetItemData(posCategsCurrentMonth - , new mmTreeItemData("Where the Money Comes From - Current Month" - , new mmReportCategoryExpensesComesCurrentMonth())); - } - - wxTreeItemId posCategsTimeLast30 = navTreeCtrl_->AppendItem(posCategs - , _("Last 30 Days"), 4, 4); - navTreeCtrl_->SetItemData(posCategsTimeLast30 - , new mmTreeItemData("Where the Money Comes From - Last 30 Days" - , new mmReportCategoryExpensesComesLast30Days())); - - wxTreeItemId posCategsTimeLastYear = navTreeCtrl_->AppendItem(posCategs - , _("Last Year"), 4, 4); - navTreeCtrl_->SetItemData(posCategsTimeLastYear - , new mmTreeItemData("Where the Money Comes From - Last Year" - , new mmReportCategoryExpensesComesLastYear())); - - if (ignoreFuture) - { - wxTreeItemId posCategsTimeCurrentYear = navTreeCtrl_->AppendItem(posCategs - , _("Current Year to Date"), 4, 4); - navTreeCtrl_->SetItemData(posCategsTimeCurrentYear - , new mmTreeItemData("Where the Money Comes From - Current Year" - , new mmReportCategoryExpensesComesCurrentYearToDate())); - } - else - { - wxTreeItemId posCategsTimeCurrentYear = navTreeCtrl_->AppendItem(posCategs - , _("Current Year"), 4, 4); - navTreeCtrl_->SetItemData(posCategsTimeCurrentYear - , new mmTreeItemData("Where the Money Comes From - Current Year" - , new mmReportCategoryExpensesComesCurrentYear())); - } - - int day = Model_Infotable::instance().GetIntInfo("FINANCIAL_YEAR_START_DAY", 1); - int month = Model_Infotable::instance().GetIntInfo("FINANCIAL_YEAR_START_MONTH", 7); - if (financialYearIsDifferent()) - { - wxTreeItemId posCategsTimeLastFinancialYear = navTreeCtrl_->AppendItem(posCategs - , _("Last Financial Year"), 4, 4); - navTreeCtrl_->SetItemData(posCategsTimeLastFinancialYear - , new mmTreeItemData("Where the Money Comes From - Last Financial Year" - , new mmReportCategoryExpensesComesLastFinancialYear(day, month))); - - if (ignoreFuture) - { - wxTreeItemId posCategsTimeCurrentFinancialYear = navTreeCtrl_->AppendItem(posCategs - , _("Current Financial Year to Date"), 4, 4); - navTreeCtrl_->SetItemData(posCategsTimeCurrentFinancialYear - , new mmTreeItemData("Where the Money Comes From - Current Financial Year" - , new mmReportCategoryExpensesComesCurrentFinancialYearToDate(day, month))); - } - else - { - wxTreeItemId posCategsTimeCurrentFinancialYear = navTreeCtrl_->AppendItem(posCategs - , _("Current Financial Year"), 4, 4); - navTreeCtrl_->SetItemData(posCategsTimeCurrentFinancialYear - , new mmTreeItemData("Where the Money Comes From - Current Financial Year" - , new mmReportCategoryExpensesComesCurrentFinancialYear(day, month))); - } - } - /////////////////////////////////////////////////////////// - wxTreeItemId categs = navTreeCtrl_->AppendItem(reports, _("Categories"), 4, 4); navTreeCtrl_->SetItemData(categs , new mmTreeItemData("Categories - Over Time" @@ -1402,6 +1325,91 @@ } } +void mmGUIFrame::updateReportCategoryExpensesComesNavigation(wxTreeItemId& posCategs) +{ + bool ignoreFuture = mmIniOptions::instance().ignoreFutureTransactions_; + + wxTreeItemId posCategsCalMonth = navTreeCtrl_->AppendItem(posCategs + , _("Last Calendar Month"), 4, 4); + navTreeCtrl_->SetItemData(posCategsCalMonth + , new mmTreeItemData("Where the Money Comes From - Last Calendar Month" + , new mmReportCategoryExpensesComesLastMonth())); + + if (ignoreFuture) + { + wxTreeItemId posCategsCurrentMonth = navTreeCtrl_->AppendItem(posCategs + , _("Current Month to Date"), 4, 4); + navTreeCtrl_->SetItemData(posCategsCurrentMonth + , new mmTreeItemData("Where the Money Comes From - Current Month" + , new mmReportCategoryExpensesComesCurrentMonthToDate())); + } + else + { + wxTreeItemId posCategsCurrentMonth = navTreeCtrl_->AppendItem(posCategs + , _("Current Month"), 4, 4); + navTreeCtrl_->SetItemData(posCategsCurrentMonth + , new mmTreeItemData("Where the Money Comes From - Current Month" + , new mmReportCategoryExpensesComesCurrentMonth())); + } + + wxTreeItemId posCategsTimeLast30 = navTreeCtrl_->AppendItem(posCategs + , _("Last 30 Days"), 4, 4); + navTreeCtrl_->SetItemData(posCategsTimeLast30 + , new mmTreeItemData("Where the Money Comes From - Last 30 Days" + , new mmReportCategoryExpensesComesLast30Days())); + + wxTreeItemId posCategsTimeLastYear = navTreeCtrl_->AppendItem(posCategs + , _("Last Year"), 4, 4); + navTreeCtrl_->SetItemData(posCategsTimeLastYear + , new mmTreeItemData("Where the Money Comes From - Last Year" + , new mmReportCategoryExpensesComesLastYear())); + + if (ignoreFuture) + { + wxTreeItemId posCategsTimeCurrentYear = navTreeCtrl_->AppendItem(posCategs + , _("Current Year to Date"), 4, 4); + navTreeCtrl_->SetItemData(posCategsTimeCurrentYear + , new mmTreeItemData("Where the Money Comes From - Current Year" + , new mmReportCategoryExpensesComesCurrentYearToDate())); + } + else + { + wxTreeItemId posCategsTimeCurrentYear = navTreeCtrl_->AppendItem(posCategs + , _("Current Year"), 4, 4); + navTreeCtrl_->SetItemData(posCategsTimeCurrentYear + , new mmTreeItemData("Where the Money Comes From - Current Year" + , new mmReportCategoryExpensesComesCurrentYear())); + } + + int day = Model_Infotable::instance().GetIntInfo("FINANCIAL_YEAR_START_DAY", 1); + int month = Model_Infotable::instance().GetIntInfo("FINANCIAL_YEAR_START_MONTH", 7); + if (financialYearIsDifferent()) + { + wxTreeItemId posCategsTimeLastFinancialYear = navTreeCtrl_->AppendItem(posCategs + , _("Last Financial Year"), 4, 4); + navTreeCtrl_->SetItemData(posCategsTimeLastFinancialYear + , new mmTreeItemData("Where the Money Comes From - Last Financial Year" + , new mmReportCategoryExpensesComesLastFinancialYear(day, month))); + + if (ignoreFuture) + { + wxTreeItemId posCategsTimeCurrentFinancialYear = navTreeCtrl_->AppendItem(posCategs + , _("Current Financial Year to Date"), 4, 4); + navTreeCtrl_->SetItemData(posCategsTimeCurrentFinancialYear + , new mmTreeItemData("Where the Money Comes From - Current Financial Year" + , new mmReportCategoryExpensesComesCurrentFinancialYearToDate(day, month))); + } + else + { + wxTreeItemId posCategsTimeCurrentFinancialYear = navTreeCtrl_->AppendItem(posCategs + , _("Current Financial Year"), 4, 4); + navTreeCtrl_->SetItemData(posCategsTimeCurrentFinancialYear + , new mmTreeItemData("Where the Money Comes From - Current Financial Year" + , new mmReportCategoryExpensesComesCurrentFinancialYear(day, month))); + } + } +} + //---------------------------------------------------------------------------- void mmGUIFrame::OnTreeItemExpanded(wxTreeEvent& event) Modified: trunk/src/mmframe.h =================================================================== --- trunk/src/mmframe.h 2014-05-08 07:56:46 UTC (rev 6534) +++ trunk/src/mmframe.h 2014-05-08 08:05:30 UTC (rev 6535) @@ -184,6 +184,7 @@ void updateNavTreeControl(bool expandTermAccounts = false); void updateReportNavigation(wxTreeItemId& reports, wxTreeItemId& budgeting); void updateReportCategoryExpensesGoesNavigation(wxTreeItemId& categsOverTime); + void updateReportCategoryExpensesComesNavigation(wxTreeItemId& posCategs); void showTreePopupMenu(const wxTreeItemId& id, const wxPoint& pt); void showBeginAppDialog(bool fromScratch = false); void SetDataBaseParameters(const wxString& fileName); This was sent by MMEX an easy to use, money management application. |
From: <gua...@us...> - 2014-05-08 08:10:31
|
Revision: 6536 http://sourceforge.net/p/moneymanagerex/code/6536 Author: guanlisheng Date: 2014-05-08 08:10:28 +0000 (Thu, 08 May 2014) Log Message: ----------- split huge function Modified Paths: -------------- trunk/src/mmframe.cpp trunk/src/mmframe.h Modified: trunk/src/mmframe.cpp =================================================================== --- trunk/src/mmframe.cpp 2014-05-08 08:05:30 UTC (rev 6535) +++ trunk/src/mmframe.cpp 2014-05-08 08:10:28 UTC (rev 6536) @@ -835,83 +835,8 @@ , new mmTreeItemData("Categories - Over Time" , new mmReportCategoryOverTimePerformance())); - wxTreeItemId categsCalMonth = navTreeCtrl_->AppendItem(categs - , _("Last Calendar Month"), 4, 4); - navTreeCtrl_->SetItemData(categsCalMonth - , new mmTreeItemData("Categories - Last Calendar Month" - , new mmReportCategoryExpensesCategoriesLastMonth())); + this->updateReportCategoryNavigation(categs); - if (ignoreFuture) - { - wxTreeItemId categsCurrentMonth = navTreeCtrl_->AppendItem(categs - , _("Current Month to Date"), 4, 4); - navTreeCtrl_->SetItemData(categsCurrentMonth - , new mmTreeItemData("Categories - Current Month" - , new mmReportCategoryExpensesCategoriesCurrentMonthToDate())); - } - else - { - wxTreeItemId categsCurrentMonth = navTreeCtrl_->AppendItem(categs - , _("Current Month"), 4, 4); - navTreeCtrl_->SetItemData(categsCurrentMonth - , new mmTreeItemData("Categories - Current Month" - , new mmReportCategoryExpensesCategoriesCurrentMonth())); - } - - wxTreeItemId categsTimeLast30 = navTreeCtrl_->AppendItem(categs, _("Last 30 Days"), 4, 4); - navTreeCtrl_->SetItemData(categsTimeLast30 - , new mmTreeItemData("Categories - Last 30 Days" - , new mmReportCategoryExpensesCategoriesLast30Days())); - - wxTreeItemId categsTimeLastYear = navTreeCtrl_->AppendItem(categs, _("Last Year"), 4, 4); - navTreeCtrl_->SetItemData(categsTimeLastYear - , new mmTreeItemData("Categories - Last Year" - , new mmReportCategoryExpensesCategoriesLastYear())); - - if (ignoreFuture) - { - wxTreeItemId categsTimeCurrentYear = navTreeCtrl_->AppendItem(categs - , _("Current Year to Date"), 4, 4); - navTreeCtrl_->SetItemData(categsTimeCurrentYear - , new mmTreeItemData("Categories - Current Year" - , new mmReportCategoryExpensesCategoriesCurrentYearToDate())); - } - else - { - wxTreeItemId categsTimeCurrentYear = navTreeCtrl_->AppendItem(categs - , _("Current Year"), 4, 4); - navTreeCtrl_->SetItemData(categsTimeCurrentYear - , new mmTreeItemData("Categories - Current Year" - , new mmReportCategoryExpensesCategoriesCurrentYear())); - } - - if (financialYearIsDifferent()) - { - wxTreeItemId categsTimeLastFinancialYear = navTreeCtrl_->AppendItem(categs - , _("Last Financial Year"), 4, 4); - navTreeCtrl_->SetItemData(categsTimeLastFinancialYear - , new mmTreeItemData("Categories - Last Financial Year" - , new mmReportCategoryExpensesCategoriesLastFinancialYear(day, month))); - - if (ignoreFuture) - { - wxTreeItemId categsTimeCurrentFinancialYear = navTreeCtrl_->AppendItem(categs - , _("Current Financial Year to Date"), 4, 4); - navTreeCtrl_->SetItemData(categsTimeCurrentFinancialYear - , new mmTreeItemData("Categories - Current Financial Year" - , new mmReportCategoryExpensesCategoriesCurrentFinancialYearToDate(day, month))); - } - else - { - wxTreeItemId categsTimeCurrentFinancialYear = navTreeCtrl_->AppendItem(categs - , _("Current Financial Year"), 4, 4); - navTreeCtrl_->SetItemData(categsTimeCurrentFinancialYear - , new mmTreeItemData("Categories - Current Financial Year" - , new mmReportCategoryExpensesCategoriesCurrentFinancialYear(day, month))); - } - } - /////////////////////////////////////////////////////////// - wxTreeItemId payeesOverTime = navTreeCtrl_->AppendItem(reports, _("Payees"), 4, 4); navTreeCtrl_->SetItemData(payeesOverTime , new mmTreeItemData("Payee Report" @@ -1410,6 +1335,90 @@ } } +void mmGUIFrame::updateReportCategoryNavigation(wxTreeItemId& categs) +{ + int day = Model_Infotable::instance().GetIntInfo("FINANCIAL_YEAR_START_DAY", 1); + int month = Model_Infotable::instance().GetIntInfo("FINANCIAL_YEAR_START_MONTH", 7); + bool ignoreFuture = mmIniOptions::instance().ignoreFutureTransactions_; + + wxTreeItemId categsCalMonth = navTreeCtrl_->AppendItem(categs + , _("Last Calendar Month"), 4, 4); + navTreeCtrl_->SetItemData(categsCalMonth + , new mmTreeItemData("Categories - Last Calendar Month" + , new mmReportCategoryExpensesCategoriesLastMonth())); + + if (ignoreFuture) + { + wxTreeItemId categsCurrentMonth = navTreeCtrl_->AppendItem(categs + , _("Current Month to Date"), 4, 4); + navTreeCtrl_->SetItemData(categsCurrentMonth + , new mmTreeItemData("Categories - Current Month" + , new mmReportCategoryExpensesCategoriesCurrentMonthToDate())); + } + else + { + wxTreeItemId categsCurrentMonth = navTreeCtrl_->AppendItem(categs + , _("Current Month"), 4, 4); + navTreeCtrl_->SetItemData(categsCurrentMonth + , new mmTreeItemData("Categories - Current Month" + , new mmReportCategoryExpensesCategoriesCurrentMonth())); + } + + wxTreeItemId categsTimeLast30 = navTreeCtrl_->AppendItem(categs, _("Last 30 Days"), 4, 4); + navTreeCtrl_->SetItemData(categsTimeLast30 + , new mmTreeItemData("Categories - Last 30 Days" + , new mmReportCategoryExpensesCategoriesLast30Days())); + + wxTreeItemId categsTimeLastYear = navTreeCtrl_->AppendItem(categs, _("Last Year"), 4, 4); + navTreeCtrl_->SetItemData(categsTimeLastYear + , new mmTreeItemData("Categories - Last Year" + , new mmReportCategoryExpensesCategoriesLastYear())); + + if (ignoreFuture) + { + wxTreeItemId categsTimeCurrentYear = navTreeCtrl_->AppendItem(categs + , _("Current Year to Date"), 4, 4); + navTreeCtrl_->SetItemData(categsTimeCurrentYear + , new mmTreeItemData("Categories - Current Year" + , new mmReportCategoryExpensesCategoriesCurrentYearToDate())); + } + else + { + wxTreeItemId categsTimeCurrentYear = navTreeCtrl_->AppendItem(categs + , _("Current Year"), 4, 4); + navTreeCtrl_->SetItemData(categsTimeCurrentYear + , new mmTreeItemData("Categories - Current Year" + , new mmReportCategoryExpensesCategoriesCurrentYear())); + } + + if (financialYearIsDifferent()) + { + wxTreeItemId categsTimeLastFinancialYear = navTreeCtrl_->AppendItem(categs + , _("Last Financial Year"), 4, 4); + navTreeCtrl_->SetItemData(categsTimeLastFinancialYear + , new mmTreeItemData("Categories - Last Financial Year" + , new mmReportCategoryExpensesCategoriesLastFinancialYear(day, month))); + + if (ignoreFuture) + { + wxTreeItemId categsTimeCurrentFinancialYear = navTreeCtrl_->AppendItem(categs + , _("Current Financial Year to Date"), 4, 4); + navTreeCtrl_->SetItemData(categsTimeCurrentFinancialYear + , new mmTreeItemData("Categories - Current Financial Year" + , new mmReportCategoryExpensesCategoriesCurrentFinancialYearToDate(day, month))); + } + else + { + wxTreeItemId categsTimeCurrentFinancialYear = navTreeCtrl_->AppendItem(categs + , _("Current Financial Year"), 4, 4); + navTreeCtrl_->SetItemData(categsTimeCurrentFinancialYear + , new mmTreeItemData("Categories - Current Financial Year" + , new mmReportCategoryExpensesCategoriesCurrentFinancialYear(day, month))); + } + } +} + + //---------------------------------------------------------------------------- void mmGUIFrame::OnTreeItemExpanded(wxTreeEvent& event) Modified: trunk/src/mmframe.h =================================================================== --- trunk/src/mmframe.h 2014-05-08 08:05:30 UTC (rev 6535) +++ trunk/src/mmframe.h 2014-05-08 08:10:28 UTC (rev 6536) @@ -185,6 +185,7 @@ void updateReportNavigation(wxTreeItemId& reports, wxTreeItemId& budgeting); void updateReportCategoryExpensesGoesNavigation(wxTreeItemId& categsOverTime); void updateReportCategoryExpensesComesNavigation(wxTreeItemId& posCategs); + void updateReportCategoryNavigation(wxTreeItemId& categs); void showTreePopupMenu(const wxTreeItemId& id, const wxPoint& pt); void showBeginAppDialog(bool fromScratch = false); void SetDataBaseParameters(const wxString& fileName); This was sent by MMEX an easy to use, money management application. |
From: <gua...@us...> - 2014-05-08 08:15:41
|
Revision: 6538 http://sourceforge.net/p/moneymanagerex/code/6538 Author: guanlisheng Date: 2014-05-08 08:15:38 +0000 (Thu, 08 May 2014) Log Message: ----------- split huge function Modified Paths: -------------- trunk/src/mmframe.cpp trunk/src/mmframe.h Modified: trunk/src/mmframe.cpp =================================================================== --- trunk/src/mmframe.cpp 2014-05-08 08:13:07 UTC (rev 6537) +++ trunk/src/mmframe.cpp 2014-05-08 08:15:38 UTC (rev 6538) @@ -842,86 +842,8 @@ , new mmTreeItemData("Payee Report" , new mmReportPayeeExpenses())); - wxTreeItemId payeesOverTimeCalMonth = navTreeCtrl_->AppendItem(payeesOverTime - , _("Last Calendar Month"), 4, 4); - navTreeCtrl_->SetItemData(payeesOverTimeCalMonth - , new mmTreeItemData("Payees - Last Calendar Month" - , new mmReportPayeeExpensesLastMonth())); + this->updateReportPayeeNavigation(payeesOverTime); - if (ignoreFuture) - { - wxTreeItemId payeesOverTimeCurrentMonth = navTreeCtrl_->AppendItem(payeesOverTime - , _("Current Month to Date"), 4, 4); - navTreeCtrl_->SetItemData(payeesOverTimeCurrentMonth - , new mmTreeItemData("Payees - Current Month" - , new mmReportPayeeExpensesCurrentMonthToDate())); - } - else - { - wxTreeItemId payeesOverTimeCurrentMonth = navTreeCtrl_->AppendItem(payeesOverTime - , _("Current Month"), 4, 4); - navTreeCtrl_->SetItemData(payeesOverTimeCurrentMonth - , new mmTreeItemData("Payees - Current Month" - , new mmReportPayeeExpensesCurrentMonth())); - } - - wxTreeItemId payeesOverTimeLast30 = navTreeCtrl_->AppendItem(payeesOverTime - , _("Last 30 Days"), 4, 4); - navTreeCtrl_->SetItemData(payeesOverTimeLast30 - , new mmTreeItemData("Payees - Last 30 Days" - , new mmReportPayeeExpensesLast30Days())); - - wxTreeItemId payeesOverTimeLastYear = navTreeCtrl_->AppendItem(payeesOverTime - , _("Last Year"), 4, 4); - navTreeCtrl_->SetItemData(payeesOverTimeLastYear - , new mmTreeItemData("Payees - Last Year" - , new mmReportPayeeExpensesLastYear())); - - if (ignoreFuture) - { - wxTreeItemId payeesOverTimeCurrentYear = navTreeCtrl_->AppendItem(payeesOverTime - , _("Current Year to Date"), 4, 4); - navTreeCtrl_->SetItemData(payeesOverTimeCurrentYear - , new mmTreeItemData("Payees - Current Year" - , new mmReportPayeeExpensesCurrentYearToDate())); - } - else - { - wxTreeItemId payeesOverTimeCurrentYear = navTreeCtrl_->AppendItem(payeesOverTime - , _("Current Year"), 4, 4); - navTreeCtrl_->SetItemData(payeesOverTimeCurrentYear - , new mmTreeItemData("Payees - Current Year" - , new mmReportPayeeExpensesCurrentYear())); - } - - if (financialYearIsDifferent()) - { - wxTreeItemId payeesOverTimeLastFinancialYear = navTreeCtrl_->AppendItem(payeesOverTime - , _("Last Financial Year"), 4, 4); - navTreeCtrl_->SetItemData(payeesOverTimeLastFinancialYear - , new mmTreeItemData("Payees - Last Financial Year" - , new mmReportPayeeExpensesLastFinancialYear(day, month))); - - if (ignoreFuture) - { - wxTreeItemId payeesOverTimeCurrentFinancialYear = navTreeCtrl_->AppendItem(payeesOverTime - , _("Current Financial Year to Date"), 4, 4); - navTreeCtrl_->SetItemData(payeesOverTimeCurrentFinancialYear - , new mmTreeItemData("Payees - Current Financial Year" - , new mmReportPayeeExpensesCurrentFinancialYearToDate(day, month))); - } - else - { - wxTreeItemId payeesOverTimeCurrentFinancialYear = navTreeCtrl_->AppendItem(payeesOverTime - , _("Current Financial Year"), 4, 4); - navTreeCtrl_->SetItemData(payeesOverTimeCurrentFinancialYear - , new mmTreeItemData("Payees - Current Financial Year" - , new mmReportPayeeExpensesCurrentFinancialYear(day, month))); - } - } - - /////////////////////////////////////////////////////////////////// - wxTreeItemId incexpOverTime = navTreeCtrl_->AppendItem(reports, _("Income vs Expenses"), 4, 4); navTreeCtrl_->SetItemData(incexpOverTime, new mmTreeItemData("Income vs Expenses" , new mmReportIncomeExpensesAllTime())); @@ -1163,7 +1085,6 @@ , wxGetTranslation(record.REPORTNAME), 8, 8); navTreeCtrl_->SetItemData(item, new mmTreeItemData(r->REPORTNAME, new mmGeneralReport(r))); } - } void mmGUIFrame::updateReportCategoryExpensesGoesNavigation(wxTreeItemId& categsOverTime) @@ -1418,7 +1339,91 @@ } } +void mmGUIFrame::updateReportPayeeNavigation(wxTreeItemId& payeesOverTime) +{ + int day = Model_Infotable::instance().GetIntInfo("FINANCIAL_YEAR_START_DAY", 1); + int month = Model_Infotable::instance().GetIntInfo("FINANCIAL_YEAR_START_MONTH", 7); + bool ignoreFuture = mmIniOptions::instance().ignoreFutureTransactions_; + wxTreeItemId payeesOverTimeCalMonth = navTreeCtrl_->AppendItem(payeesOverTime + , _("Last Calendar Month"), 4, 4); + navTreeCtrl_->SetItemData(payeesOverTimeCalMonth + , new mmTreeItemData("Payees - Last Calendar Month" + , new mmReportPayeeExpensesLastMonth())); + + if (ignoreFuture) + { + wxTreeItemId payeesOverTimeCurrentMonth = navTreeCtrl_->AppendItem(payeesOverTime + , _("Current Month to Date"), 4, 4); + navTreeCtrl_->SetItemData(payeesOverTimeCurrentMonth + , new mmTreeItemData("Payees - Current Month" + , new mmReportPayeeExpensesCurrentMonthToDate())); + } + else + { + wxTreeItemId payeesOverTimeCurrentMonth = navTreeCtrl_->AppendItem(payeesOverTime + , _("Current Month"), 4, 4); + navTreeCtrl_->SetItemData(payeesOverTimeCurrentMonth + , new mmTreeItemData("Payees - Current Month" + , new mmReportPayeeExpensesCurrentMonth())); + } + + wxTreeItemId payeesOverTimeLast30 = navTreeCtrl_->AppendItem(payeesOverTime + , _("Last 30 Days"), 4, 4); + navTreeCtrl_->SetItemData(payeesOverTimeLast30 + , new mmTreeItemData("Payees - Last 30 Days" + , new mmReportPayeeExpensesLast30Days())); + + wxTreeItemId payeesOverTimeLastYear = navTreeCtrl_->AppendItem(payeesOverTime + , _("Last Year"), 4, 4); + navTreeCtrl_->SetItemData(payeesOverTimeLastYear + , new mmTreeItemData("Payees - Last Year" + , new mmReportPayeeExpensesLastYear())); + + if (ignoreFuture) + { + wxTreeItemId payeesOverTimeCurrentYear = navTreeCtrl_->AppendItem(payeesOverTime + , _("Current Year to Date"), 4, 4); + navTreeCtrl_->SetItemData(payeesOverTimeCurrentYear + , new mmTreeItemData("Payees - Current Year" + , new mmReportPayeeExpensesCurrentYearToDate())); + } + else + { + wxTreeItemId payeesOverTimeCurrentYear = navTreeCtrl_->AppendItem(payeesOverTime + , _("Current Year"), 4, 4); + navTreeCtrl_->SetItemData(payeesOverTimeCurrentYear + , new mmTreeItemData("Payees - Current Year" + , new mmReportPayeeExpensesCurrentYear())); + } + + if (financialYearIsDifferent()) + { + wxTreeItemId payeesOverTimeLastFinancialYear = navTreeCtrl_->AppendItem(payeesOverTime + , _("Last Financial Year"), 4, 4); + navTreeCtrl_->SetItemData(payeesOverTimeLastFinancialYear + , new mmTreeItemData("Payees - Last Financial Year" + , new mmReportPayeeExpensesLastFinancialYear(day, month))); + + if (ignoreFuture) + { + wxTreeItemId payeesOverTimeCurrentFinancialYear = navTreeCtrl_->AppendItem(payeesOverTime + , _("Current Financial Year to Date"), 4, 4); + navTreeCtrl_->SetItemData(payeesOverTimeCurrentFinancialYear + , new mmTreeItemData("Payees - Current Financial Year" + , new mmReportPayeeExpensesCurrentFinancialYearToDate(day, month))); + } + else + { + wxTreeItemId payeesOverTimeCurrentFinancialYear = navTreeCtrl_->AppendItem(payeesOverTime + , _("Current Financial Year"), 4, 4); + navTreeCtrl_->SetItemData(payeesOverTimeCurrentFinancialYear + , new mmTreeItemData("Payees - Current Financial Year" + , new mmReportPayeeExpensesCurrentFinancialYear(day, month))); + } + } +} + //---------------------------------------------------------------------------- void mmGUIFrame::OnTreeItemExpanded(wxTreeEvent& event) Modified: trunk/src/mmframe.h =================================================================== --- trunk/src/mmframe.h 2014-05-08 08:13:07 UTC (rev 6537) +++ trunk/src/mmframe.h 2014-05-08 08:15:38 UTC (rev 6538) @@ -186,6 +186,7 @@ void updateReportCategoryExpensesGoesNavigation(wxTreeItemId& categsOverTime); void updateReportCategoryExpensesComesNavigation(wxTreeItemId& posCategs); void updateReportCategoryNavigation(wxTreeItemId& categs); + void updateReportPayeeNavigation(wxTreeItemId& payeesOverTime); void showTreePopupMenu(const wxTreeItemId& id, const wxPoint& pt); void showBeginAppDialog(bool fromScratch = false); void SetDataBaseParameters(const wxString& fileName); This was sent by MMEX an easy to use, money management application. |
From: <vo...@us...> - 2014-05-08 09:18:30
|
Revision: 6540 http://sourceforge.net/p/moneymanagerex/code/6540 Author: vomikan Date: 2014-05-08 09:18:27 +0000 (Thu, 08 May 2014) Log Message: ----------- Reports temp folder initialization at startup Modified Paths: -------------- trunk/src/mmex.cpp trunk/src/mmhomepagepanel.cpp trunk/src/model/Model_Report.cpp trunk/src/model/Model_Report.h trunk/src/paths.cpp Modified: trunk/src/mmex.cpp =================================================================== --- trunk/src/mmex.cpp 2014-05-08 08:25:03 UTC (rev 6539) +++ trunk/src/mmex.cpp 2014-05-08 09:18:27 UTC (rev 6540) @@ -171,12 +171,15 @@ Mongoose_Service::instance().open(); bool ok = app->m_frame->Show(); - if (isMax) app->m_frame->Maximize(true); // success: wxApp::OnRun() will be called which will enter the main message // loop and the application will run. If we returned FALSE here, the // application would exit immediately. + if (ok) { + Model_Report::prepareTempFolder(); + } + return ok; } Modified: trunk/src/mmhomepagepanel.cpp =================================================================== --- trunk/src/mmhomepagepanel.cpp 2014-05-08 08:25:03 UTC (rev 6539) +++ trunk/src/mmhomepagepanel.cpp 2014-05-08 09:18:27 UTC (rev 6540) @@ -235,10 +235,7 @@ { m_templateText.Replace(wxString::Format("<TMPL_VAR \"%s\">", entry.first), entry.second); } - wxFileOutputStream index_output(mmex::getReportIndex()); - wxTextOutputStream index_file(index_output); - index_file << m_templateText; - index_output.Close(); + Model_Report::outputReportFile(m_templateText); browser_->LoadURL(getURL(mmex::getReportIndex())); wxLogDebug("Loading file:%s", mmex::getReportIndex()); } Modified: trunk/src/model/Model_Report.cpp =================================================================== --- trunk/src/model/Model_Report.cpp 2014-05-08 08:25:03 UTC (rev 6539) +++ trunk/src/model/Model_Report.cpp 2014-05-08 09:18:27 UTC (rev 6540) @@ -280,15 +280,13 @@ // TODO } - prepareTempFolder(out); + outputReportFile(out); return out; } -void Model_Report::prepareTempFolder(const wxString& str) +void Model_Report::prepareTempFolder() { - //TODO: cleanup - const wxString tempDir = wxString::Format("%s%smmex_reports%s", wxStandardPaths::Get().GetTempDir() - , wxString(wxFILE_SEP_PATH), wxString(wxFILE_SEP_PATH)); + const wxString tempDir = wxFileName(mmex::getReportIndex()).GetPathWithSep(); const wxString resDir = mmex::GetResourceDir().GetPathWithSep(); wxFileName::Mkdir(tempDir, 511, wxPATH_MKDIR_FULL); wxArrayString filesArray; @@ -301,8 +299,11 @@ } wxLogDebug("Coping file: %s to %s", f, tempDir + wxFileName(f).GetFullName()); } +} - wxFileOutputStream index_output(wxString::Format("%sindex.html", tempDir)); +void Model_Report::outputReportFile(const wxString& str) +{ + wxFileOutputStream index_output(mmex::getReportIndex()); wxTextOutputStream index_file(index_output); index_file << str; index_output.Close(); Modified: trunk/src/model/Model_Report.h =================================================================== --- trunk/src/model/Model_Report.h 2014-05-08 08:25:03 UTC (rev 6539) +++ trunk/src/model/Model_Report.h 2014-05-08 09:18:27 UTC (rev 6540) @@ -51,8 +51,8 @@ wxString getTemplate(const wxString& sql); bool getColumns(const wxString& sql, std::vector<std::pair<wxString, int> > &colHeaders); void getSqlTableInfo(std::vector<std::pair<wxString, wxArrayString>> &sqlTableInfo); -private: - static void prepareTempFolder(const wxString& str); + static void prepareTempFolder(); + static void outputReportFile(const wxString& str); }; #endif // Modified: trunk/src/paths.cpp =================================================================== --- trunk/src/paths.cpp 2014-05-08 08:25:03 UTC (rev 6539) +++ trunk/src/paths.cpp 2014-05-08 09:18:27 UTC (rev 6540) @@ -221,8 +221,11 @@ const wxString mmex::getReportIndex() { - const wxString tempDir = wxString::Format("%s%smmex_reports%s", wxStandardPaths::Get().GetTempDir() - , wxString(wxFILE_SEP_PATH), wxString(wxFILE_SEP_PATH)); + const wxString tempDir = wxString::Format("%s%s%s%s" + , wxStandardPaths::Get().GetTempDir() //TODO: user dir more sequre + , wxString(wxFILE_SEP_PATH) + , mmex::GetAppName() + "_rep" + , wxString(wxFILE_SEP_PATH)); wxString index = wxString::Format("%sindex.html", tempDir); wxLogDebug("%s", index); return index; This was sent by MMEX an easy to use, money management application. |
From: <vo...@us...> - 2014-05-08 09:54:44
|
Revision: 6541 http://sourceforge.net/p/moneymanagerex/code/6541 Author: vomikan Date: 2014-05-08 09:54:41 +0000 (Thu, 08 May 2014) Log Message: ----------- wxRichToolTip for error values Modified Paths: -------------- trunk/src/assetdialog.cpp trunk/src/util.cpp trunk/src/util.h Modified: trunk/src/assetdialog.cpp =================================================================== --- trunk/src/assetdialog.cpp 2014-05-08 09:18:27 UTC (rev 6540) +++ trunk/src/assetdialog.cpp 2014-05-08 09:54:41 UTC (rev 6541) @@ -20,6 +20,7 @@ #include "paths.h" #include "constants.h" #include "validators.h" +#include "util.h" #include "model/Model_Asset.h" #include "model/Model_Attachment.h" #include "../resources/attachment.xpm" @@ -113,9 +114,11 @@ wxFlexGridSizer* itemFlexGridSizer6 = new wxFlexGridSizer(0, 2, 0, 0); itemPanel5->SetSizer(itemFlexGridSizer6); - itemFlexGridSizer6->Add(new wxStaticText( itemPanel5, wxID_STATIC, _("Name")), g_flags); + wxStaticText* n = new wxStaticText(itemPanel5, wxID_STATIC, _("Name")); + itemFlexGridSizer6->Add(n, g_flags); + n->SetFont(this->GetFont().Bold()); - m_assetName = new mmTextCtrl(itemPanel5, wxID_ANY, wxGetEmptyString(), wxDefaultPosition, wxDefaultSize, 0); + m_assetName = new mmTextCtrl(itemPanel5, wxID_ANY, wxGetEmptyString()); m_assetName->SetToolTip(_("Enter the name of the asset")); itemFlexGridSizer6->Add(m_assetName, g_flagsExpand); @@ -137,7 +140,9 @@ itemFlexGridSizer6->Add(m_assetType, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5); - itemFlexGridSizer6->Add(new wxStaticText(itemPanel5, wxID_STATIC, _("Value")), g_flags); + wxStaticText* v = new wxStaticText(itemPanel5, wxID_STATIC, _("Value")); + itemFlexGridSizer6->Add(v, g_flags); + v->SetFont(this->GetFont().Bold()); m_value = new mmTextCtrl(itemPanel5, IDC_VALUE, wxGetEmptyString() , wxDefaultPosition, wxSize(150,-1), wxALIGN_RIGHT|wxTE_PROCESS_ENTER @@ -221,29 +226,23 @@ void mmAssetDialog::OnOk(wxCommandEvent& /*event*/) { - double value; + const wxString name = m_assetName->GetValue().Trim(); + if (name.empty()){ + mmMessageNameInvalid(m_assetName); + return; + } + + double value = 0, valueChangeRate = 0; if (!m_value->checkValue(value)) { return; } int valueChangeType = m_valueChange->GetSelection(); - wxString valueChangeRateStr = m_valueChangeRate->GetValue().Trim(); - if (valueChangeRateStr.IsEmpty() && valueChangeType != Model_Asset::RATE_NONE) + if (valueChangeType != Model_Asset::RATE_NONE && !m_valueChangeRate->checkValue(valueChangeRate)) { - wxMessageBox(_("Rate of Change in Value"), _("Invalid Entry"), wxOK | wxICON_ERROR); return; } - double valueChangeRate = 0; - if (!wxNumberFormatter::FromString(valueChangeRateStr, &valueChangeRate) || valueChangeRate < 0) - { - if (valueChangeType != Model_Asset::RATE_NONE) - { - wxMessageBox(_("Invalid Value "), _("Invalid Entry"), wxOK | wxICON_ERROR); - return; - } - valueChangeRate = 0; - } wxString asset_type = ""; wxStringClientData* type_obj = (wxStringClientData *)m_assetType->GetClientObject(m_assetType->GetSelection()); @@ -253,7 +252,7 @@ m_asset->STARTDATE = m_dpc->GetValue().FormatISODate(); m_asset->NOTES = m_notes->GetValue().Trim(); - m_asset->ASSETNAME = m_assetName->GetValue().Trim(); + m_asset->ASSETNAME = name; m_asset->VALUE = value; m_asset->VALUECHANGE = Model_Asset::all_rate()[valueChangeType]; m_asset->VALUECHANGERATE = valueChangeRate; Modified: trunk/src/util.cpp =================================================================== --- trunk/src/util.cpp 2014-05-08 09:18:27 UTC (rev 6540) +++ trunk/src/util.cpp 2014-05-08 09:54:41 UTC (rev 6541) @@ -434,6 +434,16 @@ tip.ShowFor((wxWindow*)comboBox); } +void mmMessageNameInvalid(wxTextCtrl *textBox) +{ + const wxString errorHeader = _("Invalid Name"); + const wxString errorMessage = (_("Please type in a non empty name.") + + "\n"); + wxRichToolTip tip(errorHeader, errorMessage); + tip.SetIcon(wxICON_WARNING); + tip.ShowFor((wxWindow*) textBox); +} + // const wxString mmPlatformType() { Modified: trunk/src/util.h =================================================================== --- trunk/src/util.h 2014-05-08 09:18:27 UTC (rev 6540) +++ trunk/src/util.h 2014-05-08 09:54:41 UTC (rev 6541) @@ -113,6 +113,7 @@ void mmMessageCategoryInvalid(wxButton *button); void mmMessageAccountInvalid(wxComboBox *comboBox, bool transfer = false); void mmMessagePayeeInvalid(wxComboBox *comboBox); +void mmMessageNameInvalid(wxTextCtrl *textBox); const wxString mmSelectLanguage(wxWindow *parent, bool forced_show_dlg, bool save_setting = true); This was sent by MMEX an easy to use, money management application. |
From: <vo...@us...> - 2014-05-08 10:36:30
|
Revision: 6542 http://sourceforge.net/p/moneymanagerex/code/6542 Author: vomikan Date: 2014-05-08 10:36:25 +0000 (Thu, 08 May 2014) Log Message: ----------- cleanup Modified Paths: -------------- trunk/src/mmhomepagepanel.cpp trunk/src/mmhomepagepanel.h Modified: trunk/src/mmhomepagepanel.cpp =================================================================== --- trunk/src/mmhomepagepanel.cpp 2014-05-08 09:54:41 UTC (rev 6541) +++ trunk/src/mmhomepagepanel.cpp 2014-05-08 10:36:25 UTC (rev 6542) @@ -193,11 +193,11 @@ std::map<int, std::pair<double, double> > accountStats; get_account_stats(accountStats); - displayAccounts(tBalance, accountStats); + m_frames["ACCOUNTS_INFO"] = displayAccounts(tBalance, accountStats); if (Model_Account::hasActiveTermAccount()) { double termBalance = 0.0; - displayAccounts(termBalance, accountStats, Model_Account::TERM); + m_frames["TERM_ACCOUNTS_INFO"] = displayAccounts(termBalance, accountStats, Model_Account::TERM); tBalance += termBalance; } @@ -212,8 +212,8 @@ tBalance += stocks_widget.get_total(); m_frames["STOCKS_INFO"] = stocks; - displayAssets(tBalance); - displayGrandTotals(tBalance); + m_frames["ASSETS_INFO"] = displayAssets(tBalance); + m_frames["GRAND_TOTAL"] = displayGrandTotals(tBalance); // mmDateRange* date_range = new mmLast30Days(); @@ -301,14 +301,14 @@ } /* Accounts */ -void mmHomePagePanel::displayAccounts(double& tBalance, std::map<int, std::pair<double, double> > &accountStats, int type) +const wxString mmHomePagePanel::displayAccounts(double& tBalance, std::map<int, std::pair<double, double> > &accountStats, int type) { bool type_is_bank = type == Model_Account::CHECKING; double tReconciled = 0; wxString output = wxString::Format("<table class = \"table\" id = \"%s\">", (type_is_bank ? "ACCOUNTS_INFO" : "TERM_ACCOUNTS_INFO")); output += "<thead><tr><th>"; - output += _("Bank Account") + "</th><th>" + _("Reconciled") + "</th><th>" + _("Balance") + "</th></tr></thead>"; + output += (type_is_bank ? _("Bank Account") : _("Term Account")) + "</th><th>" + _("Reconciled") + "</th><th>" + _("Balance") + "</th></tr></thead>"; output += wxString::Format("<tbody id = \"%s\">", ""); wxString body = ""; for (const auto& account : Model_Account::instance().all(Model_Account::COL_ACCOUNTNAME)) @@ -348,7 +348,7 @@ output += "<td class =\"money, text-right\">" + wxString::Format("%f", tBalance) + "</td></tr></tfoot></table>"; if (body.empty()) output.clear(); - m_frames[(type_is_bank ? "ACCOUNTS_INFO" : "TERM_ACCOUNTS_INFO")] = output; + return output; } //* Income vs Expenses *// @@ -377,7 +377,7 @@ } //* Assets *// -void mmHomePagePanel::displayAssets(double& tBalance) +const wxString mmHomePagePanel::displayAssets(double& tBalance) { wxString output = ""; @@ -390,10 +390,10 @@ output += wxString::Format("<td class = \"money, text-right\">%f</td></tr>", asset_balance); output += "</tfoot></table>"; } - m_frames["ASSETS_INFO"] = output; + return output; } -wxString mmHomePagePanel::getStatWidget() +const wxString mmHomePagePanel::getStatWidget() { wxString output = "<table class = \"table\"><thead><tr>"; output += "<th>" + _("Transaction Statistics") + "</th><th></th><tbody>"; @@ -412,15 +412,15 @@ return output; } -void mmHomePagePanel::displayGrandTotals(double& tBalance) +const wxString mmHomePagePanel::displayGrandTotals(double& tBalance) { wxString output = "<table class = \"table\">"; // Display the grand total from all sections wxString tBalanceStr = Model_Currency::toCurrency(tBalance); - output += "<tfoot><tr class = \"total\"><td>" + _("Grand Total:") + "</td><td></td>"; + output += "<tfoot><tr class = \"success\" style = \"font-weight:bold\"><td>" + _("Grand Total:") + "</td><td></td>"; output += "<td class =\"text-right\">" + tBalanceStr + "</td>"; output += "</tr></tfoot></table>"; - m_frames["GRAND_TOTAL"] = output; + return output; } Modified: trunk/src/mmhomepagepanel.h =================================================================== --- trunk/src/mmhomepagepanel.h 2014-05-08 09:54:41 UTC (rev 6541) +++ trunk/src/mmhomepagepanel.h 2014-05-08 10:36:25 UTC (rev 6542) @@ -66,12 +66,12 @@ void getTemplate(); void getData(); void fillData(); - void displayAssets(double& tBalance); + const wxString displayAssets(double& tBalance); void displayIncomeVsExpenses(); - wxString getStatWidget(); - void displayGrandTotals(double& tBalance); + const wxString getStatWidget(); + const wxString displayGrandTotals(double& tBalance); - void displayAccounts(double& tBalance, std::map<int, std::pair<double, double> > &accountStats + const wxString displayAccounts(double& tBalance, std::map<int, std::pair<double, double> > &accountStats , int type = Model_Account::CHECKING); void get_account_stats(std::map<int, std::pair<double, double> > &accountStats); void getExpensesIncomeStats(std::map<int, std::pair<double, double> > &incomeExpensesStats This was sent by MMEX an easy to use, money management application. |
From: <vo...@us...> - 2014-05-08 22:31:36
|
Revision: 6545 http://sourceforge.net/p/moneymanagerex/code/6545 Author: vomikan Date: 2014-05-08 22:31:33 +0000 (Thu, 08 May 2014) Log Message: ----------- fixes Modified Paths: -------------- trunk/src/mmhomepagepanel.cpp trunk/src/reports/html_widget_bills_and_deposits.cpp Modified: trunk/src/mmhomepagepanel.cpp =================================================================== --- trunk/src/mmhomepagepanel.cpp 2014-05-08 21:24:02 UTC (rev 6544) +++ trunk/src/mmhomepagepanel.cpp 2014-05-08 22:31:33 UTC (rev 6545) @@ -284,7 +284,7 @@ { if (ignoreFuture) { - if (Model_Checking::TRANSDATE(pBankTransaction).IsLaterThan(wxDateTime::Today())) + if (Model_Checking::TRANSDATE(pBankTransaction).IsLaterThan(date_range->today())) continue; //skip future dated transactions } Modified: trunk/src/reports/html_widget_bills_and_deposits.cpp =================================================================== --- trunk/src/reports/html_widget_bills_and_deposits.cpp 2014-05-08 21:24:02 UTC (rev 6544) +++ trunk/src/reports/html_widget_bills_and_deposits.cpp 2014-05-08 22:31:33 UTC (rev 6545) @@ -109,19 +109,23 @@ const wxString id = "BILLS_AND_DEPOSITS"; wxString colorStr; - output = "<table class=\"table\"\n><thead><tr><th>"; - output += wxString::Format("<a href=\"billsdeposits:\">%s</a></th><th></th>", title_); - output += wxString::Format("<th class = \"text-right\">%i <a id=\"bils_label\" onclick=\"toggleBills(); \" href=\"#\">[-]</a></th></tr></thead>" + output = "<table class=\"table\"><thead><tr class='active'><th>"; + output += wxString::Format("<a href=\"billsdeposits:\">%s</a></th>\n<th></th>", title_); + output += wxString::Format("<th class='text-right'>%i <a id=\"bils_label\" onclick=\"toggleBills(); \" href=\"#\">[-]</a></th></tr>\n" , int(bd_days.size())); - output += wxString::Format("<tbody id = \"%s\">", id); + output += "</thead>"; + output += wxString::Format("<tbody id='%s'>", id); + output += wxString::Format("<tr style='background-color: #d8ebf0'><th>%s</th><th class='text-right'>%s</th><th class='text-right'>%s</th></tr>" + , _("Payee"), _("Amount"), _("Days")); + for (const auto& item : bd_days) { - output += wxString::Format("<tr %s\n>", std::get<0>(item) < 0 ? "class='danger'" : ""); + output += wxString::Format("<tr %s>\n", std::get<0>(item) < 0 ? "class='danger'" : ""); output += "<td>" + std::get<1>(item) +"</td>"; //payee output += wxString::Format("<td class = \"text-right\">%s</td>" , Model_Account::toCurrency(std::get<3>(item), std::get<4>(item))); - output += "<td class = 'text-right'>" + std::get<2>(item) + "</td></tr>"; + output += "<td class = 'text-right'>" + std::get<2>(item) + "</td></tr>\n"; } output += "</tbody></table>\n"; output += wxString::Format(FUNCTION, id); This was sent by MMEX an easy to use, money management application. |
From: <vo...@us...> - 2014-05-09 10:57:35
|
Revision: 6553 http://sourceforge.net/p/moneymanagerex/code/6553 Author: vomikan Date: 2014-05-09 10:57:30 +0000 (Fri, 09 May 2014) Log Message: ----------- cleanup Modified Paths: -------------- trunk/src/mmframe.cpp trunk/src/mmframe.h trunk/src/mmhomepagepanel.cpp trunk/src/mmhomepagepanel.h Modified: trunk/src/mmframe.cpp =================================================================== --- trunk/src/mmframe.cpp 2014-05-09 06:54:13 UTC (rev 6552) +++ trunk/src/mmframe.cpp 2014-05-09 10:57:30 UTC (rev 6553) @@ -224,7 +224,6 @@ , m_commit_callback_hook() , gotoAccountID_(-1) , gotoTransID_(-1) -, homePageAccountSelect_(false) , checkingAccountPage_(0) , activeCheckingAccountPage_(false) , budgetingPage_(0) @@ -287,14 +286,14 @@ // "commit" all changes made to wxAuiManager m_mgr.Update(); - // Show license agreement at first open - if (Model_Setting::instance().GetStringSetting("SENDUSAGESTATS", "") == "") - { - mmAboutDialog(this, 4).ShowModal(); - Model_Setting::instance().Set("SENDUSAGESTATS", "TRUE"); - } + // Show license agreement at first open + if (Model_Setting::instance().GetStringSetting("SENDUSAGESTATS", "") == "") + { + mmAboutDialog(this, 4).ShowModal(); + Model_Setting::instance().Set("SENDUSAGESTATS", "TRUE"); + } - //Show appstart + //Show appstart if (from_scratch || !dbpath.IsOk()) { menuEnableItems(false); @@ -337,7 +336,7 @@ void mmGUIFrame::cleanup() { - autoRepeatTransactionsTimer_.Stop(); + autoRepeatTransactionsTimer_.Stop(); delete recentFiles_; if (!fileName_.IsEmpty()) // Exiting before file is opened saveSettings(); @@ -425,10 +424,8 @@ if (accountItem.IsOk()) { // Set the NavTreeCtrl and prevent any event code being executed for now. - homePageAccountSelect_ = true; navTreeCtrl_->SelectItem(accountItem); processPendingEvents(); - homePageAccountSelect_ = false; accountNotFound = false; } } @@ -443,10 +440,8 @@ if (rootItem.IsOk()) { // Set the NavTreeCtrl and prevent any event code being executed for now. - homePageAccountSelect_ = true; navTreeCtrl_->SelectItem(rootItem); processPendingEvents(); - homePageAccountSelect_ = false; accountNotFound = false; } return accountNotFound; @@ -469,54 +464,54 @@ //---------------------------------------------------------------------------- void mmGUIFrame::OnAutoRepeatTransactionsTimer(wxTimerEvent& /*event*/) { - //WebApp check - if (mmWebApp::WebApp_CheckEnabled()) - { - if (mmWebApp::WebApp_CheckGuid() && mmWebApp::WebApp_CheckApiVersion()) - { - mmWebApp::WebApp_UpdateAccount(); - mmWebApp::WebApp_UpdatePayee(); - mmWebApp::WebApp_UpdateCategory(); - if (mmWebApp::WebApp_CheckNewTransaction()) - { - wxString msgStr = wxString() << _("New transactions found on web app") << "\n" << - _("Do you want to downlaod them?"); - int NewTransactionResponse = wxMessageBox(msgStr, _("Download WebApp new transaction"), wxYES_NO); - if (NewTransactionResponse == wxYES) - { - while (mmWebApp::WebApp_CheckNewTransaction()) - { - wxString NewTransactionJSON; - if (mmWebApp::WebApp_DownloadNewTransaction(NewTransactionJSON)) - { - int InsertedTransactionID = mmWebApp::MMEX_InsertNewTransaction(NewTransactionJSON); - if (InsertedTransactionID > 0) - { - mmTransDialog EditTransactionDialog(this, 1, InsertedTransactionID); - EditTransactionDialog.ShowModal(); - } - else - { - wxString msgStr = wxString() << _("Unable to insert transaction in MMEX database") << "\n"; - wxMessageBox(msgStr, _("WebApp communication error"), wxICON_ERROR); - } - } - else - { - wxString msgStr = wxString() << _("Unable to download new transaction from WebApp") << "\n"; - wxMessageBox(msgStr, _("WebApp communication error"), wxICON_ERROR); - } - } - } - else - { - //Response NO - } - } - } - } + //WebApp check + if (mmWebApp::WebApp_CheckEnabled()) + { + if (mmWebApp::WebApp_CheckGuid() && mmWebApp::WebApp_CheckApiVersion()) + { + mmWebApp::WebApp_UpdateAccount(); + mmWebApp::WebApp_UpdatePayee(); + mmWebApp::WebApp_UpdateCategory(); + if (mmWebApp::WebApp_CheckNewTransaction()) + { + wxString msgStr = wxString() << _("New transactions found on web app") << "\n" << + _("Do you want to downlaod them?"); + int NewTransactionResponse = wxMessageBox(msgStr, _("Download WebApp new transaction"), wxYES_NO); + if (NewTransactionResponse == wxYES) + { + while (mmWebApp::WebApp_CheckNewTransaction()) + { + wxString NewTransactionJSON; + if (mmWebApp::WebApp_DownloadNewTransaction(NewTransactionJSON)) + { + int InsertedTransactionID = mmWebApp::MMEX_InsertNewTransaction(NewTransactionJSON); + if (InsertedTransactionID > 0) + { + mmTransDialog EditTransactionDialog(this, 1, InsertedTransactionID); + EditTransactionDialog.ShowModal(); + } + else + { + wxString msgStr = wxString() << _("Unable to insert transaction in MMEX database") << "\n"; + wxMessageBox(msgStr, _("WebApp communication error"), wxICON_ERROR); + } + } + else + { + wxString msgStr = wxString() << _("Unable to download new transaction from WebApp") << "\n"; + wxMessageBox(msgStr, _("WebApp communication error"), wxICON_ERROR); + } + } + } + else + { + //Response NO + } + } + } + } - //Auto repeating transaction + //Auto repeating transaction bool continueExecution = false; Model_Billsdeposits& bills = Model_Billsdeposits::instance(); @@ -1454,19 +1449,12 @@ void mmGUIFrame::OnSelChanged(wxTreeEvent& event) { - //TODO: that may be not true anymore - /* Because Windows generates 2 events when selecting the navTree, and Linux - does not, we need to be able to control when the event is actually executed. - This ensures that only one event activates the account for all systems. */ - if (homePageAccountSelect_) return; - menuPrintingEnable(false); wxTreeItemId id = event.GetItem(); if (!id) return; mmTreeItemData* iData = dynamic_cast<mmTreeItemData*>(navTreeCtrl_->GetItemData(id)); selectedItemData_ = iData; - if (!iData) return; if (!iData->isStringData()) @@ -1498,26 +1486,12 @@ Model_Account::Data* account = Model_Account::instance().get(data); if (account) { - if (Model_Account::type(account) == Model_Account::CHECKING || Model_Account::type(account) == Model_Account::TERM) - { - gotoAccountID_ = data; - if (gotoAccountID_ != -1) createCheckingAccountPage(gotoAccountID_); - navTreeCtrl_->SetFocus(); - } + gotoAccountID_ = data; + if (Model_Account::type(account) != Model_Account::INVESTMENT) + createCheckingAccountPage(gotoAccountID_); else - { - json::Object o; - o["module"] = json::String("Stock Panel"); - o["start"] = json::String(wxDateTime::Now().FormatISOCombined().ToStdString()); - wxSizer *sizer = cleanupHomePanel(); - - panelCurrent_ = new mmStocksPanel(data, homePanel_, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); - sizer->Add(panelCurrent_, 1, wxGROW | wxALL, 1); - - homePanel_->Layout(); - o["end"] = json::String(wxDateTime::Now().FormatISOCombined().ToStdString()); - Model_Usage::instance().append(o); - } + createStocksAccountPage(gotoAccountID_); + navTreeCtrl_->SetFocus(); menuPrintingEnable(true); } else @@ -1587,14 +1561,14 @@ void mmGUIFrame::OnAccountAttachments(wxCommandEvent& /*event*/) { - if (selectedItemData_) - { - int RefId = selectedItemData_->getData(); - wxString RefType = Model_Attachment::reftype_desc(Model_Attachment::BANKACCOUNT); + if (selectedItemData_) + { + int RefId = selectedItemData_->getData(); + wxString RefType = Model_Attachment::reftype_desc(Model_Attachment::BANKACCOUNT); - mmAttachmentDialog dlg(this, RefType, RefId); - dlg.ShowModal(); - } + mmAttachmentDialog dlg(this, RefType, RefId); + dlg.ShowModal(); + } } //---------------------------------------------------------------------------- @@ -1633,7 +1607,7 @@ if (msgDlg.ShowModal() == wxID_YES) { Model_Account::instance().remove(account->ACCOUNTID); - mmAttachmentManage::DeleteAllAttachments(Model_Attachment::reftype_desc(Model_Attachment::BANKACCOUNT), account->ACCOUNTID); + mmAttachmentManage::DeleteAllAttachments(Model_Attachment::reftype_desc(Model_Attachment::BANKACCOUNT), account->ACCOUNTID); updateNavTreeControl(); wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, MENU_TREEPOPUP_ACCOUNT_LIST); OnAccountList(evt); @@ -1682,7 +1656,7 @@ // Enable menu item only if a website exists for the account. bool webStatus = !account->WEBSITE.IsEmpty(); menu.Enable(MENU_TREEPOPUP_LAUNCHWEBSITE, webStatus); - menu.Append(MENU_TREEPOPUP_ACCOUNTATTACHMENTS, _("&Organize Attachments")); + menu.Append(MENU_TREEPOPUP_ACCOUNTATTACHMENTS, _("&Organize Attachments")); PopupMenu(&menu, pt); } @@ -1811,18 +1785,24 @@ void mmGUIFrame::createHomePage() { - wxSizer *sizer = cleanupHomePanel(); - panelCurrent_ = new mmHomePagePanel( - homePanel_, - wxID_STATIC, - wxDefaultPosition, - wxDefaultSize, - wxNO_BORDER | wxTAB_TRAVERSAL); - - sizer->Add(panelCurrent_, 1, wxGROW | wxALL, 1); - + refreshRequested_ = true; + if (!activeHomePage_) { + wxSizer *sizer = cleanupHomePanel(); + panelCurrent_ = new mmHomePagePanel( + homePanel_, + wxID_STATIC, + wxDefaultPosition, + wxDefaultSize, + wxNO_BORDER | wxTAB_TRAVERSAL); + sizer->Add(panelCurrent_, 1, wxGROW | wxALL, 1); + activeHomePage_ = true; + } + else + { + //TODO: refresh html only + //panelCurrent_->BuildPage(); + } homePanel_->Layout(); - refreshRequested_ = false; } //---------------------------------------------------------------------------- @@ -2372,7 +2352,7 @@ fileName += ".mmb"; SetDatabaseFile(fileName, true); - Model_Setting::instance().Set("LASTFILENAME", fileName); + Model_Setting::instance().Set("LASTFILENAME", fileName); } //---------------------------------------------------------------------------- @@ -2564,7 +2544,7 @@ void mmGUIFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) { - wxLogDebug("OnQuit(wxCommandEvent& WXUNUSED(event)"); + wxLogDebug("OnQuit(wxCommandEvent& WXUNUSED(event)"); // this->Destroy(); Close(TRUE); } @@ -2624,9 +2604,7 @@ void mmGUIFrame::OnAccountList(wxCommandEvent& /*event*/) { createHomePage(); - homePageAccountSelect_ = true; navTreeCtrl_->SelectItem(navTreeCtrl_->GetRootItem()); - homePageAccountSelect_ = false; } //---------------------------------------------------------------------------- @@ -2689,7 +2667,7 @@ if (dlg.ShowModal() == wxID_OK) { gotoAccountID_ = dlg.getAccountID(); - gotoTransID_ = dlg.getTransactionID(); + gotoTransID_ = dlg.getTransactionID(); refreshRequested_ = true; Model_Account::Data * account = Model_Account::instance().get(gotoAccountID_); if (account) @@ -2819,7 +2797,7 @@ versionTokens.GetNextToken(); // ignore old counters page = versionTokens.GetNextToken(); // substrtute new counters - page = page.SubString(page.find(mmPlatformType()), 53); + page = page.SubString(page.find(mmPlatformType()), 53); wxString current_version = page; wxStringTokenizer mySysToken(page, ":"); mySysToken.GetNextToken().Trim(false).Trim(); // skip Operating System. Already accounted for. @@ -3021,10 +2999,10 @@ o["end"] = json::String(wxDateTime::Now().FormatISOCombined().ToStdString()); Model_Usage::instance().append(o); - if (gotoTransID_ > 0) - { - checkingAccountPage_->SetSelectedTransaction(gotoTransID_); - } + if (gotoTransID_ > 0) + { + checkingAccountPage_->SetSelectedTransaction(gotoTransID_); + } } void mmGUIFrame::createStocksAccountPage(int accountID) @@ -3153,7 +3131,7 @@ if (msgDlg.ShowModal() == wxID_YES) { Model_Account::instance().remove(acctID); - mmAttachmentManage::DeleteAllAttachments(Model_Attachment::reftype_desc(Model_Attachment::BANKACCOUNT), acctID); + mmAttachmentManage::DeleteAllAttachments(Model_Attachment::reftype_desc(Model_Attachment::BANKACCOUNT), acctID); } } updateNavTreeControl(); @@ -3367,11 +3345,11 @@ return; wxString file_name = recentFiles_->GetHistoryFile(fileNum); wxFileName file(file_name); - if (file.FileExists()) - { - SetDatabaseFile(file_name); - saveSettings(); - } + if (file.FileExists()) + { + SetDatabaseFile(file_name); + saveSettings(); + } else { wxMessageBox(wxString::Format(_("File %s not found"), file_name), _("Error"), wxOK | wxICON_ERROR); Modified: trunk/src/mmframe.h =================================================================== --- trunk/src/mmframe.h 2014-05-09 06:54:13 UTC (rev 6552) +++ trunk/src/mmframe.h 2014-05-09 10:57:30 UTC (rev 6553) @@ -124,7 +124,6 @@ int gotoAccountID_; int gotoTransID_; - bool homePageAccountSelect_; /* Cannot process home page recursively */ bool refreshRequested_; Modified: trunk/src/mmhomepagepanel.cpp =================================================================== --- trunk/src/mmhomepagepanel.cpp 2014-05-09 06:54:13 UTC (rev 6552) +++ trunk/src/mmhomepagepanel.cpp 2014-05-09 10:57:30 UTC (rev 6553) @@ -111,7 +111,7 @@ , browser_(0) { Create(parent, winid, pos, size, style, name); - frame_->setHomePageActive(); + frame_->setHomePageActive(false); frame_->menuPrintingEnable(true); } Modified: trunk/src/mmhomepagepanel.h =================================================================== --- trunk/src/mmhomepagepanel.h 2014-05-09 06:54:13 UTC (rev 6552) +++ trunk/src/mmhomepagepanel.h 2014-05-09 10:57:30 UTC (rev 6553) @@ -48,12 +48,11 @@ ~mmHomePagePanel(); - wxString GetHomePageText() const; - wxString BuildPage() const { return GetHomePageText(); } void PrintPage(); private: + wxString GetHomePageText() const; mmGUIFrame* frame_; wxWebView* browser_; mmDateRange* date_range_; This was sent by MMEX an easy to use, money management application. |
From: <vo...@us...> - 2014-05-09 17:22:29
|
Revision: 6556 http://sourceforge.net/p/moneymanagerex/code/6556 Author: vomikan Date: 2014-05-09 17:22:25 +0000 (Fri, 09 May 2014) Log Message: ----------- cleanup F1 for help page Modified Paths: -------------- trunk/src/mmframe.cpp trunk/src/mmframe.h trunk/src/mmhomepagepanel.cpp trunk/src/reports/html_widget_stocks.cpp Modified: trunk/src/mmframe.cpp =================================================================== --- trunk/src/mmframe.cpp 2014-05-09 15:41:13 UTC (rev 6555) +++ trunk/src/mmframe.cpp 2014-05-09 17:22:25 UTC (rev 6556) @@ -433,7 +433,7 @@ } //---------------------------------------------------------------------------- -bool mmGUIFrame::setNavTreeSection(wxString sectionName) +bool mmGUIFrame::setNavTreeSection(const wxString §ionName) { bool accountNotFound = true; wxTreeItemId rootItem = getTreeItemfor(navTreeCtrl_->GetRootItem(), sectionName); @@ -450,9 +450,10 @@ //---------------------------------------------------------------------------- void mmGUIFrame::setAccountNavTreeSection(const wxString& accountName) { - if (setAccountInSection(_("Bank Accounts"), accountName)) - if (setAccountInSection(_("Term Accounts"), accountName)) - setAccountInSection(_("Stocks"), accountName); + if (setAccountInSection(_("Bank Accounts"), accountName)) { + if (setAccountInSection(_("Term Accounts"), accountName)) + setAccountInSection(_("Stocks"), accountName); + } } //---------------------------------------------------------------------------- @@ -2056,7 +2057,7 @@ wxMenu *menuHelp = new wxMenu; wxMenuItem* menuItemHelp = new wxMenuItem(menuTools, wxID_HELP, - _("&Help\tCtrl-F1"), _("Show the Help file")); + _("&Help\tF1"), _("Show the Help file")); menuItemHelp->SetBitmap(wxBitmap(help_xpm)); menuHelp->Append(menuItemHelp); @@ -2147,7 +2148,7 @@ toolBar_->AddTool(wxID_NEW, _("New"), wxBitmap(new_transaction_xpm), _("New Transaction")); toolBar_->AddSeparator(); toolBar_->AddTool(wxID_ABOUT, _("&About..."), wxBitmap(about_xpm), _("Show about dialog")); - toolBar_->AddTool(wxID_HELP, _("&Help\tCtrl-F1"), wxBitmap(help_xpm), _("Show the Help file")); + toolBar_->AddTool(wxID_HELP, _("&Help\tF1"), wxBitmap(help_xpm), _("Show the Help file")); // after adding the buttons to the toolbar, must call Realize() to reflect changes toolBar_->Realize(); @@ -2744,6 +2745,7 @@ { helpFileIndex_ = mmex::HTML_INDEX; createHelpPage(); + setNavTreeSection(_("Help")); } //---------------------------------------------------------------------------- Modified: trunk/src/mmframe.h =================================================================== --- trunk/src/mmframe.h 2014-05-09 15:41:13 UTC (rev 6555) +++ trunk/src/mmframe.h 2014-05-09 17:22:25 UTC (rev 6556) @@ -105,7 +105,7 @@ } void setAccountNavTreeSection(const wxString& accountName); - bool setNavTreeSection( wxString sectionName); + bool setNavTreeSection(const wxString §ionName); void SetCheckingAccountPageInactive(); void SetBudgetingPageInactive(); void menuPrintingEnable(bool enable); Modified: trunk/src/mmhomepagepanel.cpp =================================================================== --- trunk/src/mmhomepagepanel.cpp 2014-05-09 15:41:13 UTC (rev 6555) +++ trunk/src/mmhomepagepanel.cpp 2014-05-09 17:22:25 UTC (rev 6556) @@ -53,19 +53,19 @@ { mmGUIFrame* frame = wxGetApp().m_frame; wxString sData; - if (uri.Upper().StartsWith("ASSETS", &sData)) + if (uri.StartsWith("assets:", &sData)) { frame->setNavTreeSection(_("Assets")); - wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, MENU_ASSETS); - frame->GetEventHandler()->AddPendingEvent(evt); + //wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, MENU_ASSETS); + //frame->GetEventHandler()->AddPendingEvent(evt); } - else if (uri.Upper().StartsWith("BILLSDEPOSITS", &sData)) + else if (uri.StartsWith("billsdeposits:", &sData)) { frame->setNavTreeSection(_("Repeating Transactions")); - wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, MENU_BILLSDEPOSITS); - frame->GetEventHandler()->AddPendingEvent(evt); + //wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, MENU_BILLSDEPOSITS); + //frame->GetEventHandler()->AddPendingEvent(evt); } - else if (uri.Upper().StartsWith("ACCT:", &sData)) + else if (uri.StartsWith("acct:", &sData)) { long id = -1; sData.ToLong(&id); @@ -73,11 +73,11 @@ if (account) { frame->setGotoAccountID(id); frame->setAccountNavTreeSection(account->ACCOUNTNAME); - wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, MENU_GOTOACCOUNT); - frame->GetEventHandler()->AddPendingEvent(evt); + //wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, MENU_GOTOACCOUNT); + //frame->GetEventHandler()->AddPendingEvent(evt); } } - else if (uri.Upper().StartsWith("STOCK:", &sData)) + else if (uri.StartsWith("stock:", &sData)) { long id = -1; sData.ToLong(&id); @@ -85,8 +85,8 @@ if (account) { frame->setGotoAccountID(id); frame->setAccountNavTreeSection(account->ACCOUNTNAME); - wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, MENU_STOCKS); - frame->GetEventHandler()->AddPendingEvent(evt); + //wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, MENU_STOCKS); + //frame->GetEventHandler()->AddPendingEvent(evt); } } @@ -156,10 +156,10 @@ browser_ = wxWebView::New(this, wxID_ANY); browser_->RegisterHandler(wxSharedPtr<wxWebViewHandler>(new wxWebViewFSHandler("memory"))); - browser_->RegisterHandler(wxSharedPtr<wxWebViewHandler>(new WebViewHandlerHomePage(this, "Assets"))); + browser_->RegisterHandler(wxSharedPtr<wxWebViewHandler>(new WebViewHandlerHomePage(this, "assets"))); browser_->RegisterHandler(wxSharedPtr<wxWebViewHandler>(new WebViewHandlerHomePage(this, "billsdeposits"))); - browser_->RegisterHandler(wxSharedPtr<wxWebViewHandler>(new WebViewHandlerHomePage(this, "ACCT"))); - browser_->RegisterHandler(wxSharedPtr<wxWebViewHandler>(new WebViewHandlerHomePage(this, "STOCK"))); + browser_->RegisterHandler(wxSharedPtr<wxWebViewHandler>(new WebViewHandlerHomePage(this, "acct"))); + browser_->RegisterHandler(wxSharedPtr<wxWebViewHandler>(new WebViewHandlerHomePage(this, "stock"))); itemBoxSizer2->Add(browser_, 1, wxGROW | wxALL, 0); } @@ -336,7 +336,7 @@ && ((type_is_bank) ? frame_->expandedBankAccounts() : frame_->expandedTermAccounts())) { body += "<tr>"; - body += wxString::Format("<td><a href=\"ACCT:%d\">%s</a></td>", account.ACCOUNTID, account.ACCOUNTNAME); + body += wxString::Format("<td><a href=\"acct:%i\">%s</a></td>", account.ACCOUNTID, account.ACCOUNTNAME); body += wxString::Format("<td class = \"text-right\">%s</td>", Model_Currency::toCurrency(reconciledBal, currency)); body += wxString::Format("<td class = \"text-right\">%s</td>", Model_Currency::toCurrency(bal, currency)); body += "</tr>\n"; Modified: trunk/src/reports/html_widget_stocks.cpp =================================================================== --- trunk/src/reports/html_widget_stocks.cpp 2014-05-09 15:41:13 UTC (rev 6555) +++ trunk/src/reports/html_widget_stocks.cpp 2014-05-09 17:22:25 UTC (rev 6556) @@ -55,7 +55,7 @@ if (Model_Account::type(account) != Model_Account::INVESTMENT) continue; if (Model_Account::status(account) != Model_Account::OPEN) continue; body += "<tr>"; - body += wxString::Format("<td><a href=\"STOCK:%d\">%s</a></td>" + body += wxString::Format("<td><a href=\"stock:%d\">%s</a></td>" , account.ACCOUNTID, account.ACCOUNTNAME); body += wxString::Format("<td class = \"text-right\">%s</td>" , Model_Account::toCurrency(stockStats[account.ACCOUNTID].first, &account)); This was sent by MMEX an easy to use, money management application. |
From: <vo...@us...> - 2014-05-09 21:06:39
|
Revision: 6557 http://sourceforge.net/p/moneymanagerex/code/6557 Author: vomikan Date: 2014-05-09 21:06:36 +0000 (Fri, 09 May 2014) Log Message: ----------- wxComboBox workaround for MAC AutoComplete tests Modified Paths: -------------- trunk/src/relocatepayeedialog.cpp trunk/src/relocatepayeedialog.h Added Paths: ----------- trunk/src/mmcombobox.h Added: trunk/src/mmcombobox.h =================================================================== --- trunk/src/mmcombobox.h (rev 0) +++ trunk/src/mmcombobox.h 2014-05-09 21:06:36 UTC (rev 6557) @@ -0,0 +1,98 @@ +/******************************************************* +Copyright (C) 2014 Nikolay + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +********************************************************/ + +#pragma once +#include "util.h" +#include <wx/textctrl.h> +#include <wx/combobox.h> +#include <wx/string.h> +#include "model/Model_Account.h" +#include "model/Model_Payee.h" +#include <wx/richtooltip.h> + + +class mmComboBox : public wxTextCtrl +{ +public: + using wxTextCtrl::Connect; + + mmComboBox() {} + mmComboBox(wxWindow *parent, wxWindowID id + , const wxString &value + , bool payee + , const wxPoint &pos = wxDefaultPosition + , const wxSize &size = wxDefaultSize + , long style = 0 + , const wxValidator &validator = wxDefaultValidator + , const wxString &name = wxTextCtrlNameStr) + : wxTextCtrl(parent, id, value, pos, size, style, validator, name) + , m_payee(payee) + { + if (m_payee) + this->AutoComplete(Model_Payee::instance().all_payee_names()); + else + this->AutoComplete(Model_Account::instance().all_checking_account_names()); + + } + wxString GetValue() const + { + return wxTextCtrl::GetValue(); + } + + void setSelection(int &id) + { + if (m_payee) { + for (const auto payee : Model_Payee::instance().all(Model_Payee::COL_PAYEENAME)) + if (payee.PAYEEID == id) this->ChangeValue(payee.PAYEENAME); + } + else + { + for (const auto acc : Model_Account::instance().all(Model_Account::COL_ACCOUNTNAME)) + if (acc.ACCOUNTID == id) this->ChangeValue(acc.ACCOUNTNAME); + } + } + + int getID() + { + int id = -1; + if (m_payee) { + Model_Payee::Data * p = Model_Payee::instance().get(this->GetValue()); + if (p) id = p->PAYEEID; + else { + const wxString errorHeader = _("Invalid Payee"); + const wxString errorMessage = (_("Please type in an exiting payee name,\nor make a selection using the dropdown button.") + + "\n"); + wxRichToolTip tip(errorHeader, errorMessage); + tip.SetIcon(wxICON_WARNING); + tip.ShowFor((wxWindow*) this); + this->SetFocus(); + } + } + else { + Model_Account::Data* a = Model_Account::instance().get(this->GetValue()); + if (a) id = a->ACCOUNTID; + else { + //TODO: + } + } + return id; + } + +private: + bool m_payee; +}; Modified: trunk/src/relocatepayeedialog.cpp =================================================================== --- trunk/src/relocatepayeedialog.cpp 2014-05-09 17:22:25 UTC (rev 6556) +++ trunk/src/relocatepayeedialog.cpp 2014-05-09 21:06:36 UTC (rev 6557) @@ -78,30 +78,15 @@ wxStaticLine* lineTop = new wxStaticLine(this,wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL); - cbSourcePayee_ = new wxComboBox(this, wxID_ANY, "" + cbSourcePayee_ = new mmComboBox(this, wxID_ANY, "" + , true //payee mode , wxDefaultPosition, btnSize); - for (const auto payee: Model_Payee::instance().all(Model_Payee::COL_PAYEENAME)) - { - //wxStringClientData* data = (wxStringClientData*)payee.PAYEEID; - cbSourcePayee_->Append(payee.PAYEENAME/*, data*/); - if (payee.PAYEEID == sourcePayeeID_) - cbSourcePayee_->SetStringSelection(payee.PAYEENAME); - } + cbSourcePayee_->setSelection(sourcePayeeID_); - cbSourcePayee_->AutoComplete(Model_Payee::instance().all_payee_names()); - cbSourcePayee_->Connect(wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED - , wxCommandEventHandler(relocatePayeeDialog::OnPayeeUpdated), nullptr, this); - cbDestPayee_ = new wxComboBox(this, wxID_NEW, "" - , wxDefaultPosition, btnSize); - for (const auto payee: Model_Payee::instance().all(Model_Payee::COL_PAYEENAME)) - { - //wxStringClientData* data = (wxStringClientData*)payee.PAYEEID; - cbDestPayee_->Append(payee.PAYEENAME/*, data*/); - } + , wxDefaultPosition, btnSize + , Model_Payee::instance().all_payee_names()); cbDestPayee_->AutoComplete(Model_Payee::instance().all_payee_names()); - cbDestPayee_->Connect(wxID_NEW, wxEVT_COMMAND_TEXT_UPDATED - , wxCommandEventHandler(relocatePayeeDialog::OnPayeeUpdated), nullptr, this); wxStaticLine* lineBottom = new wxStaticLine(this,wxID_STATIC , wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL); @@ -139,29 +124,28 @@ void relocatePayeeDialog::OnOk(wxCommandEvent& /*event*/) { - wxString destPayeeName, sourcePayeeName; - destPayeeName = cbDestPayee_->GetValue(); - sourcePayeeName = cbSourcePayee_->GetValue(); + const wxString destPayeeName = cbDestPayee_->GetValue(); + const wxString sourcePayeeName = cbSourcePayee_->GetValue(); Model_Payee::Data* dest_payee = Model_Payee::instance().get(destPayeeName); - Model_Payee::Data* source_payee = Model_Payee::instance().get(sourcePayeeName); + sourcePayeeID_ = cbSourcePayee_->getID(); - if ( dest_payee && source_payee ) + if (dest_payee && sourcePayeeID_ != -1) { wxString msgStr = _("Please Confirm:") ; msgStr << "\n\n"; msgStr << wxString::Format( _("Changing all payees of: %s \n\n to payee: %s"), sourcePayeeName, destPayeeName); - int ans = wxMessageBox(msgStr,_("Payee Relocation Confirmation"), wxOK|wxCANCEL|wxICON_QUESTION); + int ans = wxMessageBox(msgStr, _("Payee Relocation Confirmation"), wxOK | wxCANCEL | wxICON_QUESTION); if (ans == wxOK) { - auto transactions = Model_Checking::instance().find(Model_Checking::PAYEEID(source_payee->PAYEEID)); + auto transactions = Model_Checking::instance().find(Model_Checking::PAYEEID(sourcePayeeID_)); for (auto &entry : transactions) entry.PAYEEID = dest_payee->PAYEEID; changedRecords_ += Model_Checking::instance().save(transactions); - auto billsdeposits = Model_Billsdeposits::instance().find(Model_Billsdeposits::PAYEEID(source_payee->PAYEEID)); + auto billsdeposits = Model_Billsdeposits::instance().find(Model_Billsdeposits::PAYEEID(sourcePayeeID_)); for (auto &entry : billsdeposits) entry.PAYEEID = dest_payee->PAYEEID; changedRecords_ += Model_Billsdeposits::instance().save(billsdeposits); @@ -170,28 +154,3 @@ } } } - -void relocatePayeeDialog::OnPayeeUpdated(wxCommandEvent& event) -{ - wxWindow *w = FindFocus(); - bool source_payee = (w && w->GetId() == wxID_NEW); - - wxComboBox *cbPayeeInFocus = cbSourcePayee_; - if (source_payee) - cbPayeeInFocus = cbDestPayee_; - - wxString value = cbPayeeInFocus->GetValue(); - - //wxStringClientData* data_obj = (wxStringClientData *)cbPayeeInFocus->GetClientObject(cbPayeeInFocus->GetSelection()); - //if (data_obj) wxLogDebug("%s", data_obj->GetData()); - - Model_Payee::Data* payee = Model_Payee::instance().get(value); - if (payee) - { - if (source_payee) - sourcePayeeID_ = payee->PAYEEID; - else - destPayeeID_ = payee->PAYEEID; - } - event.Skip(); -} Modified: trunk/src/relocatepayeedialog.h =================================================================== --- trunk/src/relocatepayeedialog.h 2014-05-09 17:22:25 UTC (rev 6556) +++ trunk/src/relocatepayeedialog.h 2014-05-09 21:06:36 UTC (rev 6557) @@ -21,6 +21,7 @@ #define MM_EX_RELOCATEPAYEEDIALOG_H_ #include "defs.h" +#include "mmcombobox.h" class relocatePayeeDialog : public wxDialog { @@ -43,12 +44,11 @@ void CreateControls(); void OnOk(wxCommandEvent& event); - void OnPayeeUpdated(wxCommandEvent& event); int sourcePayeeID_; int destPayeeID_; - wxComboBox* cbSourcePayee_; + mmComboBox* cbSourcePayee_; wxComboBox* cbDestPayee_; int changedRecords_; wxString prev_value_; This was sent by MMEX an easy to use, money management application. |
From: <vo...@us...> - 2014-05-10 10:03:01
|
Revision: 6560 http://sourceforge.net/p/moneymanagerex/code/6560 Author: vomikan Date: 2014-05-10 10:02:55 +0000 (Sat, 10 May 2014) Log Message: ----------- styles cleanup Modified Paths: -------------- trunk/src/mmhomepagepanel.cpp trunk/src/reports/html_widget_top_categories.cpp Modified: trunk/src/mmhomepagepanel.cpp =================================================================== --- trunk/src/mmhomepagepanel.cpp 2014-05-10 06:26:16 UTC (rev 6559) +++ trunk/src/mmhomepagepanel.cpp 2014-05-10 10:02:55 UTC (rev 6560) @@ -377,10 +377,11 @@ //Type, Amount, Income, Expences, Difference:, Income/Expences, income, expemces static const wxString INCOME_VS_EXPENCES_HTML = "<table class = \"table\">\n" + "<thead><tr class='active'><th>%s</th><th></th></tr></thead>" "<tbody>\n" " <tr valign=\"center\">\n" " <td><canvas id=\"reportChart\" width=\"312\" height=\"256\"></canvas></td>\n" - " <td>\n" + " <td style='vertical-align:middle'>\n" " <table class= \"table\">\n" " <thead>\n" " <tr>" @@ -436,6 +437,7 @@ "</script>\n"; wxString output = wxString::Format(INCOME_VS_EXPENCES_HTML + , wxString::Format(_("Income vs Expenses: %s"), date_range_->title()) , _("Type"), _("Amount") , _("Income"), Model_Currency::toCurrency(tIncome) , _("Expences"), Model_Currency::toCurrency(tExpenses) @@ -464,7 +466,7 @@ const wxString mmHomePagePanel::getStatWidget() { - wxString output = "<table class = \"table\"><thead><tr>"; + wxString output = "<table class = \"table\"><thead><tr class = 'active'>"; output += "<th>" + _("Transaction Statistics") + "</th><th></th><tbody>"; if (this->countFollowUp_ > 0) Modified: trunk/src/reports/html_widget_top_categories.cpp =================================================================== --- trunk/src/reports/html_widget_top_categories.cpp 2014-05-10 06:26:16 UTC (rev 6559) +++ trunk/src/reports/html_widget_top_categories.cpp 2014-05-10 10:02:55 UTC (rev 6560) @@ -40,8 +40,10 @@ wxString htmlWidgetTop7Categories::getHTMLText() { - wxString output = "<table class = \"table\"><thead><tr><th>\n"; - output += _("Category") + "</th><th class='text-right'>" + _("Summary") + "</th></tr></thead><tbody>\n"; + wxString output = "<table class = \"table\"><thead><tr class='active'><th>\n"; + output += title_ + "</th><th></th></tr></thead>\n"; + output += "<tbody><tr style='background-color: #d8ebf0'><td>"; + output += _("Category") + "</td><td class='text-right'>" + _("Summary") + "</td></tr>"; std::vector<std::pair<wxString, double> > topCategoryStats; getTopCategoryStats(topCategoryStats, date_range_); This was sent by MMEX an easy to use, money management application. |
From: <vo...@us...> - 2014-05-10 15:41:06
|
Revision: 6563 http://sourceforge.net/p/moneymanagerex/code/6563 Author: vomikan Date: 2014-05-10 15:41:03 +0000 (Sat, 10 May 2014) Log Message: ----------- uri case fix Modified Paths: -------------- trunk/src/mmreportspanel.cpp trunk/src/reports/categexp.cpp trunk/src/reports/categovertimeperf.cpp trunk/src/reports/payee.cpp trunk/src/reports/transactions.cpp Modified: trunk/src/mmreportspanel.cpp =================================================================== --- trunk/src/mmreportspanel.cpp 2014-05-10 14:33:11 UTC (rev 6562) +++ trunk/src/mmreportspanel.cpp 2014-05-10 15:41:03 UTC (rev 6563) @@ -45,7 +45,7 @@ { mmGUIFrame* frame = wxGetApp().m_frame; wxString sData; - if (uri.Upper().StartsWith("TRXID:", &sData)) + if (uri.StartsWith("trxid:", &sData)) { long transID = -1; sData.ToLong(&transID); @@ -63,7 +63,7 @@ } } } - else if (uri.Upper().StartsWith("SORT:", &sData)) + else if (uri.StartsWith("sort:", &sData)) { long sortColumn = -1; sData.ToLong(&sortColumn); @@ -156,8 +156,8 @@ browser_ = wxWebView::New(this, wxID_ANY); browser_->RegisterHandler(wxSharedPtr<wxWebViewHandler>(new wxWebViewFSHandler("memory"))); - browser_->RegisterHandler(wxSharedPtr<wxWebViewHandler>(new WebViewHandlerReportsPage(this, "TRXID"))); - browser_->RegisterHandler(wxSharedPtr<wxWebViewHandler>(new WebViewHandlerReportsPage(this, "SORT"))); + browser_->RegisterHandler(wxSharedPtr<wxWebViewHandler>(new WebViewHandlerReportsPage(this, "trxid"))); + browser_->RegisterHandler(wxSharedPtr<wxWebViewHandler>(new WebViewHandlerReportsPage(this, "sort"))); itemBoxSizer2->Add(browser_, 1, wxGROW|wxALL, 1); } Modified: trunk/src/reports/categexp.cpp =================================================================== --- trunk/src/reports/categexp.cpp 2014-05-10 14:33:11 UTC (rev 6562) +++ trunk/src/reports/categexp.cpp 2014-05-10 15:41:03 UTC (rev 6563) @@ -160,12 +160,12 @@ if(CATEGORY_SORT_BY_NAME == sortColumn_) hb.addTableHeaderCell(_("Category")); else - hb.addTableHeaderCellLink(wxString::Format("SORT:%d", CATEGORY_SORT_BY_NAME), _("Category")); + hb.addTableHeaderCellLink(wxString::Format("sort:%d", CATEGORY_SORT_BY_NAME), _("Category")); if(CATEGORY_SORT_BY_AMOUNT == sortColumn_) hb.addTableHeaderCell(_("Amount"), true); else - hb.addTableHeaderCellLink(wxString::Format("SORT:%d", CATEGORY_SORT_BY_AMOUNT), _("Amount"), true); + hb.addTableHeaderCellLink(wxString::Format("sort:%d", CATEGORY_SORT_BY_AMOUNT), _("Amount"), true); hb.addTableHeaderCell(_("Total"), true); hb.endTableRow(); Modified: trunk/src/reports/categovertimeperf.cpp =================================================================== --- trunk/src/reports/categovertimeperf.cpp 2014-05-10 14:33:11 UTC (rev 6562) +++ trunk/src/reports/categovertimeperf.cpp 2014-05-10 15:41:03 UTC (rev 6563) @@ -148,7 +148,7 @@ if(CATEGORY_SORT_BY_NAME == sortColumn_) hb.addTableHeaderCell(_("Category")); else - hb.addTableHeaderCellLink(wxString::Format("SORT:%d", CATEGORY_SORT_BY_NAME), _("Category")); + hb.addTableHeaderCellLink(wxString::Format("sort:%d", CATEGORY_SORT_BY_NAME), _("Category")); wxDateTime start_date = date_range_->start_date(); for (int i = 0; i < MONTHS_IN_PERIOD; i++) { @@ -158,13 +158,13 @@ hb.addTableHeaderCell(wxGetTranslation(wxDateTime::GetEnglishMonthName(d.GetMonth(), wxDateTime::Name_Abbr)) + wxString::Format("<br>%i", d.GetYear())); else - hb.addTableHeaderCellLink(wxString::Format("SORT:%d", sort), + hb.addTableHeaderCellLink(wxString::Format("sort:%d", sort), wxGetTranslation(wxDateTime::GetEnglishMonthName(d.GetMonth(), wxDateTime::Name_Abbr)) + wxString::Format("<br>%i", d.GetYear())); } if(CATEGORY_SORT_BY_OVERALL == sortColumn_) hb.addTableHeaderCell(_("Overall")); else - hb.addTableHeaderCellLink(wxString::Format("SORT:%d", CATEGORY_SORT_BY_OVERALL), _("Overall")); + hb.addTableHeaderCellLink(wxString::Format("sort:%d", CATEGORY_SORT_BY_OVERALL), _("Overall")); hb.endTableRow(); //Begin of table Modified: trunk/src/reports/payee.cpp =================================================================== --- trunk/src/reports/payee.cpp 2014-05-10 14:33:11 UTC (rev 6562) +++ trunk/src/reports/payee.cpp 2014-05-10 15:41:03 UTC (rev 6563) @@ -140,19 +140,19 @@ if(PAYEE_SORT_BY_NAME == sortColumn_) hb.addTableHeaderCell(_("Payee")); else - hb.addTableHeaderCellLink(wxString::Format("SORT:%d", PAYEE_SORT_BY_NAME), _("Payee")); + hb.addTableHeaderCellLink(wxString::Format("sort:%d", PAYEE_SORT_BY_NAME), _("Payee")); if(PAYEE_SORT_BY_INCOME == sortColumn_) hb.addTableHeaderCell(_("Incomes"), true); else - hb.addTableHeaderCellLink(wxString::Format("SORT:%d", PAYEE_SORT_BY_INCOME), _("Incomes"), true); + hb.addTableHeaderCellLink(wxString::Format("sort:%d", PAYEE_SORT_BY_INCOME), _("Incomes"), true); if(PAYEE_SORT_BY_EXPENSE == sortColumn_) hb.addTableHeaderCell(_("Expences"), true); else - hb.addTableHeaderCellLink(wxString::Format("SORT:%d", PAYEE_SORT_BY_EXPENSE), _("Expences"), true); + hb.addTableHeaderCellLink(wxString::Format("sort:%d", PAYEE_SORT_BY_EXPENSE), _("Expences"), true); if(PAYEE_SORT_BY_DIFF == sortColumn_) hb.addTableHeaderCell(_("Difference"), true); else - hb.addTableHeaderCellLink(wxString::Format("SORT:%d", PAYEE_SORT_BY_DIFF), _("Difference"), true); + hb.addTableHeaderCellLink(wxString::Format("sort:%d", PAYEE_SORT_BY_DIFF), _("Difference"), true); hb.endTableRow(); for (const auto& entry : data_) Modified: trunk/src/reports/transactions.cpp =================================================================== --- trunk/src/reports/transactions.cpp 2014-05-10 14:33:11 UTC (rev 6562) +++ trunk/src/reports/transactions.cpp 2014-05-10 15:41:03 UTC (rev 6563) @@ -96,39 +96,39 @@ if(DATE == sortColumn_) hb.addTableHeaderCell(_("Date")); else - hb.addTableHeaderCellLink(wxString::Format("SORT:%d", DATE), _("Date")); + hb.addTableHeaderCellLink(wxString::Format("sort:%d", DATE), _("Date")); if(ACCOUNT == sortColumn_) hb.addTableHeaderCell(_("Account")); else - hb.addTableHeaderCellLink(wxString::Format("SORT:%d", ACCOUNT), _("Account")); + hb.addTableHeaderCellLink(wxString::Format("sort:%d", ACCOUNT), _("Account")); if(PAYEE == sortColumn_) hb.addTableHeaderCell(_("Payee")); else - hb.addTableHeaderCellLink(wxString::Format("SORT:%d", PAYEE), _("Payee")); + hb.addTableHeaderCellLink(wxString::Format("sort:%d", PAYEE), _("Payee")); if(STATUS == sortColumn_) hb.addTableHeaderCell(_("Status")); else - hb.addTableHeaderCellLink(wxString::Format("SORT:%d", STATUS), _("Status")); + hb.addTableHeaderCellLink(wxString::Format("sort:%d", STATUS), _("Status")); if(CATEGORY == sortColumn_) hb.addTableHeaderCell(_("Category")); else - hb.addTableHeaderCellLink(wxString::Format("SORT:%d", CATEGORY), _("Category")); + hb.addTableHeaderCellLink(wxString::Format("sort:%d", CATEGORY), _("Category")); if(TYPE == sortColumn_) hb.addTableHeaderCell(_("Type")); else - hb.addTableHeaderCellLink(wxString::Format("SORT:%d", TYPE), _("Type")); + hb.addTableHeaderCellLink(wxString::Format("sort:%d", TYPE), _("Type")); if(AMOUNT == sortColumn_) hb.addTableHeaderCell(_("Amount"), true); else - hb.addTableHeaderCellLink(wxString::Format("SORT:%d", AMOUNT), _("Amount"), true); + hb.addTableHeaderCellLink(wxString::Format("sort:%d", AMOUNT), _("Amount"), true); if(NUMBER == sortColumn_) hb.addTableHeaderCell(_("Number")); else - hb.addTableHeaderCellLink(wxString::Format("SORT:%d", NUMBER), _("Number")); + hb.addTableHeaderCellLink(wxString::Format("sort:%d", NUMBER), _("Number")); if(NOTE == sortColumn_) hb.addTableHeaderCell(_("Notes")); else - hb.addTableHeaderCellLink(wxString::Format("SORT:%d", NOTE), _("Notes")); + hb.addTableHeaderCellLink(wxString::Format("sort:%d", NOTE), _("Notes")); hb.endTableRow(); // Display the data for each row @@ -138,7 +138,7 @@ hb.startTableRow(); hb.addTableCell(mmGetDateForDisplay(mmGetStorageStringAsDate(transaction.TRANSDATE))); - hb.addTableCellLink(wxString::Format("TRXID:%d", transaction.TRANSID), transaction.ACCOUNTNAME); + hb.addTableCellLink(wxString::Format("trxid:%d", transaction.TRANSID), transaction.ACCOUNTNAME); hb.addTableCell(transaction.PAYEENAME); This was sent by MMEX an easy to use, money management application. |
From: <vo...@us...> - 2014-05-10 18:07:09
|
Revision: 6565 http://sourceforge.net/p/moneymanagerex/code/6565 Author: vomikan Date: 2014-05-10 18:07:03 +0000 (Sat, 10 May 2014) Log Message: ----------- fixes for get payee by id for transfer transactions Modified Paths: -------------- trunk/src/filtertransdialog.cpp trunk/src/filtertransdialog.h trunk/src/model/Model_Currency.cpp Modified: trunk/src/filtertransdialog.cpp =================================================================== --- trunk/src/filtertransdialog.cpp 2014-05-10 17:36:53 UTC (rev 6564) +++ trunk/src/filtertransdialog.cpp 2014-05-10 18:07:03 UTC (rev 6565) @@ -678,18 +678,32 @@ event.Skip(); } -bool mmFilterTransactionsDialog::checkPayee(int payeeID) +bool mmFilterTransactionsDialog::checkPayee(const Model_Checking::Data &tran) { - if (payeeCheckBox_->IsChecked()) + bool ok = Model_Checking::type(tran) != Model_Checking::TRANSFER; + if (ok && payeeCheckBox_->IsChecked()) { - const Model_Payee::Data* payee = Model_Payee::instance().get(payeeID); + const Model_Payee::Data* payee = Model_Payee::instance().get(tran.PAYEEID); if (payee) return cbPayee_->GetValue().Lower() == (payee->PAYEENAME).Lower(); return false; } - return true; + return ok; } +bool mmFilterTransactionsDialog::checkPayee(const Model_Billsdeposits::Data &tran) +{ + bool ok = Model_Billsdeposits::type(tran) != Model_Billsdeposits::TRANSFER; + if (ok && payeeCheckBox_->IsChecked()) + { + const Model_Payee::Data* payee = Model_Payee::instance().get(tran.PAYEEID); + if (payee) + return cbPayee_->GetValue().Lower() == (payee->PAYEENAME).Lower(); + return false; + } + return ok; +} + bool mmFilterTransactionsDialog::checkCategory(const Model_Checking::Data &tran) { if (categoryCheckBox_->IsChecked()) @@ -753,7 +767,7 @@ , getToDateControl().GetDateOnly() ) ) ok = false; - else if (!checkPayee(tran.PAYEEID)) ok = false; + else if (!checkPayee(tran)) ok = false; else if (!checkCategory(tran)) ok = false; else if (getStatusCheckBox() && !compareStatus(tran.STATUS)) ok = false; else if (getTypeCheckBox() && !allowType(tran.TRANSCODE, accountID == tran.ACCOUNTID)) ok = false; @@ -773,7 +787,7 @@ , getToDateControl().GetDateOnly() ) ) ok = false; - else if (!checkPayee(tran.PAYEEID)) ok = false; + else if (!checkPayee(tran)) ok = false; else if (!checkCategory(tran)) ok = false; else if (getStatusCheckBox() && !compareStatus(tran.STATUS)) ok = false; else if (getTypeCheckBox() && !allowType(tran.TRANSCODE, true)) ok = false; Modified: trunk/src/filtertransdialog.h =================================================================== --- trunk/src/filtertransdialog.h 2014-05-10 17:36:53 UTC (rev 6564) +++ trunk/src/filtertransdialog.h 2014-05-10 18:07:03 UTC (rev 6565) @@ -95,7 +95,8 @@ double getAmountMax(); double getAmountMin(); - bool checkPayee(int payeeID); + bool checkPayee(const Model_Checking::Data &tran); + bool checkPayee(const Model_Billsdeposits::Data &tran); bool checkCategory(const Model_Checking::Data &tran); bool checkCategory(const Model_Billsdeposits::Data &tran); Modified: trunk/src/model/Model_Currency.cpp =================================================================== --- trunk/src/model/Model_Currency.cpp 2014-05-10 17:36:53 UTC (rev 6564) +++ trunk/src/model/Model_Currency.cpp 2014-05-10 18:07:03 UTC (rev 6565) @@ -105,7 +105,7 @@ else if (!init_currencies_) { wxASSERT(false); //Base Currency ID is invalid - for (const auto c : Model_Currency::instance().all()) + for (const auto &c : Model_Currency::instance().all()) { //Get first available currency as base currency currency = Model_Currency::instance().get(c.CURRENCYID); This was sent by MMEX an easy to use, money management application. |
From: <vo...@us...> - 2014-05-10 21:02:29
|
Revision: 6566 http://sourceforge.net/p/moneymanagerex/code/6566 Author: vomikan Date: 2014-05-10 21:02:26 +0000 (Sat, 10 May 2014) Log Message: ----------- sort order chooser for Transaction Filter report Modified Paths: -------------- trunk/src/filtertransdialog.cpp trunk/src/filtertransdialog.h trunk/src/mmframe.cpp Modified: trunk/src/filtertransdialog.cpp =================================================================== --- trunk/src/filtertransdialog.cpp 2014-05-10 18:07:03 UTC (rev 6565) +++ trunk/src/filtertransdialog.cpp 2014-05-10 21:02:26 UTC (rev 6566) @@ -310,7 +310,28 @@ notesEdit_ = new wxTextCtrl( itemPanel, wxID_ANY); itemPanelSizer->Add(notesEdit_, g_flagsExpand); //--End of Row -------------------------------------------------------- + itemPanelSizer->Add(new wxStaticText(itemPanel, wxID_STATIC, _("Sort by")), g_flags); + wxArrayString sorterLabels; + sorterLabels.Add(wxTRANSLATE("Date")); + sorterLabels.Add(wxTRANSLATE("Account")); + sorterLabels.Add(wxTRANSLATE("Payee")); + sorterLabels.Add(wxTRANSLATE("Status")); + sorterLabels.Add(wxTRANSLATE("Category")); + sorterLabels.Add(wxTRANSLATE("Type")); + sorterLabels.Add(wxTRANSLATE("Amount")); + sorterLabels.Add(wxTRANSLATE("Number")); + sorterLabels.Add(wxTRANSLATE("Notes")); + sorterDropDown_ = new wxChoice(itemPanel + , wxID_ANY, wxDefaultPosition, wxSize(220, -1)); + for (const auto& item : sorterLabels) + { + sorterDropDown_->Append(wxGetTranslation(item), new wxStringClientData(item)); + } + sorterDropDown_->SetSelection(0); + itemPanelSizer->Add(sorterDropDown_, g_flagsExpand); + //--End of Row -------------------------------------------------------- + wxBoxSizer* settings_box_sizer = new wxBoxSizer(wxVERTICAL); m_settingLabel = new wxTextCtrl(this, wxID_INFO, ""); @@ -612,6 +633,7 @@ void mmFilterTransactionsDialog::clearSettings() { settings_string_.Clear(); + sorterDropDown_->SetSelection(0); dataToControls(); } void mmFilterTransactionsDialog::datePresetMenuSelected( wxCommandEvent& event ) @@ -906,6 +928,9 @@ if (!notes.empty()) o["NOTES"] = json::String(notes.ToStdString()); } + wxStringClientData* obj = (wxStringClientData *) sorterDropDown_->GetClientObject(sorterDropDown_->GetSelection()); + if (sorterDropDown_->GetSelection() && obj) o["SORTORDER"] = json::String(obj->GetData().ToStdString()); + std::stringstream ss; json::Writer::Write(o, ss); return ss.str(); @@ -922,6 +947,9 @@ //Label m_settingLabel->ChangeValue(wxString(json::String(o["LABEL"]))); + + //Sort order + sorterDropDown_->SetStringSelection(wxGetTranslation(wxString(json::String(o["SORTORDER"])))); //Account accountCheckBox_->SetValue(!wxString(json::String(o["ACCOUNT"])).empty()); Modified: trunk/src/filtertransdialog.h =================================================================== --- trunk/src/filtertransdialog.h 2014-05-10 18:07:03 UTC (rev 6565) +++ trunk/src/filtertransdialog.h 2014-05-10 21:02:26 UTC (rev 6566) @@ -67,6 +67,7 @@ bool getSimilarStatus() { return bSimilarCategoryStatus_; } int getCategId() { return categID_; } int getSubCategId() { return subcategID_; } + int getSortColumn() { return sorterDropDown_->GetSelection(); } private: void BuildPayeeList(); @@ -183,6 +184,7 @@ wxCheckBox* similarCategCheckBox_; wxCheckBox* statusCheckBox_; wxChoice* choiceStatus_; + wxChoice* sorterDropDown_; wxCheckBox* typeCheckBox_; wxCheckBox* cbTypeWithdrawal_; wxCheckBox* cbTypeDeposit_; Modified: trunk/src/mmframe.cpp =================================================================== --- trunk/src/mmframe.cpp 2014-05-10 18:07:03 UTC (rev 6565) +++ trunk/src/mmframe.cpp 2014-05-10 21:02:26 UTC (rev 6566) @@ -2695,6 +2695,7 @@ if (dlg->ShowModal() == wxID_OK) { mmReportTransactions* rs = new mmReportTransactions(dlg->getAccountID(), dlg); + rs->setSortColumn(dlg->getSortColumn()); createReportsPage(rs, true); } } This was sent by MMEX an easy to use, money management application. |
From: <gab...@us...> - 2014-05-11 10:08:43
|
Revision: 6568 http://sourceforge.net/p/moneymanagerex/code/6568 Author: gabriele-v Date: 2014-05-11 10:08:39 +0000 (Sun, 11 May 2014) Log Message: ----------- cleanup Modified Paths: -------------- trunk/src/attachmentdialog.cpp trunk/src/attachmentdialog.h Modified: trunk/src/attachmentdialog.cpp =================================================================== --- trunk/src/attachmentdialog.cpp 2014-05-11 09:19:01 UTC (rev 6567) +++ trunk/src/attachmentdialog.cpp 2014-05-11 10:08:39 UTC (rev 6568) @@ -54,7 +54,7 @@ do_create(parent); - wxString AttachmentsFolder = mmex::getPathAttachment(Model_Infotable::instance().GetStringInfo("ATTACHMENTSFOLDER:" + mmPlatformType(), "")); + wxString AttachmentsFolder = mmex::getPathAttachment(mmAttachmentManage::InfotablePathSetting()); if (AttachmentsFolder == wxEmptyString) { @@ -137,7 +137,7 @@ wxVector<wxVariant> data; if (debug_) data.push_back(wxVariant(wxString::Format("%i", attachmentID))); data.push_back(wxVariant(entry.DESCRIPTION)); - data.push_back(wxVariant(entry.REFTYPE + wxFileName::GetPathSeparator() + entry.FILENAME)); + data.push_back(wxVariant(entry.REFTYPE + m_PathSep + entry.FILENAME)); attachmentListBox_->AppendItem(data, (wxUIntPtr)attachmentID); if (m_selected_index == attachmentListBox_->GetItemCount() - 1) { @@ -174,21 +174,20 @@ if (attachmentFilePath.empty()) return; - wxFileName fn(attachmentFilePath); - const wxString attachmentFileName = fn.FileName(attachmentFilePath).GetName(); - const wxString attachmentFileExtension = fn.FileName(attachmentFilePath).GetExt().MakeLower(); + const wxString attachmentFileName = wxFileName(attachmentFilePath).GetName(); + const wxString attachmentFileExtension = wxFileName(attachmentFilePath).GetExt().MakeLower(); const wxString attachmentDescription = wxGetTextFromUser(_("Enter a description for the new attachment:") , _("Organize Attachments: Add Attachment"), attachmentFileName); - wxString AttachmentsFolder = mmex::getPathAttachment(Model_Infotable::instance().GetStringInfo("ATTACHMENTSFOLDER:" + mmPlatformType(), "")); + wxString AttachmentsFolder = mmex::getPathAttachment(mmAttachmentManage::InfotablePathSetting()); wxString attachmentNumberString = Model_Attachment::LastAttachmentFileName(m_RefType, m_RefId); attachmentNumberString = attachmentNumberString.SubString(attachmentNumberString.Find("Attach")+6, attachmentNumberString.Find(".")-1); int attachmentNumber = wxAtoi(attachmentNumberString); wxString importedFileName = m_RefType + "_" + wxString::Format("%i", m_RefId) + "_Attach" + wxString::Format("%i", attachmentNumber+1) + "." + attachmentFileExtension; - if (mmAttachmentManage::CopyAttachment(attachmentFilePath, AttachmentsFolder + wxFileName::GetPathSeparator() + m_RefType + wxFileName::GetPathSeparator() + importedFileName)) + if (mmAttachmentManage::CopyAttachment(attachmentFilePath, AttachmentsFolder + m_PathSep + m_RefType + m_PathSep + importedFileName)) { Model_Attachment::Data* NewAttachment = Model_Attachment::instance().create(); NewAttachment->REFTYPE = m_RefType; @@ -205,8 +204,8 @@ void mmAttachmentDialog::OpenAttachment() { Model_Attachment::Data *attachments = Model_Attachment::instance().get(m_attachment_id); - wxString attachmentFilePath = mmex::getPathAttachment(Model_Infotable::instance().GetStringInfo("ATTACHMENTSFOLDER:" + mmPlatformType(), "")) - + wxFileName::GetPathSeparator() + attachments->REFTYPE + wxFileName::GetPathSeparator() + attachments->FILENAME; + wxString attachmentFilePath = mmex::getPathAttachment(mmAttachmentManage::InfotablePathSetting()) + + m_PathSep + attachments->REFTYPE + m_PathSep + attachments->FILENAME; mmAttachmentManage::OpenAttachment(attachmentFilePath); } @@ -241,9 +240,8 @@ , wxYES_NO | wxNO_DEFAULT | wxICON_ERROR); if (DeleteResponse == wxYES) { - wxString AttachmentsFolder = mmex::getPathAttachment(Model_Infotable::instance().GetStringInfo("ATTACHMENTSFOLDER:" + mmPlatformType(), "")) - + wxFileName::GetPathSeparator() + attachments->REFTYPE; - if (mmAttachmentManage::DeleteAttachment(AttachmentsFolder + wxFileName::GetPathSeparator() + attachments->FILENAME)) + wxString AttachmentsFolder = mmex::getPathAttachment(mmAttachmentManage::InfotablePathSetting()) + m_PathSep + attachments->REFTYPE; + if (mmAttachmentManage::DeleteAttachment(AttachmentsFolder + m_PathSep + attachments->FILENAME)) { Model_Attachment::instance().remove(m_attachment_id); } @@ -284,7 +282,7 @@ mainMenu->Append(new wxMenuItem(mainMenu, MENU_DELETE_ATTACHMENT, _("&Remove "))); //Disable buttons - wxString AttachmentsFolder = mmex::getPathAttachment(Model_Infotable::instance().GetStringInfo("ATTACHMENTSFOLDER:" + mmPlatformType(), "")); + wxString AttachmentsFolder = mmex::getPathAttachment(mmAttachmentManage::InfotablePathSetting()); if (AttachmentsFolder == wxEmptyString || !wxDirExists(AttachmentsFolder)) mainMenu->Enable(MENU_NEW_ATTACHMENT, false); @@ -303,8 +301,8 @@ void mmAttachmentDialog::OnListItemActivated(wxDataViewEvent& event) { Model_Attachment::Data *attachments = Model_Attachment::instance().get(m_attachment_id); - wxString attachmentFilePath = mmex::getPathAttachment(Model_Infotable::instance().GetStringInfo("ATTACHMENTSFOLDER:" + mmPlatformType(), "")) - + wxFileName::GetPathSeparator() + attachments->REFTYPE + wxFileName::GetPathSeparator() + attachments->FILENAME; + wxString attachmentFilePath = mmex::getPathAttachment(mmAttachmentManage::InfotablePathSetting()) + + m_PathSep + attachments->REFTYPE + m_PathSep + attachments->FILENAME; mmAttachmentManage::OpenAttachment(attachmentFilePath); } @@ -323,14 +321,21 @@ /*********************** ** mmAttachmentManage ** ************************/ +wxString mmAttachmentManage::m_PathSep = wxFileName::GetPathSeparator(); + +wxString mmAttachmentManage::InfotablePathSetting() +{ + return Model_Infotable::instance().GetStringInfo("ATTACHMENTSFOLDER:" + mmPlatformType(), ""); +} + wxString mmAttachmentManage::GetAttachmentNoteSign() { - return "[U] "; + return wxString::Format("[%s] ",_("Att.")); } bool mmAttachmentManage::CreateReadmeFile(const wxString& FolderPath) { - wxString ReadmeFilePath = FolderPath + wxFileName::GetPathSeparator() + "readme.txt"; + wxString ReadmeFilePath = FolderPath + m_PathSep + "readme.txt"; wxString ReadmeText; ReadmeText << _("This directory and its files are automatically managed by Money Manager EX software.") << wxTextFile::GetEOL(); ReadmeText << wxTextFile::GetEOL(); @@ -401,8 +406,7 @@ { if (Model_Infotable::instance().GetBoolInfo("ATTACHMENTSTRASH", false)) { - wxString DeletedAttachmentFolder = mmex::getPathAttachment(Model_Infotable::instance().GetStringInfo("ATTACHMENTSFOLDER:" + mmPlatformType(), "")) - + wxFileName::GetPathSeparator() + "Deleted"; + wxString DeletedAttachmentFolder = mmex::getPathAttachment(mmAttachmentManage::InfotablePathSetting()) + m_PathSep + "Deleted"; if (!wxDirExists(DeletedAttachmentFolder)) { @@ -412,7 +416,7 @@ return false; } - wxString FileToTrash = DeletedAttachmentFolder + wxFileName::GetPathSeparator() + wxString FileToTrash = DeletedAttachmentFolder + m_PathSep + wxDateTime::Now().FormatISODate() + "_" + wxFileNameFromPath(FileToDelete); if (!wxRenameFile(FileToDelete, FileToTrash)) @@ -438,8 +442,7 @@ bool mmAttachmentManage::OpenAttachment(const wxString& FileToOpen) { - wxFileName fn(FileToOpen); - const wxString FileExtension = fn.FileName(FileToOpen).GetExt(); + const wxString FileExtension = wxFileName(FileToOpen).GetExt(); if (!wxFileExists(FileToOpen)) { @@ -472,12 +475,11 @@ bool mmAttachmentManage::DeleteAllAttachments(const wxString& RefType, const int& RefId) { Model_Attachment::Data_Set attachments = Model_Attachment::instance().FilterAttachments(RefType, RefId); - wxString AttachmentsFolder = mmex::getPathAttachment(Model_Infotable::instance().GetStringInfo("ATTACHMENTSFOLDER:" + mmPlatformType(), "")) - + wxFileName::GetPathSeparator() + RefType; + wxString AttachmentsFolder = mmex::getPathAttachment(mmAttachmentManage::InfotablePathSetting()) + m_PathSep + RefType; for (const auto &entry : attachments) { - mmAttachmentManage::DeleteAttachment(AttachmentsFolder + wxFileName::GetPathSeparator() + entry.FILENAME); + mmAttachmentManage::DeleteAttachment(AttachmentsFolder + m_PathSep + entry.FILENAME); Model_Attachment::instance().remove(entry.ATTACHMENTID); } return true; @@ -486,8 +488,7 @@ bool mmAttachmentManage::RelocateAllAttachments(const wxString& RefType, const int& OldRefId, const int& NewRefId) { auto attachments = Model_Attachment::instance().find(Model_Attachment::DB_Table_ATTACHMENT_V1::REFTYPE(RefType), Model_Attachment::REFID(OldRefId)); - wxString AttachmentsFolder = mmex::getPathAttachment(Model_Infotable::instance().GetStringInfo("ATTACHMENTSFOLDER:" + mmPlatformType(), "")) - + wxFileName::GetPathSeparator() + RefType + wxFileName::GetPathSeparator(); + wxString AttachmentsFolder = mmex::getPathAttachment(mmAttachmentManage::InfotablePathSetting()) + m_PathSep + RefType + m_PathSep; for (auto &entry : attachments) { @@ -508,8 +509,8 @@ if (AttachmentsNr == 1) { Model_Attachment::Data_Set attachments = Model_Attachment::instance().FilterAttachments(RefType, RefId); - wxString attachmentFilePath = mmex::getPathAttachment(Model_Infotable::instance().GetStringInfo("ATTACHMENTSFOLDER:" + mmPlatformType(), "")) - + wxFileName::GetPathSeparator() + attachments[0].REFTYPE + wxFileName::GetPathSeparator() + attachments[0].FILENAME; + wxString attachmentFilePath = mmex::getPathAttachment(mmAttachmentManage::InfotablePathSetting()) + + m_PathSep + attachments[0].REFTYPE + m_PathSep + attachments[0].FILENAME; mmAttachmentManage::OpenAttachment(attachmentFilePath); } else Modified: trunk/src/attachmentdialog.h =================================================================== --- trunk/src/attachmentdialog.h 2014-05-11 09:19:01 UTC (rev 6567) +++ trunk/src/attachmentdialog.h 2014-05-11 10:08:39 UTC (rev 6568) @@ -54,6 +54,8 @@ std::map<int, wxString> ColName_; wxButton* btnCancel_; wxButton* button_OK_; + wxString m_PathSep = wxFileName::GetPathSeparator(); + wxString m_RefType; int m_RefId; @@ -81,6 +83,7 @@ class mmAttachmentManage { public: + static wxString InfotablePathSetting(); static wxString GetAttachmentNoteSign(); static bool CreateReadmeFile(const wxString& FolderPath); static bool CopyAttachment(const wxString& FileToImport, const wxString& ImportedFile); @@ -89,6 +92,8 @@ static bool DeleteAllAttachments(const wxString& RefType, const int& RefId); static bool RelocateAllAttachments(const wxString& RefType, const int& OldRefId, const int& NewRefId); static void OpenAttachmentFromPanelIcon(wxWindow* parent, const wxString& RefType, const int& RefId); +private: + static wxString m_PathSep; }; #endif // MM_EX_ATTACHMENTDIALOG_H_ This was sent by MMEX an easy to use, money management application. |
From: <gua...@us...> - 2014-05-12 05:22:05
|
Revision: 6572 http://sourceforge.net/p/moneymanagerex/code/6572 Author: guanlisheng Date: 2014-05-12 05:21:59 +0000 (Mon, 12 May 2014) Log Message: ----------- improve symbol Modified Paths: -------------- trunk/src/filtertransdialog.h trunk/src/optionsdialog.h Modified: trunk/src/filtertransdialog.h =================================================================== --- trunk/src/filtertransdialog.h 2014-05-12 05:14:38 UTC (rev 6571) +++ trunk/src/filtertransdialog.h 2014-05-12 05:21:59 UTC (rev 6572) @@ -16,8 +16,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ********************************************************/ -#ifndef _FILTERTRANSDIALOG_H_ -#define _FILTERTRANSDIALOG_H_ +#ifndef FILTERTRANSDIALOG_H_ +#define FILTERTRANSDIALOG_H_ #if defined(__GNUG__) && !defined(__APPLE__) #pragma interface "filtertransdialog.cpp" @@ -210,4 +210,4 @@ }; #endif -// _FILTERTRANSDIALOG_H_ +// FILTERTRANSDIALOG_H_ Modified: trunk/src/optionsdialog.h =================================================================== --- trunk/src/optionsdialog.h 2014-05-12 05:14:38 UTC (rev 6571) +++ trunk/src/optionsdialog.h 2014-05-12 05:21:59 UTC (rev 6572) @@ -177,8 +177,8 @@ ID_DIALOG_OPTIONS_BUTTON_ATTACHMENTSFOLDER, ID_DIALOG_OPTIONS_STATICTEXT_ATTACHMENTSTEXT, ID_DIALOG_OPTIONS_CHECKBOX_ATTACHMENTSSUBFOLDER, - ID_DIALOG_OPTIONS_ENABLEWEB_SERVER, - ID_DIALOG_OPTIONSWEB_SERVER_PORT, + ID_DIALOG_OPTIONS_ENABLE_WEB_SERVER, + ID_DIALOG_OPTIONS_WEB_SERVER_PORT, ID_DIALOG_OPTIONS_ALLOW_SEND_USAGE }; }; This was sent by MMEX an easy to use, money management application. |
From: <gua...@us...> - 2014-05-14 01:03:15
|
Revision: 6577 http://sourceforge.net/p/moneymanagerex/code/6577 Author: guanlisheng Date: 2014-05-14 01:03:09 +0000 (Wed, 14 May 2014) Log Message: ----------- more hook for future search index Modified Paths: -------------- trunk/src/mmHook.h trunk/src/mmframe.cpp trunk/src/mmframe.h Modified: trunk/src/mmHook.h =================================================================== --- trunk/src/mmHook.h 2014-05-13 14:32:26 UTC (rev 6576) +++ trunk/src/mmHook.h 2014-05-14 01:03:09 UTC (rev 6577) @@ -15,6 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ********************************************************/ +#pragma once #include "mmOption.h" class CommitCallbackHook : public wxSQLite3Hook @@ -26,3 +27,29 @@ return false; } }; + +class UpdateCallbackHook : public wxSQLite3Hook +{ +public: + virtual void UpdateCallback (wxUpdateType type, const wxString& database, const wxString& table, wxLongLong rowid) + { + switch (type) + { + case SQLITE_DELETE: + wxLogDebug("SQLITE_DELETE"); + break; + case SQLITE_INSERT: + wxLogDebug("SQLITE_INSERT"); + break; + case SQLITE_UPDATE: + wxLogDebug("SQLITE_UPDATE"); + break; + default: + wxLogDebug("UNKNOWN type"); + break; + } + wxLogDebug("database: %s, table: %s, rowid: %lld", database, table, rowid); + + // TODO sync search index from full text search + } +}; Modified: trunk/src/mmframe.cpp =================================================================== --- trunk/src/mmframe.cpp 2014-05-13 14:32:26 UTC (rev 6576) +++ trunk/src/mmframe.cpp 2014-05-14 01:03:09 UTC (rev 6577) @@ -221,7 +221,8 @@ , const wxPoint& pos , const wxSize& size) : wxFrame(0, -1, title, pos, size) -, m_commit_callback_hook() +, m_commit_callback_hook(0) +, m_update_callback_hook(0) , gotoAccountID_(-1) , gotoTransID_(-1) , checkingAccountPage_(0) @@ -362,6 +363,7 @@ m_db->SetCommitHook(nullptr); m_db->Close(); delete m_commit_callback_hook; + delete m_update_callback_hook; m_db.reset(); } @@ -2219,6 +2221,8 @@ m_commit_callback_hook = new CommitCallbackHook(); m_db->SetCommitHook(m_commit_callback_hook); + m_update_callback_hook = new UpdateCallbackHook(); + m_db->SetUpdateHook(m_update_callback_hook); InitializeModelTables(); // we need to check the db whether it is the right version @@ -2245,6 +2249,8 @@ m_db = mmDBWrapper::Open(fileName, password); m_commit_callback_hook = new CommitCallbackHook(); m_db->SetCommitHook(m_commit_callback_hook); + m_update_callback_hook = new UpdateCallbackHook(); + m_db->SetUpdateHook(m_update_callback_hook); password_ = password; InitializeModelTables(); Modified: trunk/src/mmframe.h =================================================================== --- trunk/src/mmframe.h 2014-05-13 14:32:26 UTC (rev 6576) +++ trunk/src/mmframe.h 2014-05-14 01:03:09 UTC (rev 6577) @@ -54,6 +54,7 @@ class mmBudgetingPanel; class mmFileHistory; class CommitCallbackHook; +class UpdateCallbackHook; class ModelBase; //---------------------------------------------------------------------------- @@ -277,6 +278,7 @@ // Required to prevent memory leaks. CommitCallbackHook* m_commit_callback_hook; + UpdateCallbackHook* m_update_callback_hook; void ShutdownDatabase(); // any class wishing to process wxWindows events must use this macro This was sent by MMEX an easy to use, money management application. |
From: <gua...@us...> - 2014-05-14 02:20:41
|
Revision: 6578 http://sourceforge.net/p/moneymanagerex/code/6578 Author: guanlisheng Date: 2014-05-14 02:20:37 +0000 (Wed, 14 May 2014) Log Message: ----------- search sketch Modified Paths: -------------- trunk/src/mmframe.cpp Added Paths: ----------- trunk/src/search/Search.h Modified: trunk/src/mmframe.cpp =================================================================== --- trunk/src/mmframe.cpp 2014-05-14 01:03:09 UTC (rev 6577) +++ trunk/src/mmframe.cpp 2014-05-14 02:20:37 UTC (rev 6578) @@ -81,6 +81,7 @@ #include "model/Model_Report.h" #include "model/Model_Attachment.h" #include "model/Model_Usage.h" +#include "search/Search.h" #include "transdialog.h" #include "webapp.h" #include "wizard_newdb.h" Added: trunk/src/search/Search.h =================================================================== --- trunk/src/search/Search.h (rev 0) +++ trunk/src/search/Search.h 2014-05-14 02:20:37 UTC (rev 6578) @@ -0,0 +1,82 @@ +/******************************************************* + Copyright (C) 2014 Guan Lisheng (gua...@gm...) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + ********************************************************/ +#pragma once +#include "db/DB_Table.h" + +class SearchBase +{ +public: + SearchBase() {}; + SearchBase(wxSQLite3Database* db, const wxString& table): db_(db), table_(table) {}; + ~SearchBase() {}; + +protected: + wxSQLite3Database* db_; + wxString table_; + +public: + virtual wxString name() const { return this->table_; }; + // http://www.sqlite.org/fts3.html#section_3 + virtual json::Array search(const wxString& query) + { + wxString sql = wxString::Format("SELECT * FROM %s WHERE %s MATCH ?", this->name(), this->name());; + json::Array a; + try + { + wxSQLite3Statement stmt = db_->PrepareStatement(sql); + stmt.Bind(1, query); + + wxSQLite3ResultSet q = stmt.ExecuteQuery(); + while (q.NextRow()) + { + json::Object o; + for (int i = 0; i < q.GetColumnCount(); ++i) + { + int column_type = q.GetColumnType(i); + std::string column_name = q.GetColumnName(i).ToStdString(); + switch (column_type) + { + case WXSQLITE_INTEGER: + o[column_name] = json::Number(q.GetInt(i)); + break; + case WXSQLITE_FLOAT: + o[column_name] = json::Number(q.GetDouble(i)); + break; + case WXSQLITE_TEXT: + o[column_name] = json::String(q.GetString(i).ToStdString()); + break; + case WXSQLITE_BLOB: + o[column_name] = json::String(q.GetString(i).ToStdString()); + break; + case WXSQLITE_NULL: + defaut: + break; + } + } + a.Insert(o); + } + q.Finalize(); + } + catch (const wxSQLite3Exception& e) + { + wxLogError("%s: Exception %s", this->name(), e.GetMessage()); + } + + return a; + } +}; This was sent by MMEX an easy to use, money management application. |
From: <ste...@us...> - 2014-05-15 11:31:51
|
Revision: 6584 http://sourceforge.net/p/moneymanagerex/code/6584 Author: stef145g Date: 2014-05-15 11:31:48 +0000 (Thu, 15 May 2014) Log Message: ----------- Fix: Tests - Build selection. Modified Paths: -------------- trunk/src/search/Search.h trunk/src/tests/defined_test_selection.h trunk/src/tests/test_about_dialog.cpp trunk/src/tests/test_assets.cpp trunk/src/tests/test_billsdeposits.cpp trunk/src/tests/test_callback_hooks.cpp trunk/src/tests/test_checking.cpp trunk/src/tests/test_currency.cpp trunk/src/tests/test_database_initialisation.cpp trunk/src/tests/test_date_range.cpp trunk/src/tests/test_filtertrans_dialog.cpp trunk/src/tests/test_relocate_category.cpp trunk/src/tests/test_relocate_payee.cpp trunk/src/tests/test_stocks.cpp Modified: trunk/src/search/Search.h =================================================================== --- trunk/src/search/Search.h 2014-05-14 12:41:53 UTC (rev 6583) +++ trunk/src/search/Search.h 2014-05-15 11:31:48 UTC (rev 6584) @@ -64,7 +64,7 @@ o[column_name] = json::String(q.GetString(i).ToStdString()); break; case WXSQLITE_NULL: - defaut: + default: break; } } Modified: trunk/src/tests/defined_test_selection.h =================================================================== --- trunk/src/tests/defined_test_selection.h 2014-05-14 12:41:53 UTC (rev 6583) +++ trunk/src/tests/defined_test_selection.h 2014-05-15 11:31:48 UTC (rev 6584) @@ -10,14 +10,14 @@ ******************************************************************************/ #define MMEX_TESTS_ABOUT_DIALOG -//#define MMEX_TESTS_ASSETS -//#define MMEX_TESTS_BILLS_DEPOSITS -//#define MMEX_TESTS_CALLBACK_HOOKS -//#define MMEX_TESTS_CHECKING -//#define MMEX_TESTS_CURRENCY -//#define MMEX_TESTS_FILTER_TRANS_DIALOG -//#define MMEX_TESTS_RELOCATE_CATEGORY -//#define MMEX_TESTS_RELOCATE_PAYEE +#define MMEX_TESTS_ASSETS +#define MMEX_TESTS_BILLS_DEPOSITS +#define MMEX_TESTS_CALLBACK_HOOKS +#define MMEX_TESTS_CHECKING +#define MMEX_TESTS_CURRENCY +#define MMEX_TESTS_FILTER_TRANS_DIALOG +#define MMEX_TESTS_RELOCATE_CATEGORY +#define MMEX_TESTS_RELOCATE_PAYEE #define MMEX_TESTS_STOCKS #define MMEX_TESTS_TEST_DATABASE_INITIALISATION #define MMEX_TESTS_TEST_DATE_RANGE Modified: trunk/src/tests/test_about_dialog.cpp =================================================================== --- trunk/src/tests/test_about_dialog.cpp 2014-05-14 12:41:53 UTC (rev 6583) +++ trunk/src/tests/test_about_dialog.cpp 2014-05-15 11:31:48 UTC (rev 6584) @@ -30,7 +30,7 @@ *****************************************************************************/ #include "defined_test_selection.h" -#ifdef __MMEX_TESTS__ABOUT_DIALOG +#ifdef MMEX_TESTS_ABOUT_DIALOG // Registers the fixture into the 'registry' CPPUNIT_TEST_SUITE_REGISTRATION( Test_About_Dialog ); #endif Modified: trunk/src/tests/test_assets.cpp =================================================================== --- trunk/src/tests/test_assets.cpp 2014-05-14 12:41:53 UTC (rev 6583) +++ trunk/src/tests/test_assets.cpp 2014-05-15 11:31:48 UTC (rev 6584) @@ -31,7 +31,7 @@ *****************************************************************************/ #include "defined_test_selection.h" -#ifdef __MMEX_TESTS__ASSETS +#ifdef MMEX_TESTS_ASSETS // Registers the fixture into the 'registry' CPPUNIT_TEST_SUITE_REGISTRATION(Test_Asset); #endif Modified: trunk/src/tests/test_billsdeposits.cpp =================================================================== --- trunk/src/tests/test_billsdeposits.cpp 2014-05-14 12:41:53 UTC (rev 6583) +++ trunk/src/tests/test_billsdeposits.cpp 2014-05-15 11:31:48 UTC (rev 6584) @@ -35,7 +35,7 @@ *****************************************************************************/ #include "defined_test_selection.h" -#ifdef __MMEX_TESTS__BILLS_DEPOSITS +#ifdef MMEX_TESTS_BILLS_DEPOSITS // Registers the fixture into the 'registry' CPPUNIT_TEST_SUITE_REGISTRATION(Test_BillsDeposits); #endif Modified: trunk/src/tests/test_callback_hooks.cpp =================================================================== --- trunk/src/tests/test_callback_hooks.cpp 2014-05-14 12:41:53 UTC (rev 6583) +++ trunk/src/tests/test_callback_hooks.cpp 2014-05-15 11:31:48 UTC (rev 6584) @@ -31,7 +31,7 @@ *****************************************************************************/ #include "defined_test_selection.h" -#ifdef __MMEX_TESTS__CALLBACK_HOOKS +#ifdef MMEX_TESTS_CALLBACK_HOOKS // Registers the fixture into the 'registry' CPPUNIT_TEST_SUITE_REGISTRATION(Test_Callback_Hooks); #endif Modified: trunk/src/tests/test_checking.cpp =================================================================== --- trunk/src/tests/test_checking.cpp 2014-05-14 12:41:53 UTC (rev 6583) +++ trunk/src/tests/test_checking.cpp 2014-05-15 11:31:48 UTC (rev 6584) @@ -32,7 +32,7 @@ *****************************************************************************/ #include "defined_test_selection.h" -#ifdef __MMEX_TESTS__CHECKING +#ifdef MMEX_TESTS_CHECKING // Registers the fixture into the 'registry' CPPUNIT_TEST_SUITE_REGISTRATION(Test_Checking); #endif Modified: trunk/src/tests/test_currency.cpp =================================================================== --- trunk/src/tests/test_currency.cpp 2014-05-14 12:41:53 UTC (rev 6583) +++ trunk/src/tests/test_currency.cpp 2014-05-15 11:31:48 UTC (rev 6584) @@ -29,7 +29,7 @@ *****************************************************************************/ #include "defined_test_selection.h" -#ifdef __MMEX_TESTS__CURRENCY +#ifdef MMEX_TESTS_CURRENCY // Registers the fixture into the 'registry' CPPUNIT_TEST_SUITE_REGISTRATION(Test_Currency); #endif Modified: trunk/src/tests/test_database_initialisation.cpp =================================================================== --- trunk/src/tests/test_database_initialisation.cpp 2014-05-14 12:41:53 UTC (rev 6583) +++ trunk/src/tests/test_database_initialisation.cpp 2014-05-15 11:31:48 UTC (rev 6584) @@ -31,7 +31,7 @@ *****************************************************************************/ #include "defined_test_selection.h" -#ifdef __MMEX_TESTS__TEST_DATABASE_INITIALISATION +#ifdef MMEX_TESTS_TEST_DATABASE_INITIALISATION // Registers the fixture into the 'registry' CPPUNIT_TEST_SUITE_REGISTRATION(Test_DatabaseInitialisation); #endif Modified: trunk/src/tests/test_date_range.cpp =================================================================== --- trunk/src/tests/test_date_range.cpp 2014-05-14 12:41:53 UTC (rev 6583) +++ trunk/src/tests/test_date_range.cpp 2014-05-15 11:31:48 UTC (rev 6584) @@ -30,7 +30,7 @@ *****************************************************************************/ #include "defined_test_selection.h" -#ifdef __MMEX_TESTS__TEST_DATE_RANGE +#ifdef MMEX_TESTS_TEST_DATE_RANGE // Registers the fixture into the 'registry' CPPUNIT_TEST_SUITE_REGISTRATION(Test_Date_Range); #endif Modified: trunk/src/tests/test_filtertrans_dialog.cpp =================================================================== --- trunk/src/tests/test_filtertrans_dialog.cpp 2014-05-14 12:41:53 UTC (rev 6583) +++ trunk/src/tests/test_filtertrans_dialog.cpp 2014-05-15 11:31:48 UTC (rev 6584) @@ -40,7 +40,7 @@ *****************************************************************************/ #include "defined_test_selection.h" -#ifdef __MMEX_TESTS__FILTER_TRANS_DIALOG +#ifdef MMEX_TESTS_FILTER_TRANS_DIALOG // Registers the fixture into the 'registry' CPPUNIT_TEST_SUITE_REGISTRATION( Test_FilterTrans_Dialog ); #endif Modified: trunk/src/tests/test_relocate_category.cpp =================================================================== --- trunk/src/tests/test_relocate_category.cpp 2014-05-14 12:41:53 UTC (rev 6583) +++ trunk/src/tests/test_relocate_category.cpp 2014-05-15 11:31:48 UTC (rev 6584) @@ -40,7 +40,7 @@ *****************************************************************************/ #include "defined_test_selection.h" -#ifdef __MMEX_TESTS__RELOCATE_CATEGORY +#ifdef MMEX_TESTS_RELOCATE_CATEGORY // Registers the fixture into the 'registry' CPPUNIT_TEST_SUITE_REGISTRATION( Test_Relocate_Category ); #endif Modified: trunk/src/tests/test_relocate_payee.cpp =================================================================== --- trunk/src/tests/test_relocate_payee.cpp 2014-05-14 12:41:53 UTC (rev 6583) +++ trunk/src/tests/test_relocate_payee.cpp 2014-05-15 11:31:48 UTC (rev 6584) @@ -35,7 +35,7 @@ *****************************************************************************/ #include "defined_test_selection.h" -#ifdef __MMEX_TESTS__RELOCATE_PAYEE +#ifdef MMEX_TESTS_RELOCATE_PAYEE // Registers the fixture into the 'registry' CPPUNIT_TEST_SUITE_REGISTRATION( Test_Relocate_Payee ); #endif Modified: trunk/src/tests/test_stocks.cpp =================================================================== --- trunk/src/tests/test_stocks.cpp 2014-05-14 12:41:53 UTC (rev 6583) +++ trunk/src/tests/test_stocks.cpp 2014-05-15 11:31:48 UTC (rev 6584) @@ -32,7 +32,7 @@ *****************************************************************************/ #include "defined_test_selection.h" -#ifdef __MMEX_TESTS__STOCKS +#ifdef MMEX_TESTS_STOCKS // Registers the fixture into the 'registry' CPPUNIT_TEST_SUITE_REGISTRATION(Test_Stock); #endif This was sent by MMEX an easy to use, money management application. |