From 7e19b52926f0e9bccc1d2f794741b6fb823d4b82 Mon Sep 17 00:00:00 2001 From: RickyRister <42636155+RickyRister@users.noreply.github.com> Date: Wed, 15 Jan 2025 20:04:15 -0800 Subject: [PATCH] fix tab-specific menus not present when tab is opened on startup (#5478) --- cockatrice/src/client/tabs/tab_supervisor.cpp | 2 -- cockatrice/src/client/tabs/tab_supervisor.h | 3 +-- cockatrice/src/client/ui/window_main.cpp | 1 + 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cockatrice/src/client/tabs/tab_supervisor.cpp b/cockatrice/src/client/tabs/tab_supervisor.cpp index af789e134..594c1b732 100644 --- a/cockatrice/src/client/tabs/tab_supervisor.cpp +++ b/cockatrice/src/client/tabs/tab_supervisor.cpp @@ -167,8 +167,6 @@ TabSupervisor::TabSupervisor(AbstractClient *_client, QMenu *tabsMenu, QWidget * resetTabsMenu(); retranslateUi(); - - initStartupTabs(); } TabSupervisor::~TabSupervisor() diff --git a/cockatrice/src/client/tabs/tab_supervisor.h b/cockatrice/src/client/tabs/tab_supervisor.h index 7e9acbdb6..912f6df27 100644 --- a/cockatrice/src/client/tabs/tab_supervisor.h +++ b/cockatrice/src/client/tabs/tab_supervisor.h @@ -89,8 +89,6 @@ private: QAction *aTabDeckEditor, *aTabVisualDeckStorage, *aTabServer, *aTabAccount, *aTabDeckStorage, *aTabReplays, *aTabAdmin, *aTabLog; - void initStartupTabs(); - int myAddTab(Tab *tab, QAction *manager = nullptr); void addCloseButtonToTab(Tab *tab, int tabIndex, QAction *manager); QString sanitizeTabName(QString dirty) const; @@ -101,6 +99,7 @@ public: explicit TabSupervisor(AbstractClient *_client, QMenu *tabsMenu, QWidget *parent = nullptr); ~TabSupervisor() override; void retranslateUi(); + void initStartupTabs(); void start(const ServerInfo_User &userInfo); void startLocal(const QList &_clients); void stop(); diff --git a/cockatrice/src/client/ui/window_main.cpp b/cockatrice/src/client/ui/window_main.cpp index a01c5bba6..ef4aaf3c9 100644 --- a/cockatrice/src/client/ui/window_main.cpp +++ b/cockatrice/src/client/ui/window_main.cpp @@ -860,6 +860,7 @@ MainWindow::MainWindow(QWidget *parent) connect(tabSupervisor, &TabSupervisor::setMenu, this, &MainWindow::updateTabMenu); connect(tabSupervisor, &TabSupervisor::localGameEnded, this, &MainWindow::localGameEnded); connect(tabSupervisor, &TabSupervisor::showWindowIfHidden, this, &MainWindow::showWindowIfHidden); + tabSupervisor->initStartupTabs(); setCentralWidget(tabSupervisor);