• 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
knconfigpages.cpp
Go to the documentation of this file.
1 /*
2  KNode, the KDE newsreader
3  Copyright (c) 2004-2005 Volker Krause <vkrause@kde.org>
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  You should have received a copy of the GNU General Public License
10  along with this program; if not, write to the Free Software Foundation,
11  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US
12 */
13 
14 #include "knconfigpages.h"
15 
16 #include "configuration/identity_widget.h"
17 #include "knconfigmanager.h"
18 #include "knconfigwidgets.h"
19 #include "settings.h"
20 
21 #include <kcmoduleloader.h>
22 
23 
24 //
25 // common config page with tabs (code mostly taken from kmail)
26 //
27 KNode::KCMTabContainer::KCMTabContainer( const KComponentData &inst, QWidget * parent )
28  : KCModule( inst, parent )
29 {
30  QVBoxLayout *vlay = new QVBoxLayout( this );
31  vlay->setSpacing( KDialog::spacingHint() );
32  vlay->setMargin( 0 );
33  mTabWidget = new QTabWidget( this );
34  vlay->addWidget( mTabWidget );
35 }
36 
37 void KNode::KCMTabContainer::addTab( KCModule* tab, const QString & title ) {
38  mTabWidget->addTab( tab, title );
39  connect( tab, SIGNAL(changed(bool)), this, SIGNAL(changed(bool)) );
40 }
41 
42 void KNode::KCMTabContainer::load() {
43  for ( int i = 0 ; i < mTabWidget->count() ; ++i ) {
44  KCModule *tab = (KCModule*) mTabWidget->widget(i);
45  if ( tab )
46  tab->load();
47  }
48 }
49 
50 void KNode::KCMTabContainer::save() {
51  for ( int i = 0 ; i < mTabWidget->count() ; ++i ) {
52  KCModule *tab = (KCModule*) mTabWidget->widget(i);
53  if ( tab )
54  tab->save();
55  }
56 }
57 
58 void KNode::KCMTabContainer::defaults()
59 {
60  KCModule *tab = static_cast<KCModule*>( mTabWidget->currentWidget() );
61  if ( tab )
62  tab->defaults();
63 }
64 
65 
66 
67 //
68 // identity page
69 //
70 extern "C"
71 {
72  KDE_EXPORT KCModule *create_knode_config_identity( QWidget *parent )
73  {
74  KNode::IdentityWidget *page = new KNode::IdentityWidget( KNGlobals::self()->settings(), knGlobals.componentData(), parent );
75  return page;
76  }
77 }
78 
79 
80 
81 //
82 // accounts page
83 //
84 extern "C"
85 {
86  KDE_EXPORT KCModule *create_knode_config_accounts( QWidget *parent )
87  {
88  KNode::AccountsPage *page = new KNode::AccountsPage( knGlobals.componentData(), parent );
89  return page;
90  }
91 }
92 
93 KNode::AccountsPage::AccountsPage( const KComponentData &inst,QWidget *parent )
94  : KCMTabContainer( inst,parent ) {
95 
96  addTab( new NntpAccountListWidget( inst, this ), i18n("Newsgroup Servers") );
97  addTab( KCModuleLoader::loadModule( "kcm_mailtransport", KCModuleLoader::Inline, this ),
98  i18n("Mail Server (SMTP)") );
99 }
100 
101 
102 
103 //
104 // appearance page
105 //
106 extern "C"
107 {
108  KDE_EXPORT KCModule *create_knode_config_appearance( QWidget *parent )
109  {
110  KNode::AppearanceWidget *page = new KNode::AppearanceWidget( knGlobals.componentData(), parent );
111  return page;
112  }
113 }
114 
115 
116 
117 //
118 // read news page
119 //
120 extern "C"
121 {
122  KDE_EXPORT KCModule *create_knode_config_read_news( QWidget *parent )
123  {
124  KNode::ReadNewsPage *page = new KNode::ReadNewsPage( knGlobals.componentData(), parent );
125  return page;
126  }
127 }
128 
129 KNode::ReadNewsPage::ReadNewsPage( const KComponentData &inst,QWidget *parent )
130  : KCMTabContainer( inst, parent )
131 {
132  addTab( new ReadNewsGeneralWidget( inst, this ), i18n("General") );
133  addTab( new ReadNewsNavigationWidget( inst, this ), i18n("Navigation") );
134  addTab( new ScoringWidget( inst, this ), i18n("Scoring") );
135  addTab( new FilterListWidget( inst, this ), i18n("Filters") );
136  addTab( new DisplayedHeadersWidget( knGlobals.configManager()->displayedHeaders(), inst, this ), i18n("Headers") );
137  addTab( new ReadNewsViewerWidget( inst, this ), i18n("Viewer") );
138 }
139 
140 
141 
142 //
143 // post news page
144 //
145 extern "C"
146 {
147  KDE_EXPORT KCModule *create_knode_config_post_news( QWidget *parent )
148  {
149  KNode::PostNewsPage *page = new KNode::PostNewsPage( knGlobals.componentData(), parent );
150  return page;
151  }
152 }
153 
154 KNode::PostNewsPage::PostNewsPage( const KComponentData &inst, QWidget *parent )
155  : KCMTabContainer( inst, parent )
156 {
157  addTab( new PostNewsTechnicalWidget( inst, this ), i18n("Technical") );
158  addTab( new PostNewsComposerWidget( inst, this ), i18n("Composer") );
159  addTab( new PostNewsSpellingWidget( inst, this ), i18n("Spelling") );
160 }
161 
162 
163 
164 //
165 // privacy page
166 //
167 extern "C"
168 {
169  KDE_EXPORT KCModule *create_knode_config_privacy( QWidget *parent )
170  {
171  KNode::PrivacyWidget *page = new KNode::PrivacyWidget( knGlobals.componentData(), parent );
172  return page;
173  }
174 }
175 
176 
177 
178 //
179 // cleanup page
180 //
181 extern "C"
182 {
183  KDE_EXPORT KCModule *create_knode_config_cleanup( QWidget *parent )
184  {
185  KNode::CleanupWidget *page = new KNode::CleanupWidget( knGlobals.componentData(), parent );
186  return page;
187  }
188 }
189 
190 
191 #include "knconfigpages.moc"
create_knode_config_appearance
KCModule * create_knode_config_appearance(QWidget *parent)
Definition: knconfigpages.cpp:108
KNode::IdentityWidget
Configuration widget for an identity.
Definition: identity_widget.h:39
KNode::KCMTabContainer::defaults
virtual void defaults()
Reimplemented to forward defaults() to the current tab.
Definition: knconfigpages.cpp:58
create_knode_config_privacy
KCModule * create_knode_config_privacy(QWidget *parent)
Definition: knconfigpages.cpp:169
QWidget
KNode::AccountsPage::AccountsPage
AccountsPage(const KComponentData &inst, QWidget *parent=0)
Definition: knconfigpages.cpp:93
knconfigwidgets.h
KNGlobals::self
static KNGlobals * self()
Return the KNGlobals instance.
Definition: knglobals.cpp:72
create_knode_config_read_news
KCModule * create_knode_config_read_news(QWidget *parent)
Definition: knconfigpages.cpp:122
KNode::PostNewsPage
Post news page.
Definition: knconfigpages.h:76
identity_widget.h
KNode::KCMTabContainer::load
virtual void load()
Reimplemented to forward load() to all tabs.
Definition: knconfigpages.cpp:42
KNode::ReadNewsPage::ReadNewsPage
ReadNewsPage(const KComponentData &inst, QWidget *parent=0)
Definition: knconfigpages.cpp:129
KNode::KCMTabContainer
A tab-based KCModule container.
Definition: knconfigpages.h:30
create_knode_config_cleanup
KCModule * create_knode_config_cleanup(QWidget *parent)
Definition: knconfigpages.cpp:183
KNode::NntpAccountListWidget
News server account list widget.
Definition: knconfigwidgets.h:58
KNode::PrivacyWidget
Privacy configuration widget.
Definition: knconfigwidgets.h:521
KNode::DisplayedHeadersWidget
Configuration widget for headers displayed in the article viewer.
Definition: knconfigwidgets.h:286
KNode::PostNewsComposerWidget
Composer configuration widget.
Definition: knconfigwidgets.h:495
knconfigpages.h
KNode::ReadNewsNavigationWidget
Read news navigation configuration page.
Definition: knconfigwidgets.h:264
KNode::ReadNewsViewerWidget
Article viewer configuration page.
Definition: knconfigwidgets.h:275
create_knode_config_accounts
KCModule * create_knode_config_accounts(QWidget *parent)
Definition: knconfigpages.cpp:86
KNode::FilterListWidget
Configuration widget for filters.
Definition: knconfigwidgets.h:379
KNode::AppearanceWidget
Appearance configuration widget.
Definition: knconfigwidgets.h:145
KNode::ScoringWidget
Scoring configuration widget.
Definition: knconfigwidgets.h:364
KNode::PostNewsTechnicalWidget
Configuration widget for technical posting settings.
Definition: knconfigwidgets.h:453
KNode::PostNewsSpellingWidget
Spell-checking configuration widget.
Definition: knconfigwidgets.h:506
settings.h
KNode::AccountsPage
Accounts config page.
Definition: knconfigpages.h:59
KNode::ReadNewsPage
Read news page.
Definition: knconfigpages.h:68
create_knode_config_identity
KCModule * create_knode_config_identity(QWidget *parent)
Definition: knconfigpages.cpp:72
KNode::KCMTabContainer::KCMTabContainer
KCMTabContainer(const KComponentData &inst, QWidget *parent=0)
Create a new tab-based KCModule container.
Definition: knconfigpages.cpp:27
KNode::ReadNewsGeneralWidget
General read news configuration page.
Definition: knconfigwidgets.h:248
create_knode_config_post_news
KCModule * create_knode_config_post_news(QWidget *parent)
Definition: knconfigpages.cpp:147
knconfigmanager.h
QTabWidget
knGlobals
#define knGlobals
Keep compatibility with the old way.
Definition: knglobals.h:28
KNode::PostNewsPage::PostNewsPage
PostNewsPage(const KComponentData &inst, QWidget *parent=0)
Definition: knconfigpages.cpp:154
KCModule
KNode::CleanupWidget
Global cleanup configuration widget.
Definition: knconfigwidgets.h:565
KNode::KCMTabContainer::addTab
void addTab(KCModule *tab, const QString &title)
Add a new tab.
Definition: knconfigpages.cpp:37
KNode::KCMTabContainer::save
virtual void save()
Reimplemented to forward save() to all tabs.
Definition: knconfigpages.cpp:50
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