25 #include "knotesglobalconfig.h"
27 #include "kdepim-version.h"
29 #include <kapplication.h>
30 #include <kcolorbutton.h>
32 #include <kfontrequester.h>
33 #include <kiconloader.h>
34 #include <klineedit.h>
36 #include <knuminput.h>
37 #include <kwindowsystem.h>
41 #include <QGridLayout>
43 #include <QHBoxLayout>
45 #include <QVBoxLayout>
52 setFaceType( KPageDialog::List );
53 setButtons( Default | Ok | Cancel );
54 setDefaultButton( Ok );
58 KWindowSystem::setIcons( winId(),
59 qApp->windowIcon().pixmap(
60 IconSize( KIconLoader::Desktop ),
61 IconSize( KIconLoader::Desktop ) ),
62 qApp->windowIcon().pixmap(
63 IconSize( KIconLoader::Small ),
64 IconSize( KIconLoader::Small ) ) );
66 showButtonSeparator(
true );
68 addModule( QLatin1String(
"knote_config_display") );
69 addModule( QLatin1String(
"knote_config_editor") );
70 addModule( QLatin1String(
"knote_config_action") );
71 addModule( QLatin1String(
"knote_config_network") );
72 addModule( QLatin1String(
"knote_config_print") );
74 KNotesGlobalConfig::self()->setVersion( QLatin1String(KDEPIM_VERSION) );
75 connect(
this, SIGNAL(okClicked()), SLOT(
slotOk()) );
83 KNotesGlobalConfig::self()->writeConfig();
92 KComponentData instance(
"kcmnote_config_display" );
101 KComponentData instance(
"kcmnote_config_editor" );
110 KComponentData instance(
"kcmnote_config_action" );
119 KComponentData instance(
"kcmnote_config_network" );
128 KComponentData instance(
"kcmnote_config_print" );
137 QGridLayout *layout =
new QGridLayout(
this );
138 layout->setSpacing( KDialog::spacingHint() );
139 layout->setMargin( defaults ? KDialog::marginHint() : 0 );
141 QLabel *label_FgColor =
new QLabel( i18n(
"&Text color:" ),
this );
142 label_FgColor->setObjectName( QLatin1String(
"label_FgColor") );
143 layout->addWidget( label_FgColor, 0, 0 );
145 KColorButton *kcfg_FgColor =
new KColorButton(
this );
146 kcfg_FgColor->setObjectName( QLatin1String(
"kcfg_FgColor") );
147 label_FgColor->setBuddy( kcfg_FgColor );
148 layout->addWidget( kcfg_FgColor, 0, 1 );
150 QLabel *label_BgColor =
new QLabel( i18n(
"&Background color:" ),
152 label_BgColor->setObjectName( QLatin1String(
"label_BgColor") );
153 layout->addWidget( label_BgColor, 1, 0 );
155 KColorButton *kcfg_BgColor =
new KColorButton(
this );
156 kcfg_BgColor->setObjectName( QLatin1String(
"kcfg_BgColor") );
157 label_BgColor->setBuddy( kcfg_BgColor );
158 layout->addWidget( kcfg_BgColor, 1, 1 );
160 QCheckBox *kcfg_ShowInTaskbar =
161 new QCheckBox( i18n(
"&Show note in taskbar" ),
this );
162 kcfg_ShowInTaskbar->setObjectName( QLatin1String(
"kcfg_ShowInTaskbar") );
164 QCheckBox *kcfg_RememberDesktop =
165 new QCheckBox( i18n(
"&Remember desktop" ),
this );
166 kcfg_RememberDesktop->setObjectName( QLatin1String(
"kcfg_RememberDesktop") );
169 QLabel *label_Width =
new QLabel( i18n(
"Default &width:" ),
this );
171 layout->addWidget( label_Width, 2, 0 );
173 KIntNumInput *kcfg_Width =
new KIntNumInput(
this );
174 kcfg_Width->setObjectName( QLatin1String(
"kcfg_Width") );
175 label_Width->setBuddy( kcfg_Width );
176 kcfg_Width->setRange( 50, 2000, 10 );
177 kcfg_Width->setSliderEnabled(
false );
178 layout->addWidget( kcfg_Width, 2, 1 );
180 QLabel *label_Height =
new QLabel( i18n(
"Default &height:" ),
182 layout->addWidget( label_Height, 3, 0 );
184 KIntNumInput *kcfg_Height =
new KIntNumInput(
this );
185 kcfg_Height->setObjectName( QLatin1String(
"kcfg_Height") );
186 kcfg_Height->setRange( 50, 2000, 10 );
187 kcfg_Height->setSliderEnabled(
false );
188 label_Height->setBuddy( kcfg_Height );
189 layout->addWidget( kcfg_Height, 3, 1 );
191 layout->addWidget( kcfg_ShowInTaskbar, 4, 0 );
193 layout->addWidget( kcfg_RememberDesktop, 5, 0 );
196 layout->addWidget( kcfg_ShowInTaskbar, 2, 0 );
198 layout->addWidget( kcfg_RememberDesktop, 3, 0 );
201 layout->setRowStretch(4,1);
207 QVBoxLayout *lay =
new QVBoxLayout(
this );
211 addConfig( KNotesGlobalConfig::self(), w );
228 QGridLayout *layout =
new QGridLayout(
this );
229 layout->setSpacing( KDialog::spacingHint() );
230 layout->setMargin( defaults ? KDialog::marginHint() : 0 );
232 QLabel *label_TabSize =
new QLabel( i18n(
"&Tab size:" ),
this );
233 layout->addWidget( label_TabSize, 0, 0, 1, 2 );
235 KIntNumInput *kcfg_TabSize =
new KIntNumInput(
this );
236 kcfg_TabSize->setObjectName( QLatin1String(
"kcfg_TabSize") );
237 kcfg_TabSize->setRange( 1, 40 );
238 kcfg_TabSize->setSliderEnabled(
false );
239 label_TabSize->setBuddy( kcfg_TabSize );
240 layout->addWidget( kcfg_TabSize, 0, 2 );
242 QCheckBox *kcfg_AutoIndent =
new QCheckBox( i18n(
"Auto &indent" ),
244 kcfg_AutoIndent->setObjectName( QLatin1String(
"kcfg_AutoIndent") );
245 layout->addWidget( kcfg_AutoIndent, 1, 0, 1, 2 );
247 QCheckBox *kcfg_RichText =
new QCheckBox( i18n(
"&Rich text" ),
this );
248 kcfg_RichText->setObjectName( QLatin1String(
"kcfg_RichText") );
249 layout->addWidget( kcfg_RichText, 1, 2 );
251 QLabel *label_Font =
new QLabel( i18n(
"Text font:" ),
this );
252 layout->addWidget( label_Font, 3, 0 );
254 KFontRequester *kcfg_Font =
new KFontRequester(
this );
255 kcfg_Font->setObjectName( QLatin1String(
"kcfg_Font") );
256 kcfg_Font->setSizePolicy( QSizePolicy( QSizePolicy::Minimum,
257 QSizePolicy::Fixed ) );
258 layout->addWidget( kcfg_Font, 3, 1, 1, 2 );
260 QLabel *label_TitleFont =
new QLabel( i18n(
"Title font:" ),
this );
261 layout->addWidget( label_TitleFont, 2, 0 );
263 KFontRequester *kcfg_TitleFont =
new KFontRequester(
this );
264 kcfg_TitleFont->setObjectName( QLatin1String(
"kcfg_TitleFont") );
265 kcfg_TitleFont->setSizePolicy( QSizePolicy( QSizePolicy::Minimum,
266 QSizePolicy::Fixed ) );
267 layout->addWidget( kcfg_TitleFont, 2, 1, 1, 2 );
268 layout->setRowStretch(4,1);
274 QVBoxLayout *lay =
new QVBoxLayout(
this );
278 addConfig( KNotesGlobalConfig::self(), w );
295 QVBoxLayout *lay =
new QVBoxLayout(
this );
298 QGridLayout *layout =
new QGridLayout( w );
299 layout->setSpacing( KDialog::spacingHint() );
300 layout->setMargin( 0 );
302 QLabel *label_MailAction =
new QLabel( i18n(
"&Mail action:" ),
this );
303 layout->addWidget( label_MailAction, 0, 0 );
305 KLineEdit *kcfg_MailAction =
new KLineEdit(
this );
306 kcfg_MailAction->setObjectName( QLatin1String(
"kcfg_MailAction") );
307 label_MailAction->setBuddy( kcfg_MailAction );
308 layout->addWidget( kcfg_MailAction, 0, 1 );
310 QLabel *howItWorks =
new QLabel(i18n(
"<a href=\"whatsthis\">How does this work?</a>" ));
311 connect( howItWorks, SIGNAL(linkActivated(QString)),SLOT(slotHelpLinkClicked(QString)) );
312 layout->addWidget( howItWorks, 1, 0 );
314 addConfig( KNotesGlobalConfig::self(), w );
319 void KNoteActionConfig::slotHelpLinkClicked(
const QString &)
323 "<p>You can customize command line. "
326 "<li>%t returns current note title</li>"
327 "<li>%f returns current note text</li>"
331 QWhatsThis::showText( QCursor::pos(), help );
347 QVBoxLayout *lay =
new QVBoxLayout(
this );
350 QVBoxLayout *layout =
new QVBoxLayout( w );
351 layout->setSpacing( KDialog::spacingHint() );
352 layout->setMargin( 0 );
354 QGroupBox *incoming =
new QGroupBox( i18n(
"Incoming Notes" ) );
355 QHBoxLayout *tmpLayout =
new QHBoxLayout;
357 QCheckBox *tmpChkB=
new QCheckBox( i18n(
"Accept incoming notes" ) );
358 tmpChkB->setObjectName( QLatin1String(
"kcfg_ReceiveNotes") );
359 tmpLayout->addWidget( tmpChkB );
360 incoming->setLayout( tmpLayout );
361 layout->addWidget( incoming );
363 QGroupBox *outgoing =
new QGroupBox( i18n(
"Outgoing Notes" ) );
364 tmpLayout =
new QHBoxLayout;
366 QLabel *label_SenderID =
new QLabel( i18n(
"&Sender ID:" ) );
367 KLineEdit *kcfg_SenderID =
new KLineEdit;
368 kcfg_SenderID->setClearButtonShown(
true);
369 kcfg_SenderID->setObjectName( QLatin1String(
"kcfg_SenderID") );
370 label_SenderID->setBuddy( kcfg_SenderID );
371 tmpLayout->addWidget( label_SenderID );
372 tmpLayout->addWidget( kcfg_SenderID );
373 outgoing->setLayout( tmpLayout );
374 layout->addWidget( outgoing );
376 tmpLayout =
new QHBoxLayout;
378 QLabel *label_Port =
new QLabel( i18n(
"&Port:" ) );
380 tmpLayout->addWidget( label_Port );
382 KIntNumInput *kcfg_Port =
new KIntNumInput;
383 kcfg_Port->setObjectName( QLatin1String(
"kcfg_Port") );
384 kcfg_Port->setRange( 0, 65535 );
385 kcfg_Port->setSliderEnabled(
false );
386 label_Port->setBuddy( kcfg_Port );
387 tmpLayout->addWidget( kcfg_Port );
388 layout->addLayout( tmpLayout );
390 addConfig( KNotesGlobalConfig::self(), w );
408 QVBoxLayout *lay =
new QVBoxLayout(
this );
411 QGridLayout *layout =
new QGridLayout( w );
412 layout->setSpacing( KDialog::spacingHint() );
413 layout->setMargin( 0 );
415 QLabel *label_PrintAction =
new QLabel( i18n(
"Theme:" ),
this );
416 layout->addWidget( label_PrintAction, 0, 0 );
419 connect(mSelectTheme, SIGNAL(activated(
int)), SLOT(slotThemeChanged()));
420 label_PrintAction->setBuddy( mSelectTheme );
421 layout->addWidget( mSelectTheme, 0, 1 );
426 void KNotePrintConfig::slotThemeChanged()
428 Q_EMIT changed(
true);
433 KNotesGlobalConfig::self()->setTheme(mSelectTheme->
selectedTheme());
443 mSelectTheme->setCurrentIndex(0);
444 Q_EMIT changed(
true);
447 #include "knoteconfigdialog.moc"
QString selectedTheme() const
KNoteNetworkConfig(const KComponentData &inst, QWidget *parent)
virtual void load()
Reimplemented from KCModule.
KNoteEditorConfig(const KComponentData &inst, QWidget *parent)
virtual void load()
Reimplemented from KCModule.
KCModule * create_knote_config_print(QWidget *parent)
KNotePrintConfig(const KComponentData &inst, QWidget *parent)
KCModule * create_knote_config_editor(QWidget *parent)
virtual void load()
Reimplemented from KCModule.
KCModule * create_knote_config_network(QWidget *parent)
KCModule * create_knote_config_display(QWidget *parent)
KNoteConfigDialog(const QString &title, QWidget *parent)
KNoteActionConfig(const KComponentData &inst, QWidget *parent)
virtual void load()
Reimplemented from KCModule.
virtual void load()
Reimplemented from KCModule.
KNoteDisplayConfig(const KComponentData &inst, QWidget *parent)
KCModule * create_knote_config_action(QWidget *parent)