Create a new state for the MainWindow: EditDiveSite

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2015-02-11 13:19:35 -02:00 committed by Dirk Hohndel
parent 3516ff2ab2
commit e3d800885f
2 changed files with 8 additions and 1 deletions

View file

@ -67,12 +67,15 @@ MainWindow::MainWindow() : QMainWindow(),
PlannerSettingsWidget *plannerSettings = new PlannerSettingsWidget();
DivePlannerWidget *plannerWidget = new DivePlannerWidget();
PlannerDetails *plannerDetails = new PlannerDetails();
LocationInformationWidget *locationInformation = new LocationInformationWidget();
registerApplicationState("Default", mainTab, profileWidget, diveListView, globeGps );
registerApplicationState("AddDive", mainTab, profileWidget, diveListView, globeGps );
registerApplicationState("EditDive", mainTab, profileWidget, diveListView, globeGps );
registerApplicationState("PlanDive", plannerWidget, profileWidget, plannerSettings, plannerDetails );
registerApplicationState("EditPlannedDive", plannerWidget, profileWidget, diveListView, globeGps );
registerApplicationState("EditDiveSite",locationInformation, profileWidget, diveListView, globeGps );
setApplicationState("Default");
ui.multiFilter->hide();
@ -205,6 +208,10 @@ PlannerSettingsWidget *MainWindow::divePlannerSettingsWidget() {
return qobject_cast<PlannerSettingsWidget*>(applicationState["PlanDive"].bottomLeft);
}
LocationInformationWidget *MainWindow::locationInformationWidget() {
return qobject_cast<LocationInformationWidget*>(applicationState["EditDiveSite"].topLeft);
}
void MainWindow::setLoadedWithFiles(bool f)
{
filesAsArguments = f;

View file

@ -68,7 +68,7 @@ public:
GlobeGPS *globe();
DivePlannerWidget *divePlannerWidget();
PlannerSettingsWidget *divePlannerSettingsWidget();
LocationInformationWidget *locationInformationWidget();
void showError(QString message);
void setTitle(enum MainWindowTitleFormat format);