mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-13 07:15:06 +00:00
ui/updater: Don't require Qt interaction before OBS is ready (#427)
Fixes one of the launch freezes caused by StreamFX due to interaction with the Qt message loop.
This commit is contained in:
parent
2f8a0935c5
commit
2c37e19266
3 changed files with 17 additions and 8 deletions
|
@ -176,14 +176,6 @@ streamfx::ui::updater::updater(QMenu* menu)
|
||||||
std::placeholders::_1, std::placeholders::_2));
|
std::placeholders::_1, std::placeholders::_2));
|
||||||
_updater->events.refreshed.add(
|
_updater->events.refreshed.add(
|
||||||
std::bind(&streamfx::ui::updater::on_updater_refreshed, this, std::placeholders::_1));
|
std::bind(&streamfx::ui::updater::on_updater_refreshed, this, std::placeholders::_1));
|
||||||
if (_updater->automation()) {
|
|
||||||
if (_updater->gdpr()) {
|
|
||||||
_updater->refresh();
|
|
||||||
} else {
|
|
||||||
create_gdpr_box();
|
|
||||||
_gdpr->exec();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sync with updater information.
|
// Sync with updater information.
|
||||||
emit autoupdate_changed(_updater->automation());
|
emit autoupdate_changed(_updater->automation());
|
||||||
|
@ -213,6 +205,18 @@ void streamfx::ui::updater::on_updater_refreshed(streamfx::updater&)
|
||||||
emit update_detected();
|
emit update_detected();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void streamfx::ui::updater::obs_ready()
|
||||||
|
{
|
||||||
|
if (_updater->automation()) {
|
||||||
|
if (_updater->gdpr()) {
|
||||||
|
_updater->refresh();
|
||||||
|
} else {
|
||||||
|
create_gdpr_box();
|
||||||
|
_gdpr->exec();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void streamfx::ui::updater::on_channel_changed(streamfx::update_channel channel)
|
void streamfx::ui::updater::on_channel_changed(streamfx::update_channel channel)
|
||||||
{
|
{
|
||||||
bool is_stable = channel == streamfx::update_channel::RELEASE;
|
bool is_stable = channel == streamfx::update_channel::RELEASE;
|
||||||
|
|
|
@ -90,6 +90,8 @@ namespace streamfx::ui {
|
||||||
void on_updater_channel_changed(streamfx::updater&, streamfx::update_channel);
|
void on_updater_channel_changed(streamfx::updater&, streamfx::update_channel);
|
||||||
void on_updater_refreshed(streamfx::updater&);
|
void on_updater_refreshed(streamfx::updater&);
|
||||||
|
|
||||||
|
void obs_ready();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
; // Needed by some linters.
|
; // Needed by some linters.
|
||||||
|
|
||||||
|
|
|
@ -156,6 +156,9 @@ void streamfx::ui::handler::on_obs_loaded()
|
||||||
_about_dialog->show();
|
_about_dialog->show();
|
||||||
have_shown_about_streamfx(true);
|
have_shown_about_streamfx(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Let the Updater start its work.
|
||||||
|
this->_updater->obs_ready();
|
||||||
}
|
}
|
||||||
|
|
||||||
void streamfx::ui::handler::on_action_report_issue(bool)
|
void streamfx::ui::handler::on_action_report_issue(bool)
|
||||||
|
|
Loading…
Reference in a new issue