summaryrefslogtreecommitdiff
path: root/core/pim/today/plugins/addressbook/addresspluginconfig.cpp
Unidiff
Diffstat (limited to 'core/pim/today/plugins/addressbook/addresspluginconfig.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/plugins/addressbook/addresspluginconfig.cpp61
1 files changed, 42 insertions, 19 deletions
diff --git a/core/pim/today/plugins/addressbook/addresspluginconfig.cpp b/core/pim/today/plugins/addressbook/addresspluginconfig.cpp
index a234236..9c65e7d 100644
--- a/core/pim/today/plugins/addressbook/addresspluginconfig.cpp
+++ b/core/pim/today/plugins/addressbook/addresspluginconfig.cpp
@@ -25,6 +25,7 @@
25#include <qtoolbutton.h> 25#include <qtoolbutton.h>
26#include <qlabel.h> 26#include <qlabel.h>
27#include <qwhatsthis.h> 27#include <qwhatsthis.h>
28#include <qvgroupbox.h>
28 29
29 30
30AddressBookPluginConfig::AddressBookPluginConfig( QWidget *parent, const char* name) 31AddressBookPluginConfig::AddressBookPluginConfig( QWidget *parent, const char* name)
@@ -33,53 +34,66 @@ AddressBookPluginConfig::AddressBookPluginConfig( QWidget *parent, const char*
33 QVBoxLayout * layout = new QVBoxLayout( this ); 34 QVBoxLayout * layout = new QVBoxLayout( this );
34 layout->setMargin( 20 ); 35 layout->setMargin( 20 );
35 36
36 QHBox *box1 = new QHBox( this ); 37#if 0
38 // Informational stuff
39 QHBox *box4 = new QHBox( this );
40 QLabel* colorLabel = new QLabel( box4, "" );
41 colorLabel->setText( tr( "To activate settings: Restart application !" ) );
42#endif
43
44 // Buttongroup to enable/disable shown stuff
45 QVGroupBox* b_group = new QVGroupBox( this, "name" );
46 b_group -> setTitle( tr("Enable/Disable Views") );
47 m_showBirthdayButton = new QRadioButton( b_group );
48 m_showBirthdayButton -> setText( tr( "Show &Birthdays" ) );
49 m_showAnniversaryButton = new QRadioButton( b_group );
50 m_showAnniversaryButton -> setText( tr( "Show &Anniveraries" ) );
51
52 QWhatsThis::add( m_showBirthdayButton , tr( "The next birthdays will just be shown, if enabled!" ) );
53 QWhatsThis::add( m_showAnniversaryButton , tr( "The next anniversaries will just be shown, if enabled !" ) );
37 54
55 // Max lines settings
56 QHBox *box1 = new QHBox( this );
38 QLabel* TextLabel6 = new QLabel( box1, "TextLabel6" ); 57 QLabel* TextLabel6 = new QLabel( box1, "TextLabel6" );
39 TextLabel6->setText( tr( "Max Lines: " ) ); 58 TextLabel6->setText( tr( "Max Lines: " ) );
40
41 SpinBox2 = new QSpinBox( box1, "SpinBox2" ); 59 SpinBox2 = new QSpinBox( box1, "SpinBox2" );
42 SpinBox2->setMaxValue( 40 ); 60 SpinBox2->setMaxValue( 40 );
43 QWhatsThis::add( SpinBox2 , tr( "Set the maximum number of lines that should be shown for each anniversaries/birthdays" ) ); 61 QWhatsThis::add( SpinBox2 , tr( "Set the maximum number of lines that should be shown for each anniversaries/birthdays" ) );
44 62
63#if 0
64 // Clip settings (currently not used)
45 QHBox *box2 = new QHBox( this ); 65 QHBox *box2 = new QHBox( this );
46
47 QLabel* clipLabel = new QLabel( box2, "" ); 66 QLabel* clipLabel = new QLabel( box2, "" );
48 clipLabel->setText( tr( "Clip line after X chars: " ) ); 67 clipLabel->setText( tr( "Clip line after X chars: " ) );
49
50 SpinBoxClip = new QSpinBox( box2, "SpinClip" ); 68 SpinBoxClip = new QSpinBox( box2, "SpinClip" );
51 SpinBoxClip->setMaxValue( 200 ); 69 SpinBoxClip->setMaxValue( 200 );
52 QWhatsThis::add( SpinBoxClip , tr( "After how many chars should be the info about the task be cut off" ) ); 70 QWhatsThis::add( SpinBoxClip , tr( "After how many chars should be the info about the task be cut off" ) );
71#endif
53 72
73 // Look ahead settings
54 QHBox *box3 = new QHBox( this ); 74 QHBox *box3 = new QHBox( this );
55
56 QLabel* daysLabel = new QLabel( box3, "" ); 75 QLabel* daysLabel = new QLabel( box3, "" );
57 daysLabel->setText( tr( "Days look ahead: " ) ); 76 daysLabel->setText( tr( "Days look ahead: " ) );
58 SpinDaysClip = new QSpinBox( box3, "SpinDays" ); 77 SpinDaysClip = new QSpinBox( box3, "SpinDays" );
59 SpinDaysClip->setMaxValue( 200 ); 78 SpinDaysClip->setMaxValue( 200 );
60 QWhatsThis::add( SpinDaysClip , tr( "How many days we should search forward" ) ); 79 QWhatsThis::add( SpinDaysClip , tr( "How many days we should search forward" ) );
61 80
62 QHBox *box4 = new QHBox( this ); 81 // Headline color settings
63
64 QLabel* colorLabel = new QLabel( box4, "" );
65 colorLabel->setText( tr( "To activate settings: Restart application !" ) );
66
67 QHBox *box5 = new QHBox( this ); 82 QHBox *box5 = new QHBox( this );
68
69 QLabel* colorLabel2 = new QLabel( box5, "" ); 83 QLabel* colorLabel2 = new QLabel( box5, "" );
70 colorLabel2->setText( tr( "Set Headline Color: " ) ); 84 colorLabel2->setText( tr( "Set Headline Color: " ) );
71 headlineColor = new OColorButton( box5, black , "headlineColor" ); 85 headlineColor = new OColorButton( box5, black , "headlineColor" );
72 QWhatsThis::add( headlineColor , tr( "Colors for the headlines !" ) ); 86 QWhatsThis::add( headlineColor , tr( "Colors for the headlines !" ) );
73
74 QHBox *box6 = new QHBox( this ); 87 QHBox *box6 = new QHBox( this );
75 88
89 // Entry color settings
76 QLabel* colorLabel3= new QLabel( box6, "" ); 90 QLabel* colorLabel3= new QLabel( box6, "" );
77 colorLabel3->setText( tr( "Set Entry Color: " ) ); 91 colorLabel3->setText( tr( "Set Entry Color: " ) );
78 entryColor = new OColorButton( box6, black , "entryColor" ); 92 entryColor = new OColorButton( box6, black , "entryColor" );
79 QWhatsThis::add( entryColor , tr( "This color will be used for shown birthdays/anniversaries !" ) ); 93 QWhatsThis::add( entryColor , tr( "This color will be used for shown birthdays/anniversaries !" ) );
80 94
95 // Urgent color settings
81 QHBox *box7 = new QHBox( this ); 96 QHBox *box7 = new QHBox( this );
82
83 QLabel* colorLabel5 = new QLabel( box7, "" ); 97 QLabel* colorLabel5 = new QLabel( box7, "" );
84 colorLabel5->setText( tr( "Set Urgent\nColor if below " ) ); 98 colorLabel5->setText( tr( "Set Urgent\nColor if below " ) );
85 SpinUrgentClip = new QSpinBox( box7, "SpinDays" ); 99 SpinUrgentClip = new QSpinBox( box7, "SpinDays" );
@@ -91,9 +105,10 @@ AddressBookPluginConfig::AddressBookPluginConfig( QWidget *parent, const char*
91 QWhatsThis::add( SpinUrgentClip , tr( "The urgent color will be used if the birthday/anniversary is closer than given days !" ) ); 105 QWhatsThis::add( SpinUrgentClip , tr( "The urgent color will be used if the birthday/anniversary is closer than given days !" ) );
92 106
93 107
94 layout->addWidget( box4 ); 108 layout->addWidget( b_group );
109 // layout->addWidget( box4 );
95 layout->addWidget( box1 ); 110 layout->addWidget( box1 );
96 layout->addWidget( box2 ); 111 // layout->addWidget( box2 );
97 layout->addWidget( box3 ); 112 layout->addWidget( box3 );
98 layout->addWidget( box5 ); 113 layout->addWidget( box5 );
99 layout->addWidget( box6 ); 114 layout->addWidget( box6 );
@@ -108,8 +123,8 @@ void AddressBookPluginConfig::readConfig() {
108 cfg.setGroup( "config" ); 123 cfg.setGroup( "config" );
109 m_max_lines_task = cfg.readNumEntry( "maxlinestask", 5 ); 124 m_max_lines_task = cfg.readNumEntry( "maxlinestask", 5 );
110 SpinBox2->setValue( m_max_lines_task ); 125 SpinBox2->setValue( m_max_lines_task );
111 m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 ); 126// m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 );
112 SpinBoxClip->setValue( m_maxCharClip ); 127// SpinBoxClip->setValue( m_maxCharClip );
113 m_daysLookAhead = cfg.readNumEntry( "dayslookahead", 14 ); 128 m_daysLookAhead = cfg.readNumEntry( "dayslookahead", 14 );
114 SpinDaysClip->setValue( m_daysLookAhead ); 129 SpinDaysClip->setValue( m_daysLookAhead );
115 m_urgentDays = cfg.readNumEntry( "urgentdays", 7 ); 130 m_urgentDays = cfg.readNumEntry( "urgentdays", 7 );
@@ -121,6 +136,10 @@ void AddressBookPluginConfig::readConfig() {
121 headlineColor->setColor( QColor( m_headlineColor ) ); 136 headlineColor->setColor( QColor( m_headlineColor ) );
122 m_urgentColor = cfg.readEntry( "urgentcolor", Qt::red.name() ); 137 m_urgentColor = cfg.readEntry( "urgentcolor", Qt::red.name() );
123 urgentColor->setColor( QColor( m_urgentColor ) ); 138 urgentColor->setColor( QColor( m_urgentColor ) );
139
140 m_showBirthdayButton->setChecked( cfg.readBoolEntry( "showBirthdays", true ) );
141 m_showAnniversaryButton->setChecked( cfg.readBoolEntry( "showAnniversaries", true ) );
142
124} 143}
125 144
126 145
@@ -129,8 +148,8 @@ void AddressBookPluginConfig::writeConfig() {
129 cfg.setGroup( "config" ); 148 cfg.setGroup( "config" );
130 m_max_lines_task = SpinBox2->value(); 149 m_max_lines_task = SpinBox2->value();
131 cfg.writeEntry( "maxlinestask", m_max_lines_task ); 150 cfg.writeEntry( "maxlinestask", m_max_lines_task );
132 m_maxCharClip = SpinBoxClip->value(); 151// m_maxCharClip = SpinBoxClip->value();
133 cfg.writeEntry( "maxcharclip", m_maxCharClip ); 152// cfg.writeEntry( "maxcharclip", m_maxCharClip );
134 m_daysLookAhead = SpinDaysClip->value(); 153 m_daysLookAhead = SpinDaysClip->value();
135 cfg.writeEntry( "dayslookahead", m_daysLookAhead ); 154 cfg.writeEntry( "dayslookahead", m_daysLookAhead );
136 m_urgentDays = SpinUrgentClip->value(); 155 m_urgentDays = SpinUrgentClip->value();
@@ -144,6 +163,10 @@ void AddressBookPluginConfig::writeConfig() {
144 cfg.writeEntry( "headlinecolor", m_headlineColor ); 163 cfg.writeEntry( "headlinecolor", m_headlineColor );
145 m_urgentColor = urgentColor->color().name(); 164 m_urgentColor = urgentColor->color().name();
146 cfg.writeEntry( "urgentcolor", m_urgentColor ); 165 cfg.writeEntry( "urgentcolor", m_urgentColor );
166
167 cfg.writeEntry( "showBirthdays", m_showBirthdayButton->isChecked() );
168 cfg.writeEntry( "showAnniversaries", m_showAnniversaryButton->isChecked() );
169
147 cfg.write(); 170 cfg.write();
148} 171}
149 172