2013-04-14 03:44:02 +00:00
|
|
|
/*
|
|
|
|
* mainwindow.h
|
|
|
|
*
|
|
|
|
* header file for the main window of Subsurface
|
|
|
|
*
|
|
|
|
*/
|
2013-04-07 22:20:43 +00:00
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
2013-05-12 13:54:34 +00:00
|
|
|
#include <QAction>
|
2013-04-07 22:20:43 +00:00
|
|
|
|
2013-10-03 18:54:24 +00:00
|
|
|
#include "ui_mainwindow.h"
|
|
|
|
|
2013-05-19 03:09:36 +00:00
|
|
|
struct DiveList;
|
2013-04-25 23:44:06 +00:00
|
|
|
class QSortFilterProxyModel;
|
2013-04-12 07:24:07 +00:00
|
|
|
class DiveTripModel;
|
2013-04-09 08:35:44 +00:00
|
|
|
|
2013-04-07 22:20:43 +00:00
|
|
|
class DiveInfo;
|
|
|
|
class DiveNotes;
|
|
|
|
class Stats;
|
|
|
|
class Equipment;
|
2013-05-04 00:49:40 +00:00
|
|
|
class QItemSelection;
|
2013-05-19 03:09:36 +00:00
|
|
|
class DiveListView;
|
|
|
|
class GlobeGPS;
|
|
|
|
class MainTab;
|
|
|
|
class ProfileGraphicsView;
|
2013-08-22 19:20:47 +00:00
|
|
|
class QWebView;
|
2013-04-07 22:20:43 +00:00
|
|
|
|
2013-06-26 12:13:06 +00:00
|
|
|
enum MainWindowTitleFormat { MWTF_DEFAULT, MWTF_FILENAME };
|
|
|
|
|
2013-04-09 08:35:44 +00:00
|
|
|
class MainWindow : public QMainWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2013-04-07 22:20:43 +00:00
|
|
|
public:
|
2013-06-12 18:54:55 +00:00
|
|
|
enum {COLLAPSED, EXPANDED};
|
2013-09-26 14:14:40 +00:00
|
|
|
enum StackWidgetIndexes{ PROFILE, PLANNERPROFILE};
|
|
|
|
enum InfoWidgetIndexes{ MAINTAB, PLANNERWIDGET};
|
2013-11-07 16:37:27 +00:00
|
|
|
enum CurrentState{ VIEWALL, GLOBE_MAXIMIZED, INFO_MAXIMIZED, PROFILE_MAXIMIZED, LIST_MAXIMIZED};
|
2013-06-12 18:54:55 +00:00
|
|
|
|
2013-04-07 22:20:43 +00:00
|
|
|
MainWindow();
|
2013-05-19 03:09:36 +00:00
|
|
|
ProfileGraphicsView *graphics();
|
|
|
|
MainTab *information();
|
|
|
|
DiveListView *dive_list();
|
|
|
|
GlobeGPS *globe();
|
2013-05-22 06:13:45 +00:00
|
|
|
void showError(QString message);
|
2013-06-26 12:13:06 +00:00
|
|
|
void setTitle(enum MainWindowTitleFormat format);
|
2013-04-09 08:35:44 +00:00
|
|
|
|
2013-07-04 15:30:05 +00:00
|
|
|
// The 'Change DC Shortcuts' should only be enabled
|
|
|
|
// when the profile's visible.
|
|
|
|
void disableDcShortcuts();
|
|
|
|
void enableDcShortcuts();
|
2013-09-09 08:59:03 +00:00
|
|
|
void loadFiles(const QStringList files);
|
|
|
|
void importFiles(const QStringList importFiles);
|
2013-09-23 05:24:28 +00:00
|
|
|
void cleanUpEmpty();
|
2013-07-04 15:30:05 +00:00
|
|
|
|
2013-06-19 17:20:16 +00:00
|
|
|
private slots:
|
2013-04-09 16:26:23 +00:00
|
|
|
/* file menu action */
|
2013-04-09 08:35:44 +00:00
|
|
|
void on_actionNew_triggered();
|
2013-04-09 16:26:23 +00:00
|
|
|
void on_actionOpen_triggered();
|
|
|
|
void on_actionSave_triggered();
|
|
|
|
void on_actionSaveAs_triggered();
|
|
|
|
void on_actionClose_triggered();
|
|
|
|
void on_actionImport_triggered();
|
|
|
|
void on_actionExportUDDF_triggered();
|
|
|
|
void on_actionPrint_triggered();
|
|
|
|
void on_actionPreferences_triggered();
|
|
|
|
void on_actionQuit_triggered();
|
|
|
|
|
|
|
|
/* log menu actions */
|
|
|
|
void on_actionDownloadDC_triggered();
|
|
|
|
void on_actionDownloadWeb_triggered();
|
2013-10-25 01:02:59 +00:00
|
|
|
void on_actionDivelogs_de_triggered();
|
2013-04-09 16:26:23 +00:00
|
|
|
void on_actionEditDeviceNames_triggered();
|
|
|
|
void on_actionAddDive_triggered();
|
|
|
|
void on_actionRenumber_triggered();
|
|
|
|
void on_actionAutoGroup_triggered();
|
|
|
|
void on_actionToggleZoom_triggered();
|
|
|
|
void on_actionYearlyStatistics_triggered();
|
|
|
|
|
|
|
|
/* view menu actions */
|
|
|
|
void on_actionViewList_triggered();
|
|
|
|
void on_actionViewProfile_triggered();
|
|
|
|
void on_actionViewInfo_triggered();
|
2013-06-12 18:54:55 +00:00
|
|
|
void on_actionViewGlobe_triggered();
|
2013-04-09 16:26:23 +00:00
|
|
|
void on_actionViewAll_triggered();
|
|
|
|
void on_actionPreviousDC_triggered();
|
|
|
|
void on_actionNextDC_triggered();
|
|
|
|
|
|
|
|
/* other menu actions */
|
|
|
|
void on_actionSelectEvents_triggered();
|
|
|
|
void on_actionInputPlan_triggered();
|
|
|
|
void on_actionAboutSubsurface_triggered();
|
|
|
|
void on_actionUserManual_triggered();
|
2013-06-20 21:48:21 +00:00
|
|
|
void on_actionDivePlanner_triggered();
|
2013-04-09 08:35:44 +00:00
|
|
|
|
2013-06-27 12:33:43 +00:00
|
|
|
/* monitor resize of the info-profile splitter */
|
2013-07-05 12:33:51 +00:00
|
|
|
void on_mainSplitter_splitterMoved(int pos, int idx);
|
2013-06-27 12:33:43 +00:00
|
|
|
void on_infoProfileSplitter_splitterMoved(int pos, int idx);
|
|
|
|
|
2013-05-14 11:18:26 +00:00
|
|
|
void current_dive_changed(int divenr);
|
2013-06-04 12:40:09 +00:00
|
|
|
void initialUiSetup();
|
2013-05-14 11:18:26 +00:00
|
|
|
|
2013-10-16 19:05:19 +00:00
|
|
|
void on_actionImportCSV_triggered();
|
|
|
|
|
2013-04-27 09:09:57 +00:00
|
|
|
protected:
|
|
|
|
void closeEvent(QCloseEvent *);
|
|
|
|
|
2013-06-19 17:20:16 +00:00
|
|
|
public slots:
|
2013-05-26 18:33:45 +00:00
|
|
|
void readSettings();
|
2013-11-14 08:52:03 +00:00
|
|
|
void refreshDisplay(bool recreateDiveList = true);
|
2013-06-27 17:48:03 +00:00
|
|
|
void showProfile();
|
2013-11-01 15:48:34 +00:00
|
|
|
void editCurrentDive();
|
2013-05-26 18:33:45 +00:00
|
|
|
|
2013-04-07 22:20:43 +00:00
|
|
|
private:
|
2013-10-03 18:54:25 +00:00
|
|
|
Ui::MainWindow ui;
|
2013-05-12 13:54:34 +00:00
|
|
|
QAction *actionNextDive;
|
|
|
|
QAction *actionPreviousDive;
|
2013-08-22 19:20:47 +00:00
|
|
|
QWebView *helpView;
|
2013-11-07 16:37:27 +00:00
|
|
|
CurrentState state;
|
2013-04-13 13:17:59 +00:00
|
|
|
QString filter();
|
|
|
|
bool askSaveChanges();
|
2013-04-27 09:09:57 +00:00
|
|
|
void writeSettings();
|
2013-05-10 17:45:13 +00:00
|
|
|
void redrawProfile();
|
2013-05-19 22:25:47 +00:00
|
|
|
void file_save();
|
|
|
|
void file_save_as();
|
2013-11-07 16:37:27 +00:00
|
|
|
void beginChangeState(CurrentState s);
|
|
|
|
void saveSplitterSizes();
|
2013-11-14 15:42:26 +00:00
|
|
|
QString lastUsedDir();
|
|
|
|
void updateLastUsedDir(const QString& s);
|
2013-04-07 22:20:43 +00:00
|
|
|
};
|
|
|
|
|
2013-05-19 03:09:36 +00:00
|
|
|
MainWindow *mainWindow();
|
|
|
|
|
2013-04-09 08:35:44 +00:00
|
|
|
#endif
|