mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-06 00:05:02 -05:00
Use QgisApp::instance and simplify code
This commit is contained in:
parent
09c8239a77
commit
055ef76a68
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user