OptionsGeneral.cpp 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  1. // OptionsGeneral.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "CP_Main.h"
  5. #include "OptionsGeneral.h"
  6. #include "InternetUpdate.h"
  7. #include <io.h>
  8. #include <Mmsystem.h> //play sound
  9. #include "Path.h"
  10. #include "AdvGeneral.h"
  11. #include "DimWnd.h"
  12. #include "HyperLink.h"
  13. using namespace nsPath;
  14. #define DEFAULT_THEME _T("(Default)")
  15. #ifdef _DEBUG
  16. #define new DEBUG_NEW
  17. #undef THIS_FILE
  18. static char THIS_FILE[] = __FILE__;
  19. #endif
  20. /////////////////////////////////////////////////////////////////////////////
  21. // COptionsGeneral property page
  22. IMPLEMENT_DYNCREATE(COptionsGeneral, CPropertyPage)
  23. COptionsGeneral::COptionsGeneral() : CPropertyPage(COptionsGeneral::IDD)
  24. {
  25. m_csTitle = theApp.m_Language.GetString("GeneralTitle", "General");
  26. m_psp.pszTitle = m_csTitle;
  27. m_psp.dwFlags |= PSP_USETITLE;
  28. memset(&m_LogFont, 0, sizeof(LOGFONT));
  29. //{{AFX_DATA_INIT(COptionsGeneral)
  30. //}}AFX_DATA_INIT
  31. }
  32. COptionsGeneral::~COptionsGeneral()
  33. {
  34. }
  35. void COptionsGeneral::DoDataExchange(CDataExchange* pDX)
  36. {
  37. CPropertyPage::DoDataExchange(pDX);
  38. //{{AFX_DATA_MAP(COptionsGeneral)
  39. //DDX_Control(pDX, IDC_ENSURE, m_EnsureConnected);
  40. // DDX_Control(pDX, IDC_EDIT_SAVE_DELAY, m_SaveDelay);
  41. DDX_Control(pDX, IDC_COMBO_LANGUAGE, m_cbLanguage);
  42. DDX_Control(pDX, IDC_PATH, m_ePath);
  43. DDX_Control(pDX, IDC_EXPIRE_AFTER, m_eExpireAfter);
  44. DDX_Control(pDX, IDC_MAX_SAVED_COPIES, m_eMaxSavedCopies);
  45. DDX_Control(pDX, IDC_EXPIRE, m_btExpire);
  46. DDX_Control(pDX, IDC_START_ON_STARTUP, m_btRunOnStartup);
  47. DDX_Control(pDX, IDC_EDIT_APP_COPY_INCLUDE, m_copyAppInclude);
  48. DDX_Control(pDX, IDC_EDIT_APP_COPY_EXCLUDE, m_copyAppExclude);
  49. DDX_Control(pDX, IDC_MAXIMUM, m_btMaximumCheck);
  50. //}}AFX_DATA_MAP
  51. DDX_Control(pDX, IDC_COMBO_THEME, m_cbTheme);
  52. DDX_Control(pDX, IDC_BUTTON_FONT, m_btFont);
  53. DDX_Control(pDX, IDC_BUTTON_DEFAULT_FAULT, m_btDefaultButton);
  54. DDX_Control(pDX, IDC_COMBO_POPUP_POSITION, m_popupPositionCombo);
  55. DDX_Control(pDX, IDC_MFCLINK_ENV_VAR, m_envVarLink);
  56. }
  57. BEGIN_MESSAGE_MAP(COptionsGeneral, CPropertyPage)
  58. //{{AFX_MSG_MAP(COptionsGeneral)
  59. ON_BN_CLICKED(IDC_GET_PATH, OnGetPath)
  60. ON_BN_CLICKED(IDC_BUTTON_ABOUT, OnButtonAbout)
  61. //}}AFX_MSG_MAP
  62. ON_BN_CLICKED(IDC_BUTTON_ADVANCED, &COptionsGeneral::OnBnClickedButtonAdvanced)
  63. ON_WM_CTLCOLOR()
  64. ON_BN_CLICKED(IDC_BUTTON_THEME, &COptionsGeneral::OnBnClickedButtonTheme)
  65. ON_BN_CLICKED(IDC_BUTTON_DEFAULT_FAULT, &COptionsGeneral::OnBnClickedButtonDefaultFault)
  66. ON_BN_CLICKED(IDC_BUTTON_FONT, &COptionsGeneral::OnBnClickedButtonFont)
  67. ON_EN_CHANGE(IDC_PATH, &COptionsGeneral::OnEnChangePath)
  68. END_MESSAGE_MAP()
  69. /////////////////////////////////////////////////////////////////////////////
  70. // COptionsGeneral message handlers
  71. BOOL COptionsGeneral::OnInitDialog()
  72. {
  73. CPropertyPage::OnInitDialog();
  74. CString url = _T("https://sourceforge.net/p/ditto-cp/wiki/EnvironmentVariables/");
  75. /*m_envVarLink.SetURL(_T("\"") + url);
  76. m_envVarLink.SetFontSize(-9);*/
  77. m_brush.CreateSolidBrush(RGB(251, 251, 251));
  78. m_pParent = (COptionsSheet *)GetParent();
  79. #ifndef _DEBUG
  80. if (CGetSetOptions::GetIsWindowsApp())
  81. {
  82. m_btRunOnStartup.SetCheck(BST_CHECKED);
  83. GetDlgItem(IDC_START_ON_STARTUP)->EnableWindow(FALSE);
  84. }
  85. else
  86. {
  87. m_btRunOnStartup.SetCheck(CGetSetOptions::GetRunOnStartUp());
  88. }
  89. #endif
  90. m_btMaximumCheck.SetCheck(CGetSetOptions::GetCheckForMaxEntries());
  91. m_btExpire.SetCheck(CGetSetOptions::GetCheckForExpiredEntries());
  92. m_eExpireAfter.SetNumber(CGetSetOptions::GetExpiredEntries());
  93. m_eMaxSavedCopies.SetNumber(CGetSetOptions::GetMaxEntries());
  94. if(CGetSetOptions::GetDisableExpireClipsConfig())
  95. {
  96. m_btMaximumCheck.EnableWindow(FALSE);
  97. m_btExpire.EnableWindow(FALSE);
  98. m_eExpireAfter.EnableWindow(FALSE);
  99. m_eMaxSavedCopies.EnableWindow(FALSE);
  100. }
  101. m_copyAppInclude.SetWindowText(g_Opt.GetCopyAppInclude());
  102. m_copyAppExclude.SetWindowText(g_Opt.GetCopyAppExclude());
  103. CString csPath = CGetSetOptions::GetDBPath(false);
  104. m_ePath.SetWindowText(csPath);
  105. CGetSetOptions::GetFont(m_LogFont);
  106. CString cs;
  107. cs.Format(_T("Font - %s (%d)"), m_LogFont.lfFaceName, GetFontSize(m_hWnd, m_LogFont));
  108. m_btFont.SetWindowText(cs);
  109. FillThemes();
  110. FillLanguages();
  111. int caretPos = m_popupPositionCombo.AddString(_T("At Caret"));
  112. m_popupPositionCombo.SetItemData(caretPos, POS_AT_CARET);
  113. int cursorPos = m_popupPositionCombo.AddString(_T("At Cursor"));
  114. m_popupPositionCombo.SetItemData(cursorPos, POS_AT_CURSOR);
  115. int prevPos = m_popupPositionCombo.AddString(_T("At Previous Position"));
  116. m_popupPositionCombo.SetItemData(prevPos, POS_AT_PREVIOUS);
  117. switch (CGetSetOptions::GetQuickPastePosition())
  118. {
  119. case POS_AT_CARET:
  120. m_popupPositionCombo.SetCurSel(caretPos);
  121. break;
  122. case POS_AT_CURSOR:
  123. m_popupPositionCombo.SetCurSel(cursorPos);
  124. break;
  125. case POS_AT_PREVIOUS:
  126. m_popupPositionCombo.SetCurSel(prevPos);
  127. break;
  128. default:
  129. m_popupPositionCombo.SetCurSel(cursorPos);
  130. }
  131. UpdateData(FALSE);
  132. theApp.m_Language.UpdateOptionGeneral(this);
  133. OnEnChangePath();
  134. return TRUE;
  135. }
  136. #define NO_MATCH -2
  137. #define FOUND_MATCH -1
  138. void COptionsGeneral::FillLanguages()
  139. {
  140. CString csFile = CGetSetOptions::GetPath(PATH_LANGUAGE);
  141. csFile += "*.xml";
  142. CString csLanguage = CGetSetOptions::GetLanguageFile();
  143. CFileFind find;
  144. BOOL bCont = find.FindFile(csFile);
  145. int nEnglishIndex = NO_MATCH;
  146. while(bCont)
  147. {
  148. bCont = find.FindNextFile();
  149. int nIndex = m_cbLanguage.AddString(find.GetFileTitle());
  150. if(find.GetFileTitle() == csLanguage)
  151. {
  152. nEnglishIndex = -1;
  153. m_cbLanguage.SetCurSel(nIndex);
  154. }
  155. else if(find.GetFileTitle() == _T("English"))
  156. {
  157. if(nEnglishIndex == NO_MATCH)
  158. nEnglishIndex = nIndex;
  159. }
  160. }
  161. if(nEnglishIndex >= 0)
  162. {
  163. m_cbLanguage.SetCurSel(nEnglishIndex);
  164. }
  165. }
  166. BOOL COptionsGeneral::OnApply()
  167. {
  168. UpdateData();
  169. #ifndef _DEBUG
  170. if (CGetSetOptions::GetIsWindowsApp() == FALSE)
  171. {
  172. CGetSetOptions::SetRunOnStartUp(m_btRunOnStartup.GetCheck());
  173. }
  174. #endif
  175. CGetSetOptions::SetCheckForMaxEntries(m_btMaximumCheck.GetCheck());
  176. CGetSetOptions::SetCheckForExpiredEntries(m_btExpire.GetCheck());
  177. CGetSetOptions::SetMaxEntries(m_eMaxSavedCopies.GetNumber());
  178. CGetSetOptions::SetExpiredEntries(m_eExpireAfter.GetNumber());
  179. CString stringVal;
  180. m_copyAppInclude.GetWindowText(stringVal);
  181. g_Opt.SetCopyAppInclude(stringVal);
  182. m_copyAppExclude.GetWindowText(stringVal);
  183. g_Opt.SetCopyAppExclude(stringVal);
  184. CString csLanguage;
  185. if(m_cbLanguage.GetCurSel() >= 0)
  186. {
  187. m_cbLanguage.GetLBText(m_cbLanguage.GetCurSel(), csLanguage);
  188. g_Opt.SetLanguageFile(csLanguage);
  189. }
  190. if(csLanguage.IsEmpty() == FALSE)
  191. {
  192. if(!theApp.m_Language.LoadLanguageFile(csLanguage))
  193. {
  194. CString cs;
  195. cs.Format(_T("Error loading language file - %s - \n\n%s"), csLanguage, theApp.m_Language.m_csLastError);
  196. MessageBox(cs, _T("Ditto"), MB_OK);
  197. }
  198. }
  199. CString toSavePath;
  200. m_ePath.GetWindowText(toSavePath);
  201. CString resolvedPath = CGetSetOptions::ResolvePath(toSavePath);
  202. bool bOpenNewDatabase = false;
  203. if(resolvedPath.IsEmpty() == FALSE)
  204. {
  205. if(FileExists(resolvedPath) == FALSE)
  206. {
  207. CString cs;
  208. cs.Format(_T("The database %s does not exist.\n\nCreate a new database?"), resolvedPath);
  209. if(MessageBox(cs, _T("Ditto"), MB_YESNO) == IDYES)
  210. {
  211. // -- create a new one
  212. if(CreateDB(resolvedPath))
  213. {
  214. bOpenNewDatabase = true;
  215. }
  216. else
  217. MessageBox(_T("Error Creating Database"));
  218. }
  219. else
  220. return FALSE;
  221. }
  222. else
  223. {
  224. if(ValidDB(resolvedPath) == FALSE)
  225. {
  226. MessageBox(_T("Invalid Database"), _T("Ditto"), MB_OK);
  227. m_ePath.SetFocus();
  228. return FALSE;
  229. }
  230. else
  231. {
  232. bOpenNewDatabase = true;
  233. }
  234. }
  235. if(bOpenNewDatabase)
  236. {
  237. CGetSetOptions::SetDBPath(toSavePath);
  238. if(OpenDatabase(resolvedPath) == FALSE)
  239. {
  240. MessageBox(_T("Error Opening new database"), _T("Ditto"), MB_OK);
  241. m_ePath.SetFocus();
  242. return FALSE;
  243. }
  244. else
  245. {
  246. theApp.RefreshView();
  247. }
  248. }
  249. }
  250. CGetSetOptions::SetQuickPastePosition((int)m_popupPositionCombo.GetItemData(m_popupPositionCombo.GetCurSel()));
  251. if (m_LogFont.lfWeight != 0)
  252. {
  253. CGetSetOptions::SetFont(m_LogFont);
  254. }
  255. CString currentTheme = g_Opt.GetTheme();
  256. CString csTheme;
  257. if (m_cbTheme.GetCurSel() >= 0)
  258. {
  259. m_cbTheme.GetLBText(m_cbTheme.GetCurSel(), csTheme);
  260. if (csTheme == DEFAULT_THEME)
  261. {
  262. g_Opt.SetTheme("");
  263. csTheme = _T("");
  264. }
  265. else
  266. g_Opt.SetTheme(csTheme);
  267. }
  268. else
  269. {
  270. g_Opt.SetTheme("");
  271. }
  272. if (currentTheme != csTheme)
  273. {
  274. m_pParent->m_themeChanged = TRUE;
  275. }
  276. return CPropertyPage::OnApply();
  277. }
  278. BOOL COptionsGeneral::OnSetActive()
  279. {
  280. return CPropertyPage::OnSetActive();
  281. }
  282. //void COptionsGeneral::OnSetDbPath()
  283. //{
  284. // if(m_btSetDatabasePath.GetCheck() == BST_CHECKED)
  285. // {
  286. // m_ePath.EnableWindow(TRUE);
  287. // m_btGetPath.EnableWindow(TRUE);
  288. // }
  289. // else
  290. // {
  291. // m_ePath.EnableWindow(FALSE);
  292. // m_btGetPath.EnableWindow(FALSE);
  293. // }
  294. //}
  295. void COptionsGeneral::OnGetPath()
  296. {
  297. OPENFILENAME FileName;
  298. TCHAR szFileName[400];
  299. TCHAR szDir[400];
  300. memset(&FileName, 0, sizeof(FileName));
  301. memset(szFileName, 0, sizeof(szFileName));
  302. memset(&szDir, 0, sizeof(szDir));
  303. FileName.lStructSize = sizeof(FileName);
  304. FileName.lpstrTitle = _T("Open Database");
  305. FileName.Flags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_PATHMUSTEXIST | OFN_NOCHANGEDIR;
  306. FileName.nMaxFile = 400;
  307. FileName.lpstrFile = szFileName;
  308. FileName.lpstrInitialDir = szDir;
  309. FileName.lpstrFilter = _T("Ditto Databases (*.db; *.mdb)\0*.db;*.mdb\0\0");
  310. FileName.lpstrDefExt = _T("db");
  311. FileName.hwndOwner = m_hWnd;
  312. if(GetOpenFileName(&FileName) == 0)
  313. return;
  314. CString csPath(FileName.lpstrFile);
  315. if(FileExists(csPath))
  316. {
  317. if(ValidDB(csPath) == FALSE)
  318. {
  319. MessageBox(_T("Invalid Database"), _T("Ditto"), MB_OK);
  320. m_ePath.SetFocus();
  321. }
  322. else
  323. {
  324. m_ePath.SetWindowText(csPath);
  325. }
  326. }
  327. else
  328. {
  329. m_ePath.SetWindowText(csPath);
  330. }
  331. }
  332. void COptionsGeneral::OnButtonAbout()
  333. {
  334. CDimWnd dim(this->GetParent());
  335. CMultiLanguage Lang;
  336. CString csLanguage;
  337. m_cbLanguage.GetLBText(m_cbLanguage.GetCurSel(), csLanguage);
  338. Lang.SetOnlyGetHeader(true);
  339. if(Lang.LoadLanguageFile(csLanguage))
  340. {
  341. CString csMessage;
  342. csMessage.Format(_T("Language - %s\n")
  343. _T("Version - %d\n")
  344. _T("Author - %s\n")
  345. _T("Notes - %s"), csLanguage,
  346. Lang.GetVersion(),
  347. Lang.GetAuthor(),
  348. Lang.GetNotes());
  349. MessageBox(csMessage, _T("Ditto"), MB_OK);
  350. }
  351. else
  352. {
  353. CString csError;
  354. csError.Format(_T("Error loading language file - %s - reason = "), csLanguage, Lang.m_csLastError);
  355. MessageBox(csError, _T("Ditto"), MB_OK);
  356. }
  357. }
  358. void COptionsGeneral::OnBnClickedButtonAdvanced()
  359. {
  360. CDimWnd dim(this->GetParent());
  361. CAdvGeneral adv(this);
  362. adv.DoModal();
  363. }
  364. HBRUSH COptionsGeneral::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
  365. {
  366. HBRUSH hbr = CPropertyPage::OnCtlColor(pDC, pWnd, nCtlColor);
  367. switch(nCtlColor)
  368. {
  369. case CTLCOLOR_DLG: // dialog
  370. case CTLCOLOR_STATIC: // static, checkbox, read-only edit, etc.
  371. //pDC->SetBkColor(RGB(251, 251, 251));
  372. //hbr = m_brush;
  373. break;
  374. }
  375. return hbr;
  376. }
  377. void COptionsGeneral::FillThemes()
  378. {
  379. CString csFile = CGetSetOptions::GetPath(PATH_THEMES);
  380. csFile += "*.xml";
  381. CString csTheme = CGetSetOptions::GetTheme();
  382. CFileFind find;
  383. BOOL bCont = find.FindFile(csFile);
  384. bool bSetCurSel = false;
  385. while (bCont)
  386. {
  387. bCont = find.FindNextFile();
  388. CTheme theme;
  389. if (theme.Load(find.GetFileTitle(), true, false))
  390. {
  391. if (theme.FileVersion() >= 2 && theme.FileVersion() < 100)
  392. {
  393. int nIndex = m_cbTheme.AddString(find.GetFileTitle());
  394. if (find.GetFileTitle() == csTheme)
  395. {
  396. m_cbTheme.SetCurSel(nIndex);
  397. bSetCurSel = true;
  398. }
  399. }
  400. }
  401. }
  402. int nIndex = m_cbTheme.AddString(DEFAULT_THEME);
  403. if (bSetCurSel == false)
  404. {
  405. m_cbTheme.SetCurSel(nIndex);
  406. }
  407. }
  408. void COptionsGeneral::OnBnClickedButtonTheme()
  409. {
  410. CDimWnd dim(this->GetParent());
  411. CTheme theme;
  412. CString csTheme;
  413. m_cbTheme.GetLBText(m_cbTheme.GetCurSel(), csTheme);
  414. if (csTheme == DEFAULT_THEME)
  415. return;
  416. if (theme.Load(csTheme, true, false))
  417. {
  418. CString csMessage;
  419. csMessage.Format(_T("Theme - %s\n")
  420. _T("Version - %d\n")
  421. _T("Author - %s\n")
  422. _T("Notes - %s"), csTheme,
  423. theme.FileVersion(),
  424. theme.Author(),
  425. theme.Notes());
  426. MessageBox(csMessage, _T("Ditto"), MB_OK);
  427. }
  428. else
  429. {
  430. CString csError;
  431. csError.Format(_T("Error loading theme file - %s - reason = "), csTheme, theme.LastError());
  432. MessageBox(csError, _T("Ditto"), MB_OK);
  433. }
  434. }
  435. void COptionsGeneral::OnBnClickedButtonDefaultFault()
  436. {
  437. memset(&m_LogFont, 0, sizeof(m_LogFont));
  438. m_LogFont.lfHeight = -13;
  439. m_LogFont.lfWeight = 400;
  440. m_LogFont.lfCharSet = 1;
  441. STRCPY(m_LogFont.lfFaceName, _T("Segoe UI"));
  442. CString cs;
  443. cs.Format(_T("Font - %s (%d)"), m_LogFont.lfFaceName, GetFontSize(m_hWnd, m_LogFont));
  444. m_btFont.SetWindowText(cs);
  445. }
  446. int COptionsGeneral::GetFontSize(HWND hWnd, const LOGFONT& lf)
  447. {
  448. int nFontSize = 0;
  449. HDC hDC = ::GetWindowDC(hWnd);
  450. if (lf.lfHeight < 0)
  451. {
  452. nFontSize = -::MulDiv(lf.lfHeight, 72, ::GetDeviceCaps(hDC, LOGPIXELSY));
  453. }
  454. else
  455. {
  456. TEXTMETRIC tm;
  457. ::ZeroMemory(&tm, sizeof(TEXTMETRIC));
  458. ::GetTextMetrics(hDC, &tm);
  459. nFontSize = ::MulDiv(lf.lfHeight - tm.tmInternalLeading, 72, ::GetDeviceCaps(hDC, LOGPIXELSY));
  460. }
  461. ::ReleaseDC(hWnd, hDC);
  462. return nFontSize;
  463. }
  464. void COptionsGeneral::OnBnClickedButtonFont()
  465. {
  466. CFontDialog dlg(&m_LogFont, (CF_TTONLY | CF_SCREENFONTS), 0, this);
  467. if (dlg.DoModal() == IDOK)
  468. {
  469. memcpy(&m_LogFont, dlg.m_cf.lpLogFont, sizeof(LOGFONT));
  470. CString cs;
  471. cs.Format(_T("Font - %s (%d)"), m_LogFont.lfFaceName, GetFontSize(m_hWnd, m_LogFont));
  472. m_btFont.SetWindowText(cs);
  473. }
  474. }
  475. //void COptionsGeneral::OnNMClickSyslinkEnvVarInfo(NMHDR *pNMHDR, LRESULT *pResult)
  476. //{
  477. // CString url = _T("https:////sourceforge.net//p//ditto-cp//wiki//EnvironmentVariables//");
  478. //
  479. // CHyperLink::GotoURL(url, SW_SHOW);
  480. //
  481. // *pResult = 0;
  482. //}
  483. //
  484. //
  485. //void COptionsGeneral::OnEnChangePath()
  486. //{
  487. // // TODO: If this is a RICHEDIT control, the control will not
  488. // // send this notification unless you override the CPropertyPage::OnInitDialog()
  489. // // function and call CRichEditCtrl().SetEventMask()
  490. // // with the ENM_CHANGE flag ORed into the mask.
  491. //
  492. // // TODO: Add your control notification handler code here
  493. //}
  494. void COptionsGeneral::OnEnChangePath()
  495. {
  496. // TODO: If this is a RICHEDIT control, the control will not
  497. // send this notification unless you override the CPropertyPage::OnInitDialog()
  498. // function and call CRichEditCtrl().SetEventMask()
  499. // with the ENM_CHANGE flag ORed into the mask.
  500. // TODO: Add your control notification handler code here
  501. CString toSavePath;
  502. m_ePath.GetWindowText(toSavePath);
  503. if (toSavePath.Find(_T("%")) >= 0)
  504. {
  505. CString resolvedPath = CGetSetOptions::ResolvePath(toSavePath);
  506. m_envVarLink.SetWindowText(resolvedPath);
  507. }
  508. else
  509. {
  510. m_envVarLink.SetWindowText(_T("Environment Variables"));
  511. }
  512. }