MCPcopy Create free account
hub / github.com/bailey27/cppcryptfs / OnInitDialog

Method OnInitDialog

cppcryptfs/ui/CreatePropertyPage.cpp:371–506  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

369
370
371BOOL CCreatePropertyPage::OnInitDialog()
372{
373 CPropertyPage::OnInitDialog();
374
375 //Moved to both methods, otherwise the array will be loaded before we determine the GUI language at program startup.
376 static const CString sPlainText = LocUtils::GetStringFromResources(IDS_PLAIN_TEXT).c_str();
377 static const WCHAR* filename_encryption_types[] = { L"AES256-EME", sPlainText };
378 const int NUM_FN_ENC_TYPES = sizeof(filename_encryption_types) / sizeof(filename_encryption_types[0]);
379
380 // TODO: Add extra initialization here
381
382 CString clfns = theApp.GetProfileStringW(L"CreateOptions", L"LongFileNames", L"1");
383
384 CString detnames = theApp.GetProfileStringW(L"CreateOptions", L"DeterministicNames", L"0");
385
386 int longnamemax = theApp.GetProfileIntW(L"CreateOptions", L"LongNameMax", MAX_LONGNAMEMAX);
387
388 CString cdisablestreams = theApp.GetProfileStringW(L"CreateOptions", L"DisableStreams", L"0");
389
390 CString creverse = theApp.GetProfileStringW(L"CreateOptions", L"Reverse", L"0");
391
392 //To extract localization-independent text from the registry
393 CString cfnenc;
394 CString cfnenc_tmp = theApp.GetProfileStringW(L"CreateOptions", L"FilenameEncryption", L"AES256-EME");
395 if (cfnenc_tmp == L"Plain text") {
396 cfnenc = sPlainText;
397 } else {
398 cfnenc = cfnenc_tmp;
399 }
400
401 CString cdataenc = theApp.GetProfileStringW(L"CreateOptions", L"DataEncryption", L"AES256-GCM");
402
403 CheckDlgButton(IDC_LONG_FILE_NAMES, clfns == L"1");
404
405 CheckDlgButton(IDC_DETERMINISTIC_NAMES, detnames == L"1");
406
407 CheckDlgButton(IDC_DISABLE_STREAMS, cdisablestreams == L"1");
408
409 CheckDlgButton(IDC_REVERSE, creverse == L"1");
410
411 CComboBox *pBox = (CComboBox*)GetDlgItem(IDC_PATH);
412
413 int i;
414
415 if (pBox) {
416 for (i = 0; i < m_numLastDirs; i++) {
417 if (m_lastDirs[i].GetLength())
418 pBox->InsertString(i, m_lastDirs[i]);
419 }
420 }
421
422 pBox = (CComboBox*)GetDlgItem(IDC_CONFIG_PATH);
423
424 if (pBox) {
425 for (i = 0; i < m_numLastConfigs; i++) {
426 if (m_lastConfigs[i].GetLength())
427 pBox->InsertString(i, m_lastConfigs[i]);
428 }

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected