author | eilers <eilers> | 2003-01-13 13:17:17 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-01-13 13:17:17 (UTC) |
commit | 55266a0b221b065a94dc1a83860f9603c1d3c2c5 (patch) (unidiff) | |
tree | d5f25e9c77d35dc90d4881d04854cc1a5ae4eabc /core/pim/today/plugins/addressbook/addresspluginconfig.cpp | |
parent | aa4f80fdc2d78bfe1c1d4cb8ec1d852115d00fc7 (diff) | |
download | opie-55266a0b221b065a94dc1a83860f9603c1d3c2c5.zip opie-55266a0b221b065a94dc1a83860f9603c1d3c2c5.tar.gz opie-55266a0b221b065a94dc1a83860f9603c1d3c2c5.tar.bz2 |
Bugfixed and improved color settings ! Now it is possible to change
the color if the anniversary/birthday is close.. :)
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.cpp | 60 |
1 files changed, 52 insertions, 8 deletions
diff --git a/core/pim/today/plugins/addressbook/addresspluginconfig.cpp b/core/pim/today/plugins/addressbook/addresspluginconfig.cpp index f00cffe..45d9a3e 100644 --- a/core/pim/today/plugins/addressbook/addresspluginconfig.cpp +++ b/core/pim/today/plugins/addressbook/addresspluginconfig.cpp | |||
@@ -37,7 +37,7 @@ AddressBookPluginConfig::AddressBookPluginConfig( QWidget *parent, const char* | |||
37 | QHBox *box1 = new QHBox( this ); | 37 | QHBox *box1 = new QHBox( this ); |
38 | 38 | ||
39 | QLabel* TextLabel6 = new QLabel( box1, "TextLabel6" ); | 39 | QLabel* TextLabel6 = new QLabel( box1, "TextLabel6" ); |
40 | TextLabel6->setText( tr( "Max Lines " ) ); | 40 | TextLabel6->setText( tr( "Max Lines: " ) ); |
41 | 41 | ||
42 | SpinBox2 = new QSpinBox( box1, "SpinBox2" ); | 42 | SpinBox2 = new QSpinBox( box1, "SpinBox2" ); |
43 | SpinBox2->setMaxValue( 40 ); | 43 | SpinBox2->setMaxValue( 40 ); |
@@ -46,7 +46,7 @@ AddressBookPluginConfig::AddressBookPluginConfig( QWidget *parent, const char* | |||
46 | QHBox *box2 = new QHBox( this ); | 46 | QHBox *box2 = new QHBox( this ); |
47 | 47 | ||
48 | QLabel* clipLabel = new QLabel( box2, "" ); | 48 | QLabel* clipLabel = new QLabel( box2, "" ); |
49 | clipLabel->setText( tr( "Clip line after X chars" ) ); | 49 | clipLabel->setText( tr( "Clip line after X chars: " ) ); |
50 | 50 | ||
51 | SpinBoxClip = new QSpinBox( box2, "SpinClip" ); | 51 | SpinBoxClip = new QSpinBox( box2, "SpinClip" ); |
52 | SpinBoxClip->setMaxValue( 200 ); | 52 | SpinBoxClip->setMaxValue( 200 ); |
@@ -55,8 +55,7 @@ AddressBookPluginConfig::AddressBookPluginConfig( QWidget *parent, const char* | |||
55 | QHBox *box3 = new QHBox( this ); | 55 | QHBox *box3 = new QHBox( this ); |
56 | 56 | ||
57 | QLabel* daysLabel = new QLabel( box3, "" ); | 57 | QLabel* daysLabel = new QLabel( box3, "" ); |
58 | daysLabel->setText( tr( "Days look ahead" ) ); | 58 | daysLabel->setText( tr( "Days look ahead: " ) ); |
59 | |||
60 | SpinDaysClip = new QSpinBox( box3, "SpinDays" ); | 59 | SpinDaysClip = new QSpinBox( box3, "SpinDays" ); |
61 | SpinDaysClip->setMaxValue( 200 ); | 60 | SpinDaysClip->setMaxValue( 200 ); |
62 | QWhatsThis::add( SpinDaysClip , tr( "How many days we should search forward" ) ); | 61 | QWhatsThis::add( SpinDaysClip , tr( "How many days we should search forward" ) ); |
@@ -64,17 +63,45 @@ AddressBookPluginConfig::AddressBookPluginConfig( QWidget *parent, const char* | |||
64 | QHBox *box4 = new QHBox( this ); | 63 | QHBox *box4 = new QHBox( this ); |
65 | 64 | ||
66 | QLabel* colorLabel = new QLabel( box4, "" ); | 65 | QLabel* colorLabel = new QLabel( box4, "" ); |
67 | colorLabel->setText( tr( "Set Entry Color \n(restart Today \nafter change!)" ) ); | 66 | colorLabel->setText( tr( "To activate color settings:\nRestart application !" ) ); |
67 | |||
68 | QHBox *box5 = new QHBox( this ); | ||
69 | |||
70 | QLabel* colorLabel2 = new QLabel( box5, "" ); | ||
71 | colorLabel2->setText( tr( "Set Headline Color: " ) ); | ||
72 | headlineColor = new OColorButton( box5, black , "headlineColor" ); | ||
73 | QWhatsThis::add( headlineColor , tr( "Colors for the headlines !" ) ); | ||
74 | |||
75 | QHBox *box6 = new QHBox( this ); | ||
76 | |||
77 | QLabel* colorLabel3= new QLabel( box6, "" ); | ||
78 | colorLabel3->setText( tr( "Set Entry Color: " ) ); | ||
79 | entryColor = new OColorButton( box6, black , "entryColor" ); | ||
80 | QWhatsThis::add( entryColor , tr( "This color will be used for shown birthdays/anniversaries !" ) ); | ||
81 | |||
82 | QHBox *box7 = new QHBox( this ); | ||
83 | |||
84 | QLabel* colorLabel5 = new QLabel( box7, "" ); | ||
85 | colorLabel5->setText( tr( "Set Urgent\nColor if below " ) ); | ||
86 | SpinUrgentClip = new QSpinBox( box7, "SpinDays" ); | ||
87 | SpinUrgentClip->setMaxValue( 200 ); | ||
88 | QLabel* colorLabel6 = new QLabel( box7, "" ); | ||
89 | colorLabel6->setText( tr( "days: " ) ); | ||
90 | urgentColor = new OColorButton( box7, red , "urgentColor" ); | ||
91 | QWhatsThis::add( urgentColor , tr( "This color will be used if we are close to the event !" ) ); | ||
92 | QWhatsThis::add( SpinUrgentClip , tr( "How many days we should search forward" ) ); | ||
68 | 93 | ||
69 | entryColor = new OColorButton( box4, red, "entryColor" ); | ||
70 | QWhatsThis::add( entryColor , tr( "What color should be used for shown birthdays/anniversaries?" ) ); | ||
71 | 94 | ||
72 | layout->addWidget( box1 ); | 95 | layout->addWidget( box1 ); |
73 | layout->addWidget( box2 ); | 96 | layout->addWidget( box2 ); |
74 | layout->addWidget( box3 ); | 97 | layout->addWidget( box3 ); |
75 | layout->addWidget( box4 ); | 98 | layout->addWidget( box4 ); |
99 | layout->addWidget( box5 ); | ||
100 | layout->addWidget( box6 ); | ||
101 | layout->addWidget( box7 ); | ||
76 | 102 | ||
77 | readConfig(); | 103 | readConfig(); |
104 | |||
78 | } | 105 | } |
79 | 106 | ||
80 | void AddressBookPluginConfig::readConfig() { | 107 | void AddressBookPluginConfig::readConfig() { |
@@ -86,7 +113,15 @@ void AddressBookPluginConfig::readConfig() { | |||
86 | SpinBoxClip->setValue( m_maxCharClip ); | 113 | SpinBoxClip->setValue( m_maxCharClip ); |
87 | m_daysLookAhead = cfg.readNumEntry( "dayslookahead", 14 ); | 114 | m_daysLookAhead = cfg.readNumEntry( "dayslookahead", 14 ); |
88 | SpinDaysClip->setValue( m_daysLookAhead ); | 115 | SpinDaysClip->setValue( m_daysLookAhead ); |
89 | m_entryColor = cfg.readEntry( "entrycolor", Qt::red.name() ); | 116 | m_urgentDays = cfg.readNumEntry( "urgentdays", 7 ); |
117 | SpinUrgentClip->setValue( m_urgentDays ); | ||
118 | |||
119 | m_entryColor = cfg.readEntry( "entrycolor", Qt::black.name() ); | ||
120 | entryColor->setColor( QColor( m_entryColor ) ); | ||
121 | m_headlineColor = cfg.readEntry( "headlinecolor", Qt::black.name() ); | ||
122 | headlineColor->setColor( QColor( m_headlineColor ) ); | ||
123 | m_urgentColor = cfg.readEntry( "urgentcolor", Qt::red.name() ); | ||
124 | urgentColor->setColor( QColor( m_urgentColor ) ); | ||
90 | } | 125 | } |
91 | 126 | ||
92 | 127 | ||
@@ -99,8 +134,17 @@ void AddressBookPluginConfig::writeConfig() { | |||
99 | cfg.writeEntry( "maxcharclip", m_maxCharClip ); | 134 | cfg.writeEntry( "maxcharclip", m_maxCharClip ); |
100 | m_daysLookAhead = SpinDaysClip->value(); | 135 | m_daysLookAhead = SpinDaysClip->value(); |
101 | cfg.writeEntry( "dayslookahead", m_daysLookAhead ); | 136 | cfg.writeEntry( "dayslookahead", m_daysLookAhead ); |
137 | m_urgentDays = SpinUrgentClip->value(); | ||
138 | if ( m_urgentDays > m_daysLookAhead ) | ||
139 | m_urgentDays = m_daysLookAhead; | ||
140 | cfg.writeEntry( "urgentdays", m_urgentDays ); | ||
141 | |||
102 | m_entryColor = entryColor->color().name(); | 142 | m_entryColor = entryColor->color().name(); |
103 | cfg.writeEntry( "entrycolor", m_entryColor ); | 143 | cfg.writeEntry( "entrycolor", m_entryColor ); |
144 | m_headlineColor = headlineColor->color().name(); | ||
145 | cfg.writeEntry( "headlinecolor", m_headlineColor ); | ||
146 | m_urgentColor = urgentColor->color().name(); | ||
147 | cfg.writeEntry( "urgentcolor", m_urgentColor ); | ||
104 | cfg.write(); | 148 | cfg.write(); |
105 | } | 149 | } |
106 | 150 | ||