author | harlekin <harlekin> | 2002-09-19 21:01:00 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-09-19 21:01:00 (UTC) |
commit | c03cc47ea4ecba39c89283f9bfc3ee55f572793f (patch) (unidiff) | |
tree | 7cab842df67039350234bbb6700773928c2b35ab /core/pim/today | |
parent | 65ba4e3610c94ba1de71a41dd6bf69662555e206 (diff) | |
download | opie-c03cc47ea4ecba39c89283f9bfc3ee55f572793f.zip opie-c03cc47ea4ecba39c89283f9bfc3ee55f572793f.tar.gz opie-c03cc47ea4ecba39c89283f9bfc3ee55f572793f.tar.bz2 |
added line clipping to config and code cleanups
-rw-r--r-- | core/pim/today/plugins/todolist/todopluginconfig.cpp | 35 | ||||
-rw-r--r-- | core/pim/today/plugins/todolist/todopluginconfig.h | 3 | ||||
-rw-r--r-- | core/pim/today/plugins/todolist/todopluginwidget.cpp | 2 |
3 files changed, 26 insertions, 14 deletions
diff --git a/core/pim/today/plugins/todolist/todopluginconfig.cpp b/core/pim/today/plugins/todolist/todopluginconfig.cpp index 2d8f1b6..69ad727 100644 --- a/core/pim/today/plugins/todolist/todopluginconfig.cpp +++ b/core/pim/today/plugins/todolist/todopluginconfig.cpp | |||
@@ -19,32 +19,37 @@ | |||
19 | #include <qpe/config.h> | 19 | #include <qpe/config.h> |
20 | 20 | ||
21 | #include <qlayout.h> | 21 | #include <qlayout.h> |
22 | #include <qhbox.h> | ||
22 | #include <qtoolbutton.h> | 23 | #include <qtoolbutton.h> |
23 | #include <qlabel.h> | 24 | #include <qlabel.h> |
24 | 25 | ||
25 | 26 | ||
27 | |||
26 | TodolistPluginConfig::TodolistPluginConfig( QWidget *parent, const char* name) | 28 | TodolistPluginConfig::TodolistPluginConfig( QWidget *parent, const char* name) |
27 | : ConfigWidget(parent, name ) { | 29 | : ConfigWidget(parent, name ) { |
28 | 30 | ||
29 | QVBoxLayout * layout = new QVBoxLayout( this ); | 31 | QVBoxLayout * layout = new QVBoxLayout( this ); |
32 | layout->setMargin( 20 ); | ||
30 | 33 | ||
31 | QFrame* Frame9 = new QFrame( this, "Frame9" ); | 34 | QHBox *box1 = new QHBox( this ); |
32 | Frame9->setGeometry( QRect( -5, 0, 230, 310 ) ); | ||
33 | Frame9->setFrameShape( QFrame::StyledPanel ); | ||
34 | Frame9->setFrameShadow( QFrame::Raised ); | ||
35 | 35 | ||
36 | QLabel* TextLabel6 = new QLabel( Frame9, "TextLabel6" ); | 36 | QLabel* TextLabel6 = new QLabel( box1, "TextLabel6" ); |
37 | TextLabel6->setGeometry( QRect( 20, 10, 100, 60 ) ); | 37 | TextLabel6->setText( tr( "How many\n tasks should \n" |
38 | TextLabel6->setText( tr( "How many\n" | ||
39 | "tasks should \n" | ||
40 | "be shown?" ) ); | 38 | "be shown?" ) ); |
41 | 39 | ||
42 | SpinBox2 = new QSpinBox( Frame9, "SpinBox2" ); | 40 | SpinBox2 = new QSpinBox( box1, "SpinBox2" ); |
43 | SpinBox2->setGeometry( QRect( 115, 20, 58, 25 ) ); | 41 | SpinBox2->setMaxValue( 40 ); |
44 | SpinBox2->setMaxValue( 20 ); | 42 | |
45 | SpinBox2->setValue( 5 ); | 43 | QHBox *box2 = new QHBox( this ); |
44 | |||
45 | QLabel* clipLabel = new QLabel( box2, "" ); | ||
46 | clipLabel->setText( tr( "Clip line after\n X chars" ) ); | ||
47 | |||
48 | SpinBoxClip = new QSpinBox( box2, "SpinClip" ); | ||
49 | SpinBoxClip->setMaxValue( 200 ); | ||
46 | 50 | ||
47 | layout->addWidget( Frame9 ); | 51 | layout->addWidget( box1 ); |
52 | layout->addWidget( box2 ); | ||
48 | 53 | ||
49 | readConfig(); | 54 | readConfig(); |
50 | } | 55 | } |
@@ -54,6 +59,8 @@ void TodolistPluginConfig::readConfig() { | |||
54 | cfg.setGroup( "config" ); | 59 | cfg.setGroup( "config" ); |
55 | m_max_lines_task = cfg.readNumEntry( "maxlinestask", 5 ); | 60 | m_max_lines_task = cfg.readNumEntry( "maxlinestask", 5 ); |
56 | SpinBox2->setValue( m_max_lines_task ); | 61 | SpinBox2->setValue( m_max_lines_task ); |
62 | m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 ); | ||
63 | SpinBoxClip->setValue( m_maxCharClip ); | ||
57 | } | 64 | } |
58 | 65 | ||
59 | 66 | ||
@@ -62,6 +69,8 @@ void TodolistPluginConfig::writeConfig() { | |||
62 | cfg.setGroup( "config" ); | 69 | cfg.setGroup( "config" ); |
63 | m_max_lines_task = SpinBox2->value(); | 70 | m_max_lines_task = SpinBox2->value(); |
64 | cfg.writeEntry( "maxlinestask", m_max_lines_task ); | 71 | cfg.writeEntry( "maxlinestask", m_max_lines_task ); |
72 | m_maxCharClip = SpinBoxClip->value(); | ||
73 | cfg.writeEntry( "maxcharclip", m_maxCharClip ); | ||
65 | cfg.write(); | 74 | cfg.write(); |
66 | } | 75 | } |
67 | 76 | ||
diff --git a/core/pim/today/plugins/todolist/todopluginconfig.h b/core/pim/today/plugins/todolist/todopluginconfig.h index 6be4b1e..934b319 100644 --- a/core/pim/today/plugins/todolist/todopluginconfig.h +++ b/core/pim/today/plugins/todolist/todopluginconfig.h | |||
@@ -39,9 +39,12 @@ private: | |||
39 | void writeConfig(); | 39 | void writeConfig(); |
40 | 40 | ||
41 | QSpinBox* SpinBox2; | 41 | QSpinBox* SpinBox2; |
42 | QSpinBox* SpinBoxClip; | ||
42 | 43 | ||
43 | // how many lines should be showed in the todolist section | 44 | // how many lines should be showed in the todolist section |
44 | int m_max_lines_task; | 45 | int m_max_lines_task; |
46 | // clip the lines after X chars | ||
47 | int m_maxCharClip; | ||
45 | 48 | ||
46 | 49 | ||
47 | 50 | ||
diff --git a/core/pim/today/plugins/todolist/todopluginwidget.cpp b/core/pim/today/plugins/todolist/todopluginwidget.cpp index 4731b43..d793aae 100644 --- a/core/pim/today/plugins/todolist/todopluginwidget.cpp +++ b/core/pim/today/plugins/todolist/todopluginwidget.cpp | |||
@@ -39,7 +39,6 @@ TodolistPluginWidget::TodolistPluginWidget( QWidget *parent, const char* name ) | |||
39 | todo = new ToDoDB(); | 39 | todo = new ToDoDB(); |
40 | 40 | ||
41 | readConfig(); | 41 | readConfig(); |
42 | m_maxCharClip = 36; | ||
43 | getTodo(); | 42 | getTodo(); |
44 | } | 43 | } |
45 | 44 | ||
@@ -52,6 +51,7 @@ void TodolistPluginWidget::readConfig() { | |||
52 | Config cfg( "todaytodoplugin" ); | 51 | Config cfg( "todaytodoplugin" ); |
53 | cfg.setGroup( "config" ); | 52 | cfg.setGroup( "config" ); |
54 | m_maxLinesTask = cfg.readNumEntry( "maxlinestask", 5 ); | 53 | m_maxLinesTask = cfg.readNumEntry( "maxlinestask", 5 ); |
54 | m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 ); | ||
55 | } | 55 | } |
56 | 56 | ||
57 | 57 | ||