summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElvis Angelaccio <elvis.angelaccio@kde.org>2016-11-14 12:08:39 (GMT)
committerElvis Angelaccio <elvis.angelaccio@kde.org>2016-11-14 12:08:39 (GMT)
commitf399eaa2df9f08eb7ae90aa1937f0999227cfa47 (patch)
tree9af148b3474a14406ec58de025e6a85eed0f745c
parent884e8ccb12b5c29d965dbca8cfa21a937d5f3e31 (diff)
part: port away from QMessageBox
KMessage{Box|Widget} should be used instead, as recommended by the current HIG.
-rw-r--r--part/overwritedialog.h1
-rw-r--r--part/part.cpp20
2 files changed, 5 insertions, 16 deletions
diff --git a/part/overwritedialog.h b/part/overwritedialog.h
index f44cce5..f0ec4ac 100644
--- a/part/overwritedialog.h
+++ b/part/overwritedialog.h
@@ -36,7 +36,6 @@
#include <QDialog>
#include <QLabel>
#include <QListWidget>
-#include <QMessageBox>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QPushButton>
diff --git a/part/part.cpp b/part/part.cpp
index 0e42adc..6e22a45 100644
--- a/part/part.cpp
+++ b/part/part.cpp
@@ -1403,11 +1403,7 @@ void Part::slotCopyFiles()
void Part::slotRenameFile(const QString &name)
{
if (name == QLatin1String(".") || name == QLatin1String("..") || name.contains(QLatin1Char('/'))) {
- QMessageBox messageBox(QMessageBox::Warning,
- i18n("Invalid filename"),
- i18n("Filename can't contain slashes and can't be equal to \".\" or \"..\""),
- QMessageBox::Ok);
- messageBox.exec();
+ displayMsgWidget(KMessageWidget::Error, i18n("Filename can't contain slashes and can't be equal to \".\" or \"..\""));
return;
}
const Archive::Entry *entry = m_model->entryForIndex(m_view->selectionModel()->currentIndex());
@@ -1450,11 +1446,9 @@ void Part::slotPasteFiles()
foreach (const Archive::Entry *entry, entriesWithoutChildren) {
if (entry->isDir() && m_destination->fullPath().startsWith(entry->fullPath())) {
- QMessageBox messageBox(QMessageBox::Warning,
- i18n("Moving a folder into itself"),
- i18n("Folders can't be moved into themselves."),
- QMessageBox::Ok);
- messageBox.exec();
+ KMessageBox::error(widget(),
+ i18n("Folders can't be moved into themselves."),
+ i18n("Moving a folder into itself"));
delete m_destination;
return;
}
@@ -1482,11 +1476,7 @@ void Part::slotPasteFiles(QVector<Kerfuffle::Archive::Entry*> &files, Kerfuffle:
QStringList newPaths = ReadOnlyArchiveInterface::entryPathsFromDestination(filesPaths, destination, entriesWithoutChildren);
if (ArchiveModel::hasDuplicatedEntries(newPaths)) {
- QMessageBox messageBox(QMessageBox::Warning,
- i18n("Pasting entries with the same name"),
- i18n("Entries with the same names can't be pasted to the same destination."),
- QMessageBox::Ok);
- messageBox.exec();
+ displayMsgWidget(KMessageWidget::Error, i18n("Entries with the same names can't be pasted to the same destination."));
delete m_destination;
return;
}