29 #include <KAcceleratorManager>
30 #include <KComponentData>
34 KComponentData inst(
"kcmtodosummary" );
43 customDaysChanged( 7 );
45 connect( mDateTodayButton, SIGNAL(clicked(
bool)), SLOT(modified()) );
46 connect( mDateMonthButton, SIGNAL(clicked(
bool)), SLOT(modified()) );
47 connect( mDateRangeButton, SIGNAL(clicked(
bool)), SLOT(modified()) );
49 connect( mHideCompletedBox, SIGNAL(stateChanged(
int)), SLOT(modified()) );
50 connect( mHideOpenEndedBox, SIGNAL(stateChanged(
int)), SLOT(modified()) );
51 connect( mHideUnstartedBox, SIGNAL(stateChanged(
int)), SLOT(modified()) );
52 connect( mHideInProgressBox, SIGNAL(stateChanged(
int)), SLOT(modified()) );
53 connect( mHideOverdueBox, SIGNAL(stateChanged(
int)), SLOT(modified()) );
55 connect( mCustomDays, SIGNAL(valueChanged(
int)), SLOT(modified()) );
56 connect( mCustomDays, SIGNAL(valueChanged(
int)), SLOT(customDaysChanged(
int)) );
58 connect( mShowMineOnly, SIGNAL(stateChanged(
int)), SLOT(modified()) );
60 KAcceleratorManager::manage(
this );
69 void KCMTodoSummary::modified()
74 void KCMTodoSummary::customDaysChanged(
int value )
76 mCustomDays->setSuffix( i18np(
" day",
" days", value ) );
82 KConfigGroup group = config.group(
"Days" );
84 int days = group.readEntry(
"DaysToShow", 7 );
86 mDateTodayButton->setChecked(
true );
87 }
else if ( days == 31 ) {
88 mDateMonthButton->setChecked(
true );
90 mDateRangeButton->setChecked(
true );
91 mCustomDays->setValue( days );
92 mCustomDays->setEnabled(
true );
95 group = config.group(
"Hide" );
96 mHideInProgressBox->setChecked( group.readEntry(
"InProgress",
false ) );
97 mHideOverdueBox->setChecked( group.readEntry(
"Overdue",
false ) );
98 mHideCompletedBox->setChecked( group.readEntry(
"Completed",
true ) );
99 mHideOpenEndedBox->setChecked( group.readEntry(
"OpenEnded",
false ) );
100 mHideUnstartedBox->setChecked( group.readEntry(
"NotStarted",
false ) );
102 group = config.group(
"Groupware" );
103 mShowMineOnly->setChecked( group.readEntry(
"ShowMineOnly",
false ) );
105 emit changed(
false );
111 KConfigGroup group = config.group(
"Days" );
114 if ( mDateTodayButton->isChecked() ) {
116 }
else if ( mDateMonthButton->isChecked() ) {
119 days = mCustomDays->value();
121 group.writeEntry(
"DaysToShow", days );
123 group = config.group(
"Hide" );
124 group.writeEntry(
"InProgress", mHideInProgressBox->isChecked() );
125 group.writeEntry(
"Overdue", mHideOverdueBox->isChecked() );
126 group.writeEntry(
"Completed", mHideCompletedBox->isChecked() );
127 group.writeEntry(
"OpenEnded", mHideOpenEndedBox->isChecked() );
128 group.writeEntry(
"NotStarted", mHideUnstartedBox->isChecked() );
130 group = config.group(
"Groupware" );
131 group.writeEntry(
"ShowMineOnly", mShowMineOnly->isChecked() );
134 emit changed(
false );
139 mDateRangeButton->setChecked(
true );
140 mCustomDays->setValue( 7 );
141 mCustomDays->setEnabled(
true );
143 mHideInProgressBox->setChecked(
false );
144 mHideOverdueBox->setChecked(
false );
145 mHideCompletedBox->setChecked(
true );
146 mHideOpenEndedBox->setChecked(
false );
147 mHideUnstartedBox->setChecked(
false );
149 mShowMineOnly->setChecked(
false );
151 emit changed(
true );
156 KAboutData *about =
new KAboutData(
157 I18N_NOOP(
"kcmtodosummary" ), 0,
158 ki18n(
"Pending To-dos Configuration Dialog" ),
159 0, KLocalizedString(), KAboutData::License_GPL,
160 ki18n(
"Copyright © 2003–2004 Tobias Koenig\n"
161 "Copyright © 2005–2010 Allen Winter" ) );
163 about->addAuthor( ki18n(
"Tobias Koenig" ),
164 KLocalizedString(),
"tokoe@kde.org" );
165 about->addAuthor( ki18n(
"Allen Winter" ),
166 KLocalizedString(),
"winter@kde.org" );
KCMTodoSummary(const KComponentData &inst, QWidget *parent=0)
virtual ~KCMTodoSummary()
KCModule * create_todosummary(QWidget *parent, const char *)
const KAboutData * aboutData() const