// Copyright 1999 (c) by Perforce Software, Inc. All rights reserved. // // p4wUpdatePane: // The update pane. #include <p4wp4.h> #include "p4wStrBuf.h" #include "p4wHtml.h" #include "changeshelper.h" #include "p4wPane.h" #include "p4wUpdatePane.h" p4wUpdatePane::p4wUpdatePane(p4wView & ParentView, p4wRequest & Request, StrPtr & path) : p4wPane(ParentView, Request) { // // Request the last NUM_RECENT_CHANGES_RESULTS changelists. If // state sr is set, append the sr to the path const StrPtr *sr = fRequest.GetStateArg( "sr" ); StrBuf finalPath; finalPath << path; if( sr ) finalPath << "@" << sr; depotRange = new ChangesHelper( fRequest.GetClientApi(), finalPath, NUM_RECENT_CHANGES_RESULTS ); } p4wUpdatePane::~p4wUpdatePane() { delete depotRange; } void p4wUpdatePane::DrawPane() { // // Begin the pane. p4wHtml htm( 1 ); // // Don't draw anything if we don't have any results if( !depotRange->TotalResults() ) return; htm.comment( "BEGIN UPDATE PANE" ); // // Send the recent activity bar if (!(fRequest.GetScreenChunks() & SCRN_HEADER)) { htm.beginTable(0,0,"0","0"); } if (!(fRequest.GetScreenChunks() & SCRN_TABS)) { htm.beginTable(0,0,"0","0"); htm.beginTRow(); htm.beginCol(0,0,"100%"); } htm.beginTRow( NULL, NULL, "#FDE8B0" ); // // Output changes in reverse order p4wURL urlMaker; for ( int i = depotRange->TotalResults() - 1; i > -1; i-- ) { // // Build the change URL p4wStrBuf changeURL; StrBuf newBase; int changeNumber = depotRange->ChangeNumber( i ); if ( changeNumber != -1 ) { // // Truncate base path for the describe link to / fRequest.UseNewBase( newBase, NULL, "path", NULL ); newBase << changeNumber; urlMaker.ConstructURL( changeURL, newBase.Text(), AC_DESCRIBE, NULL, fRequest.GetUnicode() ); htm.beginCol( "top", NULL, NULL, NULL, NULL, NULL, NULL, 0, "recent_activity" ); StrDict * temp = depotRange->GetResult(i); if ( temp ) { htm.beginLink( changeURL.Text(), NULL, "nav_link" ); htm.text( p4wStrBuf().Expand( StrRef( "%change%" ), *temp, Unicode() ).Text() ); htm.endLink(); htm << " "; htm.text( p4wStrBuf().Expand( StrRef( "%time@*Y/*m/*d% " ), *temp, Unicode() ).Text() ); htm.beginSpan( NULL, "color: #A10000; font-weight: bold" ); htm.text( p4wStrBuf().Expand( StrRef( "%user%" ), *temp, Unicode() ).Text() ); htm.endSpan(); htm.text( p4wStrBuf().Expand( StrRef( " %desc%"), *temp, Unicode() ).Text() ); htm.endSpan(); } htm.endCol(); } } // // End the pane htm.endTRow(); if (!(fRequest.GetScreenChunks() & SCRN_TABS)) { htm.endCol(); htm.endTRow(); htm.endTable(); } if (!(fRequest.GetScreenChunks() & SCRN_HEADER)) { htm.endTable(); } // // End the pane. htm.comment( "END UPDATE PANE" ); fRequest << htm; }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 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. |
||
#1 | 8914 | Matt Attaway | Initial add of the P4Web source code |