diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2018-09-20 01:36:38 +0300 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2018-09-20 07:22:55 +0000 |
commit | 1156646ce21f7f8ca220f08c03c4d5818353f7c0 (patch) | |
tree | 4991eccb0c267f9607ce4b4e2710cf51490abb80 /src/plugins/texteditor/snippets/snippetssettingspage.cpp | |
parent | 8a472bb0ad95944bdcb41855a57dc507dfedb444 (diff) | |
download | qt-creator-1156646ce21f7f8ca220f08c03c4d5818353f7c0.tar.gz |
TextEditor: Pass dialogParent where needed
Change-Id: I57c41d0e8e37472a1a5070ea082b4c2e1ff6d287
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/texteditor/snippets/snippetssettingspage.cpp')
-rw-r--r-- | src/plugins/texteditor/snippets/snippetssettingspage.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/plugins/texteditor/snippets/snippetssettingspage.cpp b/src/plugins/texteditor/snippets/snippetssettingspage.cpp index b8151c4b17..ce1e8f4335 100644 --- a/src/plugins/texteditor/snippets/snippetssettingspage.cpp +++ b/src/plugins/texteditor/snippets/snippetssettingspage.cpp @@ -131,7 +131,8 @@ bool SnippetsTableModel::setData(const QModelIndex &modelIndex, const QVariant & if (modelIndex.column() == 0) { const QString &s = value.toString(); if (!isValidTrigger(s)) { - QMessageBox::critical(0, tr("Error"), tr("Not a valid trigger.")); + QMessageBox::critical(Core::ICore::dialogParent(), tr("Error"), + tr("Not a valid trigger.")); if (snippet.trigger().isEmpty()) removeSnippet(modelIndex); return false; @@ -207,7 +208,8 @@ void SnippetsTableModel::revertBuitInSnippet(const QModelIndex &modelIndex) { const Snippet &snippet = m_collection->revertedSnippet(modelIndex.row(), m_activeGroupId); if (snippet.id().isEmpty()) { - QMessageBox::critical(0, tr("Error"), tr("Error reverting snippet.")); + QMessageBox::critical(Core::ICore::dialogParent(), tr("Error"), + tr("Error reverting snippet.")); return; } replaceSnippet(snippet, modelIndex); @@ -391,11 +393,12 @@ void SnippetsSettingsPagePrivate::apply() if (m_snippetsCollectionChanged) { QString errorString; - if (SnippetsCollection::instance()->synchronize(&errorString)) + if (SnippetsCollection::instance()->synchronize(&errorString)) { m_snippetsCollectionChanged = false; - else - QMessageBox::critical(Core::ICore::mainWindow(), - tr("Error While Saving Snippet Collection"), errorString); + } else { + QMessageBox::critical(Core::ICore::dialogParent(), + tr("Error While Saving Snippet Collection"), errorString); + } } } @@ -466,7 +469,7 @@ void SnippetsSettingsPagePrivate::removeSnippet() { const QModelIndex &modelIndex = m_ui.snippetsTable->selectionModel()->currentIndex(); if (!modelIndex.isValid()) { - QMessageBox::critical(0, tr("Error"), tr("No snippet selected.")); + QMessageBox::critical(Core::ICore::dialogParent(), tr("Error"), tr("No snippet selected.")); return; } m_model->removeSnippet(modelIndex); |