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->SetShowGui(!s_no_gui);
gui_app->SetUseCliStyle(use_cli_style); gui_app->SetUseCliStyle(use_cli_style);
gui_app->SetWithCliBoot(parser.isSet(arg_installfw) || parser.isSet(arg_installpkg) || !parser.positionalArguments().isEmpty());
if (!gui_app->Init()) if (!gui_app->Init())
{ {

View file

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

View file

@ -38,6 +38,11 @@ public:
m_use_cli_style = use_cli_style; 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 */ /** Call this method before calling app.exec */
bool Init() override; bool Init() override;
@ -75,6 +80,7 @@ private:
bool m_show_gui = true; bool m_show_gui = true;
bool m_use_cli_style = false; bool m_use_cli_style = false;
bool m_with_cli_boot = false;
private Q_SLOTS: private Q_SLOTS:
void OnChangeStyleSheetRequest(); 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). /* An init method is used so that RPCS3App can create the necessary connects before calling init (specifically the stylesheet connect).
* Simplifies logic a bit. * Simplifies logic a bit.
*/ */
bool main_window::Init() bool main_window::Init(bool with_cli_boot)
{ {
setAcceptDrops(true); setAcceptDrops(true);
@ -229,7 +229,8 @@ bool main_window::Init()
#if defined(_WIN32) || defined(__linux__) #if defined(_WIN32) || defined(__linux__)
if (const auto update_value = m_gui_settings->GetValue(gui::m_check_upd_start).toString(); update_value != "false") 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 #endif

View file

@ -82,7 +82,7 @@ class main_window : public QMainWindow
public: 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); 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(); ~main_window();
bool Init(); bool Init(bool with_cli_boot);
QIcon GetAppIcon(); QIcon GetAppIcon();
bool OnMissingFw(); bool OnMissingFw();
void InstallPackages(QStringList file_paths = QStringList()); void InstallPackages(QStringList file_paths = QStringList());