add "open in new tab" button to decklist confirmation dialogue (#5183)

* refactor to use confirmOpen

* implement extra button in confirmation

* use brackets in one-liner if statements

* refactor save confirmation window into function
This commit is contained in:
RickyRister 2024-11-21 14:24:50 -08:00 committed by GitHub
parent f73196841a
commit 1bc92623dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 93 additions and 12 deletions

View file

@ -22,6 +22,7 @@ class Response;
class FilterTreeModel;
class FilterBuilder;
class QGroupBox;
class QMessageBox;
class QHBoxLayout;
class QVBoxLayout;
class QPushButton;
@ -100,6 +101,19 @@ private slots:
void showSearchSyntaxHelp();
private:
/**
* @brief Which tab to open the new deck in
*/
enum DeckOpenLocation
{
CANCELLED,
SAME_TAB,
NEW_TAB
};
DeckOpenLocation confirmOpen(const bool openInSameTabIfBlank = true);
QMessageBox *createSaveConfirmationWindow();
bool isBlankNewDeck() const;
CardInfoPtr currentCardInfo() const;
void addCardHelper(QString zoneName);