mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
periodically save tab/window layout
This commit is contained in:
parent
ced5508286
commit
7ea3b0a82c
2 changed files with 9 additions and 0 deletions
|
@ -352,11 +352,18 @@ void WindowManager::initialize(Settings &settings, Paths &paths)
|
||||||
settings.collpseMessagesMinLines.connect(
|
settings.collpseMessagesMinLines.connect(
|
||||||
[this](auto, auto) { this->forceLayoutChannelViews(); });
|
[this](auto, auto) { this->forceLayoutChannelViews(); });
|
||||||
|
|
||||||
|
// timer for periodically saving tabs
|
||||||
|
QObject::connect(&this->saveTimer_, &QTimer::timeout,
|
||||||
|
[=] { this->save(); });
|
||||||
|
this->saveTimer_.start(60 * 1000);
|
||||||
|
|
||||||
this->initialized_ = true;
|
this->initialized_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowManager::save()
|
void WindowManager::save()
|
||||||
{
|
{
|
||||||
|
log("[WindowManager] Saving");
|
||||||
|
|
||||||
assertInGuiThread();
|
assertInGuiThread();
|
||||||
auto app = getApp();
|
auto app = getApp();
|
||||||
|
|
||||||
|
|
|
@ -75,6 +75,8 @@ private:
|
||||||
|
|
||||||
MessageElementFlags wordFlags_{};
|
MessageElementFlags wordFlags_{};
|
||||||
pajlada::Settings::SettingListener wordFlagsListener_;
|
pajlada::Settings::SettingListener wordFlagsListener_;
|
||||||
|
|
||||||
|
QTimer saveTimer_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace chatterino
|
} // namespace chatterino
|
||||||
|
|
Loading…
Reference in a new issue