// Copyright 1999 (c) by Perforce Software, Inc. All rights reserved. // // p4wInfoPane: // The info pane. // ------------------------------------- // Includes // #include <p4wp4.h> #include "p4wHtml.h" #include "p4wPane.h" #include "p4wMenuPane.h" #include "p4wInfoPane.h" #include "p4wPasswdTestPane.h" #include "p4wStrBuf.h" // ------------------------------------- // Constructors and destructor. // p4wInfoPane::p4wInfoPane(p4wView & ParentView, p4wRequest & Request) : p4wPane(ParentView, Request) { } p4wInfoPane::~p4wInfoPane() { } // ------------------------------------- // Render this pane. // void p4wInfoPane::Render(StrDict * varList) { if (!(fRequest.GetScreenChunks() & (SCRN_LOGO + SCRN_HEADER))) return; p4wHtml htm; p4wURL urlMaker; StrBuf clientUrl; StrBuf portUrl; StrBuf userUrl; StrBuf icon; StrBuf base; StrBuf userBase; StrBuf clientBase; StrBuf actionURL; GetAction( actionURL ); // // Begin the pane. htm.comment( "BEGIN INFO PANE" ); // // Begin the nested tables htm.beginTable( "0", "100%", "0", "1" ); htm.beginTRow(); htm.beginCol(); htm.beginTable( "0", "100%", "0", "1", (fRequest.GetScreenChunks() & SCRN_TOOLBAR) ? "#7F7F7F" : "#FFFFFF" ); htm.beginTRow(); if( !fRequest.HideRecentChanges() ) htm.beginCol( NULL, NULL, "5" ); else if( !fRequest.HideRawP4Cmds() ) htm.beginCol( NULL, NULL, "5" ); else if( !fRequest.HideGoTo() ) htm.beginCol( NULL, NULL, "5" ); else htm.beginCol(); htm.beginTable( "0", "100%", "0", "0", 0, "fHeader" ); // // Generate custom header if there is one const StrPtr *ptr = fRequest.GetCustHeader(); if (ptr && ptr->Length()) { fRequest << htm; fRequest.WriteCustHTML(ptr->Text()); htm.Clear(); } // // Generate the log with the title htm.beginTRow(); ptr = fRequest.GetCustGraphic(); if (ptr && ptr->Length()) { htm.beginCol( "middle", NULL, NULL, "2" ); if (strncmp(ptr->Text(), "http", 4)) urlMaker.ConstructURL( icon, ptr->Text(), AC_ICON, NULL ); else icon << ptr; htm.icon( icon.Text(), 0, 0, "Logo", 1, "0" ); } else { htm.beginCol( "middle", NULL, NULL, "2", 0, 0, 0, 0, "logo" ); if( fRequest.GetMultiUser() ) urlMaker.ConstructURL( icon, "/logomultiIcon", AC_ICON, NULL ); else if( !fRequest.GetBrowseMode() ) urlMaker.ConstructURL( icon, "/logoproIcon", AC_ICON, NULL ); else urlMaker.ConstructURL( icon, "/logoviewerIcon", AC_ICON, NULL ); htm.icon( icon.Text(), "46", "114", "", 1, "0" ); } htm.endCol(); if (!(fRequest.GetScreenChunks() & SCRN_HEADER)) { htm.endTRow(); htm.endTable(); htm.comment( "END INFO PANE" ); fRequest << htm; return; } // // Show the port as a link to the connection info fRequest.UseNewBase( base, NULL, "path", "//" ); urlMaker.ConstructURL( portUrl, base.Text(), AC_ABOUT, NULL, fRequest.GetUnicode() ); htm.beginCol(0,0,0,0,0,0,0,0,"statusLabel"); htm.text( "Server:" ); htm.endCol(); htm.beginCol( NULL, NULL, NULL, NULL, NULL, "100%" ); htm.beginTable( "0", NULL, NULL, "0" ); htm.beginTRow(); htm.beginCol(0,0,0,0,0,0,0,0,"connectionField"); if (fRequest.GetCmd() != AC_SHOWHIDECOLUMNS) htm.beginLink( portUrl.Text(), NULL, "status" ); htm.text( p4wStrBuf().EscapeHTML(fRequest.GetPort(), Unicode()).Text() ); if (fRequest.GetCmd() != AC_SHOWHIDECOLUMNS) htm.endLink(); htm.endCol(); // // Show the user as a link to edit user unless this is // browse only mode if( !fRequest.GetBrowseMode() ) { fRequest.UseNewBase( base, NULL, "path", NULL ); userBase << base << fRequest.GetUser(); urlMaker.ConstructURL( userUrl, userBase.Text(), AC_EDITUSER, NULL, fRequest.GetUnicode() ); htm.beginCol(0,0,0,0,0,0,0,0,"statusLabel"); htm.text( "User:" ); htm.beginCol(0,0,0,0,0,0,0,0,"connectionField"); if (fRequest.GetCmd() != AC_SHOWHIDECOLUMNS) htm.beginLink( userUrl.Text(), NULL, "status" ); htm.text( p4wStrBuf().EscapeHTML(fRequest.GetUser(), Unicode()).Text() ); if (fRequest.GetCmd() != AC_SHOWHIDECOLUMNS) htm.endLink(); htm.endCol(); } // // Show the client as a link to edit the client. If this // is viewer mode, this will not be a link. clientBase << base << fRequest.GetClient(); urlMaker.ConstructURL( clientUrl, clientBase.Text(), AC_EDITCLIENT, NULL, fRequest.GetUnicode() ); htm.beginCol(0,0,0,0,0,0,0,0,"statusLabel"); htm.text( "Client:" ); htm.beginCol(0,0,0,0,0,0,0,0,"connectionField"); if( !fRequest.GetBrowseMode() && fRequest.GetCmd() != AC_SHOWHIDECOLUMNS ) { htm.beginLink( clientUrl.Text(), NULL, "status" ); htm.text( p4wStrBuf().EscapeHTML(fRequest.GetClient(), Unicode()).Text() ); htm.endLink(); } else { htm.text( p4wStrBuf().EscapeHTML(fRequest.GetClient(), Unicode()).Text() ); } htm.endCol(); htm.endTRow(); htm.endTable(); htm.endCol(); htm.endTRow(); // // Next row has a text box for the Goto Path command AllCommands ac = fRequest.GetLastReturnType(); StrBuf path; path.Set( fRequest.GetReturnURL( ac ).Text() ); htm.beginTRow(); AllCommands cmd = fRequest.GetCmd(); if (fRequest.GetScreenChunks() & SCRN_PATH) { htm.beginCol(0,0,0,0,0,0,0,0,"statusPath"); htm.text( "Path:" ); htm.endCol(); htm.beginForm( actionURL.Text() ); htm.beginCol(0,0,0,0,0,0,0,0,"pathField"); if (cmd == AC_DIFFWVC || cmd == AC_DIFFCVH || cmd == AC_DIFFWVH || cmd == AC_DIFFRVW || cmd == AC_DIFF2 || cmd == AC_DIFF21 || cmd == AC_DIFF22) htm.textField( "goField", p4wStrBuf().EscapeHTML( path, Unicode() ).Text(), 92, 0, 0, "document.getElementById('nextprev').checked=false", "document.getElementById('nextprev').checked=true" ); else htm.textField( "goField", p4wStrBuf().EscapeHTML( path, Unicode() ).Text(), 92 ); htm.text( " " ); htm.button( "Go", "Go" ); htm.endCol(); htm.endForm(); } else { htm.beginCol(); htm << " "; htm.endCol(); } htm.endTRow(); // // Generate custom subheader if there is one ptr = fRequest.GetCustSubheader(); if (ptr && ptr->Length()) { fRequest << htm; fRequest.WriteCustHTML(ptr->Text()); htm.Clear(); } htm.endTable(); // // End the pane. htm.comment( "END INFO PANE" ); fRequest << htm; } void p4wInfoPane::GetAction( StrBuf & actionURL ) { // // Constructs url used for the form ACTION value StrBuf path; // // Determine the path part of the action. if( fRequest.GetViewMode() == VM_WORKSPACE ) { fRequest.UseNewBase( path, NULL, "path", fRequest.GetPath().Text() ); } else { path << fRequest.GetURL(); } fRequest.ConstructSafeURL( actionURL, path.Text(), AC_GOTO, 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/Panes/p4wInfoPane.cpp | |||||
#1 | 8914 | Matt Attaway | Initial add of the P4Web source code |