summaryrefslogtreecommitdiff
path: root/core/pim/today/plugins/datebook/datebookpluginconfig.cpp
Unidiff
Diffstat (limited to 'core/pim/today/plugins/datebook/datebookpluginconfig.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/plugins/datebook/datebookpluginconfig.cpp82
1 files changed, 82 insertions, 0 deletions
diff --git a/core/pim/today/plugins/datebook/datebookpluginconfig.cpp b/core/pim/today/plugins/datebook/datebookpluginconfig.cpp
new file mode 100644
index 0000000..7482f5e
--- a/dev/null
+++ b/core/pim/today/plugins/datebook/datebookpluginconfig.cpp
@@ -0,0 +1,82 @@
1
2
3#include "datebookpluginconfig.h"
4
5
6#include <qpe/config.h>
7
8#include <qlayout.h>
9#include <qtoolbutton.h>
10#include <qlabel.h>
11#include <qhbox.h>
12#include <qvbox.h>
13
14DatebookPluginConfig::DatebookPluginConfig( QWidget* parent, const char* name)
15 : ConfigWidget( parent, name ) {
16
17 QVBoxLayout * layout = new QVBoxLayout( this );
18
19 QHBox *box1 = new QHBox( this );
20 QLabel* TextLabel4 = new QLabel( box1, "TextLabel4" );
21 TextLabel4->setText( tr( "Show location" ) );
22 CheckBox1 = new QCheckBox( box1, "CheckBox1" );
23
24 QHBox *box2 = new QHBox( this );
25 QLabel* TextLabel5 = new QLabel( box2 , "TextLabel5" );
26 TextLabel5->setText( tr( "Show notes" ) );
27 CheckBox2 = new QCheckBox( box2, "CheckBox2" );
28
29 QHBox *box3 = new QHBox( this );
30 QLabel* TextLabel6 = new QLabel( box3, "All Day");
31 TextLabel6->setText( tr( "Show only later\n"
32 "appointments") );
33 CheckBox3 = new QCheckBox ( box3, "CheckBox3" );
34
35 QHBox *box4 = new QHBox( this );
36 QLabel *TextLabel3 = new QLabel( box4, "TextLabel3" );
37 TextLabel3->setText( tr( "How many \nappointment\n"
38 "should be \nshown?" ) );
39 SpinBox1 = new QSpinBox( box4, "SpinBox1" );
40 SpinBox1->setMaxValue( 10 );
41 SpinBox1->setValue( 5 );
42
43 layout->addWidget( box1 );
44 layout->addWidget( box2 );
45 layout->addWidget( box3 );
46 layout->addWidget( box4 );
47
48 readConfig();
49}
50
51void DatebookPluginConfig::readConfig() {
52 Config cfg( "todaydatebookplugin" );
53 cfg.setGroup( "config" );
54
55 m_max_lines_meet = cfg.readNumEntry( "maxlinesmeet", 5 );
56 SpinBox1->setValue( m_max_lines_meet );
57 m_show_location = cfg.readNumEntry( "showlocation", 1 );
58 CheckBox1->setChecked( m_show_location );
59 m_show_notes = cfg.readNumEntry( "shownotes", 0 );
60 CheckBox2->setChecked( m_show_notes );
61 m_only_later = cfg.readNumEntry( "onlylater", 1 );
62 CheckBox3->setChecked( m_only_later );
63}
64
65
66void DatebookPluginConfig::writeConfig() {
67 Config cfg( "todaydatebookplugin" );
68 cfg.setGroup( "config" );
69
70 m_max_lines_meet = SpinBox1->value();
71 cfg.writeEntry( "maxlinesmeet", m_max_lines_meet);
72 m_show_location = CheckBox1->isChecked();
73 cfg.writeEntry( "showlocation", m_show_location);
74 m_show_notes = CheckBox2->isChecked();
75 cfg.writeEntry( "shownotes", m_show_notes );
76 m_only_later = CheckBox3->isChecked();
77 cfg.writeEntry( "onlylater", m_only_later );
78 cfg.write();
79}
80
81DatebookPluginConfig::~DatebookPluginConfig() {
82}