// Copyright 1999 (c) by Perforce Software, Inc. All rights reserved. // // p4wSyncProcessorView: // The Sync processor view. // ------------------------------------- // Includes // #include <stdlib.h> #include <string.h> #include <p4wp4.h> #include "p4wView.h" #include "p4wSyncProcessorView.h" #include "p4wCmdPane.h" #include "p4wPreviewPane.h" // // ------------------------------------- // Constructors and destructor. // p4wSyncProcessorView::p4wSyncProcessorView(p4wRequest & Request) : p4wRunView(Request) { // // Parse spec for type of form (Remove from workspace or Sync) Spec spec; StrBufDict syncTable; const StrPtr *sr = fRequest.GetDynArg( "sr" ); spec.Add("isRemove"); if( !fRequest.ProcessForm(spec, &syncTable) ) { fShortTitle.Set( "Error" ); fFullTitle.Set( "Error" ); return; } if( syncTable.GetVar( "isRemove" ) ) fAc = AC_REMOVEFRM; else if( sr ) fAc = AC_SYNCLABEL; else fAc = AC_SYNCFRM; // // Parse action (preview? redisplay?) & set flags if needed ProcessFormAction(); // // Set the short and the long versions of the title. fShortTitle.Set( "Command Result" ); if( fPreview ) fFullTitle.Set( "Sync Preview Result" ); else fFullTitle.Set( "Sync Result" ); } p4wSyncProcessorView::~p4wSyncProcessorView() { } // ------------------------------------- // Control item render functions. // void p4wSyncProcessorView::RenderContent() { // // Issue sync command (passing the results through a // CmdPane). // Build a spec to parse the sync options if( !ProcessForm() ) { RenderError("Requested URL is invalid in this context."); return; } title = "Sync "; if( fPreview ) ArgAndTitle( "-n" ); if( specTable.GetVar("Force") != NULL ) ArgAndTitle( "-f" ); // Process the files. If this returned an error don't issue the command if( !AddFileArgs() ) return; // Run the command. if( fPreview ) { p4wPreviewPane prevPane( *this, fRequest, title.Text() ); fRequest.p4( "sync", 0, 0, &prevPane ); fRequest.p4Wait(); } else { p4wCmdPane cmdPane(*this, fRequest, title.Text()); fRequest.p4("sync", 0, 0, &cmdPane); fRequest.p4Wait(); } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 12234 | Matt Attaway |
Rejigger P4Web project in preparation for official sunsetting The bin directory contains the last official builds of P4Web from the Perforce download site. P4Web is soon to be completely sunsetted; these builds are here for folks who don't want to build their own. To better handle the archived builds the source code has been moved into a separate src directory. |
||
//guest/perforce_software/p4web/Views/p4wSyncProcessorView.cpp | |||||
#1 | 8914 | Matt Attaway | Initial add of the P4Web source code |