mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-24 07:33:54 -07:00
fix tab-specific menus not present when tab is opened on startup (#5478)
This commit is contained in:
parent
2d02955f8b
commit
7e19b52926
3 changed files with 2 additions and 4 deletions
|
|
@ -167,8 +167,6 @@ TabSupervisor::TabSupervisor(AbstractClient *_client, QMenu *tabsMenu, QWidget *
|
||||||
resetTabsMenu();
|
resetTabsMenu();
|
||||||
|
|
||||||
retranslateUi();
|
retranslateUi();
|
||||||
|
|
||||||
initStartupTabs();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TabSupervisor::~TabSupervisor()
|
TabSupervisor::~TabSupervisor()
|
||||||
|
|
|
||||||
|
|
@ -89,8 +89,6 @@ private:
|
||||||
QAction *aTabDeckEditor, *aTabVisualDeckStorage, *aTabServer, *aTabAccount, *aTabDeckStorage, *aTabReplays,
|
QAction *aTabDeckEditor, *aTabVisualDeckStorage, *aTabServer, *aTabAccount, *aTabDeckStorage, *aTabReplays,
|
||||||
*aTabAdmin, *aTabLog;
|
*aTabAdmin, *aTabLog;
|
||||||
|
|
||||||
void initStartupTabs();
|
|
||||||
|
|
||||||
int myAddTab(Tab *tab, QAction *manager = nullptr);
|
int myAddTab(Tab *tab, QAction *manager = nullptr);
|
||||||
void addCloseButtonToTab(Tab *tab, int tabIndex, QAction *manager);
|
void addCloseButtonToTab(Tab *tab, int tabIndex, QAction *manager);
|
||||||
QString sanitizeTabName(QString dirty) const;
|
QString sanitizeTabName(QString dirty) const;
|
||||||
|
|
@ -101,6 +99,7 @@ public:
|
||||||
explicit TabSupervisor(AbstractClient *_client, QMenu *tabsMenu, QWidget *parent = nullptr);
|
explicit TabSupervisor(AbstractClient *_client, QMenu *tabsMenu, QWidget *parent = nullptr);
|
||||||
~TabSupervisor() override;
|
~TabSupervisor() override;
|
||||||
void retranslateUi();
|
void retranslateUi();
|
||||||
|
void initStartupTabs();
|
||||||
void start(const ServerInfo_User &userInfo);
|
void start(const ServerInfo_User &userInfo);
|
||||||
void startLocal(const QList<AbstractClient *> &_clients);
|
void startLocal(const QList<AbstractClient *> &_clients);
|
||||||
void stop();
|
void stop();
|
||||||
|
|
|
||||||
|
|
@ -860,6 +860,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||||
connect(tabSupervisor, &TabSupervisor::setMenu, this, &MainWindow::updateTabMenu);
|
connect(tabSupervisor, &TabSupervisor::setMenu, this, &MainWindow::updateTabMenu);
|
||||||
connect(tabSupervisor, &TabSupervisor::localGameEnded, this, &MainWindow::localGameEnded);
|
connect(tabSupervisor, &TabSupervisor::localGameEnded, this, &MainWindow::localGameEnded);
|
||||||
connect(tabSupervisor, &TabSupervisor::showWindowIfHidden, this, &MainWindow::showWindowIfHidden);
|
connect(tabSupervisor, &TabSupervisor::showWindowIfHidden, this, &MainWindow::showWindowIfHidden);
|
||||||
|
tabSupervisor->initStartupTabs();
|
||||||
|
|
||||||
setCentralWidget(tabSupervisor);
|
setCentralWidget(tabSupervisor);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue