mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Coordinate some mark_divelist_changed() calls
1) Make a call mark_divelist_changed(TRUE) when the user adds new cylinder or weight entries. 2) Call mark_divelist_changed(FALSE) in MainWindow::on_actionClose_triggered() so that each time after a file is closed or a new one is created it does not ask immediately the user for a save confirmation for the blank file/divelist. 3) Call mark_divelist_changed(TRUE) once a dive's geo location has changed in GlobeGPS::changeDiveGeoPosition(). Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
8678e2d57c
commit
bdd89f0e7a
3 changed files with 5 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "ui_mainwindow.h"
|
#include "ui_mainwindow.h"
|
||||||
#include "../dive.h"
|
#include "../dive.h"
|
||||||
|
#include "../divelist.h"
|
||||||
#include "../helpers.h"
|
#include "../helpers.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
@ -203,6 +204,7 @@ void GlobeGPS::changeDiveGeoPosition(qreal lon, qreal lat, GeoDataCoordinates::U
|
||||||
reload();
|
reload();
|
||||||
editingDiveCoords = 0;
|
editingDiveCoords = 0;
|
||||||
messageWidget->animatedHide();
|
messageWidget->animatedHide();
|
||||||
|
mark_divelist_changed(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GlobeGPS::mousePressEvent(QMouseEvent* event)
|
void GlobeGPS::mousePressEvent(QMouseEvent* event)
|
||||||
|
|
|
@ -324,11 +324,13 @@ void MainTab::updateDiveInfo(int dive)
|
||||||
void MainTab::addCylinder_clicked()
|
void MainTab::addCylinder_clicked()
|
||||||
{
|
{
|
||||||
cylindersModel->add();
|
cylindersModel->add();
|
||||||
|
mark_divelist_changed(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainTab::addWeight_clicked()
|
void MainTab::addWeight_clicked()
|
||||||
{
|
{
|
||||||
weightModel->add();
|
weightModel->add();
|
||||||
|
mark_divelist_changed(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainTab::reload()
|
void MainTab::reload()
|
||||||
|
|
|
@ -166,6 +166,7 @@ void MainWindow::on_actionClose_triggered()
|
||||||
ui->ListWidget->reload(DiveTripModel::TREE);
|
ui->ListWidget->reload(DiveTripModel::TREE);
|
||||||
ui->globe->reload();
|
ui->globe->reload();
|
||||||
setTitle(MWTF_DEFAULT);
|
setTitle(MWTF_DEFAULT);
|
||||||
|
mark_divelist_changed(FALSE);
|
||||||
|
|
||||||
clear_events();
|
clear_events();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue