summaryrefslogtreecommitdiff
path: root/plugins/New_GPG/src
diff options
context:
space:
mode:
authorAlexander Gluzsky <sss123next@list.ru>2012-10-05 06:22:09 +0000
committerAlexander Gluzsky <sss123next@list.ru>2012-10-05 06:22:09 +0000
commit960ee4645b7f11921e8c0ce5f80b1398303855a5 (patch)
tree32c0c670c57a4ab3cfdcd64824278f41a644ce4f /plugins/New_GPG/src
parent6a1066dcc71002eae9a3576534f8a806ee5bd75b (diff)
per account key ui finally fixed
git-svn-id: http://svn.miranda-ng.org/main/trunk@1785 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/New_GPG/src')
-rwxr-xr-xplugins/New_GPG/src/main.cpp97
1 files changed, 32 insertions, 65 deletions
diff --git a/plugins/New_GPG/src/main.cpp b/plugins/New_GPG/src/main.cpp
index 056b3594ed..db7a6d79f4 100755
--- a/plugins/New_GPG/src/main.cpp
+++ b/plugins/New_GPG/src/main.cpp
@@ -240,13 +240,14 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR
{
char setting[64];
std::string acc_str = buf;
- acc_str += "_GPGPubKey";
- DBWriteContactSettingString(NULL, szGPGModuleName, acc_str.c_str(), out.c_str());
- acc_str += "_KeyMainName";
- DBWriteContactSettingTString(NULL, szGPGModuleName, acc_str.c_str(), name);
- acc_str = buf;
- acc_str += "_KeyID";
- DBWriteContactSettingTString(NULL, szGPGModuleName, acc_str.c_str(), fp);
+ acc_str += "_GPGPubKey";
+ DBWriteContactSettingString(NULL, szGPGModuleName, acc_str.c_str(), out.c_str());
+ acc_str = buf;
+ acc_str += "_KeyMainName";
+ DBWriteContactSettingTString(NULL, szGPGModuleName, acc_str.c_str(), name);
+ acc_str = buf;
+ acc_str += "_KeyID";
+ DBWriteContactSettingTString(NULL, szGPGModuleName, acc_str.c_str(), fp);
}
}
TCHAR passwd[64];
@@ -431,47 +432,24 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR
else
{
char setting[64];
- PROTOACCOUNT *acc = (PROTOACCOUNT*)CallService(MS_PROTO_GETCONTACTBASEPROTO, 0, (LPARAM)buf);
- std::string acc_str;
- if(acc)
- {
- acc_str = toUTF8(acc->tszAccountName);
- acc_str += "(";
- acc_str += acc->szModuleName;
- acc_str += ")" ;
- acc_str += "_GPGPubKey";
- DBDeleteContactSetting(NULL, szGPGModuleName, acc_str.c_str());
- acc_str = toUTF8(acc->tszAccountName);
- acc_str += "(";
- acc_str += acc->szModuleName;
- acc_str += ")" ;
- acc_str += "_KeyMainName";
- DBDeleteContactSetting(NULL, szGPGModuleName, acc_str.c_str());
- acc_str = toUTF8(acc->tszAccountName);
- acc_str += "(";
- acc_str += acc->szModuleName;
- acc_str += ")" ;
- acc_str += "_KeyID";
- DBDeleteContactSetting(NULL, szGPGModuleName, acc_str.c_str());
- acc_str = toUTF8(acc->tszAccountName);
- acc_str += "(";
- acc_str += acc->szModuleName;
- acc_str += ")" ;
- acc_str += "_KeyComment";
- DBDeleteContactSetting(NULL, szGPGModuleName, acc_str.c_str());
- acc_str = toUTF8(acc->tszAccountName);
- acc_str += "(";
- acc_str += acc->szModuleName;
- acc_str += ")" ;
- acc_str += "_KeyMainEmail";
- DBDeleteContactSetting(NULL, szGPGModuleName, acc_str.c_str());
- acc_str = toUTF8(acc->tszAccountName);
- acc_str += "(";
- acc_str += acc->szModuleName;
- acc_str += ")" ;
- acc_str += "_KeyType";
- DBDeleteContactSetting(NULL, szGPGModuleName, acc_str.c_str());
- }
+ std::string acc_str = buf;
+ acc_str += "_GPGPubKey";
+ DBDeleteContactSetting(NULL, szGPGModuleName, acc_str.c_str());
+ acc_str = buf;
+ acc_str += "_KeyMainName";
+ DBDeleteContactSetting(NULL, szGPGModuleName, acc_str.c_str());
+ acc_str = buf;
+ acc_str += "_KeyID";
+ DBDeleteContactSetting(NULL, szGPGModuleName, acc_str.c_str());
+ acc_str = buf;
+ acc_str += "_KeyComment";
+ DBDeleteContactSetting(NULL, szGPGModuleName, acc_str.c_str());
+ acc_str = buf;
+ acc_str += "_KeyMainEmail";
+ DBDeleteContactSetting(NULL, szGPGModuleName, acc_str.c_str());
+ acc_str = buf;
+ acc_str += "_KeyType";
+ DBDeleteContactSetting(NULL, szGPGModuleName, acc_str.c_str());
}
}
ListView_DeleteItem(hwndList, itemnum);
@@ -587,23 +565,12 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR
else
{
char setting[64];
- PROTOACCOUNT *acc = (PROTOACCOUNT*)CallService(MS_PROTO_GETCONTACTBASEPROTO, 0, (LPARAM)buf);
- std::string acc_str;
- if(acc)
- {
- acc_str = toUTF8(acc->tszAccountName);
- acc_str += "(";
- acc_str += acc->szModuleName;
- acc_str += ")" ;
- acc_str += "_GPGPubKey";
- DBWriteContactSettingString(NULL, szGPGModuleName, acc_str.c_str(), out.c_str());
- acc_str = toUTF8(acc->tszAccountName);
- acc_str += "(";
- acc_str += acc->szModuleName;
- acc_str += ")" ;
- acc_str += "_KeyID";
- DBWriteContactSettingTString(NULL, szGPGModuleName, acc_str.c_str(), fp);
- }
+ std::string acc_str = buf;
+ acc_str += "_GPGPubKey";
+ DBWriteContactSettingString(NULL, szGPGModuleName, acc_str.c_str(), out.c_str());
+ acc_str = buf;
+ acc_str += "_KeyID";
+ DBWriteContactSettingTString(NULL, szGPGModuleName, acc_str.c_str(), fp);
}
}
extern HWND hwndCurKey_p;