summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-06-25 18:10:00 -0400
committerisanae <14251494+isanae@users.noreply.github.com>2019-07-02 10:10:19 -0400
commitcb56bf76fd8036895bda468a5ad9ef707dbefce9 (patch)
treed0f253edc8ef3921163cf7e14a269422ce98dc62 /src
parentfc3ed80d0de220a1aa9d2b459785d47beea5861b (diff)
fixed text editors not clearing when switching mods
ported typo fixes that applied to the mod info dialog
Diffstat (limited to 'src')
-rw-r--r--src/modinfodialog.ui2
-rw-r--r--src/modinfodialogfiletree.cpp4
-rw-r--r--src/modinfodialogtextfiles.cpp1
-rw-r--r--src/texteditor.cpp8
-rw-r--r--src/texteditor.h1
5 files changed, 13 insertions, 3 deletions
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
<string>ESPs in the data directory and thus visible to the game.</string>
</property>
<property name="whatsThis">
- <string>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.</string>
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;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.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="uniformItemSizes">
<bool>true</bool>
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();