From 77b376f8a0d8d172c51729762f80bb394534aa41 Mon Sep 17 00:00:00 2001 From: Joe Ludwig Date: Thu, 4 Jul 2013 11:20:31 -0700 Subject: * Switched the SDK from checked-in projects to VPC, the Valve Project Creator. See the Getting Started document on the wiki for details. * Pulled in bug fixes from HL2 and HL2MP. --- .../vgui2/vgui_controls/perforcefilelistframe.cpp | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'mp/src/vgui2/vgui_controls/perforcefilelistframe.cpp') diff --git a/mp/src/vgui2/vgui_controls/perforcefilelistframe.cpp b/mp/src/vgui2/vgui_controls/perforcefilelistframe.cpp index 1ba29d16..e761ec5c 100644 --- a/mp/src/vgui2/vgui_controls/perforcefilelistframe.cpp +++ b/mp/src/vgui2/vgui_controls/perforcefilelistframe.cpp @@ -334,6 +334,9 @@ void CPerforceFileListFrame::DoModal( KeyValues *pContextKeys, const char *pMess //----------------------------------------------------------------------------- void CPerforceFileListFrame::AddFileForOpen( const char *pFullPath ) { + if ( !p4 ) + return; + bool bIsInPerforce = p4->IsFileInPerforce( pFullPath ); bool bIsOpened = ( p4->GetFileState( pFullPath ) != P4FILE_UNOPENED ); switch( m_Action ) @@ -402,6 +405,9 @@ void CPerforceFileListFrame::AddFileForSubmit( const char *pFullPath, P4FileStat //----------------------------------------------------------------------------- void CPerforceFileListFrame::AddFile( const char *pFullPath ) { + if ( !p4 ) + return; + if ( m_Action < PERFORCE_ACTION_FILE_REVERT ) { // If the file wasn't found on the disk, then abort @@ -427,6 +433,9 @@ void CPerforceFileListFrame::AddFile( const char *pFullPath ) //----------------------------------------------------------------------------- void CPerforceFileListFrame::AddFile( const char *pRelativePath, const char *pPathId ) { + if ( !p4 ) + return; + // Deal with add, open, edit if ( m_Action < PERFORCE_ACTION_FILE_REVERT ) { @@ -497,6 +506,9 @@ void CPerforceFileListFrame::AddFile( const char *pRelativePath, const char *pPa //----------------------------------------------------------------------------- bool CPerforceFileListFrame::PerformOperation( ) { + if ( !p4 ) + return false; + int nFileCount = GetOperationCount(); const char **ppFileNames = (const char**)_alloca( nFileCount * sizeof(char*) ); for ( int i = 0; i < nFileCount; ++i ) @@ -583,6 +595,18 @@ bool CPerforceFileListFrame::PerformOperation( ) //----------------------------------------------------------------------------- void ShowPerforceQuery( vgui::Panel *pParent, const char *pFileName, vgui::Panel *pActionSignalTarget, KeyValues *pKeyValues, PerforceAction_t actionFilter ) { + if ( !p4 ) + { + KeyValues *pSpoofKeys = new KeyValues( "PerforceQueryCompleted", "operationPerformed", 1 ); + if ( pKeyValues ) + { + pSpoofKeys->AddSubKey( pKeyValues ); + } + vgui::ivgui()->PostMessage( pActionSignalTarget->GetVPanel(), pSpoofKeys, 0 ); + + return; + } + // Refresh the current perforce settings p4->RefreshActiveClient(); -- cgit v1.2.3