parent
876322c3e1
commit
b68670700b
|
@ -8,6 +8,7 @@ TextBrowser::TextBrowser()
|
|||
}
|
||||
|
||||
|
||||
// getters
|
||||
bool TextBrowser::getWideLinesUsage() const
|
||||
{
|
||||
return this->wide_lines;
|
||||
|
@ -65,3 +66,108 @@ void TextBrowser::setFont( const QFont& font )
|
|||
{
|
||||
this->font = font;
|
||||
}
|
||||
|
||||
|
||||
// preview
|
||||
void TextBrowser::makePreview( QString& content )
|
||||
{
|
||||
content += QString("<!DOCTYPE html><html><head></head><body");
|
||||
if ( this->color_scheme_id > 0 ) {
|
||||
content += QString(" style=\"background:%1; color:%2\"")
|
||||
.arg( this->color_scheme.at("background"),
|
||||
this->color_scheme.at("text") );
|
||||
}
|
||||
content += ">";
|
||||
if ( wide_lines == true ) {
|
||||
content += "<br/>";
|
||||
}
|
||||
for ( int i=0; i<32; i++ ) {
|
||||
content += "<p>";
|
||||
|
||||
content += "<b>";
|
||||
if ( this->color_scheme_id > 0 ) {
|
||||
content += QString("<span style=\"color:%1\">").arg( this->color_scheme.at("time") );
|
||||
}
|
||||
content += "2000-01-01 23:59:59";
|
||||
if ( this->color_scheme_id > 0 ) {
|
||||
content += "</span>";
|
||||
}
|
||||
content += "</b>";
|
||||
|
||||
content += " <b>";
|
||||
if ( this->color_scheme_id > 0 ) {
|
||||
content += QString("<span style=\"color:%1\">").arg( this->color_scheme.at("req_err") );
|
||||
}
|
||||
content += "HTTP/1.1 GET /index.php query=x";
|
||||
if ( this->color_scheme_id > 0 ) {
|
||||
content += "</span>";
|
||||
}
|
||||
content += "</b>";
|
||||
|
||||
content += " <b>";
|
||||
if ( this->color_scheme_id > 0 ) {
|
||||
content += QString("<span style=\"color:%1\">").arg( this->color_scheme.at("res_lev") );
|
||||
}
|
||||
content += "404</b>";
|
||||
if ( this->color_scheme_id > 0 ) {
|
||||
content += "</span>";
|
||||
}
|
||||
content += "</b>";
|
||||
|
||||
content += " <b>";
|
||||
if ( this->color_scheme_id > 0 ) {
|
||||
content += QString("<span style=\"color:%1\">").arg( this->color_scheme.at("x") );
|
||||
}
|
||||
content += "123 1234 1000";
|
||||
if ( this->color_scheme_id > 0 ) {
|
||||
content += "</span>";
|
||||
}
|
||||
content += "</b>";
|
||||
|
||||
content += " \"<b>";
|
||||
if ( this->color_scheme_id > 0 ) {
|
||||
content += QString("<span style=\"color:%1\">").arg( this->color_scheme.at("x") );
|
||||
}
|
||||
content += "http://www.referrer.site";
|
||||
if ( this->color_scheme_id > 0 ) {
|
||||
content += "</span>";
|
||||
}
|
||||
content += "</b>\"";
|
||||
|
||||
content += " \"<b>";
|
||||
if ( this->color_scheme_id > 0 ) {
|
||||
content += QString("<span style=\"color:%1\">").arg( this->color_scheme.at("x") );
|
||||
}
|
||||
content += "aCookie=abc123";
|
||||
if ( this->color_scheme_id > 0 ) {
|
||||
content += "</span>";
|
||||
}
|
||||
content += "</b>\"";
|
||||
|
||||
content += " \"<b>";
|
||||
if ( this->color_scheme_id > 0 ) {
|
||||
content += QString("<span style=\"color:%1\">").arg( this->color_scheme.at("ua_src") );
|
||||
}
|
||||
content += "UserAgent/3.0 (Details stuff) Info/123";
|
||||
if ( this->color_scheme_id > 0 ) {
|
||||
content += "</span>";
|
||||
}
|
||||
content += "</b>\"";
|
||||
|
||||
content += " <b>";
|
||||
if ( this->color_scheme_id > 0 ) {
|
||||
content += QString("<span style=\"color:%1\">").arg( this->color_scheme.at("ip") );
|
||||
}
|
||||
content += "192.168.1.123";
|
||||
if ( this->color_scheme_id > 0 ) {
|
||||
content += "</span>";
|
||||
}
|
||||
content += "</b>";
|
||||
|
||||
content += "</p>";
|
||||
if ( this->wide_lines == true ) {
|
||||
content += "<br/>";
|
||||
}
|
||||
}
|
||||
content += "</body></html>";
|
||||
}
|
||||
|
|
|
@ -25,6 +25,9 @@ public:
|
|||
void setFontFamily( const QString& font_family );
|
||||
void setFont( const QFont& font );
|
||||
|
||||
// preview
|
||||
void makePreview( QString& content );
|
||||
|
||||
private:
|
||||
bool wide_lines = false;
|
||||
int color_scheme_id = 1;
|
||||
|
|
Loading…
Reference in New Issue