void UserInterface::DisplayVolumeProperties (const VolumeInfoList &volumes) const { if (volumes.size() < 1) throw_err (LangString["NO_VOLUMES_MOUNTED"]); wxString prop; foreach_ref (const VolumeInfo &volume, volumes) { prop << _("Slot") << L": " << StringConverter::FromNumber (volume.SlotNumber) << L'\n'; prop << LangString["VOLUME"] << L": " << wstring (volume.Path) << L'\n'; #ifndef TC_WINDOWS prop << LangString["VIRTUAL_DEVICE"] << L": " << wstring (volume.VirtualDevice) << L'\n'; #endif prop << LangString["MOUNT_POINT"] << L": " << wstring (volume.MountPoint) << L'\n'; prop << LangString["SIZE"] << L": " << SizeToString (volume.Size) << L'\n'; prop << LangString["TYPE"] << L": " << VolumeTypeToString (volume.Type, volume.Protection) << L'\n'; prop << LangString["READ_ONLY"] << L": " << LangString [volume.Protection == VolumeProtection::ReadOnly ? "UISTR_YES" : "UISTR_NO"] << L'\n'; wxString protection; if (volume.Type == VolumeType::Hidden) protection = LangString["NOT_APPLICABLE_OR_NOT_AVAILABLE"]; else if (volume.HiddenVolumeProtectionTriggered) protection = LangString["HID_VOL_DAMAGE_PREVENTED"]; else protection = LangString [volume.Protection == VolumeProtection::HiddenVolumeReadOnly ? "UISTR_YES" : "UISTR_NO"]; prop << LangString["HIDDEN_VOL_PROTECTION"] << L": " << protection << L'\n'; prop << LangString["ENCRYPTION_ALGORITHM"] << L": " << volume.EncryptionAlgorithmName << L'\n'; prop << LangString["KEY_SIZE"] << L": " << StringFormatter (L"{0} {1}", volume.EncryptionAlgorithmKeySize * 8, LangString ["BITS"]) << L'\n'; if (volume.EncryptionModeName == L"XTS") prop << LangString["SECONDARY_KEY_SIZE_XTS"] << L": " << StringFormatter (L"{0} {1}", volume.EncryptionAlgorithmKeySize * 8, LangString ["BITS"]) << L'\n';; wstringstream blockSize; blockSize << volume.EncryptionAlgorithmBlockSize * 8; if (volume.EncryptionAlgorithmBlockSize != volume.EncryptionAlgorithmMinBlockSize) blockSize << L"/" << volume.EncryptionAlgorithmMinBlockSize * 8; prop << LangString["BLOCK_SIZE"] << L": " << blockSize.str() + L" " + LangString ["BITS"] << L'\n'; prop << LangString["MODE_OF_OPERATION"] << L": " << volume.EncryptionModeName << L'\n'; prop << LangString["PKCS5_PRF"] << L": " << volume.Pkcs5PrfName << L'\n'; prop << LangString["VOLUME_FORMAT_VERSION"] << L": " << (volume.MinRequiredProgramVersion < 0x600 ? 1 : 2) << L'\n'; prop << LangString["BACKUP_HEADER"] << L": " << LangString[volume.MinRequiredProgramVersion >= 0x600 ? "UISTR_YES" : "UISTR_NO"] << L'\n'; #ifdef TC_LINUX if (string (volume.VirtualDevice).find ("/dev/mapper/truecrypt") != 0) { #endif prop << LangString["TOTAL_DATA_READ"] << L": " << SizeToString (volume.TotalDataRead) << L'\n'; prop << LangString["TOTAL_DATA_WRITTEN"] << L": " << SizeToString (volume.TotalDataWritten) << L'\n'; #ifdef TC_LINUX } #endif prop << L'\n'; }
// -------------------------------------------------------------------------------- // void guImportFiles::UpdateCounters( void ) { wxLongLong Size = 0; wxLongLong Length = 0; int Index; int Count = m_Tracks->Count(); if( Count ) { for( Index = 0; Index < Count; Index++ ) { guTrack &Track = m_Tracks->Item( Index ); Size += Track.m_FileSize; Length += Track.m_Length; } wxString SelInfo = wxString::Format( wxT( "%u " ), Count ); SelInfo += Count == 1 ? _( "track" ) : _( "tracks" ); SelInfo += wxString::Format( wxT( ", %s, %s" ), LenToString( Length.GetValue() ).c_str(), SizeToString( Size.GetValue() ).c_str() ); m_FilesLabel->SetLabel( SelInfo ); Layout(); } else { m_FilesLabel->SetLabel( _( "No files added" ) ); Layout(); } }
CXTPPropertyGridItemSize::CXTPPropertyGridItemSize(UINT nID, CSize size, CSize* pBindSize) : CXTPPropertyGridItem(nID) { m_pItemWidth = NULL; m_pItemHeight = NULL; m_szValue = size; BindToSize(pBindSize); m_strDefaultValue = m_strValue = SizeToString(size); }
CXTPPropertyGridItemSize::CXTPPropertyGridItemSize(LPCTSTR strCaption, CSize size, CSize* pBindSize) : CXTPPropertyGridItem(strCaption) { m_pItemWidth = NULL; m_pItemHeight = NULL; m_szValue = size; BindToSize(pBindSize); m_strDefaultValue = m_strValue = SizeToString(size); }
void SizeToString(unsigned __int64 nSize, string& strUTF8) { wstring wstr; strUTF8.clear(); SizeToString(nSize, wstr); WstringToUTF8String(wstr, strUTF8); }
void CXTPPropertyGridItemSize::SetSize(CSize size) { m_szValue = size; if (m_pBindSize) { *m_pBindSize = m_szValue; } CXTPPropertyGridItem::SetValue(SizeToString(m_szValue)); UpdateChilds(); }
wxSize Ini::Load(wxString key, const wxSize def_value) { return StringToSize(m_Config->Read(key, SizeToString(def_value))); }
void Ini::Save(wxString key, wxSize value) { m_Config->Write(key, SizeToString(value)); }
void CXTPPropertyGridItemSize::SetHeight(LPCTSTR strHeight) { OnValueChanged(SizeToString(CSize(m_szValue.cx, _ttoi(strHeight)))); }
void CXTPPropertyGridItemSize::SetWidth(LPCTSTR strWidth) { OnValueChanged(SizeToString(CSize(_ttoi(strWidth), m_szValue.cy))); }
std::pair<int, int> Ini::Load(const std::string& section, const std::string& key, const std::pair<int, int> def_value) { return StringToSize(m_Config->GetValue(section.c_str(), key.c_str(), SizeToString(def_value).c_str())); saveIniFile(); }
void Ini::Save(const std::string& section, const std::string& key, std::pair<int, int> value) { m_Config->SetValue(section.c_str(), key.c_str(), SizeToString(value).c_str()); saveIniFile(); }
std::pair<int, int> Ini::Load(const std::string& section, const std::string& key, const std::pair<int, int> def_value) { return StringToSize(static_cast<CSimpleIniCaseA*>(m_config)->GetValue(section.c_str(), key.c_str(), SizeToString(def_value).c_str())); }
void Ini::Save(const std::string& section, const std::string& key, std::pair<int, int> value) { static_cast<CSimpleIniCaseA*>(m_config)->SetValue(section.c_str(), key.c_str(), SizeToString(value).c_str()); saveIniFile(); }