summaryrefslogtreecommitdiff
path: root/core/pim/today/plugins/todolist/todopluginconfig.cpp
Unidiff
Diffstat (limited to 'core/pim/today/plugins/todolist/todopluginconfig.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/plugins/todolist/todopluginconfig.cpp34
1 files changed, 6 insertions, 28 deletions
diff --git a/core/pim/today/plugins/todolist/todopluginconfig.cpp b/core/pim/today/plugins/todolist/todopluginconfig.cpp
index c83f83b..4821776 100644
--- a/core/pim/today/plugins/todolist/todopluginconfig.cpp
+++ b/core/pim/today/plugins/todolist/todopluginconfig.cpp
@@ -10,72 +10,50 @@
10 * This program is free software; you can redistribute it and/or modify * 10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by * 11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or * 12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. * 13 * (at your option) any later version. *
14 * * 14 * *
15 ***************************************************************************/ 15 ***************************************************************************/
16 16
17#include "todopluginconfig.h" 17#include "todopluginconfig.h"
18 18
19#include <qpe/config.h> 19#include <qpe/config.h>
20 20
21#include <qlayout.h> 21#include <qlayout.h>
22#include <qhbox.h>
23#include <qlabel.h>
24#include <qwhatsthis.h> 22#include <qwhatsthis.h>
25 23
26 24
27
28TodolistPluginConfig::TodolistPluginConfig( QWidget *parent, const char* name) 25TodolistPluginConfig::TodolistPluginConfig( QWidget *parent, const char* name)
29 : TodayConfigWidget(parent, name ) { 26 : TodayConfigWidget(parent, name ) {
30 27
31 QVBoxLayout * layout = new QVBoxLayout( this ); 28 QVBoxLayout * layout = new QVBoxLayout( this );
32 layout->setMargin( 20 );
33
34 QHBox *box1 = new QHBox( this );
35
36 QLabel* TextLabel6 = new QLabel( box1, "TextLabel6" );
37 TextLabel6->setText( tr( "tasks shown " ) );
38
39 SpinBox2 = new QSpinBox( box1, "SpinBox2" );
40 SpinBox2->setMaxValue( 40 );
41 QWhatsThis::add( SpinBox2 , tr( "Set the maximum number of task that should be shown" ) );
42
43
44
45 QHBox *box2 = new QHBox( this );
46 29
47 QLabel* clipLabel = new QLabel( box2, "" ); 30 m_gui = new TodoPluginConfigBase( this );
48 clipLabel->setText( tr( "Clip line after X chars" ) );
49 31
50 SpinBoxClip = new QSpinBox( box2, "SpinClip" ); 32 layout->addWidget( m_gui );
51 SpinBoxClip->setMaxValue( 200 );
52 QWhatsThis::add( SpinBoxClip , tr( "After how many chars should be the info about the task be cut off" ) );
53 layout->addWidget( box1 );
54 layout->addWidget( box2 );
55 33
56 readConfig(); 34 readConfig();
57} 35}
58 36
59void TodolistPluginConfig::readConfig() { 37void TodolistPluginConfig::readConfig() {
60 Config cfg( "todaytodoplugin" ); 38 Config cfg( "todaytodoplugin" );
61 cfg.setGroup( "config" ); 39 cfg.setGroup( "config" );
62 m_max_lines_task = cfg.readNumEntry( "maxlinestask", 5 ); 40 m_max_lines_task = cfg.readNumEntry( "maxlinestask", 5 );
63 SpinBox2->setValue( m_max_lines_task ); 41 m_gui->SpinBox2->setValue( m_max_lines_task );
64 m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 ); 42 m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 );
65 SpinBoxClip->setValue( m_maxCharClip ); 43 m_gui->SpinBoxClip->setValue( m_maxCharClip );
66} 44}
67 45
68 46
69void TodolistPluginConfig::writeConfig() { 47void TodolistPluginConfig::writeConfig() {
70 Config cfg( "todaytodoplugin" ); 48 Config cfg( "todaytodoplugin" );
71 cfg.setGroup( "config" ); 49 cfg.setGroup( "config" );
72 m_max_lines_task = SpinBox2->value(); 50 m_max_lines_task = m_gui->SpinBox2->value();
73 cfg.writeEntry( "maxlinestask", m_max_lines_task ); 51 cfg.writeEntry( "maxlinestask", m_max_lines_task );
74 m_maxCharClip = SpinBoxClip->value(); 52 m_maxCharClip = m_gui->SpinBoxClip->value();
75 cfg.writeEntry( "maxcharclip", m_maxCharClip ); 53 cfg.writeEntry( "maxcharclip", m_maxCharClip );
76 cfg.write(); 54 cfg.write();
77} 55}
78 56
79 57
80TodolistPluginConfig::~TodolistPluginConfig() { 58TodolistPluginConfig::~TodolistPluginConfig() {
81} 59}