From cb56bf76fd8036895bda468a5ad9ef707dbefce9 Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Tue, 25 Jun 2019 18:10:00 -0400 Subject: fixed text editors not clearing when switching mods ported typo fixes that applied to the mod info dialog --- src/modinfodialog.ui | 2 +- src/modinfodialogfiletree.cpp | 4 ++-- src/modinfodialogtextfiles.cpp | 1 + src/texteditor.cpp | 8 ++++++++ src/texteditor.h | 1 + 5 files changed, 13 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/modinfodialog.ui b/src/modinfodialog.ui index 30ea9217..7a7d82da 100644 --- a/src/modinfodialog.ui +++ b/src/modinfodialog.ui @@ -426,7 +426,7 @@ Most mods do not have optional esps, so chances are good you are looking at an e ESPs in the data directory and thus visible to the game. - These are the mod files that are in the (virtual) data directory of your game and will thus be selectable in the esp list in the main window. + <html><head/><body><p>These are the mod files that are in the (virtual) data directory of your game and will thus be selectable in the esp list in the main window.</p></body></html> true diff --git a/src/modinfodialogfiletree.cpp b/src/modinfodialogfiletree.cpp index b57f6b5d..24faec5e 100644 --- a/src/modinfodialogfiletree.cpp +++ b/src/modinfodialogfiletree.cpp @@ -166,9 +166,9 @@ void FileTreeTab::onDelete() if (rows.count() == 1) { QString fileName = m_fs->fileName(rows[0]); - message = tr("Are sure you want to delete \"%1\"?").arg(fileName); + message = tr("Are you sure you want to delete \"%1\"?").arg(fileName); } else { - message = tr("Are sure you want to delete the selected files?"); + message = tr("Are you sure you want to delete the selected files?"); } if (QMessageBox::question(parentWidget(), tr("Confirm"), message) != QMessageBox::Yes) { diff --git a/src/modinfodialogtextfiles.cpp b/src/modinfodialogtextfiles.cpp index e3d00049..5b035c53 100644 --- a/src/modinfodialogtextfiles.cpp +++ b/src/modinfodialogtextfiles.cpp @@ -185,6 +185,7 @@ void GenericFilesTab::onSelection( void GenericFilesTab::select(const QModelIndex& index) { if (!index.isValid()) { + m_editor->clear(); m_editor->setEnabled(false); return; } diff --git a/src/texteditor.cpp b/src/texteditor.cpp index 6c1685da..ee36c104 100644 --- a/src/texteditor.cpp +++ b/src/texteditor.cpp @@ -57,6 +57,14 @@ void TextEditor::setDefaultStyle() setHighlightBackgroundColor(backgroundColor); } +void TextEditor::clear() +{ + m_filename.clear(); + m_encoding.clear(); + setPlainText(""); + dirty(false); +} + bool TextEditor::load(const QString& filename) { m_filename = filename; diff --git a/src/texteditor.h b/src/texteditor.h index f3031731..775565f2 100644 --- a/src/texteditor.h +++ b/src/texteditor.h @@ -91,6 +91,7 @@ public: void setupToolbar(); + void clear(); bool load(const QString& filename); bool save(); -- cgit v1.3.1