Navigator2Go  2.0
Manage your local Ocean Navigator installation.
mainwindow.h
1 #ifndef MAINWINDOW_H
2 #define MAINWINDOW_H
3 
4 #include "datadownloaddesc.h"
5 #include "preferences.h"
6 #include "servermanager.h"
7 
8 #include <QMainWindow>
9 #include <QJsonObject>
10 #include <QTimer>
11 #include <QSettings>
12 #include <QPointer>
13 #include <QProcess>
14 
15 /***********************************************************************************/
16 // Forward declarations
17 namespace Ui {
18 class MainWindow;
19 }
20 
21 class WidgetConfigEditor;
22 class WidgetDataOrder;
24 class WidgetLocalData;
25 class QNetworkReply;
26 
27 /***********************************************************************************/
28 class MainWindow : public QMainWindow {
29  Q_OBJECT
30 
31 public:
32  explicit MainWindow(QWidget* parent = nullptr);
33  ~MainWindow() override;
34 
36  void showProgressBar(const char* labelText);
38  void updateProgressBar(const int value);
40  void hideProgressBar();
41 
42 private slots:
44  void refreshRequestHandler();
46  void showStatusBarMessageHandler(const char* message);
47 
48  // Callbacks
49 
51  void on_actionAbout_Qt_triggered();
53  void on_actionClose_triggered();
55  void on_actionPreferences_triggered();
57  void on_actionAbout_triggered();
59  void on_actionCheck_for_Updates_triggered();
61  void on_actionNavigator2Go_Manual_triggered();
63  void on_pushButtonLaunchViewer_clicked();
65  void on_pushButtonOpenDataOrder_clicked();
67  void on_pushButtonImportNCFiles_clicked();
69  void on_pushButtonViewLocalData_clicked();
71  void on_actionClear_Python_cache_triggered();
73  void on_pushButtonRefresh_clicked();
75  void on_tabWidget_currentChanged(int index);
76 
77  void on_actionReport_Issue_triggered();
78 
79 private:
81  void showStatusBarMessage(const char* text) const;
83  void checkRemoteConnection();
85  void updateTHREDDSConfigTable();
87  void initWidgets();
89  void setInitialLayout();
91  void checkForUpdates();
93  void checkForAppUpdate();
95  void checkForONUpdates();
97  void showFirstRunConfiguration();
98 
99  Ui::MainWindow* m_ui{nullptr};
100 
101  ServerManager m_serverManager{this};
102 
103  // Tab widgets
104  QPointer<WidgetLocalData> m_widgetLocalData;
105  QPointer<WidgetConfigEditor> m_widgetConfigEditor;
106  QPointer<WidgetDataOrder> m_widgetDataOrder;
107  QPointer<WidgetThreddsConfig> m_widgetThreddsConfig;
108 
109  QPointer<QNetworkReply> m_updateReply;
110 
111  Preferences m_prefs{this};
112 
113  QTimer m_uplinkTimer{this};
114  bool m_hasRemoteUplink{true};
115 };
116 
117 #endif // MAINWINDOW_H
Contains the loaded and modified settings.
Definition: preferences.h:17
QPointer< WidgetThreddsConfig > m_widgetThreddsConfig
THREDDS config tab (advanced mode)
Definition: mainwindow.h:107
Definition: dialogdatasetview.h:16
QPointer< WidgetLocalData > m_widgetLocalData
Local data tab.
Definition: mainwindow.h:104
Data order widget in the Data Order tab.
Definition: widgetdataorder.h:22
Manages the Apache and gUnicorn servers for the Ocean Navigator.
Definition: servermanager.h:10
Dataset config editor widget in the Config Editor tab.
Definition: widgetconfigeditor.h:21
Local data widget in the Local Data tab.
Definition: widgetlocaldata.h:15
QPointer< QNetworkReply > m_updateReply
Pointer to update response.
Definition: mainwindow.h:109
Thredds config widget in the THREDDS Config Editor tab.
Definition: widgetthreddsconfig.h:18
Definition: mainwindow.h:28
QPointer< WidgetConfigEditor > m_widgetConfigEditor
Dataset config tab (advanced mode)
Definition: mainwindow.h:105
QPointer< WidgetDataOrder > m_widgetDataOrder
Data order tab.
Definition: mainwindow.h:106