diff options
Diffstat (limited to 'plugins/CurrencyRates/src/CommonOptionDlg.cpp')
-rw-r--r-- | plugins/CurrencyRates/src/CommonOptionDlg.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/plugins/CurrencyRates/src/CommonOptionDlg.cpp b/plugins/CurrencyRates/src/CommonOptionDlg.cpp index 0fdd483abb..2878f2a91f 100644 --- a/plugins/CurrencyRates/src/CommonOptionDlg.cpp +++ b/plugins/CurrencyRates/src/CommonOptionDlg.cpp @@ -1,11 +1,11 @@ #include "StdAfx.h" typedef boost::shared_ptr<CAdvProviderSettings> TAdvSettingsPtr; -typedef std::map<const IQuotesProvider*, TAdvSettingsPtr> TAdvSettings; +typedef std::map<const ICurrencyRatesProvider*, TAdvSettingsPtr> TAdvSettings; TAdvSettings g_aAdvSettings; -CAdvProviderSettings* get_adv_settings(const IQuotesProvider* pProvider, bool bCreateIfNonExist) +CAdvProviderSettings* get_adv_settings(const ICurrencyRatesProvider* pProvider, bool bCreateIfNonExist) { TAdvSettings::iterator i = g_aAdvSettings.find(pProvider); if (i != g_aAdvSettings.end()) @@ -20,7 +20,7 @@ CAdvProviderSettings* get_adv_settings(const IQuotesProvider* pProvider, bool bC return nullptr; } -void remove_adv_settings(const IQuotesProvider *pProvider) +void remove_adv_settings(const ICurrencyRatesProvider *pProvider) { TAdvSettings::iterator i = g_aAdvSettings.find(pProvider); if (i != g_aAdvSettings.end()) @@ -32,10 +32,10 @@ void CommonOptionDlgProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp, CCommonDlgPr switch (msg) { case WM_INITDIALOG: { - assert(rData.m_pQuotesProvider); + assert(rData.m_pCurrencyRatesProvider); - CQuotesProviderVisitorDbSettings visitor; - rData.m_pQuotesProvider->Accept(visitor); + CCurrencyRatesProviderVisitorDbSettings visitor; + rData.m_pCurrencyRatesProvider->Accept(visitor); assert(visitor.m_pszDbRefreshRateType); assert(visitor.m_pszDbRefreshRateValue); assert(visitor.m_pszDbDisplayNameFormat); @@ -43,15 +43,15 @@ void CommonOptionDlgProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp, CCommonDlgPr assert(visitor.m_pszDbTendencyFormat); // set contact list display format - tstring sDspNameFrmt = Quotes_DBGetStringT(NULL, QUOTES_MODULE_NAME, visitor.m_pszDbDisplayNameFormat, visitor.m_pszDefDisplayFormat); + tstring sDspNameFrmt = CurrencyRates_DBGetStringT(NULL, CURRENCYRATES_MODULE_NAME, visitor.m_pszDbDisplayNameFormat, visitor.m_pszDefDisplayFormat); ::SetDlgItemText(hWnd, IDC_EDIT_CONTACT_LIST_FORMAT, sDspNameFrmt.c_str()); // set status message display format - tstring sStatusMsgFrmt = Quotes_DBGetStringT(NULL, QUOTES_MODULE_NAME, visitor.m_pszDbStatusMsgFormat, visitor.m_pszDefStatusMsgFormat); + tstring sStatusMsgFrmt = CurrencyRates_DBGetStringT(NULL, CURRENCYRATES_MODULE_NAME, visitor.m_pszDbStatusMsgFormat, visitor.m_pszDefStatusMsgFormat); ::SetDlgItemText(hWnd, IDC_EDIT_STATUS_MESSAGE_FORMAT, sStatusMsgFrmt.c_str()); // set tendency format - tstring sTendencyFrmt = Quotes_DBGetStringT(NULL, QUOTES_MODULE_NAME, visitor.m_pszDbTendencyFormat, visitor.m_pszDefTendencyFormat); + tstring sTendencyFrmt = CurrencyRates_DBGetStringT(NULL, CURRENCYRATES_MODULE_NAME, visitor.m_pszDbTendencyFormat, visitor.m_pszDefTendencyFormat); ::SetDlgItemText(hWnd, IDC_EDIT_TENDENCY_FORMAT, sTendencyFrmt.c_str()); // refresh rate @@ -60,11 +60,11 @@ void CommonOptionDlgProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp, CCommonDlgPr for (int i = 0; i < _countof(pszRefreshRateTypes); ++i) ::SendMessage(hwndCombo, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(pszRefreshRateTypes[i])); - int nRefreshRateType = db_get_w(NULL, QUOTES_MODULE_NAME, visitor.m_pszDbRefreshRateType, RRT_MINUTES); + int nRefreshRateType = db_get_w(NULL, CURRENCYRATES_MODULE_NAME, visitor.m_pszDbRefreshRateType, RRT_MINUTES); if (nRefreshRateType < RRT_SECONDS || nRefreshRateType > RRT_HOURS) nRefreshRateType = RRT_MINUTES; - UINT nRate = db_get_w(NULL, QUOTES_MODULE_NAME, visitor.m_pszDbRefreshRateValue, 1); + UINT nRate = db_get_w(NULL, CURRENCYRATES_MODULE_NAME, visitor.m_pszDbRefreshRateValue, 1); switch (nRefreshRateType) { default: case RRT_SECONDS: @@ -128,10 +128,10 @@ void CommonOptionDlgProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp, CCommonDlgPr case BN_CLICKED: switch (LOWORD(wp)) { case IDC_BUTTON_DESCRIPTION: - show_variable_list(hWnd, rData.m_pQuotesProvider); + show_variable_list(hWnd, rData.m_pCurrencyRatesProvider); break; case IDC_BUTTON_ADVANCED_SETTINGS: - CAdvProviderSettings* pAdvSet = get_adv_settings(rData.m_pQuotesProvider, true); + CAdvProviderSettings* pAdvSet = get_adv_settings(rData.m_pCurrencyRatesProvider, true); assert(pAdvSet); if (true == ShowSettingsDlg(hWnd, pAdvSet)) PropSheet_Changed(::GetParent(hWnd), hWnd); @@ -156,14 +156,14 @@ void CommonOptionDlgProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp, CCommonDlgPr case RRT_SECONDS: if (FALSE == bOk || nRefreshRate < 1 || nRefreshRate > 60) { prepare_edit_ctrl_for_error(::GetDlgItem(hWnd, IDC_EDIT_REFRESH_RATE)); - Quotes_MessageBox(hWnd, TranslateT("Enter integer value between 1 and 60."), MB_OK | MB_ICONERROR); + CurrencyRates_MessageBox(hWnd, TranslateT("Enter integer value between 1 and 60."), MB_OK | MB_ICONERROR); bOk = FALSE; } break; case RRT_HOURS: if (FALSE == bOk || nRefreshRate < 1 || nRefreshRate > 24) { prepare_edit_ctrl_for_error(::GetDlgItem(hWnd, IDC_EDIT_REFRESH_RATE)); - Quotes_MessageBox(hWnd, TranslateT("Enter integer value between 1 and 24."), MB_OK | MB_ICONERROR); + CurrencyRates_MessageBox(hWnd, TranslateT("Enter integer value between 1 and 24."), MB_OK | MB_ICONERROR); bOk = FALSE; } break; @@ -176,7 +176,7 @@ void CommonOptionDlgProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp, CCommonDlgPr tstring s = get_window_text(hEdit); if (true == s.empty()) { prepare_edit_ctrl_for_error(hEdit); - Quotes_MessageBox(hWnd, TranslateT("Enter text to display in contact list."), MB_OK | MB_ICONERROR); + CurrencyRates_MessageBox(hWnd, TranslateT("Enter text to display in contact list."), MB_OK | MB_ICONERROR); bOk = FALSE; } } @@ -191,29 +191,29 @@ void CommonOptionDlgProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp, CCommonDlgPr assert(TRUE == bOk); ERefreshRateType nType = static_cast<ERefreshRateType>(::SendDlgItemMessage(hWnd, IDC_COMBO_REFRESH_RATE, CB_GETCURSEL, 0, 0)); - assert(rData.m_pQuotesProvider); + assert(rData.m_pCurrencyRatesProvider); - CQuotesProviderVisitorDbSettings visitor; - rData.m_pQuotesProvider->Accept(visitor); + CCurrencyRatesProviderVisitorDbSettings visitor; + rData.m_pCurrencyRatesProvider->Accept(visitor); assert(visitor.m_pszDbRefreshRateType); assert(visitor.m_pszDbRefreshRateValue); assert(visitor.m_pszDbDisplayNameFormat); assert(visitor.m_pszDbStatusMsgFormat); rData.m_bFireSetingsChangedEvent = true; - db_set_w(NULL, QUOTES_MODULE_NAME, visitor.m_pszDbRefreshRateType, nType); - db_set_w(NULL, QUOTES_MODULE_NAME, visitor.m_pszDbRefreshRateValue, nRefreshRate); + db_set_w(NULL, CURRENCYRATES_MODULE_NAME, visitor.m_pszDbRefreshRateType, nType); + db_set_w(NULL, CURRENCYRATES_MODULE_NAME, visitor.m_pszDbRefreshRateValue, nRefreshRate); tstring s = get_window_text(::GetDlgItem(hWnd, IDC_EDIT_CONTACT_LIST_FORMAT)); - db_set_ws(NULL, QUOTES_MODULE_NAME, visitor.m_pszDbDisplayNameFormat, s.c_str()); + db_set_ws(NULL, CURRENCYRATES_MODULE_NAME, visitor.m_pszDbDisplayNameFormat, s.c_str()); s = get_window_text(::GetDlgItem(hWnd, IDC_EDIT_STATUS_MESSAGE_FORMAT)); - db_set_ws(NULL, QUOTES_MODULE_NAME, visitor.m_pszDbStatusMsgFormat, s.c_str()); + db_set_ws(NULL, CURRENCYRATES_MODULE_NAME, visitor.m_pszDbStatusMsgFormat, s.c_str()); s = get_window_text(::GetDlgItem(hWnd, IDC_EDIT_TENDENCY_FORMAT)); - db_set_ws(NULL, QUOTES_MODULE_NAME, visitor.m_pszDbTendencyFormat, s.c_str()); + db_set_ws(NULL, CURRENCYRATES_MODULE_NAME, visitor.m_pszDbTendencyFormat, s.c_str()); - CAdvProviderSettings* pAdvSet = get_adv_settings(rData.m_pQuotesProvider, false); + CAdvProviderSettings* pAdvSet = get_adv_settings(rData.m_pCurrencyRatesProvider, false); if (pAdvSet) pAdvSet->SaveToDb(); break; @@ -222,7 +222,7 @@ void CommonOptionDlgProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp, CCommonDlgPr break; case WM_DESTROY: - remove_adv_settings(rData.m_pQuotesProvider); + remove_adv_settings(rData.m_pCurrencyRatesProvider); break; } } |