desktop: move planner-code to diveplanner.cpp

Around 2015 there was a push to move planner UI code from
mainwindow.cpp to diveplanner.cpp. That never was completed,
presumably because the planner is actually three widgets.

Collect these widgets in one PlannerWidgets class and move
the code there.

This is not a full dis-entanglement, as the plannerwidgets
have to access the profile via the mainwindow. But at least
it collects the planner UI code at a single place.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-11-25 07:31:19 +01:00 committed by Dirk Hohndel
parent 16f86f2f65
commit bb76cb56d4
4 changed files with 143 additions and 117 deletions

View file

@ -35,10 +35,8 @@ class QWebView;
class QSettings;
class UpdateManager;
class UserManual;
class DivePlannerWidget;
class PlannerWidgets;
class ProfileWidget2;
class PlannerDetails;
class PlannerSettingsWidget;
class LocationInformationWidget;
typedef std::pair<QByteArray, QVariant> WidgetProperty;
@ -73,7 +71,6 @@ public:
void loadFiles(const QStringList files);
void importFiles(const QStringList importFiles);
void setToolButtonsEnabled(bool enabled);
void printPlan();
void setApplicationState(ApplicationState state);
bool inPlanner();
NotificationWidget *getNotificationWidget();
@ -82,10 +79,8 @@ public:
void editDiveSite(dive_site *ds);
std::unique_ptr<MainTab> mainTab;
PlannerDetails *plannerDetails;
PlannerSettingsWidget *divePlannerSettingsWidget;
std::unique_ptr<PlannerWidgets> plannerWidgets;
ProfileWidget2 *graphics;
DivePlannerWidget *divePlannerWidget;
DiveListView *diveList;
private
slots:
@ -164,7 +159,6 @@ slots:
void planCanceled();
void planCreated();
void setEnabledToolbar(bool arg1);
void setPlanNotes(QString plan);
// Some shortcuts like "change DC" or "copy/paste dive components"
// should only be enabled when the profile's visible.
void disableShortcuts(bool disablePaste = true);