mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-06-27 03:29:16 +02:00
Added "data sources" help item
Now using a common directory for all data/configs
This commit is contained in:
11
src/config.h
11
src/config.h
@ -8,8 +8,13 @@
|
||||
#define FONT_FAMILY "Arial"
|
||||
#define FONT_SIZE 12
|
||||
|
||||
#define POI_DIR "POI"
|
||||
#define TILES_DIR "tiles"
|
||||
#define MAP_LIST_FILE TILES_DIR"/list.txt"
|
||||
#if defined(Q_OS_WIN32)
|
||||
#define APP_DIR "GPXSee"
|
||||
#else
|
||||
#define APP_DIR ".gpxsee"
|
||||
#endif
|
||||
#define POI_DIR APP_DIR"/POI"
|
||||
#define TILES_DIR APP_DIR"/tiles"
|
||||
#define MAP_LIST_FILE APP_DIR"/maps.txt"
|
||||
|
||||
#endif /* CONFIG_H */
|
||||
|
31
src/gui.cpp
31
src/gui.cpp
@ -125,6 +125,8 @@ void GUI::createActions()
|
||||
connect(_exitAction, SIGNAL(triggered()), this, SLOT(close()));
|
||||
|
||||
// Help & About
|
||||
_dataSourcesAction = new QAction(tr("Data sources"), this);
|
||||
connect(_dataSourcesAction, SIGNAL(triggered()), this, SLOT(dataSources()));
|
||||
_keysAction = new QAction(tr("Keyboard controls"), this);
|
||||
connect(_keysAction, SIGNAL(triggered()), this, SLOT(keys()));
|
||||
_aboutAction = new QAction(QIcon(QPixmap(APP_ICON)),
|
||||
@ -221,6 +223,7 @@ void GUI::createMenus()
|
||||
_settingsMenu->addAction(_showGraphsAction);
|
||||
|
||||
_helpMenu = menuBar()->addMenu(tr("Help"));
|
||||
_helpMenu->addAction(_dataSourcesAction);
|
||||
_helpMenu->addAction(_keysAction);
|
||||
_helpMenu->addSeparator();
|
||||
_helpMenu->addAction(_aboutAction);
|
||||
@ -317,6 +320,34 @@ void GUI::keys()
|
||||
msgBox.exec();
|
||||
}
|
||||
|
||||
void GUI::dataSources()
|
||||
{
|
||||
QMessageBox msgBox(this);
|
||||
|
||||
msgBox.setWindowTitle(tr("Data sources"));
|
||||
msgBox.setText(QString("<h3>") + tr("Data sources") + QString("</h3>"));
|
||||
msgBox.setInformativeText(
|
||||
QString("<h4>") + tr("Map sources") + QString("</h4><p>")
|
||||
+ tr("Map (tiles) source URLs are read on program startup from the "
|
||||
"following file:")
|
||||
+ QString("</p><p><code>") + QDir::homePath()
|
||||
+ QString("/"MAP_LIST_FILE"</code></p><p>")
|
||||
+ tr("The file format is one URL per line where the tile X and Y "
|
||||
"coordinates are replaced with $x and $y. The zoom level is "
|
||||
"replaced with $z. An example map file could look like:")
|
||||
+ QString("</p><p><code>http://tile.server.com/map/$z/$x/$y.png<br/>"
|
||||
"http://mapserver.org/map/$z-$x-$y</code></p>")
|
||||
|
||||
+ QString("<h4>") + tr("POIs") + QString("</h4><p>")
|
||||
+ tr("To make GPXSee load a POI file automatically on startup, add "
|
||||
"the file to the following directory:")
|
||||
+ QString("</p><p><code>") + QDir::homePath()
|
||||
+ QString("/"POI_DIR"</code></p>")
|
||||
);
|
||||
|
||||
msgBox.exec();
|
||||
}
|
||||
|
||||
void GUI::openFile()
|
||||
{
|
||||
QStringList files = QFileDialog::getOpenFileNames(this, tr("Open file"));
|
||||
|
@ -30,6 +30,7 @@ public:
|
||||
private slots:
|
||||
void about();
|
||||
void keys();
|
||||
void dataSources();
|
||||
void saveFile();
|
||||
void saveAs();
|
||||
void openFile();
|
||||
@ -74,6 +75,7 @@ private:
|
||||
|
||||
QAction *_exitAction;
|
||||
QAction *_keysAction;
|
||||
QAction *_dataSourcesAction;
|
||||
QAction *_aboutAction;
|
||||
QAction *_aboutQtAction;
|
||||
QAction *_saveFileAction;
|
||||
|
Reference in New Issue
Block a user