Skip to content
Permalink
Browse files
Use QgisApp::instance and simplify code
  • Loading branch information
Médéric RIBREUX authored and m-kuhn committed Nov 27, 2015
1 parent 09c8239 commit 055ef76a68f1075d989f3a126e155d050842a204
Showing with 14 additions and 0 deletions.
  1. +11 −0 src/app/qgsmeasuredialog.cpp
  2. +3 −0 src/app/qgsmeasuredialog.h
@@ -14,6 +14,7 @@
* *
***************************************************************************/

#include "qgisapp.h"
#include "qgsmeasuredialog.h"
#include "qgsmeasuretool.h"

@@ -40,6 +41,11 @@ QgsMeasureDialog::QgsMeasureDialog( QgsMeasureTool* tool, Qt::WindowFlags f )
buttonBox->addButton( nb, QDialogButtonBox::ActionRole );
connect( nb, SIGNAL( clicked() ), this, SLOT( restart() ) );

// Add a configuration button
QPushButton* cb = new QPushButton( tr( "&Configuration" ) );
buttonBox->addButton( cb, QDialogButtonBox::ActionRole );
connect( cb, SIGNAL( clicked() ), this, SLOT( openConfigTab() ) );

mMeasureArea = tool->measureArea();
mTotal = 0.;

@@ -60,6 +66,11 @@ QgsMeasureDialog::QgsMeasureDialog( QgsMeasureTool* tool, Qt::WindowFlags f )
groupBox->setCollapsed( true );
}

void QgsMeasureDialog::openConfigTab()
{
QgisApp::instance()->showOptionsDialog( this, "mOptionsPageMapTools" );
}

void QgsMeasureDialog::updateSettings()
{
QSettings settings;
@@ -68,6 +68,9 @@ class APP_EXPORT QgsMeasureDialog : public QDialog, private Ui::QgsMeasureBase
private slots:
void unitsChanged( const QString &units );

//! Open configuration tab
void openConfigTab();

private:

//! formats distance to most appropriate units

0 comments on commit 055ef76

Please sign in to comment.