summaryrefslogtreecommitdiffabout
path: root/kmicromail/settingsdialog.cpp
authorMichael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
committer Michael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
commita08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff)
tree8ee90d686081c52e7c69b5ce946e9b1a7d690001 /kmicromail/settingsdialog.cpp
parent11edc920afe4f274c0964436633aa632c8288a40 (diff)
downloadkdepimpi-p1.zip
kdepimpi-p1.tar.gz
kdepimpi-p1.tar.bz2
initial public commit of qt4 portp1
Diffstat (limited to 'kmicromail/settingsdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/settingsdialog.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/kmicromail/settingsdialog.cpp b/kmicromail/settingsdialog.cpp
index c593b48..889c490 100644
--- a/kmicromail/settingsdialog.cpp
+++ b/kmicromail/settingsdialog.cpp
@@ -1,89 +1,91 @@
1#include <qcheckbox.h> 1#include <qcheckbox.h>
2#include <qspinbox.h> 2#include <qspinbox.h>
3#include <qlayout.h> 3#include <qlayout.h>
4#include <qtabwidget.h> 4#include <qtabwidget.h>
5//Added by qt3to4:
6#include <Q3GridLayout>
5 7
6#include <kconfig.h> 8#include <kconfig.h>
7#include <kprefs.h> 9#include <kprefs.h>
8#include <klocale.h> 10#include <klocale.h>
9#include <kglobal.h> 11#include <kglobal.h>
10#include <kfontdialog.h> 12#include <kfontdialog.h>
11 13
12#include "settingsdialog.h" 14#include "settingsdialog.h"
13 15
14 16
15SettingsDialog::SettingsDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) 17SettingsDialog::SettingsDialog( QWidget* parent, const char* name, bool modal, Qt::WFlags fl )
16 : SettingsDialogUI( parent, name, modal, fl ) { 18 : SettingsDialogUI( parent, name, modal, fl ) {
17 19
18#if 0 20#if 0
19 QTabWidget *topFrame = TabWidget2; 21 QTabWidget *topFrame = TabWidget2;
20 22
21 QGridLayout *topLayout = new QGridLayout(topFrame,3,3); 23 Q3GridLayout *topLayout = new Q3GridLayout(topFrame,3,3);
22 topLayout->setSpacing(2); 24 topLayout->setSpacing(2);
23 topLayout->setMargin(3); 25 topLayout->setMargin(3);
24 KPrefsWidFont * tVFont; 26 KPrefsWidFont * tVFont;
25 int i = 0; 27 int i = 0;
26 KPrefsWidFont *timeLabelsFont = 28 KPrefsWidFont *timeLabelsFont =
27 addWidFont(i18n("OK"),i18n("Application(nr):"), 29 addWidFont(i18n("OK"),i18n("Application(nr):"),
28 &(mAppFont),topFrame); 30 &(mAppFont),topFrame);
29 topLayout->addWidget(timeLabelsFont->label(),i,0); 31 topLayout->addWidget(timeLabelsFont->label(),i,0);
30 topLayout->addWidget(timeLabelsFont->preview(),i,1); 32 topLayout->addWidget(timeLabelsFont->preview(),i,1);
31 topLayout->addWidget(timeLabelsFont->button(),i,2); 33 topLayout->addWidget(timeLabelsFont->button(),i,2);
32 ++i; 34 ++i;
33 35
34 36
35 timeLabelsFont = 37 timeLabelsFont =
36 addWidFont(i18n("Mon 15"),i18n("Compose Mail:"), 38 addWidFont(i18n("Mon 15"),i18n("Compose Mail:"),
37 &(mComposeFont),topFrame); 39 &(mComposeFont),topFrame);
38 topLayout->addWidget(timeLabelsFont->label(),i,0); 40 topLayout->addWidget(timeLabelsFont->label(),i,0);
39 topLayout->addWidget(timeLabelsFont->preview(),i,1); 41 topLayout->addWidget(timeLabelsFont->preview(),i,1);
40 topLayout->addWidget(timeLabelsFont->button(),i,2); 42 topLayout->addWidget(timeLabelsFont->button(),i,2);
41 ++i; 43 ++i;
42 44
43 KPrefsWidFont *timeBarFont = 45 KPrefsWidFont *timeBarFont =
44 addWidFont(i18n("Mon 15"),i18n("Read Mail:"), 46 addWidFont(i18n("Mon 15"),i18n("Read Mail:"),
45 &(mReadFont),topFrame); 47 &(mReadFont),topFrame);
46 topLayout->addWidget(timeBarFont->label(),i,0); 48 topLayout->addWidget(timeBarFont->label(),i,0);
47 topLayout->addWidget(timeBarFont->preview(),i,1); 49 topLayout->addWidget(timeBarFont->preview(),i,1);
48 topLayout->addWidget(timeBarFont->button(),i,2); 50 topLayout->addWidget(timeBarFont->button(),i,2);
49 ++i; 51 ++i;
50 52
51 readConfig(); 53 readConfig();
52#endif 54#endif
53} 55}
54 56
55SettingsDialog::~SettingsDialog() { 57SettingsDialog::~SettingsDialog() {
56 58
57} 59}
58 60
59void SettingsDialog::readConfig() { 61void SettingsDialog::readConfig() {
60 KConfig cfg = ( locateLocal("config","kopiemailrc" )); 62 KConfig cfg = ( locateLocal("config","kopiemailrc" ));
61 cfg.setGroup( "Settings" ); 63 cfg.setGroup( "Settings" );
62 showHtmlButton->setChecked( cfg.readBoolEntry( "showHtml", false ) ); 64 showHtmlButton->setChecked( cfg.readBoolEntry( "showHtml", false ) );
63 cfg.setGroup( "Compose" ); 65 cfg.setGroup( "Compose" );
64 checkBoxLater->setChecked( cfg.readBoolEntry( "sendLater", false ) ); 66 checkBoxLater->setChecked( cfg.readBoolEntry( "sendLater", false ) );
65 cfg.setGroup( "Applet" ); 67 cfg.setGroup( "Applet" );
66 cbEnableTaskbarApplet->setChecked( cfg.readBoolEntry( "Disabled", false ) ); 68 cbEnableTaskbarApplet->setChecked( cfg.readBoolEntry( "Disabled", false ) );
67 spCheckOften->setValue( cfg.readNumEntry( "CheckEvery", 5 ) ); 69 spCheckOften->setValue( cfg.readNumEntry( "CheckEvery", 5 ) );
68 cbBlinkLed->setChecked( cfg.readBoolEntry( "BlinkLed", true ) ); 70 cbBlinkLed->setChecked( cfg.readBoolEntry( "BlinkLed", true ) );
69 cbPlaySound->setChecked( cfg.readBoolEntry( "PlaySound", false ) ); 71 cbPlaySound->setChecked( cfg.readBoolEntry( "PlaySound", false ) );
70 72
71} 73}
72 74
73void SettingsDialog::writeConfig() { 75void SettingsDialog::writeConfig() {
74 KConfig cfg ( locateLocal("config","kopiemailrc" )); 76 KConfig cfg ( locateLocal("config","kopiemailrc" ));
75 cfg.setGroup( "Settings" ); 77 cfg.setGroup( "Settings" );
76 cfg.writeEntry( "showHtml", showHtmlButton->isChecked() ); 78 cfg.writeEntry( "showHtml", showHtmlButton->isChecked() );
77 cfg.setGroup( "Compose" ); 79 cfg.setGroup( "Compose" );
78 cfg.writeEntry( "sendLater", checkBoxLater->isChecked() ); 80 cfg.writeEntry( "sendLater", checkBoxLater->isChecked() );
79 cfg.setGroup( "Applet" ); 81 cfg.setGroup( "Applet" );
80 cfg.writeEntry( "Disabled", cbEnableTaskbarApplet->isChecked() ); 82 cfg.writeEntry( "Disabled", cbEnableTaskbarApplet->isChecked() );
81 cfg.writeEntry( "CheckEvery", spCheckOften->value() ); 83 cfg.writeEntry( "CheckEvery", spCheckOften->value() );
82 cfg.writeEntry( "BlinkLed", cbBlinkLed->isChecked() ); 84 cfg.writeEntry( "BlinkLed", cbBlinkLed->isChecked() );
83 cfg.writeEntry( "PlaySound", cbPlaySound->isChecked() ); 85 cfg.writeEntry( "PlaySound", cbPlaySound->isChecked() );
84} 86}
85 87
86void SettingsDialog::accept() { 88void SettingsDialog::accept() {
87 writeConfig(); 89 writeConfig();
88 QDialog::accept(); 90 QDialog::accept();
89} 91}