Skip to content

Commit

Permalink
Fix crs tab opening when clicking crs button in status bar
Browse files Browse the repository at this point in the history
and cleanup code a lot
  • Loading branch information
nyalldawson committed Nov 27, 2020
1 parent d95820b commit 26a7add
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 22 deletions.
13 changes: 3 additions & 10 deletions src/app/qgisapp.cpp
Expand Up @@ -14389,10 +14389,8 @@ void QgisApp::showMapTip()

void QgisApp::projectPropertiesProjections()
{
// Driver to display the project props dialog and switch to the
// projections tab
mShowProjectionTab = true;
projectProperties();
// display the project props dialog and switch to the projections tab
projectProperties( QStringLiteral( "mProjOptsCRS" ) );
}

void QgisApp::projectProperties( const QString &currentPage )
Expand All @@ -14412,13 +14410,8 @@ void QgisApp::projectProperties( const QString &currentPage )
}
QgsProjectProperties *pp = new QgsProjectProperties( mMapCanvas, this, QgsGuiUtils::ModalDialogFlags, factories );

// if called from the status bar, show the projection tab
if ( mShowProjectionTab )
{
pp->showProjectionsTab();
mShowProjectionTab = false;
}
qApp->processEvents();

// Be told if the mouse display precision may have changed by the user
// changing things in the project properties dialog box
connect( pp, &QgsProjectProperties::displayPrecisionChanged, this,
Expand Down
2 changes: 0 additions & 2 deletions src/app/qgisapp.h
Expand Up @@ -2520,8 +2520,6 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow

//! QGIS-internal vector feature clipboard
QgsClipboard *mInternalClipboard = nullptr;
//! Flag to indicate how the project properties dialog was summoned
bool mShowProjectionTab = false;

/**
* String containing supporting vector file formats
Expand Down
5 changes: 0 additions & 5 deletions src/app/qgsprojectproperties.cpp
Expand Up @@ -1596,11 +1596,6 @@ void QgsProjectProperties::apply()
}
}

void QgsProjectProperties::showProjectionsTab()
{
mOptionsListWidget->setCurrentRow( 2 );
}

void QgsProjectProperties::lwWmsRowsInserted( const QModelIndex &parent, int first, int last )
{
Q_UNUSED( parent )
Expand Down
5 changes: 0 additions & 5 deletions src/app/qgsprojectproperties.h
Expand Up @@ -79,11 +79,6 @@ class APP_EXPORT QgsProjectProperties : public QgsOptionsDialogBase, private Ui:
*/
void apply();

/**
* Slot to show the projections tab when the dialog is opened
*/
void showProjectionsTab();

/**
* Let the user add a scale to the list of project scales
* used in scale combobox instead of global ones.
Expand Down

0 comments on commit 26a7add

Please sign in to comment.