Hi Oliver: Am 30.12.11 11:56 schrieb(en) "Albrecht Dreß" <[email protected]>:
I see, that's a good point. What about adding a button in the tool bar, next to the grid check box, as to open a transient (OS X: drawer) dialogue for defining the grid? That would save the menu entry *and* provide even faster and more intuitive access to the settings (as the user doesn't need to move the mouse from the lower to the upper rim of the screen). I'll provide a proposal for that, stay tuned...
...like the attached patch. How do you like this one? Cheers, Albrecht.
Index: src/CMainWindow.cpp
===================================================================
--- src/CMainWindow.cpp (Revision 3145)
+++ src/CMainWindow.cpp (Arbeitskopie)
@@ -622,7 +622,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 +722,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)
@@ -26,6 +26,7 @@
class QPainter;
class QRect;
class QCheckBox;
+class QToolButton;
class CGridDB : public QObject
{
@@ -43,6 +44,7 @@
private slots:
void slotShowGrid(bool on){showGrid = on;}
+ void slotSetupGrid();
private:
friend class CMainWindow;
@@ -57,6 +59,8 @@
PJ * pjGrid;
QCheckBox * checkGrid;
+ QToolButton * setupGrid;
+
bool showGrid;
QString projstr;
QColor color;
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/CDlgSetupGrid.cpp
===================================================================
--- src/CDlgSetupGrid.cpp (Revision 3145)
+++ src/CDlgSetupGrid.cpp (Arbeitskopie)
@@ -26,6 +26,11 @@
CDlgSetupGrid::CDlgSetupGrid(QWidget * parent)
: QDialog(parent)
{
+ this->setWindowModality(Qt::WindowModal);
+#if defined(Q_WS_MAC)
+ this->setParent(qApp->focusWidget());
+ this->setWindowFlags(Qt::Sheet);
+#endif
setupUi(this);
toolProjWizzard->setIcon(QPixmap(":/icons/iconWizzard16x16.png"));
Index: src/CGridDB.cpp
===================================================================
--- src/CGridDB.cpp (Revision 3145)
+++ src/CGridDB.cpp (Arbeitskopie)
@@ -21,6 +21,7 @@
#include "IMap.h"
#include "CMainWindow.h"
#include "CResources.h"
+#include "CDlgSetupGrid.h"
#include <QtGui>
@@ -50,6 +51,12 @@
connect(checkGrid, SIGNAL(toggled(bool)), this, SLOT(slotShowGrid(bool)));
connect(checkGrid, SIGNAL(clicked()), theMainWindow->getCanvas(), SLOT(update()));
+ setupGrid = new QToolButton(theMainWindow);
+ setupGrid->setIcon(QIcon(":/icons/iconConfig16x16.png"));
+ theMainWindow->statusBar()->addPermanentWidget(setupGrid);
+
+ connect(setupGrid,SIGNAL(clicked()),this,SLOT(slotSetupGrid()));
+
showGrid = cfg.value("map/grid", showGrid).toBool();
checkGrid->setChecked(showGrid);
@@ -67,6 +74,12 @@
cfg.setValue("map/grid/color", color.name());
}
+void CGridDB::slotSetupGrid()
+{
+ CDlgSetupGrid dlg(theMainWindow);
+ dlg.exec();
+}
+
void CGridDB::setProjAndColor(const QString& proj, const QColor& c)
{
projstr = proj;
@@ -75,7 +88,7 @@
if(pjGrid) pj_free(pjGrid);
pjGrid = pj_init_plus(projstr.toAscii());
- checkGrid->setToolTip(tr("Use 'Setup -> Grid...' to setup color and projection.\nCur. proj.: %1").arg(projstr));
+ setupGrid->setToolTip(tr("Configure grid color and projection.\nCur. proj.: %1").arg(projstr));
theMainWindow->getCanvas()->update();
}
pgpTj4MaqljS8.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
