Hi all, attached is a trivial patch which moves the grid configuration into the main configuration dialogue. When the patch is used, the files src/CDlgSetupGrid.cpp, src/CDlgSetupGrid.h and src/ICreateMapGridTool.ui can be removed.
The advantage (IMHO) of this approach is that the 'Preferences' menu on OS X will
disappear completely, saving some space in the menu bar (as OS X uses a rather large
font, the "crowded" menu bar may be too long for small screens).
Apart from that, it might be a good idea to move the 'Preferences' menu
*completely* as a sub-item to the 'Edit' menu (see e.g. Firefox), but that's a
matter of taste I guess.
The 'proj' wizard, btw, doesn't pick up the current config when opened. And
apparently it is not possible to re-generate the default ("+proj=longlat
+datum=WGS84 +no_defs)...
Opinions?
Best, Albrecht.Index: src/IDlgConfig.ui
===================================================================
--- src/IDlgConfig.ui (Revision 3145)
+++ src/IDlgConfig.ui (Arbeitskopie)
@@ -193,6 +193,60 @@
</widget>
</item>
<item>
+ <widget class="QGroupBox" name="groupBox_10">
+ <property name="title">
+ <string>Grid</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_6">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_8">
+ <item>
+ <widget class="QLabel" name="label_11">
+ <property name="text">
+ <string>Projection</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineProjection"/>
+ </item>
+ <item>
+ <widget class="QToolButton" name="toolProjWizzard">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_7">
+ <item>
+ <widget class="QLabel" name="labelGridColor">
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Grid color</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="toolGridColor">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
Index: src/CDlgConfig.h
===================================================================
--- src/CDlgConfig.h (Revision 3145)
+++ src/CDlgConfig.h (Arbeitskopie)
@@ -38,6 +38,8 @@
void slotCurrentDeviceChanged(int index);
void slotSelectFont();
void slotSelectWptTextColor();
+ void slotProjWizard();
+ void slotSelectGridColor();
void slotSetupGarminIcons();
void slotSelectPathGeoDB();
void slotSelectPathMapCache();
Index: src/CMainWindow.cpp
===================================================================
--- src/CMainWindow.cpp (Revision 3145)
+++ src/CMainWindow.cpp (Arbeitskopie)
@@ -51,7 +51,6 @@
#include "CDBus.h"
#endif
#include "CGridDB.h"
-#include "CDlgSetupGrid.h"
#include <QtGui>
#ifdef WIN32
@@ -622,7 +621,6 @@
#else
menu->addAction(QIcon(":/icons/iconConfig16x16.png"),tr("&General"),this,SLOT(slotConfig()));
#endif
- menu->addAction(QIcon(":/icons/iconGrid16x16.png"),tr("Grid"),this,SLOT(slotSetupGrid()));
menuBar()->addMenu(menu);
menu = new QMenu(this);
@@ -723,12 +721,6 @@
dlg.exec();
}
-void CMainWindow::slotSetupGrid()
-{
- CDlgSetupGrid dlg(this);
- dlg.exec();
-}
-
void CMainWindow::slotLoadData()
{
QString formats = getGeoDataFormats();
Index: src/CGridDB.h
===================================================================
--- src/CGridDB.h (Revision 3145)
+++ src/CGridDB.h (Arbeitskopie)
@@ -46,7 +46,7 @@
private:
friend class CMainWindow;
- friend class CDlgSetupGrid;
+ friend class CDlgConfig;
CGridDB(QObject * parent);
void findGridSpace(double min, double max, double& xSpace, double& ySpace);
bool calcIntersection(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4, double& x, double& y);
Index: src/CMainWindow.h
===================================================================
--- src/CMainWindow.h (Revision 3145)
+++ src/CMainWindow.h (Arbeitskopie)
@@ -86,7 +86,6 @@
void slotCopyright();
void slotToolBoxChanged(int idx);
void slotConfig();
- void slotSetupGrid();
void slotLoadData();
void slotAddData();
void slotSaveData();
Index: src/CDlgConfig.cpp
===================================================================
--- src/CDlgConfig.cpp (Revision 3145)
+++ src/CDlgConfig.cpp (Arbeitskopie)
@@ -25,6 +25,8 @@
#include "CUnitMetric.h"
#include "CMapTDB.h"
#include "CDlgSetupGarminIcons.h"
+#include "CDlgProjWizzard.h"
+#include "CGridDB.h"
#include <QtGui>
#include <QNetworkProxy>
@@ -43,6 +45,9 @@
setupUi(this);
connect(toolFont,SIGNAL(clicked()),this,SLOT(slotSelectFont()));
connect(toolWptTextColor,SIGNAL(clicked()),this,SLOT(slotSelectWptTextColor()));
+ toolProjWizzard->setIcon(QPixmap(":/icons/iconWizzard16x16.png"));
+ connect(toolProjWizzard, SIGNAL(clicked()), this, SLOT(slotProjWizard()));
+ connect(toolGridColor,SIGNAL(clicked()),this,SLOT(slotSelectGridColor()));
fillTypeCombo();
#ifndef HAS_GEODB
@@ -103,7 +108,12 @@
labelPathGeoDB->setText(resources.m_pathGeoDB.absolutePath());
#endif
+ lineProjection->setText(CGridDB::self().projstr);
+ QPalette palette = labelGridColor->palette();
+ palette.setColor(labelGridColor->foregroundRole(), CGridDB::self().color);
+ labelGridColor->setPalette(palette);
+
comboDevice->addItem(tr(""),"");
comboDevice->addItem(tr("QLandkarte M"), "QLandkarteM");
comboDevice->addItem(tr("Garmin"), "Garmin");
@@ -143,7 +153,7 @@
checkUploadWpt->setChecked(IDevice::m_UploadAllWpt);
checkUploadRte->setChecked(IDevice::m_UploadAllRte);
- QPalette palette = labelWptTextColor->palette();
+ palette = labelWptTextColor->palette();
palette.setColor(labelWptTextColor->foregroundRole(), resources.m_WptTextColor);
labelWptTextColor->setPalette(palette);
@@ -229,6 +239,9 @@
resources.m_pathMapCache = QDir(labelPathMapCache->text());
resources.m_sizeMapCache = spinSizeMapCache->value();
+ palette = labelGridColor->palette();
+ CGridDB::self().setProjAndColor(lineProjection->text(), palette.color(labelGridColor->foregroundRole()));
+
QDialog::accept();
}
@@ -387,6 +400,27 @@
}
+void CDlgConfig::slotProjWizard()
+{
+ CDlgProjWizzard dlg(*lineProjection, this);
+ dlg.exec();
+}
+
+void CDlgConfig::slotSelectGridColor()
+{
+ QPalette palette = labelGridColor->palette();
+ QColor color = palette.color(labelGridColor->foregroundRole());
+
+ color = QColorDialog::getColor(color);
+
+ if(color.isValid())
+ {
+ palette.setColor(labelGridColor->foregroundRole(), color);
+ labelGridColor->setPalette(palette);
+ }
+
+}
+
void CDlgConfig::slotSelectPathMapCache()
{
QString path = QFileDialog::getExistingDirectory(this, tr("Open Directory"), labelPathMapCache->text(), QFileDialog::ShowDirsOnly);
Index: src/CMakeLists.txt
===================================================================
--- src/CMakeLists.txt (Revision 3145)
+++ src/CMakeLists.txt (Arbeitskopie)
@@ -149,7 +149,6 @@
CDlgConfig3D.cpp
CDlgExport.cpp
CDlgWpt2Rte.cpp
- CDlgSetupGrid.cpp
CQlb.cpp
CGpx.cpp
IDevice.cpp
@@ -310,7 +309,6 @@
CDlgConfig3D.h
CDlgExport.h
CDlgWpt2Rte.h
- CDlgSetupGrid.h
CQlb.h
CGpx.h
IDevice.h
@@ -420,7 +418,6 @@
IDlgConfig3D.ui
IDlgExport.ui
IDlgWpt2Rte.ui
- IDlgSetupGrid.ui
ICreateMapOSM.ui
ICreateMapQMAP.ui
ICreateMapGeoTiff.ui
pgpELBkQ8XX1Q.pgp
Description: PGP signature
------------------------------------------------------------------------------ Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex infrastructure or vast IT resources to deliver seamless, secure access to virtual desktops. With this all-in-one solution, easily deploy virtual desktops for less than the cost of PCs and save 60% on VDI infrastructure costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________ Qlandkartegt-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qlandkartegt-users
