yeah, close it, but close it right :)

This commit is contained in:
Hiro Protagonist 2017-03-30 15:37:22 +13:00
parent 93a1e97030
commit edb1f996fb
2 changed files with 12 additions and 10 deletions

View file

@ -7,6 +7,7 @@
#include <QTime>
#include <QErrorMessage>
#include <QFileDialog>
#include <QCloseEvent>
// TODO: Handle Errors!!
// TODO: Handle Disconnect!!
@ -83,17 +84,18 @@ MainWindow::MainWindow( QWidget * parent ) :
MainWindow::~MainWindow() {
delete ui;
delete image_buffer;
if ( status == RECORDING ) {
showError( "Stopping Capture..." );
startStopRecording();
}
recThread->quit();
recThread->wait();
delete recThread;
}
void MainWindow::closeEvent ( QCloseEvent * event ) {
if ( status == RECORDING ) {
setStatus( STOPPING );
startStopRecording();
recThread->quit();
recThread->wait();
}
}
void MainWindow::setStatus( STATUS status ) {
this->status = status;

View file

@ -105,8 +105,8 @@ RecorderError Recorder::verifyRecDir() {
QMessageBox msgBox;
msgBox.setText( tr( "A recording with this name already exists. Which action should be taken?" ) );
void * appendButton = msgBox.addButton( tr( "Append the recording." ), QMessageBox::ActionRole );
void * removeButton = msgBox.addButton( tr( "Overwrite recording." ), QMessageBox::ActionRole );
void * appendButton = msgBox.addButton( tr( "Append the recording" ), QMessageBox::ApplyRole );
void * removeButton = msgBox.addButton( tr( "Overwrite recording" ), QMessageBox::ActionRole );
void * abortButton = msgBox.addButton( QMessageBox::Abort );
msgBox.exec();