mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 16:44:48 -07:00
Tips close with the main window (#3305)
* tips close with main window * null verification added
This commit is contained in:
parent
2354a6f89d
commit
87eb132af1
3 changed files with 19 additions and 9 deletions
|
|
@ -317,9 +317,13 @@ void MainWindow::actAbout()
|
|||
|
||||
void MainWindow::actTips()
|
||||
{
|
||||
DlgTipOfTheDay tip;
|
||||
if (tip.successfulInit) {
|
||||
tip.exec();
|
||||
if (tip != NULL) {
|
||||
delete tip;
|
||||
tip = NULL;
|
||||
}
|
||||
tip = new DlgTipOfTheDay();
|
||||
if (tip->successfulInit) {
|
||||
tip->show();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -819,10 +823,19 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
qDebug() << "Spoilers Disabled";
|
||||
QtConcurrent::run(db, &CardDatabase::loadCardDatabases);
|
||||
}
|
||||
|
||||
tip = new DlgTipOfTheDay();
|
||||
if (tip->successfulInit && settingsCache->getShowTipsOnStartup() && tip->newTipsAvailable) {
|
||||
tip->show();
|
||||
}
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
if (tip != NULL) {
|
||||
delete tip;
|
||||
tip = NULL;
|
||||
}
|
||||
if (trayIcon) {
|
||||
trayIcon->hide();
|
||||
trayIcon->deleteLater();
|
||||
|
|
@ -885,6 +898,7 @@ void MainWindow::closeEvent(QCloseEvent *event)
|
|||
bClosingDown = false;
|
||||
return;
|
||||
}
|
||||
tip->close();
|
||||
|
||||
event->accept();
|
||||
settingsCache->setMainWindowGeometry(saveGeometry());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue