From: <ste...@us...> - 2012-03-04 03:14:25
|
Revision: 1901 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1901&view=rev Author: stef145g Date: 2012-03-04 03:14:19 +0000 (Sun, 04 Mar 2012) Log Message: ----------- Updated Menu Option details Modified Paths: -------------- trunk/mmex/src/mmex.cpp Modified: trunk/mmex/src/mmex.cpp =================================================================== --- trunk/mmex/src/mmex.cpp 2012-03-02 23:19:45 UTC (rev 1900) +++ trunk/mmex/src/mmex.cpp 2012-03-04 03:14:19 UTC (rev 1901) @@ -2507,7 +2507,7 @@ //CSV Files // //QIF Files // //Import > // - //Universal CSV Files // + //CSV Files // //QIF Files // //Accounts Visible// //All // @@ -2527,12 +2527,12 @@ if ( (iData->getString() != wxT("Term Accounts")) && (iData->getString() != wxT("Stocks")) ) { wxMenu *exportTo = new wxMenu; - exportTo->Append(MENU_TREEPOPUP_ACCOUNT_EXPORT2CSV, _("&CSV Files")); - exportTo->Append(MENU_TREEPOPUP_ACCOUNT_EXPORT2QIF, _("&QIF Files")); + exportTo->Append(MENU_TREEPOPUP_ACCOUNT_EXPORT2CSV, _("&CSV Files...")); + exportTo->Append(MENU_TREEPOPUP_ACCOUNT_EXPORT2QIF, _("&QIF Files...")); menu->AppendSubMenu(exportTo, _("&Export")); wxMenu *importFrom = new wxMenu; - importFrom->Append(MENU_TREEPOPUP_ACCOUNT_IMPORTUNIVCSV, _("&Universal CSV Files")); - importFrom->Append(MENU_TREEPOPUP_ACCOUNT_IMPORTQIF, _("&QIF Files")); + importFrom->Append(MENU_TREEPOPUP_ACCOUNT_IMPORTUNIVCSV, _("&CSV Files...")); + importFrom->Append(MENU_TREEPOPUP_ACCOUNT_IMPORTQIF, _("&QIF Files...")); menu->AppendSubMenu(importFrom, _("&Import")); menu->AppendSeparator(); } @@ -2720,14 +2720,14 @@ menu_file->AppendSeparator(); wxMenu* exportMenu = new wxMenu; - exportMenu->Append(MENU_EXPORT_CSV, _("&CSV Files"), _("Export to CSV")); - exportMenu->Append(MENU_EXPORT_QIF, _("&QIF Files"), _("Export to QIF")); + exportMenu->Append(MENU_EXPORT_CSV, _("&CSV Files..."), _("Export to CSV")); + exportMenu->Append(MENU_EXPORT_QIF, _("&QIF Files..."), _("Export to QIF")); exportMenu->Append(MENU_EXPORT_HTML, _("&Report to HTML"), _("Export to HTML")); menu_file->Append(MENU_EXPORT, _("&Export"), exportMenu); wxMenu* importMenu = new wxMenu; - importMenu->Append(MENU_IMPORT_UNIVCSV, _("&Universal CSV Files"), _("Import from any CSV file")); - importMenu->Append(MENU_IMPORT_QIF, _("&QIF Files"), _("Import from QIF")); + importMenu->Append(MENU_IMPORT_UNIVCSV, _("&CSV Files..."), _("Import from any CSV file")); + importMenu->Append(MENU_IMPORT_QIF, _("&QIF Files..."), _("Import from QIF")); menu_file->Append(MENU_IMPORT, _("&Import"), importMenu); menu_file->AppendSeparator(); @@ -2958,8 +2958,8 @@ if (mmIniOptions::instance().enableReportIssues_) { - wxMenuItem* menuItemReportIssues = new wxMenuItem(menuTools, MENU_REPORTISSUES, - _("&Report Issues or Feedback"), _("Send email through the mailing list to report issues with the software.")); + wxMenuItem* menuItemReportIssues = new wxMenuItem(menuTools, MENU_REPORTISSUES, + _("Visit MMEX Forum or &Report New Issues."), _("Visit the MMEX forum. See existing user comments, or report new issues with the software.")); menuItemReportIssues->SetBitmap(wxBitmap(issues_xpm)); menuHelp->Append(menuItemReportIssues); } @@ -2967,7 +2967,7 @@ if (mmIniOptions::instance().enableBeNotifiedForNewReleases_) { wxMenuItem* menuItemNotify = new wxMenuItem(menuTools, MENU_ANNOUNCEMENTMAILING, - _("Be ¬ified of new releases"), _("Sign up for the announcement mailing list")); + _("Register/View Release &Notifications."), _("Sign up to Notification Mailing List or View existing announcements.")); menuItemNotify->SetBitmap(wxBitmap(notify_xpm)); menuHelp->Append(menuItemNotify); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gua...@us...> - 2012-03-05 03:20:30
|
Revision: 1907 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1907&view=rev Author: guanlisheng Date: 2012-03-05 03:20:23 +0000 (Mon, 05 Mar 2012) Log Message: ----------- format Modified Paths: -------------- trunk/mmex/src/mmex.cpp Modified: trunk/mmex/src/mmex.cpp =================================================================== --- trunk/mmex/src/mmex.cpp 2012-03-04 09:37:48 UTC (rev 1906) +++ trunk/mmex/src/mmex.cpp 2012-03-05 03:20:23 UTC (rev 1907) @@ -1706,32 +1706,28 @@ createHomePage(); return; } - - if (iData->getString() == NAVTREECTRL_HELP) + else if (iData->getString() == NAVTREECTRL_HELP) { helpFileIndex_ = mmex::HTML_INDEX; menuPrintingEnable(true); createHelpPage(); return; } - - if (iData->getString() == NAVTREECTRL_CUSTOM_REPORTS) + else if (iData->getString() == NAVTREECTRL_CUSTOM_REPORTS) { helpFileIndex_ = mmex::HTML_CUSTOM_SQL; menuPrintingEnable(true); createHelpPage(); return; } - - if (iData->getString() == NAVTREECTRL_INVESTMENT) + else if (iData->getString() == NAVTREECTRL_INVESTMENT) { helpFileIndex_ = mmex::HTML_INVESTMENT; menuPrintingEnable(true); createHelpPage(); return; } - - if (iData->getString() == NAVTREECTRL_BUDGET) + else if (iData->getString() == NAVTREECTRL_BUDGET) { helpFileIndex_ = mmex::HTML_BUDGET; menuPrintingEnable(true); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gua...@us...> - 2012-03-05 05:28:24
|
Revision: 1910 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1910&view=rev Author: guanlisheng Date: 2012-03-05 05:28:18 +0000 (Mon, 05 Mar 2012) Log Message: ----------- format Modified Paths: -------------- trunk/mmex/src/mmex.cpp Modified: trunk/mmex/src/mmex.cpp =================================================================== --- trunk/mmex/src/mmex.cpp 2012-03-05 05:20:32 UTC (rev 1909) +++ trunk/mmex/src/mmex.cpp 2012-03-05 05:28:18 UTC (rev 1910) @@ -1568,20 +1568,16 @@ /* 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; - } + if (homePageAccountSelect_) return; menuPrintingEnable(false); wxTreeItemId id = event.GetItem(); - if (!id) - return; + if (!id) return; + mmTreeItemData* iData = dynamic_cast<mmTreeItemData*>(navTreeCtrl_->GetItemData(id)); selectedItemData_ = iData; - if (!iData) - return; + if (!iData) return; if (!iData->isStringData()) { @@ -1592,23 +1588,26 @@ Freeze(); wxTreeItemId idparent = navTreeCtrl_->GetItemParent(id); mmTreeItemData* iParentData = dynamic_cast<mmTreeItemData*>(navTreeCtrl_->GetItemData(idparent)); - if (iParentData->getString() == wxT("Budget Performance")) { + if (iParentData->getString() == wxT("Budget Performance")) + { wxProgressDialog proDlg(_("Budget Performance"), reportWaitingMsg, 100, this); mmPrintableBase* rs = new mmReportBudgetingPerformance(m_core.get(), this, data); proDlg.Update(70); menuPrintingEnable(true); createReportsPage(rs); proDlg.Update(95); - - } else if (iParentData->getString() == wxT("Budget Setup Performance")) { + } + else if (iParentData->getString() == wxT("Budget Setup Performance")) + { wxProgressDialog proDlg(_("Budget Category Summary"), reportWaitingMsg, 100, this); mmPrintableBase* rs = new mmReportBudgetCategorySummary(m_core.get(), this, data); proDlg.Update(70); menuPrintingEnable(true); createReportsPage(rs); proDlg.Update(95); - - } else { + } + else + { wxProgressDialog proDlg(_("Budget Setup"), reportWaitingMsg, 100, this); createBudgetingPage(data); proDlg.Update(95); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gua...@us...> - 2012-03-05 05:31:04
|
Revision: 1911 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1911&view=rev Author: guanlisheng Date: 2012-03-05 05:30:58 +0000 (Mon, 05 Mar 2012) Log Message: ----------- format Modified Paths: -------------- trunk/mmex/src/mmex.cpp Modified: trunk/mmex/src/mmex.cpp =================================================================== --- trunk/mmex/src/mmex.cpp 2012-03-05 05:28:18 UTC (rev 1910) +++ trunk/mmex/src/mmex.cpp 2012-03-05 05:30:58 UTC (rev 1911) @@ -4712,16 +4712,10 @@ createHomePage(); } - if (progress) - { - progress->Update(40); - } + if (progress) progress->Update(40); openFile(dbFileName, newDatabase); - if (progress) - { - progress->Update(95); - } + if (progress) progress->Update(95); recentFiles_->updateRecentList(dbFileName); if (progress) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gua...@us...> - 2012-03-05 05:32:41
|
Revision: 1912 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1912&view=rev Author: guanlisheng Date: 2012-03-05 05:32:35 +0000 (Mon, 05 Mar 2012) Log Message: ----------- format Modified Paths: -------------- trunk/mmex/src/mmex.cpp Modified: trunk/mmex/src/mmex.cpp =================================================================== --- trunk/mmex/src/mmex.cpp 2012-03-05 05:30:58 UTC (rev 1911) +++ trunk/mmex/src/mmex.cpp 2012-03-05 05:32:35 UTC (rev 1912) @@ -432,13 +432,13 @@ mmGUIApp::SQLiteInit::SQLiteInit() { - wxSQLite3Database::InitializeSQLite(); + wxSQLite3Database::InitializeSQLite(); } //---------------------------------------------------------------------------- mmGUIApp::SQLiteInit::~SQLiteInit() { - wxSQLite3Database::ShutdownSQLite(); + wxSQLite3Database::ShutdownSQLite(); } //---------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gua...@us...> - 2012-03-05 05:44:13
|
Revision: 1913 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1913&view=rev Author: guanlisheng Date: 2012-03-05 05:44:07 +0000 (Mon, 05 Mar 2012) Log Message: ----------- format Modified Paths: -------------- trunk/mmex/src/mmex.cpp Modified: trunk/mmex/src/mmex.cpp =================================================================== --- trunk/mmex/src/mmex.cpp 2012-03-05 05:32:35 UTC (rev 1912) +++ trunk/mmex/src/mmex.cpp 2012-03-05 05:44:07 UTC (rev 1913) @@ -3710,7 +3710,8 @@ // we will get latest currency rate data from European Central Bank wxString site = wxT("http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml"); - if (!m_core) { + if (!m_core) + { wxMessageBox(_("No database!"), _("Update Currency Rate"), wxICON_WARNING); return; } @@ -3719,58 +3720,73 @@ wxInputStream* in_stream = url.GetInputStream(); - if (!in_stream) { + if (!in_stream) + { wxMessageBox(_("Unable to connect!"), _("Update Currency Rate"), wxICON_WARNING); return; } wxXmlDocument doc; - if(!doc.Load(*in_stream)) { + if(!doc.Load(*in_stream)) + { wxMessageBox(_("Cannot get data from WWW!"), _("Update Currency Rate"), wxICON_WARNING); return; } // decode received XML data - if(doc.GetRoot()->GetName() != wxT("gesmes:Envelope")) { + if(doc.GetRoot()->GetName() != wxT("gesmes:Envelope")) + { wxMessageBox(_("Incorrect XML data (#1)!"), _("Update Currency Rate"), wxICON_WARNING); return; } wxXmlNode *root_child = doc.GetRoot()->GetChildren(); - while(root_child) { - if(root_child->GetName() == wxT("gesmes:subject")) { - if(root_child->GetNodeContent() != wxT("Reference rates")) { + while(root_child) + { + if(root_child->GetName() == wxT("gesmes:subject")) + { + if(root_child->GetNodeContent() != wxT("Reference rates")) + { wxMessageBox(_("Incorrect XML data (#2)!"), _("Update Currency Rate"), wxICON_WARNING); return; } - } else if (root_child->GetName() == wxT("gesmes:Sender")) { + } + else if (root_child->GetName() == wxT("gesmes:Sender")) + { wxXmlNode *sender_child = root_child->GetChildren(); - if(!sender_child) { + if(!sender_child) + { wxMessageBox(_("Incorrect XML data (#3)!"), _("Update Currency Rate"), wxICON_WARNING); return; } - if(sender_child->GetName() != wxT("gesmes:name")) { + if(sender_child->GetName() != wxT("gesmes:name")) + { wxMessageBox(_("Incorrect XML data (#4)!"), _("Update Currency Rate"), wxICON_WARNING); return; } - if(sender_child->GetNodeContent() != wxT("European Central Bank")) { + if(sender_child->GetNodeContent() != wxT("European Central Bank")) + { wxMessageBox(_("Incorrect XML data (#5)!"), _("Update Currency Rate"), wxICON_WARNING); return; } - } else if (root_child->GetName() == wxT("Cube")) { + } + else if (root_child->GetName() == wxT("Cube")) + { wxXmlNode *cube_lv1_child = root_child->GetChildren(); - if(!cube_lv1_child) { + if(!cube_lv1_child) + { wxMessageBox(_("Incorrect XML data (#6)!"), _("Update Currency Rate"), wxICON_WARNING); return; } - if(cube_lv1_child->GetName() != wxT("Cube")) { + if(cube_lv1_child->GetName() != wxT("Cube")) + { wxMessageBox(_("Incorrect XML data (#7)!"), _("Update Currency Rate"), wxICON_WARNING); return; } @@ -3781,7 +3797,8 @@ currency_name.Add(wxT("EUR")); currency_rate.Add(wxT("1.0")); - while(cube_lv2_child) { + while(cube_lv2_child) + { wxString name = cube_lv2_child->GetPropVal(wxT("currency"), wxGetEmptyString()); wxString rate = cube_lv2_child->GetPropVal(wxT("rate"), wxT("1")); @@ -3801,19 +3818,21 @@ wxString base_symbol = mmDBWrapper::getCurrencySymbol(m_core->db_.get(), currencyID); base_rate = 0; - for(i=0; i<(int)currency_rate.GetCount(); i++) { - if(currency_rate[i].ToDouble(&rate_value) == false) { + for(i=0; i<(int)currency_rate.GetCount(); i++) + { + if(currency_rate[i].ToDouble(&rate_value) == false) + { rate_ptr[i] = 1.0; - } else { + } else + { rate_ptr[i] = rate_value; - - if(currency_name[i] == base_symbol) { + if(currency_name[i] == base_symbol) base_rate = rate_value; - } } } - if(base_rate == 0) { + if(base_rate == 0) + { wxMessageBox(_("Could not find base currency symbol!"), _("Update Currency Rate"), wxICON_WARNING); return; } @@ -3823,9 +3842,8 @@ // currency Z / currency Y = Z / Y // Therefore, if currency X is EUR and currency Y is the base currency, // currency Y : currency Z = base_rate / rate of Z : 1 - for(i=0; i<(int)currency_rate.GetCount(); i++) { + for(i=0; i<(int)currency_rate.GetCount(); i++) rate_ptr[i] = base_rate / rate_ptr[i]; - } // update currency rates @@ -3962,37 +3980,27 @@ void mmGUIFrame::OnPrintPageReport(wxCommandEvent& WXUNUSED(event)) { - if (!printer_) - return; + if (!printer_) return; mmReportsPanel* rp = dynamic_cast<mmReportsPanel*>(panelCurrent_); mmHelpPanel* hp = dynamic_cast<mmHelpPanel*>(panelCurrent_); if (rp) - { printer_ ->PrintText(rp->getReportText()); - } - else if (hp) - { + else if (hp) printer_ ->PrintFile(mmex::getPathDoc((mmex::EDocFile)helpFileIndex_)); - } } //---------------------------------------------------------------------------- void mmGUIFrame::OnPrintPagePreview(wxCommandEvent& WXUNUSED(event)) { - if (!printer_) - return; + if (!printer_) return; mmReportsPanel* rp = dynamic_cast<mmReportsPanel*>(panelCurrent_); mmHelpPanel* hp = dynamic_cast<mmHelpPanel*>(panelCurrent_); if (rp) - { printer_ ->PreviewText(rp->getReportText()); - } else if (hp) - { printer_ ->PreviewFile(mmex::getPathDoc((mmex::EDocFile)helpFileIndex_)); - } } //---------------------------------------------------------------------------- @@ -4025,9 +4033,7 @@ else if (rc == 4) { wxFileName fname(mmDBWrapper::getLastDbPath(m_inidb.get())); - if (fname.IsOk()) { - openFile(fname.GetFullPath(), false); - } + if (fname.IsOk()) openFile(fname.GetFullPath(), false); } else if (rc == -1) { @@ -4090,9 +4096,7 @@ void mmGUIFrame::OnGotoStocksAccount(wxCommandEvent& WXUNUSED(event)) { if (gotoAccountID_ != -1) - { createStocksAccountPage(gotoAccountID_); - } } //---------------------------------------------------------------------------- @@ -4113,9 +4117,7 @@ void mmGUIFrame::OnGotoAccount(wxCommandEvent& WXUNUSED(event)) { if (gotoAccountID_ != -1) - { createCheckingAccountPage(gotoAccountID_); - } } //---------------------------------------------------------------------------- @@ -4246,7 +4248,7 @@ void mmGUIFrame::OnViewToolbarUpdateUI(wxUpdateUIEvent &event) { - if( m_mgr.GetPane(wxT("toolbar")).IsShown()) + if(m_mgr.GetPane(wxT("toolbar")).IsShown()) event.Check(true); else event.Check(false); @@ -4255,7 +4257,7 @@ void mmGUIFrame::OnViewLinksUpdateUI(wxUpdateUIEvent &event) { - if( m_mgr.GetPane(wxT("Navigation")).IsShown()) + if(m_mgr.GetPane(wxT("Navigation")).IsShown()) event.Check(true); else event.Check(false); @@ -4359,8 +4361,7 @@ } wxEndBusyCursor(); - if (dialogStatus == wxID_OK) - updateNavTreeControl(); + if (dialogStatus == wxID_OK) updateNavTreeControl(); dlg->Destroy(); } @@ -4459,9 +4460,7 @@ currencyID_ = parent_->m_core->currencyList_.getBaseCurrencySettings(); wxString currName = _("Set Currency"); if (currencyID_ != -1) - { currName = parent_->m_core->currencyList_.getCurrencySharedPtr(currencyID_)->currencyName_; - } itemButtonCurrency_ = new wxButton( this, ID_DIALOG_OPTIONS_BUTTON_CURRENCY, currName, wxDefaultPosition, wxSize(130,-1), 0 ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gua...@us...> - 2012-03-05 05:48:18
|
Revision: 1914 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1914&view=rev Author: guanlisheng Date: 2012-03-05 05:48:12 +0000 (Mon, 05 Mar 2012) Log Message: ----------- format Modified Paths: -------------- trunk/mmex/src/mmex.cpp Modified: trunk/mmex/src/mmex.cpp =================================================================== --- trunk/mmex/src/mmex.cpp 2012-03-05 05:44:07 UTC (rev 1913) +++ trunk/mmex/src/mmex.cpp 2012-03-05 05:48:12 UTC (rev 1914) @@ -3705,7 +3705,6 @@ { wxArrayString currency_name, currency_rate; double *rate_ptr, rate_value, base_rate; - int i; // we will get latest currency rate data from European Central Bank wxString site = wxT("http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml"); @@ -3818,7 +3817,7 @@ wxString base_symbol = mmDBWrapper::getCurrencySymbol(m_core->db_.get(), currencyID); base_rate = 0; - for(i=0; i<(int)currency_rate.GetCount(); i++) + for(int i=0; i<(int)currency_rate.GetCount(); i++) { if(currency_rate[i].ToDouble(&rate_value) == false) { @@ -3842,7 +3841,7 @@ // currency Z / currency Y = Z / Y // Therefore, if currency X is EUR and currency Y is the base currency, // currency Y : currency Z = base_rate / rate of Z : 1 - for(i=0; i<(int)currency_rate.GetCount(); i++) + for(int i=0; i<(int)currency_rate.GetCount(); i++) rate_ptr[i] = base_rate / rate_ptr[i]; // update currency rates @@ -3853,7 +3852,7 @@ { wxString currencySymbol = m_core->currencyList_.currencies_[idx]->currencySymbol_; - for(i=0; i<(int)currency_name.GetCount(); i++) + for(int i=0; i<(int)currency_name.GetCount(); i++) { if(currency_name[i] == currencySymbol) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gua...@us...> - 2012-03-05 05:58:01
|
Revision: 1915 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1915&view=rev Author: guanlisheng Date: 2012-03-05 05:57:55 +0000 (Mon, 05 Mar 2012) Log Message: ----------- format Modified Paths: -------------- trunk/mmex/src/mmex.cpp Modified: trunk/mmex/src/mmex.cpp =================================================================== --- trunk/mmex/src/mmex.cpp 2012-03-05 05:48:12 UTC (rev 1914) +++ trunk/mmex/src/mmex.cpp 2012-03-05 05:57:55 UTC (rev 1915) @@ -2526,7 +2526,6 @@ //Restore settings mmDBWrapper::setINISettingValue(m_inidb.get(), wxT("VIEWACCOUNTS"), vAccts); - } //---------------------------------------------------------------------------- @@ -2543,7 +2542,6 @@ //Restore settings mmDBWrapper::setINISettingValue(m_inidb.get(), wxT("VIEWACCOUNTS"), vAccts); - } //---------------------------------------------------------------------------- @@ -2560,7 +2558,6 @@ //Restore settings mmDBWrapper::setINISettingValue(m_inidb.get(), wxT("VIEWACCOUNTS"), vAccts); - } //---------------------------------------------------------------------------- @@ -2988,10 +2985,7 @@ void mmGUIFrame::createDataStore(const wxString& fileName, const wxString& pwd, bool openingNew) { - if (m_core) - { - m_core.reset(); - } + if (m_core) m_core.reset(); if (m_db) { @@ -3132,9 +3126,12 @@ m_topCategories.Clear(); mmIniOptions::instance().loadInfoOptions(m_db.get()); - if (m_db) { + if (m_db) + { fileName_ = fileName; - } else { + } + else + { fileName_.Clear(); password_.Clear(); } @@ -3151,7 +3148,8 @@ { createDataStore(fileName, password, openingNew); - if (m_db) { + if (m_db) + { menuEnableItems(true); menuPrintingEnable(false); autoRepeatTransactionsTimer_.Start(REPEAT_TRANS_DELAY_TIME, wxTIMER_ONE_SHOT); @@ -3159,7 +3157,8 @@ updateNavTreeControl(); - if (!refreshRequested_) { + if (!refreshRequested_) + { refreshRequested_ = true; /* Currency Options might have changed so refresh */ wxCommandEvent ev(wxEVT_COMMAND_MENU_SELECTED, MENU_ACCTLIST); @@ -3181,15 +3180,13 @@ wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); - if(dlg.ShowModal() != wxID_OK) { - return; - } + if(dlg.ShowModal() != wxID_OK) + return; wxString fileName = dlg.GetPath(); - if (!fileName.EndsWith(wxT(".mmb"))) { + if (!fileName.EndsWith(wxT(".mmb"))) fileName += wxT(".mmb"); - } SetDatabaseFile(fileName, true); } @@ -3259,7 +3256,8 @@ { wxASSERT(m_db); - if (fileName_.empty()) { + if (fileName_.empty()) + { wxASSERT(false); return; } @@ -3272,15 +3270,10 @@ wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); - if (dlg.ShowModal() != wxID_OK) { - return; - } + if (dlg.ShowModal() != wxID_OK) return; // Ensure database is in a steady state first - if (!activeHomePage_) - { - createHomePage(); // Display Home page when not being displayed. - } + if (!activeHomePage_) createHomePage(); // Display Home page when not being displayed. bool encrypt = dlg.GetFilterIndex() != 0; // emb -> Encrypted mMB wxFileName newFileName(dlg.GetPath()); @@ -3288,25 +3281,27 @@ wxFileName oldFileName(fileName_); // opened db's file - if (newFileName == oldFileName) { // on case-sensitive FS uses case-sensitive comparison + if (newFileName == oldFileName) // on case-sensitive FS uses case-sensitive comparison + { wxMessageDialog dlg(this, _("Can't copy file to itself"), _("Save database file as"), wxICON_WARNING); dlg.ShowModal(); return; } // prepare to copy - wxString new_password; bool rekey = encrypt ^ m_db->IsEncrypted(); if (encrypt) { - if (rekey) { + if (rekey) + { new_password = wxGetPasswordFromUser(_("Enter password for new database")); - if (new_password.empty()) { + if (new_password.empty()) return; - } - } else { + } + else + { new_password = password_; } } @@ -3319,9 +3314,8 @@ m_db.reset(); } - if (!wxCopyFile(oldFileName.GetFullPath(), newFileName.GetFullPath(), true)) { // true -> overwrite if file exists + if (!wxCopyFile(oldFileName.GetFullPath(), newFileName.GetFullPath(), true)) // true -> overwrite if file exists return; - } if (rekey) // encrypt or reset encryption { @@ -3344,7 +3338,7 @@ void mmGUIFrame::OnExportToQIF(wxCommandEvent& /*event*/) { - mmExportQIF(m_core.get(), m_db.get()); + mmExportQIF(m_core.get(), m_db.get()); } //---------------------------------------------------------------------------- @@ -3448,7 +3442,8 @@ void mmGUIFrame::OnBudgetSetupDialog(wxCommandEvent& /*event*/) { - if (m_db) { + if (m_db) + { mmBudgetYearDialog(m_db.get(), this).ShowModal(); createHomePage(); updateNavTreeControl(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gua...@us...> - 2012-03-05 06:15:34
|
Revision: 1917 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1917&view=rev Author: guanlisheng Date: 2012-03-05 06:15:28 +0000 (Mon, 05 Mar 2012) Log Message: ----------- format & cleanup Modified Paths: -------------- trunk/mmex/src/mmex.cpp Modified: trunk/mmex/src/mmex.cpp =================================================================== --- trunk/mmex/src/mmex.cpp 2012-03-05 06:13:28 UTC (rev 1916) +++ trunk/mmex/src/mmex.cpp 2012-03-05 06:15:28 UTC (rev 1917) @@ -1481,8 +1481,7 @@ wxDateTime today = wxDateTime::Now(); int year = today.GetYear(); - if (today.GetMonth() < monthNum) - year -- ; + if (today.GetMonth() < monthNum) year -- ; long dayNum; wxString dayNumStr = mmOptions::instance().financialYearStartDayString_; @@ -2078,9 +2077,7 @@ wxDateTime today = wxDateTime::Now(); int year = today.GetYear()-1; - if (today.GetMonth() < dtBegin.GetMonth() ) { - year -- ; - } + if (today.GetMonth() < dtBegin.GetMonth()) year -- ; mmPrintableBase* rs = new mmReportIncExpensesOverFinancialPeriod(this, m_core.get(), year); menuPrintingEnable(true); createReportsPage(rs); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gua...@us...> - 2012-03-08 14:48:10
|
Revision: 1962 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1962&view=rev Author: guanlisheng Date: 2012-03-08 14:47:59 +0000 (Thu, 08 Mar 2012) Log Message: ----------- stop warning Modified Paths: -------------- trunk/mmex/src/mmex.cpp Modified: trunk/mmex/src/mmex.cpp =================================================================== --- trunk/mmex/src/mmex.cpp 2012-03-08 14:28:08 UTC (rev 1961) +++ trunk/mmex/src/mmex.cpp 2012-03-08 14:47:59 UTC (rev 1962) @@ -537,7 +537,10 @@ ) : wxFrame(0, -1, title, pos, size), gotoAccountID_(-1), + homePageAccountSelect_(false), refreshRequested_(), + autoRepeatTransactionsTimer_(this, AUTO_REPEAT_TRANSACTIONS_TIMER_ID), + activeHomePage_(false), panelCurrent_(), homePanel(), navTreeCtrl_(), @@ -545,14 +548,11 @@ toolBar_(), selectedItemData_(), menuItemOnlineUpdateCurRate_(), + helpFileIndex_(mmex::HTML_INDEX), activeTermAccounts_(false), - autoRepeatTransactionsTimer_(this, AUTO_REPEAT_TRANSACTIONS_TIMER_ID), - activeHomePage_(false), - homePageAccountSelect_(false), expandedReportNavTree_(true), - expandedBudgetingNavTree_(true), expandedCustomSqlReportNavTree_(false), - helpFileIndex_(mmex::HTML_INDEX) + expandedBudgetingNavTree_(true) { // tell wxAuiManager to manage this frame m_mgr.SetManagedWindow(this); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2012-03-10 00:29:22
|
Revision: 1971 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1971&view=rev Author: stef145g Date: 2012-03-10 00:29:16 +0000 (Sat, 10 Mar 2012) Log Message: ----------- Update Mailing List URL. Fix message when no internet access for Check Update. Modified Paths: -------------- trunk/mmex/src/mmex.cpp Modified: trunk/mmex/src/mmex.cpp =================================================================== --- trunk/mmex/src/mmex.cpp 2012-03-10 00:22:46 UTC (rev 1970) +++ trunk/mmex/src/mmex.cpp 2012-03-10 00:29:16 UTC (rev 1971) @@ -3547,6 +3547,18 @@ void mmGUIFrame::OnCheckUpdate(wxCommandEvent& /*event*/) { + // Set up system information + wxString versionDetails = wxString() + << wxT("MMEX: ") << mmex::getProgramVersion() << wxT("\n") + << _("System: ") << wxPlatformInfo::Get().GetOperatingSystemIdName() << wxT("\n\n") + << wxVERSION_STRING << wxT("\n") + << wxT("Boost C++ ") << (BOOST_VERSION/100000) << wxT('.') + << (BOOST_VERSION / 100 % 1000) << wxT('.') + << (BOOST_VERSION % 100) << wxT("\n") + << wxT("SQLite3: ") << wxSQLite3Database::GetVersion() << wxT("\n") + << wxT("wxSQLite3: 3.0.0 by Ulrich Telle") << wxT("\n\n"); + + // Access current version details page wxString site = wxT("http://www.codelathe.com/mmex/version.html"); wxURL url(site); @@ -3554,7 +3566,8 @@ boost::scoped_ptr<wxInputStream> in_stream(url.GetInputStream()); if (!in_stream) { - mmShowErrorMessage(this, _("Unable to connect!"), _("Check Update")); + versionDetails << _("Unable to connect!"); + wxMessageBox(versionDetails, _("MMEX System Information Check")); return; } in_stream->Read(buf, 1024); @@ -3588,17 +3601,7 @@ page = mySysToken.GetNextToken(); // the system page = mySysToken.GetNextToken().Trim(false).Trim(); // the version - // Set up system information - wxString versionDetails = wxString() - << wxT("MMEX: ") << mmex::getProgramVersion() << wxT("\n") - << _("System: ") << wxPlatformInfo::Get().GetOperatingSystemIdName() << wxT("\n\n") - << wxVERSION_STRING << wxT("\n") - << wxT("Boost C++ ") << (BOOST_VERSION/100000) << wxT('.') - << (BOOST_VERSION / 100 % 1000) << wxT('.') - << (BOOST_VERSION % 100) << wxT("\n") - << wxT("SQLite3: ") << wxSQLite3Database::GetVersion() << wxT("\n") - << wxT("wxSQLite3: 3.0.0 by Ulrich Telle") << wxT("\n\n"); - + // set up display information. int style = wxOK|wxCANCEL; if (IsUpdateAvailable(page)) { @@ -3804,7 +3807,10 @@ void mmGUIFrame::OnBeNotified(wxCommandEvent& /*event*/) { - wxString url = wxT("http://groups.google.com/group/mmlist"); + // New site location + // wxString url = wxT("http://groups.google.com/group/mmlist"); + wxString url = wxT("https://groups.google.com/forum/?fromgroups#!forum/mmlist"); + wxLaunchDefaultBrowser(url); } //---------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2012-03-10 02:55:07
|
Revision: 1975 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1975&view=rev Author: stef145g Date: 2012-03-10 02:55:00 +0000 (Sat, 10 Mar 2012) Log Message: ----------- Add Progress bar to Category report Modified Paths: -------------- trunk/mmex/src/mmex.cpp Modified: trunk/mmex/src/mmex.cpp =================================================================== --- trunk/mmex/src/mmex.cpp 2012-03-10 02:51:57 UTC (rev 1974) +++ trunk/mmex/src/mmex.cpp 2012-03-10 02:55:00 UTC (rev 1975) @@ -1678,9 +1678,12 @@ } else if (iData->getString() == wxT("Categories - Over Time")) { + wxProgressDialog proDlg(_("Category Report"), _("Category Report being generated... Please wait."), 100, this); mmPrintableBase* rs = new mmReportCategoryOverTimePerformance(m_core.get()); + proDlg.Update(70); menuPrintingEnable(true); createReportsPage(rs); + proDlg.Update(95); } else if (iData->getString() == wxT("Categories - Month")) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2012-03-17 20:58:14
|
Revision: 2027 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2027&view=rev Author: stef145g Date: 2012-03-17 20:58:08 +0000 (Sat, 17 Mar 2012) Log Message: ----------- Updated reports to display Current month and Current Month to Date Modified Paths: -------------- trunk/mmex/src/mmex.cpp Modified: trunk/mmex/src/mmex.cpp =================================================================== --- trunk/mmex/src/mmex.cpp 2012-03-17 20:42:23 UTC (rev 2026) +++ trunk/mmex/src/mmex.cpp 2012-03-17 20:58:08 UTC (rev 2027) @@ -1143,7 +1143,10 @@ wxTreeItemId categsOverTimeCalMonth = navTreeCtrl_->AppendItem(categsOverTime, _("Last Calendar Month"), 4, 4); navTreeCtrl_->SetItemData(categsOverTimeCalMonth, new mmTreeItemData(wxT("Where the Money Goes - Month"))); - wxTreeItemId categsOverTimeCurrentMonth = navTreeCtrl_->AppendItem(categsOverTime, _("Current Month"), 4, 4); + wxString currentMonthMsg = _("Current Month"); + if (mmIniOptions::instance().ignoreFutureTransactions_) currentMonthMsg = _("Current Month to Date"); + + wxTreeItemId categsOverTimeCurrentMonth = navTreeCtrl_->AppendItem(categsOverTime, currentMonthMsg, 4, 4); navTreeCtrl_->SetItemData(categsOverTimeCurrentMonth, new mmTreeItemData(wxT("Where the Money Goes - Current Month"))); wxTreeItemId categsOverTimeLast30 = navTreeCtrl_->AppendItem(categsOverTime, _("Last 30 Days"), 4, 4); @@ -1171,7 +1174,7 @@ wxTreeItemId posCategsCalMonth = navTreeCtrl_->AppendItem(posCategs, _("Last Calendar Month"), 4, 4); navTreeCtrl_->SetItemData(posCategsCalMonth, new mmTreeItemData(wxT("Where the Money Comes From - Month"))); - wxTreeItemId posCategsCurrentMonth = navTreeCtrl_->AppendItem(posCategs, _("Current Month"), 4, 4); + wxTreeItemId posCategsCurrentMonth = navTreeCtrl_->AppendItem(posCategs, currentMonthMsg, 4, 4); navTreeCtrl_->SetItemData(posCategsCurrentMonth, new mmTreeItemData(wxT("Where the Money Comes From - Current Month"))); wxTreeItemId posCategsTimeLast30 = navTreeCtrl_->AppendItem(posCategs, _("Last 30 Days"), 4, 4); @@ -1199,7 +1202,7 @@ wxTreeItemId categsCalMonth = navTreeCtrl_->AppendItem(categs, _("Last Calendar Month"), 4, 4); navTreeCtrl_->SetItemData(categsCalMonth, new mmTreeItemData(wxT("Categories - Month"))); - wxTreeItemId categsCurrentMonth = navTreeCtrl_->AppendItem(categs, _("Current Month"), 4, 4); + wxTreeItemId categsCurrentMonth = navTreeCtrl_->AppendItem(categs, currentMonthMsg, 4, 4); navTreeCtrl_->SetItemData(categsCurrentMonth, new mmTreeItemData(wxT("Categories - Current Month"))); wxTreeItemId categsTimeLast30 = navTreeCtrl_->AppendItem(categs, _("Last 30 Days"), 4, 4); @@ -1227,7 +1230,7 @@ wxTreeItemId payeesOverTimeCalMonth = navTreeCtrl_->AppendItem(payeesOverTime, _("Last Calendar Month"), 4, 4); navTreeCtrl_->SetItemData(payeesOverTimeCalMonth, new mmTreeItemData(wxT("Payee Report - Month"))); - wxTreeItemId payeesOverTimeCurrentMonth = navTreeCtrl_->AppendItem(payeesOverTime, _("Current Month"), 4, 4); + wxTreeItemId payeesOverTimeCurrentMonth = navTreeCtrl_->AppendItem(payeesOverTime, currentMonthMsg, 4, 4); navTreeCtrl_->SetItemData(payeesOverTimeCurrentMonth, new mmTreeItemData(wxT("Payee Report - Current Month"))); wxTreeItemId payeesOverTimeLast30 = navTreeCtrl_->AppendItem(payeesOverTime, _("Last 30 Days"), 4, 4); @@ -1255,7 +1258,7 @@ wxTreeItemId incexpOverTimeCalMonth = navTreeCtrl_->AppendItem(incexpOverTime, _("Last Calendar Month"), 4, 4); navTreeCtrl_->SetItemData(incexpOverTimeCalMonth, new mmTreeItemData(wxT("Income vs Expenses - Month"))); - wxTreeItemId incexpOverTimeCurrentMonth = navTreeCtrl_->AppendItem(incexpOverTime, _("Current Month"), 4, 4); + wxTreeItemId incexpOverTimeCurrentMonth = navTreeCtrl_->AppendItem(incexpOverTime, currentMonthMsg, 4, 4); navTreeCtrl_->SetItemData(incexpOverTimeCurrentMonth, new mmTreeItemData(wxT("Income vs Expenses - Current Month"))); wxTreeItemId incexpOverTimeLast30 = navTreeCtrl_->AppendItem(incexpOverTime, _("Last 30 Days"), 4, 4); @@ -1719,8 +1722,13 @@ wxDateTime today = wxDateTime::Now(); wxDateTime prevMonthEnd = today.Subtract(wxDateSpan::Days(today.GetDay())); wxDateTime dtBegin = prevMonthEnd; - wxDateTime dtEnd = wxDateTime::Now(); + wxDateTime dtEnd = wxDateTime::Now().GetLastMonthDay(); wxString title = _("Categories - Current Month"); + if (mmIniOptions::instance().ignoreFutureTransactions_) + { + title = _("Categories - Current Month to Date"); + dtEnd = wxDateTime::Now(); + } mmPrintableBase* rs = new mmReportCategoryExpenses(m_core.get(), false, dtBegin, dtEnd, title, 0); menuPrintingEnable(true); createReportsPage(rs); @@ -1816,8 +1824,13 @@ wxDateTime today = wxDateTime::Now(); wxDateTime prevMonthEnd = today.Subtract(wxDateSpan::Days(today.GetDay())); wxDateTime dtBegin = prevMonthEnd; - wxDateTime dtEnd = wxDateTime::Now(); + wxDateTime dtEnd = wxDateTime::Now().GetLastMonthDay(); wxString title = _("Where the Money Comes From - Current Month"); + if (mmIniOptions::instance().ignoreFutureTransactions_) + { + title = _("Where the Money Comes From - Current Month to Date"); + dtEnd = wxDateTime::Now(); + } mmPrintableBase* rs = new mmReportCategoryExpenses(m_core.get(), false, dtBegin, dtEnd, title, 1); menuPrintingEnable(true); createReportsPage(rs); @@ -1914,8 +1927,13 @@ wxDateTime today = wxDateTime::Now(); wxDateTime prevMonthEnd = today.Subtract(wxDateSpan::Days(today.GetDay())); wxDateTime dtBegin = prevMonthEnd; - wxDateTime dtEnd = wxDateTime::Now(); + wxDateTime dtEnd = wxDateTime::Now().GetLastMonthDay(); wxString title = _("Where the Money Goes - Current Month"); + if (mmIniOptions::instance().ignoreFutureTransactions_) + { + title = _("Where the Money Goes - Current Month to Date"); + dtEnd = wxDateTime::Now(); + } mmPrintableBase* rs = new mmReportCategoryExpenses(m_core.get(), false, dtBegin, dtEnd, title, 2); menuPrintingEnable(true); createReportsPage(rs); @@ -2018,8 +2036,13 @@ wxDateTime today = wxDateTime::Now(); wxDateTime prevMonthEnd = today.Subtract(wxDateSpan::Days(today.GetDay())); wxDateTime dtBegin = prevMonthEnd; - wxDateTime dtEnd = wxDateTime::Now(); + wxDateTime dtEnd = wxDateTime::Now().GetLastMonthDay(); wxString title = _("Income vs Expenses - Current Month"); + if (mmIniOptions::instance().ignoreFutureTransactions_) + { + title = _("Income vs Expenses - Current Month to Date"); + dtEnd = wxDateTime::Now(); + } mmPrintableBase* rs = new mmReportIncomeExpenses(m_core.get(), false, dtBegin, dtEnd, title); menuPrintingEnable(true); createReportsPage(rs); @@ -2113,10 +2136,15 @@ wxDateTime today = wxDateTime::Now(); wxDateTime prevMonthEnd = today.Subtract(wxDateSpan::Days(today.GetDay())); wxDateTime dtBegin = prevMonthEnd; - wxDateTime dtEnd = wxDateTime::Now(); + wxDateTime dtEnd = wxDateTime::Now().GetLastMonthDay(); dtBegin.Add(wxDateSpan::Day()); wxString title = _("Payees - Current Month"); + if (mmIniOptions::instance().ignoreFutureTransactions_) + { + title = _("Payees - Current Month to Date"); + dtEnd = wxDateTime::Now(); + } mmPrintableBase* rs = new mmReportPayeeExpenses(m_core.get(), false, dtBegin, dtEnd, title); menuPrintingEnable(true); createReportsPage(rs); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2012-03-23 11:53:11
|
Revision: 2073 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2073&view=rev Author: stef145g Date: 2012-03-23 11:53:00 +0000 (Fri, 23 Mar 2012) Log Message: ----------- Fix: Solution to "The MMEX window disappears from view..." http://www.codelathe.com/forum/viewtopic.php?f=5&t=1627 Modified Paths: -------------- trunk/mmex/src/mmex.cpp Modified: trunk/mmex/src/mmex.cpp =================================================================== --- trunk/mmex/src/mmex.cpp 2012-03-22 14:47:07 UTC (rev 2072) +++ trunk/mmex/src/mmex.cpp 2012-03-23 11:53:00 UTC (rev 2073) @@ -902,6 +902,9 @@ m_perspective = m_mgr.SavePerspective(); mmDBWrapper::setINISettingValue(m_inidb.get(), wxT("AUIPERSPECTIVE"), m_perspective); + // prevent values being saved while window is in an iconised state. + if (this->IsIconized()) this->Restore(); + int valx = 0; int valy = 0; int valw = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-03-23 12:10:47
|
Revision: 2075 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2075&view=rev Author: vomikan Date: 2012-03-23 12:10:37 +0000 (Fri, 23 Mar 2012) Log Message: ----------- Visit web site for more information function moved. Modified Paths: -------------- trunk/mmex/src/mmex.cpp Modified: trunk/mmex/src/mmex.cpp =================================================================== --- trunk/mmex/src/mmex.cpp 2012-03-23 12:08:02 UTC (rev 2074) +++ trunk/mmex/src/mmex.cpp 2012-03-23 12:10:37 UTC (rev 2075) @@ -3983,8 +3983,8 @@ } else if (rc == 3) { - wxString url = wxT("http://www.codelathe.com/mmex/index.php"); - wxLaunchDefaultBrowser(url); + //wxString url = wxT("http://www.codelathe.com/mmex/index.php"); + //wxLaunchDefaultBrowser(url); } else if (rc == 4) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-04-14 18:19:59
|
Revision: 2172 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2172&view=rev Author: vomikan Date: 2012-04-14 18:19:51 +0000 (Sat, 14 Apr 2012) Log Message: ----------- cleanup Modified Paths: -------------- trunk/mmex/src/mmex.cpp Modified: trunk/mmex/src/mmex.cpp =================================================================== --- trunk/mmex/src/mmex.cpp 2012-04-14 10:54:05 UTC (rev 2171) +++ trunk/mmex/src/mmex.cpp 2012-04-14 18:19:51 UTC (rev 2172) @@ -115,7 +115,7 @@ #include "../resources/money_dollar.xpm" #include "../resources/user_edit.xpm" #include "../resources/wrench.xpm" -// +// #include "../resources/customsql.xpm" #include "../resources/termaccount.xpm" #include "../resources/savings_acc_closed.xpm" @@ -243,7 +243,7 @@ app.getLocale().Init(wxLANGUAGE_ENGLISH); /* Initialize Image Handlers */ - wxImage::AddHandler(new wxICOHandler()); + wxImage::AddHandler(new wxICOHandler()); wxImage::AddHandler(new wxJPEGHandler()); wxImage::AddHandler(new wxPNGHandler()); @@ -251,7 +251,7 @@ wxSQLite3Database inidb; inidb.Open(mmex::getPathUser(mmex::SETTINGS)); - + mmDBWrapper::verifyINIDB(&inidb); /* Load Colors from Database */ @@ -269,13 +269,13 @@ wxString originY = wxT("50"); wxString sizeW = wxT("800"); wxString sizeH = wxT("600"); - wxString valxStr = mmDBWrapper::getINISettingValue(&inidb, wxT("ORIGINX"), originX); + wxString valxStr = mmDBWrapper::getINISettingValue(&inidb, wxT("ORIGINX"), originX); wxString valyStr = mmDBWrapper::getINISettingValue(&inidb, wxT("ORIGINY"), originY); wxString valWStr = mmDBWrapper::getINISettingValue(&inidb, wxT("SIZEW"), sizeW); wxString valHStr = mmDBWrapper::getINISettingValue(&inidb, wxT("SIZEH"), sizeH); long valx = 0; - long valy = 0; + long valy = 0; long valw = 0; long valh = 0; @@ -362,7 +362,7 @@ EVT_MENU(MENU_VIEW_STOCKACCOUNTS, mmGUIFrame::OnViewStockAccounts) EVT_MENU(MENU_CATEGORY_RELOCATION, mmGUIFrame::OnCategoryRelocation) EVT_MENU(MENU_PAYEE_RELOCATION, mmGUIFrame::OnPayeeRelocation) - + // Added for easier ability to test new feature. // May be taken out in future after being added to Options Dialog. EVT_MENU(MENU_IGNORE_FUTURE_TRANSACTIONS, mmGUIFrame::OnIgnoreFutureTransactions) @@ -401,10 +401,10 @@ EVT_MENU(MENU_CUSTOM_SQL_REPORT_DELETE, mmGUIFrame::OnDeleteCustomSqlReport) EVT_MENU(MENU_TREEPOPUP_CUSTOM_SQL_REPORT_EDIT, mmGUIFrame::OnPopupEditCustomSqlReport) EVT_MENU(MENU_TREEPOPUP_CUSTOM_SQL_REPORT_DELETE, mmGUIFrame::OnPopupDeleteCustomSqlReport) - + /*Automatic processing of repeat transactions*/ EVT_TIMER(AUTO_REPEAT_TRANSACTIONS_TIMER_ID, mmGUIFrame::OnAutoRepeatTransactionsTimer) - + /* Recent Files */ EVT_MENU(MENU_RECENT_FILES_1, mmGUIFrame::OnRecentFiles_1) EVT_MENU(MENU_RECENT_FILES_2, mmGUIFrame::OnRecentFiles_2) @@ -478,11 +478,11 @@ wxDEFAULT_DIALOG_STYLE), m_core(core) { /****************** Message to be displayed****************** - + The next pages will help you create a new database. Your database file is stored with an extension of .mmb. - + As this file contains important financial information, we recommended creating daily backups with the Options setting: 'Backup before opening', and store your backups @@ -531,12 +531,12 @@ } //---------------------------------------------------------------------------- -mmGUIFrame::mmGUIFrame(const wxString& title, - const wxPoint& pos, +mmGUIFrame::mmGUIFrame(const wxString& title, + const wxPoint& pos, const wxSize& size - ) : - wxFrame(0, -1, title, pos, size), - gotoAccountID_(-1), + ) : + wxFrame(0, -1, title, pos, size), + gotoAccountID_(-1), homePageAccountSelect_(false), refreshRequested_(), autoRepeatTransactionsTimer_(this, AUTO_REPEAT_TRANSACTIONS_TIMER_ID), @@ -587,8 +587,8 @@ // Save default perspective m_perspective = m_mgr.SavePerspective(); - - wxString auiPerspective = mmDBWrapper::getINISettingValue(m_inidb.get(), + + wxString auiPerspective = mmDBWrapper::getINISettingValue(m_inidb.get(), wxT("AUIPERSPECTIVE"), m_perspective); m_mgr.LoadPerspective(auiPerspective); @@ -598,12 +598,12 @@ // enable or disable online update currency rate wxString enableCurrencyUpd = mmDBWrapper::getINISettingValue(m_inidb.get(), INIDB_UPDATE_CURRENCY_RATE, wxT("FALSE")); - if(enableCurrencyUpd == wxT("TRUE")) + if(enableCurrencyUpd == wxT("TRUE")) { if (menuItemOnlineUpdateCurRate_) menuItemOnlineUpdateCurRate_->Enable(true); - } - else + } + else { if (menuItemOnlineUpdateCurRate_) menuItemOnlineUpdateCurRate_->Enable(false); @@ -614,7 +614,7 @@ bool from_scratch = showBeginApp == wxT("TRUE"); wxFileName dbpath = from_scratch ? wxGetEmptyString() : mmDBWrapper::getLastDbPath(m_inidb.get()); - + if (from_scratch || !dbpath.IsOk()) { menuEnableItems(false); createHomePage(); @@ -651,7 +651,7 @@ if (m_db) m_db->Close(); /// Update the database according to user requirements - if (mmOptions::instance().databaseUpdated_ && + if (mmOptions::instance().databaseUpdated_ && (mmDBWrapper::getINISettingValue(m_inidb.get(), wxT("BACKUPDB_UPDATE"), wxT("FALSE")) == wxT("TRUE"))) { BackupDatabase(fileName_, true); @@ -747,7 +747,7 @@ bool autoExecuteSilent; bool requireExecution; - static const char sql[] = + static const char sql[] = "select " "b.BDID, " "b.ACCOUNTID, b.TOACCOUNTID, " @@ -770,7 +770,7 @@ mmBDTransactionHolder th; th.id_ = q1.GetInt(wxT("BDID")); th.nextOccurDate_ = mmGetStorageStringAsDate(q1.GetString(wxT("NEXTOCCURRENCEDATE"))); - + th.nextOccurStr_ = mmGetDateForDisplay(m_db.get(), th.nextOccurDate_); th.payeeID_ = q1.GetInt(wxT("PAYEEID")); th.transType_ = q1.GetString(wxT("TRANSCODE")); @@ -800,7 +800,7 @@ if (repeats >= BD_REPEATS_MULTIPLEX_BASE) // Auto Execute Silent mode { - autoExecuteManual = false; // Can only be manual or auto. Not both + autoExecuteManual = false; // Can only be manual or auto. Not both autoExecuteSilent = true; repeats -= BD_REPEATS_MULTIPLEX_BASE; } @@ -890,7 +890,7 @@ } //---------------------------------------------------------------------------- -/* +/* Save our settings to ini db. */ void mmGUIFrame::saveConfigFile() @@ -909,9 +909,9 @@ int valy = 0; int valw = 0; int valh = 0; - + this->GetPosition(&valx, &valy); - this->GetSize(&valw, &valh); + this->GetSize(&valw, &valh); wxString valxs = wxString::Format(wxT("%d"), valx); wxString valys = wxString::Format(wxT("%d"), valy); @@ -919,7 +919,7 @@ wxString valhs = wxString::Format(wxT("%d"), valh); m_inidb.get()->Begin(); - mmDBWrapper::setINISettingValue(m_inidb.get(), wxT("ORIGINX"), valxs); + mmDBWrapper::setINISettingValue(m_inidb.get(), wxT("ORIGINX"), valxs); mmDBWrapper::setINISettingValue(m_inidb.get(), wxT("ORIGINY"), valys); mmDBWrapper::setINISettingValue(m_inidb.get(), wxT("SIZEW"), valws); mmDBWrapper::setINISettingValue(m_inidb.get(), wxT("SIZEH"), valhs); @@ -988,15 +988,15 @@ { #if defined (__WXGTK__) || defined (__WXMAC__) // Under GTK, row lines look ugly - navTreeCtrl_ = new wxTreeCtrl( this, ID_NAVTREECTRL, + navTreeCtrl_ = new wxTreeCtrl( this, ID_NAVTREECTRL, wxDefaultPosition, wxSize(100, 100)); #else - navTreeCtrl_ = new wxTreeCtrl( this, ID_NAVTREECTRL, + navTreeCtrl_ = new wxTreeCtrl( this, ID_NAVTREECTRL, wxDefaultPosition, wxSize(100, 100), wxTR_SINGLE | wxTR_HAS_BUTTONS | wxTR_ROW_LINES ); #endif navTreeCtrl_->SetBackgroundColour(mmColors::navTreeBkColor); - + wxSize imageSize(16, 16); wxImageList* imageList_ = new wxImageList( imageSize.GetWidth(), imageSize.GetHeight() ); imageList_->Add(wxBitmap(house_xpm)); @@ -1016,7 +1016,7 @@ navTreeCtrl_->AssignImageList(imageList_); - homePanel = new wxPanel( this, ID_PANEL, + homePanel = new wxPanel( this, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL | wxTR_SINGLE | wxNO_BORDER); m_mgr.AddPane(navTreeCtrl_, wxAuiPaneInfo(). @@ -1055,7 +1055,7 @@ wxTreeItemId termAccount; if ( hasActiveTermAccounts() ) { - // Positioning for new type of accounts: Term Accounts + // Positioning for new type of accounts: Term Accounts termAccount = navTreeCtrl_->AppendItem(root, _("Term Accounts"), 9, 9); navTreeCtrl_->SetItemData(termAccount, new mmTreeItemData(wxT("Term Accounts"))); navTreeCtrl_->SetItemBold(termAccount, true); @@ -1142,7 +1142,7 @@ wxTreeItemId categsOverTime = navTreeCtrl_->AppendItem(reports, _("Where the Money Goes"), 4, 4); navTreeCtrl_->SetItemData(categsOverTime, new mmTreeItemData(wxT("Where the Money Goes"))); - + wxTreeItemId categsOverTimeCalMonth = navTreeCtrl_->AppendItem(categsOverTime, _("Last Calendar Month"), 4, 4); navTreeCtrl_->SetItemData(categsOverTimeCalMonth, new mmTreeItemData(wxT("Where the Money Goes - Month"))); @@ -1154,7 +1154,7 @@ wxTreeItemId categsOverTimeLast30 = navTreeCtrl_->AppendItem(categsOverTime, _("Last 30 Days"), 4, 4); navTreeCtrl_->SetItemData(categsOverTimeLast30, new mmTreeItemData(wxT("Where the Money Goes - 30 Days"))); - + wxTreeItemId categsOverTimeLastYear = navTreeCtrl_->AppendItem(categsOverTime, _("Last Year"), 4, 4); navTreeCtrl_->SetItemData(categsOverTimeLastYear, new mmTreeItemData(wxT("Where the Money Goes - Last Year"))); @@ -1182,13 +1182,13 @@ wxTreeItemId posCategsTimeLast30 = navTreeCtrl_->AppendItem(posCategs, _("Last 30 Days"), 4, 4); navTreeCtrl_->SetItemData(posCategsTimeLast30, new mmTreeItemData(wxT("Where the Money Comes From - 30 Days"))); - + wxTreeItemId posCategsTimeLastYear = navTreeCtrl_->AppendItem(posCategs, _("Last Year"), 4, 4); navTreeCtrl_->SetItemData(posCategsTimeLastYear, new mmTreeItemData(wxT("Where the Money Comes From - Last Year"))); wxTreeItemId posCategsTimeCurrentYear = navTreeCtrl_->AppendItem(posCategs, _("Current Year"), 4, 4); navTreeCtrl_->SetItemData(posCategsTimeCurrentYear, new mmTreeItemData(wxT("Where the Money Comes From - Current Year"))); - + if (financialYearIsDifferent()) { wxTreeItemId posCategsTimeLastFinancialYear = navTreeCtrl_->AppendItem(posCategs, _("Last Financial Year"), 4, 4); @@ -1201,7 +1201,7 @@ wxTreeItemId categs = navTreeCtrl_->AppendItem(reports, _("Categories"), 4, 4); navTreeCtrl_->SetItemData(categs, new mmTreeItemData(wxT("Categories - Over Time"))); - + wxTreeItemId categsCalMonth = navTreeCtrl_->AppendItem(categs, _("Last Calendar Month"), 4, 4); navTreeCtrl_->SetItemData(categsCalMonth, new mmTreeItemData(wxT("Categories - Month"))); @@ -1210,7 +1210,7 @@ wxTreeItemId categsTimeLast30 = navTreeCtrl_->AppendItem(categs, _("Last 30 Days"), 4, 4); navTreeCtrl_->SetItemData(categsTimeLast30, new mmTreeItemData(wxT("Categories - 30 Days"))); - + wxTreeItemId categsTimeLastYear = navTreeCtrl_->AppendItem(categs, _("Last Year"), 4, 4); navTreeCtrl_->SetItemData(categsTimeLastYear, new mmTreeItemData(wxT("Categories - Last Year"))); @@ -1238,7 +1238,7 @@ wxTreeItemId payeesOverTimeLast30 = navTreeCtrl_->AppendItem(payeesOverTime, _("Last 30 Days"), 4, 4); navTreeCtrl_->SetItemData(payeesOverTimeLast30, new mmTreeItemData(wxT("Payee Report - 30 Days"))); - + wxTreeItemId payeesOverTimeLastYear = navTreeCtrl_->AppendItem(payeesOverTime, _("Last Year"), 4, 4); navTreeCtrl_->SetItemData(payeesOverTimeLastYear, new mmTreeItemData(wxT("Payee Report - Last Year"))); @@ -1266,7 +1266,7 @@ wxTreeItemId incexpOverTimeLast30 = navTreeCtrl_->AppendItem(incexpOverTime, _("Last 30 Days"), 4, 4); navTreeCtrl_->SetItemData(incexpOverTimeLast30, new mmTreeItemData(wxT("Income vs Expenses - 30 Days"))); - + wxTreeItemId incexpOverTimeLastYear = navTreeCtrl_->AppendItem(incexpOverTime, _("Last Year"), 4, 4); navTreeCtrl_->SetItemData(incexpOverTimeLastYear, new mmTreeItemData(wxT("Income vs Expenses - Last Year"))); @@ -1290,14 +1290,14 @@ navTreeCtrl_->SetItemData(transactionList, new mmTreeItemData(wxT("Transaction Report"))); /////////////////////////////////////////////////////////////////// - + if (m_db && mmIniOptions::instance().enableBudget_) { static const char sql[] = "select BUDGETYEARID, BUDGETYEARNAME " "from BUDGETYEAR_V1 " "order by BUDGETYEARNAME"; - + wxTreeItemId budgetPerformance; wxTreeItemId budgetSetupPerformance; @@ -1315,27 +1315,27 @@ int id = q1.GetInt(wxT("BUDGETYEARID")); const wxString name = q1.GetString(wxT("BUDGETYEARNAME")); - + wxTreeItemId bYear = navTreeCtrl_->AppendItem(budgeting, name, 3, 3); navTreeCtrl_->SetItemData(bYear, new mmTreeItemData(id, true)); - - // Only add YEARS for Budget Performance + + // Only add YEARS for Budget Performance if (name.length() < 5) { wxTreeItemId bYearData = navTreeCtrl_->AppendItem(budgetPerformance, name, 4, 4); navTreeCtrl_->SetItemData(bYearData, new mmTreeItemData(id, true)); - } + } wxTreeItemId bYearSetupData = navTreeCtrl_->AppendItem(budgetSetupPerformance, name, 4, 4); navTreeCtrl_->SetItemData(bYearSetupData, new mmTreeItemData(id, true)); } q1.Finalize(); - - //TODO: Set up as a permanent user option + + //TODO: Set up as a permanent user option if (expandedBudgetingNavTree_) navTreeCtrl_->Expand(budgeting); } - + /////////////////////////////////////////////////////////////////// wxTreeItemId cashFlow = navTreeCtrl_->AppendItem(reports, _("Cash Flow"), 4, 4); navTreeCtrl_->SetItemData(cashFlow, new mmTreeItemData(wxT("Cash Flow"))); @@ -1388,10 +1388,10 @@ { int selectedImage = 1; if (pCA->status_ == mmAccount::MMEX_Closed) - selectedImage = 11; + selectedImage = 11; else if (pCA->favoriteAcct_) - selectedImage = 10; - + selectedImage = 10; + wxTreeItemId tacct = navTreeCtrl_->AppendItem(accounts, pCA->name_, selectedImage, selectedImage); navTreeCtrl_->SetItemData(tacct, new mmTreeItemData(pCA->id_, false)); } @@ -1399,16 +1399,16 @@ // Term Accounts else if (account->acctType_ == ACCOUNT_TYPE_TERM) { - const mmAccount* pTA = account; + const mmAccount* pTA = account; if ((vAccts == wxT("Open") && pTA->status_ == mmAccount::MMEX_Open) || (vAccts == wxT("Favorites") && pTA->favoriteAcct_) || (vAccts == wxT("ALL"))) { int selectedImage = 9; if (pTA->status_ == mmAccount::MMEX_Closed) - selectedImage = 13; + selectedImage = 13; else if (pTA->favoriteAcct_) - selectedImage = 12; + selectedImage = 12; wxTreeItemId tacct = navTreeCtrl_->AppendItem(termAccount, pTA->name_, selectedImage, selectedImage); navTreeCtrl_->SetItemData(tacct, new mmTreeItemData(pTA->id_, false)); @@ -1437,7 +1437,7 @@ menuBar_->FindItem(MENU_VIEW_TERMACCOUNTS)->Enable(true); if (mmIniOptions::instance().expandTermTree_ || expandTermAccounts) navTreeCtrl_->Expand(termAccount); - } else + } else menuBar_->FindItem(MENU_VIEW_TERMACCOUNTS)->Enable(false); } @@ -1455,14 +1455,14 @@ int year = today.GetYear(); if (today.GetMonth() < monthNum) year -- ; - long dayNum; + long dayNum; wxString dayNumStr = mmOptions::instance().financialYearStartDayString_; dayNumStr.ToLong(&dayNum); - if ( (dayNum < 1) || (dayNum > 31 ) ) { + if ((dayNum < 1) || (dayNum > 31 )) { dayNum = 1; - } else if ( ( (monthNum == wxDateTime::Feb) && (dayNum > 28) ) || - ( ((monthNum == wxDateTime::Sep) || (monthNum == wxDateTime::Apr) || - (monthNum == wxDateTime::Jun) || (monthNum == wxDateTime::Nov)) && (dayNum > 29) ) ) + } else if (((monthNum == wxDateTime::Feb) && (dayNum > 28)) || + (((monthNum == wxDateTime::Sep) || (monthNum == wxDateTime::Apr) || + (monthNum == wxDateTime::Jun) || (monthNum == wxDateTime::Nov)) && (dayNum > 29))) { dayNum = 1; } @@ -1500,7 +1500,7 @@ bool result = false; if (tk1 == wxT("Custom") && tk2 == wxT("Report") && indexStr.IsNumber()) { - long index; + long index; indexStr.ToLong(&index); customSqlReportID = index; result = true; @@ -1525,7 +1525,7 @@ { wxTreeItemId id = event.GetItem(); mmTreeItemData* iData = dynamic_cast<mmTreeItemData*>(navTreeCtrl_->GetItemData(id)); - + if (iData->getString() == NAVTREECTRL_REPORTS) expandedReportNavTree_ = false; else if (iData->getString() == NAVTREECTRL_CUSTOM_REPORTS) @@ -1547,7 +1547,7 @@ mmTreeItemData* iData = dynamic_cast<mmTreeItemData*>(navTreeCtrl_->GetItemData(id)); selectedItemData_ = iData; - + if (!iData) return; if (!iData->isStringData()) @@ -1559,7 +1559,7 @@ Freeze(); wxTreeItemId idparent = navTreeCtrl_->GetItemParent(id); mmTreeItemData* iParentData = dynamic_cast<mmTreeItemData*>(navTreeCtrl_->GetItemData(idparent)); - if (iParentData->getString() == wxT("Budget Performance")) + if (iParentData->getString() == wxT("Budget Performance")) { wxProgressDialog proDlg(_("Budget Performance"), reportWaitingMsg, 100, this); mmPrintableBase* rs = new mmReportBudgetingPerformance(m_core.get(), this, data); @@ -1567,8 +1567,8 @@ menuPrintingEnable(true); createReportsPage(rs); proDlg.Update(95); - } - else if (iParentData->getString() == wxT("Budget Setup Performance")) + } + else if (iParentData->getString() == wxT("Budget Setup Performance")) { wxProgressDialog proDlg(_("Budget Category Summary"), reportWaitingMsg, 100, this); mmPrintableBase* rs = new mmReportBudgetCategorySummary(m_core.get(), this, data); @@ -1576,8 +1576,8 @@ menuPrintingEnable(true); createReportsPage(rs); proDlg.Update(95); - } - else + } + else { wxProgressDialog proDlg(_("Budget Setup"), reportWaitingMsg, 100, this); createBudgetingPage(data); @@ -1587,7 +1587,7 @@ } else { - boost::shared_ptr<mmAccount> pAccount = m_core->getAccountSharedPtr(data); + boost::shared_ptr<mmAccount> pAccount = m_core->getAccountSharedPtr(data); if (pAccount) { wxString acctType = pAccount->acctType_; @@ -1617,7 +1617,7 @@ } } } - else + else { if (iData->getString() == wxT("Home Page")) { @@ -1659,7 +1659,7 @@ //======================================================================== int customSqlReportID; // Define before all the if...else statements //======================================================================== - + if (iData->getString() == wxT("Summary of Accounts")) { mmPrintableBase* rs = new mmReportSummary(m_core.get(), this); @@ -2080,7 +2080,7 @@ else if (iData->getString() == wxT("Income vs Expenses - Current Financial Year")) { wxDateTime dtBegin = wxDateTime(getUserDefinedFinancialYear()); - + wxDateTime today = wxDateTime::Now(); int year = today.GetYear(); if (today.GetMonth() < dtBegin.GetMonth()) year --; @@ -2111,7 +2111,7 @@ numDays = wxDateTime::GetNumberOfDays((wxDateTime::Month)(wxDateTime::Dec)); else numDays = wxDateTime::GetNumberOfDays((wxDateTime::Month)(cm-1)); - + wxDateTime prevMonthEnd = today.Subtract(wxDateSpan::Days(today.GetDay())); wxDateTime dtEnd = prevMonthEnd; wxDateTime dtBegin = prevMonthEnd.Subtract(wxDateSpan::Days(numDays)); @@ -2128,7 +2128,7 @@ wxDateTime prevMonthEnd = today; wxDateTime dtEnd = today; wxDateTime dtBegin = today.Subtract(wxDateSpan::Days(30)); - + wxString title = _("Payees - Last 30 Days"); mmPrintableBase* rs = new mmReportPayeeExpenses(m_core.get(), false, dtBegin, dtEnd, title); menuPrintingEnable(true); @@ -2228,7 +2228,7 @@ menuPrintingEnable(true); createReportsPage(report); } - + else if (iData->getString() == wxT("Cash Flow - With Term Accounts")) { mmReportCashFlow* report = new mmReportCashFlow(m_core.get(), this); @@ -2268,12 +2268,12 @@ { if (selectedItemData_) { - int data = selectedItemData_->getData(); - boost::shared_ptr<mmAccount> pAccount = m_core->getAccountSharedPtr(data); + int data = selectedItemData_->getData(); + boost::shared_ptr<mmAccount> pAccount = m_core->getAccountSharedPtr(data); if (pAccount) { wxString website = pAccount->website_; - if (!website.IsEmpty()) wxLaunchDefaultBrowser(website); + if (!website.IsEmpty()) wxLaunchDefaultBrowser(website); return; } } @@ -2285,7 +2285,7 @@ if (selectedItemData_) { int data = selectedItemData_->getData(); - boost::shared_ptr<mmAccount> pAccount = m_core->getAccountSharedPtr(data); + boost::shared_ptr<mmAccount> pAccount = m_core->getAccountSharedPtr(data); if (pAccount) { wxString acctType = pAccount->acctType_; @@ -2308,7 +2308,7 @@ if (selectedItemData_) { int data = selectedItemData_->getData(); - boost::shared_ptr<mmAccount> pAccount = m_core->getAccountSharedPtr(data); + boost::shared_ptr<mmAccount> pAccount = m_core->getAccountSharedPtr(data); if (pAccount) { wxString acctType = pAccount->acctType_; @@ -2318,7 +2318,7 @@ if ( dlg.ShowModal() == wxID_OK ) { createHomePage(); - updateNavTreeControl(); + updateNavTreeControl(); } } } @@ -2331,25 +2331,25 @@ if (selectedItemData_) { int data = selectedItemData_->getData(); - boost::shared_ptr<mmAccount> pAccount = m_core->getAccountSharedPtr(data); + boost::shared_ptr<mmAccount> pAccount = m_core->getAccountSharedPtr(data); if (pAccount) { - wxMessageDialog msgDlg(this, + wxMessageDialog msgDlg(this, _("Do you really want to delete the account?"), _("Confirm Account Deletion"), wxYES_NO | wxNO_DEFAULT | wxICON_EXCLAMATION); if (msgDlg.ShowModal() == wxID_YES) { m_core->deleteAccount(pAccount->id_); - m_core->bTransactionList_.deleteTransactions(pAccount->id_); + m_core->bTransactionList_.deleteTransactions(pAccount->id_); updateNavTreeControl(); if (!refreshRequested_) { refreshRequested_ = true; wxCommandEvent ev(wxEVT_COMMAND_MENU_SELECTED, MENU_ACCTLIST); - GetEventHandler()->AddPendingEvent(ev); + GetEventHandler()->AddPendingEvent(ev); } - } + } } } } @@ -2368,13 +2368,13 @@ { mmTreeItemData* iData = dynamic_cast<mmTreeItemData*>(navTreeCtrl_->GetItemData(id)); selectedItemData_ = iData; - + if (!iData->isStringData()) { int data = iData->getData(); if (!iData->isBudgetingNode()) { - boost::shared_ptr<mmAccount> pAccount = m_core->getAccountSharedPtr(data); + boost::shared_ptr<mmAccount> pAccount = m_core->getAccountSharedPtr(data); if (pAccount) { wxString acctType = pAccount->acctType_; @@ -2401,10 +2401,10 @@ } } } - else + else { - if (iData->getString() == wxT("Bank Accounts") || - iData->getString() == wxT("Term Accounts") || + if (iData->getString() == wxT("Bank Accounts") || + iData->getString() == wxT("Term Accounts") || iData->getString() == wxT("Stocks")) { // Create for Bank Term & Stock Accounts @@ -2413,7 +2413,7 @@ //New Account // //Delete Account // //Edit Account // - //Export > // + //Export > // //CSV Files // //QIF Files // //Import > // @@ -2481,7 +2481,7 @@ //Get current settings for view accounts wxString vAccts = mmDBWrapper::getINISettingValue(m_inidb.get(), wxT("VIEWACCOUNTS"), wxT("ALL")); - //Set view ALL + //Set view ALL mmDBWrapper::setINISettingValue(m_inidb.get(), wxT("VIEWACCOUNTS"), wxT("ALL")); //Refresh Navigation Panel @@ -2497,7 +2497,7 @@ //Get current settings for view accounts wxString vAccts = mmDBWrapper::getINISettingValue(m_inidb.get(), wxT("VIEWACCOUNTS"), wxT("ALL")); - //Set view ALL + //Set view ALL mmDBWrapper::setINISettingValue(m_inidb.get(), wxT("VIEWACCOUNTS"), wxT("Favorites")); //Refresh Navigation Panel @@ -2513,7 +2513,7 @@ //Get current settings for view accounts wxString vAccts = mmDBWrapper::getINISettingValue(m_inidb.get(), wxT("VIEWACCOUNTS"), wxT("ALL")); - //Set view ALL + //Set view ALL mmDBWrapper::setINISettingValue(m_inidb.get(), wxT("VIEWACCOUNTS"), wxT("Open")); //Refresh Navigation Panel @@ -2528,9 +2528,9 @@ { wxSizer *sizer = cleanupHomePanel(); - panelCurrent_ = new mmBudgetingPanel(m_db.get(), m_inidb.get(), m_core.get(), this, budgetYearID, + panelCurrent_ = new mmBudgetingPanel(m_db.get(), m_inidb.get(), m_core.get(), this, budgetYearID, homePanel, ID_PANEL3, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); - + sizer->Add(panelCurrent_, 1, wxGROW|wxALL, 1); homePanel->Layout(); @@ -2540,26 +2540,26 @@ void mmGUIFrame::createHomePage() { wxSizer *sizer = cleanupHomePanel(); - + if (panelCurrent_) { //panelCurrent_->DestroyChildren(); //panelCurrent_->SetSizer(NULL); panelCurrent_ = 0; } - panelCurrent_ = new mmHomePagePanel(this, - m_db.get(), + panelCurrent_ = new mmHomePagePanel(this, + m_db.get(), m_inidb.get(), - m_core.get(), + m_core.get(), m_topCategories, - homePanel, - ID_PANEL3, - wxDefaultPosition, - wxDefaultSize, + homePanel, + ID_PANEL3, + wxDefaultPosition, + wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL); - + sizer->Add(panelCurrent_, 1, wxGROW|wxALL, 1); - + homePanel->Layout(); refreshRequested_ = false; } @@ -2568,12 +2568,12 @@ void mmGUIFrame::createReportsPage(mmPrintableBase* rs) { wxSizer *sizer = cleanupHomePanel(); - - panelCurrent_ = new mmReportsPanel(this, m_db.get(), rs, homePanel, ID_PANEL3, + + panelCurrent_ = new mmReportsPanel(this, m_db.get(), rs, homePanel, ID_PANEL3, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL); - + sizer->Add(panelCurrent_, 1, wxGROW|wxALL, 1); - + homePanel->Layout(); } //---------------------------------------------------------------------------- @@ -2581,12 +2581,12 @@ void mmGUIFrame::createHelpPage() { wxSizer *sizer = cleanupHomePanel(); - - panelCurrent_ = new mmHelpPanel(this, m_db.get(), homePanel, ID_PANEL3, + + panelCurrent_ = new mmHelpPanel(this, m_db.get(), homePanel, ID_PANEL3, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL); - + sizer->Add(panelCurrent_, 1, wxGROW|wxALL, 1); - + homePanel->Layout(); } //---------------------------------------------------------------------------- @@ -2620,7 +2620,7 @@ menuRecentFiles_ = new wxMenu; menu_file->Append(MENU_RECENT_FILES, _("&Recent Files..."), menuRecentFiles_); - // Note: menuRecentFiles_ will be constructed by the class: RecentDatabaseFiles::setMenuFileItems() + // Note: menuRecentFiles_ will be constructed by the class: RecentDatabaseFiles::setMenuFileItems() wxMenuItem* menuClearRecentFiles = new wxMenuItem(menu_file, MENU_RECENT_FILES_CLEAR,_("&Clear Recent Files")); menuClearRecentFiles->SetBitmap(toolBarBitmaps[9]); menu_file->Append(menuClearRecentFiles); @@ -2638,20 +2638,20 @@ menu_file->Append(MENU_IMPORT, _("&Import"), importMenu); menu_file->AppendSeparator(); - - wxMenuItem* menuItemPrintSetup = new wxMenuItem(menu_file, MENU_PRINT_PAGE_SETUP, + + wxMenuItem* menuItemPrintSetup = new wxMenuItem(menu_file, MENU_PRINT_PAGE_SETUP, _("Page Set&up..."), _("Setup page printing options")); menuItemPrintSetup->SetBitmap(toolBarBitmaps[7]); - menu_file->Append(menuItemPrintSetup); - + menu_file->Append(menuItemPrintSetup); + wxMenu* printPreviewMenu = new wxMenu; - printPreviewMenu->Append(MENU_PRINT_PREVIEW_REPORT, + printPreviewMenu->Append(MENU_PRINT_PREVIEW_REPORT, _("Current &View"), _("Preview current report")); menu_file->Append(MENU_PRINT_PREVIEW, _("Print Pre&view..."), printPreviewMenu); wxMenu* printMenu = new wxMenu; - wxMenuItem* menuItemPrintView = new wxMenuItem(printMenu, MENU_PRINT_REPORT, + wxMenuItem* menuItemPrintView = new wxMenuItem(printMenu, MENU_PRINT_REPORT, _("Current &View"), _("Print current report")); printMenu->Append(menuItemPrintView); @@ -2659,30 +2659,30 @@ menu_file->AppendSeparator(); - wxMenuItem* menuItemQuit = new wxMenuItem(menu_file, wxID_EXIT, + wxMenuItem* menuItemQuit = new wxMenuItem(menu_file, wxID_EXIT, _("E&xit\tAlt-X"), _("Quit this program")); menuItemQuit->SetBitmap(wxBitmap(exit_xpm)); menu_file->Append(menuItemQuit); - + // Create the required menu items wxMenu *menuView = new wxMenu; - wxMenuItem* menuItemToolbar = new wxMenuItem(menuView, MENU_VIEW_TOOLBAR, + wxMenuItem* menuItemToolbar = new wxMenuItem(menuView, MENU_VIEW_TOOLBAR, _("&Toolbar"), _("Show/Hide the toolbar"), wxITEM_CHECK); - wxMenuItem* menuItemLinks = new wxMenuItem(menuView, MENU_VIEW_LINKS, + wxMenuItem* menuItemLinks = new wxMenuItem(menuView, MENU_VIEW_LINKS, _("&Navigation"), _("Show/Hide the Navigation tree control"), wxITEM_CHECK); - wxMenuItem* menuItemBankAccount = new wxMenuItem(menuView, MENU_VIEW_BANKACCOUNTS, + wxMenuItem* menuItemBankAccount = new wxMenuItem(menuView, MENU_VIEW_BANKACCOUNTS, _("&Bank Accounts"), _("Show/Hide Bank Accounts on Summary page"), wxITEM_CHECK); - wxMenuItem* menuItemTermAccount = new wxMenuItem(menuView, MENU_VIEW_TERMACCOUNTS, + wxMenuItem* menuItemTermAccount = new wxMenuItem(menuView, MENU_VIEW_TERMACCOUNTS, _("Term &Accounts"), _("Show/Hide Term Accounts on Summary page"), wxITEM_CHECK); - wxMenuItem* menuItemStockAccount = new wxMenuItem(menuView, MENU_VIEW_STOCKACCOUNTS, + wxMenuItem* menuItemStockAccount = new wxMenuItem(menuView, MENU_VIEW_STOCKACCOUNTS, _("&Stock Accounts"), _("Show/Hide Stock Accounts on Summary page"), wxITEM_CHECK); wxMenuItem* menuItemBudgetFinancialYears = new wxMenuItem(menuView, MENU_VIEW_BUDGET_FINANCIAL_YEARS, _("Budgets: As &Financial Years"), _("Display Budgets in Financial Year Format"), wxITEM_CHECK); wxMenuItem* menuItemBudgetTransferTotal = new wxMenuItem(menuView, MENU_VIEW_BUDGET_TRANSFER_TOTAL, _("Budgets: &Include Transfers in Totals"), _("Include the transfer transactions in the Budget Totals"), wxITEM_CHECK); - wxMenuItem* menuItemBudgetSetupWithoutSummary = new wxMenuItem(menuView, MENU_VIEW_BUDGET_SETUP_SUMMARY, + wxMenuItem* menuItemBudgetSetupWithoutSummary = new wxMenuItem(menuView, MENU_VIEW_BUDGET_SETUP_SUMMARY, _("Budget Setup: &Without Summaries"), _("Display the Budget Setup without category summaries"), wxITEM_CHECK); - wxMenuItem* menuItemBudgetCategorySummary = new wxMenuItem(menuView, MENU_VIEW_BUDGET_CATEGORY_SUMMARY, + wxMenuItem* menuItemBudgetCategorySummary = new wxMenuItem(menuView, MENU_VIEW_BUDGET_CATEGORY_SUMMARY, _("Budget Summary: Include &Categories"), _("Include the categories in the Budget Category Summary"), wxITEM_CHECK); wxMenuItem* menuItemIgnoreFutureTransactions = new wxMenuItem(menuView, MENU_IGNORE_FUTURE_TRANSACTIONS, _("Ignore F&uture Transactions"), _("Ignore Future transactions"), wxITEM_CHECK); @@ -2715,34 +2715,34 @@ if (mmIniOptions::instance().enableAddAccount_) { - wxMenuItem* menuItemNewAcct = new wxMenuItem(menuAccounts, MENU_NEWACCT, + wxMenuItem* menuItemNewAcct = new wxMenuItem(menuAccounts, MENU_NEWACCT, _("New &Account"), _("New Account")); menuItemNewAcct->SetBitmap(toolBarBitmaps[3]); - menuAccounts->Append(menuItemNewAcct); + menuAccounts->Append(menuItemNewAcct); } - wxMenuItem* menuItemAcctList = new wxMenuItem(menuAccounts, MENU_ACCTLIST, + wxMenuItem* menuItemAcctList = new wxMenuItem(menuAccounts, MENU_ACCTLIST, _("Account &List"), _("Show Account List")); menuItemAcctList->SetBitmap(toolBarBitmaps[4]); - wxMenuItem* menuItemAcctEdit = new wxMenuItem(menuAccounts, MENU_ACCTEDIT, + wxMenuItem* menuItemAcctEdit = new wxMenuItem(menuAccounts, MENU_ACCTEDIT, _("&Edit Account"), _("Edit Account")); menuItemAcctEdit->SetBitmap(toolBarBitmaps[8]); if (mmIniOptions::instance().enableDeleteAccount_) { - wxMenuItem* menuItemAcctDelete = new wxMenuItem(menuAccounts, MENU_ACCTDELETE, + wxMenuItem* menuItemAcctDelete = new wxMenuItem(menuAccounts, MENU_ACCTDELETE, _("&Delete Account"), _("Delete Account from database")); menuItemAcctDelete->SetBitmap(toolBarBitmaps[9]); - menuAccounts->Append(menuItemAcctDelete); + menuAccounts->Append(menuItemAcctDelete); } - menuAccounts->Append(menuItemAcctList); - menuAccounts->Append(menuItemAcctEdit); - + menuAccounts->Append(menuItemAcctList); + menuAccounts->Append(menuItemAcctEdit); + // Tools Menu wxMenu *menuTools = new wxMenu; - + wxMenuItem* menuItemCateg = new wxMenuItem(menuTools, MENU_ORGCATEGS, _("Organize &Categories..."), _("Organize Categories")); menuItemCateg->SetBitmap(wxBitmap(categoryedit_xpm)); @@ -2751,15 +2751,15 @@ wxMenuItem* menuItemPayee = new wxMenuItem(menuTools, MENU_ORGPAYEE, _("Organize &Payees..."), _("Organize Payees")); menuItemPayee->SetBitmap(wxBitmap(user_edit_xpm)); - menuTools->Append(menuItemPayee); + menuTools->Append(menuItemPayee); - wxMenuItem* menuItemCurrency = new wxMenuItem(menuTools, MENU_CURRENCY, + wxMenuItem* menuItemCurrency = new wxMenuItem(menuTools, MENU_CURRENCY, _("Organize Currency..."), _("Organize Currency")); menuItemCurrency->SetBitmap(wxBitmap(money_dollar_xpm)); menuTools->Append(menuItemCurrency); wxMenu *menuRelocation = new wxMenu; - wxMenuItem* menuItemCategoryRelocation = new wxMenuItem(menuRelocation, + wxMenuItem* menuItemCategoryRelocation = new wxMenuItem(menuRelocation, MENU_CATEGORY_RELOCATION,_("&Categories..."),_("Reassign all categories to another category")); menuItemCategoryRelocation->SetBitmap(wxBitmap(wrench_xpm)); wxMenuItem* menuItemPayeeRelocation = new wxMenuItem(menuRelocation, @@ -2770,21 +2770,21 @@ menuTools->AppendSubMenu(menuRelocation,_("Relocation of..."),_("Relocate Categories && Payees")); menuTools->AppendSeparator(); - + if (mmIniOptions::instance().enableBudget_) { - wxMenuItem* menuItemBudgeting = new wxMenuItem(menuTools, MENU_BUDGETSETUPDIALOG, + wxMenuItem* menuItemBudgeting = new wxMenuItem(menuTools, MENU_BUDGETSETUPDIALOG, _("&Budget Setup"), _("Budget Setup")); menuItemBudgeting->SetBitmap(wxBitmap(calendar_xpm)); - menuTools->Append(menuItemBudgeting); + menuTools->Append(menuItemBudgeting); } if (mmIniOptions::instance().enableRepeatingTransactions_) { - wxMenuItem* menuItemBillsDeposits = new wxMenuItem(menuTools, MENU_BILLSDEPOSITS, + wxMenuItem* menuItemBillsDeposits = new wxMenuItem(menuTools, MENU_BILLSDEPOSITS, _("&Repeating Transactions"), _("Bills && Deposits")); menuItemBillsDeposits->SetBitmap(wxBitmap(clock_xpm)); - menuTools->Append(menuItemBillsDeposits); + menuTools->Append(menuItemBillsDeposits); } if (mmIniOptions::instance().enableAssets_) @@ -2796,7 +2796,7 @@ menuTools->AppendSeparator(); - wxMenuItem* menuItemTransactions = new wxMenuItem(menuTools, MENU_TRANSACTIONREPORT, + wxMenuItem* menuItemTransactions = new wxMenuItem(menuTools, MENU_TRANSACTIONREPORT, _("&Transaction Report Filter..."), _("Transaction Report Filter")); menuItemTransactions->SetBitmap(wxBitmap(filter_xpm)); menuTools->Append(menuItemTransactions); @@ -2805,12 +2805,12 @@ // Create the head menu wxMenu *menuCustomSqlReports = new wxMenu; - // create the menu items - wxMenuItem* menuItemCustomReportNew = new wxMenuItem(menuCustomSqlReports, + // create the menu items + wxMenuItem* menuItemCustomReportNew = new wxMenuItem(menuCustomSqlReports, MENU_CUSTOM_SQL_REPORT_NEW, _("New..."),_("Create a new SQL report")); - wxMenuItem* menuItemCustomReportEdit = new wxMenuItem(menuCustomSqlReports, + wxMenuItem* menuItemCustomReportEdit = new wxMenuItem(menuCustomSqlReports, MENU_CUSTOM_SQL_REPORT_EDIT, _("Edit..."),_("Edit an existing SQL report")); - wxMenuItem* menuItemCustomReportDelete = new wxMenuItem(menuCustomSqlReports, + wxMenuItem* menuItemCustomReportDelete = new wxMenuItem(menuCustomSqlReports, MENU_CUSTOM_SQL_REPORT_DELETE, _("Delete..."),_("Remove a file from the Custom SQL Reports menu")); // Add menu items to the Custom SQL Reports menu menuCustomSqlReports->Append(menuItemCustomReportNew); @@ -2821,34 +2821,34 @@ menuTools->AppendSeparator(); - wxMenuItem* menuItemOptions = new wxMenuItem(menuTools, wxID_PREFERENCES, + wxMenuItem* menuItemOptions = new wxMenuItem(menuTools, wxID_PREFERENCES, _("&Options..."), _("Show the Options Dialog")); menuItemOptions->SetBitmap(wxBitmap(wrench_xpm)); menuTools->Append(menuItemOptions); menuTools->AppendSeparator(); - wxMenuItem* menuItemConvertDB = new wxMenuItem(menuTools, MENU_CONVERT_ENC_DB, - _("Convert Encrypted &DB"), + wxMenuItem* menuItemConvertDB = new wxMenuItem(menuTools, MENU_CONVERT_ENC_DB, + _("Convert Encrypted &DB"), _("Convert Encrypted DB to Non-Encrypted DB")); menuTools->Append(menuItemConvertDB); menuTools->AppendSeparator(); - menuItemOnlineUpdateCurRate_ = new wxMenuItem(menuTools, MENU_ONLINE_UPD_CURRENCY_RATE, - _("Online &Update Currency Rate"), + menuItemOnlineUpdateCurRate_ = new wxMenuItem(menuTools, MENU_ONLINE_UPD_CURRENCY_RATE, + _("Online &Update Currency Rate"), _("Online update currency rate")); menuTools->Append(menuItemOnlineUpdateCurRate_); // Help Menu wxMenu *menuHelp = new wxMenu; - wxMenuItem* menuItemHelp = new wxMenuItem(menuTools, wxID_HELP, + wxMenuItem* menuItemHelp = new wxMenuItem(menuTools, wxID_HELP, _("&Help\tCtrl-F1"), _("Show the Help file")); menuItemHelp->SetBitmap(wxBitmap(help_xpm)); menuHelp->Append(menuItemHelp); - wxMenuItem* menuItemAppStart = new wxMenuItem(menuTools, MENU_SHOW_APPSTART, + wxMenuItem* menuItemAppStart = new wxMenuItem(menuTools, MENU_SHOW_APPSTART, _("&Show App Start Dialog"), _("App Start Dialog")); menuItemAppStart->SetBitmap(wxBitmap(appstart_xpm)); menuHelp->Append(menuItemAppStart); @@ -2857,7 +2857,7 @@ if (mmIniOptions::instance().enableCheckForUpdates_) { - wxMenuItem* menuItemCheck = new wxMenuItem(menuTools, MENU_CHECKUPDATE, + wxMenuItem* menuItemCheck = new wxMenuItem(menuTools, MENU_CHECKUPDATE, _("Check for &Updates"), _("Check For Updates")); menuItemCheck->SetBitmap(wxBitmap(checkupdate_xpm)); menuHelp->Append(menuItemCheck); @@ -2873,18 +2873,18 @@ if (mmIniOptions::instance().enableBeNotifiedForNewReleases_) { - wxMenuItem* menuItemNotify = new wxMenuItem(menuTools, MENU_ANNOUNCEMENTMAILING, + wxMenuItem* menuItemNotify = new wxMenuItem(menuTools, MENU_ANNOUNCEMENTMAILING, _("Register/View Release &Notifications."), _("Sign up to Notification Mailing List or View existing announcements.")); menuItemNotify->SetBitmap(wxBitmap(notify_xpm)); - menuHelp->Append(menuItemNotify); + menuHelp->Append(menuItemNotify); } - - wxMenuItem* menuItemFacebook = new wxMenuItem(menuTools, MENU_FACEBOOK, + + wxMenuItem* menuItemFacebook = new wxMenuItem(menuTools, MENU_FACEBOOK, _("Visit us on Facebook"), _("Visit us on Facebook")); menuItemFacebook->SetBitmap(wxBitmap(facebook_xpm)); - menuHelp->Append(menuItemFacebook); - - wxMenuItem* menuItemAbout = new wxMenuItem(menuTools, wxID_ABOUT, + menuHelp->Append(menuItemFacebook); + + wxMenuItem* menuItemAbout = new wxMenuItem(menuTools, wxID_ABOUT, _("&About..."), _("Show about dialog")); menuItemAbout->SetBitmap(wxBitmap(about_xpm)); menuHelp->Append(menuItemAbout); @@ -2938,7 +2938,7 @@ toolBar_->AddTool(MENU_TRANSACTIONREPORT, _("Transaction Report Filter"), toolBarBitmaps[8], _("Transaction Report Filter")); toolBar_->AddSeparator(); toolBar_->AddTool(MENU_CUSTOM_SQL_REPORT_NEW, _("Custom SQL Manager"), toolBarBitmaps[9], _("Create new Custom SQL Reports")); - + // after adding the buttons to the toolbar, must call Realize() to reflect changes toolBar_->Realize(); } @@ -2954,7 +2954,7 @@ m_db.reset(); /// Update the database according to user requirements - if (mmOptions::instance().databaseUpdated_ && + if (mmOptions::instance().databaseUpdated_ && (mmDBWrapper::getINISettingValue(m_inidb.get(), wxT("BACKUPDB_UPDATE"), wxT("FALSE")) == wxT("TRUE"))) { BackupDatabase(fileName_, true); @@ -2994,7 +2994,7 @@ if (!mmDBWrapper::checkDBVersion(m_db.get())) { wxString note = mmex::getProgramName() + _(" - No File opened "); - this->SetTitle(note); + this->SetTitle(note); wxMessageBox(_("Sorry. The Database version is too old or Database password is incorrect"), dialogErrorMessageHeading, wxICON_EXCLAMATION); @@ -3042,13 +3042,13 @@ else // open of existing database failed { wxString note = mmex::getProgramName() + _(" - No File opened "); - this->SetTitle(note); - + this->SetTitle(note); + wxString msgStr = _("Cannot locate previously opened database.\n"); if (!passwordCheckPassed) msgStr = _("Password not entered for encrypted Database.\n"); - wxMessageDialog msgDlg(this, msgStr + _("Do you want to browse to locate another file?"), + wxMessageDialog msgDlg(this, msgStr + _("Do you want to browse to locate another file?"), dialogErrorMessageHeading, wxYES_NO | wxYES_DEFAULT); if (msgDlg.ShowModal() == wxID_YES) { @@ -3066,8 +3066,8 @@ void mmGUIFrame::openDataBase(const wxString& fileName) { - wxProgressDialog dlg(_("Please Wait"), - _("Opening Database File && Verifying Integrity"), 100, this, + wxProgressDialog dlg(_("Please Wait"), + _("Opening Database File && Verifying Integrity"), 100, this, wxPD_AUTO_HIDE | wxPD_APP_MODAL | wxPD_SMOOTH ); mmDBWrapper::initDB(m_db.get(), &dlg); @@ -3084,11 +3084,11 @@ m_topCategories.Clear(); mmIniOptions::instance().loadInfoOptions(m_db.get()); - if (m_db) + if (m_db) { fileName_ = fileName; - } - else + } + else { fileName_.Clear(); password_.Clear(); @@ -3105,22 +3105,22 @@ void mmGUIFrame::openFile(const wxString& fileName, bool openingNew, const wxString &password) { createDataStore(fileName, password, openingNew); - - if (m_db) + + if (m_db) { menuEnableItems(true); menuPrintingEnable(false); - autoRepeatTransactionsTimer_.Start(REPEAT_TRANS_DELAY_TIME, wxTIMER_ONE_SHOT); + autoRepeatTransactionsTimer_.Start(REPEAT_TRANS_DELAY_TIME, wxTIMER_ONE_SHOT); } - + updateNavTreeControl(); - if (!refreshRequested_) + if (!refreshRequested_) { refreshRequested_ = true; /* Currency Options might have changed so refresh */ wxCommandEvent ev(wxEVT_COMMAND_MENU_SELECTED, MENU_ACCTLIST); - GetEventHandler()->AddPendingEvent(ev); + GetEventHandler()->AddPendingEvent(ev); } if (!m_db) @@ -3130,20 +3130,20 @@ void mmGUIFrame::OnNew(wxCommandEvent& /*event*/) { autoRepeatTransactionsTimer_.Stop(); - wxFileDialog dlg(this, - _("Choose database file to create"), - wxEmptyString, - wxEmptyString, - wxT("MMB Files(*.mmb)|*.mmb"), + wxFileDialog dlg(this, + _("Choose database file to create"), + wxEmptyString, + wxEmptyString, + wxT("MMB Files(*.mmb)|*.mmb"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); - if(dlg.ShowModal() != wxID_OK) + if(dlg.ShowModal() != wxID_OK) return; wxString fileName = dlg.GetPath(); - - if (!fileName.EndsWith(wxT(".mmb"))) + + if (!fileName.EndsWith(wxT(".mmb"))) fileName += wxT(".mmb"); SetDatabaseFile(fileName, true); @@ -3153,13 +3153,13 @@ void mmGUIFrame::OnOpen(wxCommandEvent& /*event*/) { autoRepeatTransactionsTimer_.Stop(); - wxString fileName = wxFileSelector(_("Choose database file to open"), - wxEmptyString, wxEmptyString, wxEmptyString, - wxT("MMB Files(*.mmb)|*.mmb|Encrypted MMB files (*.emb)|*.emb"), + wxString fileName = wxFileSelector(_("Choose database file to open"), + wxEmptyString, wxEmptyString, wxEmptyString, + wxT("MMB Files(*.mmb)|*.mmb|Encrypted MMB files (*.emb)|*.emb"), wxFD_FILE_MUST_EXIST, this ); - + if (!fileName.empty()) { SetDatabaseFile(fileName); mmGUIFrame::saveConfigFile(); @@ -3169,33 +3169,33 @@ void mmGUIFrame::OnConvertEncryptedDB(wxCommandEvent& /*event*/) { - wxString encFileName = wxFileSelector(_("Choose Encrypted database file to open"), - wxEmptyString, wxEmptyString, wxEmptyString, - wxT("Encrypted MMB files (*.emb)|*.emb"), - wxFD_FILE_MUST_EXIST, + wxString encFileName = wxFileSelector(_("Choose Encrypted database file to open"), + wxEmptyString, wxEmptyString, wxEmptyString, + wxT("Encrypted MMB files (*.emb)|*.emb"), + wxFD_FILE_MUST_EXIST, this ); if (encFileName.empty()) return; - + wxString password = wxGetPasswordFromUser(_("Enter password for database")); if (password.empty()) return; - - wxFileDialog dlg(this, - _("Choose database file to Save As"), - wxEmptyString, - wxEmptyString, - wxT("MMB Files(*.mmb)|*.mmb"), + + wxFileDialog dlg(this, + _("Choose database file to Save As"), + wxEmptyString, + wxEmptyString, + wxT("MMB Files(*.mmb)|*.mmb"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); if(dlg.ShowModal() != wxID_OK) return; - + wxString fileName = dlg.GetPath(); - + if (!dlg.GetPath().EndsWith(wxT(".mmb"))) fileName += wxT(".mmb"); @@ -3214,7 +3214,7 @@ { wxASSERT(m_db); - if (fileName_.empty()) + if (fileName_.empty()) { wxASSERT(false); return; @@ -3252,13 +3252,13 @@ if (encrypt) { - if (rekey) + if (rekey) { new_password = wxGetPasswordFromUser(_("Enter password for new database")); - if (new_password.empty()) + if (new_password.empty()) return; - } - else + } + else { new_password = password_; } @@ -3274,7 +3274,7 @@ if (!wxCopyFile(oldFileName.GetFullPath(), newFileName.GetFullPath(), true)) // true -> overwrite if file exists return; - + if (rekey) // encrypt or reset encryption { wxSQLite3Database dbx; @@ -3282,7 +3282,7 @@ dbx.ReKey(new_password); // empty password resets encryption dbx.Close(); } - + password_.clear(); openFile(newFileName.GetFullPath(), false, new_password); } @@ -3335,7 +3335,7 @@ Close(TRUE); } //---------------------------------------------------------------------------- - + void mmGUIFrame::OnNewAccount(wxCommandEvent& /*event*/) { mmAddAccountWizard* wizard = new mmAddAccountWizard(this, m_core.get()); @@ -3349,14 +3349,14 @@ dlg.ShowModal(); if (dlg.termAccountActivated() ) { - updateNavTreeControl(true); + updateNavTreeControl(true); menuBar_->FindItem(MENU_VIEW_TERMACCOUNTS)->Check(true); if (firstTermAccount) { /***************Message to display ************************* Term Account views have been temporarly turned on. To maintain this view, change the defaults by using: - + Tools -> Options View Options @@ -3369,23 +3369,23 @@ << _("This message will not be displayed in future."); wxMessageBox(msgStr, _("Initial Term Account Activation"),wxICON_INFORMATION); } - } + } else { - updateNavTreeControl(); + updateNavTreeControl(); } } - + if (!refreshRequested_) { refreshRequested_ = true; /* Currency Options might have changed so refresh */ wxCommandEvent ev(wxEVT_COMMAND_MENU_SELECTED, MENU_ACCTLIST); - GetEventHandler()->AddPendingEvent(ev); + GetEventHandler()->AddPendingEvent(ev); } } //---------------------------------------------------------------------------- - + void mmGUIFrame::OnAccountList(wxCommandEvent& /*event*/) { createHomePage(); @@ -3400,7 +3400,7 @@ mmCategDialog(m_core.get(), this, false).ShowModal(); } //---------------------------------------------------------------------------- - + void mmGUIFrame::OnOrgPayees(wxCommandEvent& /*event*/) { mmPayeeDialog(this, m_core.get(), false).ShowModal(); @@ -3409,11 +3409,11 @@ void mmGUIFrame::OnBudgetSetupDialog(wxCommandEvent& /*event*/) { - if (m_db) + if (m_db) { mmBudgetYearDialog(m_db.get(), this).ShowModal(); createHomePage(); - updateNavTreeControl(); + updateNavTreeControl(); } } //---------------------------------------------------------------------------- @@ -3424,7 +3424,7 @@ if (m_core.get()->getNumAccounts() == 0) return; - std::vector< boost::shared_ptr<mmBankTransaction> >* trans + std::vector< boost::shared_ptr<mmBankTransaction> >* trans = new std::vector< boost::shared_ptr<mmBankTransaction> >; mmFilterTransactionsDialog* dlg= new mmFilterTransactionsDialog(trans, m_core.get(), this); @@ -3453,7 +3453,7 @@ { const mmAccount* account = it->get(); - if (account->acctType_ == ACCOUNT_TYPE_BANK || (withTermAccounts && account->acctType_ == ACCOUNT_TYPE_TERM)) + if (account->acctType_ == ACCOUNT_TYPE_BANK || (withTermAccounts && account->acctType_ == ACCOUNT_TYPE_TERM)) accountArray.Add(account->name_); } @@ -3477,7 +3477,7 @@ { selections->Add(accountArray.Item(arraySel[i])); } - + // mmReportCashFlow is a mmPrintableBase mmReportCashFlow* report = new mmReportCashFlow(m_core.get(), this, selections); @@ -3534,10 +3534,10 @@ createHelpPage(); } //---------------------------------------------------------------------------- - + bool mmGUIFrame::IsUpdateAvailable(wxString page) { - wxStringTokenizer tkz(page, wxT('.'), wxTOKEN_RET_EMPTY_ALL); + wxStringTokenizer tkz(page, wxT('.'), wxTOKEN_RET_EMPTY_ALL); int numTokens = (int)tkz.CountTokens(); if (numTokens != 4) { @@ -3545,7 +3545,7 @@ wxLaunchDefaultBrowser(url); return false; } - + wxString maj = tkz.GetNextToken(); wxString min = tkz.GetNextToken(); wxString cust = tkz.GetNextToken(); @@ -3553,9 +3553,9 @@ // get current version wxString currentV = mmex::getProgramVersion(); - wxStringTokenizer tkz1(currentV, wxT('.'), wxTOKEN_RET_EMPTY_ALL); + wxStringTokenizer tkz1(currentV, wxT('.'), wxTOKEN_RET_EMPTY_ALL); numTokens = (int)tkz1.CountTokens(); - + wxString majC = tkz1.GetNextToken(); wxString minC = tkz1.GetNextToken(); wxString custC = tkz1.GetNextToken(); @@ -3594,8 +3594,8 @@ << wxT("MMEX: ") << mmex::getProgramVersion() << wxT("\n") << _("System: ") << wxPlatformInfo::Get().GetOperatingSystemIdName() << wxT("\n\n") << wxVERSION_STRING << wxT("\n") - << wxT("Boost C++ ") << (BOOST_VERSION/100000) << wxT('.') - << (BOOST_VERSION / 100 % 1000) << wxT('.') + << wxT("Boost C++ ") << (BOOST_VERSION/100000) << wxT('.') + << (BOOST_VERSION / 100 % 1000) << wxT('.') << (BOOST_VERSION % 100) << wxT("\n") << wxT("SQLite3: ") << wxSQLite3Database::GetVersion() << wxT("\n") << wxT("wxSQLite3: 3.0.0 by Ulrich Telle") << wxT("\n\n"); @@ -3625,7 +3625,7 @@ **************************************************************************/ wxStringTokenizer sysTokens(page,wxT("-")); // Ignored the first token. Added for compatibility for pre 0.9.8.0 - wxString oldSys = sysTokens.GetNextToken(); + wxString oldSys = sysTokens.GetNextToken(); wxString winSys = sysTokens.GetNextToken().Trim(false); wxString unixSys = sysTokens.GetNextToken().Trim(false); wxString macSys = sysTokens.GetNextToken().Trim(false); @@ -3633,23 +3633,23 @@ wxString mySys = wxPlatformInfo::Get().GetOperatingSystemFamilyName(); wxStringTokenizer mySysToken; - if (mySys == wxT("Windows")) + if (mySys == wxT("Windows")) mySysToken.SetString(winSys,wxT(":")); else if (mySys == wxT("Unix")) mySysToken.SetString(unixSys,wxT(":")); else if (mySys == wxT("Macintosh")) mySysToken.SetString(macSys,wxT(":")); - + page = mySysToken.GetNextToken(); // the system - page = mySysToken.GetNextToken().Trim(false).Trim(); // the version - + page = mySysToken.GetNextToken().Trim(false).Trim(); // the version + // set up display information. int style = wxOK|wxCANCEL; if (IsUpdateAvailable(page)) { versionDetails << _("New update available!"); style = wxICON_EXCLAMATION|style; - } + } else { versionDetails << _("You have the latest version installed!"); @@ -3667,11 +3667,11 @@ { wxArrayString currency_name, currency_rate; double *rate_ptr, rate_value, base_rate; - + // we will get latest currency rate data from European Central Bank wxString site = wxT("http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml"); - if (!m_core) + if (!m_core) { wxMessageBox(_("No database!"), _("Update Currency Rate"), wxICON_WARNING); return; @@ -3681,22 +3681,22 @@ wxInputStream* in_stream = url.GetInputStream(); - if (!in_stream) + if (!in_stream) { wxMessageBox(_("Unable to connect!"), _("Update Currency Rate"), wxICON_WARNING); return; } - + wxXmlDocument doc; - if(!doc.Load(*in_stream)) + if(!doc.Load(*in_stream)) { wxMessageBox(_("Cannot get data from WWW!"), _("Update Currency Rate"), wxICON_WARNING); return; } // decode received XML data - if(doc.GetRoot()->GetName() != wxT("gesmes:Envelope")) + if(doc.GetRoot()->GetName() != wxT("gesmes:Envelope")) { wxMessageBox(_("Incorrect XML data (#1)!"), _("Update Currency Rate"), wxICON_WARNING); return; @@ -3704,49 +3704,49 @@ wxXmlNode *root_child = doc.GetRoot()->GetChildren(); - while(root_child) + while(root_child) { - if(root_child->GetName() == wxT("gesmes:subject")) + if(root_child->GetName() == wxT("gesmes:subject")) { - if(root_child->GetNodeContent() != wxT("Reference rates")) + if(root_child->GetNodeContent() != wxT("Reference rates")) { wxMessageBox(_("Incorrect XML data (#2)!"), _("Update Currency Rate"), wxICON_WARNING); return; } - } - else if (root_child->GetName() == wxT("gesmes:Sender")) + } + else if (root_child->GetName() == wxT("gesmes:Sender")) { wxXmlNode *sender_child = root_child->GetChildren(); - if(!sender_child) + if(!sender_child) { wxMessageBox(_("Incorrect XML data (#3)!"), _("Update Currency Rate"), wxICON_WARNING); return; } - if(se... [truncated message content] |
From: <vo...@us...> - 2012-04-27 14:23:37
|
Revision: 2207 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2207&view=rev Author: vomikan Date: 2012-04-27 14:23:27 +0000 (Fri, 27 Apr 2012) Log Message: ----------- begin....commit for currency update Modified Paths: -------------- trunk/mmex/src/mmex.cpp Modified: trunk/mmex/src/mmex.cpp =================================================================== --- trunk/mmex/src/mmex.cpp 2012-04-26 16:11:28 UTC (rev 2206) +++ trunk/mmex/src/mmex.cpp 2012-04-27 14:23:27 UTC (rev 2207) @@ -3801,18 +3801,20 @@ // currency Z / currency Y = Z / Y // Therefore, if currency X is EUR and currency Y is the base currency, // currency Y : currency Z = base_rate / rate of Z : 1 - for(int i=0; i<(int)currency_rate.GetCount(); i++) + for(int i = 0; i<(int)currency_rate.GetCount(); i++) rate_ptr[i] = base_rate / rate_ptr[i]; // update currency rates wxString msg = _("Currency rate updated"); msg << wxT("\n\n"); + + m_db->Begin(); for (int idx = 0; idx < (int)m_core->currencyList_.currencies_.size(); idx++) { wxString currencySymbol = m_core->currencyList_.currencies_[idx]->currencySymbol_; - for(int i=0; i<(int)currency_name.GetCount(); i++) + for(int i = 0; i<(int)currency_name.GetCount(); i++) { if(currency_name[i] == currencySymbol) { @@ -3825,6 +3827,7 @@ } } // for i loop } + m_db->Commit(); delete[] rate_ptr; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2012-04-27 16:06:51
|
Revision: 2208 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2208&view=rev Author: stef145g Date: 2012-04-27 16:06:45 +0000 (Fri, 27 Apr 2012) Log Message: ----------- Removing progress bar to verify database integrity as too quick to be helpful. Modified Paths: -------------- trunk/mmex/src/mmex.cpp Modified: trunk/mmex/src/mmex.cpp =================================================================== --- trunk/mmex/src/mmex.cpp 2012-04-27 14:23:27 UTC (rev 2207) +++ trunk/mmex/src/mmex.cpp 2012-04-27 16:06:45 UTC (rev 2208) @@ -3063,14 +3063,16 @@ void mmGUIFrame::openDataBase(const wxString& fileName) { - wxProgressDialog dlg(_("Please Wait"), - _("Opening Database File && Verifying Integrity"), 100, this, - wxPD_AUTO_HIDE | wxPD_APP_MODAL | wxPD_SMOOTH ); + //wxProgressDialog dlg(_("Please Wait"), + // _("Opening Database File && Verifying Integrity"), 100, this, + // wxPD_AUTO_HIDE | wxPD_APP_MODAL | wxPD_SMOOTH ); - mmDBWrapper::initDB(m_db.get(), &dlg); - dlg.Update(100); - dlg.Destroy(); + //mmDBWrapper::initDB(m_db.get(), &dlg); + //dlg.Update(100); + //dlg.Destroy(); + mmDBWrapper::initDB(m_db.get(), 0); + wxString title = mmex::getProgramName() + wxT(" : ") + fileName; if (mmex::isPortableMode()) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-05-09 12:59:09
|
Revision: 2285 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2285&view=rev Author: vomikan Date: 2012-05-09 12:59:00 +0000 (Wed, 09 May 2012) Log Message: ----------- new currency updater Modified Paths: -------------- trunk/mmex/src/mmex.cpp Modified: trunk/mmex/src/mmex.cpp =================================================================== --- trunk/mmex/src/mmex.cpp 2012-05-09 12:41:13 UTC (rev 2284) +++ trunk/mmex/src/mmex.cpp 2012-05-09 12:59:00 UTC (rev 2285) @@ -64,6 +64,7 @@ #include "customreportindex.h" #include "customreportdialog.h" #include <boost/version.hpp> +#include "mmyahoo.h" //---------------------------------------------------------------------------- /* Include XPM Support */ @@ -132,6 +133,8 @@ #include <boost/scoped_array.hpp> #include <string> //---------------------------------------------------------------------------- +#include "mmex_db_view.h" +#include <boost/foreach.hpp> namespace { @@ -3602,22 +3605,11 @@ // Access current version details page wxString site = wxT("http://www.codelathe.com/mmex/version.html"); - wxURL url(site); - unsigned char buf[1024]; - boost::scoped_ptr<wxInputStream> in_stream(url.GetInputStream()); - if (!in_stream) - { - versionDetails << _("Unable to connect!"); - wxMessageBox(versionDetails, _("MMEX System Information Check")); + wxString page; + if (site_content(site, page) != 0) return; - } - in_stream->Read(buf, 1024); - //size_t bytes_read=in_stream->LastRead(); - in_stream.reset(); - buf[53] = '\0'; - - wxString page = wxString::FromAscii((const char *)buf); + /************************************************************************* Expected format of the string from the internet. Version: 0.9.8.0 page = wxT("x.x.x.x - Win: w.w.w.w - Unix: u.u.u.u - Mac: m.m.m.m"); @@ -3657,7 +3649,7 @@ } wxString urlString = wxT("http://www.codelathe.com/mmex"); - versionDetails << wxT("\n\n") << _("Proceed to website: ") << urlString; + versionDetails << wxT("\n\n") << _("Proceed to website: ") << urlString << wxT(" "); if (wxMessageBox(versionDetails, _("MMEX System Information Check"), style) == wxOK) wxLaunchDefaultBrowser(urlString); } @@ -3665,177 +3657,106 @@ void mmGUIFrame::OnOnlineUpdateCurRate(wxCommandEvent& /*event*/) { - wxArrayString currency_name, currency_rate; - double *rate_ptr, rate_value, base_rate; - - // we will get latest currency rate data from European Central Bank - wxString site = wxT("http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml"); - - if (!m_core) - { - wxMessageBox(_("No database!"), _("Update Currency Rate"), wxICON_WARNING); - return; - } - - wxURL url(site); - - wxInputStream* in_stream = url.GetInputStream(); - - if (!in_stream) - { - wxMessageBox(_("Unable to connect!"), _("Update Currency Rate"), wxICON_WARNING); + std::vector<DB_View_CURRENCYFORMATS_V1::Data> all_currency = CURRENCYFORMATS_V1.all(m_core->db_.get()); + if (all_currency.empty()) return; - } - wxXmlDocument doc; + wxString site; + wxSortedArrayString symbols_array; + int currencyID = mmDBWrapper::getBaseCurrencySettings(m_core->db_.get()); + wxString base_symbol = mmDBWrapper::getCurrencySymbol(m_core->db_.get(), currencyID); - if(!doc.Load(*in_stream)) + if(base_symbol.IsEmpty()) { - wxMessageBox(_("Cannot get data from WWW!"), _("Update Currency Rate"), wxICON_WARNING); + wxMessageBox(_("Could not find base currency symbol!"), _("Update Currency Rate"), wxICON_WARNING); return; } - // decode received XML data - if(doc.GetRoot()->GetName() != wxT("gesmes:Envelope")) + BOOST_FOREACH(const DB_View_CURRENCYFORMATS_V1::Data ¤cy, all_currency) { - wxMessageBox(_("Incorrect XML data (#1)!"), _("Update Currency Rate"), wxICON_WARNING); - return; - } - - wxXmlNode *root_child = doc.GetRoot()->GetChildren(); - - while(root_child) - { - if(root_child->GetName() == wxT("gesmes:subject")) - { - if(root_child->GetNodeContent() != wxT("Reference rates")) - { - wxMessageBox(_("Incorrect XML data (#2)!"), _("Update Currency Rate"), wxICON_WARNING); - return; + wxString currency_symbol = currency.CURRENCY_SYMBOL.Upper(); + if (!currency_symbol.IsEmpty()) { + if (wxNOT_FOUND == symbols_array.Index(currency_symbol) && + base_symbol != currency_symbol) { + symbols_array.Add(currency_symbol); + site << currency.CURRENCY_SYMBOL.Upper() << base_symbol << wxT("=X+"); } } - else if (root_child->GetName() == wxT("gesmes:Sender")) - { - wxXmlNode *sender_child = root_child->GetChildren(); + } + site.RemoveLast(1); - if(!sender_child) - { - wxMessageBox(_("Incorrect XML data (#3)!"), _("Update Currency Rate"), wxICON_WARNING); - return; - } + mmYahoo* yahoo_ = new mmYahoo(m_inidb.get(), m_core->db_.get()); - if(sender_child->GetName() != wxT("gesmes:name")) - { - wxMessageBox(_("Incorrect XML data (#4)!"), _("Update Currency Rate"), wxICON_WARNING); - return; - } + //Sample: + //http://finance.yahoo.com/d/quotes.csv?s=EURUSD=X+RUBUSD=X&f=sl1n&e=.csv + site = wxString() << wxT("http://") << yahoo_->Server_ + << wxT("/d/quotes.csv?s=") << site; + site << wxT("&f=") << yahoo_->CSVColumns_ << wxT("&e=.csv"); - if(sender_child->GetNodeContent() != wxT("European Central Bank")) - { - wxMessageBox(_("Incorrect XML data (#5)!"), _("Update Currency Rate"), wxICON_WARNING); - return; - } - } - else if (root_child->GetName() == wxT("Cube")) - { - wxXmlNode *cube_lv1_child = root_child->GetChildren(); + wxString rates; + if (site_content(site, rates) != 0) + return; - if(!cube_lv1_child) - { - wxMessageBox(_("Incorrect XML data (#6)!"), _("Update Currency Rate"), wxICON_WARNING); - return; - } + wxString CurrencySymbol, dName; + double dRate = 0; - if(cube_lv1_child->GetName() != wxT("Cube")) - { - wxMessageBox(_("Incorrect XML data (#7)!"), _("Update Currency Rate"), wxICON_WARNING); - return; - } + std::map<wxString, std::pair<double, wxString> > currency_data; - wxXmlNode *cube_lv2_child = cube_lv1_child->GetChildren(); + // Break it up into lines + wxStringTokenizer tkz(rates, wxT("\r\n")); - // set default base currency and its rate - currency_name.Add(wxT("EUR")); - currency_rate.Add(wxT("1.0")); + while (tkz.HasMoreTokens()) + { + wxString csvline = tkz.GetNextToken(); - while(cube_lv2_child) + /*** Grab the relevant bits (for now only the symbol and the current price) */ + wxStringTokenizer csvsimple(csvline,wxT("\","),wxTOKEN_STRTOK); + if (csvsimple.HasMoreTokens()) + { + CurrencySymbol = csvsimple.GetNextToken(); + if (csvsimple.HasMoreTokens()) { - wxString name = cube_lv2_child->GetPropVal(wxT("currency"), wxGetEmptyString()); - wxString rate = cube_lv2_child->GetPropVal(wxT("rate"), wxT("1")); - - currency_name.Add(name); - currency_rate.Add(rate); - - cube_lv2_child = cube_lv2_child->GetNext(); + csvsimple.GetNextToken().ToDouble(&dRate); + if (csvsimple.HasMoreTokens()) + dName = csvsimple.GetNextToken(); } } - root_child = root_child->GetNext(); + currency_data.insert(std::make_pair(CurrencySymbol, std::make_pair(dRate, dName))); } - // Get base currency and the adjust currency rate for each currency - rate_ptr = new double[currency_rate.GetCount()]; + CURRENCYFORMATS_V1.begin(m_core->db_.get()); - int currencyID = mmDBWrapper::getBaseCurrencySettings(m_core->db_.get()); - wxString base_symbol = mmDBWrapper::getCurrencySymbol(m_core->db_.get(), currencyID); - base_rate = 0; - - for(int i=0; i<(int)currency_rate.GetCount(); i++) + wxString msg = wxT(""); + BOOST_FOREACH(DB_View_CURRENCYFORMATS_V1::Data ¤cy, all_currency) { - if(currency_rate[i].ToDouble(&rate_value) == false) - { - rate_ptr[i] = 1.0; - } else - { - rate_ptr[i] = rate_value; - if(currency_name[i] == base_symbol) - base_rate = rate_value; - } - } + wxString currency_symbol = currency.CURRENCY_SYMBOL.Upper(); + if (!currency_symbol.IsEmpty() && base_symbol != currency_symbol) { + wxString currency_symbols_pair = currency_symbol + base_symbol + wxT("=X"); - if(base_rate == 0) - { - wxMessageBox(_("Could not find base currency symbol!"), _("Update Currency Rate"), wxICON_WARNING); - return; - } + std::pair<double, wxString> data = currency_data[currency_symbols_pair]; - // Note: - // Suppose currency Y / currency X = Y / X and currency Z / currency X = Z / X, then - // currency Z / currency Y = Z / Y - // Therefore, if currency X is EUR and currency Y is the base currency, - // currency Y : currency Z = base_rate / rate of Z : 1 - for(int i = 0; i<(int)currency_rate.GetCount(); i++) - rate_ptr[i] = base_rate / rate_ptr[i]; + double rate = data.first; - // update currency rates + msg << currency_symbol << wxT(" : ") << currency.BASECONVRATE << wxT("\t -> \t") << rate << wxT("\n"); - wxString msg = _("Currency rate updated"); - msg << wxT("\n\n"); + if (rate > 0.000001) + currency.BASECONVRATE = rate; - m_db->Begin(); - for (int idx = 0; idx < (int)m_core->currencyList_.currencies_.size(); idx++) - { - wxString currencySymbol = m_core->currencyList_.currencies_[idx]->currencySymbol_; - - for(int i = 0; i<(int)currency_name.GetCount(); i++) - { - if(currency_name[i] == currencySymbol) - { - double rate = m_core->currencyList_.currencies_[idx]->baseConv_ ; - if (rate != rate_ptr[i]) - msg << currencySymbol << wxT(" : ") << rate << wxT(" -> ") << rate_ptr[i] << wxT("\n"); - - m_core->currencyList_.currencies_[idx]->baseConv_ = rate_ptr[i]; - m_core->currencyList_.updateCurrency(m_core->currencyList_.currencies_[idx]); + // store into db + if (currency.save(m_core->db_.get())) { + for (int idx = 0; idx < (int)m_core->currencyList_.currencies_.size(); idx++) + { + wxString currencySymbol = m_core->currencyList_.currencies_[idx]->currencySymbol_; + if (currencySymbol == currency_symbol) + m_core->currencyList_.currencies_[idx]->baseConv_ = rate; + } } - } // for i loop + } } - m_db->Commit(); - delete[] rate_ptr; + CURRENCYFORMATS_V1.commit(m_core->db_.get()); wxMessageDialog msgDlg(this, msg, _("Currency rate updated")); - - //fileviewer(wxT(""), this).ShowModal(); msgDlg.ShowModal(); createHomePage(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gua...@us...> - 2012-05-09 14:00:27
|
Revision: 2288 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2288&view=rev Author: guanlisheng Date: 2012-05-09 14:00:17 +0000 (Wed, 09 May 2012) Log Message: ----------- cleanup Modified Paths: -------------- trunk/mmex/src/mmex.cpp Modified: trunk/mmex/src/mmex.cpp =================================================================== --- trunk/mmex/src/mmex.cpp 2012-05-09 13:21:10 UTC (rev 2287) +++ trunk/mmex/src/mmex.cpp 2012-05-09 14:00:17 UTC (rev 2288) @@ -131,7 +131,6 @@ #include <wx/xml/xml.h> //---------------------------------------------------------------------------- #include <boost/scoped_array.hpp> -#include <string> //---------------------------------------------------------------------------- #include "mmex_db_view.h" #include <boost/foreach.hpp> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gua...@us...> - 2012-05-10 02:08:21
|
Revision: 2295 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2295&view=rev Author: guanlisheng Date: 2012-05-10 02:08:15 +0000 (Thu, 10 May 2012) Log Message: ----------- decoupling Modified Paths: -------------- trunk/mmex/src/mmex.cpp Modified: trunk/mmex/src/mmex.cpp =================================================================== --- trunk/mmex/src/mmex.cpp 2012-05-10 02:01:30 UTC (rev 2294) +++ trunk/mmex/src/mmex.cpp 2012-05-10 02:08:15 UTC (rev 2295) @@ -27,7 +27,6 @@ #include "assetspanel.h" #include "univcsvdialog.h" #include "htmlbuilder.h" -#include "reportbase.h" #include "reportsummary.h" #include "reportcategexp.h" #include "reportpayee.h" @@ -135,6 +134,8 @@ #include "mmex_db_view.h" #include <boost/foreach.hpp> +class mmPrintableBase; + namespace { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gua...@us...> - 2012-05-23 03:27:44
|
Revision: 2366 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2366&view=rev Author: guanlisheng Date: 2012-05-23 03:27:38 +0000 (Wed, 23 May 2012) Log Message: ----------- Modified Paths: -------------- trunk/mmex/src/mmex.cpp Modified: trunk/mmex/src/mmex.cpp =================================================================== --- trunk/mmex/src/mmex.cpp 2012-05-23 02:33:46 UTC (rev 2365) +++ trunk/mmex/src/mmex.cpp 2012-05-23 03:27:38 UTC (rev 2366) @@ -291,6 +291,10 @@ inidb.Close(); +#if defined (__WXMAC__) || defined (__WXOSX__) + wxSystemOptions::SetOption(wxT("mac.listctrl.always_use_generic"), 1); +#endif + mmGUIFrame *frame = new mmGUIFrame(mmex::getProgramName(), wxPoint(valx, valy), wxSize(valw, valh)); bool ok = frame->Show(); wxASSERT(ok); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gua...@us...> - 2012-05-23 05:57:09
|
Revision: 2367 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2367&view=rev Author: guanlisheng Date: 2012-05-23 05:57:03 +0000 (Wed, 23 May 2012) Log Message: ----------- Modified Paths: -------------- trunk/mmex/src/mmex.cpp Modified: trunk/mmex/src/mmex.cpp =================================================================== --- trunk/mmex/src/mmex.cpp 2012-05-23 03:27:38 UTC (rev 2366) +++ trunk/mmex/src/mmex.cpp 2012-05-23 05:57:03 UTC (rev 2367) @@ -292,8 +292,12 @@ inidb.Close(); #if defined (__WXMAC__) || defined (__WXOSX__) +#if wxCHECK_VERSION(2,9,0) wxSystemOptions::SetOption(wxT("mac.listctrl.always_use_generic"), 1); +#else + wxSystemOptions::SetOption(wxMAC_ALWAYS_USE_GENERIC_LISTCTRL, 1); #endif +#endif mmGUIFrame *frame = new mmGUIFrame(mmex::getProgramName(), wxPoint(valx, valy), wxSize(valw, valh)); bool ok = frame->Show(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-05-23 09:38:29
|
Revision: 2375 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2375&view=rev Author: vomikan Date: 2012-05-23 09:38:23 +0000 (Wed, 23 May 2012) Log Message: ----------- cleanup Modified Paths: -------------- trunk/mmex/src/mmex.cpp Modified: trunk/mmex/src/mmex.cpp =================================================================== --- trunk/mmex/src/mmex.cpp 2012-05-23 09:34:42 UTC (rev 2374) +++ trunk/mmex/src/mmex.cpp 2012-05-23 09:38:23 UTC (rev 2375) @@ -127,7 +127,7 @@ #include <wx/debugrpt.h> #include <wx/sysopt.h> #include <wx/wizard.h> -#include <wx/xml/xml.h> + //---------------------------------------------------------------------------- #include <boost/scoped_array.hpp> //---------------------------------------------------------------------------- @@ -3618,7 +3618,7 @@ wxMessageBox(_("Unable to connect!"), update_check_heading, wxICON_WARNING); return; } - + // Included for future testing // page = wxT("x.x.x.x - Win: w.w.w.w - Unix: u.u.u.u - Mac: m.m.m.m"); // page = wxT("9.9.9.9 - Win: 0.9.9.0 - Unix: 0.9.9.0 - Mac: 0.9.9.0"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gua...@us...> - 2012-05-24 00:45:01
|
Revision: 2378 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2378&view=rev Author: guanlisheng Date: 2012-05-24 00:44:55 +0000 (Thu, 24 May 2012) Log Message: ----------- format & cleanup Modified Paths: -------------- trunk/mmex/src/mmex.cpp Modified: trunk/mmex/src/mmex.cpp =================================================================== --- trunk/mmex/src/mmex.cpp 2012-05-24 00:28:51 UTC (rev 2377) +++ trunk/mmex/src/mmex.cpp 2012-05-24 00:44:55 UTC (rev 2378) @@ -584,9 +584,7 @@ recentFiles_ = new RecentDatabaseFiles(m_inidb.get(), menuRecentFiles_); // add the toolbars to the manager - m_mgr.AddPane(toolBar_, wxAuiPaneInfo(). - Name(wxT("toolbar")).Caption(wxT("Toolbar")).ToolbarPane().Top(). - LeftDockable(false).RightDockable(false)); + m_mgr.AddPane(toolBar_, wxAuiPaneInfo().Name(wxT("toolbar")).Caption(wxT("Toolbar")).ToolbarPane().Top().LeftDockable(false).RightDockable(false)); // change look and feel of wxAuiManager m_mgr.GetArtProvider()->SetMetric(16, 0); @@ -595,8 +593,7 @@ // Save default perspective m_perspective = m_mgr.SavePerspective(); - wxString auiPerspective = mmDBWrapper::getINISettingValue(m_inidb.get(), - wxT("AUIPERSPECTIVE"), m_perspective); + wxString auiPerspective = mmDBWrapper::getINISettingValue(m_inidb.get(), wxT("AUIPERSPECTIVE"), m_perspective); m_mgr.LoadPerspective(auiPerspective); @@ -622,14 +619,16 @@ wxFileName dbpath = from_scratch ? wxGetEmptyString() : mmDBWrapper::getLastDbPath(m_inidb.get()); - if (from_scratch || !dbpath.IsOk()) { + if (from_scratch || !dbpath.IsOk()) + { menuEnableItems(false); createHomePage(); updateNavTreeControl(); showBeginAppDialog(dbpath.GetFullName().IsEmpty()); - } else { - if (!openFile(dbpath.GetFullPath(), false)) - showBeginAppDialog(true); + } + else + { + if (!openFile(dbpath.GetFullPath(), false)) showBeginAppDialog(true); } } //---------------------------------------------------------------------------- @@ -2567,8 +2566,7 @@ { wxSizer *sizer = cleanupHomePanel(); - panelCurrent_ = new mmReportsPanel(this, m_db.get(), rs, homePanel, ID_PANEL3, - wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL); + panelCurrent_ = new mmReportsPanel(this, m_db.get(), rs, homePanel, ID_PANEL3, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL); sizer->Add(panelCurrent_, 1, wxGROW|wxALL, 1); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |