mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-01 06:30:26 +00:00
106f7a8e0e
Add a new "statistics" application state. In the statistics state show the statistics widget and the filter in the top quadrants. The idea is to allow filtering and doing statistics at the same time. Sadly, we can't use the filter-widget in different quadrants, because Qt's ownership model is completely broken / inflexible. It does not support a widget having different parents and thus a widget can only belong to one QStackedWidget. Hiding the map in the statistics view is quite hacky: Since the view of the quadrants is not determined by the "ApplicationState", we have to restore the original quadrant visibility when exiting the stats mode. Therefore, set the original visibility-state when changing application state. The MainWindow-quadrant code really needs to be rewritten! Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
22 lines
517 B
C
22 lines
517 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
#ifndef APPLICATIONSTATE_H
|
|
#define APPLICATIONSTATE_H
|
|
|
|
// By using an enum class, the enum entries don't polute the global namespace.
|
|
// Moreover, they are strongly typed. This means that they are not auto-converted
|
|
// to integer types if e.g. used as array-indices.
|
|
enum class ApplicationState {
|
|
Default,
|
|
EditDive,
|
|
PlanDive,
|
|
EditPlannedDive,
|
|
EditDiveSite,
|
|
FilterDive,
|
|
Statistics,
|
|
Count
|
|
};
|
|
|
|
ApplicationState getAppState();
|
|
void setAppState(ApplicationState state);
|
|
|
|
#endif
|