Fri, 16 Jan 2015 18:13:44 +0100
Integrate suggestion from review to improve consistency with existing code.
michael@0 | 1 | // OpenCallbackGUI.cpp |
michael@0 | 2 | |
michael@0 | 3 | #include "StdAfx.h" |
michael@0 | 4 | |
michael@0 | 5 | #include "OpenCallbackGUI.h" |
michael@0 | 6 | |
michael@0 | 7 | #include "Common/StdOutStream.h" |
michael@0 | 8 | #include "Common/StdInStream.h" |
michael@0 | 9 | #include "Common/StringConvert.h" |
michael@0 | 10 | |
michael@0 | 11 | #ifndef _NO_CRYPTO |
michael@0 | 12 | #include "../../FileManager/Resource/PasswordDialog/PasswordDialog.h" |
michael@0 | 13 | #endif |
michael@0 | 14 | |
michael@0 | 15 | HRESULT COpenCallbackGUI::CheckBreak() |
michael@0 | 16 | { |
michael@0 | 17 | return S_OK; |
michael@0 | 18 | } |
michael@0 | 19 | |
michael@0 | 20 | HRESULT COpenCallbackGUI::SetTotal(const UInt64 *files, const UInt64 *bytes) |
michael@0 | 21 | { |
michael@0 | 22 | return S_OK; |
michael@0 | 23 | } |
michael@0 | 24 | |
michael@0 | 25 | HRESULT COpenCallbackGUI::SetCompleted(const UInt64 *files, const UInt64 *bytes) |
michael@0 | 26 | { |
michael@0 | 27 | return S_OK; |
michael@0 | 28 | } |
michael@0 | 29 | |
michael@0 | 30 | #ifndef _NO_CRYPTO |
michael@0 | 31 | HRESULT COpenCallbackGUI::CryptoGetTextPassword(BSTR *password) |
michael@0 | 32 | { |
michael@0 | 33 | if (!PasswordIsDefined) |
michael@0 | 34 | { |
michael@0 | 35 | CPasswordDialog dialog; |
michael@0 | 36 | if (dialog.Create(ParentWindow) == IDCANCEL) |
michael@0 | 37 | return E_ABORT; |
michael@0 | 38 | Password = dialog.Password; |
michael@0 | 39 | PasswordIsDefined = true; |
michael@0 | 40 | } |
michael@0 | 41 | CMyComBSTR tempName(Password); |
michael@0 | 42 | *password = tempName.Detach(); |
michael@0 | 43 | return S_OK; |
michael@0 | 44 | } |
michael@0 | 45 | |
michael@0 | 46 | HRESULT COpenCallbackGUI::GetPasswordIfAny(UString &password) |
michael@0 | 47 | { |
michael@0 | 48 | if (PasswordIsDefined) |
michael@0 | 49 | password = Password; |
michael@0 | 50 | return S_OK; |
michael@0 | 51 | } |
michael@0 | 52 | #endif |
michael@0 | 53 |