mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
e86fd45efd
commit
ccd2cb2502
4 changed files with 17 additions and 9 deletions
14
qthelper.cpp
14
qthelper.cpp
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue