13 #include "exportdialog.h"
14 #include "optionsdialog.h"
31 class GUI
: public QMainWindow
39 bool openFile(const QString
&fileName
);
52 void showGraphs(bool show
);
53 void showGraphGrids(bool show
);
54 void showToolbars(bool show
);
55 void showFullscreen(bool show
);
56 void showTracks(bool show
);
57 void showRoutes(bool show
);
65 void graphChanged(int);
66 void poiFileChecked(int);
73 void setTotalTime() {setTimeType(Total
);}
74 void setMovingTime() {setTimeType(Moving
);}
75 void setMetricUnits() {setUnits(Metric
);}
76 void setImperialUnits() {setUnits(Imperial
);}
77 void setDistanceGraph() {setGraphType(Distance
);}
78 void setTimeGraph() {setGraphType(Time
);}
80 void sliderPositionChanged(qreal pos
);
83 typedef QPair
<QDate
, QDate
> DateRange
;
89 void plot(QPrinter
*printer
);
91 QAction
*createPOIFileAction(int index
);
92 void createPOIFilesActions();
93 void createMapActions();
96 void createToolBars();
97 void createStatusBar();
98 void createPathView();
99 void createGraphTabs();
100 void createBrowser();
102 bool openPOIFile(const QString
&fileName
);
103 bool loadFile(const QString
&fileName
);
104 void exportFile(const QString
&fileName
);
105 void updateStatusBarInfo();
106 void updateWindowTitle();
107 void updateNavigationActions();
108 void updateGraphTabs();
109 void updatePathView();
111 TimeType
timeType() const;
113 void setTimeType(TimeType type
);
114 void setUnits(Units units
);
115 void setGraphType(GraphType type
);
117 qreal
distance() const;
119 qreal
movingTime() const;
120 int mapIndex(const QString
&name
);
122 void writeSettings();
124 const QString
fileFormats() const;
126 void keyPressEvent(QKeyEvent
*event
);
127 void closeEvent(QCloseEvent
*event
);
128 void dragEnterEvent(QDragEnterEvent
*event
);
129 void dropEvent(QDropEvent
*event
);
131 QToolBar
*_fileToolBar
;
132 QToolBar
*_showToolBar
;
133 QToolBar
*_navigationToolBar
;
134 QMenu
*_poiFilesMenu
;
137 QActionGroup
*_fileActionGroup
;
138 QActionGroup
*_navigationActionGroup
;
139 QActionGroup
*_mapsActionGroup
;
140 QAction
*_exitAction
;
141 QAction
*_keysAction
;
142 QAction
*_dataSourcesAction
;
143 QAction
*_aboutAction
;
144 QAction
*_aboutQtAction
;
145 QAction
*_printFileAction
;
146 QAction
*_exportFileAction
;
147 QAction
*_openFileAction
;
148 QAction
*_closeFileAction
;
149 QAction
*_reloadFileAction
;
150 QAction
*_openPOIAction
;
151 QAction
*_closePOIAction
;
152 QAction
*_showPOIAction
;
153 QAction
*_overlapPOIAction
;
154 QAction
*_showPOILabelsAction
;
155 QAction
*_showMapAction
;
156 QAction
*_fullscreenAction
;
157 QAction
*_loadMapAction
;
158 QAction
*_clearMapCacheAction
;
159 QAction
*_showGraphsAction
;
160 QAction
*_showGraphGridAction
;
161 QAction
*_distanceGraphAction
;
162 QAction
*_timeGraphAction
;
163 QAction
*_showToolbarsAction
;
164 QAction
*_nextAction
;
165 QAction
*_prevAction
;
166 QAction
*_lastAction
;
167 QAction
*_firstAction
;
168 QAction
*_metricUnitsAction
;
169 QAction
*_imperialUnitsAction
;
170 QAction
*_totalTimeAction
;
171 QAction
*_movingTimeAction
;
172 QAction
*_nextMapAction
;
173 QAction
*_prevMapAction
;
174 QAction
*_showTracksAction
;
175 QAction
*_showRoutesAction
;
176 QAction
*_showWaypointsAction
;
177 QAction
*_showWaypointLabelsAction
;
178 QAction
*_showRouteWaypointsAction
;
179 QAction
*_openOptionsAction
;
181 QList
<QAction
*> _mapActions
;
182 QList
<QAction
*> _poiFilesActions
;
184 QSignalMapper
*_poiFilesSignalMapper
;
185 QSignalMapper
*_mapsSignalMapper
;
187 QLabel
*_fileNameLabel
;
188 QLabel
*_distanceLabel
;
192 QTabWidget
*_graphTabWidget
;
193 QList
<GraphTab
*> _tabs
;
198 FileBrowser
*_browser
;
199 QList
<QString
> _files
;
205 qreal _trackDistance
;
206 qreal _routeDistance
;
209 DateRange _dateRange
;