120
120
Akonadi::Control::start();
122
122
BirthdayModel* model = BirthdayModel::instance();
123
connect(model, SIGNAL(dataChanged(const QModelIndex&,const QModelIndex&)), SLOT(resizeViewColumns()));
123
connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), SLOT(resizeViewColumns()));
125
125
KDescendantsProxyModel* descendantsModel = new KDescendantsProxyModel(this);
126
126
descendantsModel->setSourceModel(model);
145
145
mListView->setTextElideMode(Qt::ElideRight);
146
146
mListView->header()->setResizeMode(BirthdayModel::NameColumn, QHeaderView::Stretch);
147
147
mListView->header()->setResizeMode(BirthdayModel::DateColumn, QHeaderView::ResizeToContents);
148
connect(mListView->selectionModel(), SIGNAL(selectionChanged(const QItemSelection&,const QItemSelection&)), SLOT(slotSelectionChanged()));
148
connect(mListView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), SLOT(slotSelectionChanged()));
149
149
mListView->setWhatsThis(i18nc("@info:whatsthis",
150
150
"<para>Select birthdays to set alarms for.<nl/>"
151
151
"This list shows all birthdays in <application>KAddressBook</application> except those for which alarms already exist.</para>"
173
173
mFontColourButton = new FontColourButton(group);
174
174
mFontColourButton->setMaximumHeight(mFontColourButton->sizeHint().height() * 3/2);
175
175
hlayout->addWidget(mFontColourButton);
176
connect(mFontColourButton, SIGNAL(selected(const QColor&, const QColor&)), SLOT(setColours(const QColor&, const QColor&)));
176
connect(mFontColourButton, SIGNAL(selected(QColor,QColor)), SLOT(setColours(QColor,QColor)));
178
178
// How much advance warning to give
179
179
mReminder = new Reminder(i18nc("@info:whatsthis", "Check to display a reminder in advance of or after the birthday."),
248
248
/******************************************************************************
249
249
* Return a list of events for birthdays chosen.
251
QList<KAEvent> BirthdayDlg::events() const
251
QVector<KAEvent> BirthdayDlg::events() const
253
QVector<KAEvent> list;
254
254
QModelIndexList indexes = mListView->selectionModel()->selectedRows();
255
255
int count = indexes.count();
269
269
if (date <= today)
270
270
date.setYMD(thisYear + 1, date.month(), date.day());
271
271
KAEvent event(KDateTime(date, KDateTime::ClockTime),
272
mPrefix->text() + name + mSuffix->text(),
273
mFontColourButton->bgColour(), mFontColourButton->fgColour(),
274
mFontColourButton->font(), KAEvent::MESSAGE, mLateCancel->minutes(),
272
mPrefix->text() + name + mSuffix->text(),
273
mFontColourButton->bgColour(), mFontColourButton->fgColour(),
274
mFontColourButton->font(), KAEvent::MESSAGE, mLateCancel->minutes(),
276
276
float fadeVolume;
278
278
float volume = mSoundPicker->volume(fadeVolume, fadeSecs);
279
event.setAudioFile(mSoundPicker->file().prettyUrl(), volume, fadeVolume, fadeSecs);
281
months.append(date.month());
279
int repeatPause = mSoundPicker->repeatPause();
280
event.setAudioFile(mSoundPicker->file().prettyUrl(), volume, fadeVolume, fadeSecs, repeatPause);
281
QVector<int> months(1, date.month());
282
282
event.setRecurAnnualByDate(1, months, 0, KARecurrence::defaultFeb29Type(), -1, QDate());
283
283
event.setRepetition(mSubRepetition->repetition());
284
284
event.setNextOccurrence(todayStart);
306
306
config.writeEntry("BirthdaySuffix", mSuffix->text());
309
mFlags = (mSoundPicker->sound() == Preferences::Sound_Beep ? KAEvent::BEEP : 0)
310
| (mSoundPicker->repeat() ? KAEvent::REPEAT_SOUND : 0)
311
| (mConfirmAck->isChecked() ? KAEvent::CONFIRM_ACK : 0)
312
| (mFontColourButton->defaultFont() ? KAEvent::DEFAULT_FONT : 0)
309
mFlags = KAEvent::ANY_TIME;
310
if (mSoundPicker->sound() == Preferences::Sound_Beep) mFlags |= KAEvent::BEEP;
311
if (mSoundPicker->repeatPause() >= 0) mFlags |= KAEvent::REPEAT_SOUND;
312
if (mConfirmAck->isChecked()) mFlags |= KAEvent::CONFIRM_ACK;
313
if (mFontColourButton->defaultFont()) mFlags |= KAEvent::DEFAULT_FONT;
314
314
KDialog::accept();