mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Correctly update the dive when the user edits dive_site
We didn't correctly update the dive site as soon as the dive_site edit finished, and this time we are actually correctly updating things using signals instead of calling the mainwindow for everything. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
7834341562
commit
9130ff8a97
3 changed files with 11 additions and 0 deletions
|
@ -451,6 +451,13 @@ void MainTab::showLocation()
|
|||
ui.location->clear();
|
||||
}
|
||||
|
||||
// Seems wrong, since we can also call updateDiveInfo(), but since the updateDiveInfo
|
||||
// has a parameter on it's definition it didn't worked on the signal slot connection.
|
||||
void MainTab::refreshDiveInfo()
|
||||
{
|
||||
updateDiveInfo();
|
||||
}
|
||||
|
||||
void MainTab::updateDiveInfo(bool clear)
|
||||
{
|
||||
// I don't like this code here - but globe() wasn't initialized on the constructor.
|
||||
|
|
|
@ -63,6 +63,7 @@ public
|
|||
slots:
|
||||
void addCylinder_clicked();
|
||||
void addWeight_clicked();
|
||||
void refreshDiveInfo();
|
||||
void updateDiveInfo(bool clear = false);
|
||||
void acceptChanges();
|
||||
void rejectChanges();
|
||||
|
|
|
@ -114,6 +114,9 @@ MainWindow::MainWindow() : QMainWindow(),
|
|||
connect(diveSiteEdit, &LocationInformationWidget::endEditDiveSite,
|
||||
this, &MainWindow::setDefaultState);
|
||||
|
||||
connect(diveSiteEdit, &LocationInformationWidget::endEditDiveSite,
|
||||
mainTab, &MainTab::refreshDiveInfo);
|
||||
|
||||
QWidget *diveSitePictures = new QWidget(); // Placeholder
|
||||
|
||||
registerApplicationState("Default", mainTab, profileContainer, diveListView, globeGps );
|
||||
|
|
Loading…
Reference in a new issue