summaryrefslogtreecommitdiff
path: root/plugins/Db3x_mmap/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Db3x_mmap/src')
-rw-r--r--plugins/Db3x_mmap/src/dbcrypt.cpp8
-rw-r--r--plugins/Db3x_mmap/src/resource.h12
-rw-r--r--plugins/Db3x_mmap/src/stdafx.h4
-rw-r--r--plugins/Db3x_mmap/src/ui.h37
4 files changed, 54 insertions, 7 deletions
diff --git a/plugins/Db3x_mmap/src/dbcrypt.cpp b/plugins/Db3x_mmap/src/dbcrypt.cpp
index 7a1dbe996a..b2f72c50d6 100644
--- a/plugins/Db3x_mmap/src/dbcrypt.cpp
+++ b/plugins/Db3x_mmap/src/dbcrypt.cpp
@@ -144,7 +144,13 @@ int CDb3Mmap::InitCrypt()
if (iNumProvs == 0)
return 1;
- pProvider = ppProvs[0]; //!!!!!!!!!!!!!!!!!!
+ if (iNumProvs > 1)
+ {
+ CSelectCryptoDialog dlg(ppProvs, iNumProvs);
+ dlg.DoModal();
+ pProvider = dlg.GetSelected();
+ }
+ else pProvider = ppProvs[0];
DBCONTACTWRITESETTING dbcws = { "CryptoEngine", "Provider" };
dbcws.value.type = DBVT_BLOB;
diff --git a/plugins/Db3x_mmap/src/resource.h b/plugins/Db3x_mmap/src/resource.h
index be74c3e5e8..db0d501fcb 100644
--- a/plugins/Db3x_mmap/src/resource.h
+++ b/plugins/Db3x_mmap/src/resource.h
@@ -1,16 +1,15 @@
//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by D:\Myranda\plugins\Db3x_mmap\res\db3x_mmap.rc
+// Включаемый файл, созданный в Microsoft Visual C++.
+// Используется d:\Others\SVN\MirandaNG\trunk\plugins\Db3x_mmap\res\db3x_mmap.rc
//
-
#define IDREMOVE 3
-
#define IDI_ICONPASS 100
#define IDI_LOGO 101
#define IDD_LOGIN 102
#define IDD_NEWPASS 103
#define IDD_CHANGEPASS 104
#define IDD_OPTIONS 105
+#define IDD_SELECT_CRYPTOPROVIDER 106
#define IDC_HEADERBAR 1001
#define IDC_LANG 1002
#define IDC_USERPASS 1003
@@ -19,14 +18,15 @@
#define IDC_OLDPASS 1006
#define IDC_STANDARD 1007
#define IDC_TOTAL 1008
+#define IDC_SELECTCRYPT_COMBO 1010
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 106
+#define _APS_NEXT_RESOURCE_VALUE 107
#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1009
+#define _APS_NEXT_CONTROL_VALUE 1011
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
diff --git a/plugins/Db3x_mmap/src/stdafx.h b/plugins/Db3x_mmap/src/stdafx.h
index c316044348..e2784ab0c1 100644
--- a/plugins/Db3x_mmap/src/stdafx.h
+++ b/plugins/Db3x_mmap/src/stdafx.h
@@ -39,16 +39,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_crypto.h>
#include <m_metacontacts.h>
#include <m_protocols.h>
+#include <m_gui.h>
#include "database.h"
#include "dbintf.h"
#include "resource.h"
#include "version.h"
+
extern HINSTANCE g_hInst;
extern LIST<CDb3Mmap> g_Dbs;
extern DBSignature dbSignatureU, dbSignatureE, dbSignatureIM, dbSignatureSA, dbSignatureSD;
+#include "ui.h"
+
#ifdef __GNUC__
#define mir_i64(x) (x##LL)
#else
diff --git a/plugins/Db3x_mmap/src/ui.h b/plugins/Db3x_mmap/src/ui.h
new file mode 100644
index 0000000000..b818b64adf
--- /dev/null
+++ b/plugins/Db3x_mmap/src/ui.h
@@ -0,0 +1,37 @@
+
+
+class CSelectCryptoDialog : public CDlgBase
+{
+ CCtrlCombo m_combo;
+ CRYPTO_PROVIDER **m_provs;
+ size_t m_provscount;
+ CRYPTO_PROVIDER *m_selected;
+public:
+ CSelectCryptoDialog(CRYPTO_PROVIDER **provs, size_t count) :
+ CDlgBase(g_hInst, IDD_SELECT_CRYPTOPROVIDER),
+ m_combo(this, IDC_SELECTCRYPT_COMBO),
+ m_provs(provs),
+ m_provscount(count),
+ m_selected(nullptr)
+ {
+ }
+ void OnInitDialog()
+ {
+ for (size_t i = 0; i < m_provscount; i++)
+ {
+ CRYPTO_PROVIDER *prov = m_provs[i];
+ m_combo.AddStringA(prov->pszName, i);
+ }
+ m_combo.SetCurSel(0);
+ }
+ void OnClose()
+ {
+ m_selected = m_provs[ m_combo.GetItemData(m_combo.GetCurSel()) ];
+ }
+
+ inline CRYPTO_PROVIDER* GetSelected()
+ {
+ return m_selected;
+ }
+
+}; \ No newline at end of file