Update SaveDialogs for Tabbed Athletes

.. the save dialogs all assumed the current tab
   and current context were relevant when checking
   for unsaved files etc, but this was INCORRECT.

.. when window is closed each tab is checked IN TURN
   so the context should have been passed (because the
   current tab/context is just one of the many to save)
This commit is contained in:
Mark Liversedge
2013-12-27 11:41:10 +00:00
parent 611ffde353
commit 08e7d6d882
5 changed files with 26 additions and 24 deletions

View File

@@ -868,7 +868,7 @@ MainWindow::closeEvent(QCloseEvent* event)
foreach(Tab *tab, closing) {
// do we need to save?
if (tab->context->mainWindow->saveRideExitDialog() == true)
if (tab->context->mainWindow->saveRideExitDialog(tab->context) == true)
removeTab(tab);
else
needtosave = true;
@@ -1174,7 +1174,7 @@ void
MainWindow::saveRide()
{
if (currentTab->context->ride)
saveRideSingleDialog(currentTab->context->ride); // will signal save to everyone
saveRideSingleDialog(currentTab->context, currentTab->context->ride); // will signal save to everyone
else {
QMessageBox oops(QMessageBox::Critical, tr("No Activity To Save"),
tr("There is no currently selected ride to save."));
@@ -1341,7 +1341,7 @@ bool
MainWindow::closeTab()
{
// wipe it down ...
if (saveRideExitDialog() == false) return false;
if (saveRideExitDialog(currentTab->context) == false) return false;
// if its the last tab we close the window
if (tabList.count() == 1)