quit action checks contentchange

master
Denes Matetelki 14 years ago
parent 3f9c182c2d
commit edad97d19a

@ -25,9 +25,8 @@ MainWindow::MainWindow(QWidget *parent) :
this, SLOT(closeFile())); this, SLOT(closeFile()));
connect(m_ui->actionExport, SIGNAL(activated()), connect(m_ui->actionExport, SIGNAL(activated()),
this, SLOT(exportScene())); this, SLOT(exportScene()));
connect(m_ui->actionQuit, SIGNAL(activated()), connect(m_ui->actionQuit, SIGNAL(activated()),
QApplication::instance(), SLOT(quit())); this, SLOT(quit()));
connect(m_ui->actionAbout_QtMindMap, SIGNAL(activated()), connect(m_ui->actionAbout_QtMindMap, SIGNAL(activated()),
this, SLOT(about())); this, SLOT(about()));
@ -209,6 +208,14 @@ void MainWindow::exportScene()
} }
} }
void MainWindow::quit()
{
if (m_contentChanged && !closeFile())
return;
QApplication::instance()->quit();
}
void MainWindow::keys() void MainWindow::keys()
{ {
QMessageBox msgBox(this); QMessageBox msgBox(this);

@ -30,6 +30,7 @@ public slots:
bool saveFileAs(); bool saveFileAs();
bool closeFile(); bool closeFile();
void exportScene(); void exportScene();
void quit();
void keys(); void keys();
void about(); void about();

Loading…
Cancel
Save