diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-05-31 11:31:21 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-05-31 11:54:32 -0400 |
| commit | b7580c5ad766ebf984641674fdc0f121d754c82e (patch) | |
| tree | b73d66b48c5bd111f83c5061a47cd550229ae147 | |
| parent | 8efab8bf129b6f9928f478a429e20cf018e5e373 (diff) | |
restore conflicts selected tab and checkboxes
| -rw-r--r-- | src/modinfodialog.cpp | 28 | ||||
| -rw-r--r-- | src/modinfodialog.h | 4 | ||||
| -rw-r--r-- | src/modinfodialog.ui | 2 |
3 files changed, 26 insertions, 8 deletions
diff --git a/src/modinfodialog.cpp b/src/modinfodialog.cpp index 4852150f..1dd44112 100644 --- a/src/modinfodialog.cpp +++ b/src/modinfodialog.cpp @@ -553,13 +553,13 @@ int ModInfoDialog::tabIndex(const QString &tabId) void ModInfoDialog::saveState(Settings& s) const { s.directInterface().setValue("mod_info_tabs", saveTabState()); - s.directInterface().setValue("mod_info_conflict_expanders", saveConflictExpandersState()); + s.directInterface().setValue("mod_info_conflicts", saveConflictsState()); } void ModInfoDialog::restoreState(const Settings& s) { restoreTabState(s.directInterface().value("mod_info_tabs").toByteArray()); - restoreConflictExpandersState(s.directInterface().value("mod_info_conflict_expanders").toByteArray()); + restoreConflictsState(s.directInterface().value("mod_info_conflicts").toByteArray()); } void ModInfoDialog::restoreTabState(const QByteArray &state) @@ -593,7 +593,7 @@ void ModInfoDialog::restoreTabState(const QByteArray &state) ui->tabWidget->blockSignals(false); } -void ModInfoDialog::restoreConflictExpandersState(const QByteArray &state) +void ModInfoDialog::restoreConflictsState(const QByteArray &state) { QDataStream stream(state); @@ -608,6 +608,20 @@ void ModInfoDialog::restoreConflictExpandersState(const QByteArray &state) m_overwrittenExpander.toggle(overwrittenExpanded); m_nonconflictExpander.toggle(noConflictExpanded); } + + int index = 0; + bool noConflictChecked = false; + bool showAllChecked = false; + bool showNearestChecked = false; + + stream >> index >> noConflictChecked >> showAllChecked >> showNearestChecked; + + if (stream.status() == QDataStream::Ok) { + ui->tabConflictsTabs->setCurrentIndex(index); + ui->conflictsAdvancedShowNoConflict->setChecked(noConflictChecked); + ui->conflictsAdvancedShowAll->setChecked(showAllChecked); + ui->conflictsAdvancedShowNearest->setChecked(showNearestChecked); + } } QByteArray ModInfoDialog::saveTabState() const @@ -622,7 +636,7 @@ QByteArray ModInfoDialog::saveTabState() const return result; } -QByteArray ModInfoDialog::saveConflictExpandersState() const +QByteArray ModInfoDialog::saveConflictsState() const { QByteArray result; QDataStream stream(&result, QIODevice::WriteOnly); @@ -630,7 +644,11 @@ QByteArray ModInfoDialog::saveConflictExpandersState() const stream << m_overwriteExpander.opened() << m_overwrittenExpander.opened() - << m_nonconflictExpander.opened(); + << m_nonconflictExpander.opened() + << ui->tabConflictsTabs->currentIndex() + << ui->conflictsAdvancedShowNoConflict->isChecked() + << ui->conflictsAdvancedShowAll->isChecked() + << ui->conflictsAdvancedShowNearest->isChecked(); return result; } diff --git a/src/modinfodialog.h b/src/modinfodialog.h index 5169a993..40e45eb4 100644 --- a/src/modinfodialog.h +++ b/src/modinfodialog.h @@ -452,10 +452,10 @@ private: void restoreTabState(const QByteArray &state);
- void restoreConflictExpandersState(const QByteArray &state);
+ void restoreConflictsState(const QByteArray &state);
QByteArray saveTabState() const;
- QByteArray saveConflictExpandersState() const;
+ QByteArray saveConflictsState() const;
bool canHideConflictItem(const QTreeWidgetItem* item) const;
bool canUnhideConflictItem(const QTreeWidgetItem* item) const;
diff --git a/src/modinfodialog.ui b/src/modinfodialog.ui index b55c0f07..6c1ed36d 100644 --- a/src/modinfodialog.ui +++ b/src/modinfodialog.ui @@ -402,7 +402,7 @@ Most mods do not have optional esps, so chances are good you are looking at an e </attribute>
<layout class="QVBoxLayout" name="verticalLayout_8" stretch="0">
<item>
- <widget class="QTabWidget" name="tabWidget_2">
+ <widget class="QTabWidget" name="tabConflictsTabs">
<property name="currentIndex">
<number>1</number>
</property>
|
