Commit 5070cf99 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port to new connect api

parent ee06ca97
......@@ -100,7 +100,7 @@ void AlarmTimeWidget::init(Mode mode, const QString& title)
}
mDeferring = mode & DEFER_TIME;
mButtonGroup = new ButtonGroup(this);
connect(mButtonGroup, SIGNAL(buttonSet(QAbstractButton*)), SLOT(slotButtonSet(QAbstractButton*)));
connect(mButtonGroup, &ButtonGroup::buttonSet, this, &AlarmTimeWidget::slotButtonSet);
QVBoxLayout* topLayout = new QVBoxLayout(topWidget);
topLayout->setSpacing(KDialog::spacingHint());
topLayout->setMargin(title.isEmpty() ? 0 : KDialog::marginHint());
......@@ -115,7 +115,7 @@ void AlarmTimeWidget::init(Mode mode, const QString& title)
// Date edit box
mDateEdit = new KDateComboBox(topWidget);
mDateEdit->setOptions(KDateComboBox::EditDate | KDateComboBox::SelectDate | KDateComboBox::DatePicker);
connect(mDateEdit, SIGNAL(dateEntered(QDate)), SLOT(dateTimeChanged()));
connect(mDateEdit, &KDateComboBox::dateEntered, this, &AlarmTimeWidget::dateTimeChanged);
mDateEdit->setWhatsThis(xi18nc("@info:whatsthis",
"<para>Enter the date to schedule the alarm.</para>"
"<para>%1</para>", (mDeferring ? tzText : recurText)));
......@@ -129,7 +129,7 @@ void AlarmTimeWidget::init(Mode mode, const QString& title)
mTimeEdit = new TimeEdit(timeBox);
timeBoxHLayout->addWidget(mTimeEdit);
mTimeEdit->setFixedSize(mTimeEdit->sizeHint());
connect(mTimeEdit, SIGNAL(valueChanged(int)), SLOT(dateTimeChanged()));
connect(mTimeEdit, &TimeEdit::valueChanged, this, &AlarmTimeWidget::dateTimeChanged);
mTimeEdit->setWhatsThis(xi18nc("@info:whatsthis",
"<para>Enter the time to schedule the alarm.</para>"
"<para>%1</para>"
......@@ -147,7 +147,7 @@ void AlarmTimeWidget::init(Mode mode, const QString& title)
mAnyTimeCheckBox = new CheckBox(i18nc("@option:check", "Any time"), timeBox);
timeBoxHLayout->addWidget(mAnyTimeCheckBox);
mAnyTimeCheckBox->setFixedSize(mAnyTimeCheckBox->sizeHint());
connect(mAnyTimeCheckBox, SIGNAL(toggled(bool)), SLOT(slotAnyTimeToggled(bool)));
connect(mAnyTimeCheckBox, &CheckBox::toggled, this, &AlarmTimeWidget::slotAnyTimeToggled);
mAnyTimeCheckBox->setWhatsThis(i18nc("@info:whatsthis",
"Check to specify only a date (without a time) for the alarm. The alarm will trigger at the first opportunity on the selected date."));
}
......@@ -163,7 +163,7 @@ void AlarmTimeWidget::init(Mode mode, const QString& title)
mDelayTimeEdit = new TimeSpinBox(1, maxDelayTime, topWidget);
mDelayTimeEdit->setValue(1439);
mDelayTimeEdit->setFixedSize(mDelayTimeEdit->sizeHint());
connect(mDelayTimeEdit, SIGNAL(valueChanged(int)), SLOT(delayTimeChanged(int)));
connect(mDelayTimeEdit, static_cast<void (TimeSpinBox::*)(int)>(&TimeSpinBox::valueChanged), this, &AlarmTimeWidget::delayTimeChanged);
mDelayTimeEdit->setWhatsThis(mDeferring ? xi18nc("@info:whatsthis", "<para>%1</para><para>%2</para>", i18n_TimeAfterPeriod(), TimeSpinBox::shiftWhatsThis())
: xi18nc("@info:whatsthis", "<para>%1</para><para>%2</para><para>%3</para>", i18n_TimeAfterPeriod(), recurText, TimeSpinBox::shiftWhatsThis()));
mAfterTimeRadio->setFocusWidget(mDelayTimeEdit);
......@@ -196,7 +196,7 @@ void AlarmTimeWidget::init(Mode mode, const QString& title)
// Time zone selection push button
mTimeZoneButton = new PushButton(i18nc("@action:button", "Time Zone..."), topWidget);
connect(mTimeZoneButton, SIGNAL(clicked()), SLOT(showTimeZoneSelector()));
connect(mTimeZoneButton, &PushButton::clicked, this, &AlarmTimeWidget::showTimeZoneSelector);
mTimeZoneButton->setWhatsThis(i18nc("@info:whatsthis",
"Choose a time zone for this alarm which is different from the default time zone set in KAlarm's configuration dialog."));
grid->addWidget(mTimeZoneButton, 2, 2, 1, 2, Qt::AlignRight);
......@@ -217,14 +217,14 @@ void AlarmTimeWidget::init(Mode mode, const QString& title)
mTimeZone = new TimeZoneCombo(mTimeZoneBox);
hlayout->addWidget(mTimeZone);
mTimeZone->setMaxVisibleItems(15);
connect(mTimeZone, SIGNAL(activated(int)), SLOT(slotTimeZoneChanged()));
connect(mTimeZone, static_cast<void (TimeZoneCombo::*)(int)>(&TimeZoneCombo::activated), this, &AlarmTimeWidget::slotTimeZoneChanged);
mTimeZoneBox->setWhatsThis(i18nc("@info:whatsthis", "Select the time zone to use for this alarm."));
label->setBuddy(mTimeZone);
layout->addWidget(mTimeZoneBox);
// Time zone checkbox
mNoTimeZone = new CheckBox(i18nc("@option:check", "Ignore time zone"), topWidget);
connect(mNoTimeZone, SIGNAL(toggled(bool)), SLOT(slotTimeZoneToggled(bool)));
connect(mNoTimeZone, &CheckBox::toggled, this, &AlarmTimeWidget::slotTimeZoneToggled);
mNoTimeZone->setWhatsThis(xi18nc("@info:whatsthis",
"<para>Check to use the local computer time, ignoring time zones.</para>"
"<para>You are recommended not to use this option if the alarm has a "
......
......@@ -117,8 +117,8 @@ RecurrenceEdit::RecurrenceEdit(bool readOnly, QWidget* parent)
vlayout->setMargin(0);
hlayout->addLayout(vlayout);
mRuleButtonGroup = new ButtonGroup(recurGroup);
connect(mRuleButtonGroup, SIGNAL(buttonSet(QAbstractButton*)), SLOT(periodClicked(QAbstractButton*)));
connect(mRuleButtonGroup, SIGNAL(buttonSet(QAbstractButton*)), SIGNAL(contentsChanged()));
connect(mRuleButtonGroup, &ButtonGroup::buttonSet, this, &RecurrenceEdit::periodClicked);
connect(mRuleButtonGroup, &ButtonGroup::buttonSet, this, &RecurrenceEdit::contentsChanged);
mNoneButton = new RadioButton(i18n_combo_NoRecur(), recurGroup);
mNoneButton->setFixedSize(mNoneButton->sizeHint());
......@@ -178,9 +178,9 @@ RecurrenceEdit::RecurrenceEdit(bool readOnly, QWidget* parent)
mSubRepetition->setReadOnly(mReadOnly);
mSubRepetition->setWhatsThis(i18nc("@info:whatsthis",
"Set up a repetition within the recurrence, to trigger the alarm multiple times each time the recurrence is due."));
connect(mSubRepetition, SIGNAL(needsInitialisation()), SIGNAL(repeatNeedsInitialisation()));
connect(mSubRepetition, SIGNAL(changed()), SIGNAL(frequencyChanged()));
connect(mSubRepetition, SIGNAL(changed()), SIGNAL(contentsChanged()));
connect(mSubRepetition, &RepetitionButton::needsInitialisation, this, &RecurrenceEdit::repeatNeedsInitialisation);
connect(mSubRepetition, &RepetitionButton::changed, this, &RecurrenceEdit::frequencyChanged);
connect(mSubRepetition, &RepetitionButton::changed, this, &RecurrenceEdit::contentsChanged);
vlayout->addSpacing(KDialog::spacingHint());
vlayout->addWidget(mSubRepetition);
......@@ -203,16 +203,16 @@ RecurrenceEdit::RecurrenceEdit(bool readOnly, QWidget* parent)
mMonthlyRule = new MonthlyRule(mReadOnly, mRuleStack);
mYearlyRule = new YearlyRule(mReadOnly, mRuleStack);
connect(mSubDailyRule, SIGNAL(frequencyChanged()), SIGNAL(frequencyChanged()));
connect(mDailyRule, SIGNAL(frequencyChanged()), SIGNAL(frequencyChanged()));
connect(mWeeklyRule, SIGNAL(frequencyChanged()), SIGNAL(frequencyChanged()));
connect(mMonthlyRule, SIGNAL(frequencyChanged()), SIGNAL(frequencyChanged()));
connect(mYearlyRule, SIGNAL(frequencyChanged()), SIGNAL(frequencyChanged()));
connect(mSubDailyRule, SIGNAL(changed()), SIGNAL(contentsChanged()));
connect(mDailyRule, SIGNAL(changed()), SIGNAL(contentsChanged()));
connect(mWeeklyRule, SIGNAL(changed()), SIGNAL(contentsChanged()));
connect(mMonthlyRule, SIGNAL(changed()), SIGNAL(contentsChanged()));
connect(mYearlyRule, SIGNAL(changed()), SIGNAL(contentsChanged()));
connect(mSubDailyRule, &SubDailyRule::frequencyChanged, this, &RecurrenceEdit::frequencyChanged);
connect(mDailyRule, &DailyRule::frequencyChanged, this, &RecurrenceEdit::frequencyChanged);
connect(mWeeklyRule, &WeeklyRule::frequencyChanged, this, &RecurrenceEdit::frequencyChanged);
connect(mMonthlyRule, &MonthlyRule::frequencyChanged, this, &RecurrenceEdit::frequencyChanged);
connect(mYearlyRule, &YearlyRule::frequencyChanged, this, &RecurrenceEdit::frequencyChanged);
connect(mSubDailyRule, &SubDailyRule::changed, this, &RecurrenceEdit::contentsChanged);
connect(mDailyRule, &DailyRule::changed, this, &RecurrenceEdit::contentsChanged);
connect(mWeeklyRule, &WeeklyRule::changed, this, &RecurrenceEdit::contentsChanged);
connect(mMonthlyRule, &MonthlyRule::changed, this, &RecurrenceEdit::contentsChanged);
connect(mYearlyRule, &YearlyRule::changed, this, &RecurrenceEdit::contentsChanged);
mRuleStack->addWidget(mNoRule);
mRuleStack->addWidget(mSubDailyRule);
......@@ -228,8 +228,8 @@ RecurrenceEdit::RecurrenceEdit(bool readOnly, QWidget* parent)
mRangeButtonBox = new QGroupBox(i18nc("@title:group", "Recurrence End"), this);
topLayout->addWidget(mRangeButtonBox);
mRangeButtonGroup = new ButtonGroup(mRangeButtonBox);
connect(mRangeButtonGroup, SIGNAL(buttonSet(QAbstractButton*)), SLOT(rangeTypeClicked()));
connect(mRangeButtonGroup, SIGNAL(buttonSet(QAbstractButton*)), SIGNAL(contentsChanged()));
connect(mRangeButtonGroup, &ButtonGroup::buttonSet, this, &RecurrenceEdit::rangeTypeClicked);
connect(mRangeButtonGroup, &ButtonGroup::buttonSet, this, &RecurrenceEdit::contentsChanged);
vlayout = new QVBoxLayout(mRangeButtonBox);
vlayout->setMargin(KDialog::marginHint());
......@@ -255,8 +255,8 @@ RecurrenceEdit::RecurrenceEdit(bool readOnly, QWidget* parent)
mRepeatCountEntry->setSelectOnStep(false);
mRepeatCountEntry->setReadOnly(mReadOnly);
mRepeatCountEntry->setWhatsThis(i18nc("@info:whatsthis", "Enter the total number of times to trigger the alarm"));
connect(mRepeatCountEntry, SIGNAL(valueChanged(int)), SLOT(repeatCountChanged(int)));
connect(mRepeatCountEntry, SIGNAL(valueChanged(int)), SIGNAL(contentsChanged()));
connect(mRepeatCountEntry, static_cast<void (SpinBox::*)(int)>(&SpinBox::valueChanged), this, &RecurrenceEdit::repeatCountChanged);
connect(mRepeatCountEntry, static_cast<void (SpinBox::*)(int)>(&SpinBox::valueChanged), this, &RecurrenceEdit::contentsChanged);
mRepeatCountButton->setFocusWidget(mRepeatCountEntry);
mRepeatCountLabel = new QLabel(i18nc("@label", "occurrence(s)"), mRangeButtonBox);
mRepeatCountLabel->setFixedSize(mRepeatCountLabel->sizeHint());
......@@ -281,20 +281,20 @@ RecurrenceEdit::RecurrenceEdit(bool readOnly, QWidget* parent)
static const QString tzText = i18nc("@info", "This uses the same time zone as the start time.");
mEndDateEdit->setWhatsThis(xi18nc("@info:whatsthis",
"<para>Enter the last date to repeat the alarm.</para><para>%1</para>", tzText));
connect(mEndDateEdit, SIGNAL(dateEdited(QDate)), SIGNAL(contentsChanged()));
connect(mEndDateEdit, &KDateComboBox::dateEdited, this, &RecurrenceEdit::contentsChanged);
mEndDateButton->setFocusWidget(mEndDateEdit);
mEndTimeEdit = new TimeEdit(mRangeButtonBox);
mEndTimeEdit->setFixedSize(mEndTimeEdit->sizeHint());
mEndTimeEdit->setReadOnly(mReadOnly);
mEndTimeEdit->setWhatsThis(xi18nc("@info:whatsthis",
"<para>Enter the last time to repeat the alarm.</para><para>%1</para><para>%2</para>", tzText, TimeSpinBox::shiftWhatsThis()));
connect(mEndTimeEdit, SIGNAL(valueChanged(int)), SIGNAL(contentsChanged()));
connect(mEndTimeEdit, &TimeEdit::valueChanged, this, &RecurrenceEdit::contentsChanged);
mEndAnyTimeCheckBox = new CheckBox(i18nc("@option:check", "Any time"), mRangeButtonBox);
mEndAnyTimeCheckBox->setFixedSize(mEndAnyTimeCheckBox->sizeHint());
mEndAnyTimeCheckBox->setReadOnly(mReadOnly);
mEndAnyTimeCheckBox->setWhatsThis(i18nc("@info:whatsthis", "Stop repeating the alarm after your first login on or after the specified end date"));
connect(mEndAnyTimeCheckBox, SIGNAL(toggled(bool)), SLOT(slotAnyTimeToggled(bool)));
connect(mEndAnyTimeCheckBox, SIGNAL(toggled(bool)), SIGNAL(contentsChanged()));
connect(mEndAnyTimeCheckBox, &CheckBox::toggled, this, &RecurrenceEdit::slotAnyTimeToggled);
connect(mEndAnyTimeCheckBox, &CheckBox::toggled, this, &RecurrenceEdit::contentsChanged);
hlayout->addWidget(mEndDateButton);
hlayout->addSpacing(KDialog::spacingHint());
hlayout->addWidget(mEndDateEdit);
......@@ -322,7 +322,7 @@ RecurrenceEdit::RecurrenceEdit(bool readOnly, QWidget* parent)
mExceptionDateList = new ListWidget(mExceptionGroup);
mExceptionDateList->setWhatsThis(i18nc("@info:whatsthis", "The list of exceptions, i.e. dates/times excluded from the recurrence"));
connect(mExceptionDateList, SIGNAL(currentRowChanged(int)), SLOT(enableExceptionButtons()));
connect(mExceptionDateList, &QListWidget::currentRowChanged, this, &RecurrenceEdit::enableExceptionButtons);
vlayout->addWidget(mExceptionDateList);
if (mReadOnly)
......@@ -349,18 +349,18 @@ RecurrenceEdit::RecurrenceEdit(bool readOnly, QWidget* parent)
vlayout->addLayout(hlayout);
QPushButton* button = new QPushButton(i18nc("@action:button", "Add"), mExceptionGroup);
button->setWhatsThis(i18nc("@info:whatsthis", "Add the date entered above to the exceptions list"));
connect(button, SIGNAL(clicked()), SLOT(addException()));
connect(button, &QPushButton::clicked, this, &RecurrenceEdit::addException);
hlayout->addWidget(button);
mChangeExceptionButton = new QPushButton(i18nc("@action:button", "Change"), mExceptionGroup);
mChangeExceptionButton->setWhatsThis(i18nc("@info:whatsthis",
"Replace the currently highlighted item in the exceptions list with the date entered above"));
connect(mChangeExceptionButton, SIGNAL(clicked()), SLOT(changeException()));
connect(mChangeExceptionButton, &QPushButton::clicked, this, &RecurrenceEdit::changeException);
hlayout->addWidget(mChangeExceptionButton);
mDeleteExceptionButton = new QPushButton(i18nc("@action:button", "Delete"), mExceptionGroup);
mDeleteExceptionButton->setWhatsThis(i18nc("@info:whatsthis", "Remove the currently highlighted item from the exceptions list"));
connect(mDeleteExceptionButton, SIGNAL(clicked()), SLOT(deleteException()));
connect(mDeleteExceptionButton, &QPushButton::clicked, this, &RecurrenceEdit::deleteException);
hlayout->addWidget(mDeleteExceptionButton);
}
......@@ -371,7 +371,7 @@ RecurrenceEdit::RecurrenceEdit(bool readOnly, QWidget* parent)
mExcludeHolidays->setWhatsThis(xi18nc("@info:whatsthis",
"<para>Do not trigger the alarm on holidays.</para>"
"<para>You can specify your holiday region in the Configuration dialog.</para>"));
connect(mExcludeHolidays, SIGNAL(toggled(bool)), SIGNAL(contentsChanged()));
connect(mExcludeHolidays, &CheckBox::toggled, this, &RecurrenceEdit::contentsChanged);
vlayout->addWidget(mExcludeHolidays);
mWorkTimeOnly = new CheckBox(i18nc("@option:check", "Only during working time"), mExceptionGroup);
......@@ -379,7 +379,7 @@ RecurrenceEdit::RecurrenceEdit(bool readOnly, QWidget* parent)
mWorkTimeOnly->setWhatsThis(xi18nc("@info:whatsthis",
"<para>Only execute the alarm during working hours, on working days.</para>"
"<para>You can specify working days and hours in the Configuration dialog.</para>"));
connect(mWorkTimeOnly, SIGNAL(toggled(bool)), SIGNAL(contentsChanged()));
connect(mWorkTimeOnly, &CheckBox::toggled, this, &RecurrenceEdit::contentsChanged);
vlayout->addWidget(mWorkTimeOnly);
topLayout->addStretch();
......@@ -1360,8 +1360,8 @@ MonthYearRule::MonthYearRule(const QString& freqText, const QString& freqWhatsTh
mDayCombo->setReadOnly(readOnly);
mDayCombo->setWhatsThis(i18nc("@info:whatsthis", "Select the day of the month on which to repeat the alarm"));
mDayButton->setFocusWidget(mDayCombo);
connect(mDayCombo, SIGNAL(activated(int)), SLOT(slotDaySelected(int)));
connect(mDayCombo, SIGNAL(currentIndexChanged(int)), SIGNAL(changed()));
connect(mDayCombo, static_cast<void (ComboBox::*)(int)>(&ComboBox::activated), this, &MonthYearRule::slotDaySelected);
connect(mDayCombo, static_cast<void (ComboBox::*)(int)>(&ComboBox::currentIndexChanged), this, &MonthYearRule::changed);
box->setStretchFactor(new QWidget(box), 1); // left adjust the controls
box->setFixedHeight(box->sizeHint().height());
......@@ -1399,7 +1399,7 @@ MonthYearRule::MonthYearRule(const QString& freqText, const QString& freqWhatsTh
mWeekCombo->setFixedSize(mWeekCombo->sizeHint());
mWeekCombo->setReadOnly(readOnly);
mPosButton->setFocusWidget(mWeekCombo);
connect(mWeekCombo, SIGNAL(currentIndexChanged(int)), SIGNAL(changed()));
connect(mWeekCombo, static_cast<void (ComboBox::*)(int)>(&ComboBox::currentIndexChanged), this, &MonthYearRule::changed);
mDayOfWeekCombo = new ComboBox(box);
mDayOfWeekCombo->setEditable(false);
......@@ -1411,12 +1411,12 @@ MonthYearRule::MonthYearRule(const QString& freqText, const QString& freqWhatsTh
}
mDayOfWeekCombo->setReadOnly(readOnly);
mDayOfWeekCombo->setWhatsThis(i18nc("@info:whatsthis", "Select the day of the week on which to repeat the alarm"));
connect(mDayOfWeekCombo, SIGNAL(currentIndexChanged(int)), SIGNAL(changed()));
connect(mDayOfWeekCombo, static_cast<void (ComboBox::*)(int)>(&ComboBox::currentIndexChanged), this, &MonthYearRule::changed);
box->setStretchFactor(new QWidget(box), 1); // left adjust the controls
box->setFixedHeight(box->sizeHint().height());
connect(mButtonGroup, SIGNAL(buttonSet(QAbstractButton*)), SLOT(clicked(QAbstractButton*)));
connect(mButtonGroup, SIGNAL(buttonSet(QAbstractButton*)), SIGNAL(changed()));
connect(mButtonGroup, &ButtonGroup::buttonSet, this, &MonthYearRule::clicked);
connect(mButtonGroup, &ButtonGroup::buttonSet, this, &MonthYearRule::changed);
}
MonthYearRule::DayPosType MonthYearRule::type() const
......@@ -1593,7 +1593,7 @@ YearlyRule::YearlyRule(bool readOnly, QWidget* parent)
mFeb29Combo->addItem(i18nc("@item:inlistbox 28th February (short form)", "28 Feb"));
mFeb29Combo->setFixedSize(mFeb29Combo->sizeHint());
mFeb29Combo->setReadOnly(readOnly);
connect(mFeb29Combo, SIGNAL(currentIndexChanged(int)), SIGNAL(changed()));
connect(mFeb29Combo, static_cast<void (ComboBox::*)(int)>(&ComboBox::currentIndexChanged), this, &YearlyRule::changed);
mFeb29Label->setBuddy(mFeb29Combo);
box->setFixedSize(box->sizeHint());
box->setWhatsThis(i18nc("@info:whatsthis", "Select which date, if any, the February 29th alarm should trigger in non-leap years"));
......
......@@ -52,7 +52,7 @@ RepetitionButton::RepetitionButton(const QString& caption, bool waitForInitialis
{
setCheckable(true);
setChecked(false);
connect(this, SIGNAL(clicked()), SLOT(slotPressed()));
connect(this, &RepetitionButton::clicked, this, &RepetitionButton::slotPressed);
}
void RepetitionButton::set(const Repetition& repetition)
......@@ -164,14 +164,14 @@ RepetitionDlg::RepetitionDlg(const QString& caption, bool readOnly, QWidget* par
i18nc("@info:whatsthis", "Enter the time between repetitions of the alarm"),
true, page);
mTimeSelector->setFixedSize(mTimeSelector->sizeHint());
connect(mTimeSelector, SIGNAL(valueChanged(KCalCore::Duration)), SLOT(intervalChanged(KCalCore::Duration)));
connect(mTimeSelector, SIGNAL(toggled(bool)), SLOT(repetitionToggled(bool)));
connect(mTimeSelector, &TimeSelector::valueChanged, this, &RepetitionDlg::intervalChanged);
connect(mTimeSelector, &TimeSelector::toggled, this, &RepetitionDlg::repetitionToggled);
topLayout->addWidget(mTimeSelector, 0, Qt::AlignLeft);
mButtonBox = new QGroupBox(page);
topLayout->addWidget(mButtonBox);
mButtonGroup = new ButtonGroup(mButtonBox);
connect(mButtonGroup, SIGNAL(buttonSet(QAbstractButton*)), SLOT(typeClicked()));
connect(mButtonGroup, &ButtonGroup::buttonSet, this, &RepetitionDlg::typeClicked);
QVBoxLayout* vlayout = new QVBoxLayout(mButtonBox);
vlayout->setMargin(marginHint());
......@@ -188,7 +188,7 @@ RepetitionDlg::RepetitionDlg(const QString& caption, bool readOnly, QWidget* par
mCount->setFixedSize(mCount->sizeHint());
mCount->setSingleShiftStep(10);
mCount->setSelectOnStep(false);
connect(mCount, SIGNAL(valueChanged(int)), SLOT(countChanged(int)));
connect(mCount, static_cast<void (SpinBox::*)(int)>(&SpinBox::valueChanged), this, &RepetitionDlg::countChanged);
mCount->setWhatsThis(i18nc("@info:whatsthis", "Enter the number of times to trigger the alarm after its initial occurrence"));
layout->addWidget(mCount);
mCountButton->setFocusWidget(mCount);
......@@ -204,7 +204,7 @@ RepetitionDlg::RepetitionDlg(const QString& caption, bool readOnly, QWidget* par
layout->addWidget(mDurationButton);
mDuration = new TimePeriod(true, mButtonBox);
mDuration->setFixedSize(mDuration->sizeHint());
connect(mDuration, SIGNAL(valueChanged(KCalCore::Duration)), SLOT(durationChanged(KCalCore::Duration)));
connect(mDuration, &TimePeriod::valueChanged, this, &RepetitionDlg::durationChanged);
mDuration->setWhatsThis(i18nc("@info:whatsthis", "Enter the length of time to repeat the alarm"));
layout->addWidget(mDuration);
mDurationButton->setFocusWidget(mDuration);
......
......@@ -172,7 +172,7 @@ SoundWidget::SoundWidget(bool showPlay, bool showRepeat, QWidget* parent)
mFilePlay = new QPushButton(box);
boxHLayout->addWidget(mFilePlay);
mFilePlay->setIcon(SmallIcon(QLatin1String("media-playback-start")));
connect(mFilePlay, SIGNAL(clicked()), SLOT(playSound()));
connect(mFilePlay, &QPushButton::clicked, this, &SoundWidget::playSound);
mFilePlay->setToolTip(i18nc("@info:tooltip", "Test the sound"));
mFilePlay->setWhatsThis(i18nc("@info:whatsthis", "Play the selected sound file."));
}
......@@ -184,7 +184,7 @@ SoundWidget::SoundWidget(bool showPlay, bool showRepeat, QWidget* parent)
mFileEdit->setWhatsThis(i18nc("@info:whatsthis", "Enter the name or URL of a sound file to play."));
if (label)
label->setBuddy(mFileEdit);
connect(mFileEdit, SIGNAL(textChanged(QString)), SIGNAL(changed()));
connect(mFileEdit, &LineEdit::textChanged, this, &SoundWidget::changed);
// File browse button
mFileBrowseButton = new PushButton(box);
......@@ -192,7 +192,7 @@ SoundWidget::SoundWidget(bool showPlay, bool showRepeat, QWidget* parent)
mFileBrowseButton->setIcon(KIcon(SmallIcon(QLatin1String("document-open"))));
int size = mFileBrowseButton->sizeHint().height();
mFileBrowseButton->setFixedSize(size, size);
connect(mFileBrowseButton, SIGNAL(clicked()), SLOT(slotPickFile()));
connect(mFileBrowseButton, &PushButton::clicked, this, &SoundWidget::slotPickFile);
mFileBrowseButton->setToolTip(i18nc("@info:tooltip", "Choose a file"));
mFileBrowseButton->setWhatsThis(i18nc("@info:whatsthis", "Select a sound file to play."));
......@@ -209,7 +209,7 @@ SoundWidget::SoundWidget(bool showPlay, bool showRepeat, QWidget* parent)
mRepeatGroupBox = new GroupBox(i18n_chk_Repeat(), this);
mRepeatGroupBox->setCheckable(true);
mRepeatGroupBox->setWhatsThis(i18nc("@info:whatsthis", "If checked, the sound file will be played repeatedly for as long as the message is displayed."));
connect(mRepeatGroupBox, SIGNAL(toggled(bool)), SIGNAL(changed()));
connect(mRepeatGroupBox, &GroupBox::toggled, this, &SoundWidget::changed);
layout->addWidget(mRepeatGroupBox);
QVBoxLayout* glayout = new QVBoxLayout(mRepeatGroupBox);
......@@ -226,7 +226,7 @@ SoundWidget::SoundWidget(bool showPlay, bool showRepeat, QWidget* parent)
mRepeatPause->setSingleShiftStep(10);
mRepeatPause->setFixedSize(mRepeatPause->sizeHint());
label->setBuddy(mRepeatPause);
connect(mRepeatPause, SIGNAL(valueChanged(int)), SIGNAL(changed()));
connect(mRepeatPause, static_cast<void (SpinBox::*)(int)>(&SpinBox::valueChanged), this, &SoundWidget::changed);
label = new QLabel(i18nc("@label", "seconds"), box);
boxHLayout->addWidget(label);
label->setFixedSize(label->sizeHint());
......@@ -252,7 +252,7 @@ SoundWidget::SoundWidget(bool showPlay, bool showRepeat, QWidget* parent)
mVolumeCheckbox = new CheckBox(i18nc("@option:check", "Set volume"), box);
boxHLayout->addWidget(mVolumeCheckbox);
mVolumeCheckbox->setFixedSize(mVolumeCheckbox->sizeHint());
connect(mVolumeCheckbox, SIGNAL(toggled(bool)), SLOT(slotVolumeToggled(bool)));
connect(mVolumeCheckbox, &CheckBox::toggled, this, &SoundWidget::slotVolumeToggled);
mVolumeCheckbox->setWhatsThis(i18nc("@info:whatsthis", "Select to choose the volume for playing the sound file."));
// Volume slider
......@@ -263,12 +263,12 @@ SoundWidget::SoundWidget(bool showPlay, bool showRepeat, QWidget* parent)
mVolumeSlider->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
mVolumeSlider->setWhatsThis(i18nc("@info:whatsthis", "Choose the volume for playing the sound file."));
mVolumeCheckbox->setFocusWidget(mVolumeSlider);
connect(mVolumeSlider, SIGNAL(valueChanged(int)), SIGNAL(changed()));
connect(mVolumeSlider, &Slider::valueChanged, this, &SoundWidget::changed);
// Fade checkbox
mFadeCheckbox = new CheckBox(i18nc("@option:check", "Fade"), group);
mFadeCheckbox->setFixedSize(mFadeCheckbox->sizeHint());
connect(mFadeCheckbox, SIGNAL(toggled(bool)), SLOT(slotFadeToggled(bool)));
connect(mFadeCheckbox, &CheckBox::toggled, this, &SoundWidget::slotFadeToggled);
mFadeCheckbox->setWhatsThis(i18nc("@info:whatsthis", "Select to fade the volume when the sound file first starts to play."));
grid->addWidget(mFadeCheckbox, 2, 1, 1, 2, Qt::AlignLeft);
......@@ -285,7 +285,7 @@ SoundWidget::SoundWidget(bool showPlay, bool showRepeat, QWidget* parent)
mFadeTime->setSingleShiftStep(10);
mFadeTime->setFixedSize(mFadeTime->sizeHint());
label->setBuddy(mFadeTime);
connect(mFadeTime, SIGNAL(valueChanged(int)), SIGNAL(changed()));
connect(mFadeTime, static_cast<void (SpinBox::*)(int)>(&SpinBox::valueChanged), this, &SoundWidget::changed);
label = new QLabel(i18nc("@label", "seconds"), mFadeBox);
boxHLayout->addWidget(label);
label->setFixedSize(label->sizeHint());
......@@ -305,7 +305,7 @@ SoundWidget::SoundWidget(bool showPlay, bool showRepeat, QWidget* parent)
mFadeSlider->setTickInterval(10);
mFadeSlider->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
label->setBuddy(mFadeSlider);
connect(mFadeSlider, SIGNAL(valueChanged(int)), SIGNAL(changed()));
connect(mFadeSlider, &Slider::valueChanged, this, &SoundWidget::changed);
mFadeVolumeBox->setWhatsThis(i18nc("@info:whatsthis", "Choose the initial volume for playing the sound file."));
slotVolumeToggled(false);
......@@ -453,7 +453,7 @@ void SoundWidget::playSound()
mPlayer->setCurrentSource(mUrl);
Phonon::createPath(mPlayer, output);
#endif
connect(mPlayer, SIGNAL(finished()), SLOT(playFinished()));
connect(mPlayer, &Phonon::MediaObject::finished, this, &SoundWidget::playFinished);
mFilePlay->setIcon(SmallIcon(QLatin1String("media-playback-stop"))); // change the play button to a stop button
mFilePlay->setToolTip(i18nc("@info:tooltip", "Stop sound"));
mFilePlay->setWhatsThis(i18nc("@info:whatsthis", "Stop playing the sound"));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment