mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix build without marble
If we have an null widget, we hide the stack. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
d53723fade
commit
bb9398d08f
1 changed files with 22 additions and 8 deletions
|
@ -57,7 +57,12 @@ MainWindow::MainWindow() : QMainWindow(),
|
||||||
MainTab *mainTab = new MainTab();
|
MainTab *mainTab = new MainTab();
|
||||||
DiveListView *diveListView = new DiveListView();
|
DiveListView *diveListView = new DiveListView();
|
||||||
ProfileWidget2 *profileWidget = new ProfileWidget2();
|
ProfileWidget2 *profileWidget = new ProfileWidget2();
|
||||||
|
|
||||||
|
#ifndef NO_MARBLE
|
||||||
GlobeGPS *globeGps = new GlobeGPS();
|
GlobeGPS *globeGps = new GlobeGPS();
|
||||||
|
#else
|
||||||
|
QWidget *globeGps = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
PlannerSettingsWidget *plannerSettings = new PlannerSettingsWidget();
|
PlannerSettingsWidget *plannerSettings = new PlannerSettingsWidget();
|
||||||
DivePlannerWidget *plannerWidget = new DivePlannerWidget();
|
DivePlannerWidget *plannerWidget = new DivePlannerWidget();
|
||||||
|
@ -1516,16 +1521,16 @@ void MainWindow::checkForUndoAndRedo()
|
||||||
void MainWindow::registerApplicationState(const QByteArray& state, QWidget *topLeft, QWidget *topRight, QWidget *bottomLeft, QWidget *bottomRight)
|
void MainWindow::registerApplicationState(const QByteArray& state, QWidget *topLeft, QWidget *topRight, QWidget *bottomLeft, QWidget *bottomRight)
|
||||||
{
|
{
|
||||||
applicationState[state] = WidgetForQuadrant(topLeft, topRight, bottomLeft, bottomRight);
|
applicationState[state] = WidgetForQuadrant(topLeft, topRight, bottomLeft, bottomRight);
|
||||||
if (ui.topLeft->indexOf(topLeft) == -1) {
|
if (ui.topLeft->indexOf(topLeft) == -1 && topLeft) {
|
||||||
ui.topLeft->addWidget(topLeft);
|
ui.topLeft->addWidget(topLeft);
|
||||||
}
|
}
|
||||||
if (ui.topRight->indexOf(topRight) == -1) {
|
if (ui.topRight->indexOf(topRight) == -1 && topRight) {
|
||||||
ui.topRight->addWidget(topRight);
|
ui.topRight->addWidget(topRight);
|
||||||
}
|
}
|
||||||
if (ui.bottomLeft->indexOf(bottomLeft) == -1) {
|
if (ui.bottomLeft->indexOf(bottomLeft) == -1 && bottomLeft) {
|
||||||
ui.bottomLeft->addWidget(bottomLeft);
|
ui.bottomLeft->addWidget(bottomLeft);
|
||||||
}
|
}
|
||||||
if(ui.bottomRight->indexOf(bottomRight) == -1) {
|
if(ui.bottomRight->indexOf(bottomRight) == -1 && bottomRight) {
|
||||||
ui.bottomRight->addWidget(bottomRight);
|
ui.bottomRight->addWidget(bottomRight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1538,8 +1543,17 @@ void MainWindow::setApplicationState(const QByteArray& state) {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
currentApplicationState = state;
|
currentApplicationState = state;
|
||||||
ui.topLeft->setCurrentWidget( applicationState[state].topLeft);
|
#define SET_CURRENT_INDEX( X ) \
|
||||||
ui.bottomLeft->setCurrentWidget( applicationState[state].bottomLeft);
|
if (applicationState[state].X) { \
|
||||||
ui.topRight->setCurrentWidget( applicationState[state].topRight);
|
ui.X->setCurrentWidget( applicationState[state].X); \
|
||||||
ui.bottomRight->setCurrentWidget( applicationState[state].bottomRight);
|
ui.X->show(); \
|
||||||
|
} else { \
|
||||||
|
ui.X->hide(); \
|
||||||
|
}
|
||||||
|
|
||||||
|
SET_CURRENT_INDEX( topLeft )
|
||||||
|
SET_CURRENT_INDEX( topRight )
|
||||||
|
SET_CURRENT_INDEX( bottomLeft )
|
||||||
|
SET_CURRENT_INDEX( bottomRight )
|
||||||
|
#undef SET_CURRENT_INDEX
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue