• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

knode

  • sources
  • kde-4.12
  • kdepim
  • knode
knsourceviewwindow.cpp
Go to the documentation of this file.
1 /*
2  KNode, the KDE newsreader
3  Copyright (c) 1999-2005 the KNode authors.
4  See file AUTHORS for details
5 
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
13 */
14 
15 #include <kdialog.h>
16 #include <klocale.h>
17 
18 #include "knsourceviewwindow.h"
19 #include "knglobals.h"
20 #include "settings.h"
21 #include "utilities.h"
22 
23 #include <QShortcut>
24 #include <QPalette>
25 
26 
27 KNSourceViewWindow::KNSourceViewWindow( const QString &text )
28  : KTextBrowser(0)
29 {
30  setWindowFlags( Qt::Window );
31  setAttribute( Qt::WA_DeleteOnClose );
32 
33  QShortcut *shortcut = new QShortcut( QKeySequence(Qt::Key_Escape), this );
34  connect( shortcut, SIGNAL(activated()), this, SLOT(close()) );
35 
36  setAcceptRichText( false );
37 
38  setWindowTitle(KDialog::makeStandardCaption(i18n("Article Source"), this));
39 
40  QPalette p = palette();
41  p.setColor( QPalette::Text, knGlobals.settings()->textColor() );
42  p.setColor( QPalette::Base, knGlobals.settings()->backgroundColor() );
43  setPalette( p );
44 
45  setFont( knGlobals.settings()->articleFixedFont() );
46  setWordWrapMode( QTextOption::NoWrap );
47 
48  setPlainText( text );
49  KNHelper::restoreWindowSize("sourceWindow", this, QSize(500,300));
50  show();
51 }
52 
53 KNSourceViewWindow::~KNSourceViewWindow()
54 {
55  KNHelper::saveWindowSize("sourceWindow",size());
56 }
57 
58 
59 #include "knsourceviewwindow.moc"
KNHelper::saveWindowSize
static void saveWindowSize(const QString &name, const QSize &s)
Definition: utilities.cpp:205
utilities.h
text
virtual QByteArray text(quint32 serialNumber) const =0
KNSourceViewWindow::~KNSourceViewWindow
~KNSourceViewWindow()
Definition: knsourceviewwindow.cpp:53
KNHelper::restoreWindowSize
static void restoreWindowSize(const QString &name, QWidget *d, const QSize &defaultSize)
Definition: utilities.cpp:212
KNSourceViewWindow::KNSourceViewWindow
KNSourceViewWindow(const QString &text)
Definition: knsourceviewwindow.cpp:27
KTextBrowser
knglobals.h
settings.h
knsourceviewwindow.h
knGlobals
#define knGlobals
Keep compatibility with the old way.
Definition: knglobals.h:28
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:58:36 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

knode

Skip menu "knode"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal