// Implementation of ClientChangeUser.
#include <clientapi.h>
#include <qapplication.h>
#include <qmessagebox.h>
#include "clientchangeuser.h"
ClientChangeUser::ClientChangeUser()
: desc( StrBuf() )
{
}
ClientChangeUser::~ClientChangeUser()
{
}
// Spit errors straight to a QMessageBox.
void ClientChangeUser::HandleError( Error* err )
{
StrBuf msg;
err->Fmt( &msg );
QMessageBox::warning
(
qApp->activeWindow(),
"P4QTree Warning",
msg.Text(),
QMessageBox::Ok,
QMessageBox::NoButton,
QMessageBox::NoButton
);
}
// This only gets called on file names. Make 'em bold.
void ClientChangeUser::OutputInfo(char level, const_char* data)
{
desc.Append( "... <b>" );
desc.Append( data );
desc.Append( "</b><br>" );
}
// Convert newlines to <br> tags.
void ClientChangeUser::OutputText( const_char* data, int length )
{
for ( char* ptr = data; *ptr; ptr++ )
{
if ( *ptr == '\n' ) desc.Append( "<br>" );
else desc.Append( ptr, 1 );
}
}