diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2016-02-19 15:20:53 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2016-02-19 15:20:53 +0000 |
commit | cf751286442fa9b4b4843ae1091625e6a6c7ba2d (patch) | |
tree | c5c76f649b8065018d4d1189c84a70b7ef090bc3 /plugins/Dbx_mdb/src/ui.h | |
parent | a98fbb55e2701f6ba4348e90bdb110df667bc4a5 (diff) |
dbx_lmdb: fixed writing settings; CryptoProvider selector; correct transactions revert
git-svn-id: http://svn.miranda-ng.org/main/trunk@16310 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dbx_mdb/src/ui.h')
-rw-r--r-- | plugins/Dbx_mdb/src/ui.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/plugins/Dbx_mdb/src/ui.h b/plugins/Dbx_mdb/src/ui.h new file mode 100644 index 0000000000..d723e684c0 --- /dev/null +++ b/plugins/Dbx_mdb/src/ui.h @@ -0,0 +1,53 @@ +
+
+class CSelectCryptoDialog : public CDlgBase
+{
+ CCtrlCombo m_combo;
+ CCtrlData m_descr;
+ //CCtrlCustom m_descr;
+ 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_descr(this, IDC_CRYPTOPROVIDER_DESCR),
+ m_provs(provs),
+ m_provscount(count),
+ m_selected(nullptr)
+ {
+ m_combo.OnChange = Callback(this, &CSelectCryptoDialog::OnComboChanged);
+ }
+
+ 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);
+ SetDescr(m_provs[0]);
+ }
+
+ void OnClose()
+ {
+ m_selected = m_provs[ m_combo.GetItemData(m_combo.GetCurSel()) ];
+ }
+
+ void OnComboChanged(CCtrlCombo*)
+ {
+ SetDescr(m_provs[m_combo.GetItemData(m_combo.GetCurSel())]);
+ }
+
+ void SetDescr(CRYPTO_PROVIDER *prov)
+ {
+ m_descr.SetText(prov->ptszDescr);
+ }
+
+ inline CRYPTO_PROVIDER* GetSelected()
+ {
+ return m_selected;
+ }
+};
\ No newline at end of file |