mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-25 16:13:54 -07:00
Make all tabs closable; add tabs menu (#5451)
* make closeRequest call close by default * make all tabs closable by default * closeRequest instead of deleteLater on stop * null out pointer on destroy * no need to manually null out the tabs anymore * comment * pass tabsMenu into ctor * comment * implement tabs menu * fix segfault on close (again) * remove deck editor action from WindowMain
This commit is contained in:
parent
e4611a8616
commit
9bd024d39f
6 changed files with 259 additions and 85 deletions
|
|
@ -13,6 +13,12 @@ class Tab : public QMainWindow
|
|||
signals:
|
||||
void userEvent(bool globalEvent = true);
|
||||
void tabTextChanged(Tab *tab, const QString &newTabText);
|
||||
/**
|
||||
* Emitted when the tab is closed (because Qt doesn't provide a built-in close signal)
|
||||
* This signal is emitted from this class's overridden Tab::closeEvent method.
|
||||
* Make sure any subclasses that override closeEvent still emit this signal from there.
|
||||
*/
|
||||
void closed();
|
||||
|
||||
protected:
|
||||
TabSupervisor *tabSupervisor;
|
||||
|
|
@ -23,6 +29,7 @@ protected:
|
|||
protected slots:
|
||||
void showCardInfoPopup(const QPoint &pos, const QString &cardName, const QString &providerId);
|
||||
void deleteCardInfoPopup(const QString &cardName);
|
||||
void closeEvent(QCloseEvent *event) override;
|
||||
|
||||
private:
|
||||
QString currentCardName, currentProviderId;
|
||||
|
|
@ -56,9 +63,7 @@ public:
|
|||
*
|
||||
* @param forced whether this close request was initiated by the user or forced by the server.
|
||||
*/
|
||||
virtual void closeRequest(bool /*forced*/ = false)
|
||||
{
|
||||
}
|
||||
virtual void closeRequest(bool forced = false);
|
||||
virtual void tabActivated()
|
||||
{
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue