1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-28 13:41:16 +01:00
GPXSee/src/GUI/gui.h

233 lines
5.1 KiB
C
Raw Normal View History

2015-10-05 01:43:48 +02:00
#ifndef GUI_H
#define GUI_H
#include <QMainWindow>
#include <QString>
#include <QList>
#include <QDate>
2016-05-25 23:27:07 +02:00
#include <QPrinter>
2017-11-26 18:54:03 +01:00
#include "data/graph.h"
2016-09-21 23:48:11 +02:00
#include "units.h"
#include "timetype.h"
#include "format.h"
2016-12-06 01:48:26 +01:00
#include "exportdialog.h"
#include "optionsdialog.h"
2015-10-05 01:43:48 +02:00
class QMenu;
class QToolBar;
class QTabWidget;
class QActionGroup;
class QAction;
class QLabel;
class QSplitter;
class QSignalMapper;
class QPrinter;
2015-10-20 22:18:41 +02:00
class FileBrowser;
2016-06-24 00:55:44 +02:00
class GraphTab;
class MapView;
2015-11-23 02:37:08 +01:00
class Map;
class MapList;
2018-06-04 23:40:42 +02:00
class POI;
2015-10-05 01:43:48 +02:00
class GUI : public QMainWindow
{
Q_OBJECT
public:
GUI();
2015-10-05 01:43:48 +02:00
bool openFile(const QString &fileName);
private slots:
void about();
2015-10-21 01:09:17 +02:00
void keys();
void paths();
void printFile();
void exportFile();
2015-10-05 01:43:48 +02:00
void openFile();
2016-03-23 20:56:39 +01:00
void closeAll();
2015-10-20 22:18:41 +02:00
void reloadFile();
2015-10-05 01:43:48 +02:00
void openPOIFile();
void closePOIFiles();
2016-10-17 23:14:07 +02:00
void showGraphs(bool show);
void showGraphGrids(bool show);
2017-09-29 11:43:09 +02:00
void showGraphSliderInfo(bool show);
2016-10-17 23:14:07 +02:00
void showToolbars(bool show);
void showFullscreen(bool show);
void showTracks(bool show);
void showRoutes(bool show);
void loadMap();
2016-04-08 22:33:19 +02:00
void nextMap();
void prevMap();
2016-12-06 01:48:26 +01:00
void openOptions();
2015-10-20 22:18:41 +02:00
2015-11-23 02:37:08 +01:00
void mapChanged(int);
2015-10-05 01:43:48 +02:00
void graphChanged(int);
void poiFileChecked(int);
2015-10-05 01:43:48 +02:00
2015-12-18 22:21:11 +01:00
void next();
void prev();
void last();
void first();
void setTotalTime() {setTimeType(Total);}
void setMovingTime() {setTimeType(Moving);}
2016-09-21 23:48:11 +02:00
void setMetricUnits() {setUnits(Metric);}
void setImperialUnits() {setUnits(Imperial);}
2018-02-11 23:51:57 +01:00
void setNauticalUnits() {setUnits(Nautical);}
2016-09-21 23:48:11 +02:00
void setDistanceGraph() {setGraphType(Distance);}
void setTimeGraph() {setGraphType(Time);}
void setDecimalDegrees() {setCoordinatesFormat(DecimalDegrees);}
void setDegreesMinutes() {setCoordinatesFormat(DegreesMinutes);}
void setDMS() {setCoordinatesFormat(DMS);}
2015-12-19 20:23:07 +01:00
2016-03-30 20:50:51 +02:00
void sliderPositionChanged(qreal pos);
2015-10-05 01:43:48 +02:00
private:
typedef QPair<QDate, QDate> DateRange;
2016-05-13 18:48:42 +02:00
void loadMaps();
void loadPOIs();
2016-03-23 20:56:39 +01:00
void closeFiles();
void plot(QPrinter *printer);
2015-11-23 02:37:08 +01:00
2016-03-05 22:42:22 +01:00
QAction *createPOIFileAction(int index);
void createPOIFilesActions();
2016-03-05 22:42:22 +01:00
void createMapActions();
2015-10-05 01:43:48 +02:00
void createActions();
void createMenus();
void createToolBars();
void createStatusBar();
void createMapView();
void createGraphTabs();
2016-10-23 11:09:20 +02:00
void createBrowser();
2015-10-05 01:43:48 +02:00
bool openPOIFile(const QString &fileName);
2015-10-20 22:18:41 +02:00
bool loadFile(const QString &fileName);
bool loadMap(const QString &fileName);
void exportFile(const QString &fileName);
2015-10-20 22:18:41 +02:00
void updateStatusBarInfo();
2016-04-19 08:51:11 +02:00
void updateWindowTitle();
2015-12-18 22:21:11 +01:00
void updateNavigationActions();
bool updateGraphTabs();
bool updateMapView();
2015-10-17 12:08:30 +02:00
TimeType timeType() const;
Units units() const;
void setTimeType(TimeType type);
2016-09-21 23:48:11 +02:00
void setUnits(Units units);
void setCoordinatesFormat(CoordinatesFormat format);
2016-09-21 23:48:11 +02:00
void setGraphType(GraphType type);
2016-04-26 09:39:16 +02:00
2016-11-01 08:42:16 +01:00
qreal distance() const;
qreal time() const;
qreal movingTime() const;
2016-04-26 20:55:29 +02:00
int mapIndex(const QString &name);
2016-04-26 09:39:16 +02:00
void readSettings();
void writeSettings();
2015-10-05 01:43:48 +02:00
2016-09-21 23:48:11 +02:00
void keyPressEvent(QKeyEvent *event);
void closeEvent(QCloseEvent *event);
2016-10-04 10:16:46 +02:00
void dragEnterEvent(QDragEnterEvent *event);
void dropEvent(QDropEvent *event);
2016-09-21 23:48:11 +02:00
2015-10-05 01:43:48 +02:00
QToolBar *_fileToolBar;
2015-11-23 02:37:08 +01:00
QToolBar *_showToolBar;
2015-12-18 22:21:11 +01:00
QToolBar *_navigationToolBar;
2016-08-09 01:16:19 +02:00
QMenu *_poiFilesMenu;
QMenu *_mapMenu;
2016-08-09 01:16:19 +02:00
2015-10-05 01:43:48 +02:00
QActionGroup *_fileActionGroup;
2015-12-18 22:21:11 +01:00
QActionGroup *_navigationActionGroup;
QActionGroup *_mapsActionGroup;
2015-10-05 01:43:48 +02:00
QAction *_exitAction;
2015-10-21 01:09:17 +02:00
QAction *_keysAction;
QAction *_pathsAction;
2015-10-05 01:43:48 +02:00
QAction *_aboutAction;
QAction *_aboutQtAction;
QAction *_printFileAction;
QAction *_exportFileAction;
2015-10-05 01:43:48 +02:00
QAction *_openFileAction;
QAction *_closeFileAction;
2015-10-20 22:18:41 +02:00
QAction *_reloadFileAction;
2015-10-05 01:43:48 +02:00
QAction *_openPOIAction;
QAction *_closePOIAction;
2015-10-05 01:43:48 +02:00
QAction *_showPOIAction;
QAction *_overlapPOIAction;
2016-08-09 01:16:19 +02:00
QAction *_showPOILabelsAction;
2015-11-23 02:37:08 +01:00
QAction *_showMapAction;
2016-04-05 09:10:19 +02:00
QAction *_fullscreenAction;
QAction *_loadMapAction;
2016-04-01 19:25:34 +02:00
QAction *_clearMapCacheAction;
QAction *_showGraphsAction;
2016-10-17 23:14:07 +02:00
QAction *_showGraphGridAction;
2017-09-29 11:43:09 +02:00
QAction *_showGraphSliderInfoAction;
2016-09-19 00:56:10 +02:00
QAction *_distanceGraphAction;
QAction *_timeGraphAction;
QAction *_showToolbarsAction;
2015-12-18 22:21:11 +01:00
QAction *_nextAction;
QAction *_prevAction;
QAction *_lastAction;
QAction *_firstAction;
2015-12-19 20:23:07 +01:00
QAction *_metricUnitsAction;
QAction *_imperialUnitsAction;
2018-02-11 23:51:57 +01:00
QAction *_nauticalUnitsAction;
QAction *_decimalDegreesAction;
QAction *_degreesMinutesAction;
QAction *_DMSAction;
QAction *_totalTimeAction;
QAction *_movingTimeAction;
2016-04-08 22:33:19 +02:00
QAction *_nextMapAction;
QAction *_prevMapAction;
2016-08-09 01:16:19 +02:00
QAction *_showTracksAction;
QAction *_showRoutesAction;
QAction *_showWaypointsAction;
QAction *_showWaypointLabelsAction;
2016-08-09 10:47:49 +02:00
QAction *_showRouteWaypointsAction;
2016-12-06 01:48:26 +01:00
QAction *_openOptionsAction;
QAction *_mapsEnd;
2015-11-23 02:37:08 +01:00
QList<QAction*> _mapActions;
QList<QAction*> _poiFilesActions;
QSignalMapper *_poiFilesSignalMapper;
QSignalMapper *_mapsSignalMapper;
2015-10-05 01:43:48 +02:00
2015-10-14 02:54:36 +02:00
QLabel *_fileNameLabel;
QLabel *_distanceLabel;
QLabel *_timeLabel;
2015-10-05 01:43:48 +02:00
QSplitter *_splitter;
MapView *_mapView;
QTabWidget *_graphTabWidget;
2016-06-24 00:55:44 +02:00
QList<GraphTab*> _tabs;
2015-10-05 01:43:48 +02:00
2016-10-09 23:46:30 +02:00
POI *_poi;
MapList *_ml;
Map *_map;
2015-10-05 01:43:48 +02:00
2015-10-20 22:18:41 +02:00
FileBrowser *_browser;
QList<QString> _files;
2015-10-14 02:54:36 +02:00
int _trackCount;
int _routeCount;
int _waypointCount;
qreal _trackDistance;
qreal _routeDistance;
2015-10-14 02:54:36 +02:00
qreal _time;
qreal _movingTime;
DateRange _dateRange;
QString _pathName;
2016-03-30 20:50:51 +02:00
qreal _sliderPos;
2016-04-05 09:10:19 +02:00
int _frameStyle;
bool _showGraphs;
2016-05-25 23:27:07 +02:00
2016-12-06 01:48:26 +01:00
Export _export;
Options _options;
QString _dataDir, _mapDir, _poiDir;
2015-10-05 01:43:48 +02:00
};
#endif // GUI_H