summaryrefslogtreecommitdiff
path: root/plugins/New_GPG/src/options.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-03-18 15:56:27 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-03-18 15:56:27 +0300
commit5f7e5caff72b4ce876c70b4ce03ff3b4c7bc6528 (patch)
tree739f255f2647ea2b7a8803e802ffd496d519ea04 /plugins/New_GPG/src/options.cpp
parent4be051a155c0fbc47c1e0eab75da6b4ba8bb2327 (diff)
NewGPG: options implemented using CMOption
Diffstat (limited to 'plugins/New_GPG/src/options.cpp')
-rwxr-xr-xplugins/New_GPG/src/options.cpp30
1 files changed, 12 insertions, 18 deletions
diff --git a/plugins/New_GPG/src/options.cpp b/plugins/New_GPG/src/options.cpp
index fe924e710a..c76a775406 100755
--- a/plugins/New_GPG/src/options.cpp
+++ b/plugins/New_GPG/src/options.cpp
@@ -27,6 +27,8 @@ static class COptGpgMainDlg *g_pMainDlg;
class COptGpgMainDlg : public CDlgBase
{
+ bool old_bFileTransfers = g_plugin.bFileTransfers;
+
CCtrlListView list_USERLIST;
CCtrlData lbl_CURRENT_KEY;
CCtrlEdit edit_LOG_FILE_EDIT;
@@ -48,6 +50,10 @@ public:
check_JABBER_API.OnChange = Callback(this, &COptGpgMainDlg::onChange_JABBER_API);
list_USERLIST.OnItemChanged = Callback(this, &COptGpgMainDlg::onItemChanged_USERLIST);
+
+ CreateLink(check_JABBER_API, g_plugin.bJabberAPI);
+ CreateLink(check_AUTO_EXCHANGE, g_plugin.bAutoExchange);
+ CreateLink(check_FILE_TRANSFERS, g_plugin.bFileTransfers);
}
bool OnInitDialog() override
@@ -95,7 +101,7 @@ public:
check_DEBUG_LOG.SetState(g_plugin.getByte("bDebugLog", 0));
check_JABBER_API.Enable();
- check_AUTO_EXCHANGE.Enable(globals.bJabberAPI);
+ check_AUTO_EXCHANGE.Enable(g_plugin.bJabberAPI);
CMStringW keyinfo = TranslateT("Default private key ID");
keyinfo += L": ";
@@ -120,15 +126,9 @@ public:
g_plugin.setByte("bDebugLog", globals.bDebugLog = check_DEBUG_LOG.GetState());
globals.debuglog.init();
- g_plugin.setByte("bJabberAPI", globals.bJabberAPI = check_JABBER_API.GetState());
+ if (g_plugin.bFileTransfers != old_bFileTransfers)
+ g_plugin.bSameAction = false;
- bool old_bFileTransfers = g_plugin.getByte("bFileTransfers", 0) != 0;
- g_plugin.setByte("bFileTransfers", globals.bFileTransfers = check_FILE_TRANSFERS.GetState());
- if (globals.bFileTransfers != old_bFileTransfers) {
- g_plugin.setByte("bSameAction", 0);
- globals.bSameAction = false;
- }
- g_plugin.setByte("bAutoExchange", globals.bAutoExchange = check_AUTO_EXCHANGE.GetState());
g_plugin.setWString("szLogFilePath", ptrW(edit_LOG_FILE_EDIT.GetText()));
return true;
}
@@ -496,18 +496,13 @@ public:
{
btn_EXPORT.OnClick = Callback(this, &COptGpgAdvDlg::onClick_EXPORT);
btn_IMPORT.OnClick = Callback(this, &COptGpgAdvDlg::onClick_IMPORT);
- }
- bool OnInitDialog() override
- {
- check_PRESCENSE_SUBSCRIPTION.SetState(g_plugin.getByte("bPresenceSigning", 0));
- check_PRESCENSE_SUBSCRIPTION.Enable(globals.bJabberAPI);
- return true;
+ CreateLink(check_PRESCENSE_SUBSCRIPTION, g_plugin.bPresenceSigning);
}
- bool OnApply() override
+ bool OnInitDialog() override
{
- g_plugin.setByte("bPresenceSigning", globals.bPresenceSigning = check_PRESCENSE_SUBSCRIPTION.GetState());
+ check_PRESCENSE_SUBSCRIPTION.Enable(g_plugin.bJabberAPI);
return true;
}
@@ -524,7 +519,6 @@ public:
}
};
-
CCtrlEdit *edit_p_PubKeyEdit = nullptr;
static LRESULT CALLBACK editctrl_ctrl_a(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)