Commit 49c020e5 authored by David Jarvie's avatar David Jarvie
Browse files

Make prompt windows non-application modal

Use KMessageBox::WindowModal by default to avoid prompts preventing
user input to alarm windows.

Backport f5d274b96c0c76998d72660f6317f6561531b7d8 from master.
parent 7507fc75
......@@ -25,6 +25,7 @@
#include "collectionattribute.h"
#include "compatibilityattribute.h"
#include "eventattribute.h"
#include "messagebox.h"
#include "preferences.h"
#include "synchtimer.h"
#include "kalarmdirsettings.h"
......@@ -46,7 +47,6 @@
#include <akonadi/itemfetchscope.h>
#include <klocale.h>
#include <kmessagebox.h>
#include <QApplication>
#include <QFileInfo>
......@@ -1097,7 +1097,8 @@ void AkonadiModel::addCollectionJobDone(KJob* j)
if (j->error())
{
kError() << "Failed to create new calendar resource:" << j->errorString();
KMessageBox::error(0, i18nc("@info", "%1<nl/>(%2)", i18nc("@info/plain", "Failed to create new calendar resource"), j->errorString()));
MessageBox::error(MainWindow::mainMainWindow(), i18nc("@info", "%1<nl/>(%2)",
i18nc("@info/plain", "Failed to create new calendar resource"), j->errorString()));
emit collectionAdded(job, false);
}
else
......@@ -1175,7 +1176,7 @@ void AkonadiModel::deleteCollectionJobDone(KJob* j)
emit collectionDeleted(jobData.id, false);
QString errMsg = i18nc("@info", "Failed to remove calendar <resource>%1</resource>.", jobData.displayName);
kError() << errMsg << ":" << j->errorString();
KMessageBox::error(0, i18nc("@info", "%1<nl/>(%2)", errMsg, j->errorString()));
MessageBox::error(MainWindow::mainMainWindow(), i18nc("@info", "%1<nl/>(%2)", errMsg, j->errorString()));
}
else
emit collectionDeleted(jobData.id, true);
......@@ -1221,7 +1222,7 @@ void AkonadiModel::modifyCollectionJobDone(KJob* j)
emit collectionModified(collection.id(), false);
QString errMsg = i18nc("@info", "Failed to update calendar <resource>%1</resource>.", displayName(collection));
kError() << errMsg << ":" << j->errorString();
KMessageBox::error(0, i18nc("@info", "%1<nl/>(%2)", errMsg, j->errorString()));
MessageBox::error(MainWindow::mainMainWindow(), i18nc("@info", "%1<nl/>(%2)", errMsg, j->errorString()));
}
else
emit collectionModified(collection.id(), true);
......@@ -1509,7 +1510,7 @@ void AkonadiModel::itemJobDone(KJob* j)
Item current = itemById(itemId); // fetch the up-to-date item
checkQueuedItemModifyJob(current);
}
KMessageBox::error(0, i18nc("@info", "%1<nl/>(%2)", errMsg, j->errorString()));
MessageBox::error(MainWindow::mainMainWindow(), i18nc("@info", "%1<nl/>(%2)", errMsg, j->errorString()));
}
else
{
......
......@@ -32,6 +32,7 @@
#include "functions.h"
#include "kalarmapp.h"
#include "mainwindow.h"
#include "messagebox.h"
#include "preferences.h"
#ifdef USE_AKONADI
......@@ -44,7 +45,6 @@
#include <kglobal.h>
#include <klocale.h>
#include <kmessagebox.h>
#include <kstandarddirs.h>
#ifndef USE_AKONADI
#include <kconfig.h>
......@@ -308,7 +308,8 @@ int AlarmCalendar::load()
if (!KIO::NetAccess::download(mUrl, tmpFile, MainWindow::mainMainWindow()))
{
kError() << "Download failure";
KMessageBox::error(0, i18nc("@info", "Cannot download calendar: <filename>%1</filename>", mUrl.prettyUrl()));
MessageBox::error(MainWindow::mainMainWindow(),
i18nc("@info", "Cannot download calendar: <filename>%1</filename>", mUrl.prettyUrl()));
return -1;
}
kDebug() << "--- Downloaded to" << tmpFile;
......@@ -329,7 +330,8 @@ int AlarmCalendar::load()
if (!fi.size())
return 0; // file is zero length
kError() << "Error loading calendar file '" << tmpFile <<"'";
KMessageBox::error(0, i18nc("@info", "<para>Error loading calendar:</para><para><filename>%1</filename></para><para>Please fix or delete the file.</para>", mUrl.prettyUrl()));
MessageBox::error(MainWindow::mainMainWindow(),
i18nc("@info", "<para>Error loading calendar:</para><para><filename>%1</filename></para><para>Please fix or delete the file.</para>", mUrl.prettyUrl()));
// load() could have partially populated the calendar, so clear it out
#ifdef USE_AKONADI
mCalendarStorage->calendar()->close();
......@@ -423,7 +425,8 @@ bool AlarmCalendar::saveCal(const QString& newFile)
#endif
{
kError() << "Saving" << saveFilename << "failed.";
KMessageBox::error(0, i18nc("@info", "Failed to save calendar to <filename>%1</filename>", mICalUrl.prettyUrl()));
MessageBox::error(MainWindow::mainMainWindow(),
i18nc("@info", "Failed to save calendar to <filename>%1</filename>", mICalUrl.prettyUrl()));
return false;
}
......@@ -432,7 +435,8 @@ bool AlarmCalendar::saveCal(const QString& newFile)
if (!KIO::NetAccess::upload(saveFilename, mICalUrl, MainWindow::mainMainWindow()))
{
kError() << saveFilename << "upload failed.";
KMessageBox::error(0, i18nc("@info", "Cannot upload calendar to <filename>%1</filename>", mICalUrl.prettyUrl()));
MessageBox::error(MainWindow::mainMainWindow(),
i18nc("@info", "Cannot upload calendar to <filename>%1</filename>", mICalUrl.prettyUrl()));
return false;
}
}
......@@ -854,7 +858,7 @@ bool AlarmCalendar::importAlarms(QWidget* parent, AlarmResource* resource)
if (!KStandardDirs::exists(filename))
{
kDebug() << "File '" << url.prettyUrl() <<"' not found";
KMessageBox::error(parent, i18nc("@info", "Could not load calendar <filename>%1</filename>.", url.prettyUrl()));
MessageBox::error(parent, i18nc("@info", "Could not load calendar <filename>%1</filename>.", url.prettyUrl()));
return false;
}
}
......@@ -863,7 +867,7 @@ bool AlarmCalendar::importAlarms(QWidget* parent, AlarmResource* resource)
if (!KIO::NetAccess::download(url, filename, MainWindow::mainMainWindow()))
{
kError() << "Download failure";
KMessageBox::error(parent, i18nc("@info", "Cannot download calendar: <filename>%1</filename>", url.prettyUrl()));
MessageBox::error(parent, i18nc("@info", "Cannot download calendar: <filename>%1</filename>", url.prettyUrl()));
return false;
}
kDebug() << "--- Downloaded to" << filename;
......@@ -881,7 +885,7 @@ bool AlarmCalendar::importAlarms(QWidget* parent, AlarmResource* resource)
if (!success)
{
kDebug() << "Error loading calendar '" << filename <<"'";
KMessageBox::error(parent, i18nc("@info", "Could not load calendar <filename>%1</filename>.", url.prettyUrl()));
MessageBox::error(parent, i18nc("@info", "Could not load calendar <filename>%1</filename>.", url.prettyUrl()));
}
else
{
......@@ -1062,7 +1066,8 @@ bool AlarmCalendar::exportAlarms(const KAEvent::List& events, QWidget* parent)
if (fi.size())
{
kError() << "Error loading calendar file" << file << "for append";
KMessageBox::error(0, i18nc("@info", "Error loading calendar to append to:<nl/><filename>%1</filename>", url.prettyUrl()));
MessageBox::error(MainWindow::mainMainWindow(),
i18nc("@info", "Error loading calendar to append to:<nl/><filename>%1</filename>", url.prettyUrl()));
return false;
}
}
......@@ -1111,13 +1116,15 @@ bool AlarmCalendar::exportAlarms(const KAEvent::List& events, QWidget* parent)
#endif
{
kError() << file << ": failed";
KMessageBox::error(0, i18nc("@info", "Failed to save new calendar to:<nl/><filename>%1</filename>", url.prettyUrl()));
MessageBox::error(MainWindow::mainMainWindow(),
i18nc("@info", "Failed to save new calendar to:<nl/><filename>%1</filename>", url.prettyUrl()));
success = false;
}
else if (!local && !KIO::NetAccess::upload(file, url, parent))
{
kError() << file << ": upload failed";
KMessageBox::error(0, i18nc("@info", "Cannot upload new calendar to:<nl/><filename>%1</filename>", url.prettyUrl()));
MessageBox::error(MainWindow::mainMainWindow(),
i18nc("@info", "Cannot upload new calendar to:<nl/><filename>%1</filename>", url.prettyUrl()));
success = false;
}
#ifdef USE_AKONADI
......
/*
* alarmtimewidget.cpp - alarm date/time entry widget
* Program: kalarm
* Copyright © 2001-2010 by David Jarvie <djarvie@kde.org>
* Copyright © 2001-2011 by David Jarvie <djarvie@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -23,6 +23,7 @@
#include "buttongroup.h"
#include "checkbox.h"
#include "datetime.h"
#include "messagebox.h"
#include "preferences.h"
#include "pushbutton.h"
#include "radiobutton.h"
......@@ -35,7 +36,6 @@
#include <libkdepim/kdateedit.h>
#include <kdialog.h>
#include <kmessagebox.h>
#include <klocale.h>
#include <QGroupBox>
......@@ -289,7 +289,7 @@ KDateTime AlarmTimeWidget::getDateTime(int* minsFromNow, bool checkExpired, bool
if (!mDelayTimeEdit->isValid())
{
if (showErrorMessage)
KMessageBox::sorry(const_cast<AlarmTimeWidget*>(this), i18nc("@info", "Invalid time"));
MessageBox::sorry(const_cast<AlarmTimeWidget*>(this), i18nc("@info", "Invalid time"));
if (errorWidget)
*errorWidget = mDelayTimeEdit;
return KDateTime();
......@@ -308,14 +308,14 @@ KDateTime AlarmTimeWidget::getDateTime(int* minsFromNow, bool checkExpired, bool
if (!mDateEdit->date().isValid())
{
if (showErrorMessage)
KMessageBox::sorry(const_cast<AlarmTimeWidget*>(this), i18nc("@info", "Invalid date"));
MessageBox::sorry(const_cast<AlarmTimeWidget*>(this), i18nc("@info", "Invalid date"));
if (errorWidget)
*errorWidget = mDateEdit;
}
else
{
if (showErrorMessage)
KMessageBox::sorry(const_cast<AlarmTimeWidget*>(this), i18nc("@info", "Invalid time"));
MessageBox::sorry(const_cast<AlarmTimeWidget*>(this), i18nc("@info", "Invalid time"));
if (errorWidget)
*errorWidget = mTimeEdit;
}
......@@ -329,7 +329,7 @@ KDateTime AlarmTimeWidget::getDateTime(int* minsFromNow, bool checkExpired, bool
if (checkExpired && result.date() < now.date())
{
if (showErrorMessage)
KMessageBox::sorry(const_cast<AlarmTimeWidget*>(this), i18nc("@info", "Alarm date has already expired"));
MessageBox::sorry(const_cast<AlarmTimeWidget*>(this), i18nc("@info", "Alarm date has already expired"));
if (errorWidget)
*errorWidget = mDateEdit;
return KDateTime();
......@@ -341,7 +341,7 @@ KDateTime AlarmTimeWidget::getDateTime(int* minsFromNow, bool checkExpired, bool
if (checkExpired && result <= now.addSecs(1))
{
if (showErrorMessage)
KMessageBox::sorry(const_cast<AlarmTimeWidget*>(this), i18nc("@info", "Alarm time has already expired"));
MessageBox::sorry(const_cast<AlarmTimeWidget*>(this), i18nc("@info", "Alarm time has already expired"));
if (errorWidget)
*errorWidget = mTimeEdit;
return KDateTime();
......
......@@ -29,6 +29,8 @@
#endif
#include "functions.h"
#include "kaevent.h"
#include "mainwindow.h"
#include "messagebox.h"
#include "preferences.h"
#ifndef USE_AKONADI
......@@ -39,7 +41,6 @@ using namespace KCal;
#include <kapplication.h>
#include <kaboutdata.h>
#include <klocale.h>
#include <kmessagebox.h>
#include <kdebug.h>
#include <QFile>
......@@ -129,7 +130,7 @@ KAlarm::Calendar::Compat CalendarCompat::fix(KCal::CalendarLocal& calendar, cons
#else
resource->resourceName());
#endif
if (KMessageBox::warningYesNo(0,
if (MessageBox::warningYesNo(MainWindow::mainMainWindow(),
i18nc("@info", "<para>%1</para><para>"
"<warning>Do not update the calendar if it is shared with other users who run an older version "
"of <application>KAlarm</application>. If you do so, they may be unable to use it any more.</warning></para>"
......
......@@ -211,7 +211,7 @@ void CalendarMigrator::calendarCreated(CalendarCreator* creator)
errmsg = i18nc("@info", "<para>%1</para><para>%2</para>", errmsg, locn);
else
errmsg = i18nc("@info", "<para>%1</para><para>%2<nl/>(%3)</para>", errmsg, locn, creator->errorMessage());
KMessageBox::error(0, errmsg);
MessageBox::error(MainWindow::mainMainWindow(), errmsg);
}
creator->deleteLater();
......
......@@ -335,14 +335,14 @@ bool CollectionCheckListModel::setData(const QModelIndex& index, const QVariant&
errmsg = i18nc("@info", "You cannot disable your default archived alarm calendar "
"while expired alarms are configured to be kept.");
}
else if (KMessageBox::warningContinueCancel(messageParent,
else if (MessageBox::warningContinueCancel(messageParent,
i18nc("@info", "Do you really want to disable your default calendar?"))
== KMessageBox::Cancel)
return false;
}
if (!errmsg.isEmpty())
{
KMessageBox::sorry(messageParent, errmsg);
MessageBox::sorry(messageParent, errmsg);
return false;
}
}
......
/*
* deferdlg.cpp - dialog to defer an alarm
* Program: kalarm
* Copyright © 2002-2010 by David Jarvie <djarvie@kde.org>
* Copyright © 2002-2011 by David Jarvie <djarvie@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -27,10 +27,10 @@
#include "functions.h"
#include "kaevent.h"
#include "kalarmapp.h"
#include "messagebox.h"
#include <kglobal.h>
#include <klocale.h>
#include <kmessagebox.h>
#include <kdebug.h>
#include <QVBoxLayout>
......@@ -112,7 +112,7 @@ void DeferAlarmDlg::slotOk()
case KAEvent::LIMIT_NONE:
break; // can't happen with a valid endTime
}
KMessageBox::sorry(this, text);
MessageBox::sorry(this, text);
}
else
accept();
......
......@@ -39,6 +39,7 @@
#include "latecancel.h"
#include "lineedit.h"
#include "mainwindow.h"
#include "messagebox.h"
#include "packedlayout.h"
#include "preferences.h"
#include "radiobutton.h"
......@@ -58,7 +59,6 @@
#include <kconfig.h>
#include <kfiledialog.h>
#include <kpushbutton.h>
#include <kmessagebox.h>
#include <khbox.h>
#include <kvbox.h>
#include <kwindowsystem.h>
......@@ -958,7 +958,7 @@ bool EditAlarmDlg::validate()
if (!errmsg.isEmpty())
{
mTemplateName->setFocus();
KMessageBox::sorry(this, errmsg);
MessageBox::sorry(this, errmsg);
return false;
}
}
......@@ -1006,7 +1006,7 @@ bool EditAlarmDlg::validate()
"The start date/time does not match the alarm's recurrence pattern, "
"so it will be adjusted to the date/time of the next recurrence (%1).",
KGlobal::locale()->formatDateTime(next.kDateTime(), KLocale::ShortDate));
if (KMessageBox::warningContinueCancel(this, prompt) != KMessageBox::Continue)
if (MessageBox::warningContinueCancel(this, prompt) != KMessageBox::Continue)
return false;
}
}
......@@ -1030,12 +1030,12 @@ bool EditAlarmDlg::validate()
// has already expired, so we must adjust it.
if (event.nextOccurrence(now, mAlarmDateTime, KAEvent::ALLOW_FOR_REPETITION) == KAEvent::NO_OCCURRENCE)
{
KMessageBox::sorry(this, i18nc("@info", "Recurrence has already expired"));
MessageBox::sorry(this, i18nc("@info", "Recurrence has already expired"));
return false;
}
if (event.workTimeOnly() && !event.nextTrigger(KAEvent::DISPLAY_TRIGGER).isValid())
{
if (KMessageBox::warningContinueCancel(this, i18nc("@info", "The alarm will never occur during working hours"))
if (MessageBox::warningContinueCancel(this, i18nc("@info", "The alarm will never occur during working hours"))
!= KMessageBox::Continue)
return false;
}
......@@ -1047,7 +1047,7 @@ bool EditAlarmDlg::validate()
{
mTabs->setCurrentIndex(mRecurPageIndex);
errWidget->setFocus();
KMessageBox::sorry(this, errmsg);
MessageBox::sorry(this, errmsg);
return false;
}
}
......@@ -1064,7 +1064,7 @@ bool EditAlarmDlg::validate()
{
mTabs->setCurrentIndex(mMainPageIndex);
mReminder->setFocusOnCount();
KMessageBox::sorry(this, i18nc("@info", "Reminder period must be less than the recurrence interval, unless <interface>%1</interface> is checked."
MessageBox::sorry(this, i18nc("@info", "Reminder period must be less than the recurrence interval, unless <interface>%1</interface> is checked."
, Reminder::i18n_chk_FirstRecurrenceOnly()));
return false;
}
......@@ -1079,14 +1079,14 @@ bool EditAlarmDlg::validate()
if (longestRecurMinutes > 0
&& recurEvent.repetition().intervalMinutes() * recurEvent.repetition().count() >= longestRecurMinutes - reminder)
{
KMessageBox::sorry(this, i18nc("@info", "The duration of a repetition within the recurrence must be less than the recurrence interval minus any reminder period"));
MessageBox::sorry(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())))
{
KMessageBox::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"));
MessageBox::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"));
mRecurrenceEdit->activateSubRepetition(); // display the alarm repetition dialog again
return false;
}
......@@ -1118,7 +1118,7 @@ bool EditAlarmDlg::validate()
if (!mCollection.isValid())
{
if (!cancelled)
KMessageBox::sorry(this, i18nc("@info", "You must select a calendar to save the alarm in"));
MessageBox::sorry(this, i18nc("@info", "You must select a calendar to save the alarm in"));
return false;
}
}
......@@ -1147,7 +1147,7 @@ bool EditAlarmDlg::validate()
if (!mResource)
{
if (!cancelled)
KMessageBox::sorry(this, i18nc("@info", "You must select a calendar to save the alarm in"));
MessageBox::sorry(this, i18nc("@info", "You must select a calendar to save the alarm in"));
return false;
}
}
......
......@@ -35,6 +35,7 @@
#include "latecancel.h"
#include "lineedit.h"
#include "mainwindow.h"
#include "messagebox.h"
#include "pickfileradio.h"
#include "preferences.h"
#include "radiobutton.h"
......@@ -61,7 +62,6 @@ using namespace KCal;
#include <kiconloader.h>
#include <kio/netaccess.h>
#include <kfileitem.h>
#include <kmessagebox.h>
#include <khbox.h>
#include <kdebug.h>
......@@ -942,7 +942,7 @@ bool EditCommandAlarmDlg::type_validate(bool trial)
{
showMainPage();
mCmdLogFileEdit->setFocus();
KMessageBox::sorry(this, i18nc("@info", "Log file must be the name or path of a local file, with write permission."));
MessageBox::sorry(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
......@@ -959,7 +959,7 @@ void EditCommandAlarmDlg::type_trySuccessMessage(ShellProcess* proc, const QStri
if (mCmdOutputGroup->checkedButton() != mCmdExecInTerm)
{
theApp()->commandMessage(proc, this);
KMessageBox::information(this, i18nc("@info", "Command executed: <icode>%1</icode>", text));
MessageBox::information(this, i18nc("@info", "Command executed: <icode>%1</icode>", text));
theApp()->commandMessage(proc, 0);
}
}
......@@ -1307,14 +1307,14 @@ bool EditEmailAlarmDlg::type_validate(bool trial)
if (!bad.isEmpty())
{
mEmailToEdit->setFocus();
KMessageBox::error(this, i18nc("@info", "Invalid email address: <email>%1</email>", bad));
MessageBox::error(this, i18nc("@info", "Invalid email address: <email>%1</email>", bad));
return false;
}
}
if (mEmailAddresses.isEmpty())
{
mEmailToEdit->setFocus();
KMessageBox::error(this, i18nc("@info", "No email address specified"));
MessageBox::error(this, i18nc("@info", "No email address specified"));
return false;
}
......@@ -1331,12 +1331,12 @@ bool EditEmailAlarmDlg::type_validate(bool trial)
break; // empty
case -1:
mEmailAttachList->setFocus();
KMessageBox::error(this, i18nc("@info", "Invalid email attachment: <filename>%1</filename>", att));
MessageBox::error(this, i18nc("@info", "Invalid email attachment: <filename>%1</filename>", att));
return false;
}
}
if (trial && KMessageBox::warningContinueCancel(this, i18nc("@info", "Do you really want to send the email now to the specified recipient(s)?"),
i18nc("@action:button", "Confirm Email"), KGuiItem(i18nc("@action:button", "Send"))) != KMessageBox::Continue)
if (trial && MessageBox::warningContinueCancel(this, i18nc("@info", "Do you really want to send the email now to the specified recipient(s)?"),
i18nc("@action:button", "Confirm Email"), KGuiItem(i18nc("@action:button", "Send"))) != KMessageBox::Continue)
return false;
return true;
}
......@@ -1355,7 +1355,7 @@ void EditEmailAlarmDlg::type_trySuccessMessage(ShellProcess*, const QString&)
to, Preferences::emailBccAddress()) + "</qt>";
else
msg = "<qt>" + i18nc("@info", "Email sent to:<nl/>%1", to) + "</qt>";
KMessageBox::information(this, msg);
MessageBox::information(this, msg);
}
/******************************************************************************
......@@ -1680,7 +1680,7 @@ QString CommandEdit::text(EditAlarmDlg* dlg, bool showErrorMessage) const
{
QString result = text();
if (showErrorMessage && result.isEmpty())
KMessageBox::sorry(dlg, i18nc("@info", "Please enter a command or script to execute"));
MessageBox::sorry(dlg, i18nc("@info", "Please enter a command or script to execute"));
return result;
}
......
/*
* find.cpp - search facility
* Program: kalarm
* Copyright © 2005-2010 by David Jarvie <djarvie@kde.org>
* Copyright © 2005-2011 by David Jarvie <djarvie@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -27,6 +27,7 @@
#include "alarmlistview.h"
#include "eventlistview.h"
#include "kaevent.h"
#include "messagebox.h"
#include "preferences.h"
#include <kfinddialog.h>
......@@ -34,7 +35,6 @@
#include <kseparator.h>
#include <kwindowsystem.h>
#include <klocale.h>
#include <kmessagebox.h>
#include <kdebug.h>
#include <QGroupBox>
......@@ -268,7 +268,7 @@ void Find::slotFind()
if (!(mOptions & (FIND_LIVE | FIND_ARCHIVED))
|| !(mOptions & (FIND_MESSAGE | FIND_FILE | FIND_COMMAND | FIND_EMAIL | FIND_AUDIO)))
{
KMessageBox::sorry(mDialog, i18nc("@info", "No alarm types are selected to search"));
MessageBox::sorry(mDialog, i18nc("@info", "No alarm types are selected to search"));
return;
}
......@@ -421,7 +421,7 @@ void Find::findNext(bool forward, bool checkEnd, bool fromCurrent)
{
QString msg = forward ? i18nc("@info", "<para>End of alarm list reached.</para><para>Continue from the beginning?</para>")
: i18nc("@info", "<para>Beginning of alarm list reached.</para><para>Continue from the end?</para>");
if (KMessageBox::questionYesNo(mListView, msg, QString(), KStandardGuiItem::cont(), KStandardGuiItem::cancel()) == KMessageBox::Yes)
if (MessageBox::questionYesNo(mListView, msg, QString(), KStandardGuiItem::cont(), KStandardGuiItem::cancel()) == KMessageBox::Yes)
{
mNoCurrentItem = true;
findNext(forward, false, false);
......
......@@ -37,6 +37,7 @@
#include "kalarmapp.h"
#include "kamail.h"
#include "mainwindow.h"
#include "messagebox.h"
#include "messagewin.h"
#include "preferences.h"
#include "shellprocess.h"
......@@ -72,7 +73,6 @@ using namespace KCal;
#include <ksystemtimezone.h>
#include <kstandardguiitem.h>
#include <kstandardshortcut.h>
#include <kmessagebox.h>
#include <kfiledialog.h>
#include <kicon.h>
#include <kio/netaccess.h>
......@@ -1065,7 +1065,7 @@ void displayUpdateError(QWidget* parent, UpdateStatus status, UpdateError code,
: i18nc("@info", "Error saving alarm template");
break;
}
KMessageBox::error(parent, errmsg);
MessageBox::error(parent, errmsg);
}
else if (showKOrgError)
displayKOrgUpdateError(parent, code, status, nKOrgAlarms);
......@@ -1101,7 +1101,7 @@ void displayKOrgUpdateError(QWidget* parent, UpdateError code, UpdateStatus korg
msg = i18nc("@info", "<para>%1</para><para>(Error communicating with KOrganizer)</para>", errmsg);
else
msg = errmsg;
KMessageBox::error(parent, msg);
MessageBox::error(parent, msg);
}
/******************************************************************************
......@@ -1353,7 +1353,7 @@ bool setRtcWakeTime(unsigned triggerTime, QWidget* parent)
}
errmsg = i18nc("@info", "Error obtaining authorization (%1)", errcode);
}
KMessageBox::information(parent, errmsg);
MessageBox::information(parent, errmsg);
return false;
}
return true;
......@@ -1376,7 +1376,7 @@ void editNewTemplate(EditAlarmDlg::Type type, const KAEvent* preset, QWidget* pa
if (!AlarmResources::instance()->activeCount(KAlarm::CalEvent::TEMPLATE, true))
#endif
{
KMessageBox::sorry(parent, i18nc("@info", "You must enable a template calendar to save the template in"));
MessageBox::sorry(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
......@@ -1631,14 +1631,14 @@ void outputAlarmWarnings(QWidget* parent, const KAEvent* event)
{
if (event && event->action() == KAEvent::EMAIL
&& Preferences::emailAddress().isEmpty())
KMessageBox::information(parent, i18nc("@info Please set the 'From' email address...",
"<para>%1</para><para>Please set it in the Configuration dialog.</para>", KAMail::i18n_NeedFromEmailAddress()));
MessageBox::information(parent, i18nc("@info Please set the 'From' email address...",
"<para>%1</para><para>Please set it in the Configuration dialog.</para>", KAMail::i18n_NeedFromEmailAddress()));
if (!theApp()->alarmsEnabled())
{
if (KMessageBox::warningYesNo(parent, i18nc("@info", "<para>Alarms are currently disabled.</para><para>Do you want to enable alarms now?</para>"),
QString(), KGuiItem(i18nc("@action:button", "Enable")), KGuiItem(i18nc("@action:button", "Keep Disabled")),
QLatin1String("EditEnableAlarms"))
if (MessageBox::warningYesNo(parent, i18nc("@info", "<para>Alarms are currently disabled.</para><para>Do you want to enable alarms now?</para>"),
QString(), KGuiItem(i18nc("@action:button", "Enable")), KGuiItem(i18nc("@action:button", "Keep Disabled")),
QLatin1String("EditEnableAlarms"))
== KMessageBox::Yes)
theApp()->setAlarmsEnabled(true);
}
......@@ -1987,10 +1987,10 @@ bool showFileErrMessage(const QString& filename, FileErr err, FileErr blankError
errmsg = i18nc("@info", "Please select a file to play");
else
kFatal() << "Program error";
KMessageBox::sorry(errmsgParent, errmsg);
MessageBox::sorry(errmsgParent, errmsg);
return false;
case FileErr_Directory:
KMessageBox::sorry(errmsgParent, i18nc("@info", "<filename>%1</filename> is a folder", file));
MessageBox::sorry(errmsgParent, i18nc("@info", "<filename>%1</filename> is a folder", file));
return false;
case FileErr_Nonexistent: errmsg = i18nc("@info", "<filename>%1</filename> not found", file); break;
case FileErr_Unreadable: errmsg = i18nc("@info", "<filename>%1</filename> is not readable", file); break;
......@@ -1999,7 +1999,7 @@ bool showFileErrMessage(const QString& filename, FileErr err, FileErr blankError
default:
break;
}
if (KMessageBox::warningContinueCancel(errmsgParent, errmsg)
if (MessageBox::warningContinueCancel(errmsgParent, errmsg)
== KMessageBox::Cancel)
return false;
}
......
......@@ -512,8 +512,8 @@ void KAlarmApp::checkKtimezoned()
if (!KSystemTimeZones::isTimeZoneDaemonAvailable())
{