From 72fe92f13d8cc335b0a05a702b99f52811898786 Mon Sep 17 00:00:00 2001
From: Vadim Dashevskiy <watcherhd@gmail.com>
Date: Thu, 21 Mar 2013 17:27:55 +0000
Subject: - MsgPopup: create popup options page only if plugin exists -
 SeenPlugin: cosmetics (patch from person)

git-svn-id: http://svn.miranda-ng.org/main/trunk@4150 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
---
 plugins/MsgPopup/src/main.cpp      |  21 ++---
 plugins/SeenPlugin/res/resource.rc | 165 ++++++++++++++++---------------------
 plugins/SeenPlugin/src/resource.h  |   1 -
 3 files changed, 82 insertions(+), 105 deletions(-)

diff --git a/plugins/MsgPopup/src/main.cpp b/plugins/MsgPopup/src/main.cpp
index ea6c69c0df..bdc1a5ab5e 100644
--- a/plugins/MsgPopup/src/main.cpp
+++ b/plugins/MsgPopup/src/main.cpp
@@ -199,16 +199,17 @@ int HookedInit(WPARAM wParam, LPARAM lParam)
 
 int HookedOptions(WPARAM wParam, LPARAM lParam)
 {
-	OPTIONSDIALOGPAGE odp = {0};
-	odp.cbSize = sizeof(odp);
-	odp.hInstance = hInst;
-	odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
-	odp.ptszTitle = LPGENT("MessagePopup");
-	odp.ptszGroup = LPGENT("Popups");
-	odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
-	odp.pfnDlgProc = OptionsDlgProc;
-	Options_AddPage(wParam, &odp);
-
+	if (ServiceExists(MS_POPUP_ADDPOPUP)){
+		OPTIONSDIALOGPAGE odp = {0};
+		odp.cbSize = sizeof(odp);
+		odp.hInstance = hInst;
+		odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
+		odp.ptszTitle = LPGENT("MessagePopup");
+		odp.ptszGroup = LPGENT("Popups");
+		odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+		odp.pfnDlgProc = OptionsDlgProc;
+		Options_AddPage(wParam, &odp);
+	}
 	return 0;
 }
 
diff --git a/plugins/SeenPlugin/res/resource.rc b/plugins/SeenPlugin/res/resource.rc
index 93f0da9146..87f914463a 100644
--- a/plugins/SeenPlugin/res/resource.rc
+++ b/plugins/SeenPlugin/res/resource.rc
@@ -1,4 +1,4 @@
-//Microsoft Developer Studio generated resource script.
+// Microsoft Visual C++ generated resource script.
 //
 #include "..\src\resource.h"
 
@@ -12,13 +12,11 @@
 #undef APSTUDIO_READONLY_SYMBOLS
 
 /////////////////////////////////////////////////////////////////////////////
-// German (Germany) resources
+// �������� (��������) resources
 
 #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU)
-#ifdef _WIN32
 LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
 #pragma code_page(1252)
-#endif //_WIN32
 
 #ifdef APSTUDIO_INVOKED
 /////////////////////////////////////////////////////////////////////////////
@@ -26,17 +24,17 @@ LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
 // TEXTINCLUDE
 //
 
-1 TEXTINCLUDE
+1 TEXTINCLUDE 
 BEGIN
     "..\\src\\resource.h\0"
 END
 
-2 TEXTINCLUDE
+2 TEXTINCLUDE 
 BEGIN
     "#include <winres.h>\0"
 END
 
-3 TEXTINCLUDE
+3 TEXTINCLUDE 
 BEGIN
     "\r\n"
     "\0"
@@ -51,103 +49,87 @@ END
 //
 
 IDD_SETTINGS DIALOGEX 0, 0, 300, 228
-STYLE DS_3DLOOK | DS_FIXEDSYS | WS_CHILD
+STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | WS_CHILD
 EXSTYLE WS_EX_CONTROLPARENT
 FONT 8, "MS Shell Dlg", 0, 0, 0x1
 BEGIN
     GROUPBOX        "Last seen options",IDC_MAINGROUP,0,0,299,226,WS_GROUP
-    CONTROL         "Last seen menuitem",IDC_MENUITEM,"Button",
-                    BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,6,12,132,10
-    CONTROL         "Show icon",IDC_SHOWICON,"Button",BS_AUTOCHECKBOX |
-                    WS_GROUP | WS_TABSTOP,141,12,69,10
+    CONTROL         "Last seen menuitem",IDC_MENUITEM,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,6,12,132,10
+    CONTROL         "Show icon",IDC_SHOWICON,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,141,12,69,10
     EDITTEXT        IDC_MENUSTAMP,18,23,120,12,ES_AUTOHSCROLL | WS_GROUP
-    CONTROL         "Userinfo tab",IDC_USERINFO,"Button",BS_AUTOCHECKBOX |
-                    WS_GROUP | WS_TABSTOP,6,42,140,10
+    CONTROL         "Userinfo tab",IDC_USERINFO,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,6,42,140,10
     EDITTEXT        IDC_USERSTAMP,18,52,275,12,ES_AUTOHSCROLL | WS_GROUP
-    CONTROL         "Log to file",IDC_FILE,"Button",BS_AUTOCHECKBOX |
-                    WS_GROUP | WS_TABSTOP,6,72,132,10
+    CONTROL         "Log to file",IDC_FILE,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,6,72,132,10
     EDITTEXT        IDC_FILENAME,149,69,144,12,ES_AUTOHSCROLL
     EDITTEXT        IDC_FILESTAMP,18,83,275,12,ES_AUTOHSCROLL | WS_GROUP
-    CONTROL         "Log to history",IDC_HISTORY,"Button",BS_AUTOCHECKBOX |
-                    WS_GROUP | WS_TABSTOP,7,104,131,10
-    LTEXT           "Maximum size",IDC_STATIC,183,102,51,9
+    CONTROL         "Log to history",IDC_HISTORY,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,7,104,131,10
+    LTEXT           "Maximum size",IDC_MAINGROUP,183,102,51,9
     EDITTEXT        IDC_HISTORYSIZE,149,100,30,12,ES_AUTOHSCROLL | ES_NUMBER
     EDITTEXT        IDC_HISTORYSTAMP,18,114,275,12,ES_AUTOHSCROLL | WS_GROUP
     PUSHBUTTON      "Variable list",IDC_VARIABLES,47,137,50,13
-    CONTROL         "Enable Idle support",IDC_IDLESUPPORT,"Button",
-                    BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,7,158,135,10
-    CONTROL         "Ignore contacts going offline",IDC_IGNOREOFFLINE,"Button",
-                    BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,7,174,135,10
-    CONTROL         "Enable 'Missed Ones' feature",IDC_MISSEDONES,"Button",
-                    BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,7,190,135,10
-    CONTROL         "Count times",IDC_COUNT,"Button",BS_AUTOCHECKBOX |
-                    WS_GROUP | WS_TABSTOP,18,202,100,10
+    CONTROL         "Enable Idle support",IDC_IDLESUPPORT,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,7,158,135,10
+    CONTROL         "Ignore contacts going offline",IDC_IGNOREOFFLINE,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,7,174,135,10
+    CONTROL         "Enable 'Missed Ones' feature",IDC_MISSEDONES,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,7,190,135,10
+    CONTROL         "Count times",IDC_COUNT,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,18,202,100,10
     LTEXT           "Protocols to watch:",IDC_MAINGROUP,149,130,114,9
-    CONTROL         "Tree1",IDC_PROTOCOLLIST,"SysTreeView32",TVS_NOTOOLTIPS |
-                    WS_BORDER | WS_TABSTOP,149,140,144,81
+    CONTROL         "Tree1",IDC_PROTOCOLLIST,"SysTreeView32",TVS_NOTOOLTIPS | WS_BORDER | WS_TABSTOP,149,140,144,81
 END
 
 IDD_POPUPS DIALOGEX 0, 0, 280, 208
-STYLE DS_3DLOOK | DS_FIXEDSYS | WS_CHILD
+STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | WS_CHILD
 EXSTYLE WS_EX_CONTROLPARENT
 FONT 8, "MS Shell Dlg", 0, 0, 0x1
 BEGIN
-    GROUPBOX        "",IDC_STATIC,0,0,280,26,WS_GROUP
-    CTEXT           "Popup interoperability missing or disabled. You need Popups plugin",IDC_MISSPOPUP,1,11,280,10,NOT WS_VISIBLE
-    CONTROL         "Use popups",IDC_POPUPS,"Button",BS_AUTOCHECKBOX |
-                    WS_GROUP | WS_TABSTOP,3,10,50,10
-    RTEXT           "Title",IDC_LABTEXT,57,11,40,10
-    EDITTEXT        IDC_POPUPSTAMP,100,9,50,12,ES_AUTOHSCROLL | WS_GROUP
-    RTEXT           "Text",IDC_LABTTITLE,155,11,25,10
-    EDITTEXT        IDC_POPUPSTAMPTEXT,185,9,88,12,ES_AUTOHSCROLL |
-                    WS_GROUP
-    GROUPBOX        "PopUp Colors",IDC_STATIC,0,30,280,136,WS_GROUP
-    RTEXT           "Online",IDC_STATIC,10,43,60,10
-    CONTROL         "",ID_STATUS_ONLINE,"ColourPicker",WS_TABSTOP,80,40,20,14
-    CONTROL         "",ID_STATUS_ONLINE+20,"ColourPicker",WS_TABSTOP,105,40,20,14
-    RTEXT           "Away",IDC_STATIC,10,63,60,10
-    CONTROL         "",ID_STATUS_AWAY,"ColourPicker",WS_TABSTOP,80,60,20,14
-    CONTROL         "",ID_STATUS_AWAY+20,"ColourPicker",WS_TABSTOP,105,60,20,14
-    RTEXT           "NA",IDC_STATIC,10,83,60,10
-    CONTROL         "",ID_STATUS_NA,"ColourPicker",WS_TABSTOP,80,80,20,14
-    CONTROL         "",ID_STATUS_NA+20,"ColourPicker",WS_TABSTOP,105,80,20,14
-    RTEXT           "Occupied",IDC_STATIC,10,103,60,10
-    CONTROL         "",ID_STATUS_OCCUPIED,"ColourPicker",WS_TABSTOP,80,100,20,14
-    CONTROL         "",ID_STATUS_OCCUPIED+20,"ColourPicker",WS_TABSTOP,105,100,20,14
-    RTEXT           "DND",IDC_STATIC,10,123,60,10
-    CONTROL         "",ID_STATUS_DND,"ColourPicker",WS_TABSTOP,80,120,20,14
-    CONTROL         "",ID_STATUS_DND+20,"ColourPicker",WS_TABSTOP,105,120,20,14
-
-    RTEXT           "On the phone",IDC_STATIC,140,43,60,10
-    CONTROL         "",ID_STATUS_ONTHEPHONE,"ColourPicker",WS_TABSTOP,210,40,20,14
-    CONTROL         "",ID_STATUS_ONTHEPHONE+20,"ColourPicker",WS_TABSTOP,235,40,20,14
-    RTEXT           "Out to lunch",IDC_STATIC,140,63,60,10
-    CONTROL         "",ID_STATUS_OUTTOLUNCH,"ColourPicker",WS_TABSTOP,210,60,20,14
-    CONTROL         "",ID_STATUS_OUTTOLUNCH+20,"ColourPicker",WS_TABSTOP,235,60,20,14
-    RTEXT           "Free for chat",IDC_STATIC,140,83,60,10
-    CONTROL         "",ID_STATUS_FREECHAT,"ColourPicker",WS_TABSTOP,210,80,20,14
-    CONTROL         "",ID_STATUS_FREECHAT+20,"ColourPicker",WS_TABSTOP,235,80,20,14
-    RTEXT           "Invisible",IDC_STATIC,140,103,60,10
-    CONTROL         "",ID_STATUS_INVISIBLE,"ColourPicker",WS_TABSTOP,210,100,20,14
-    CONTROL         "",ID_STATUS_INVISIBLE+20,"ColourPicker",WS_TABSTOP,235,100,20,14
-    RTEXT           "Offline",IDC_STATIC,140,123,60,10
-    CONTROL         "",ID_STATUS_OFFLINE,"ColourPicker",WS_TABSTOP,210,120,20,14
-    CONTROL         "",ID_STATUS_OFFLINE+20,"ColourPicker",WS_TABSTOP,235,120,20,14
-    PUSHBUTTON      "Reset colors",IDC_DEFAULTCOL,115,145,50,13
+    GROUPBOX        "",IDC_STATIC,0,0,280,69,WS_GROUP
+    CONTROL         "Use popups",IDC_POPUPS,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,3,10,50,10
+    RTEXT           "Title",IDC_LABTEXT,6,22,40,10
+    EDITTEXT        IDC_POPUPSTAMP,49,20,224,12,ES_AUTOHSCROLL | WS_GROUP
+    RTEXT           "Text",IDC_LABTTITLE,19,37,25,10
+    EDITTEXT        IDC_POPUPSTAMPTEXT,49,35,224,12,ES_AUTOHSCROLL | WS_GROUP
+    GROUPBOX        "PopUp Colors",IDC_STATIC,0,70,280,136,WS_GROUP
+    RTEXT           "Online",IDC_STATIC,10,83,60,10
+    CONTROL         "",ID_STATUS_ONLINE,"ColourPicker",WS_TABSTOP,80,80,20,14
+    CONTROL         "",40092,"ColourPicker",WS_TABSTOP,105,80,20,14
+    RTEXT           "Away",IDC_STATIC,10,103,60,10
+    CONTROL         "",ID_STATUS_AWAY,"ColourPicker",WS_TABSTOP,80,100,20,14
+    CONTROL         "",40093,"ColourPicker",WS_TABSTOP,105,100,20,14
+    RTEXT           "NA",IDC_STATIC,10,123,60,10
+    CONTROL         "",ID_STATUS_NA,"ColourPicker",WS_TABSTOP,80,120,20,14
+    CONTROL         "",40095,"ColourPicker",WS_TABSTOP,105,120,20,14
+    RTEXT           "Occupied",IDC_STATIC,10,143,60,10
+    CONTROL         "",ID_STATUS_OCCUPIED,"ColourPicker",WS_TABSTOP,80,140,20,14
+    CONTROL         "",40096,"ColourPicker",WS_TABSTOP,105,140,20,14
+    RTEXT           "DND",IDC_STATIC,10,163,60,10
+    CONTROL         "",ID_STATUS_DND,"ColourPicker",WS_TABSTOP,80,160,20,14
+    CONTROL         "",40094,"ColourPicker",WS_TABSTOP,105,160,20,14
+    RTEXT           "On the phone",IDC_STATIC,140,83,60,10
+    CONTROL         "",ID_STATUS_ONTHEPHONE,"ColourPicker",WS_TABSTOP,210,80,20,14
+    CONTROL         "",40099,"ColourPicker",WS_TABSTOP,235,80,20,14
+    RTEXT           "Out to lunch",IDC_STATIC,140,103,60,10
+    CONTROL         "",ID_STATUS_OUTTOLUNCH,"ColourPicker",WS_TABSTOP,210,100,20,14
+    CONTROL         "",40100,"ColourPicker",WS_TABSTOP,235,100,20,14
+    RTEXT           "Free for chat",IDC_STATIC,140,123,60,10
+    CONTROL         "",ID_STATUS_FREECHAT,"ColourPicker",WS_TABSTOP,210,120,20,14
+    CONTROL         "",40097,"ColourPicker",WS_TABSTOP,235,120,20,14
+    RTEXT           "Invisible",IDC_STATIC,140,143,60,10
+    CONTROL         "",ID_STATUS_INVISIBLE,"ColourPicker",WS_TABSTOP,210,140,20,14
+    CONTROL         "",40098,"ColourPicker",WS_TABSTOP,235,140,20,14
+    RTEXT           "Offline",IDC_STATIC,140,163,60,10
+    CONTROL         "",ID_STATUS_OFFLINE,"ColourPicker",WS_TABSTOP,210,160,20,14
+    CONTROL         "",40091,"ColourPicker",WS_TABSTOP,235,160,20,14
+    PUSHBUTTON      "Reset colors",IDC_DEFAULTCOL,115,185,50,13
 END
 
 IDD_USERINFO DIALOGEX 0, 0, 222, 132
-STYLE DS_3DLOOK | DS_FIXEDSYS | WS_CHILD
+STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | WS_CHILD
 EXSTYLE WS_EX_CONTROLPARENT
 FONT 8, "MS Shell Dlg", 0, 0, 0x1
 BEGIN
-    EDITTEXT        IDC_INFOTEXT,6,6,210,122,ES_MULTILINE | ES_NOHIDESEL |
-                    ES_READONLY | NOT WS_BORDER
+    EDITTEXT        IDC_INFOTEXT,6,6,210,122,ES_MULTILINE | ES_NOHIDESEL | ES_READONLY | NOT WS_BORDER
 END
 
 IDD_MISSED DIALOGEX 0, 0, 160, 71
-STYLE DS_MODALFRAME | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP |
-    WS_CAPTION | WS_SYSMENU
+STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
 EXSTYLE WS_EX_CONTROLPARENT
 CAPTION "Last seen plugin"
 FONT 8, "MS Shell Dlg", 0, 0, 0x1
@@ -158,18 +140,16 @@ BEGIN
 END
 
 IDD_HISTORY DIALOGEX 0, 0, 200, 120
-STYLE DS_SETFOREGROUND | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP |
-    WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
+STYLE DS_SETFONT | DS_SETFOREGROUND | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
 EXSTYLE WS_EX_CONTROLPARENT
 FONT 8, "MS Shell Dlg", 0, 0, 0x1
 BEGIN
     DEFPUSHBUTTON   "OK",IDOK,75,101,50,14
     LISTBOX         IDC_HISTORYLIST,5,20,190,59,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
-    CONTROL         "Alert when user status changes",IDC_STATUSCHANGE,"Button",
-                    BS_AUTOCHECKBOX | WS_TABSTOP,5,86,190,8
-    CONTROL         "",IDC_USERMENU,"MButtonClass",BS_ICON | WS_TABSTOP,140,2,16,16
-    CONTROL         "",IDC_DETAILS, "MButtonClass",BS_ICON | WS_TABSTOP,160,2,16,16
-    CONTROL         "",IDC_SENDMSG, "MButtonClass",BS_ICON | WS_TABSTOP,180,2,16,16
+    CONTROL         "Alert when user status changes",IDC_STATUSCHANGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,86,190,8
+    CONTROL         "",IDC_USERMENU,"MButtonClass",WS_TABSTOP | 0x40,140,2,16,16
+    CONTROL         "",IDC_DETAILS,"MButtonClass",WS_TABSTOP | 0x40,160,2,16,16
+    CONTROL         "",IDC_SENDMSG,"MButtonClass",WS_TABSTOP | 0x40,180,2,16,16
 END
 
 
@@ -181,16 +161,12 @@ END
 #ifdef APSTUDIO_INVOKED
 GUIDELINES DESIGNINFO
 BEGIN
-    IDD_OPTIONS, DIALOG
+    IDD_SETTINGS, DIALOG
+    BEGIN
+    END
+
+    IDD_POPUPS, DIALOG
     BEGIN
-        LEFTMARGIN, 7
-        RIGHTMARGIN, 293
-        VERTGUIDE, 18
-        VERTGUIDE, 149
-        VERTGUIDE, 161
-        TOPMARGIN, 7
-        BOTTOMMARGIN, 225
-        HORZGUIDE, 22
     END
 
     IDD_USERINFO, DIALOG
@@ -219,7 +195,7 @@ BEGIN
 END
 #endif    // APSTUDIO_INVOKED
 
-#endif    // German (Germany) resources
+#endif    // �������� (��������) resources
 /////////////////////////////////////////////////////////////////////////////
 
 
@@ -233,3 +209,4 @@ END
 
 /////////////////////////////////////////////////////////////////////////////
 #endif    // not APSTUDIO_INVOKED
+
diff --git a/plugins/SeenPlugin/src/resource.h b/plugins/SeenPlugin/src/resource.h
index 110639bb3b..1001ae2739 100644
--- a/plugins/SeenPlugin/src/resource.h
+++ b/plugins/SeenPlugin/src/resource.h
@@ -79,7 +79,6 @@
 #define IDC_MAINGROUP                   -1
 #define IDC_INFO                        -1
 #define IDC_TEXT                        -1
-#define IDC_STATIC                      -1
 
 // Next default values for new objects
 //
-- 
cgit v1.2.3