Make impossible to change dives while editing one.

This is to prevent loss of data, so if the user is editing something,
either cancel the edition or save it, to continue moving around on
the Dive List.  - Only the dive list is affected, user can still
play with the globe and the profile.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2013-05-19 00:09:36 -03:00 committed by Dirk Hohndel
parent 80274b5788
commit 046eacabe5
3 changed files with 51 additions and 6 deletions

View file

@ -26,6 +26,13 @@
#include "modeldelegates.h"
#include "models.h"
static MainWindow* instance = 0;
MainWindow* mainWindow()
{
return instance;
}
MainWindow::MainWindow() : ui(new Ui::MainWindow())
{
ui->setupUi(this);
@ -39,6 +46,7 @@ MainWindow::MainWindow() : ui(new Ui::MainWindow())
ui->ListWidget->reload();
ui->ListWidget->setFocus();
ui->globe->reload();
instance = this;
}
void MainWindow::current_dive_changed(int divenr)
@ -465,3 +473,23 @@ void MainWindow::closeEvent(QCloseEvent *event)
event->accept();
writeSettings();
}
DiveListView* MainWindow::dive_list()
{
return ui->ListWidget;
}
GlobeGPS* MainWindow::globe()
{
return ui->globe;
}
ProfileGraphicsView* MainWindow::graphics()
{
return ui->ProfileWidget;
}
MainTab* MainWindow::information()
{
return ui->InfoWidget;
}