Continue to separate logic code from UI code

We don't want to call into the MainWindow from C code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-08-22 07:05:13 -07:00
parent e86fd45efd
commit ccd2cb2502
4 changed files with 17 additions and 9 deletions

View file

@ -1274,7 +1274,19 @@ extern "C" void parse_display_units(char *line)
qDebug() << line;
}
static QByteArray currentApplicationState;
QByteArray getCurrentAppState()
{
return currentApplicationState;
}
void setCurrentAppState(QByteArray state)
{
currentApplicationState = state;
}
extern "C" bool in_planner()
{
return MainWindow::instance()->inPlanner();
return (currentApplicationState == "PlanDive" || currentApplicationState == "EditPlannedDive");
}