mirror of
git://projects.qi-hardware.com/nanomap.git
synced 2024-11-23 13:16:16 +02:00
a bit more consistant ui
This commit is contained in:
parent
a9d68105c8
commit
88bbfbef29
@ -35,7 +35,7 @@ DownloadWidget::DownloadWidget(QWidget *parent)
|
|||||||
m_downloadMode(Tiles),
|
m_downloadMode(Tiles),
|
||||||
m_tabWidget(new QTabWidget(this)),
|
m_tabWidget(new QTabWidget(this)),
|
||||||
m_dlProgress(new QProgressBar(this)),
|
m_dlProgress(new QProgressBar(this)),
|
||||||
m_startButton(new QPushButton("&Start", this)),
|
m_startButton(new QPushButton("&Start download", this)),
|
||||||
m_backButton(new QPushButton("&Back", this)),
|
m_backButton(new QPushButton("&Back", this)),
|
||||||
m_startLevel(0),
|
m_startLevel(0),
|
||||||
m_dlRect(),
|
m_dlRect(),
|
||||||
@ -61,9 +61,11 @@ DownloadWidget::DownloadWidget(QWidget *parent)
|
|||||||
m_dlProgress->hide();
|
m_dlProgress->hide();
|
||||||
layout->addWidget(m_dlProgress, 1, 0, 1, 2);
|
layout->addWidget(m_dlProgress, 1, 0, 1, 2);
|
||||||
|
|
||||||
|
m_startButton->setIcon(QIcon(":ok.png"));
|
||||||
connect(m_startButton, SIGNAL(clicked()), this, SLOT(startDownload()));
|
connect(m_startButton, SIGNAL(clicked()), this, SLOT(startDownload()));
|
||||||
layout->addWidget(m_startButton, 2, 0);
|
layout->addWidget(m_startButton, 2, 0);
|
||||||
|
|
||||||
|
m_backButton->setIcon(QIcon(":cancel.png"));
|
||||||
connect(m_backButton, SIGNAL(clicked()), this, SIGNAL(back()));
|
connect(m_backButton, SIGNAL(clicked()), this, SIGNAL(back()));
|
||||||
layout->addWidget(m_backButton, 2, 1);
|
layout->addWidget(m_backButton, 2, 1);
|
||||||
|
|
||||||
|
@ -91,6 +91,7 @@ MainWidget::MainWidget(QWidget *parent)
|
|||||||
connect(m_search, SIGNAL(centerOn(qreal, qreal)), this, SLOT(showMap(qreal, qreal)));
|
connect(m_search, SIGNAL(centerOn(qreal, qreal)), this, SLOT(showMap(qreal, qreal)));
|
||||||
m_stack->insertWidget(3, m_search);
|
m_stack->insertWidget(3, m_search);
|
||||||
|
|
||||||
|
m_fileSelector->setTitle("Open POI / Track file");
|
||||||
m_fileSelector->setFileTypes(QStringList() << "*.gpx" << "*.osm");
|
m_fileSelector->setFileTypes(QStringList() << "*.gpx" << "*.osm");
|
||||||
connect(m_fileSelector, SIGNAL(cancel()), this, SLOT(showMap()));
|
connect(m_fileSelector, SIGNAL(cancel()), this, SLOT(showMap()));
|
||||||
connect(m_fileSelector, SIGNAL(fileSelected(QString)), this, SLOT(loadFile(QString)));
|
connect(m_fileSelector, SIGNAL(fileSelected(QString)), this, SLOT(loadFile(QString)));
|
||||||
|
@ -243,7 +243,7 @@ void MapWidget::keyPressEvent(QKeyEvent *event)
|
|||||||
}
|
}
|
||||||
case Qt::Key_D:
|
case Qt::Key_D:
|
||||||
{
|
{
|
||||||
if (event->modifiers() == Qt::NoModifier) {
|
if (event->modifiers() == Qt::ControlModifier) {
|
||||||
emit downloadArea(m_level, geoRect());
|
emit downloadArea(m_level, geoRect());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -416,12 +416,12 @@ void MapWidget::paintEvent(QPaintEvent *event)
|
|||||||
usage << "l: Show/hide individual layers";
|
usage << "l: Show/hide individual layers";
|
||||||
usage << "tab: Show/hide marker list";
|
usage << "tab: Show/hide marker list";
|
||||||
if (m_networkMode) {
|
if (m_networkMode) {
|
||||||
usage << "d: Download map data for visible area";
|
usage << "Crtl+d: Download map data for visible area";
|
||||||
painter.drawText(30, 200, 260, 20, Qt::AlignCenter, "Map data: (C) OpenStreetMap.org");
|
painter.drawText(30, 200, 260, 20, Qt::AlignCenter, "Map data: (C) OpenStreetMap.org");
|
||||||
} else if (!m_copyright.isEmpty()) {
|
} else if (!m_copyright.isEmpty()) {
|
||||||
painter.drawText(30, 200, 260, 20, Qt::AlignCenter, "Map data: (C) "+m_copyright);
|
painter.drawText(30, 200, 260, 20, Qt::AlignCenter, "Map data: (C) "+m_copyright);
|
||||||
}
|
}
|
||||||
usage << "Ctrl+o: Load POI / Track file";
|
usage << "Ctrl+o: Open POI / Track file";
|
||||||
painter.drawText(30, 10, 260, 20, Qt::AlignCenter, "NanoMap - Usage");
|
painter.drawText(30, 10, 260, 20, Qt::AlignCenter, "NanoMap - Usage");
|
||||||
painter.drawLine(70, 27, 250, 27);
|
painter.drawLine(70, 27, 250, 27);
|
||||||
painter.drawText(30, 30, 260, 200, Qt::AlignLeft, usage.join("\n"));
|
painter.drawText(30, 30, 260, 200, Qt::AlignLeft, usage.join("\n"));
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010 Niels Kummerfeldt <niels.kummerfeldt@tu-harburg.de>
|
* Copyright 2010-2011 Niels Kummerfeldt <niels.kummerfeldt@tu-harburg.de>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -40,7 +40,6 @@ SearchWidget::SearchWidget(QWidget *parent)
|
|||||||
QGridLayout *layout = new QGridLayout(this);
|
QGridLayout *layout = new QGridLayout(this);
|
||||||
layout->setContentsMargins(0, 0, 0, 0);
|
layout->setContentsMargins(0, 0, 0, 0);
|
||||||
|
|
||||||
m_city->setPlaceholderText("Enter city name");
|
|
||||||
layout->addWidget(m_city, 0, 0, 1, 2);
|
layout->addWidget(m_city, 0, 0, 1, 2);
|
||||||
connect(m_city, SIGNAL(textEdited(QString)), this, SLOT(cityChanged(QString)));
|
connect(m_city, SIGNAL(textEdited(QString)), this, SLOT(cityChanged(QString)));
|
||||||
connect(m_city, SIGNAL(editingFinished()), this, SLOT(cityEntered()));
|
connect(m_city, SIGNAL(editingFinished()), this, SLOT(cityEntered()));
|
||||||
@ -49,7 +48,10 @@ SearchWidget::SearchWidget(QWidget *parent)
|
|||||||
connect(m_cityList, SIGNAL(itemActivated(QListWidgetItem*)),
|
connect(m_cityList, SIGNAL(itemActivated(QListWidgetItem*)),
|
||||||
this, SLOT(citySelected(QListWidgetItem*)));
|
this, SLOT(citySelected(QListWidgetItem*)));
|
||||||
|
|
||||||
|
#if QT_VERSION >= 0x040700
|
||||||
|
m_city->setPlaceholderText("Enter city name");
|
||||||
m_street->setPlaceholderText("Enter street name");
|
m_street->setPlaceholderText("Enter street name");
|
||||||
|
#endif
|
||||||
layout->addWidget(m_street, 2, 0, 1, 2);
|
layout->addWidget(m_street, 2, 0, 1, 2);
|
||||||
connect(m_street, SIGNAL(textEdited(QString)), this, SLOT(streetChanged(QString)));
|
connect(m_street, SIGNAL(textEdited(QString)), this, SLOT(streetChanged(QString)));
|
||||||
|
|
||||||
@ -57,7 +59,8 @@ SearchWidget::SearchWidget(QWidget *parent)
|
|||||||
connect(m_streetList, SIGNAL(itemActivated(QListWidgetItem*)),
|
connect(m_streetList, SIGNAL(itemActivated(QListWidgetItem*)),
|
||||||
this, SLOT(streetSelected(QListWidgetItem*)));
|
this, SLOT(streetSelected(QListWidgetItem*)));
|
||||||
|
|
||||||
QPushButton *back = new QPushButton("&Cancel", this);
|
QPushButton *back = new QPushButton("&Back", this);
|
||||||
|
back->setIcon(QIcon(":cancel.png"));
|
||||||
layout->addWidget(back, 4, 1);
|
layout->addWidget(back, 4, 1);
|
||||||
connect(back, SIGNAL(clicked()), this, SIGNAL(back()));
|
connect(back, SIGNAL(clicked()), this, SIGNAL(back()));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user