~ubuntu-branches/ubuntu/quantal/kdepim/quantal

« back to all changes in this revision

Viewing changes to kalarm/birthdaydlg.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2011-12-15 14:17:51 UTC
  • mto: This revision was merged to the branch mainline in revision 193.
  • Revision ID: package-import@ubuntu.com-20111215141751-bmhdpiwl23wd9w26
Tags: upstream-4.7.90
ImportĀ upstreamĀ versionĀ 4.7.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
120
120
    Akonadi::Control::start();
121
121
 
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()));
124
124
 
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)));
177
177
 
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.
250
250
*/
251
 
QList<KAEvent> BirthdayDlg::events() const
 
251
QVector<KAEvent> BirthdayDlg::events() const
252
252
{
253
 
    QList<KAEvent> list;
 
253
    QVector<KAEvent> list;
254
254
    QModelIndexList indexes = mListView->selectionModel()->selectedRows();
255
255
    int count = indexes.count();
256
256
    if (!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(),
275
 
                  mFlags, true);
 
272
                      mPrefix->text() + name + mSuffix->text(),
 
273
                      mFontColourButton->bgColour(), mFontColourButton->fgColour(),
 
274
                      mFontColourButton->font(), KAEvent::MESSAGE, mLateCancel->minutes(),
 
275
                      mFlags, true);
276
276
        float fadeVolume;
277
277
        int   fadeSecs;
278
278
        float volume = mSoundPicker->volume(fadeVolume, fadeSecs);
279
 
        event.setAudioFile(mSoundPicker->file().prettyUrl(), volume, fadeVolume, fadeSecs);
280
 
        QList<int> months;
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());
307
307
    config.sync();
308
308
 
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)
313
 
           |                                                     KAEvent::ANY_TIME;
 
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();
315
315
}
316
316