summaryrefslogtreecommitdiff
path: root/plugins/LotusNotify
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2015-06-12 19:21:42 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2015-06-12 19:21:42 +0000
commit9c4510cd09c2fb34eeb1cefe58d70a7fb75e5ad4 (patch)
treeae1b0a09b21166bb16a4df25427b298952b6b293 /plugins/LotusNotify
parent21ecc48547be0920eed6ce45d5948c3b7d0d7581 (diff)
LotusNotify:
- options redesign (by pepinlebref) - minor warnings fixed git-svn-id: http://svn.miranda-ng.org/main/trunk@14135 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/LotusNotify')
-rw-r--r--plugins/LotusNotify/LotusNotify_10.vcxproj4
-rw-r--r--plugins/LotusNotify/LotusNotify_10.vcxproj.filters8
-rw-r--r--plugins/LotusNotify/res/LotusNotify.rc143
-rw-r--r--plugins/LotusNotify/src/LotusNotify.cpp756
-rw-r--r--plugins/LotusNotify/src/debug.cpp17
-rw-r--r--plugins/LotusNotify/src/resource.h9
-rw-r--r--plugins/LotusNotify/src/version.h2
7 files changed, 524 insertions, 415 deletions
diff --git a/plugins/LotusNotify/LotusNotify_10.vcxproj b/plugins/LotusNotify/LotusNotify_10.vcxproj
index d77f495c9f..e178c3c97c 100644
--- a/plugins/LotusNotify/LotusNotify_10.vcxproj
+++ b/plugins/LotusNotify/LotusNotify_10.vcxproj
@@ -112,6 +112,10 @@
<ItemGroup>
<ResourceCompile Include="res\LotusNotify.rc" />
</ItemGroup>
+ <ItemGroup>
+ <None Include="res\icon1.ico" />
+ <None Include="res\icon2.ico" />
+ </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
diff --git a/plugins/LotusNotify/LotusNotify_10.vcxproj.filters b/plugins/LotusNotify/LotusNotify_10.vcxproj.filters
index 9bc4ec3ce0..97e891ae0b 100644
--- a/plugins/LotusNotify/LotusNotify_10.vcxproj.filters
+++ b/plugins/LotusNotify/LotusNotify_10.vcxproj.filters
@@ -53,4 +53,12 @@
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
+ <ItemGroup>
+ <None Include="res\icon1.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\icon2.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ </ItemGroup>
</Project> \ No newline at end of file
diff --git a/plugins/LotusNotify/res/LotusNotify.rc b/plugins/LotusNotify/res/LotusNotify.rc
index eaaea478c1..9715da43d7 100644
--- a/plugins/LotusNotify/res/LotusNotify.rc
+++ b/plugins/LotusNotify/res/LotusNotify.rc
@@ -38,79 +38,88 @@ IDI_ICON2 ICON "icon2.ico"
// Dialog
//
-IDD_OPT_DIALOG DIALOGEX 0, 0, 315, 250
+IDD_OPT_LOTUS_CONECTION DIALOGEX 0, 0, 255, 185
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- GROUPBOX "Lotus connection settings",IDC_STATIC,0,5,242,57
- LTEXT "Primary server:",IDC_STATIC,3,16,65,9
- COMBOBOX IDC_SERVER,67,14,115,11,CBS_DROPDOWN | CBS_AUTOHSCROLL |
+ GROUPBOX "Lotus connection settings",IDC_STATIC,2,39,251,95
+ LTEXT "Primary server:",IDC_STATIC,8,73,105,8
+ COMBOBOX IDC_SERVER,116,71,131,11,CBS_DROPDOWN | CBS_AUTOHSCROLL |
CBS_SORT | CBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP
- LTEXT "Secondary server:",IDC_STATIC,3,27,65,9
- EDITTEXT IDC_SERVERSEC,67,26,115,11,ES_AUTOHSCROLL
- LTEXT "Database:",IDC_STATIC,3,38,65,9
- EDITTEXT IDC_DATABASE,67,37,115,11,ES_AUTOHSCROLL
- LTEXT "Password:",IDC_STATIC,3,49,65,9
- EDITTEXT IDC_PASSWORD,67,48,115,11,ES_PASSWORD | ES_AUTOHSCROLL
- PUSHBUTTON "try detect",IDC_BUTTON_DETECT,188,15,50,30,BS_MULTILINE
- CONTROL "autoregister",IDC_BUTTON_CHECK,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,186,48,52,12
- GROUPBOX "Check interval:",IDC_STATIC,244,5,70,57
- EDITTEXT IDC_INTERVAL,247,14,21,11,ES_AUTOHSCROLL
- LTEXT "min.",IDC_STATIC,270,16,19,8
- LTEXT "(0-disabled)",IDC_STATIC,250,29,56,8
+ LTEXT "Secondary server:",IDC_STATIC,8,88,105,9
+ EDITTEXT IDC_SERVERSEC,116,87,131,12,ES_AUTOHSCROLL
+ LTEXT "Database:",IDC_STATIC,8,103,105,9
+ EDITTEXT IDC_DATABASE,116,102,131,12,ES_AUTOHSCROLL
+ LTEXT "Password:",IDC_STATIC,8,118,105,9
+ EDITTEXT IDC_PASSWORD,116,117,131,12,ES_PASSWORD | ES_AUTOHSCROLL
+ PUSHBUTTON "try detect",IDC_BUTTON_DETECT,56,51,62,14,BS_MULTILINE
+ CONTROL "autoregister",IDC_BUTTON_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,154,54,90,8
+ GROUPBOX "Check interval:",IDC_STATIC,2,140,251,40
+ EDITTEXT IDC_INTERVAL,8,151,21,12,ES_AUTOHSCROLL
+ LTEXT "min.",IDC_STATIC,32,153,19,8
+ LTEXT "(0-disabled)",IDC_STATIC,55,153,121,8
CONTROL "Keep connection on error",IDC_KEEP_CONNEXION_ON_ERROR,
- "Button",BS_AUTOCHECKBOX | BS_MULTILINE |
- WS_TABSTOP,247,40,63,20
- GROUPBOX "Popup options",IDC_STATIC,0,63,315,75,WS_GROUP
+ "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,9,167,168,8
+END
+
+IDD_OPT_LOTUS_POPUP DIALOGEX 0, 0, 228, 204
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
CONTROL "Set popup colors",IDC_SETCOLOURS,"Button",
- BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,5,80,83,11
- CONTROL "Custom1",IDC_BGCOLOR,"ColourPicker",WS_GROUP | WS_TABSTOP,90,74,10,10
- LTEXT "Background",IDC_STATIC,105,75,43,8
- CONTROL "Custom1",IDC_FGCOLOR,"ColourPicker",WS_GROUP | WS_TABSTOP,90,87,10,10
- LTEXT "Text",IDC_STATIC,105,88,41,8
- LTEXT "Close after:",IDC_STATIC,3,102,44,9
- EDITTEXT IDC_INTERVAL1,48,101,21,11,ES_AUTOHSCROLL | WS_GROUP
- LTEXT "sec (0 default, -1 disabled)",IDC_STATIC,74,102,100,9
- LTEXT "Left button click cmd:",IDC_STATIC,3,115,80,9
- EDITTEXT IDC_COMMAND,83,114,103,11,ES_AUTOHSCROLL
- LTEXT "Command parameters:",IDC_STATIC,3,126,80,9
- EDITTEXT IDC_PARAMETERS,83,125,103,11,ES_AUTOHSCROLL
+ BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,5,35,218,8
+ CONTROL "Custom1",IDC_BGCOLOR,"ColourPicker",WS_GROUP | WS_TABSTOP,13,48,10,10
+ LTEXT "Background",IDC_STATIC,28,49,85,8
+ CONTROL "Custom1",IDC_FGCOLOR,"ColourPicker",WS_GROUP | WS_TABSTOP,117,48,10,10
+ LTEXT "Text",IDC_STATIC,132,49,85,8
+ LTEXT "Close after:",IDC_STATIC,5,68,65,8
+ EDITTEXT IDC_INTERVAL1,71,67,21,12,ES_AUTOHSCROLL | WS_GROUP
+ LTEXT "sec (0 default, -1 disabled)",IDC_STATIC,97,68,126,9
+ LTEXT "Left button click cmd:",IDC_STATIC,5,152,113,8
+ EDITTEXT IDC_COMMAND,120,150,103,12,ES_AUTOHSCROLL
+ LTEXT "Command parameters:",IDC_STATIC,5,167,113,8
+ EDITTEXT IDC_PARAMETERS,120,165,103,12,ES_AUTOHSCROLL
CONTROL "Show again if still unread",IDC_ONCEONLY,"Button",
- BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,198,69,115,10
+ BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,5,86,218,8
CONTROL "...but only if popup not clicked",IDC_NONCLICKEDONLY,"Button",
- BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,198,80,115,10
+ BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,5,98,218,8
CONTROL "Show error messages",IDC_SHOWERROR,"Button",
- BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,198,91,115,10
+ BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,5,110,218,8
CONTROL "Remember newest message ID and don't show older",IDC_NEWEST,"Button",
- BS_AUTOCHECKBOX | BS_LEFT | BS_MULTILINE | WS_TABSTOP,198,102,115,16
+ BS_AUTOCHECKBOX | BS_LEFT | BS_MULTILINE | WS_TABSTOP,5,122,218,8
CONTROL "...even if popup not clicked",IDC_REMEMBEREVENNONCLICKED,"Button",
- BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,198,120,115,10
- PUSHBUTTON "Clear popups history",IDC_BUTTON_CLEAR,20,140,140,12,BS_CENTER | BS_MULTILINE
- GROUPBOX "Filter messages contain below strings in:",IDC_STATIC,0,163,197,56
- LTEXT "Sender",IDC_STATIC,3,176,39,8
- COMBOBOX IDC_FILTER_SENDER,44,175,120,11,CBS_DROPDOWN | CBS_SORT |
+ BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,5,134,218,8
+ PUSHBUTTON "Clear popups history",IDC_BUTTON_CLEAR,43,185,140,14,BS_CENTER | BS_MULTILINE
+END
+
+IDD_OPT_LOTUS_MISC DIALOGEX 0, 0, 245, 216
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ GROUPBOX "Filter messages contain below strings in:",IDC_STATIC,5,20,235,62
+ LTEXT "Sender",IDC_STATIC,9,33,71,8
+ COMBOBOX IDC_FILTER_SENDER,82,32,120,11,CBS_DROPDOWN | CBS_SORT |
WS_VSCROLL | WS_TABSTOP
- PUSHBUTTON "+",IDC_BUTTON_ADD_SENDER_FILTER,167,175,13,12,BS_CENTER
- PUSHBUTTON "-",IDC_BUTTON_REMOVE_SENDER_FILTER,181,175,13,12,BS_CENTER
- LTEXT "Subject",IDC_STATIC,3,188,39,8
- COMBOBOX IDC_FILTER_SUBJECT,44,187,120,11,CBS_DROPDOWN | CBS_SORT |
+ PUSHBUTTON "+",IDC_BUTTON_ADD_SENDER_FILTER,206,32,13,12,BS_CENTER
+ PUSHBUTTON "-",IDC_BUTTON_REMOVE_SENDER_FILTER,220,32,13,12,BS_CENTER
+ LTEXT "Subject",IDC_STATIC,9,48,71,8
+ COMBOBOX IDC_FILTER_SUBJECT,82,47,120,11,CBS_DROPDOWN | CBS_SORT |
WS_VSCROLL | WS_TABSTOP
- PUSHBUTTON "+",IDC_BUTTON_ADD_SUBJECT_FILTER,167,187,13,12,BS_CENTER
- PUSHBUTTON "-",IDC_BUTTON_REMOVE_SUBJECT_FILTER,181,187,13,12,BS_CENTER
- LTEXT "To / CopyTo",IDC_STATIC,3,201,39,8
- COMBOBOX IDC_FILTER_TO,44,200,120,11,CBS_DROPDOWN | CBS_SORT |
+ PUSHBUTTON "+",IDC_BUTTON_ADD_SUBJECT_FILTER,206,47,13,12,BS_CENTER
+ PUSHBUTTON "-",IDC_BUTTON_REMOVE_SUBJECT_FILTER,220,47,13,12,BS_CENTER
+ LTEXT "To / CopyTo",IDC_STATIC,9,63,71,8
+ COMBOBOX IDC_FILTER_TO,82,62,120,11,CBS_DROPDOWN | CBS_SORT |
WS_VSCROLL | WS_TABSTOP
- PUSHBUTTON "+",IDC_BUTTON_ADD_TO_FILTER,167,200,13,12,BS_CENTER
- PUSHBUTTON "-",IDC_BUTTON_REMOVE_TO_FILTER,181,200,13,12,BS_CENTER
- GROUPBOX "Offline status mean:",IDC_STATIC,213,140,101,110
+ PUSHBUTTON "+",IDC_BUTTON_ADD_TO_FILTER,206,62,13,12,BS_CENTER
+ PUSHBUTTON "-",IDC_BUTTON_REMOVE_TO_FILTER,220,62,13,12,BS_CENTER
+ GROUPBOX "Offline status mean:",IDC_STATIC,66,95,113,112
CONTROL "",IDC_STATUS,"SysListView32",LVS_REPORT |
LVS_NOLABELWRAP | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER |
- LVS_NOSORTHEADER | WS_TABSTOP,216,150,96,97,
+ LVS_NOSORTHEADER | WS_TABSTOP,71,105,102,97,
WS_EX_CLIENTEDGE
- RTEXT "version:",IDC_VERSION2,5,234,35,9
- CTEXT "",IDC_VERSION,41,233,52,9,0,WS_EX_STATICEDGE
END
@@ -120,14 +129,30 @@ END
//
#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
+GUIDELINES DESIGNINFO
BEGIN
- IDD_OPT_DIALOG, DIALOG
+ IDD_OPT_LOTUS_CONECTION, DIALOG
+ BEGIN
+ LEFTMARGIN, 5
+ RIGHTMARGIN, 250
+ TOPMARGIN, 5
+ BOTTOMMARGIN, 180
+ END
+
+ IDD_OPT_LOTUS_POPUP, DIALOG
+ BEGIN
+ LEFTMARGIN, 5
+ RIGHTMARGIN, 223
+ TOPMARGIN, 5
+ BOTTOMMARGIN, 199
+ END
+
+ IDD_OPT_LOTUS_MISC, DIALOG
BEGIN
LEFTMARGIN, 5
- RIGHTMARGIN, 310
+ RIGHTMARGIN, 240
TOPMARGIN, 5
- BOTTOMMARGIN, 245
+ BOTTOMMARGIN, 211
END
END
#endif // APSTUDIO_INVOKED
diff --git a/plugins/LotusNotify/src/LotusNotify.cpp b/plugins/LotusNotify/src/LotusNotify.cpp
index f508c27906..38ee74482e 100644
--- a/plugins/LotusNotify/src/LotusNotify.cpp
+++ b/plugins/LotusNotify/src/LotusNotify.cpp
@@ -330,7 +330,7 @@ void Click(HWND hWnd,BOOL execute)
if(settingNewest && (pid->id > settingNewestID) ){
db_set_dw(NULL, PLUGINNAME, "LNNewestID", settingNewestID=pid->id);
}
- if(execute && settingCommand && mir_strlen(settingCommand)>0 ) {
+ if(execute && settingCommand[0] ) {
char tmpcommand[2*MAX_SETTING_STR];
char tmpparameters[2*MAX_SETTING_STR];
strncpy_s(tmpcommand, SIZEOF(tmpcommand), settingCommand, SIZEOF(tmpcommand));
@@ -724,7 +724,7 @@ void checkthread(void*)
&retModified, /* out: */
&retNoteClass) ;
memset(strLink, 0, sizeof(strLink));
- mir_snprintf(strLink, SIZEOF(strLink), "%.8lX%.8lX%.8lX%.8lX",
+ mir_snprintf(strLink, "%.8lX%.8lX%.8lX%.8lX",
retNoteOID.File.Innards[1],
retNoteOID.File.Innards[0],
retNoteOID.Note.Innards[1],
@@ -1033,330 +1033,417 @@ void LoadSettings()
//lookupLotusDefaultSettings();
}
-
-//callback function to speak with user interactions in options page
-INT_PTR CALLBACK DlgProcLotusNotifyOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+void SaveSettings(HWND hwndDlg)
{
- HWND hwndList;
- switch(msg)
- {
- case WM_INITDIALOG://initialize dialog, so set properties from db.
- {
- TranslateDialogDefault(hwndDlg);//translate miranda function
- TCHAR buffa[256];
- mir_sntprintf(buffa, SIZEOF(buffa), _T("%d.%d.%d.%d"), HIBYTE(HIWORD(pluginInfo.version)), LOBYTE(HIWORD(pluginInfo.version)), HIBYTE(LOWORD(pluginInfo.version)), LOBYTE(LOWORD(pluginInfo.version)));
- SetDlgItemText(hwndDlg, IDC_VERSION, buffa);
- LoadSettings();
- SetDlgItemTextA(hwndDlg, IDC_DATABASE, settingDatabase);
- SetDlgItemTextA(hwndDlg, IDC_SERVER, settingServer);
- SetDlgItemTextA(hwndDlg, IDC_SERVERSEC, settingServerSec);
- SetDlgItemTextA(hwndDlg, IDC_PASSWORD, settingPassword);
- SetDlgItemInt(hwndDlg, IDC_INTERVAL, settingInterval,FALSE);
- SetDlgItemInt(hwndDlg, IDC_INTERVAL1, settingInterval1,TRUE);
- CheckDlgButton(hwndDlg, IDC_KEEP_CONNEXION_ON_ERROR, settingKeepConnection ? BST_CHECKED : BST_UNCHECKED);
- SetDlgItemTextA(hwndDlg, IDC_COMMAND, settingCommand);
- SetDlgItemTextA(hwndDlg, IDC_PARAMETERS, settingParameters);
- CheckDlgButton(hwndDlg, IDC_ONCEONLY, settingOnceOnly ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOWERROR, settingShowError ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NEWEST, settingNewest ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_REMEMBEREVENNONCLICKED, settingEvenNonClicked ? BST_CHECKED : BST_UNCHECKED);
- EnableWindow(GetDlgItem(hwndDlg, IDC_REMEMBEREVENNONCLICKED), settingNewest!=0);
- CheckDlgButton(hwndDlg, IDC_NONCLICKEDONLY, settingNonClickedOnly ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_BUTTON_CHECK, settingIniCheck ? BST_CHECKED : BST_UNCHECKED);
-
- EnableWindow(GetDlgItem(hwndDlg, IDC_NONCLICKEDONLY), settingOnceOnly!=0);
-
- CheckDlgButton(hwndDlg, IDC_SETCOLOURS, settingSetColours ? BST_CHECKED : BST_UNCHECKED);
- SendDlgItemMessage(hwndDlg, IDC_BGCOLOR, CPM_SETCOLOUR, 0, (LPARAM)settingBgColor);
- SendDlgItemMessage(hwndDlg, IDC_FGCOLOR, CPM_SETCOLOUR, 0, (LPARAM)settingFgColor);
- EnableWindow(GetDlgItem(hwndDlg, IDC_BGCOLOR), settingSetColours!=0);
- EnableWindow(GetDlgItem(hwndDlg, IDC_FGCOLOR), settingSetColours!=0);
-
- // initialise and fill listbox
- hwndList = GetDlgItem(hwndDlg, IDC_STATUS);
- ListView_DeleteAllItems(hwndList);
-
- SendMessage(hwndList,LVM_SETEXTENDEDLISTVIEWSTYLE, 0,LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES);
-
- // Initialize the LVCOLUMN structure.
- // The mask specifies that the format, width, text, and
- // subitem members of the structure are valid.
- LVCOLUMN lvc={0};
- lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
- lvc.fmt = LVCFMT_LEFT;
-
- lvc.iSubItem = 0;
- lvc.pszText = TranslateT("Status");
- lvc.cx = 120; // width of column in pixels
- ListView_InsertColumn(hwndList, 0, &lvc);
-
- // Some code to create the list-view control.
- // Initialize LVITEM members that are common to all items.
- LVITEM lvI={0};
- lvI.mask = LVIF_TEXT;
- for(int i = 0; i < STATUS_COUNT; i++) {
- lvI.pszText = (TCHAR*)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, ID_STATUS_ONLINE + i, GSMDF_TCHAR);
- lvI.iItem = i;
- ListView_InsertItem(hwndList, &lvI);
- ListView_SetCheckState(hwndList, i, settingStatus[i]);
- }
+ char buff[128];
+ GetDlgItemTextA(hwndDlg, IDC_SERVER, settingServer, SIZEOF(settingServer));
+ db_set_s(NULL, PLUGINNAME, "LNServer", settingServer );
+ db_set_s(NULL, PLUGINNAME, "LNServerSec", settingServerSec);
+ db_set_s(NULL, PLUGINNAME, "LNPassword", settingPassword);
+ db_set_s(NULL, PLUGINNAME, "LNDatabase", settingDatabase);
+ db_set_dw (NULL, PLUGINNAME, "LNInterval", settingInterval);
+ db_set_dw (NULL, PLUGINNAME, "LNInterval1", settingInterval1);
+ db_set_b(NULL, PLUGINNAME, "LNKeepConnection", settingKeepConnection);
+ db_set_s(NULL, PLUGINNAME, "LNCommand", settingCommand );
+ db_set_s(NULL, PLUGINNAME, "LNParameters", settingParameters);
+ db_set_b(NULL, PLUGINNAME, "LNOnceOnly", settingOnceOnly);
+ db_set_b(NULL, PLUGINNAME, "LNNonClickedOnly", settingNonClickedOnly);
+ db_set_b(NULL, PLUGINNAME, "LNShowError", settingShowError);
+ db_set_b(NULL, PLUGINNAME, "LNSetColours", settingSetColours);
+ db_set_dw(NULL, PLUGINNAME, "LNBgColor", (DWORD)settingBgColor);
+ db_set_dw(NULL, PLUGINNAME, "LNFgColor", (DWORD)settingFgColor);
+ db_set_b(NULL, PLUGINNAME, "LNNewest", settingNewest);
+ db_set_b(NULL, PLUGINNAME, "LNEvenNonClicked", settingEvenNonClicked);
+ db_set_b(NULL, PLUGINNAME, "LNIniCheck", settingIniCheck);
+ db_set_b(NULL, PLUGINNAME, "LNIniAnswer", settingIniAnswer);
+
+ for(int i = 0; i < STATUS_COUNT ; i++){
+ mir_snprintf(buff, "LNStatus%d", i);
+ settingStatus[i] = (ListView_GetCheckState(GetDlgItem(hwndDlg, IDC_STATUS), i) ? TRUE : FALSE);
+ db_set_b(0, PLUGINNAME, buff, settingStatus[i] ? 1 : 0);
+ }
- //fill filter combos
- TCHAR buff[512];
- TCHAR* strptr;
+ settingFilterSender[0] = 0;
+ for(int i=0; i<SendDlgItemMessage(hwndDlg, IDC_FILTER_SENDER, CB_GETCOUNT, 0, 0); i++){
+ TCHAR text[512] = TEXT("");
+ SendDlgItemMessage(hwndDlg,IDC_FILTER_SENDER ,CB_GETLBTEXT,(WPARAM)i,(LPARAM)text);
+ _tcscat_s(settingFilterSender, SIZEOF(settingFilterSender), text);
+ _tcscat_s(settingFilterSender, SIZEOF(settingFilterSender), TEXT(";"));
+ }
+ db_set_ts(NULL, PLUGINNAME, "LNFilterSender", settingFilterSender);
+
+ settingFilterSubject[0] = 0;
+ for(int i=0; i<SendDlgItemMessage(hwndDlg, IDC_FILTER_SUBJECT, CB_GETCOUNT, 0, 0); i++){
+ TCHAR text[512] = TEXT("");
+ SendDlgItemMessage(hwndDlg,IDC_FILTER_SUBJECT ,CB_GETLBTEXT,(WPARAM)i,(LPARAM)text);
+ _tcscat_s(settingFilterSubject, SIZEOF(settingFilterSubject), text);
+ _tcscat_s(settingFilterSubject, SIZEOF(settingFilterSubject), TEXT(";"));
+ }
+ db_set_ts(NULL, PLUGINNAME, "LNFilterSubject", settingFilterSubject);
+
+ settingFilterTo[0] = 0;
+ for(int i=0; i<SendDlgItemMessage(hwndDlg, IDC_FILTER_TO, CB_GETCOUNT, 0, 0); i++){
+ TCHAR text[512] = TEXT("");
+ SendDlgItemMessage(hwndDlg,IDC_FILTER_TO ,CB_GETLBTEXT,(WPARAM)i,(LPARAM)text);
+ _tcscat_s(settingFilterTo, SIZEOF(settingFilterTo), text);
+ _tcscat_s(settingFilterTo, SIZEOF(settingFilterTo), TEXT(";"));
+ }
+ db_set_ts(NULL, PLUGINNAME, "LNFilterTo", settingFilterTo);
+}
- _tcsncpy_s(buff, settingFilterSender, _TRUNCATE);
- while(strptr = _tcschr(buff, TEXT(';'))) {
- TCHAR tmp[512] = TEXT("");
- _tcsncpy_s(tmp, buff, (strptr-buff));
- SendDlgItemMessage(hwndDlg, IDC_FILTER_SENDER , CB_ADDSTRING, 0, (LPARAM)tmp);
- _tcsncpy_s(buff, strptr + 1, _TRUNCATE);
- }
+//callback function to speak with user interactions in options page
+INT_PTR CALLBACK DlgProcLotusNotifyConnectionOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ static bool bInit = false;
+
+ int i;
+ char text[MAXENVVALUE];
+ switch(msg)
+ {
+ case WM_INITDIALOG://initialize dialog, so set properties from db.
+ bInit = true;
+ TranslateDialogDefault(hwndDlg);//translate miranda function
+ LoadSettings();
+ CheckDlgButton(hwndDlg, IDC_BUTTON_CHECK, settingIniCheck ? BST_CHECKED : BST_UNCHECKED);
+ SetDlgItemTextA(hwndDlg, IDC_SERVER, settingServer);
+ SetDlgItemTextA(hwndDlg, IDC_SERVERSEC, settingServerSec);
+ SetDlgItemTextA(hwndDlg, IDC_DATABASE, settingDatabase);
+ SetDlgItemTextA(hwndDlg, IDC_PASSWORD, settingPassword);
+ SetDlgItemInt(hwndDlg, IDC_INTERVAL, settingInterval,FALSE);
+ CheckDlgButton(hwndDlg, IDC_KEEP_CONNEXION_ON_ERROR, settingKeepConnection ? BST_CHECKED : BST_UNCHECKED);
+ bInit = false;
+ break;
+
+ case WM_COMMAND://user changed something, so get changes to variables
+ if (!bInit && (HIWORD(wParam) == EN_CHANGE))
+ {
+ PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ }
+ switch(LOWORD(wParam))
+ {
+ case IDC_BUTTON_DETECT:
+ lookupLotusDefaultSettings(hwndDlg);
+ GetDlgItemTextA(hwndDlg, IDC_SERVER, settingServer, SIZEOF(settingServer));
+ GetDlgItemTextA(hwndDlg, IDC_DATABASE, settingDatabase, SIZEOF(settingDatabase));
+ break;
+ case IDC_BUTTON_CHECK:
+ settingIniCheck = (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BUTTON_CHECK);
+ checkNotesIniFile(TRUE);
+ break;
+ case IDC_DATABASE:
+ GetDlgItemTextA(hwndDlg, IDC_DATABASE, settingDatabase, SIZEOF(settingDatabase));
+ break;
+ case IDC_SERVER:
+ switch(HIWORD(wParam))
+ {
+ case CBN_SELCHANGE:
+ i=SendDlgItemMessage(hwndDlg,IDC_SERVER,CB_GETCURSEL,0,0);
+ SendDlgItemMessageA(hwndDlg,IDC_SERVER,CB_GETLBTEXT,(WPARAM)i,(LPARAM)text);
+ SetDlgItemTextA(hwndDlg,IDC_SERVER,text);
+ break;
+
+ case CBN_DROPDOWN:
+ SendDlgItemMessage(hwndDlg, IDC_SERVER, CB_RESETCONTENT ,0, 0);
+ fillServersList(hwndDlg);
+ SendDlgItemMessageA(hwndDlg, IDC_SERVER, CB_ADDSTRING, 0, (LPARAM)settingServer);
+ SendDlgItemMessageA(hwndDlg, IDC_SERVER, CB_SELECTSTRING , -1, (LPARAM)settingServer);
+ break;
+ }
+ break;
+ case IDC_SERVERSEC:
+ GetDlgItemTextA(hwndDlg, IDC_SERVERSEC, settingServerSec, SIZEOF(settingServerSec));
+ break;
+ case IDC_PASSWORD:
+ GetDlgItemTextA(hwndDlg, IDC_PASSWORD, settingPassword, SIZEOF(settingPassword));
+ break;
+ case IDC_INTERVAL:
+ settingInterval = GetDlgItemInt(hwndDlg, IDC_INTERVAL, NULL, FALSE);
+ break;
+ case IDC_KEEP_CONNEXION_ON_ERROR:
+ settingKeepConnection = (BYTE)IsDlgButtonChecked(hwndDlg, IDC_KEEP_CONNEXION_ON_ERROR);
+ break;
+ }
+ break;
+
+ case WM_NOTIFY://apply changes so write it to db
+ switch(((LPNMHDR)lParam)->idFrom)
+ {
+ case 0:
+ switch (((LPNMHDR)lParam)->code)
+ {
+ case PSN_RESET:
+ LoadSettings();
+ return TRUE;
+
+ case PSN_APPLY:
+ SaveSettings(hwndDlg);
+ return TRUE;
+ }
+ break;
+ } //id from
+
+ break; //switch(msg)
- _tcsncpy_s(buff, settingFilterSubject, _TRUNCATE);
- while(strptr = _tcschr(buff, TEXT(';'))) {
- TCHAR tmp[512] = TEXT("");
- _tcsncpy_s(tmp, buff, (strptr-buff));
- SendDlgItemMessage(hwndDlg, IDC_FILTER_SUBJECT , CB_ADDSTRING, 0, (LPARAM)tmp);
- _tcsncpy_s(buff, strptr + 1, _TRUNCATE);
- }
+ }
+ return FALSE;
+}
- _tcsncpy_s(buff, settingFilterTo, _TRUNCATE);
- while(strptr = _tcschr(buff, TEXT(';'))) {
- TCHAR tmp[512] = TEXT("");
- _tcsncpy_s(tmp, buff, (strptr-buff));
- SendDlgItemMessage(hwndDlg, IDC_FILTER_TO , CB_ADDSTRING, 0, (LPARAM)tmp);
- _tcsncpy_s(buff, strptr + 1, _TRUNCATE);
- }
+INT_PTR CALLBACK DlgProcLotusNotifyPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ static bool bInit = false;
+
+ switch(msg)
+ {
+ case WM_INITDIALOG://initialize dialog, so set properties from db.
+ bInit = true;
+ TranslateDialogDefault(hwndDlg);//translate miranda function
+ LoadSettings();
+
+ CheckDlgButton(hwndDlg, IDC_SETCOLOURS, settingSetColours ? BST_CHECKED : BST_UNCHECKED);
+ SendDlgItemMessage(hwndDlg, IDC_BGCOLOR, CPM_SETCOLOUR, 0, (LPARAM)settingBgColor);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BGCOLOR), settingSetColours!=0);
+ SendDlgItemMessage(hwndDlg, IDC_FGCOLOR, CPM_SETCOLOUR, 0, (LPARAM)settingFgColor);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_FGCOLOR), settingSetColours!=0);
+
+ SetDlgItemInt(hwndDlg, IDC_INTERVAL1, settingInterval1,TRUE);
+ CheckDlgButton(hwndDlg, IDC_ONCEONLY, settingOnceOnly ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NONCLICKEDONLY, settingNonClickedOnly ? BST_CHECKED : BST_UNCHECKED);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_NONCLICKEDONLY), settingOnceOnly!=0);
+ CheckDlgButton(hwndDlg, IDC_SHOWERROR, settingShowError ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NEWEST, settingNewest ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_REMEMBEREVENNONCLICKED, settingEvenNonClicked ? BST_CHECKED : BST_UNCHECKED);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_REMEMBEREVENNONCLICKED), settingNewest!=0);
+ SetDlgItemTextA(hwndDlg, IDC_COMMAND, settingCommand);
+ SetDlgItemTextA(hwndDlg, IDC_PARAMETERS, settingParameters);
+
+ bInit = FALSE;
+ break;
+
+ case WM_COMMAND://user changed something, so get changes to variables
+ if (!bInit && (HIWORD(wParam) == EN_CHANGE))
+ {
+ PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ }
+ switch(LOWORD(wParam))
+ {
+ case IDC_SETCOLOURS:
+ settingSetColours=IsDlgButtonChecked(hwndDlg, IDC_SETCOLOURS);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BGCOLOR), settingSetColours );
+ EnableWindow(GetDlgItem(hwndDlg, IDC_FGCOLOR), settingSetColours);
+ break;
+ case IDC_BGCOLOR:
+ settingBgColor = (COLORREF)SendDlgItemMessage(hwndDlg, IDC_BGCOLOR, CPM_GETCOLOUR, 0, 0);
+ break;
+ case IDC_FGCOLOR:
+ settingFgColor = (COLORREF)SendDlgItemMessage(hwndDlg, IDC_FGCOLOR, CPM_GETCOLOUR, 0, 0);
+ break;
+ case IDC_INTERVAL1:
+ settingInterval1 = GetDlgItemInt(hwndDlg, IDC_INTERVAL1, NULL, TRUE);
+ break;
+ case IDC_ONCEONLY:
+ settingOnceOnly=(BYTE) IsDlgButtonChecked(hwndDlg, IDC_ONCEONLY);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_NONCLICKEDONLY), settingOnceOnly);
+ break;
+ case IDC_NONCLICKEDONLY:
+ settingNonClickedOnly = (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NONCLICKEDONLY);
+ break;
+ case IDC_SHOWERROR:
+ settingShowError = (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SHOWERROR);
+ break;
+ case IDC_NEWEST:
+ settingNewest =(BYTE) IsDlgButtonChecked(hwndDlg, IDC_NEWEST);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_REMEMBEREVENNONCLICKED), settingNewest);
+ break;
+ case IDC_REMEMBEREVENNONCLICKED:
+ settingEvenNonClicked = (BYTE)IsDlgButtonChecked(hwndDlg, IDC_REMEMBEREVENNONCLICKED);
+ break;
+ case IDC_COMMAND:
+ GetDlgItemTextA(hwndDlg, IDC_COMMAND, settingCommand, SIZEOF(settingCommand));
+ break;
+ case IDC_PARAMETERS:
+ GetDlgItemTextA(hwndDlg, IDC_PARAMETERS, settingParameters, SIZEOF(settingParameters));
+ break;
+ case IDC_BUTTON_CLEAR:
+ deleteElements();
+ break;
+ }
+ break;
+
+ case WM_NOTIFY://apply changes so write it to db
+ switch(((LPNMHDR)lParam)->idFrom)
+ {
+ case 0:
+ {
+ switch (((LPNMHDR)lParam)->code)
+ {
+ case PSN_RESET:
+ LoadSettings();
+ return TRUE;
+ case PSN_APPLY:
+ SaveSettings(hwndDlg);
+
+ return TRUE;
+ break;
+ }
+ //KillTimer(hTimerWnd,TID);
+ //if(settingInterval!=0)
+ // SetTimer(hTimerWnd, TID, settingInterval*60000, (TIMERPROC)atTime);
+
+ break;
+ } //case 0
+ } //id from
+
+ break; //switch(msg)
- break;
- }
- case WM_COMMAND://user changed something, so get changes to variables
- PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- switch(LOWORD(wParam))
- {
- case IDC_DATABASE: GetDlgItemTextA(hwndDlg, IDC_DATABASE, settingDatabase, SIZEOF(settingDatabase)); break;
- case IDC_SERVER:
- {
- switch(HIWORD(wParam))
- {
- case CBN_SELCHANGE:
- {
- int i;
- char text[MAXENVVALUE];
- i=SendDlgItemMessage(hwndDlg,IDC_SERVER,CB_GETCURSEL,0,0);
- SendDlgItemMessageA(hwndDlg,IDC_SERVER,CB_GETLBTEXT,(WPARAM)i,(LPARAM)text);
- SetDlgItemTextA(hwndDlg,IDC_SERVER,text);
- break;
- }
-
- //case CBN_EDITCHANGE:
-
- case CBN_DROPDOWN:
- {
- SendDlgItemMessage(hwndDlg, IDC_SERVER, CB_RESETCONTENT ,0, 0);
- fillServersList(hwndDlg);
- SendDlgItemMessageA(hwndDlg, IDC_SERVER, CB_ADDSTRING, 0, (LPARAM)settingServer);
- SendDlgItemMessageA(hwndDlg, IDC_SERVER, CB_SELECTSTRING , -1, (LPARAM)settingServer);
- break;
- }
- }
- }
- case IDC_SERVERSEC: GetDlgItemTextA(hwndDlg, IDC_SERVERSEC, settingServerSec, SIZEOF(settingServerSec)); break;
- case IDC_PASSWORD: GetDlgItemTextA(hwndDlg, IDC_PASSWORD, settingPassword, SIZEOF(settingPassword)); break;
-
- case IDC_INTERVAL: settingInterval =GetDlgItemInt(hwndDlg, IDC_INTERVAL, NULL, FALSE); break;
- case IDC_INTERVAL1: settingInterval1 =GetDlgItemInt(hwndDlg, IDC_INTERVAL1, NULL, TRUE); break;
- case IDC_KEEP_CONNEXION_ON_ERROR: settingKeepConnection=(BYTE) IsDlgButtonChecked(hwndDlg, IDC_KEEP_CONNEXION_ON_ERROR); break;
- case IDC_COMMAND: GetDlgItemTextA(hwndDlg, IDC_COMMAND, settingCommand, SIZEOF(settingCommand)); break;
- case IDC_PARAMETERS: GetDlgItemTextA(hwndDlg, IDC_PARAMETERS, settingParameters, SIZEOF(settingParameters)); break;
- case IDC_ONCEONLY:
- {
- settingOnceOnly=(BYTE) IsDlgButtonChecked(hwndDlg, IDC_ONCEONLY);
- EnableWindow(GetDlgItem(hwndDlg, IDC_NONCLICKEDONLY), settingOnceOnly);
- break;
- }
- case IDC_NONCLICKEDONLY: settingNonClickedOnly=(BYTE) IsDlgButtonChecked(hwndDlg, IDC_NONCLICKEDONLY); break;
- case IDC_NEWEST:
- {
- settingNewest =(BYTE) IsDlgButtonChecked(hwndDlg, IDC_NEWEST);
- EnableWindow(GetDlgItem(hwndDlg, IDC_REMEMBEREVENNONCLICKED), settingNewest);
- break;
- }
- case IDC_REMEMBEREVENNONCLICKED: settingEvenNonClicked=(BYTE) IsDlgButtonChecked(hwndDlg, IDC_REMEMBEREVENNONCLICKED); break;
- case IDC_SHOWERROR: settingShowError=(BYTE) IsDlgButtonChecked(hwndDlg, IDC_SHOWERROR); break;
-
- case IDC_SETCOLOURS:
- {
- settingSetColours=IsDlgButtonChecked(hwndDlg, IDC_SETCOLOURS);
- EnableWindow(GetDlgItem(hwndDlg, IDC_BGCOLOR), settingSetColours );
- EnableWindow(GetDlgItem(hwndDlg, IDC_FGCOLOR), settingSetColours);
- break;
- }
- case IDC_BGCOLOR: settingBgColor = (COLORREF)SendDlgItemMessage(hwndDlg, IDC_BGCOLOR, CPM_GETCOLOUR, 0, 0);break;
- case IDC_FGCOLOR: settingFgColor = (COLORREF)SendDlgItemMessage(hwndDlg, IDC_FGCOLOR, CPM_GETCOLOUR, 0, 0);break;
- case IDC_BUTTON_DETECT:
- {
- lookupLotusDefaultSettings(hwndDlg);
- GetDlgItemTextA(hwndDlg, IDC_SERVER, settingServer, SIZEOF(settingServer));
- GetDlgItemTextA(hwndDlg, IDC_DATABASE, settingDatabase, SIZEOF(settingDatabase));
- break;
- }
- case IDC_BUTTON_CLEAR:
- {
- deleteElements();
- break;
- }
- case IDC_BUTTON_CHECK:
- {
- settingIniCheck = (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BUTTON_CHECK);
- checkNotesIniFile(TRUE);
- break;
- }
-
- case IDC_BUTTON_ADD_SENDER_FILTER:
- {
- char tmp[255];
- GetDlgItemTextA(hwndDlg, IDC_FILTER_SENDER, tmp, SIZEOF(tmp));
- SendDlgItemMessageA(hwndDlg, IDC_FILTER_SENDER, CB_ADDSTRING, 0, (LPARAM)tmp);
- break;
- }
- case IDC_BUTTON_REMOVE_SENDER_FILTER:
- {
- SendDlgItemMessage(hwndDlg, IDC_FILTER_SENDER, CB_DELETESTRING, 0, (LPARAM)SendDlgItemMessage(hwndDlg,IDC_FILTER_SENDER ,CB_GETCURSEL,0,0));
- break;
- }
- case IDC_BUTTON_ADD_SUBJECT_FILTER:
- {
- char tmp[255];
- GetDlgItemTextA(hwndDlg, IDC_FILTER_SUBJECT, tmp, SIZEOF(tmp));
- SendDlgItemMessageA(hwndDlg, IDC_FILTER_SUBJECT, CB_ADDSTRING, 0, (LPARAM)tmp);
- break;
- }
- case IDC_BUTTON_REMOVE_SUBJECT_FILTER:
- {
- SendDlgItemMessage(hwndDlg, IDC_FILTER_SUBJECT, CB_DELETESTRING, 0, (LPARAM)SendDlgItemMessage(hwndDlg,IDC_FILTER_SUBJECT ,CB_GETCURSEL,0,0));
- break;
- }
- case IDC_BUTTON_ADD_TO_FILTER:
- {
- char tmp[255];
- GetDlgItemTextA(hwndDlg, IDC_FILTER_TO, tmp, SIZEOF(tmp));
- SendDlgItemMessageA(hwndDlg, IDC_FILTER_TO, CB_ADDSTRING, 0, (LPARAM)tmp);
- break;
- }
- case IDC_BUTTON_REMOVE_TO_FILTER:
- {
- SendDlgItemMessage(hwndDlg, IDC_FILTER_TO, CB_DELETESTRING, 0, (LPARAM)SendDlgItemMessage(hwndDlg,IDC_FILTER_SUBJECT ,CB_GETCURSEL,0,0));
- break;
- }
-
-
- }
- break;
-
- case WM_NOTIFY://apply changes so write it to db
- switch(((LPNMHDR)lParam)->idFrom)
- {
- case 0:
- {
- switch (((LPNMHDR)lParam)->code)
- {
- case PSN_RESET:
- LoadSettings();
- return TRUE;
- case PSN_APPLY:
-
- {
- char buff[128];
- GetDlgItemTextA(hwndDlg, IDC_SERVER, settingServer, SIZEOF(settingServer));
- db_set_s(NULL, PLUGINNAME, "LNServer", settingServer );
- db_set_s(NULL, PLUGINNAME, "LNServerSec", settingServerSec);
- db_set_s(NULL, PLUGINNAME, "LNPassword", settingPassword);
- db_set_s(NULL, PLUGINNAME, "LNDatabase", settingDatabase);
- db_set_dw (NULL, PLUGINNAME, "LNInterval", settingInterval);
- db_set_dw (NULL, PLUGINNAME, "LNInterval1", settingInterval1);
- db_set_b(NULL, PLUGINNAME, "LNKeepConnection", settingKeepConnection);
- db_set_s(NULL, PLUGINNAME, "LNCommand", settingCommand );
- db_set_s(NULL, PLUGINNAME, "LNParameters", settingParameters);
- db_set_b(NULL, PLUGINNAME, "LNOnceOnly", settingOnceOnly);
- db_set_b(NULL, PLUGINNAME, "LNNonClickedOnly", settingNonClickedOnly);
- db_set_b(NULL, PLUGINNAME, "LNShowError", settingShowError);
- db_set_b(NULL, PLUGINNAME, "LNSetColours", settingSetColours);
- db_set_dw(NULL, PLUGINNAME, "LNBgColor", (DWORD)settingBgColor);
- db_set_dw(NULL, PLUGINNAME, "LNFgColor", (DWORD)settingFgColor);
- db_set_b(NULL, PLUGINNAME, "LNNewest", settingNewest);
- db_set_b(NULL, PLUGINNAME, "LNEvenNonClicked", settingEvenNonClicked);
- db_set_b(NULL, PLUGINNAME, "LNIniCheck", settingIniCheck);
- db_set_b(NULL, PLUGINNAME, "LNIniAnswer", settingIniAnswer);
-
- for(int i = 0; i < STATUS_COUNT ; i++){
- mir_snprintf(buff, "LNStatus%d", i);
- settingStatus[i] = (ListView_GetCheckState(GetDlgItem(hwndDlg, IDC_STATUS), i) ? TRUE : FALSE);
- db_set_b(0, PLUGINNAME, buff, settingStatus[i] ? 1 : 0);
- }
-
- settingFilterSender[0] = 0;
- for(int i=0; i<SendDlgItemMessage(hwndDlg, IDC_FILTER_SENDER, CB_GETCOUNT, 0, 0); i++){
- TCHAR text[512] = TEXT("");
- SendDlgItemMessage(hwndDlg,IDC_FILTER_SENDER ,CB_GETLBTEXT,(WPARAM)i,(LPARAM)text);
- _tcscat_s(settingFilterSender, SIZEOF(settingFilterSender), text);
- _tcscat_s(settingFilterSender, SIZEOF(settingFilterSender), TEXT(";"));
- }
- db_set_ts(NULL, PLUGINNAME, "LNFilterSender", settingFilterSender);
-
- settingFilterSubject[0] = 0;
- for(int i=0; i<SendDlgItemMessage(hwndDlg, IDC_FILTER_SUBJECT, CB_GETCOUNT, 0, 0); i++){
- TCHAR text[512] = TEXT("");
- SendDlgItemMessage(hwndDlg,IDC_FILTER_SUBJECT ,CB_GETLBTEXT,(WPARAM)i,(LPARAM)text);
- _tcscat_s(settingFilterSubject, SIZEOF(settingFilterSubject), text);
- _tcscat_s(settingFilterSubject, SIZEOF(settingFilterSubject), TEXT(";"));
- }
- db_set_ts(NULL, PLUGINNAME, "LNFilterSubject", settingFilterSubject);
-
- settingFilterTo[0] = 0;
- for(int i=0; i<SendDlgItemMessage(hwndDlg, IDC_FILTER_TO, CB_GETCOUNT, 0, 0); i++){
- TCHAR text[512] = TEXT("");
- SendDlgItemMessage(hwndDlg,IDC_FILTER_TO ,CB_GETLBTEXT,(WPARAM)i,(LPARAM)text);
- _tcscat_s(settingFilterTo, SIZEOF(settingFilterTo), text);
- _tcscat_s(settingFilterTo, SIZEOF(settingFilterTo), TEXT(";"));
- }
- db_set_ts(NULL, PLUGINNAME, "LNFilterTo", settingFilterTo);
-
- }
-
-
- return TRUE;
- break;
- }
- //KillTimer(hTimerWnd,TID);
- //if(settingInterval!=0)
- // SetTimer(hTimerWnd, TID, settingInterval*60000, (TIMERPROC)atTime);
-
- break;
- } //case 0
- } //id from
-
- if (GetDlgItem(hwndDlg, IDC_STATUS) == ((LPNMHDR) lParam)->hwndFrom){
- switch (((LPNMHDR) lParam)->code)
- {
- case LVN_ITEMCHANGED:
- {
- NMLISTVIEW *nmlv = (NMLISTVIEW *)lParam;
- if((nmlv->uNewState ^ nmlv->uOldState) & LVIS_STATEIMAGEMASK){
- SendMessage( GetParent(hwndDlg), PSM_CHANGED, 0, 0 );
- }
- break;
-
- }
- break;
- }
- }
- break; //switch(msg)
+ }
+ return FALSE;
+}
+INT_PTR CALLBACK DlgProcLotusNotifyMiscOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ static bool bInit = false;
+
+ HWND hwndList;
+ TCHAR buff[512];
+ char tmp[255];
+ TCHAR* strptr;
+ LVITEM lvI={0};
+ LVCOLUMN lvc={0};
+ switch(msg)
+ {
+ case WM_INITDIALOG://initialize dialog, so set properties from db.
+ bInit = true;
+ TranslateDialogDefault(hwndDlg);//translate miranda function
+ LoadSettings();
+
+ //fill filter combos
+
+ _tcsncpy_s(buff, settingFilterSender, _TRUNCATE);
+ while(strptr = _tcschr(buff, TEXT(';'))) {
+ TCHAR tmp[512] = TEXT("");
+ _tcsncpy_s(tmp, buff, (strptr-buff));
+ SendDlgItemMessage(hwndDlg, IDC_FILTER_SENDER , CB_ADDSTRING, 0, (LPARAM)tmp);
+ _tcsncpy_s(buff, strptr + 1, _TRUNCATE);
+ }
+
+ _tcsncpy_s(buff, settingFilterSubject, _TRUNCATE);
+ while(strptr = _tcschr(buff, TEXT(';'))) {
+ TCHAR tmp[512] = TEXT("");
+ _tcsncpy_s(tmp, buff, (strptr-buff));
+ SendDlgItemMessage(hwndDlg, IDC_FILTER_SUBJECT , CB_ADDSTRING, 0, (LPARAM)tmp);
+ _tcsncpy_s(buff, strptr + 1, _TRUNCATE);
+ }
+
+ _tcsncpy_s(buff, settingFilterTo, _TRUNCATE);
+ while(strptr = _tcschr(buff, TEXT(';'))) {
+ TCHAR tmp[512] = TEXT("");
+ _tcsncpy_s(tmp, buff, (strptr-buff));
+ SendDlgItemMessage(hwndDlg, IDC_FILTER_TO , CB_ADDSTRING, 0, (LPARAM)tmp);
+ _tcsncpy_s(buff, strptr + 1, _TRUNCATE);
+ }
+
+ // initialise and fill listbox
+ hwndList = GetDlgItem(hwndDlg, IDC_STATUS);
+ ListView_DeleteAllItems(hwndList);
+
+ SendMessage(hwndList,LVM_SETEXTENDEDLISTVIEWSTYLE, 0,LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES);
+
+ // Initialize the LVCOLUMN structure.
+ // The mask specifies that the format, width, text, and
+ // subitem members of the structure are valid.
+ lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
+ lvc.fmt = LVCFMT_LEFT;
+
+ lvc.iSubItem = 0;
+ lvc.pszText = TranslateT("Status");
+ lvc.cx = 120; // width of column in pixels
+ ListView_InsertColumn(hwndList, 0, &lvc);
+
+ // Some code to create the list-view control.
+ // Initialize LVITEM members that are common to all items.
+ lvI.mask = LVIF_TEXT;
+ for(int i = 0; i < STATUS_COUNT; i++) {
+ lvI.pszText = (TCHAR*)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, ID_STATUS_ONLINE + i, GSMDF_TCHAR);
+ lvI.iItem = i;
+ ListView_InsertItem(hwndList, &lvI);
+ ListView_SetCheckState(hwndList, i, settingStatus[i]);
+ }
+
+ bInit = false;
+ break;
+
+ case WM_COMMAND://user changed something, so get changes to variables
+ if (!bInit && (HIWORD(wParam) == EN_CHANGE))
+ {
+ PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ }
+ switch(LOWORD(wParam))
+ {
+ case IDC_BUTTON_ADD_SENDER_FILTER:
+ GetDlgItemTextA(hwndDlg, IDC_FILTER_SENDER, tmp, SIZEOF(tmp));
+ SendDlgItemMessageA(hwndDlg, IDC_FILTER_SENDER, CB_ADDSTRING, 0, (LPARAM)tmp);
+ break;
+ case IDC_BUTTON_REMOVE_SENDER_FILTER:
+ SendDlgItemMessage(hwndDlg, IDC_FILTER_SENDER, CB_DELETESTRING, 0, (LPARAM)SendDlgItemMessage(hwndDlg,IDC_FILTER_SENDER ,CB_GETCURSEL,0,0));
+ break;
+ case IDC_BUTTON_ADD_SUBJECT_FILTER:
+ GetDlgItemTextA(hwndDlg, IDC_FILTER_SUBJECT, tmp, SIZEOF(tmp));
+ SendDlgItemMessageA(hwndDlg, IDC_FILTER_SUBJECT, CB_ADDSTRING, 0, (LPARAM)tmp);
+ break;
+ case IDC_BUTTON_REMOVE_SUBJECT_FILTER:
+ SendDlgItemMessage(hwndDlg, IDC_FILTER_SUBJECT, CB_DELETESTRING, 0, (LPARAM)SendDlgItemMessage(hwndDlg,IDC_FILTER_SUBJECT ,CB_GETCURSEL,0,0));
+ break;
+ case IDC_BUTTON_ADD_TO_FILTER:
+ GetDlgItemTextA(hwndDlg, IDC_FILTER_TO, tmp, SIZEOF(tmp));
+ SendDlgItemMessageA(hwndDlg, IDC_FILTER_TO, CB_ADDSTRING, 0, (LPARAM)tmp);
+ break;
+ case IDC_BUTTON_REMOVE_TO_FILTER:
+ SendDlgItemMessage(hwndDlg, IDC_FILTER_TO, CB_DELETESTRING, 0, (LPARAM)SendDlgItemMessage(hwndDlg,IDC_FILTER_SUBJECT ,CB_GETCURSEL,0,0));
+ break;
+ }
+ break;
+
+ case WM_NOTIFY://apply changes so write it to db
+ if (bInit)
+ {
+ break;
+ }
+ switch(((LPNMHDR)lParam)->idFrom)
+ {
+ case 0:
+ switch (((LPNMHDR)lParam)->code)
+ {
+ case PSN_RESET:
+ LoadSettings();
+ return TRUE;
+
+ case PSN_APPLY:
+ SaveSettings(hwndDlg);
+ return TRUE;
+ }
+
+ break;
+ } //id from
+
+ if (GetDlgItem(hwndDlg, IDC_STATUS) == ((LPNMHDR) lParam)->hwndFrom){
+ switch (((LPNMHDR) lParam)->code)
+ {
+ case LVN_ITEMCHANGED:
+ {
+ NMLISTVIEW *nmlv = (NMLISTVIEW *)lParam;
+ if((nmlv->uNewState ^ nmlv->uOldState) & LVIS_STATEIMAGEMASK){
+ SendMessage( GetParent(hwndDlg), PSM_CHANGED, 0, 0 );
+ }
+ break;
+
+ }
+ break;
+ }
+ }
+ break; //switch(msg)
- }
- return FALSE;
+ }
+ return FALSE;
}
@@ -1365,18 +1452,30 @@ int LotusNotifyOptInit(WPARAM wParam,LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_DIALOG);
- odp.ptszTitle = _A2T(PLUGINNAME);
odp.ptszGroup = LPGENT("Plugins");
+ odp.ptszTitle = LPGENT(__PLUGIN_NAME);
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
- odp.pfnDlgProc = DlgProcLotusNotifyOpts; //callback function name
- Options_AddPage(wParam, &odp); //add page to options menu pages
+
+ odp.ptszTab = LPGENT("Connection");
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_LOTUS_CONECTION);
+ odp.pfnDlgProc = DlgProcLotusNotifyConnectionOpts;
+ Options_AddPage(wParam, &odp);
+
+ odp.ptszTab = LPGENT("Popup");
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_LOTUS_POPUP);
+ odp.pfnDlgProc = DlgProcLotusNotifyPopupOpts;
+ Options_AddPage(wParam, &odp);
+
+ odp.ptszTab = LPGENT("Miscelaneous");
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_LOTUS_MISC);
+ odp.pfnDlgProc = DlgProcLotusNotifyMiscOpts;
+ Options_AddPage(wParam, &odp);
return 0;
}
//gives protocol avainable statuses
-INT_PTR GetCaps(WPARAM wParam, LPARAM lParam)
+INT_PTR GetCaps(WPARAM wParam, LPARAM)
{
if(wParam == PFLAGNUM_1)
return 0;
@@ -1442,7 +1541,6 @@ INT_PTR SetStatus(WPARAM wParam, LPARAM lParam)
}
}
} else {
-
int retv = 0;
if(settingStatus[wParam - ID_STATUS_ONLINE])
retv = SetStatus(ID_STATUS_OFFLINE, lParam);
@@ -1452,7 +1550,6 @@ INT_PTR SetStatus(WPARAM wParam, LPARAM lParam)
diffstat = wParam;
return retv;
// the status has been changed to unknown (maybe run some more code)
-
}
//broadcast the message
if(currentStatus != wParam)
@@ -1465,7 +1562,6 @@ INT_PTR SetStatus(WPARAM wParam, LPARAM lParam)
void checkEnvPath(TCHAR *path)
{
-
TCHAR *cur;
TCHAR nowy[2048]={0};
TCHAR *found;
@@ -1491,18 +1587,12 @@ void checkEnvPath(TCHAR *path)
_tcscat_s(nowy, _T(";"));
_tputenv(nowy);
-
}
-
//GetStatus
INT_PTR GetStatus(WPARAM, LPARAM)
{
return currentStatus;
- if (diffstat)
- return diffstat;
- else
- return currentStatus ;
}
@@ -1543,7 +1633,6 @@ static int modulesloaded(WPARAM, LPARAM)
LNEnableMenuItem(hMenuHandle, !running);//disable menu cause lotus is not initialized
} else {
-
log(L"Checking Notes Ini File");
if (!checkNotesIniFile(FALSE)) {
startuperror += 16;
@@ -1695,7 +1784,6 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_LOTUSNO
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
{
-
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
diff --git a/plugins/LotusNotify/src/debug.cpp b/plugins/LotusNotify/src/debug.cpp
index 754705a827..37f5f26948 100644
--- a/plugins/LotusNotify/src/debug.cpp
+++ b/plugins/LotusNotify/src/debug.cpp
@@ -3,9 +3,7 @@
HANDLE netlibHandle;
-
void logRegister(){
-
// Register netlib user for logging function
NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
@@ -13,14 +11,11 @@ void logRegister(){
nlu.szSettingsModule = PLUGINNAME;
nlu.ptszDescriptiveName = mir_a2u(PLUGINNAME);
netlibHandle = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
-
}
void logUnregister(){
-
Netlib_CloseHandle(netlibHandle);
netlibHandle = NULL;
-
}
void log(const wchar_t* szText){
@@ -32,11 +27,9 @@ void log(const wchar_t* szText){
#ifdef _DEBUG
OutputDebugString(szText);
#endif //_DEBUG
-
}
void log_p(const wchar_t* szText, ...){
-
va_list args;
va_start(args, szText);
int len = _vscwprintf(szText, args ) + 1; // _vscprintf doesn't count terminating '\0' //!!!!!!!!!!!!!!!!
@@ -44,14 +37,6 @@ void log_p(const wchar_t* szText, ...){
mir_vsntprintf(buffer, len, szText, args);
va_end(args);
log(buffer);
- delete buffer;
-
+ delete[] buffer;
}
-
-
-
-
-
-
-
diff --git a/plugins/LotusNotify/src/resource.h b/plugins/LotusNotify/src/resource.h
index b2aed137d1..320d18cc62 100644
--- a/plugins/LotusNotify/src/resource.h
+++ b/plugins/LotusNotify/src/resource.h
@@ -3,8 +3,10 @@
// Used by LotusNotify.rc
//
#define IDI_ICON1 101
-#define IDD_OPT_DIALOG 102
+#define IDD_OPT_LOTUS_MISC 102
#define IDI_ICON2 103
+#define IDD_OPT_LOTUS_CONECTION 104
+#define IDD_OPT_LOTUS_POPUP 105
#define IDC_SERVER 1001
#define IDC_DATABASE 1002
#define IDC_DATABASE2 1003
@@ -23,9 +25,6 @@
#define IDC_NEWEST 1014
#define IDC_BUTTON_DETECT 1015
#define IDC_STATUS 1016
-#define IDC_VERSION 1017
-#define IDC_VERSION2 1018
-#define IDC_BUTTON_DETECT2 1019
#define IDC_BUTTON_CLEAR 1019
#define IDC_FILTER_SENDER 1020
#define IDC_FILTER_SUBJECT 1021
@@ -45,7 +44,7 @@
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 104
+#define _APS_NEXT_RESOURCE_VALUE 106
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1033
#define _APS_NEXT_SYMED_VALUE 101
diff --git a/plugins/LotusNotify/src/version.h b/plugins/LotusNotify/src/version.h
index 3e408e182f..e44b5408a1 100644
--- a/plugins/LotusNotify/src/version.h
+++ b/plugins/LotusNotify/src/version.h
@@ -1,6 +1,6 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 1
-#define __RELEASE_NUM 22
+#define __RELEASE_NUM 23
#define __BUILD_NUM 0
#include <stdver.h>