Commit db5a4b38 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.
parent 05499258
......@@ -32,6 +32,7 @@
#include "compatibilityattribute.h"
#include "eventattribute.h"
#include "mainwindow.h"
#include "messagebox.h"
#include "preferences.h"
#include "synchtimer.h"
#include "kalarmsettings.h"
......@@ -54,7 +55,6 @@
#include <akonadi/itemfetchscope.h>
#include <klocale.h>
#include <kmessagebox.h>
#include <QApplication>
#include <QFileInfo>
......@@ -1135,7 +1135,9 @@ 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()));
KMessageBox::error(MainWindow::mainMainWindow(),
i18nc("@info", "%1<nl/>(%2)", errMsg, j->errorString()),
QString(), MessageBox::NoAppModal);
}
else
emit collectionDeleted(jobData.id, true);
......@@ -1186,7 +1188,9 @@ void AkonadiModel::modifyCollectionJobDone(KJob* j)
{
QString errMsg = i18nc("@info", "Failed to update calendar <resource>%1</resource>.", displayName(collection));
kError() << "Id:" << collection.id() << errMsg << ":" << j->errorString();
KMessageBox::error(0, i18nc("@info", "%1<nl/>(%2)", errMsg, j->errorString()));
KMessageBox::error(MainWindow::mainMainWindow(),
i18nc("@info", "%1<nl/>(%2)", errMsg, j->errorString()),
QString(), MessageBox::NoAppModal);
}
}
else
......@@ -1475,7 +1479,9 @@ 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()));
KMessageBox::error(MainWindow::mainMainWindow(),
i18nc("@info", "%1<nl/>(%2)", errMsg, j->errorString()),
QString(), MessageBox::NoAppModal);
}
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();
......
......@@ -19,10 +19,10 @@
*/
#include "calendarcompat.h"
#include "messagebox.h"
#include <kcal/calendarlocal.h>
#include <kmessagebox.h>
#include <kdebug.h>
namespace CalendarCompat
......@@ -63,7 +63,7 @@ KAlarm::Calendar::Compat fix(KCal::CalendarLocal& calendar, const QString& local
if (conv == AlarmResource::PROMPT || conv == AlarmResource::PROMPT_PART)
{
QString msg = KAlarm::Calendar::conversionPrompt(resource->resourceName(), versionString, (conv == AlarmResource::PROMPT));
if (KMessageBox::warningYesNo(0, msg) != KMessageBox::Yes)
if (MessageBox::warningYesNo(MainWindow::mainMainWindow(), msg) != KMessageBox::Yes)
return KAlarm::Calendar::Convertible;
}
KAlarm::Calendar::setKAlarmVersion(calendar);
......
......@@ -24,6 +24,8 @@
#include "kalarmdirsettings.h"
#include "collectionattribute.h"
#include "compatibilityattribute.h"
#include "mainwindow.h"
#include "messagebox.h"
#include "version.h"
#include <akonadi/agentinstancecreatejob.h>
......@@ -37,7 +39,6 @@
#include <klocale.h>
#include <kconfiggroup.h>
#include <kstandarddirs.h>
#include <kmessagebox.h>
#include <kdebug.h>
#include <QTimer>
......@@ -256,7 +257,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();
......@@ -325,7 +326,7 @@ bool CalendarUpdater::update()
QString versionString = KAlarm::getVersionString(compatAttr->version());
QString msg = KAlarm::Calendar::conversionPrompt(mCollection.name(), versionString, false);
kDebug() << "Version" << versionString;
if (KMessageBox::warningYesNo(qobject_cast<QWidget*>(mParent), msg) == KMessageBox::Yes)
if (MessageBox::warningYesNo(qobject_cast<QWidget*>(mParent), msg))
{
// Tell the resource to update the backend storage format
QString errmsg;
......@@ -346,9 +347,10 @@ bool CalendarUpdater::update()
}
if (!errmsg.isEmpty())
{
KMessageBox::error(0, i18nc("@info", "%1<nl/>(%2)",
i18nc("@info/plain", "Failed to update format of calendar <resource>%1</resource>", mCollection.name()),
errmsg));
MessageBox::error(MainWindow::mainMainWindow(),
i18nc("@info", "%1<nl/>(%2)",
i18nc("@info/plain", "Failed to update format of calendar <resource>%1</resource>", mCollection.name()),
errmsg));
}
}
else
......
......@@ -22,6 +22,7 @@
#include "autoqpointer.h"
#include "collectionattribute.h"
#include "compatibilityattribute.h"
#include "messagebox.h"
#include "preferences.h"
#include <akonadi/collectiondialog.h>
......@@ -30,7 +31,6 @@
#include <akonadi/entitymimetypefiltermodel.h>
#include <klocale.h>
#include <kmessagebox.h>
#include <QApplication>
#include <QMouseEvent>
......@@ -357,14 +357,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;
}
}
......@@ -787,7 +787,7 @@ void CollectionControlModel::statusChanged(const Collection& collection, Akonadi
}
if (singleType)
msg = i18nc("@info", "<para>%1</para><para>Please select a new default calendar.</para>", msg);
KMessageBox::information(messageParent, msg);
MessageBox::information(messageParent, msg);
}
}
break;
......
/*
* 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,11 +1331,11 @@ 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)?"),
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>
......@@ -265,7 +265,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;
}
......@@ -418,7 +418,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);
}
/******************************************************************************
......@@ -1308,7 +1308,7 @@ void Private::cancelRtcWake()
// setRtcWakeTime will only work with a parent window specified
setRtcWakeTime(0, mMsgParent);
deleteRtcWakeConfig();
KMessageBox::information(mMsgParent, i18nc("info", "The scheduled Wake from Suspend has been cancelled."));
MessageBox::information(mMsgParent, i18nc("info", "The scheduled Wake from Suspend has been cancelled."));
}
/******************************************************************************
......@@ -1354,7 +1354,7 @@ bool setRtcWakeTime(unsigned triggerTime, QWidget* parent)
}
errmsg = i18nc("@info", "Error obtaining authorization (%1)", errcode);
}
KMessageBox::information(parent, errmsg);