// // Copyright 2007 Perforce Software. All rights reserved. // // This file is part of Perforce - the FAST SCM System. // // p4wDescribeDefaultPane: // generates a default changelist by parsing p4 opened -C <client> -c default #include <p4wp4.h> #include "p4wStrBuf.h" #include "p4wHtml.h" #include "p4wPane.h" #include "p4wDescribeDefaultPane.h" p4wDescribeDefaultPane::p4wDescribeDefaultPane( p4wView & ParentView, p4wRequest & Request ) : p4wPane( ParentView, Request ), fSeenData(0), fError(0) { } p4wDescribeDefaultPane::~p4wDescribeDefaultPane() { } void p4wDescribeDefaultPane::Begin() { // // Begin the pane. p4wHtml htm; p4wURL urlMaker; StrBuf grayIcon; StrBuf clearIcon; // // Used to generate line & vertical white space urlMaker.ConstructURL( grayIcon, "/grayPixelIcon", AC_ICON, NULL ); urlMaker.ConstructURL( clearIcon, "/clearpixelIcon", AC_ICON, NULL ); htm.comment( "BEGIN DESCRIBE PANE" ); if (fRequest.GetScreenChunks() & SCRN_TITLE) { // // Generate title with line underneath htm.beginTRow(); htm.beginCol(); htm.beginSpan( "title" ); htm << "Changelist:"; htm.endSpan(); htm.endCol(); htm.endTRow(); htm.beginTRow(); htm.beginCol( "top" ); htm.icon( grayIcon.Text(), "1", "100%", "", 1, "0", "0" ); htm.endCol(); htm.endTRow(); // // Some vertical white space htm.beginTRow(); htm.beginCol(); htm.icon( clearIcon.Text(), "15", "0", "", 1 ); htm.endCol(); htm.endTRow(); } htm.beginTRow(); htm.beginCol(); htm.beginTable( "0" ); fRequest << htm; } void p4wDescribeDefaultPane::Render( StrDict * varList ) { const StrPtr *user = varList->GetVar( "user" ); if (!user || strcmp(user->Text(), fUser.Text())) return; p4wHtml htm; const StrPtr *depotFile = varList->GetVar( "depotFile" ); const StrPtr *client = varList->GetVar( "client" ); const StrPtr *action = varList->GetVar( "action" ); const StrPtr *rev = varList->GetVar( "rev" ); const StrPtr *type = varList->GetVar( "type" ); if (!fSeenData) { fSeenData = 1; htm.beginTRow(); htm.beginCol(); htm.text( "Change:", "b" ); htm.endCol(); htm.beginCol(); htm << "Default"; htm.endCol(); htm.endTRow(); htm.beginTRow(); htm.beginCol(); htm.text( "Client:", "b" ); htm.endCol(); htm.beginCol(); htm.text( p4wStrBuf().Expand( StrRef( "%client%" ), *varList, Unicode() ).Text() ); htm.endCol(); htm.endTRow(); htm.beginTRow(); htm.beginCol(); htm.text( "User:", "b" ); htm.endCol(); htm.beginCol(); htm.text( p4wStrBuf().Expand( StrRef( "%user%" ), *varList, Unicode() ).Text() ); htm.endCol(); htm.endTRow(); htm.beginTRow(); htm.beginCol( "top", NULL, NULL, NULL, NULL, NULL, NULL, 1 ); htm.text( "Files:", "b" ); htm.endCol(); htm.beginCol( NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1 ); } else { htm.beginTRow(); htm.beginCol( "top", NULL, NULL, NULL, NULL, NULL, NULL, 1 ); htm.endCol(); htm.beginCol( NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1 ); } p4wURL urlMaker; StrBuf clearIcon; StrBuf url; StrBuf newBase; urlMaker.ConstructURL( clearIcon, "/clearpixelIcon", AC_ICON, NULL ); // // If page content limit in bytes has been exceeded, don't // generate this entry if( PageLimitExceeded() ) return; // Prepare the file browser url fRequest.UseNewBase( newBase, NULL, "md", "d" ); fRequest.UseNewBase( newBase, newBase.Text(), "cd", "//" ); fRequest.UseNewBase( newBase, newBase.Text(), "wr", NULL ); fRequest.UseNewBase( newBase, newBase.Text(), "path", depotFile->Text() ); urlMaker.ConstructURL( url, newBase.Text(), AC_BROWSEFILE, NULL, fRequest.GetUnicode() ); // Output this entry & url htm.beginLink( url.Text() ); htm.text( depotFile->Text() ); htm.endLink(); htm << "#" << rev << " " << action; htm.linebreak(); htm.endCol(); htm.endTRow(); fRequest << htm; } void p4wDescribeDefaultPane::RenderError( char *data, int escapeHTML ) { if( fSeenData ) return; fErrMsg << data << " "; fError = 1; } void p4wDescribeDefaultPane::End() { p4wHtml htm; htm.endTable(); htm.endCol(); htm.endTRow(); htm.comment( "END DESCRIBE PANE" ); fRequest << htm; }
# | 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/p4wDescribeDefaultPane.cpp | |||||
#1 | 8914 | Matt Attaway | Initial add of the P4Web source code |