SVN_SILENT made messages (.desktop file)
[kdepim.git] / knode / knsourceviewwindow.cpp
blob11dcb98b502aea3a22ee246ff7dfea7302ede8f6
1 /*
2 KNode, the KDE newsreader
3 Copyright (c) 1999-2005 the KNode authors.
4 See file AUTHORS for details
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10 You should have received a copy of the GNU General Public License
11 along with this program; if not, write to the Free Software Foundation,
12 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US
15 #include <kdialog.h>
16 #include <klocale.h>
18 #include "knsourceviewwindow.h"
19 #include "knglobals.h"
20 #include "settings.h"
21 #include "utilities.h"
23 #include <QShortcut>
24 #include <QPalette>
27 KNSourceViewWindow::KNSourceViewWindow( const QString &text )
28 : KTextBrowser(0)
30 setWindowFlags( Qt::Window );
31 setAttribute( Qt::WA_DeleteOnClose );
33 QShortcut *shortcut = new QShortcut( QKeySequence(Qt::Key_Escape), this );
34 connect( shortcut, SIGNAL(activated()), this, SLOT(close()) );
36 setAcceptRichText( false );
38 setWindowTitle(KDialog::makeStandardCaption(i18n("Article Source"), this));
40 QPalette p = palette();
41 p.setColor( QPalette::Text, knGlobals.settings()->textColor() );
42 p.setColor( QPalette::Base, knGlobals.settings()->backgroundColor() );
43 setPalette( p );
45 setFont( knGlobals.settings()->articleFixedFont() );
46 setWordWrapMode( QTextOption::NoWrap );
48 setPlainText( text );
49 KNHelper::restoreWindowSize("sourceWindow", this, QSize(500,300));
50 show();
53 KNSourceViewWindow::~KNSourceViewWindow()
55 KNHelper::saveWindowSize("sourceWindow",size());