Qt: don't show updater if booted with cli arg

This commit is contained in:
Megamouse 2021-03-25 22:55:06 +01:00
parent 9d895e6b15
commit 9f80a55652
5 changed files with 12 additions and 4 deletions

View File

@ -720,6 +720,7 @@ int main(int argc, char** argv)
gui_app->SetShowGui(!s_no_gui);
gui_app->SetUseCliStyle(use_cli_style);
gui_app->SetWithCliBoot(parser.isSet(arg_installfw) || parser.isSet(arg_installpkg) || !parser.positionalArguments().isEmpty());
if (!gui_app->Init())
{

View File

@ -96,7 +96,7 @@ bool gui_application::Init()
welcome->exec();
}
if (m_main_window && !m_main_window->Init())
if (m_main_window && !m_main_window->Init(m_with_cli_boot))
{
return false;
}

View File

@ -38,6 +38,11 @@ public:
m_use_cli_style = use_cli_style;
}
void SetWithCliBoot(bool with_cli_boot = false)
{
m_with_cli_boot = with_cli_boot;
}
/** Call this method before calling app.exec */
bool Init() override;
@ -75,6 +80,7 @@ private:
bool m_show_gui = true;
bool m_use_cli_style = false;
bool m_with_cli_boot = false;
private Q_SLOTS:
void OnChangeStyleSheetRequest();

View File

@ -87,7 +87,7 @@ main_window::~main_window()
/* An init method is used so that RPCS3App can create the necessary connects before calling init (specifically the stylesheet connect).
* Simplifies logic a bit.
*/
bool main_window::Init()
bool main_window::Init(bool with_cli_boot)
{
setAcceptDrops(true);
@ -229,7 +229,8 @@ bool main_window::Init()
#if defined(_WIN32) || defined(__linux__)
if (const auto update_value = m_gui_settings->GetValue(gui::m_check_upd_start).toString(); update_value != "false")
{
m_updater.check_for_updates(true, update_value != "true", this);
const bool in_background = with_cli_boot || update_value != "true";
m_updater.check_for_updates(true, in_background, this);
}
#endif

View File

@ -82,7 +82,7 @@ class main_window : public QMainWindow
public:
explicit main_window(std::shared_ptr<gui_settings> gui_settings, std::shared_ptr<emu_settings> emu_settings, std::shared_ptr<persistent_settings> persistent_settings, QWidget *parent = 0);
~main_window();
bool Init();
bool Init(bool with_cli_boot);
QIcon GetAppIcon();
bool OnMissingFw();
void InstallPackages(QStringList file_paths = QStringList());