Commit fad6dd08 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

use somewhat less arcane error message box

parent 2be153ba
......@@ -718,19 +718,6 @@ void DesignDocumentController::selectAll()
view.setSelectedModelNodes(allNodesExceptRootNode);
}
void DesignDocumentController::showError(const QString &message, QWidget *parent) const
{
if (!parent)
parent = m_d->stackedWidget.data();
QMessageBox msgBox(parent);
msgBox.setWindowFlags(Qt::Sheet | Qt::MSWindowsFixedSizeDialogHint);
msgBox.setWindowTitle("Invalid qml");
msgBox.setText(message);
msgBox.setIcon(QMessageBox::Warning);
msgBox.exec();
}
RewriterView *DesignDocumentController::rewriterView() const
{
return m_d->rewriterView.data();
......@@ -773,10 +760,8 @@ bool DesignDocumentController::save(QWidget *parent)
Utils::FileSaver saver(m_d->fileName, QIODevice::Text);
if (m_d->model)
saver.write(m_d->textEdit->toPlainText().toLatin1());
if (!saver.finalize()) {
showError(saver.errorString(), parent);
if (!saver.finalize(parent ? parent : m_d->stackedWidget.data()))
return false;
}
if (m_d->model)
m_d->textEdit->setPlainText(m_d->textEdit->toPlainText()); // clear undo/redo history
......
......@@ -128,7 +128,6 @@ public slots:
private slots:
void doRealSaveAs(const QString &fileName);
void showError(const QString &message, QWidget *parent = 0) const;
void changeCurrentModelTo(const ModelNode &node);
private:
......
Markdown is supported
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