author | eilers <eilers> | 2003-01-05 14:50:40 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-01-05 14:50:40 (UTC) |
commit | f887403341dd82d46d26695acc308cc8801cd6aa (patch) (unidiff) | |
tree | be64ebf1809706120972faac630577add4ad6d5e | |
parent | 3eecce3109b543a5abd6a36a420fa3f53cc23023 (diff) | |
download | opie-f887403341dd82d46d26695acc308cc8801cd6aa.zip opie-f887403341dd82d46d26695acc308cc8801cd6aa.tar.gz opie-f887403341dd82d46d26695acc308cc8801cd6aa.tar.bz2 |
Color for entries is now customizeable
4 files changed, 19 insertions, 2 deletions
diff --git a/core/pim/today/plugins/addressbook/addresspluginconfig.cpp b/core/pim/today/plugins/addressbook/addresspluginconfig.cpp index 686d72c..f00cffe 100644 --- a/core/pim/today/plugins/addressbook/addresspluginconfig.cpp +++ b/core/pim/today/plugins/addressbook/addresspluginconfig.cpp | |||
@@ -61,9 +61,18 @@ AddressBookPluginConfig::AddressBookPluginConfig( QWidget *parent, const char* | |||
61 | SpinDaysClip->setMaxValue( 200 ); | 61 | SpinDaysClip->setMaxValue( 200 ); |
62 | QWhatsThis::add( SpinDaysClip , tr( "How many days we should search forward" ) ); | 62 | QWhatsThis::add( SpinDaysClip , tr( "How many days we should search forward" ) ); |
63 | 63 | ||
64 | QHBox *box4 = new QHBox( this ); | ||
65 | |||
66 | QLabel* colorLabel = new QLabel( box4, "" ); | ||
67 | colorLabel->setText( tr( "Set Entry Color \n(restart Today \nafter change!)" ) ); | ||
68 | |||
69 | entryColor = new OColorButton( box4, red, "entryColor" ); | ||
70 | QWhatsThis::add( entryColor , tr( "What color should be used for shown birthdays/anniversaries?" ) ); | ||
71 | |||
64 | layout->addWidget( box1 ); | 72 | layout->addWidget( box1 ); |
65 | layout->addWidget( box2 ); | 73 | layout->addWidget( box2 ); |
66 | layout->addWidget( box3 ); | 74 | layout->addWidget( box3 ); |
75 | layout->addWidget( box4 ); | ||
67 | 76 | ||
68 | readConfig(); | 77 | readConfig(); |
69 | } | 78 | } |
@@ -77,6 +86,7 @@ void AddressBookPluginConfig::readConfig() { | |||
77 | SpinBoxClip->setValue( m_maxCharClip ); | 86 | SpinBoxClip->setValue( m_maxCharClip ); |
78 | m_daysLookAhead = cfg.readNumEntry( "dayslookahead", 14 ); | 87 | m_daysLookAhead = cfg.readNumEntry( "dayslookahead", 14 ); |
79 | SpinDaysClip->setValue( m_daysLookAhead ); | 88 | SpinDaysClip->setValue( m_daysLookAhead ); |
89 | m_entryColor = cfg.readEntry( "entrycolor", Qt::red.name() ); | ||
80 | } | 90 | } |
81 | 91 | ||
82 | 92 | ||
@@ -89,6 +99,8 @@ void AddressBookPluginConfig::writeConfig() { | |||
89 | cfg.writeEntry( "maxcharclip", m_maxCharClip ); | 99 | cfg.writeEntry( "maxcharclip", m_maxCharClip ); |
90 | m_daysLookAhead = SpinDaysClip->value(); | 100 | m_daysLookAhead = SpinDaysClip->value(); |
91 | cfg.writeEntry( "dayslookahead", m_daysLookAhead ); | 101 | cfg.writeEntry( "dayslookahead", m_daysLookAhead ); |
102 | m_entryColor = entryColor->color().name(); | ||
103 | cfg.writeEntry( "entrycolor", m_entryColor ); | ||
92 | cfg.write(); | 104 | cfg.write(); |
93 | } | 105 | } |
94 | 106 | ||
diff --git a/core/pim/today/plugins/addressbook/addresspluginconfig.h b/core/pim/today/plugins/addressbook/addresspluginconfig.h index 6f128d4..54c8b4f 100644 --- a/core/pim/today/plugins/addressbook/addresspluginconfig.h +++ b/core/pim/today/plugins/addressbook/addresspluginconfig.h | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <qspinbox.h> | 23 | #include <qspinbox.h> |
24 | 24 | ||
25 | #include <opie/todayconfigwidget.h> | 25 | #include <opie/todayconfigwidget.h> |
26 | #include <opie/ocolorbutton.h> | ||
26 | 27 | ||
27 | class AddressBookPluginConfig : public TodayConfigWidget { | 28 | class AddressBookPluginConfig : public TodayConfigWidget { |
28 | 29 | ||
@@ -43,6 +44,7 @@ private: | |||
43 | QSpinBox* SpinBox2; | 44 | QSpinBox* SpinBox2; |
44 | QSpinBox* SpinBoxClip; | 45 | QSpinBox* SpinBoxClip; |
45 | QSpinBox* SpinDaysClip; | 46 | QSpinBox* SpinDaysClip; |
47 | OColorButton* entryColor; | ||
46 | 48 | ||
47 | // how many lines should be showed in the AddressBook section | 49 | // how many lines should be showed in the AddressBook section |
48 | int m_max_lines_task; | 50 | int m_max_lines_task; |
@@ -50,7 +52,8 @@ private: | |||
50 | int m_maxCharClip; | 52 | int m_maxCharClip; |
51 | // How many days look ahead | 53 | // How many days look ahead |
52 | int m_daysLookAhead; | 54 | int m_daysLookAhead; |
53 | 55 | // Entry Color | |
56 | QString m_entryColor; | ||
54 | }; | 57 | }; |
55 | 58 | ||
56 | 59 | ||
diff --git a/core/pim/today/plugins/addressbook/addresspluginwidget.cpp b/core/pim/today/plugins/addressbook/addresspluginwidget.cpp index 0d4cec8..c81beee 100644 --- a/core/pim/today/plugins/addressbook/addresspluginwidget.cpp +++ b/core/pim/today/plugins/addressbook/addresspluginwidget.cpp | |||
@@ -71,6 +71,7 @@ void AddressBookPluginWidget::readConfig() { | |||
71 | m_maxLinesTask = cfg.readNumEntry( "maxlinestask", 5 ); | 71 | m_maxLinesTask = cfg.readNumEntry( "maxlinestask", 5 ); |
72 | m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 ); | 72 | m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 ); |
73 | m_daysLookAhead = cfg.readNumEntry( "dayslookahead", 14 ); | 73 | m_daysLookAhead = cfg.readNumEntry( "dayslookahead", 14 ); |
74 | m_entryColor = cfg.readEntry("entrycolor", Qt::red.name() ); | ||
74 | } | 75 | } |
75 | 76 | ||
76 | 77 | ||
@@ -115,7 +116,7 @@ void AddressBookPluginWidget::getAddress() { | |||
115 | if ( QDate::currentDate().daysTo(destdate) < 0 ) | 116 | if ( QDate::currentDate().daysTo(destdate) < 0 ) |
116 | destdate.setYMD( QDate::currentDate().year()+1, destdate.month(), destdate.day() ); | 117 | destdate.setYMD( QDate::currentDate().year()+1, destdate.month(), destdate.day() ); |
117 | 118 | ||
118 | output += "<font color=#e00000><b>-" + (*m_it).fullName() | 119 | output += "<font color=" + m_entryColor + "><b>-" + (*m_it).fullName() |
119 | + " (" | 120 | + " (" |
120 | + QString::number(QDate::currentDate().daysTo(destdate)) | 121 | + QString::number(QDate::currentDate().daysTo(destdate)) |
121 | + " Days) </b></font><br>"; | 122 | + " Days) </b></font><br>"; |
diff --git a/core/pim/today/plugins/addressbook/addresspluginwidget.h b/core/pim/today/plugins/addressbook/addresspluginwidget.h index 75e223a..fa464de 100644 --- a/core/pim/today/plugins/addressbook/addresspluginwidget.h +++ b/core/pim/today/plugins/addressbook/addresspluginwidget.h | |||
@@ -52,6 +52,7 @@ private: | |||
52 | int m_maxLinesTask; | 52 | int m_maxLinesTask; |
53 | int m_maxCharClip; | 53 | int m_maxCharClip; |
54 | int m_daysLookAhead; | 54 | int m_daysLookAhead; |
55 | QString m_entryColor; | ||
55 | }; | 56 | }; |
56 | 57 | ||
57 | #endif | 58 | #endif |