// // Copyright 2002 Perforce Software. All rights reserved. // // This file is part of Perforce - the FAST SCM System. // // p4wShowHideColsPane: // Pane for indicating which path browser columns to show and to hide. #include <p4wp4.h> #include "p4wStrBuf.h" #include "p4wHtml.h" #include "p4wSpecPane.h" #include "p4wShowHideColsPane.h" #include "p4wFilePane.h" p4wShowHideColsPane::p4wShowHideColsPane( p4wView & ParentView, p4wRequest & Request ) : p4wSpecPane( ParentView, Request, 1 ), fShowHideCols(0) { } p4wShowHideColsPane::~p4wShowHideColsPane() { } void p4wShowHideColsPane::RenderShowHide() { // // Fetch and build the ACTION value. StrBuf actionURL; GetAction( actionURL ); p4wHtml htm; p4wURL urlMaker; StrBuf title; StrBuf grayIcon; StrBuf clearIcon; AllCommands lac = fRequest.GetLastReturnType(); StrBuf path; StrBuf newBase; StrBuf deleteURL; urlMaker.ConstructURL( grayIcon, "/grayPixelIcon", AC_ICON, NULL ); urlMaker.ConstructURL( clearIcon, "/clearpixelIcon", AC_ICON, NULL ); const StrPtr *hd = fRequest.GetStateArg( "hd" ); if (hd) { fShowHideCols = atoi(hd->Text()); if (fRequest.GetBrowseMode()) { if ((fShowHideCols & HIDE_OTHERACTION) && (fShowHideCols & HIDE_OTHERUSER) && (fShowHideCols & HIDE_OTHERCLIENT)) fShowHideCols |= HIDE_OTHERCHG; } int coMingle = fRequest.GetBrowseMode(); if (coMingle) { if (fShowHideCols & HIDE_OTHERCHG) fShowHideCols |= HIDE_YOURCHG; else if (fShowHideCols & HIDE_YOURCHG) fShowHideCols |= HIDE_OTHERCHG; if (fShowHideCols & HIDE_OTHERACTION) fShowHideCols |= HIDE_YOURACTION; else if (fShowHideCols & HIDE_YOURACTION) fShowHideCols |= HIDE_OTHERACTION; } } path.Set( fRequest.GetReturnURL( lac ).Text() ); // // Begin the pane. htm.comment( "BEGIN SHOW/HIDE COLS PANE" ); htm.beginForm( actionURL.Text() ); // // Generate title with line underneath htm.beginTRow(); htm.beginCol(); title.Set("Show Detailed Listview Columns:"); htm.beginSpan( "title" ); htm << title; htm.endSpan(); htm.endCol(); htm.endTRow(); htm.beginTRow(); htm.beginCol( "top" ); htm.icon( grayIcon.Text(), "1", "100%", "", 1, "0", "0" ); htm.endCol(); htm.endTRow(); // // Start the table htm.beginTRow(); htm.beginCol(); htm.icon( clearIcon.Text(), "20", "0", "", 1 ); htm.endCol(); htm.endTRow(); htm.beginTRow(); htm.beginCol(); htm.beginTable( "0", "100%", "0", "1", "#7F7F7F" ); htm.beginTRow( NULL, NULL, "#FFFFFF" ); htm.beginCol(); htm.beginTable( "0", "100%", "0", "0", "#FFFFFF" ); htm.beginTRow(0, "left", "#EEEEEE"); htm.beginColHead(0,0,0,0,0,"1"); htm << " "; htm.endColHead(); htm.beginColHead(); htm << "Name"; htm.endColHead(); htm.beginColHead(0,0,0,0,0,"1"); htm << " "; htm.endColHead(); htm.beginColHead(0,0,0,0,0,"1"); htm.icon( clearIcon.Text(), "1", "1", "", 1 ); htm.endColHead(); htm.beginColHead(0,0,0,0,0,"1"); htm << " "; htm.endColHead(); htm.beginColHead(0,0,0,0,0,0,0,1); htm << "Head Rev Size"; htm.endColHead(); htm.beginColHead(0,0,0,0,0,"1"); htm << " "; htm.endColHead(); htm.beginColHead(0,0,0,0,0,"1"); htm.icon( clearIcon.Text(), "1", "1", "", 1 ); htm.endColHead(); htm.beginColHead(0,0,0,0,0,"1"); htm << " "; htm.endColHead(); htm.beginColHead(0,0,0,0,0,0,0,1); htm << "Last Submitted Change"; htm.endColHead(); if (!fRequest.GetBrowseMode()) { htm.beginColHead(0,0,0,0,0,"1"); htm << " "; htm.endColHead(); htm.beginColHead(0,0,0,0,0,"1"); htm.icon( clearIcon.Text(), "1", "1", "", 1 ); htm.endColHead(); htm.beginColHead(0,0,0,0,0,"1"); htm << " "; htm.endColHead(); htm.beginColHead(); htm << "Your Pending Changes"; htm.endColHead(); } htm.beginColHead(0,0,0,0,0,"1"); htm << " "; htm.endColHead(); htm.beginColHead(0,0,0,0,0,"1"); htm.icon( clearIcon.Text(), "1", "1", "", 1 ); htm.endColHead(); htm.beginColHead(0,0,0,0,0,"1"); htm << " "; htm.endColHead(); htm.beginColHead(0,0,0,0,0,0,0,1); if (!fRequest.GetBrowseMode()) htm << "Other Clients' "; htm << "Pending Changes"; htm.endTRow(); htm.beginTRow("top"); htm.beginCol("top", 0, "100%" ); htm.icon( grayIcon.Text(), "1", "100%", "", 1, "0", "0" ); htm.endCol(); htm.endTRow(); htm.beginTRow("top"); htm.beginCol(); htm.endCol(); htm.beginCol(0, 0, 0, 0, 0, 0, 0, 1); if (fShowHideCols & HIDE_REV) htm.checkbox( "shRev", "y", 0 ); else htm.checkbox( "shRev", "y", 1 ); htm.label( "Revision numbers", "shRev" ); htm.linebreak(); if (fShowHideCols & HIDE_TYPE) htm.checkbox( "shType", "y", 0 ); else htm.checkbox( "shType", "y", 1 ); htm.label( "File type", "shType" ); htm.linebreak(); if (fShowHideCols & HIDE_NEWTYPE) htm.checkbox( "shNewType", "y", 0 ); else htm.checkbox( "shNewType", "y", 1 ); htm.label( "New file type", "shNewType" ); htm.linebreak(); if (fShowHideCols & HIDE_OTHEROPEN) htm.checkbox( "shOtherOpen", "y", 0 ); else htm.checkbox( "shOtherOpen", "y", 1 ); htm.label( "Also opend by", "shOtherOpen" ); htm.linebreak(); htm.endCol(); htm.beginCol(); htm.endCol(); htm.beginCol(0,0,0,0,"#7F7F7F"); htm.endCol(); htm.beginCol(); htm.endCol(); htm.beginCol(0, 0, 0, 0, 0, 0, 0, 1); if (fShowHideCols & HIDE_SIZE) htm.checkbox( "shSize", "y", 0 ); else htm.checkbox( "shSize", "y", 1 ); htm.label( "Head rev size", "shSize" ); htm.linebreak(); htm.endCol(); htm.beginCol(); htm.endCol(); htm.beginCol(0,0,0,0,"#7F7F7F"); htm.endCol(); htm.beginCol(); htm.endCol(); htm.beginCol(0, 0, 0, 0, 0, 0, 0, 1); if (fShowHideCols & HIDE_CHG) htm.checkbox( "shChg", "y", 0 ); else htm.checkbox( "shChg", "y", 1 ); htm.label( "Last submitted changelist", "shChg" ); htm.linebreak(); if (fShowHideCols & HIDE_ACTION) htm.checkbox( "shAction", "y", 0 ); else htm.checkbox( "shAction", "y", 1 ); htm.label( "Last submitted action", "shAction" ); htm.linebreak(); if (fShowHideCols & HIDE_DATE) htm.checkbox( "shDate", "y", 0 ); else htm.checkbox( "shDate", "y", 1 ); htm.label( "Date of last submit", "shDate" ); htm.linebreak(); if (fShowHideCols & HIDE_TIME) htm.checkbox( "shTime", "y", 0 ); else htm.checkbox( "shTime", "y", 1 ); htm.label( "Time of last submit", "shTime" ); htm.linebreak(); htm.endCol(); if (!fRequest.GetBrowseMode()) { htm.beginCol(); htm.endCol(); htm.beginCol(0,0,0,0,"#7F7F7F"); htm.endCol(); htm.beginCol(); htm.endCol(); htm.beginCol(0, 0, 0, 0, 0, 0, 0, 1); if (fShowHideCols & HIDE_YOURCHG) htm.checkbox( "shYourChg", "y", 0 ); else htm.checkbox( "shYourChg", "y", 1 ); htm.label( "Your pending changelist", "shYourChg" ); htm.linebreak(); if (fShowHideCols & HIDE_YOURACTION) htm.checkbox( "shYourAction", "y", 0 ); else htm.checkbox( "shYourAction", "y", 1 ); htm.label( "Your pending action", "shYourAction" ); htm.linebreak(); htm.endCol(); } else { if (fShowHideCols & HIDE_YOURCHG) htm.hiddenField( "shYourChg", "y" ); if (fShowHideCols & HIDE_YOURACTION) htm.hiddenField( "shYourAction", "y" ); } htm.beginCol(); htm.endCol(); htm.beginCol(0,0,0,0,"#7F7F7F"); htm.endCol(); htm.beginCol(); htm.endCol(); htm.beginCol(0, 0, 0, 0, 0, 0, 0, 1); if (!fRequest.GetBrowseMode()) { if (fShowHideCols & HIDE_OTHERCHG) htm.checkbox( "shOtherChg", "y", 0 ); else htm.checkbox( "shOtherChg", "y", 1 ); htm.label( fRequest.GetBrowseMode() ? "Pending changelists" : "Other pending changelists", "shOtherChg" ); htm.linebreak(); } else { if (fShowHideCols & HIDE_OTHERCHG) htm.hiddenField( "shOtherChg", "y" ); } if (fShowHideCols & HIDE_OTHERACTION) htm.checkbox( "shOtherAction", "y", 0 ); else htm.checkbox( "shOtherAction", "y", 1 ); htm.label( fRequest.GetBrowseMode() ? "Pending actions" : "Other pending actions", "shOtherAction" ); htm.linebreak(); if (fShowHideCols & HIDE_OTHERUSER) htm.checkbox( "shOtherUser", "y", 0 ); else htm.checkbox( "shOtherUser", "y", 1 ); htm.label( fRequest.GetBrowseMode() ? "Users" : "Other users", "shOtherUser" ); htm.linebreak(); if (fShowHideCols & HIDE_OTHERCLIENT) htm.checkbox( "shOtherClient", "y", 0 ); else htm.checkbox( "shOtherClient", "y", 1 ); htm.label( fRequest.GetBrowseMode() ? "Clients" : "Other clients", "shOtherClient" ); htm.linebreak(); htm.endCol(); htm.endTRow(); htm.endCol(); htm.endTRow(); htm.endTable(); htm.endCol(); htm.endTRow(); htm.endTable(); htm.beginTRow(); htm.beginCol(); htm.icon( clearIcon.Text(), "10", "0", "", 1 ); htm.endCol(); htm.endTRow(); htm.beginTRow(); htm.beginCol(0, "center", "100%"); fRequest << htm; // // Generate the buttons DoSubmit(); // // End the pane. htm.Clear(); htm.endCol(); htm.endTRow(); htm << "<script language=javascript>" << crlf; htm << "document.write(\"<Input type=hidden name='javascript' value='1'>\")"; htm << crlf << "</script>" << crlf; htm.endForm(); htm.comment( "END SHOW/HIDE COLS PANE" ); fRequest << htm; } void p4wShowHideColsPane::GetAction( StrBuf & actionURL ) { // // Constructs url used for the form ACTION value ConstructAction( AC_SHOWHIDECOLSPROC, NULL, 1, actionURL ); } void p4wShowHideColsPane::DoSubmit() { // // Generate the Submit and Clear and Canel buttons p4wHtml htm; htm.button( "showhidecols", " OK " ); htm << " "; htm.reset( "Reset" ); htm << " "; htm.button( "pathbrowser", "Cancel" ); 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 |