// Copyright 1999 (c) by Perforce Software, Inc. All rights reserved. // // p4wSubmitView: // The submit view. // ------------------------------------- // Includes // #include <stdlib.h> #include <string.h> #include <p4wp4.h> #include "p4wView.h" #include "p4wMenuPane.h" #include "p4wSubmitView.h" #include "p4wChangePendingEditPane.h" // // ------------------------------------- // Constructors and destructor. // p4wSubmitView::p4wSubmitView(p4wRequest & Request) : p4wView(Request) { // // Set the short and the long versions of the title if( !fRequest.GetCmdArg() ) { fShortTitle.Set( "Pending Changelist" ); fFullTitle.Set( "Pending Changelist" ); return; } fShortTitle.Set( "Pending Changelist" ); fFullTitle << "Pending Changelist #" << fRequest.GetCmdArg(); } p4wSubmitView::~p4wSubmitView() { } // ------------------------------------- // Control item render functions. // void p4wSubmitView::RenderContent() { // // Send the submit pane. Issue change -o & opened commands to generate // data for the final submit form. int unchecked = 0; int redisplayButton = 1; StrBufDict specTable; Spec spec; if( fRequest.GetPostData() ) { spec.Add( "CheckOption" ); spec.Add( "File" ); spec.Add( "Files" ); spec.Add( "Path" ); spec.Add( "dirVal" ); fRequest.ProcessForm(spec, &specTable); // // If view originated from a form, user has // selected files checked or unchecked. In this // case we don't display the Redisplay using // checked/unchecked button on this form. StrPtr *uch = specTable.GetVar("CheckOption"); if( uch && *uch == "unchecked" ) unchecked = 1; redisplayButton = 0; } p4wChangePendingEditPane submitPane(*this, fRequest, 1, redisplayButton, unchecked); // If cmdArg is not set, this is a request for submitting default change if( !fRequest.GetCmdArg() ) { const char *changePaneArgs[] = { "-o" }; fRequest.p4("change", 1, changePaneArgs, &submitPane); fRequest.p4Wait(); if( submitPane.FatalError() ) return; // // Get the opened files with actions and revs. If we have post // data, we will use a path argument. Otherwise just get all opened // files for this changelist. fRequest.p4Arg( "-c" ); fRequest.p4Arg( "default" ); if( fRequest.GetPostData() ) { StrBuf fileArg; StrPtr *filechoice = specTable.GetVar( "Files" ); StrPtr *dirchoice = specTable.GetVar( "dirVal" ); StrPtr *path = specTable.GetVar( "Path" ); StrPtr *oneFile = specTable.GetVar( "File" ); if( filechoice ) { if( *filechoice == "in" && path ) { fileArg.Set( path ); if( dirchoice && *dirchoice == "and subdirectories" ) { fileArg << "..."; } else { fileArg << "*"; } fRequest.p4Arg( fileArg.Text() ); } else if( *filechoice == "file" && oneFile ) { fileArg.Set( oneFile ); fRequest.p4Arg( fileArg.Text() ); } } } fRequest.p4("opened", 0, 0, &submitPane); } else { const char *changePaneArgs[] = { "-o", fRequest.GetCmdArg()->Text() }; fRequest.p4("change", 2, changePaneArgs, &submitPane); fRequest.p4Wait(); if( submitPane.FatalError() ) return; // // Get the opened files with actions and revs const char *openedArgs[] = { "-c", fRequest.GetCmdArg()->Text() }; fRequest.p4("opened", 2, openedArgs, &submitPane); } // // Wait for the pane to draw. fRequest.p4Wait(); if( submitPane.FatalError() ) return; // // Request list of all changes (for "move to changelist" button) fRequest.p4Arg("-s"); fRequest.p4Arg("pending"); fRequest.p4("changes", 0, 0, &submitPane); // // Wait for the pane to draw. fRequest.p4Wait(); } void p4wSubmitView::RenderMenu() { // // Draw the menu bar p4wMenuPane menuPane(*this, fRequest, "editpending"); menuPane.Render(NULL); }
# | 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/p4wSubmitView.cpp | |||||
#1 | 8914 | Matt Attaway | Initial add of the P4Web source code |