29 #include <KComponentData>
35 KComponentData inst(
"kcmplanner" );
45 customDaysChanged( 7 );
47 connect( mShowRecurrence, SIGNAL(stateChanged(
int)), SLOT(modified()) );
48 connect( mShowReminder, SIGNAL(stateChanged(
int)), SLOT(modified()) );
49 connect( mUnderline, SIGNAL(stateChanged(
int)), SLOT(modified()) );
50 connect( mTodo, SIGNAL(stateChanged(
int)), SLOT(modified()) );
51 connect( mSd, SIGNAL(stateChanged(
int)), SLOT(modified()) );
53 connect( mDateTodayButton, SIGNAL(clicked(
bool)), SLOT(modified()) );
54 connect( mDateMonthButton, SIGNAL(clicked(
bool)), SLOT(modified()) );
55 connect( mDateRangeButton, SIGNAL(clicked(
bool)), SLOT(modified()) );
57 connect( mHideCompletedBox, SIGNAL(stateChanged(
int)), SLOT(modified()) );
58 connect( mHideOpenEndedBox, SIGNAL(stateChanged(
int)), SLOT(modified()) );
59 connect( mHideUnstartedBox, SIGNAL(stateChanged(
int)), SLOT(modified()) );
60 connect( mHideInProgressBox, SIGNAL(stateChanged(
int)), SLOT(modified()) );
61 connect( mHideOverdueBox, SIGNAL(stateChanged(
int)), SLOT(modified()) );
63 connect( mCustomDays, SIGNAL(valueChanged(
int)), SLOT(modified()) );
64 connect( mCustomDays, SIGNAL(valueChanged(
int)), SLOT(customDaysChanged(
int)) );
67 connect( mBirthdayConList, SIGNAL(stateChanged(
int)), SLOT(modified()) );
69 connect( mAnniversariesConList, SIGNAL(stateChanged(
int)), SLOT(modified()) );
70 connect( mHolidaysCal, SIGNAL(stateChanged(
int)), SLOT(modified()) );
71 connect( mSpecialOccasionsCal, SIGNAL(stateChanged(
int)), SLOT(modified()) );
73 connect( mShowMyEventsOnly, SIGNAL(stateChanged(
int)), SLOT(modified()) );
74 connect( mShowMyTodosOnly, SIGNAL(stateChanged(
int)), SLOT(modified()) );
83 void KCMPlanner::modified()
88 void KCMPlanner::customDaysChanged(
int value )
90 mCustomDays->setSuffix( i18np(
" day",
" days", value ) );
93 void KCMPlanner::buttonClicked(
bool state )
95 mCustomDays->setEnabled( state );
100 KConfig config(
"plannerrc" );
103 KConfigGroup group = config.group(
"General" );
105 mShowRecurrence->setChecked( group.readEntry(
"ShowRecurrence",
true ) );
106 mShowReminder->setChecked( group.readEntry(
"ShowReminder",
true ) );
107 mUnderline->setChecked( group.readEntry(
"underlineLink",
true ) );
108 mTodo->setChecked( group.readEntry(
"ShowTodo",
true ) );
109 mSd->setChecked( group.readEntry(
"ShowSd",
true ) );
112 group = config.group(
"Calendar" );
115 int days = group.readEntry(
"DaysToShow", 7 );
117 mDateTodayButton->setChecked(
true );
118 }
else if( days == 31 ) {
119 mDateMonthButton->setChecked(
true );
121 mDateRangeButton->setChecked(
true );
122 mCustomDays->setValue( days );
123 mCustomDays->setEnabled(
true );
127 group = config.group(
"Hide" );
128 mHideInProgressBox->setChecked( group.readEntry(
"InProgress",
false ) );
129 mHideOverdueBox->setChecked( group.readEntry(
"Overdue",
false ) );
130 mHideCompletedBox->setChecked( group.readEntry(
"Completed",
true ) );
131 mHideOpenEndedBox->setChecked( group.readEntry(
"OpenEnded",
false ) );
132 mHideUnstartedBox->setChecked( group.readEntry(
"NotStarted",
false ) );
135 group = config.group(
"SpecialDates" );
138 mBirthdayConList->setChecked( group.readEntry(
"BirthdayConList",
true ) );
140 mAnniversariesConList->setChecked( group.readEntry(
"AnniversariesConList",
true ) );
141 mHolidaysCal->setChecked( group.readEntry (
"HolidaysCal",
true ) );
142 mSpecialOccasionsCal->setChecked( group.readEntry(
"SpecialOccasionsCal",
true ) );
145 group = config.group(
"Groupware" );
146 mShowMyEventsOnly->setChecked( group.readEntry(
"ShowMyEventsOnly",
false ) );
147 mShowMyTodosOnly->setChecked( group.readEntry(
"ShowMyTodosOnly",
false ) );
149 emit changed(
false );
154 KConfig config(
"plannerrc" );
157 KConfigGroup group = config.group(
"General" );
159 group.writeEntry(
"ShowRecurrence", mShowRecurrence->isChecked() );
160 group.writeEntry(
"ShowReminder", mShowReminder->isChecked() );
161 group.writeEntry(
"underlineLink", mUnderline->isChecked() );
162 group.writeEntry(
"ShowTodo", mTodo->isChecked() );
163 group.writeEntry(
"ShowSd", mSd->isChecked() );
166 group = config.group(
"Calendar" );
169 if ( mDateTodayButton->isChecked() ) {
171 }
else if ( mDateMonthButton->isChecked() ) {
174 days = mCustomDays->value();
176 group.writeEntry(
"DaysToShow", days );
179 group = config.group(
"Hide" );
180 group.writeEntry(
"InProgress", mHideInProgressBox->isChecked() );
181 group.writeEntry(
"Overdue", mHideOverdueBox->isChecked() );
182 group.writeEntry(
"Completed", mHideCompletedBox->isChecked() );
183 group.writeEntry(
"OpenEnded", mHideOpenEndedBox->isChecked() );
184 group.writeEntry(
"NotStarted", mHideUnstartedBox->isChecked() );
187 group = config.group(
"SpecialDates" );
190 group.writeEntry(
"BirthdayConList", mBirthdayConList->isChecked() );
192 group.writeEntry(
"AnniversariesConList", mAnniversariesConList->isChecked() );
193 group.writeEntry(
"HolidaysCal", mHolidaysCal->isChecked() );
194 group.writeEntry(
"SpecialOccasionsCal", mSpecialOccasionsCal->isChecked() );
197 group = config.group(
"Groupware" );
198 group.writeEntry(
"ShowMyEventsOnly", mShowMyEventsOnly->isChecked() );
199 group.writeEntry(
"ShowMyTodosOnly", mShowMyTodosOnly->isChecked() );
203 emit changed(
false );
208 mShowRecurrence->setChecked(
true );
209 mShowReminder->setChecked(
true );
210 mUnderline->setChecked(
true );
211 mTodo->setChecked(
true );
212 mSd->setChecked(
true );
214 mDateRangeButton->setChecked(
true );
215 mCustomDays->setValue( 7 );
216 mCustomDays->setEnabled(
true );
218 mHideInProgressBox->setChecked(
false );
219 mHideOverdueBox->setChecked(
false );
220 mHideCompletedBox->setChecked(
true );
221 mHideOpenEndedBox->setChecked(
false );
222 mHideUnstartedBox->setChecked(
false );
225 mBirthdayConList->setChecked(
true );
227 mAnniversariesConList->setChecked(
true );
228 mHolidaysCal->setChecked(
true );
229 mSpecialOccasionsCal->setChecked(
true );
231 mShowMyEventsOnly->setChecked(
false );
232 mShowMyTodosOnly->setChecked(
false );
234 emit changed(
true );
239 KAboutData *about =
new KAboutData(
240 I18N_NOOP(
"kcmplanner" ),
242 ki18n(
"Planner Summary Configuration Dialog" ),
245 KAboutData::License_GPL,
246 ki18n(
"Copyright © 2004 Tobias Koenig\n"
247 "Copyright © 2006–2008 Oral Timocin\n"
248 "Copyright © 2009–2010 Allen Winter" ) );
250 about->addAuthor( ki18n(
"Tobias Koenig" ), KLocalizedString(),
"tokoe@kde.org" );
251 about->addAuthor( ki18n(
"Allen Winter" ), KLocalizedString(),
"winter@kde.org" );
252 about->addAuthor( ki18n(
"Oral Timocin" ), KLocalizedString(),
"o.timocin.kde@gmx.de" );
257 #include "kcmplanner.moc"
KCMPlanner(const KComponentData &inst, QWidget *parent=0)
const KAboutData * aboutData() const
KCModule * create_planner(QWidget *parent, const char *)