Commit 1e359499 authored by Laurent Montel's avatar Laurent Montel
Browse files

KMessageBox::sorry is deprecated in kf5.97 use KMessageBox::error

Remove unused KAMessageBox::detailedSorry method too
parent c4b45b58
Pipeline #210297 passed with stage
in 1 minute and 51 seconds
......@@ -271,7 +271,7 @@ KADateTime AlarmTimeWidget::getDateTime(int* minsFromNow, bool checkExpired, boo
if (!mDelayTimeEdit->isValid())
{
if (showErrorMessage)
KAMessageBox::sorry(const_cast<AlarmTimeWidget*>(this), i18nc("@info", "Invalid time"));
KAMessageBox::error(const_cast<AlarmTimeWidget*>(this), i18nc("@info", "Invalid time"));
if (errorWidget)
*errorWidget = mDelayTimeEdit;
return {};
......@@ -291,14 +291,14 @@ KADateTime AlarmTimeWidget::getDateTime(int* minsFromNow, bool checkExpired, boo
if (!mDateEdit->date().isValid())
{
if (showErrorMessage)
KAMessageBox::sorry(const_cast<AlarmTimeWidget*>(this), i18nc("@info", "Invalid date"));
KAMessageBox::error(const_cast<AlarmTimeWidget*>(this), i18nc("@info", "Invalid date"));
if (errorWidget)
*errorWidget = mDateEdit;
}
else
{
if (showErrorMessage)
KAMessageBox::sorry(const_cast<AlarmTimeWidget*>(this), i18nc("@info", "Invalid time"));
KAMessageBox::error(const_cast<AlarmTimeWidget*>(this), i18nc("@info", "Invalid time"));
if (errorWidget)
*errorWidget = mTimeEdit;
}
......@@ -312,7 +312,7 @@ KADateTime AlarmTimeWidget::getDateTime(int* minsFromNow, bool checkExpired, boo
if (checkExpired && result.date() < now.date())
{
if (showErrorMessage)
KAMessageBox::sorry(const_cast<AlarmTimeWidget*>(this), i18nc("@info", "Alarm date has already expired"));
KAMessageBox::error(const_cast<AlarmTimeWidget*>(this), i18nc("@info", "Alarm date has already expired"));
if (errorWidget)
*errorWidget = mDateEdit;
return {};
......@@ -324,7 +324,7 @@ KADateTime AlarmTimeWidget::getDateTime(int* minsFromNow, bool checkExpired, boo
if (checkExpired && result <= now.addSecs(1))
{
if (showErrorMessage)
KAMessageBox::sorry(const_cast<AlarmTimeWidget*>(this), i18nc("@info", "Alarm time has already expired"));
KAMessageBox::error(const_cast<AlarmTimeWidget*>(this), i18nc("@info", "Alarm time has already expired"));
if (errorWidget)
*errorWidget = mTimeEdit;
return {};
......
......@@ -114,7 +114,7 @@ void DeferAlarmDlg::slotOk()
case KAEvent::LIMIT_NONE:
break; // can't happen with a valid endTime
}
KAMessageBox::sorry(this, text);
KAMessageBox::error(this, text);
}
else
accept();
......
......@@ -986,7 +986,7 @@ bool EditAlarmDlg::validate()
if (!errmsg.isEmpty())
{
mName->setFocus();
KAMessageBox::sorry(this, errmsg);
KAMessageBox::error(this, errmsg);
return false;
}
}
......@@ -1053,7 +1053,7 @@ bool EditAlarmDlg::validate()
// has already expired, so we must adjust it.
if (event.nextOccurrence(now, mAlarmDateTime, KAEvent::ALLOW_FOR_REPETITION) == KAEvent::NO_OCCURRENCE)
{
KAMessageBox::sorry(this, i18nc("@info", "Recurrence has already expired"));
KAMessageBox::error(this, i18nc("@info", "Recurrence has already expired"));
return false;
}
if (event.workTimeOnly() && !event.nextTrigger(KAEvent::DISPLAY_TRIGGER).isValid())
......@@ -1070,7 +1070,7 @@ bool EditAlarmDlg::validate()
{
mTabs->setCurrentIndex(mRecurPageIndex);
errWidget->setFocus();
KAMessageBox::sorry(this, errmsg);
KAMessageBox::error(this, errmsg);
return false;
}
}
......@@ -1087,7 +1087,7 @@ bool EditAlarmDlg::validate()
{
mTabs->setCurrentIndex(mMainPageIndex);
mReminder->setFocusOnCount();
KAMessageBox::sorry(this, xi18nc("@info", "Reminder period must be less than the recurrence interval, unless <interface>%1</interface> is checked.",
KAMessageBox::error(this, xi18nc("@info", "Reminder period must be less than the recurrence interval, unless <interface>%1</interface> is checked.",
Reminder::i18n_chk_FirstRecurrenceOnly()));
return false;
}
......@@ -1102,14 +1102,14 @@ bool EditAlarmDlg::validate()
if (longestRecurMinutes > 0
&& recurEvent.repetition().intervalMinutes() * recurEvent.repetition().count() >= longestRecurMinutes - reminder)
{
KAMessageBox::sorry(this, i18nc("@info", "The duration of a repetition within the recurrence must be less than the recurrence interval minus any reminder period"));
KAMessageBox::error(this, i18nc("@info", "The duration of a repetition within the recurrence must be less than the recurrence interval minus any reminder period"));
mRecurrenceEdit->activateSubRepetition(); // display the alarm repetition dialog again
return false;
}
if (!recurEvent.repetition().isDaily()
&& ((mTemplate && mTemplateAnyTime->isChecked()) || (!mTemplate && mAlarmDateTime.isDateOnly())))
{
KAMessageBox::sorry(this, i18nc("@info", "For a repetition within the recurrence, its period must be in units of days or weeks for a date-only alarm"));
KAMessageBox::error(this, i18nc("@info", "For a repetition within the recurrence, its period must be in units of days or weeks for a date-only alarm"));
mRecurrenceEdit->activateSubRepetition(); // display the alarm repetition dialog again
return false;
}
......@@ -1140,7 +1140,7 @@ bool EditAlarmDlg::validate()
if (!mResource.isValid())
{
if (!cancelled)
KAMessageBox::sorry(this, i18nc("@info", "You must select a calendar to save the alarm in"));
KAMessageBox::error(this, i18nc("@info", "You must select a calendar to save the alarm in"));
return false;
}
}
......
......@@ -1056,7 +1056,7 @@ bool EditCommandAlarmDlg::type_validate(bool trial)
{
showMainPage();
mCmdLogFileEdit->setFocus();
KAMessageBox::sorry(this, i18nc("@info", "Log file must be the name or path of a local file, with write permission."));
KAMessageBox::error(this, i18nc("@info", "Log file must be the name or path of a local file, with write permission."));
return false;
}
// Convert the log file to an absolute path
......@@ -1892,7 +1892,7 @@ QString CommandEdit::text(EditAlarmDlg* dlg, bool showErrorMessage) const
{
const QString result = text();
if (showErrorMessage && result.isEmpty())
KAMessageBox::sorry(dlg, i18nc("@info", "Please enter a command or script to execute"));
KAMessageBox::error(dlg, i18nc("@info", "Please enter a command or script to execute"));
return result;
}
......
......@@ -227,7 +227,7 @@ void Find::slotFind()
if (!(mOptions & (FIND_LIVE | FIND_ARCHIVED))
|| !(mOptions & (FIND_MESSAGE | FIND_FILE | FIND_COMMAND | FIND_EMAIL | FIND_AUDIO)))
{
KAMessageBox::sorry(mDialog, i18nc("@info", "No alarm types are selected to search"));
KAMessageBox::error(mDialog, i18nc("@info", "No alarm types are selected to search"));
return;
}
......
......@@ -1382,7 +1382,7 @@ void editNewTemplate(EditAlarmDlg::Type type, const KAEvent& preset, QWidget* pa
{
if (Resources::enabledResources(CalEvent::TEMPLATE, true).isEmpty())
{
KAMessageBox::sorry(parent, i18nc("@info", "You must enable a template calendar to save the template in"));
KAMessageBox::error(parent, i18nc("@info", "You must enable a template calendar to save the template in"));
return;
}
// Use AutoQPointer to guard against crash on application exit while
......
......@@ -113,10 +113,10 @@ bool showFileErrMessage(const QString& filename, FileErr err, FileErr blankError
errmsg = i18nc("@info", "Please select a file to play");
else
qFatal("showFileErrMessage: Program error");
KAMessageBox::sorry(errmsgParent, errmsg);
KAMessageBox::error(errmsgParent, errmsg);
return false;
case FileErr::Directory:
KAMessageBox::sorry(errmsgParent, xi18nc("@info", "<filename>%1</filename> is a folder", file));
KAMessageBox::error(errmsgParent, xi18nc("@info", "<filename>%1</filename> is a folder", file));
return false;
case FileErr::Nonexistent: errmsg = xi18nc("@info", "<filename>%1</filename> not found", file); break;
case FileErr::Unreadable: errmsg = xi18nc("@info", "<filename>%1</filename> is not readable", file); break;
......
......@@ -82,13 +82,6 @@ public:
KMessageBox::Options options = KMessageBox::Options(KMessageBox::Notify|KMessageBox::WindowModal))
{ KMessageBox::detailedError(parent, text, details, caption, options); }
/** Same as KMessageBox::detailedSorry() except that it defaults to window-modal,
* not application-modal. */
static void detailedSorry(QWidget* parent, const QString& text, const QString& details,
const QString& caption = QString(),
KMessageBox::Options options = KMessageBox::Options(KMessageBox::Notify|KMessageBox::WindowModal))
{ KMessageBox::detailedSorry(parent, text, details, caption, options); }
/** Same as KMessageBox::informationList() except that it defaults to window-modal,
* not application-modal. */
static void informationList(QWidget* parent, const QString& text, const QStringList& details,
......@@ -110,12 +103,6 @@ public:
KMessageBox::Options options = KMessageBox::Options(KMessageBox::Notify|KMessageBox::WindowModal))
{ KMessageBox::information(parent, text, caption, dontShowAgainName, options); }
/** Same as KMessageBox::sorry() except that it defaults to window-modal,
* not application-modal. */
static void sorry(QWidget* parent, const QString& text, const QString& caption = QString(),
KMessageBox::Options options = KMessageBox::Options(KMessageBox::Notify|KMessageBox::WindowModal))
{ KMessageBox::sorry(parent, text, caption, options); }
/** Same as KMessageBox::questionYesNo() except that it defaults to window-modal,
* not application-modal. */
static int questionYesNo(QWidget* parent, const QString& text, const QString& caption = QString(),
......
......@@ -1126,7 +1126,7 @@ void MessageWindow::slotShowKMailMessage()
}
if (failed1 || failed2)
KAMessageBox::sorry(this, xi18nc("@info", "Unable to locate this email in <application>KMail</application>"));
KAMessageBox::error(this, xi18nc("@info", "Unable to locate this email in <application>KMail</application>"));
}
/******************************************************************************
......
......@@ -222,7 +222,7 @@ void KAlarmPrefDlg::slotApply()
if (!errmsg.isEmpty())
{
setCurrentPage(mEditPageItem);
KAMessageBox::sorry(this, errmsg);
KAMessageBox::error(this, errmsg);
mValid = false;
return;
}
......@@ -973,7 +973,7 @@ void StorePrefTab::slotArchivedToggled(bool)
if (keep && !mOldKeepArchived && mCheckKeepChanges
&& !Resources::getStandard(CalEvent::ARCHIVED, true).isValid())
{
KAMessageBox::sorry(topLayout()->parentWidget(),
KAMessageBox::error(topLayout()->parentWidget(),
xi18nc("@info", "<para>A default calendar is required in order to archive alarms, but none is currently enabled.</para>"
"<para>If you wish to keep expired alarms, please first use the calendars view to select a default "
"archived alarms calendar.</para>"));
......
......@@ -342,7 +342,7 @@ bool ResourceCheckListModel::setData(const QModelIndex& index, const QVariant& v
}
if (!errmsg.isEmpty())
{
KAMessageBox::sorry(messageParent, errmsg);
KAMessageBox::error(messageParent, errmsg);
return false;
}
}
......
......@@ -229,14 +229,14 @@ void ResourceSelector::removeResource()
: CalEvent::EMPTY;
if (stdType == CalEvent::ACTIVE)
{
KAMessageBox::sorry(this, i18nc("@info", "You cannot remove your default active alarm calendar."));
KAMessageBox::error(this, i18nc("@info", "You cannot remove your default active alarm calendar."));
return;
}
if (stdType == CalEvent::ARCHIVED && Preferences::archivedKeepDays())
{
// Only allow the archived alarms standard resource to be removed if
// we're not saving archived alarms.
KAMessageBox::sorry(this, i18nc("@info", "You cannot remove your default archived alarm calendar "
KAMessageBox::error(this, i18nc("@info", "You cannot remove your default archived alarm calendar "
"while expired alarms are configured to be kept."));
return;
}
......
......@@ -409,7 +409,7 @@ bool Undo::undo(int i, Undo::Type type, QWidget* parent, const QString& action)
case UndoItem::ERR_PROG: err = i18nc("@info", "Program error"); break;
default: err = i18nc("@info", "Unknown error"); break;
}
KAMessageBox::sorry(parent, i18nc("@info Undo-action: message", "%1: %2", action, err));
KAMessageBox::error(parent, i18nc("@info Undo-action: message", "%1: %2", action, err));
return false;
}
......
......@@ -145,7 +145,7 @@ void WakeFromSuspendDlg::useWakeClicked()
const KADateTime dt = event.mainDateTime().kDateTime();
if (dt.isDateOnly())
{
KAMessageBox::sorry(this, i18nc("@info", "Cannot schedule wakeup time for a date-only alarm"));
KAMessageBox::error(this, i18nc("@info", "Cannot schedule wakeup time for a date-only alarm"));
return;
}
if (KAMessageBox::warningContinueCancel(this,
......
Supports Markdown
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