diff options
author | George Hazan <george.hazan@gmail.com> | 2013-01-27 11:57:40 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-01-27 11:57:40 +0000 |
commit | 18f6faf592c21341463e835599b61fa811d3e1a0 (patch) | |
tree | 33074d2a8466bdc6b27a4a93ae97e871da57eef7 /plugins/Clist_modern/src/modern_popup.cpp | |
parent | 3e2fa0fa0e7f74b99e3f76d966928e30f1b39393 (diff) |
code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@3301 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/src/modern_popup.cpp')
-rw-r--r-- | plugins/Clist_modern/src/modern_popup.cpp | 61 |
1 files changed, 18 insertions, 43 deletions
diff --git a/plugins/Clist_modern/src/modern_popup.cpp b/plugins/Clist_modern/src/modern_popup.cpp index 9da27e5ff9..63b4c0418d 100644 --- a/plugins/Clist_modern/src/modern_popup.cpp +++ b/plugins/Clist_modern/src/modern_popup.cpp @@ -13,25 +13,23 @@ Library General Public License for more details. You should have received a copy of the GNU Library General Public
License along with this file; see the file license.txt. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
+
#include "hdr/modern_commonheaders.h"
#include "hdr/modern_popup.h"
-
BOOL EnablePopups = FALSE;
static LRESULT CALLBACK DumbPopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
-
// Show an error popup
void ShowErrPopup(const char *title, const char *description)
{
ShowPopup(title == NULL ? "Modern Contact List Error" : title, description, POPUP_TYPE_ERROR);
}
-
// Show an trace popup
void ShowTracePopup(const char *text)
{
@@ -52,35 +50,27 @@ void ShowTracePopup(const char *text) // Show an popup
void ShowPopup(const char *title, const char *description, int type)
{
- POPUPDATAEX ppd;
- int ret;
-
if ( !ServiceExists(MS_POPUP_ADDPOPUPEX) || !EnablePopups)
- {
return;
- }
// Make popup
- ZeroMemory(&ppd, sizeof(ppd));
+ POPUPDATAEX ppd = { 0 };
ppd.lchContact = 0;
ppd.lchIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
strncpy(ppd.lpzContactName, title == NULL ? "Modern Contact List" : title, SIZEOF(ppd.lpzContactName)-1);
ppd.lpzContactName[SIZEOF(ppd.lpzContactName)-1] = '\0';
- if (description != NULL)
- {
+ if (description != NULL) {
strncpy(ppd.lpzText, description, SIZEOF(ppd.lpzText)-1);
ppd.lpzText[SIZEOF(ppd.lpzText)-1] = '\0';
}
- if (type == POPUP_TYPE_NORMAL || type == POPUP_TYPE_TEST)
- {
+ if (type == POPUP_TYPE_NORMAL || type == POPUP_TYPE_TEST) {
ppd.colorBack = 0;
ppd.colorText = 0;
}
- else // if (type == POPUP_TYPE_ERROR)
- {
+ else {
ppd.colorBack = -1;
ppd.colorText = RGB(255,255,255);
}
@@ -88,44 +78,29 @@ void ShowPopup(const char *title, const char *description, int type) ppd.PluginWindowProc = DumbPopupDlgProc;
if (type == POPUP_TYPE_NORMAL || type == POPUP_TYPE_TEST)
- {
ppd.iSeconds = 0;
- }
- else // if (type == POPUP_TYPE_ERROR)
- {
+ else
ppd.iSeconds = 0;
- }
// Now that every field has been filled, we want to see the popup.
- ret = CallService(MS_POPUP_ADDPOPUPEX, (WPARAM)&ppd,0);
-
- ret++;
+ CallService(MS_POPUP_ADDPOPUPEX, (WPARAM)&ppd, 0);
}
-
-
// Handle to popup events
static LRESULT CALLBACK DumbPopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message) {
- case WM_COMMAND:
- {
- PUDeletePopUp(hWnd);
- return TRUE;
- }
-
- case WM_CONTEXTMENU:
- {
- PUDeletePopUp(hWnd);
- return TRUE;
- }
-
- case UM_FREEPLUGINDATA:
- {
- return TRUE;
- }
+ case WM_COMMAND:
+ PUDeletePopUp(hWnd);
+ return TRUE;
+
+ case WM_CONTEXTMENU:
+ PUDeletePopUp(hWnd);
+ return TRUE;
+
+ case UM_FREEPLUGINDATA:
+ return TRUE;
}
return DefWindowProc(hWnd, message, wParam, lParam);
}
-
|