diff options
Diffstat (limited to 'plugins/Quotes/src/QuoteInfoDlg.cpp')
-rw-r--r-- | plugins/Quotes/src/QuoteInfoDlg.cpp | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/plugins/Quotes/src/QuoteInfoDlg.cpp b/plugins/Quotes/src/QuoteInfoDlg.cpp index 51970a044f..fdb60d15ab 100644 --- a/plugins/Quotes/src/QuoteInfoDlg.cpp +++ b/plugins/Quotes/src/QuoteInfoDlg.cpp @@ -8,7 +8,6 @@ extern HGENMENU g_hMenuChart; #endif
extern HGENMENU g_hMenuRefresh, g_hMenuRoot;
-
#define WINDOW_PREFIX_INFO "Quote Info"
MCONTACT g_hContact;
@@ -24,7 +23,7 @@ inline MCONTACT get_contact(HWND hWnd) return MCONTACT(GetWindowLongPtr(hWnd, GWLP_USERDATA));
}
-bool get_fetch_time(time_t& rTime, MCONTACT hContact)
+static bool get_fetch_time(time_t& rTime, MCONTACT hContact)
{
rTime = db_get_dw(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_FETCH_TIME, -1);
return (rTime != -1);
@@ -42,8 +41,7 @@ INT_PTR CALLBACK QuoteInfoDlgProcImpl(MCONTACT hContact, HWND hdlg, UINT msg, WP ::SetDlgItemText(hdlg, IDC_STATIC_QUOTE_NAME, sDescription.c_str());
double dRate = 0.0;
- if (true == Quotes_DBReadDouble(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_PREV_VALUE, dRate))
- {
+ if (true == Quotes_DBReadDouble(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_PREV_VALUE, dRate)) {
tostringstream o;
o.imbue(GetSystemLocale());
o << dRate;
@@ -52,8 +50,7 @@ INT_PTR CALLBACK QuoteInfoDlgProcImpl(MCONTACT hContact, HWND hdlg, UINT msg, WP }
dRate = 0.0;
- if (true == Quotes_DBReadDouble(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_CURR_VALUE, dRate))
- {
+ if (true == Quotes_DBReadDouble(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_CURR_VALUE, dRate)) {
tostringstream o;
o.imbue(GetSystemLocale());
o << dRate;
@@ -62,11 +59,9 @@ INT_PTR CALLBACK QuoteInfoDlgProcImpl(MCONTACT hContact, HWND hdlg, UINT msg, WP }
time_t nFetchTime;
- if (true == get_fetch_time(nFetchTime, hContact))
- {
+ if (true == get_fetch_time(nFetchTime, hContact)) {
TCHAR szTime[50] = { 0 };
- if (0 == _tctime_s(szTime, 50, &nFetchTime))
- {
+ if (0 == _tctime_s(szTime, 50, &nFetchTime)) {
::SetDlgItemText(hdlg, IDC_EDIT_RATE_FETCH_TIME, szTime);
}
}
@@ -114,7 +109,7 @@ int QuotesEventFunc_OnUserInfoInit(WPARAM wp, LPARAM lp) OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = g_hInstance;
- odp.hIcon = Quotes_LoadIconEx(ICON_STR_MAIN);
+ odp.hIcon = Quotes_LoadIconEx(IDI_ICON_MAIN);
odp.pfnDlgProc = QuoteInfoDlgProc;
odp.position = -2000000000;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_DIALOG_QUOTE_INFO);
@@ -218,8 +213,7 @@ static INT_PTR CALLBACK QuoteInfoDlgProc1(HWND hdlg, UINT msg, WPARAM wParam, LP int Quotes_OnContactDoubleClick(WPARAM wp, LPARAM/* lp*/)
{
MCONTACT hContact = MCONTACT(wp);
- if (CModuleInfo::GetQuoteProvidersPtr()->GetContactProviderPtr(hContact))
- {
+ if (CModuleInfo::GetQuoteProvidersPtr()->GetContactProviderPtr(hContact)) {
MWindowList hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX_INFO, true);
assert(hWL);
HWND hWnd = WindowList_Find(hWL, hContact);
@@ -240,9 +234,9 @@ int Quotes_PrebuildContactMenu(WPARAM wp, LPARAM) {
Menu_EnableItem(g_hMenuEditSettings, false);
Menu_EnableItem(g_hMenuOpenLogFile, false);
-#ifdef CHART_IMPLEMENT
- Menu_EnableItem(g_hMenuChart,false);
-#endif
+ #ifdef CHART_IMPLEMENT
+ Menu_EnableItem(g_hMenuChart, false);
+ #endif
Menu_EnableItem(g_hMenuRefresh, false);
MCONTACT hContact = MCONTACT(wp);
@@ -260,11 +254,10 @@ int Quotes_PrebuildContactMenu(WPARAM wp, LPARAM) tstring sLogFileName;
bool bThereIsLogFile = (true == get_log_file(hContact, sLogFileName))
&& (false == sLogFileName.empty()) && (0 == _taccess(sLogFileName.c_str(), 04));
- if (true == bThereIsLogFile)
- {
-#ifdef CHART_IMPLEMENT
- Menu_EnableItem(g_hMenuChart,true);
-#endif
+ if (true == bThereIsLogFile) {
+ #ifdef CHART_IMPLEMENT
+ Menu_EnableItem(g_hMenuChart, true);
+ #endif
Menu_EnableItem(g_hMenuOpenLogFile, true);
}
|