// Copyright 1999 (c) by Perforce Software, Inc. All rights reserved. // // p4wErrorView: // The error view. #include <stdlib.h> #include <string.h> #include <p4wp4.h> #include "p4wStrBuf.h" #include "p4wHtml.h" #include "p4wView.h" #include "p4wHelpView.h" #include "p4wMenuPane.h" #include "p4wErrorView.h" p4wErrorView::p4wErrorView( p4wRequest &Request, const StrBuf &errorText, int blankPage, const char *helpType, const char *helpText ) : p4wView(Request), fErrorText(errorText), fBlankPage(blankPage) { // // Set the short and the long versions of the title fShortTitle.Set( "Error" ); fFullTitle.Set( "Error" ); if( helpType ) fHelpType.Set( helpType ); if( helpText ) fHelpText.Set( helpText ); fIsErrorPage = 1; } p4wErrorView::~p4wErrorView() { } void p4wErrorView::RenderContent() { // // Begin the content area. p4wHtml htm; htm.comment( "BEGIN ERROR CONTENT" ); // // Generate the error text. htm.beginTRow(); htm.beginCol(); htm.beginTable( "0", "100%", "0", "0" ); htm.beginTRow(); htm.beginCol( NULL, NULL, "3" ); htm.text( fErrorText.Text(), NULL, NULL, "red" ); // // End the content area and write out the error htm.comment( "END ERROR CONTENT" ); fRequest << htm; htm.Clear(); // // Display help text if appropriate, skipping the first line which // contains links. If the help text does not reference a help file, // just output the text as-is. if( fHelpText.Length() ) { const char *helpText = p4wHelpView::GetHelpText( &fHelpText ); if( helpText) { const char *skipLinks = strchr( helpText, '\n' ); fRequest << skipLinks + 1; } else { fRequest << fHelpText; } } htm.endCol(); htm.endTRow(); htm.endTable(); htm.endCol(); htm.endTRow(); fRequest << htm; } void p4wErrorView::RenderMenu() { // // Draw the menu bar unless blank page was requested StrBuf help; if( fHelpType.Length() ) help.Set( fHelpType.Text() ); else help.Set( "roadmap" ); if( !fBlankPage ) { p4wMenuPane menuPane(*this, fRequest, help.Text() ); menuPane.Render(NULL); } } void p4wErrorView::RenderInfo() { // // Render the Info pane unless blank page was requested if( !fBlankPage ) p4wView::RenderInfo(); } void p4wErrorView::RenderCopyright() { // // Render copyright info unless this is supposed to be a blank // page if( !fBlankPage ) p4wView::RenderCopyright(); }
# | 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/Views/p4wErrorView.cpp | |||||
#1 | 8914 | Matt Attaway | Initial add of the P4Web source code |