qt: fix button state when cancelling save

If the user decides not to capture after all, by hitting cancel when prompted
for their unsaved changes, we have to manually uncheck the button again because
Qt helpfully checks it for us.

Bug: 11145
Change-Id: I362d72787ddb138d382a899d091698c6652eebb2
Reviewed-on: https://code.wireshark.org/review/9102
Reviewed-by: Evan Huus <eapache@gmail.com>
This commit is contained in:
Evan Huus 2015-06-24 14:18:04 -07:00
parent 1f0226cce9
commit cc614a93d8
1 changed files with 6 additions and 1 deletions

View File

@ -3019,8 +3019,13 @@ void MainWindow::on_actionCaptureStart_triggered()
}
/* XXX - will closing this remove a temporary file? */
if (testCaptureFileClose(FALSE, *new QString(" before starting a new capture")))
if (testCaptureFileClose(FALSE, *new QString(" before starting a new capture"))) {
startCapture();
} else {
// simply clicking the button sets it to 'checked' even though we've
// decided to do nothing, so undo that
main_ui_->actionCaptureStart->setChecked(false);
}
#endif // HAVE_LIBPCAP
}