diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2016-02-27 16:42:21 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2016-02-27 16:42:21 +0000 |
commit | 2297d8f2a8749ea9ffebbd13cdd9e903932fa3c8 (patch) | |
tree | bfd22140e28738aadc909b545046101b219746ed /plugins/Dbx_mdb/src | |
parent | 60f69a369747444ced2209bcf19ab0a379acc681 (diff) |
git-svn-id: http://svn.miranda-ng.org/main/trunk@16366 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dbx_mdb/src')
-rw-r--r-- | plugins/Dbx_mdb/src/dbcrypt.cpp | 11 | ||||
-rw-r--r-- | plugins/Dbx_mdb/src/resource.h | 11 | ||||
-rw-r--r-- | plugins/Dbx_mdb/src/ui.h | 8 |
3 files changed, 24 insertions, 6 deletions
diff --git a/plugins/Dbx_mdb/src/dbcrypt.cpp b/plugins/Dbx_mdb/src/dbcrypt.cpp index 31d7f69dda..e55d7f38aa 100644 --- a/plugins/Dbx_mdb/src/dbcrypt.cpp +++ b/plugins/Dbx_mdb/src/dbcrypt.cpp @@ -34,22 +34,31 @@ CRYPTO_PROVIDER* CDbxMdb::SelectProvider() CRYPTO_PROVIDER **ppProvs, *pProv;
int iNumProvs;
Crypto_EnumProviders(&iNumProvs, &ppProvs);
+
if (iNumProvs == 0)
return nullptr;
+ bool bTotalCrypt = false;
+
if (iNumProvs > 1)
{
CSelectCryptoDialog dlg(ppProvs, iNumProvs);
dlg.DoModal();
pProv = dlg.GetSelected();
+ bTotalCrypt = dlg.TotalSelected();
}
else pProv = ppProvs[0];
for (;; Remap())
{
txn_ptr txn(m_pMdbEnv);
+
MDB_val key = { sizeof(DBKEY_PROVIDER), DBKEY_PROVIDER }, value = { mir_strlen(pProv->pszName) + 1, pProv->pszName };
- mdb_put(txn, m_dbCrypto, &key, &value, 0);
+ MDB_CHECK(mdb_put(txn, m_dbCrypto, &key, &value, 0), nullptr);
+
+ key.mv_size = sizeof(DBKEY_IS_ENCRYPTED); key.mv_data = DBKEY_IS_ENCRYPTED; value.mv_size = sizeof(bool); value.mv_data = &bTotalCrypt;
+ MDB_CHECK(mdb_put(txn, m_dbCrypto, &key, &value, 0), nullptr);
+
if (txn.commit())
break;
}
diff --git a/plugins/Dbx_mdb/src/resource.h b/plugins/Dbx_mdb/src/resource.h index cd5530394c..2b197f31ef 100644 --- a/plugins/Dbx_mdb/src/resource.h +++ b/plugins/Dbx_mdb/src/resource.h @@ -1,10 +1,8 @@ //{{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\Dbx_mdb\res\dbx_mdb.rc
//
-
#define IDREMOVE 3
-
#define IDI_ICONPASS 100
#define IDI_LOGO 101
#define IDD_LOGIN 102
@@ -22,13 +20,16 @@ #define IDC_TOTAL 1008
#define IDC_SELECTCRYPT_COMBO 1010
#define IDC_CRYPTOPROVIDER_DESCR 1011
+#define IDC_CHECK1 1012
+#define IDC_CHECK_TOTALCRYPT 1012
+
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 107
#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1012
+#define _APS_NEXT_CONTROL_VALUE 1013
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
diff --git a/plugins/Dbx_mdb/src/ui.h b/plugins/Dbx_mdb/src/ui.h index c29659b3d2..4ee297e81f 100644 --- a/plugins/Dbx_mdb/src/ui.h +++ b/plugins/Dbx_mdb/src/ui.h @@ -48,9 +48,11 @@ class CSelectCryptoDialog : public CDlgBase {
CCtrlCombo m_combo;
CCtrlData m_descr;
+ CCtrlCheck m_chkTotalCrypt;
CRYPTO_PROVIDER **m_provs;
size_t m_provscount;
CRYPTO_PROVIDER *m_selected;
+ bool m_bTotalEncryption;
void OnInitDialog()
{
@@ -66,6 +68,7 @@ class CSelectCryptoDialog : public CDlgBase void OnClose()
{
m_selected = m_provs[ m_combo.GetItemData(m_combo.GetCurSel()) ];
+ m_bTotalEncryption = m_chkTotalCrypt.GetState() != 0;
}
void OnComboChanged(CCtrlCombo*)
@@ -78,6 +81,7 @@ public: CDlgBase(g_hInst, IDD_SELECT_CRYPTOPROVIDER),
m_combo(this, IDC_SELECTCRYPT_COMBO),
m_descr(this, IDC_CRYPTOPROVIDER_DESCR),
+ m_chkTotalCrypt(this, IDC_CHECK_TOTALCRYPT),
m_provs(provs),
m_provscount(count),
m_selected(nullptr)
@@ -89,6 +93,10 @@ public: {
return m_selected;
}
+ inline bool TotalSelected()
+ {
+ return m_bTotalEncryption;
+ }
};
struct DlgChangePassParam
|