diff options
| author | Joe Ludwig <[email protected]> | 2013-07-04 11:20:31 -0700 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2013-07-04 11:20:31 -0700 |
| commit | 77b376f8a0d8d172c51729762f80bb394534aa41 (patch) | |
| tree | 79897a015745704f7202eaa6648c18f2e5312df4 /sp/src/vgui2/vgui_controls/perforcefilelistframe.cpp | |
| parent | Adding a CONTRIBUTING file so the rights that GitHub users grant to Valve wit... (diff) | |
| download | source-sdk-2013-77b376f8a0d8d172c51729762f80bb394534aa41.tar.xz source-sdk-2013-77b376f8a0d8d172c51729762f80bb394534aa41.zip | |
* 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.
Diffstat (limited to 'sp/src/vgui2/vgui_controls/perforcefilelistframe.cpp')
| -rw-r--r-- | sp/src/vgui2/vgui_controls/perforcefilelistframe.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sp/src/vgui2/vgui_controls/perforcefilelistframe.cpp b/sp/src/vgui2/vgui_controls/perforcefilelistframe.cpp index 1ba29d16..e761ec5c 100644 --- a/sp/src/vgui2/vgui_controls/perforcefilelistframe.cpp +++ b/sp/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();
|