summaryrefslogtreecommitdiff
path: root/protocols/Weather/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-08-18 13:54:34 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-08-18 13:54:34 +0300
commit13711bec8267252821d338dee47d3cab5acd0e0e (patch)
tree1b217a321825663b89263f470b81926fdb09b662 /protocols/Weather/src
parent1c43614d3c482ce931d55f9a86cac8fbb0852792 (diff)
Weather: protocol icon in UserInfo dialog
Diffstat (limited to 'protocols/Weather/src')
-rw-r--r--protocols/Weather/src/stdafx.h1
-rw-r--r--protocols/Weather/src/version.h2
-rw-r--r--protocols/Weather/src/weather_svcs.cpp8
-rw-r--r--protocols/Weather/src/weather_userinfo.cpp51
4 files changed, 32 insertions, 30 deletions
diff --git a/protocols/Weather/src/stdafx.h b/protocols/Weather/src/stdafx.h
index c0cee1d62e..88376fee8f 100644
--- a/protocols/Weather/src/stdafx.h
+++ b/protocols/Weather/src/stdafx.h
@@ -516,7 +516,6 @@ int UserInfoInit(WPARAM wParam, LPARAM lParam);
#define WM_UPDATEDATA WM_USER + 2687
int BriefInfo(WPARAM wParam, LPARAM lParam);
-INT_PTR BriefInfoSvc(WPARAM wParam, LPARAM lParam);
///////////////////////////////////////////////////////////////////////////////
// UI Classes
diff --git a/protocols/Weather/src/version.h b/protocols/Weather/src/version.h
index 90192f3504..1120750b75 100644
--- a/protocols/Weather/src/version.h
+++ b/protocols/Weather/src/version.h
@@ -1,7 +1,7 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 4
#define __RELEASE_NUM 0
-#define __BUILD_NUM 7
+#define __BUILD_NUM 8
#include <stdver.h>
diff --git a/protocols/Weather/src/weather_svcs.cpp b/protocols/Weather/src/weather_svcs.cpp
index 7a7dff321c..c8307ba99a 100644
--- a/protocols/Weather/src/weather_svcs.cpp
+++ b/protocols/Weather/src/weather_svcs.cpp
@@ -302,12 +302,18 @@ void UpdateMenu(BOOL State)
}
// update the weather auto-update menu item when click on it
-INT_PTR EnableDisableCmd(WPARAM wParam, LPARAM lParam)
+static INT_PTR EnableDisableCmd(WPARAM wParam, LPARAM lParam)
{
UpdateMenu(wParam == TRUE ? (BOOL)lParam : !opt.CAutoUpdate);
return 0;
}
+// displays contact info dialog
+static INT_PTR BriefInfoSvc(WPARAM wParam, LPARAM lParam)
+{
+ return BriefInfo(wParam, lParam);
+}
+
// adding weather contact menus
// copied and modified form "modified MSN Protocol"
void AddMenuItems(void)
diff --git a/protocols/Weather/src/weather_userinfo.cpp b/protocols/Weather/src/weather_userinfo.cpp
index f17f797f73..5d4ba034d0 100644
--- a/protocols/Weather/src/weather_userinfo.cpp
+++ b/protocols/Weather/src/weather_userinfo.cpp
@@ -239,6 +239,27 @@ static INT_PTR CALLBACK DlgProcMoreData(HWND hwndDlg, UINT msg, WPARAM wParam, L
return FALSE;
}
+// show brief information dialog
+// wParam = current contact
+int BriefInfo(WPARAM wParam, LPARAM)
+{
+ // make sure that the contact is actually a weather one
+ if (!IsMyContact(wParam))
+ return 0;
+
+ HWND hMoreDataDlg = WindowList_Find(hDataWindowList, wParam);
+ if (hMoreDataDlg != nullptr) {
+ SetForegroundWindow(hMoreDataDlg);
+ SetFocus(hMoreDataDlg);
+ }
+ else hMoreDataDlg = CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_BRIEF), nullptr, DlgProcMoreData, (LPARAM)wParam);
+
+ ShowWindow(GetDlgItem(hMoreDataDlg, IDC_DATALIST), 0);
+ ShowWindow(GetDlgItem(hMoreDataDlg, IDC_MTEXT), 1);
+ SetDlgItemText(hMoreDataDlg, IDC_MTOGGLE, TranslateT("More Info"));
+ return 1;
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
// User info dialog
@@ -317,6 +338,8 @@ int UserInfoInit(WPARAM wParam, LPARAM hContact)
USERINFOPAGE uip = {};
uip.szTitle.a = MODULENAME;
uip.position = 100000000;
+ uip.flags = ODPF_ICON;
+ uip.dwInitParam = LPARAM(g_plugin.getIconHandle(IDI_ICON));
if (hContact == 0) {
uip.pDialog = new WeatherMyDetailsDlg();
@@ -324,34 +347,8 @@ int UserInfoInit(WPARAM wParam, LPARAM hContact)
}
else if (IsMyContact(hContact)) { // check if it is a weather contact
uip.pDialog = new WeatherUserInfoDlg();
- uip.flags = ODPF_BOLDGROUPS;
+ uip.flags |= ODPF_BOLDGROUPS;
g_plugin.addUserInfo(wParam, &uip);
}
return 0;
}
-
-// show brief information dialog
-// wParam = current contact
-int BriefInfo(WPARAM wParam, LPARAM)
-{
- // make sure that the contact is actually a weather one
- if (!IsMyContact(wParam))
- return 0;
-
- HWND hMoreDataDlg = WindowList_Find(hDataWindowList, wParam);
- if (hMoreDataDlg != nullptr) {
- SetForegroundWindow(hMoreDataDlg);
- SetFocus(hMoreDataDlg);
- }
- else hMoreDataDlg = CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_BRIEF), nullptr, DlgProcMoreData, (LPARAM)wParam);
-
- ShowWindow(GetDlgItem(hMoreDataDlg, IDC_DATALIST), 0);
- ShowWindow(GetDlgItem(hMoreDataDlg, IDC_MTEXT), 1);
- SetDlgItemText(hMoreDataDlg, IDC_MTOGGLE, TranslateT("More Info"));
- return 1;
-}
-
-INT_PTR BriefInfoSvc(WPARAM wParam, LPARAM lParam)
-{
- return BriefInfo(wParam, lParam);
-}