Skip to content
Permalink
Browse files

make canvas rotation support available in options

  • Loading branch information
jef-n committed Dec 30, 2014
1 parent bff64fd commit 916a27f7b96da3887e095d13682de6d9fe3cd04e
Showing with 47 additions and 38 deletions.
  1. +3 −3 src/app/qgisapp.cpp
  2. +2 −0 src/app/qgsoptions.cpp
  3. +42 −35 src/ui/qgsoptionsbase.ui
@@ -1750,7 +1750,8 @@ void QgisApp::createStatusBar()
statusBar()->addPermanentWidget( mScaleEdit, 0 );
connect( mScaleEdit, SIGNAL( scaleChanged() ), this, SLOT( userScale() ) );

if ( getenv( "QGIS_ENABLE_CANVAS_ROTATION" ) ) {
if ( QSettings().value( "/qgis/canvasRotation", false ).toBool() )
{
// add a widget to show/set current rotation
mRotationLabel = new QLabel( QString(), statusBar() );
mRotationLabel->setObjectName( "mRotationLabel" );
@@ -1785,7 +1786,6 @@ void QgisApp::createStatusBar()
showRotation();
}


// render suppression status bar widget
mRenderSuppressionCBox = new QCheckBox( tr( "Render" ), statusBar() );
mRenderSuppressionCBox->setObjectName( "mRenderSuppressionCBox" );
@@ -3559,7 +3559,7 @@ void QgisApp::fileNew( bool thePromptToSaveFlag, bool forceBlank )
mMapCanvas->freeze( false );
mMapCanvas->refresh();
mMapCanvas->clearExtentHistory();
mMapCanvas->setRotation(0.0);
mMapCanvas->setRotation( 0.0 );
mScaleEdit->updateScales();

// set project CRS
@@ -585,6 +585,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl ) :
cbxCopyWKTGeomFromTable->setChecked( settings.value( "/qgis/copyGeometryAsWKT", true ).toBool() );
leNullValue->setText( settings.value( "qgis/nullValue", "NULL" ).toString() );
cbxIgnoreShapeEncoding->setChecked( settings.value( "/qgis/ignoreShapeEncoding", true ).toBool() );
cbxCanvasRotation->setChecked( settings.value( "/qgis/canvasRotation", false ).toBool() );

cmbLegendDoubleClickAction->setCurrentIndex( settings.value( "/qgis/legendDoubleClickAction", 0 ).toInt() );

@@ -1112,6 +1113,7 @@ void QgsOptions::saveOptions()
settings.setValue( "/qgis/legendDoubleClickAction", cmbLegendDoubleClickAction->currentIndex() );
bool legendLayersCapitalise = settings.value( "/qgis/capitaliseLayerName", false ).toBool();
settings.setValue( "/qgis/capitaliseLayerName", capitaliseCheckBox->isChecked() );
settings.setValue( "/qgis/canvasRotation", cbxCanvasRotation->isChecked() );

// Default simplify drawing configuration
QgsVectorSimplifyMethod::SimplifyHints simplifyHints = QgsVectorSimplifyMethod::NoSimplification;
@@ -283,8 +283,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>610</width>
<height>670</height>
<width>612</width>
<height>594</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_28">
@@ -648,6 +648,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbxCanvasRotation">
<property name="text">
<string>Experimental canvas rotation support (restart required)</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
@@ -954,8 +961,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>655</width>
<height>862</height>
<width>614</width>
<height>855</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_22">
@@ -1150,10 +1157,10 @@
<property name="title">
<string>Current environment variables (read-only - bold indicates modified at startup)</string>
</property>
<property name="collapsed" stdset="0">
<property name="collapsed">
<bool>false</bool>
</property>
<property name="saveCollapsedState" stdset="0">
<property name="saveCollapsedState">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_8">
@@ -1329,8 +1336,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>531</width>
<height>440</height>
<width>504</width>
<height>383</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_27">
@@ -1639,8 +1646,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>710</width>
<height>796</height>
<width>665</width>
<height>699</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_29">
@@ -2278,8 +2285,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>239</width>
<height>258</height>
<width>203</width>
<height>252</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_46">
@@ -2374,8 +2381,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>526</width>
<height>327</height>
<width>509</width>
<height>302</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_25">
@@ -2703,8 +2710,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>684</width>
<height>625</height>
<width>638</width>
<height>576</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_30">
@@ -3199,8 +3206,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>504</width>
<height>307</height>
<width>469</width>
<height>288</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_39">
@@ -3395,8 +3402,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>501</width>
<height>640</height>
<width>473</width>
<height>566</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_31">
@@ -3886,8 +3893,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>462</width>
<height>372</height>
<width>422</width>
<height>362</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
@@ -4016,8 +4023,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>650</width>
<height>707</height>
<width>595</width>
<height>680</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_15">
@@ -4270,8 +4277,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>300</width>
<height>226</height>
<width>283</width>
<height>210</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_32">
@@ -4360,8 +4367,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>531</width>
<height>685</height>
<width>487</width>
<height>595</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_33">
@@ -4510,10 +4517,10 @@
<property name="checkable">
<bool>true</bool>
</property>
<property name="collapsed" stdset="0">
<property name="collapsed">
<bool>false</bool>
</property>
<property name="saveCollapsedState" stdset="0">
<property name="saveCollapsedState">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout_1">
@@ -4711,17 +4718,17 @@
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
<class>QgsColorButtonV2</class>
<extends>QToolButton</extends>
<header>qgscolorbuttonv2.h</header>
</customwidget>
<customwidget>
<class>QgsCollapsibleGroupBox</class>
<extends>QGroupBox</extends>
<header>qgscollapsiblegroupbox.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsColorButtonV2</class>
<extends>QToolButton</extends>
<header>qgscolorbuttonv2.h</header>
</customwidget>
<customwidget>
<class>QgsColorSchemeList</class>
<extends>QTreeView</extends>

3 comments on commit 916a27f

@strk

This comment has been minimized.

Copy link
Contributor

@strk strk replied Jan 1, 2015

Thanks for this, but there's another place to tweak:

src/gui/qgsmapcanvas.cpp:902:  if ( ! getenv( "QGIS_ENABLE_CANVAS_ROTATION" ) ) return;

That's to avoid loading a project with a canvas rotation value and getting stuck with that rotation
(not sure it makes sense).

@strk

This comment has been minimized.

Copy link
Contributor

@strk strk replied Jan 1, 2015

2b7e49b fixes it, thanks :)

@dakcarto

This comment has been minimized.

Copy link
Member

@dakcarto dakcarto replied Jan 1, 2015

Hi @jef-n. Do you think it would be better to have this option under the Rendering or Canvas and Legend tab instead of General in the Options dialog?

Please sign in to comment.
You can’t perform that action at this time.