1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/other-licenses/7zstub/src/7zip/UI/GUI/OpenCallbackGUI.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,53 @@ 1.4 +// OpenCallbackGUI.cpp 1.5 + 1.6 +#include "StdAfx.h" 1.7 + 1.8 +#include "OpenCallbackGUI.h" 1.9 + 1.10 +#include "Common/StdOutStream.h" 1.11 +#include "Common/StdInStream.h" 1.12 +#include "Common/StringConvert.h" 1.13 + 1.14 +#ifndef _NO_CRYPTO 1.15 +#include "../../FileManager/Resource/PasswordDialog/PasswordDialog.h" 1.16 +#endif 1.17 + 1.18 +HRESULT COpenCallbackGUI::CheckBreak() 1.19 +{ 1.20 + return S_OK; 1.21 +} 1.22 + 1.23 +HRESULT COpenCallbackGUI::SetTotal(const UInt64 *files, const UInt64 *bytes) 1.24 +{ 1.25 + return S_OK; 1.26 +} 1.27 + 1.28 +HRESULT COpenCallbackGUI::SetCompleted(const UInt64 *files, const UInt64 *bytes) 1.29 +{ 1.30 + return S_OK; 1.31 +} 1.32 + 1.33 +#ifndef _NO_CRYPTO 1.34 +HRESULT COpenCallbackGUI::CryptoGetTextPassword(BSTR *password) 1.35 +{ 1.36 + if (!PasswordIsDefined) 1.37 + { 1.38 + CPasswordDialog dialog; 1.39 + if (dialog.Create(ParentWindow) == IDCANCEL) 1.40 + return E_ABORT; 1.41 + Password = dialog.Password; 1.42 + PasswordIsDefined = true; 1.43 + } 1.44 + CMyComBSTR tempName(Password); 1.45 + *password = tempName.Detach(); 1.46 + return S_OK; 1.47 +} 1.48 + 1.49 +HRESULT COpenCallbackGUI::GetPasswordIfAny(UString &password) 1.50 +{ 1.51 + if (PasswordIsDefined) 1.52 + password = Password; 1.53 + return S_OK; 1.54 +} 1.55 +#endif 1.56 +