Commit 84affd32 authored by David Jarvie's avatar David Jarvie
Browse files

Rename MessageBox class to KAMessageBox to avoid name clash on Windows

parent 4b675475
......@@ -1097,8 +1097,8 @@ void AkonadiModel::addCollectionJobDone(KJob* j)
if (j->error())
{
kError() << "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()));
KAMessageBox::error(MainWindow::mainMainWindow(), i18nc("@info", "%1<nl/>(%2)",
i18nc("@info/plain", "Failed to create new calendar resource"), j->errorString()));
emit collectionAdded(job, false);
}
else
......@@ -1176,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();
MessageBox::error(MainWindow::mainMainWindow(), i18nc("@info", "%1<nl/>(%2)", errMsg, j->errorString()));
KAMessageBox::error(MainWindow::mainMainWindow(), i18nc("@info", "%1<nl/>(%2)", errMsg, j->errorString()));
}
else
emit collectionDeleted(jobData.id, true);
......@@ -1222,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();
MessageBox::error(MainWindow::mainMainWindow(), i18nc("@info", "%1<nl/>(%2)", errMsg, j->errorString()));
KAMessageBox::error(MainWindow::mainMainWindow(), i18nc("@info", "%1<nl/>(%2)", errMsg, j->errorString()));
}
else
emit collectionModified(collection.id(), true);
......@@ -1510,7 +1510,7 @@ void AkonadiModel::itemJobDone(KJob* j)
Item current = itemById(itemId); // fetch the up-to-date item
checkQueuedItemModifyJob(current);
}
MessageBox::error(MainWindow::mainMainWindow(), i18nc("@info", "%1<nl/>(%2)", errMsg, j->errorString()));
KAMessageBox::error(MainWindow::mainMainWindow(), i18nc("@info", "%1<nl/>(%2)", errMsg, j->errorString()));
}
else
{
......
......@@ -308,8 +308,8 @@ int AlarmCalendar::load()
if (!KIO::NetAccess::download(mUrl, tmpFile, MainWindow::mainMainWindow()))
{
kError() << "Download failure";
MessageBox::error(MainWindow::mainMainWindow(),
i18nc("@info", "Cannot download calendar: <filename>%1</filename>", mUrl.prettyUrl()));
KAMessageBox::error(MainWindow::mainMainWindow(),
i18nc("@info", "Cannot download calendar: <filename>%1</filename>", mUrl.prettyUrl()));
return -1;
}
kDebug() << "--- Downloaded to" << tmpFile;
......@@ -330,8 +330,8 @@ int AlarmCalendar::load()
if (!fi.size())
return 0; // file is zero length
kError() << "Error loading calendar file '" << tmpFile <<"'";
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()));
KAMessageBox::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();
......@@ -425,8 +425,8 @@ bool AlarmCalendar::saveCal(const QString& newFile)
#endif
{
kError() << "Saving" << saveFilename << "failed.";
MessageBox::error(MainWindow::mainMainWindow(),
i18nc("@info", "Failed to save calendar to <filename>%1</filename>", mICalUrl.prettyUrl()));
KAMessageBox::error(MainWindow::mainMainWindow(),
i18nc("@info", "Failed to save calendar to <filename>%1</filename>", mICalUrl.prettyUrl()));
return false;
}
......@@ -435,8 +435,8 @@ bool AlarmCalendar::saveCal(const QString& newFile)
if (!KIO::NetAccess::upload(saveFilename, mICalUrl, MainWindow::mainMainWindow()))
{
kError() << saveFilename << "upload failed.";
MessageBox::error(MainWindow::mainMainWindow(),
i18nc("@info", "Cannot upload calendar to <filename>%1</filename>", mICalUrl.prettyUrl()));
KAMessageBox::error(MainWindow::mainMainWindow(),
i18nc("@info", "Cannot upload calendar to <filename>%1</filename>", mICalUrl.prettyUrl()));
return false;
}
}
......@@ -858,7 +858,7 @@ bool AlarmCalendar::importAlarms(QWidget* parent, AlarmResource* resource)
if (!KStandardDirs::exists(filename))
{
kDebug() << "File '" << url.prettyUrl() <<"' not found";
MessageBox::error(parent, i18nc("@info", "Could not load calendar <filename>%1</filename>.", url.prettyUrl()));
KAMessageBox::error(parent, i18nc("@info", "Could not load calendar <filename>%1</filename>.", url.prettyUrl()));
return false;
}
}
......@@ -867,7 +867,7 @@ bool AlarmCalendar::importAlarms(QWidget* parent, AlarmResource* resource)
if (!KIO::NetAccess::download(url, filename, MainWindow::mainMainWindow()))
{
kError() << "Download failure";
MessageBox::error(parent, i18nc("@info", "Cannot download calendar: <filename>%1</filename>", url.prettyUrl()));
KAMessageBox::error(parent, i18nc("@info", "Cannot download calendar: <filename>%1</filename>", url.prettyUrl()));
return false;
}
kDebug() << "--- Downloaded to" << filename;
......@@ -885,7 +885,7 @@ bool AlarmCalendar::importAlarms(QWidget* parent, AlarmResource* resource)
if (!success)
{
kDebug() << "Error loading calendar '" << filename <<"'";
MessageBox::error(parent, i18nc("@info", "Could not load calendar <filename>%1</filename>.", url.prettyUrl()));
KAMessageBox::error(parent, i18nc("@info", "Could not load calendar <filename>%1</filename>.", url.prettyUrl()));
}
else
{
......@@ -1066,8 +1066,8 @@ bool AlarmCalendar::exportAlarms(const KAEvent::List& events, QWidget* parent)
if (fi.size())
{
kError() << "Error loading calendar file" << file << "for append";
MessageBox::error(MainWindow::mainMainWindow(),
i18nc("@info", "Error loading calendar to append to:<nl/><filename>%1</filename>", url.prettyUrl()));
KAMessageBox::error(MainWindow::mainMainWindow(),
i18nc("@info", "Error loading calendar to append to:<nl/><filename>%1</filename>", url.prettyUrl()));
return false;
}
}
......@@ -1116,15 +1116,15 @@ bool AlarmCalendar::exportAlarms(const KAEvent::List& events, QWidget* parent)
#endif
{
kError() << file << ": failed";
MessageBox::error(MainWindow::mainMainWindow(),
i18nc("@info", "Failed to save new calendar to:<nl/><filename>%1</filename>", url.prettyUrl()));
KAMessageBox::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";
MessageBox::error(MainWindow::mainMainWindow(),
i18nc("@info", "Cannot upload new calendar to:<nl/><filename>%1</filename>", url.prettyUrl()));
KAMessageBox::error(MainWindow::mainMainWindow(),
i18nc("@info", "Cannot upload new calendar to:<nl/><filename>%1</filename>", url.prettyUrl()));
success = false;
}
#ifdef USE_AKONADI
......
......@@ -289,7 +289,7 @@ KDateTime AlarmTimeWidget::getDateTime(int* minsFromNow, bool checkExpired, bool
if (!mDelayTimeEdit->isValid())
{
if (showErrorMessage)
MessageBox::sorry(const_cast<AlarmTimeWidget*>(this), i18nc("@info", "Invalid time"));
KAMessageBox::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)
MessageBox::sorry(const_cast<AlarmTimeWidget*>(this), i18nc("@info", "Invalid date"));
KAMessageBox::sorry(const_cast<AlarmTimeWidget*>(this), i18nc("@info", "Invalid date"));
if (errorWidget)
*errorWidget = mDateEdit;
}
else
{
if (showErrorMessage)
MessageBox::sorry(const_cast<AlarmTimeWidget*>(this), i18nc("@info", "Invalid time"));
KAMessageBox::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)
MessageBox::sorry(const_cast<AlarmTimeWidget*>(this), i18nc("@info", "Alarm date has already expired"));
KAMessageBox::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)
MessageBox::sorry(const_cast<AlarmTimeWidget*>(this), i18nc("@info", "Alarm time has already expired"));
KAMessageBox::sorry(const_cast<AlarmTimeWidget*>(this), i18nc("@info", "Alarm time has already expired"));
if (errorWidget)
*errorWidget = mTimeEdit;
return KDateTime();
......
......@@ -130,7 +130,7 @@ KAlarm::Calendar::Compat CalendarCompat::fix(KCal::CalendarLocal& calendar, cons
#else
resource->resourceName());
#endif
if (MessageBox::warningYesNo(MainWindow::mainMainWindow(),
if (KAMessageBox::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());
MessageBox::error(MainWindow::mainMainWindow(), errmsg);
KAMessageBox::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 (MessageBox::warningContinueCancel(messageParent,
else if (KAMessageBox::warningContinueCancel(messageParent,
i18nc("@info", "Do you really want to disable your default calendar?"))
== KMessageBox::Cancel)
return false;
}
if (!errmsg.isEmpty())
{
MessageBox::sorry(messageParent, errmsg);
KAMessageBox::sorry(messageParent, errmsg);
return false;
}
}
......
......@@ -112,7 +112,7 @@ void DeferAlarmDlg::slotOk()
case KAEvent::LIMIT_NONE:
break; // can't happen with a valid endTime
}
MessageBox::sorry(this, text);
KAMessageBox::sorry(this, text);
}
else
accept();
......
......@@ -958,7 +958,7 @@ bool EditAlarmDlg::validate()
if (!errmsg.isEmpty())
{
mTemplateName->setFocus();
MessageBox::sorry(this, errmsg);
KAMessageBox::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 (MessageBox::warningContinueCancel(this, prompt) != KMessageBox::Continue)
if (KAMessageBox::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)
{
MessageBox::sorry(this, i18nc("@info", "Recurrence has already expired"));
KAMessageBox::sorry(this, i18nc("@info", "Recurrence has already expired"));
return false;
}
if (event.workTimeOnly() && !event.nextTrigger(KAEvent::DISPLAY_TRIGGER).isValid())
{
if (MessageBox::warningContinueCancel(this, i18nc("@info", "The alarm will never occur during working hours"))
if (KAMessageBox::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();
MessageBox::sorry(this, errmsg);
KAMessageBox::sorry(this, errmsg);
return false;
}
}
......@@ -1064,8 +1064,8 @@ bool EditAlarmDlg::validate()
{
mTabs->setCurrentIndex(mMainPageIndex);
mReminder->setFocusOnCount();
MessageBox::sorry(this, i18nc("@info", "Reminder period must be less than the recurrence interval, unless <interface>%1</interface> is checked."
, Reminder::i18n_chk_FirstRecurrenceOnly()));
KAMessageBox::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)
{
MessageBox::sorry(this, i18nc("@info", "The duration of a repetition within the recurrence must be less than the recurrence interval minus any reminder period"));
KAMessageBox::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())))
{
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"));
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"));
mRecurrenceEdit->activateSubRepetition(); // display the alarm repetition dialog again
return false;
}
......@@ -1118,7 +1118,7 @@ bool EditAlarmDlg::validate()
if (!mCollection.isValid())
{
if (!cancelled)
MessageBox::sorry(this, i18nc("@info", "You must select a calendar to save the alarm in"));
KAMessageBox::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)
MessageBox::sorry(this, i18nc("@info", "You must select a calendar to save the alarm in"));
KAMessageBox::sorry(this, i18nc("@info", "You must select a calendar to save the alarm in"));
return false;
}
}
......
......@@ -955,7 +955,7 @@ bool EditCommandAlarmDlg::type_validate(bool trial)
{
showMainPage();
mCmdLogFileEdit->setFocus();
MessageBox::sorry(this, i18nc("@info", "Log file must be the name or path of a local file, with write permission."));
KAMessageBox::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
......@@ -972,7 +972,7 @@ void EditCommandAlarmDlg::type_trySuccessMessage(ShellProcess* proc, const QStri
if (mCmdOutputGroup->checkedButton() != mCmdExecInTerm)
{
theApp()->commandMessage(proc, this);
MessageBox::information(this, i18nc("@info", "Command executed: <icode>%1</icode>", text));
KAMessageBox::information(this, i18nc("@info", "Command executed: <icode>%1</icode>", text));
theApp()->commandMessage(proc, 0);
}
}
......@@ -1320,14 +1320,14 @@ bool EditEmailAlarmDlg::type_validate(bool trial)
if (!bad.isEmpty())
{
mEmailToEdit->setFocus();
MessageBox::error(this, i18nc("@info", "Invalid email address: <email>%1</email>", bad));
KAMessageBox::error(this, i18nc("@info", "Invalid email address: <email>%1</email>", bad));
return false;
}
}
if (mEmailAddresses.isEmpty())
{
mEmailToEdit->setFocus();
MessageBox::error(this, i18nc("@info", "No email address specified"));
KAMessageBox::error(this, i18nc("@info", "No email address specified"));
return false;
}
......@@ -1344,12 +1344,12 @@ bool EditEmailAlarmDlg::type_validate(bool trial)
break; // empty
case -1:
mEmailAttachList->setFocus();
MessageBox::error(this, i18nc("@info", "Invalid email attachment: <filename>%1</filename>", att));
KAMessageBox::error(this, i18nc("@info", "Invalid email attachment: <filename>%1</filename>", att));
return false;
}
}
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)
if (trial && KAMessageBox::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;
}
......@@ -1368,7 +1368,7 @@ void EditEmailAlarmDlg::type_trySuccessMessage(ShellProcess*, const QString&)
to, Preferences::emailBccAddress()) + "</qt>";
else
msg = "<qt>" + i18nc("@info", "Email sent to:<nl/>%1", to) + "</qt>";
MessageBox::information(this, msg);
KAMessageBox::information(this, msg);
}
/******************************************************************************
......@@ -1693,7 +1693,7 @@ QString CommandEdit::text(EditAlarmDlg* dlg, bool showErrorMessage) const
{
QString result = text();
if (showErrorMessage && result.isEmpty())
MessageBox::sorry(dlg, i18nc("@info", "Please enter a command or script to execute"));
KAMessageBox::sorry(dlg, i18nc("@info", "Please enter a command or script to execute"));
return result;
}
......
......@@ -268,7 +268,7 @@ void Find::slotFind()
if (!(mOptions & (FIND_LIVE | FIND_ARCHIVED))
|| !(mOptions & (FIND_MESSAGE | FIND_FILE | FIND_COMMAND | FIND_EMAIL | FIND_AUDIO)))
{
MessageBox::sorry(mDialog, i18nc("@info", "No alarm types are selected to search"));
KAMessageBox::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 (MessageBox::questionYesNo(mListView, msg, QString(), KStandardGuiItem::cont(), KStandardGuiItem::cancel()) == KMessageBox::Yes)
if (KAMessageBox::questionYesNo(mListView, msg, QString(), KStandardGuiItem::cont(), KStandardGuiItem::cancel()) == KMessageBox::Yes)
{
mNoCurrentItem = true;
findNext(forward, false, false);
......
......@@ -1065,7 +1065,7 @@ void displayUpdateError(QWidget* parent, UpdateStatus status, UpdateError code,
: i18nc("@info", "Error saving alarm template");
break;
}
MessageBox::error(parent, errmsg);
KAMessageBox::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;
MessageBox::error(parent, msg);
KAMessageBox::error(parent, msg);
}
/******************************************************************************
......@@ -1353,7 +1353,7 @@ bool setRtcWakeTime(unsigned triggerTime, QWidget* parent)
}
errmsg = i18nc("@info", "Error obtaining authorization (%1)", errcode);
}
MessageBox::information(parent, errmsg);
KAMessageBox::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
{
MessageBox::sorry(parent, i18nc("@info", "You must enable a template calendar to save the template in"));
KAMessageBox::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())
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()));
KAMessageBox::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 (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"))
if (KAMessageBox::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";
MessageBox::sorry(errmsgParent, errmsg);
KAMessageBox::sorry(errmsgParent, errmsg);
return false;
case FileErr_Directory:
MessageBox::sorry(errmsgParent, i18nc("@info", "<filename>%1</filename> is a folder", file));
KAMessageBox::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 (MessageBox::warningContinueCancel(errmsgParent, errmsg)
if (KAMessageBox::warningContinueCancel(errmsgParent, errmsg)
== KMessageBox::Cancel)
return false;
}
......
......@@ -512,8 +512,8 @@ void KAlarmApp::checkKtimezoned()
if (!KSystemTimeZones::isTimeZoneDaemonAvailable())
{
kDebug() << "ktimezoned not running: using UTC only";
MessageBox::information(MainWindow::mainMainWindow(),
i18nc("@info", "Time zones are not accessible:<nl/>KAlarm will use the UTC time zone.<nl/><nl/>(The KDE time zone service is not available:<nl/>check that <application>ktimezoned</application> is installed.)"),
KAMessageBox::information(MainWindow::mainMainWindow(),
i18nc("@info", "Time zones are not accessible:<nl/>KAlarm will use the UTC time zone.<nl/><nl/>(The KDE time zone service is not available:<nl/>check that <application>ktimezoned</application> is installed.)"),
QString(), QLatin1String("tzunavailable"));
}
#endif
......@@ -584,17 +584,17 @@ bool KAlarmApp::quitIf(int exitCode, bool force)
void KAlarmApp::doQuit(QWidget* parent)
{
kDebug();
if (MessageBox::warningContinueCancel(parent, KMessageBox::Cancel,
i18nc("@info", "Quitting will disable alarms (once any alarm message windows are closed)."),
QString(), KStandardGuiItem::quit(), Preferences::QUIT_WARN
) != KMessageBox::Yes)
if (KAMessageBox::warningContinueCancel(parent, KMessageBox::Cancel,
i18nc("@info", "Quitting will disable alarms (once any alarm message windows are closed)."),
QString(), KStandardGuiItem::quit(), Preferences::QUIT_WARN
) != KMessageBox::Yes)
return;
if (!Preferences::autoStart())
{
int option = KMessageBox::No;
if (!Preferences::autoStartChangedByUser())
{
option = MessageBox::questionYesNoCancel(parent,
option = KAMessageBox::questionYesNoCancel(parent,
i18nc("@info", "Do you want to start KAlarm at login?<nl/>"
"(Note that alarms will be disabled if KAlarm is not started.)"),
QString(), KStandardGuiItem::yes(), KStandardGuiItem::no(),
......@@ -1998,7 +1998,7 @@ void KAlarmApp::slotCommandExited(ShellProcess* proc)
errmsg += '\n';
errmsg += proc->command();
}
MessageBox::error(pd->messageBoxParent, errmsg);
KAMessageBox::error(pd->messageBoxParent, errmsg);
}
else
commandErrorMsg(proc, *pd->event, pd->alarm, pd->flags);
......
......@@ -445,7 +445,7 @@ void KAMail::notifyQueued(const KAEvent& event)
QString domain = addr.mailboxList.first().addrSpec().domain;
if (!domain.isEmpty() && domain != localhost && domain != hostname)
{
MessageBox::information(MainWindow::mainMainWindow(), i18nc("@info", "An email has been queued to be sent"), QString(), Preferences::EMAIL_QUEUED_NOTIFY);
KAMessageBox::information(MainWindow::mainMainWindow(), i18nc("@info", "An email has been queued to be sent"), QString(), Preferences::EMAIL_QUEUED_NOTIFY);
return;
}
}
......
......@@ -26,15 +26,15 @@
#include <kglobal.h>
QMap<QString, KMessageBox::ButtonCode> MessageBox::mContinueDefaults;
QMap<QString, KMessageBox::ButtonCode> KAMessageBox::mContinueDefaults;
const MessageBox::Options MessageBox::NoAppModal = KMessageBox::Options(KMessageBox::Notify | MessageBox::WindowModal);
const KAMessageBox::Options KAMessageBox::NoAppModal = KMessageBox::Options(KMessageBox::Notify | KAMessageBox::WindowModal);
/******************************************************************************
* Set the default button for continue/cancel message boxes with the specified
* 'dontAskAgainName'.
*/
void MessageBox::setContinueDefault(const QString& dontAskAgainName, ButtonCode defaultButton)
void KAMessageBox::setContinueDefault(const QString& dontAskAgainName, ButtonCode defaultButton)
{
mContinueDefaults[dontAskAgainName] = (defaultButton == Cancel ? Cancel : Continue);
}
......@@ -43,7 +43,7 @@ void MessageBox::setContinueDefault(const QString& dontAskAgainName, ButtonCode
* Get the default button for continue/cancel message boxes with the specified
* 'dontAskAgainName'.
*/
KMessageBox::ButtonCode MessageBox::getContinueDefault(const QString& dontAskAgainName)
KMessageBox::ButtonCode KAMessageBox::getContinueDefault(const QString& dontAskAgainName)
{
ButtonCode defaultButton = Continue;
if (!dontAskAgainName.isEmpty())
......@@ -60,7 +60,7 @@ KMessageBox::ButtonCode MessageBox::getContinueDefault(const QString& dontAskAga
* If 'dontAskAgainName' is specified, the message box will only be suppressed
* if the user chose Continue last time.
*/
int MessageBox::warningContinueCancel(QWidget* parent, ButtonCode defaultButton, const QString& text,
int KAMessageBox::warningContinueCancel(QWidget* parent, ButtonCode defaultButton, const QString& text,
const QString& caption, const KGuiItem& buttonContinue,
const QString& dontAskAgainName)
{
......@@ -91,7 +91,7 @@ int MessageBox::warningContinueCancel(QWidget* parent, ButtonCode defaultButton,
* previously to set this for this 'dontShowAgainName' value.
* Reply = true if 'defaultShow' was written.
*/
bool MessageBox::setDefaultShouldBeShownContinue(const QString& dontShowAgainName, bool defaultShow)
bool KAMessageBox::setDefaultShouldBeShownContinue(const QString& dontShowAgainName, bool defaultShow)
{
if (dontShowAgainName.isEmpty())
return false;
......@@ -111,7 +111,7 @@ bool MessageBox::setDefaultShouldBeShownContinue(const QString& dontShowAgainNam
* or warningContinueCancel() must have been called previously to set this for this
* 'dontShowAgainName' value.
*/
bool MessageBox::shouldBeShownContinue(const QString& dontShowAgainName)
bool KAMessageBox::shouldBeShownContinue(const QString& dontShowAgainName)
{
if (getContinueDefault(dontShowAgainName) != Cancel)
return KMessageBox::shouldBeShownContinue(dontShowAgainName);
......@@ -126,7 +126,7 @@ bool MessageBox::shouldBeShownContinue(const QString& dontShowAgainName)
* If 'dontShow' is true, the message box will be suppressed and it will return
* 'result'.
*/
void MessageBox::saveDontShowAgainYesNo(const QString& dontShowAgainName, bool dontShow, ButtonCode result)
void KAMessageBox::saveDontShowAgainYesNo(const QString& dontShowAgainName, bool dontShow, ButtonCode result)
{
saveDontShowAgain(dontShowAgainName, true, dontShow, (result == Yes ? "yes" : "no"));
}
......@@ -139,7 +139,7 @@ void MessageBox::saveDontShowAgainYesNo(const QString& dontShowAgainName, bool d
* or warningContinueCancel() must have been called previously to set this for this
* 'dontShowAgainName' value.
*/
void MessageBox::saveDontShowAgainContinue(const QString& dontShowAgainName, bool dontShow)
void KAMessageBox::saveDontShowAgainContinue(const QString& dontShowAgainName, bool dontShow)
{
if (getContinueDefault(dontShowAgainName) == Cancel)
saveDontShowAgainYesNo(dontShowAgainName, dontShow, Yes);
......@@ -150,7 +150,7 @@ void MessageBox::saveDontShowAgainContinue(const QString& dontShowAgainName, boo
/******************************************************************************
* Save whether the message box should not be shown again.
*/
void MessageBox::saveDontShowAgain(const QString& dontShowAgainName, bool yesno, bool dontShow, const char* yesnoResult)
void KAMessageBox::saveDontShowAgain(const QString& dontShowAgainName, bool yesno, bool dontShow, const char* yesnoResult)
{
if (dontShowAgainName.isEmpty())