summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.cpp2
-rw-r--r--main.cpp52
-rw-r--r--options.cpp4
3 files changed, 31 insertions, 27 deletions
diff --git a/init.cpp b/init.cpp
index cd4342d..3afca12 100644
--- a/init.cpp
+++ b/init.cpp
@@ -160,6 +160,7 @@ static int OnModulesLoaded(WPARAM wParam,LPARAM lParam)
void InitCheck();
void FirstRun();
+ bIsMiranda09 = (DWORD)CallService(MS_SYSTEM_GETVERSION, 0, 0) >= 0x00090001?true:false;
FirstRun();
InitCheck();
InitIconLib();
@@ -185,7 +186,6 @@ static int OnModulesLoaded(WPARAM wParam,LPARAM lParam)
}
- bIsMiranda09 = (DWORD)CallService(MS_SYSTEM_GETVERSION, 0, 0) >= 0x00090001?true:false;
bMetaContacts = ServiceExists(MS_MC_GETMETACONTACT);
if(bJabberAPI && bIsMiranda09)
diff --git a/main.cpp b/main.cpp
index 562a86d..e332f41 100644
--- a/main.cpp
+++ b/main.cpp
@@ -1,4 +1,4 @@
-// Copyright © 2010 sss
+// Copyright � 2010 sss
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
@@ -605,6 +605,8 @@ static BOOL CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if(gpg_exists && lang_exists && !bad_version)
MessageBox(0, _T("You have supported version of gpg binary, and gpg language file in place!\ngpg plugin should work fine on your installation!\njust press ok in wollowing diallog."), _T("Info"), MB_OK);
CheckDlgButton(hwndDlg, IDC_AUTO_EXCHANGE, 1);
+ extern bool bIsMiranda09;
+ EnableWindow(GetDlgItem(hwndDlg, IDC_AUTO_EXCHANGE), bIsMiranda09);
return TRUE;
}
@@ -716,15 +718,15 @@ static BOOL CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
MessageBox(0, _T("please set keyring's home directory"), _T("Warning"), MB_OK);
break;
}
- DBWriteContactSettingTString(NULL, szGPGModuleName, "szHomePath", tmp);
- {
- TCHAR *path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", _T(""));
- DWORD dwFileAttr = GetFileAttributes(path);
- if (dwFileAttr != INVALID_FILE_ATTRIBUTES)
- {
- dwFileAttr &=~ FILE_ATTRIBUTE_READONLY;
- SetFileAttributes(path, dwFileAttr);
- }
+ DBWriteContactSettingTString(NULL, szGPGModuleName, "szHomePath", tmp);
+ {
+ TCHAR *path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", _T(""));
+ DWORD dwFileAttr = GetFileAttributes(path);
+ if (dwFileAttr != INVALID_FILE_ATTRIBUTES)
+ {
+ dwFileAttr &=~ FILE_ATTRIBUTE_READONLY;
+ SetFileAttributes(path, dwFileAttr);
+ }
mir_free(path);
}
gpg_configured = true;
@@ -799,15 +801,15 @@ static BOOL CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
{
MessageBox(0, _T("please set keyring's home directory"), _T("Warning"), MB_OK);
break;
- }
- DBWriteContactSettingTString(NULL, szGPGModuleName, "szHomePath", tmp);
- {
- TCHAR *path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", _T(""));
- DWORD dwFileAttr = GetFileAttributes(path);
- if (dwFileAttr != INVALID_FILE_ATTRIBUTES)
- {
- dwFileAttr &=~ FILE_ATTRIBUTE_READONLY;
- SetFileAttributes(path, dwFileAttr);
+ }
+ DBWriteContactSettingTString(NULL, szGPGModuleName, "szHomePath", tmp);
+ {
+ TCHAR *path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", _T(""));
+ DWORD dwFileAttr = GetFileAttributes(path);
+ if (dwFileAttr != INVALID_FILE_ATTRIBUTES)
+ {
+ dwFileAttr &=~ FILE_ATTRIBUTE_READONLY;
+ SetFileAttributes(path, dwFileAttr);
}
mir_free(path);
}
@@ -1692,12 +1694,12 @@ void InitCheck()
if(MessageBoxA(0, question.c_str(), "Own secret key warning", MB_YESNO) == IDYES)
ShowFirstRunDialog();
}
- {
- TCHAR *path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", _T(""));
- DWORD dwFileAttr = GetFileAttributes(path);
- if (dwFileAttr != INVALID_FILE_ATTRIBUTES)
- {
- dwFileAttr &=~ FILE_ATTRIBUTE_READONLY;
+ {
+ TCHAR *path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", _T(""));
+ DWORD dwFileAttr = GetFileAttributes(path);
+ if (dwFileAttr != INVALID_FILE_ATTRIBUTES)
+ {
+ dwFileAttr &=~ FILE_ATTRIBUTE_READONLY;
SetFileAttributes(path, dwFileAttr);
}
mir_free(path);
diff --git a/options.cpp b/options.cpp
index 90fc4f4..c0debec 100644
--- a/options.cpp
+++ b/options.cpp
@@ -93,7 +93,7 @@ static BOOL CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
LVITEM item = {0};
TCHAR *tmp = NULL;
char *tmp2 = NULL;
- extern bool bIsMiranda09;
+ extern bool bIsMiranda09, bJabberAPI;
NMLISTVIEW * hdr = (NMLISTVIEW *) lParam;
switch (msg)
{
@@ -178,6 +178,7 @@ static BOOL CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
mir_free(tmp);
CheckStateLoadDB(hwndDlg, IDC_DEBUG_LOG, "bDebugLog", 0);
EnableWindow(GetDlgItem(hwndDlg, IDC_JABBER_API), bIsMiranda09);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_AUTO_EXCHANGE), (bIsMiranda09 && bJabberAPI));
{
string keyinfo = "Current private key id: ";
char *keyid = UniGetContactSettingUtf(NULL, szGPGModuleName, "KeyID", "");
@@ -366,6 +367,7 @@ static BOOL CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
case WM_NOTIFY:
{
+ EnableWindow(GetDlgItem(hwndDlg, IDC_AUTO_EXCHANGE), (bIsMiranda09 && IsDlgButtonChecked(hwndDlg, IDC_JABBER_API)));
if(hdr && IsWindowVisible(hdr->hdr.hwndFrom) && hdr->iItem != (-1))
{
if(hdr->hdr.code == NM_CLICK)