add QSlider to SessionManager

This commit is contained in:
2025-03-20 10:22:28 +03:00
parent 8df58026c4
commit 2cb43ab411
2 changed files with 8 additions and 0 deletions

View File

@@ -97,6 +97,8 @@ void SessionManager::save() {
sr.setValue(buttons[i].first, buttons[i].second->isChecked(), false);
for (int i = 0; i < stacks.size(); ++i)
sr.setValue(stacks[i].first, stacks[i].second->currentIndex(), false);
for (int i = 0; i < sliders.size(); ++i)
sr.setValue(sliders[i].first, sliders[i].second->value(), false);
for (int i = 0; i < actions.size(); ++i)
sr.setValue(actions[i].first, actions[i].second->isChecked(), false);
for (int i = 0; i < stringlists.size(); ++i)
@@ -221,6 +223,8 @@ void SessionManager::load(bool onlyMainwindow) {
for (int i = 0; i < stacks.size(); ++i)
stacks[i].second->setCurrentIndex(
qMin<int>(sr.getValue(stacks[i].first, stacks[i].second->currentIndex()).toInt(), stacks[i].second->count()));
for (int i = 0; i < sliders.size(); ++i)
sliders[i].second->setValue(sr.getValue(sliders[i].first, sliders[i].second->value()).toInt());
for (int i = 0; i < actions.size(); ++i)
actions[i].second->setChecked(sr.getValue(actions[i].first, actions[i].second->isChecked()).toBool());
for (int i = 0; i < stringlists.size(); ++i)
@@ -267,6 +271,7 @@ void SessionManager::clear(bool with_filename) {
tabs.clear();
buttons.clear();
stacks.clear();
sliders.clear();
actions.clear();
stringlists.clear();
strings.clear();