// // Copyright 2002 Perforce Software. All rights reserved. // // This file is part of Perforce - the FAST SCM System. // // p4wDescribeView: // Invoke the describe command and the fixes -c command. #include <stdlib.h> #include <string.h> #include <p4wp4.h> #include "p4wView.h" #include "p4wMenuPane.h" #include "p4wDescribeView.h" #include "p4wFixedPane.h" p4wDescribeView::p4wDescribeView( p4wRequest & Request ) : p4wView( Request ) { // // Set the short and the long versions of the title fShortTitle.Set( "Changelist Detail" ); fFullTitle << "Changelist #" << fRequest.GetURL(); } p4wDescribeView::~p4wDescribeView() { } void p4wDescribeView::RenderContent() { // // If this is an Add Fix request, handle it before displaying the (updated) changelist if (fRequest.GetCmd() == AC_ADDFIXPROCESSOR) ProcessAddFix(); // // Send the describe results to the describe pane. p4wDescribePane describePane( *this, fRequest ); const char *describePaneArgs[] = { "-s", fRequest.GetURL().Text() }; fRequest.p4( "describe", 2, describePaneArgs, &describePane ); // // Wait for the pane to draw. fRequest.p4Wait(); // Also invoke fixes -c changelist // unless we encountered a fatal error. if( describePane.FatalError() ) return; fRequest.p4Arg( "-c" ); fRequest.p4Arg( fRequest.GetURL().Text() ); fRequest.p4( "fixes", 0, 0, &describePane ); fRequest.p4Wait(); if( fRequest.GetCmd() != AC_ADDFIX || describePane.FatalError() ) return; fRequest.p4Arg( "-o" ); fRequest.p4( "jobspec", 0, 0, &describePane ); fRequest.p4Wait(); } void p4wDescribeView::RenderMenu() { // // Draw the menu bar p4wMenuPane menuPane( *this, fRequest, "describe" ); menuPane.Render( NULL ); } void p4wDescribeView::ProcessAddFix() { if(!fRequest.GetPostData()) return; p4wFixedPane fixedPane( *this, fRequest ); Spec s; StrBufDict st; s.Add( "Jobs" ); s.Add( "JobStatus" ); fRequest.ProcessForm( s, &st ); StrPtr *jobs = st.GetVar( "Jobs" ); int l = jobs->Length(); if (!l) return; StrPtr *jobstatus = st.GetVar( "JobStatus" ); int i; while (((i = strcspn(jobs->Text(), "\n\r\t,")) != 0) && i < l) *(jobs->Text()+i) = ' '; if (strcmp(jobstatus->Text(), "(default)") != 0) { fRequest.p4Arg( "-s" ); fRequest.p4Arg( jobstatus->Text() ); } fRequest.p4Arg( "-c" ); fRequest.p4Arg( fRequest.GetURL().Text() ); char *job = strtok( jobs->Text(), " " ); while( job != NULL ) { fRequest.p4Arg( job ); job = strtok( NULL, " " ); } fRequest.p4( "fix", 0, 0, &fixedPane ); 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/p4wDescribeView.cpp | |||||
#1 | 8914 | Matt Attaway | Initial add of the P4Web source code |