// // Copyright 2001 Perforce Software. All rights reserved. // // This file is part of Perforce - the FAST SCM System. // // p4wLabelReplacePane:: // Generates form to replace contents of a label #include <p4wp4.h> #include "p4wStrBuf.h" #include "p4wHtml.h" #include "p4wLabelReplacePane.h" // // Options for labelsync static char *const cmdOpts[] = { "default", "add", "remove" }; static char *const cmdOptsText[] = { "Replace label contents completely", "Add files to label", "Remove files from label" }; const int nOpts = 3; // // Options for labelsync revision static char *const revOpts[] = { "default", "head", "at" }; static char *const revOptsText[] = { "Workspace Revision", "Head Revision", "Label, Changelist or Date" }; const int nRevs = 3; p4wLabelReplacePane::p4wLabelReplacePane( p4wView & ParentView, p4wRequest & Request ) : p4wRunPane( ParentView, Request ) { } p4wLabelReplacePane::~p4wLabelReplacePane() { } void p4wLabelReplacePane::Render( StrDict * varList ) { // // Render form to completely replace, add or delete files // to/from a label StrBuf actionURL; GetAction( actionURL ); // // Begin the pane and start the form p4wHtml htm; StrBuf title; AllCommands ac = fRequest.GetLastReturnType(); StrBuf path; title << "Add/Replace Files for " << p4wStrBuf().EscapeHTML( fRequest.GetURL(), Unicode() ).Text() << ":"; DoComment( "BEGIN LABELREPLACE PANE" ); path.Set( fRequest.GetReturnURL( ac ).Text() ); BeginForm( title.Text(), actionURL, path.Text() ); // // Generate the Revision section htm.beginTRow(); htm.beginCol( "top" ); htm.beginSpan( "label" ); htm << "Revision:"; htm.endSpan(); htm.endCol(); fRequest << htm; htm.Clear(); int ck = 0; int newCol; for( int r = 0; r < nRevs; r++ ) { newCol = ( r != 0 ); ck = ( r == 0 ? 1 : 0 ); DoRadio( newCol, ck, "Option", revOpts[r], revOptsText[r], 0, 0, revOpts[r] ); if( r == 2 ) DoText( "atVal", NULL, 20, 1, "setCheckedValue(document.forms['Run'].elements['Option'], 'at')" ); } // // Generate the Options section StrBuf clearIcon; p4wURL urlMaker; urlMaker.ConstructURL( clearIcon, "/clearpixelIcon", AC_ICON, NULL ); htm.beginTRow(); htm.beginCol(); htm.icon( clearIcon.Text(), "20", "0", "", 1 ); htm.endCol(); htm.endTRow(); fRequest << htm; htm.Clear(); BeginOptions(); for( int opt = 0; opt < nOpts; opt++ ) { newCol = ( opt != 0 ); ck = ( opt == 0 ? 1 : 0 ); DoRadio( newCol, ck, "OptionLS", cmdOpts[opt], cmdOptsText[opt], 0, 0, cmdOptsText[opt] ); } // // Generate the Files portion. Default is "Files in this list". BeginFiles( fRequest.GetReturnURL( AC_PATHBROWSER ) ); // // Files in current directory/subdirectories options should // not be presented when path is at the top level. if( fRequest.GetReturnURL( AC_PATHBROWSER ) != "//" ) FilesIn( 1, 0, fRequest.GetReturnURL( AC_PATHBROWSER ).Text(), "All files in label view", 1 ); else DoRadio( 0, 0, "Files", "all", "All files in label view", 0, 0, "Filesall" ); DoRadio( 1, 1, "Files", "selected", "Files in this list (full path name required)", 1, 0, "Filesselected" ); htm.beginTRow(); htm.beginCol(); htm.endCol(); htm.beginCol(); htm.endCol(); htm.beginCol(); htm.beginTextbox( "File", 10, 40, "setCheckedValue(document.forms['Run'].elements['Files'], 'selected')" ); htm.endTextbox(); htm.linebreak(); fRequest << htm; StrBuf txt; txt.Set( " to see the list of files currently in label \"" ); txt << p4wStrBuf().EscapeHTML( fRequest.GetURL(), Unicode() ).Text() << "\"."; OutputHREF( "Click ", fRequest.GetURL().Text(), AC_LABELFILES, NULL, "here", txt.Text() ); fRequest << crlf; // // End the pane. htm.endCol(); htm.endTRow(); BeginButtons(); DoHidden( 0, "formActions", "preview" ); DoHidden( 0, "formActions", "labelsync" ); // // Generate preview and labelsync buttons DoButton( "preview", "Preview Add/Replace" ); DoButton( "labelsync", "Add/Replace" ); EndButtons(); EndForm(); DoComment( "END LABELREPLACE PANE" ); } void p4wLabelReplacePane::GetAction( StrBuf & actionURL ) { // // Constructs url used for the form ACTION value ConstructAction( AC_LABSYNCPROCESSOR, NULL, 1, actionURL ); }
# | 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/Panes/p4wLabelReplacePane.cpp | |||||
#1 | 8914 | Matt Attaway | Initial add of the P4Web source code |