diff options
author | George Hazan <george.hazan@gmail.com> | 2013-12-08 22:54:21 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-12-08 22:54:21 +0000 |
commit | 3c001302667561bb3c3458ed0a78699e5e93be82 (patch) | |
tree | bd15d845c29ca1b391ae40154e66844b088ba088 /plugins | |
parent | 04186af283b3bfa0278e9ad8b223a5c70f3d8158 (diff) |
mmap options dialog
git-svn-id: http://svn.miranda-ng.org/main/trunk@7100 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Db3x_mmap/db3x_mmap_10.vcxproj | 4 | ||||
-rw-r--r-- | plugins/Db3x_mmap/db3x_mmap_10.vcxproj.filters | 8 | ||||
-rw-r--r-- | plugins/Db3x_mmap/res/db3x_mmap.rc | 24 | ||||
-rw-r--r-- | plugins/Db3x_mmap/src/commonheaders.h | 1 | ||||
-rw-r--r-- | plugins/Db3x_mmap/src/resource.h | 10 | ||||
-rw-r--r-- | plugins/Db3x_mmap/src/ui.cpp | 47 |
6 files changed, 86 insertions, 8 deletions
diff --git a/plugins/Db3x_mmap/db3x_mmap_10.vcxproj b/plugins/Db3x_mmap/db3x_mmap_10.vcxproj index bbe32cb4b8..a3515c6de8 100644 --- a/plugins/Db3x_mmap/db3x_mmap_10.vcxproj +++ b/plugins/Db3x_mmap/db3x_mmap_10.vcxproj @@ -245,6 +245,10 @@ <ResourceCompile Include="res\db3x_mmap.rc" />
<ResourceCompile Include="res\version.rc" />
</ItemGroup>
+ <ItemGroup>
+ <None Include="res\logo.ico" />
+ <None Include="res\pass.ico" />
+ </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
diff --git a/plugins/Db3x_mmap/db3x_mmap_10.vcxproj.filters b/plugins/Db3x_mmap/db3x_mmap_10.vcxproj.filters index dde8eca53c..a8cd5dfc1e 100644 --- a/plugins/Db3x_mmap/db3x_mmap_10.vcxproj.filters +++ b/plugins/Db3x_mmap/db3x_mmap_10.vcxproj.filters @@ -110,4 +110,12 @@ <Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
+ <ItemGroup>
+ <None Include="res\pass.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\logo.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ </ItemGroup>
</Project>
\ No newline at end of file diff --git a/plugins/Db3x_mmap/res/db3x_mmap.rc b/plugins/Db3x_mmap/res/db3x_mmap.rc index 8829d34dbc..6854ce97d6 100644 --- a/plugins/Db3x_mmap/res/db3x_mmap.rc +++ b/plugins/Db3x_mmap/res/db3x_mmap.rc @@ -61,16 +61,28 @@ BEGIN CONTROL "Change password",IDC_HEADERBAR,"MHeaderbarCtrl",0x0,0,0,190,26
CTEXT "EN",IDC_LANG,158,42,13,13,SS_CENTERIMAGE | NOT WS_GROUP
EDITTEXT IDC_OLDPASS,21,42,128,14,ES_PASSWORD | ES_AUTOHSCROLL
- EDITTEXT IDC_USERPASS1, 21, 77, 128, 14, ES_PASSWORD | ES_AUTOHSCROLL
- EDITTEXT IDC_USERPASS2, 21, 98, 128, 14, ES_PASSWORD | ES_AUTOHSCROLL
+ EDITTEXT IDC_USERPASS1,21,77,128,14,ES_PASSWORD | ES_AUTOHSCROLL
+ EDITTEXT IDC_USERPASS2,21,98,128,14,ES_PASSWORD | ES_AUTOHSCROLL
DEFPUSHBUTTON "Change",IDOK,11,127,50,14
PUSHBUTTON "Remove",IDREMOVE,69,127,50,14
PUSHBUTTON "Cancel",IDCANCEL,126,127,50,14
- LTEXT "New password", IDC_STATIC, 11, 66, 163, 10, 0, WS_EX_TRANSPARENT
+ LTEXT "New password",IDC_STATIC,11,66,163,10,0,WS_EX_TRANSPARENT
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDFRAME,0,119,190,1
- LTEXT "Old password", IDC_STATIC, 11, 31, 140, 10, 0, WS_EX_TRANSPARENT
+ LTEXT "Old password",IDC_STATIC,11,31,140,10,0,WS_EX_TRANSPARENT
END
+IDD_OPTIONS DIALOGEX 0, 0, 318, 188
+STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_CHILD
+FONT 8, "MS Shell Dlg", 0, 0, 0x0
+BEGIN
+ GROUPBOX "Database encryption mode",IDC_STATIC,6,22,305,160
+ CONTROL "Standard",IDC_STANDARD,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,12,54,292,12
+ CONTROL "Total",IDC_TOTAL,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,12,111,292,12
+ LTEXT "Only critical data are encrypted (passwords, security tokens etc). All another settings and history remains unencrypted. Fast and effective, suitable for the most cases",IDC_STATIC,22,70,284,37
+ LTEXT "All string settings and all events in histories are encrypted. It also makes Miranda much slower and creates a risk of loosing everything you've stored in a profile in case of loosing password. Recommended only for paranoidal users",IDC_STATIC,22,126,284,37
+END
+
+
/////////////////////////////////////////////////////////////////////////////
//
// Icon
@@ -96,6 +108,10 @@ BEGIN IDD_CHANGEPASS, DIALOG
BEGIN
END
+
+ IDD_OPTIONS, DIALOG
+ BEGIN
+ END
END
#endif // APSTUDIO_INVOKED
diff --git a/plugins/Db3x_mmap/src/commonheaders.h b/plugins/Db3x_mmap/src/commonheaders.h index 9cbdf6dc0e..471aa33453 100644 --- a/plugins/Db3x_mmap/src/commonheaders.h +++ b/plugins/Db3x_mmap/src/commonheaders.h @@ -36,6 +36,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_langpack.h>
#include <m_clist.h>
#include <m_icolib.h>
+#include <m_options.h>
#include <m_crypto.h>
#include "database.h"
diff --git a/plugins/Db3x_mmap/src/resource.h b/plugins/Db3x_mmap/src/resource.h index 071a0af2e6..be74c3e5e8 100644 --- a/plugins/Db3x_mmap/src/resource.h +++ b/plugins/Db3x_mmap/src/resource.h @@ -10,21 +10,23 @@ #define IDD_LOGIN 102
#define IDD_NEWPASS 103
#define IDD_CHANGEPASS 104
-
+#define IDD_OPTIONS 105
#define IDC_HEADERBAR 1001
#define IDC_LANG 1002
#define IDC_USERPASS 1003
#define IDC_USERPASS1 1004
#define IDC_USERPASS2 1005
#define IDC_OLDPASS 1006
+#define IDC_STANDARD 1007
+#define IDC_TOTAL 1008
// Next default values for new objects
-//
+//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 103
+#define _APS_NEXT_RESOURCE_VALUE 106
#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1001
+#define _APS_NEXT_CONTROL_VALUE 1009
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
diff --git a/plugins/Db3x_mmap/src/ui.cpp b/plugins/Db3x_mmap/src/ui.cpp index 8e98974c09..3e50702048 100644 --- a/plugins/Db3x_mmap/src/ui.cpp +++ b/plugins/Db3x_mmap/src/ui.cpp @@ -244,6 +244,51 @@ static INT_PTR ChangePassword(void* obj, LPARAM, LPARAM) /////////////////////////////////////////////////////////////////////////////////////////
+INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ CDb3Mmap *db = (CDb3Mmap *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+
+ switch (msg) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hwndDlg);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
+
+ db = (CDb3Mmap*)lParam;
+ CheckRadioButton(hwndDlg, IDC_STANDARD, IDC_TOTAL, IDC_STANDARD + db->isEncrypted());
+ return TRUE;
+
+ case WM_COMMAND:
+ if (HIWORD(wParam) == BN_CLICKED && (HWND)lParam == GetFocus())
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+
+ case WM_NOTIFY:
+ if (((LPNMHDR)lParam)->code == PSN_APPLY) {
+ if (IsDlgButtonChecked(hwndDlg, IDC_TOTAL) == (BOOL)db->isEncrypted())
+ break;
+ }
+ break;
+ }
+
+ return FALSE;
+}
+
+static int OnOptionsInit(PVOID obj, WPARAM wParam, LPARAM)
+{
+ OPTIONSDIALOGPAGE odp = { sizeof(odp) };
+ odp.position = -790000000;
+ odp.hInstance = g_hInst;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
+ odp.flags = ODPF_BOLDGROUPS;
+ odp.pszTitle = LPGEN("Database");
+ odp.pfnDlgProc = DlgProcOptions;
+ odp.dwInitParam = (LPARAM)obj;
+ Options_AddPage(wParam, &odp);
+ return 0;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
void CDb3Mmap::UpdateMenuItem()
{
CLISTMENUITEM mi = { sizeof(mi) };
@@ -259,6 +304,8 @@ static int OnModulesLoaded(PVOID obj, WPARAM, LPARAM) Icon_Register(g_hInst, LPGEN("Database"), iconList, SIZEOF(iconList), "mmap");
+ HookEventObj(ME_OPT_INITIALISE, OnOptionsInit, db);
+
// main menu item
CLISTMENUITEM mi = { sizeof(mi) };
mi.pszName = LPGEN("Database");
|