Skip to content

Commit

Permalink
[addlayerbutton] Added option for modeless layer dialog (default false)
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Jun 2, 2017
1 parent 43a3ac7 commit e43dfa2
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 27 deletions.
9 changes: 8 additions & 1 deletion src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1605,7 +1605,14 @@ void QgisApp::dataSourceManager()
connect( mDataSourceManagerDialog, &QgsDataSourceManagerDialog::replaceSelectedVectorLayer, this, &QgisApp::replaceSelectedVectorLayer );
connect( mDataSourceManagerDialog, static_cast<void ( QgsDataSourceManagerDialog::* )()>( &QgsDataSourceManagerDialog::addRasterLayer ), this, static_cast<void ( QgisApp::* )()>( &QgisApp::addRasterLayer ) );
}
mDataSourceManagerDialog->exec();
if ( QgsSettings().value( "/qgis/dataSourceManagerNonModal", true ).toBool( ) )
{
mDataSourceManagerDialog->show();
}
else
{
mDataSourceManagerDialog->exec();
}
}

QgisAppStyleSheet *QgisApp::styleSheetBuilder()
Expand Down
2 changes: 2 additions & 0 deletions src/app/qgsoptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
mLegendGroupsBoldChkBx->setChecked( mSettings->value( QStringLiteral( "/qgis/legendGroupsBold" ), false ).toBool() );
cbxHideSplash->setChecked( mSettings->value( QStringLiteral( "/qgis/hideSplash" ), false ).toBool() );
cbxShowTips->setChecked( mSettings->value( QStringLiteral( "/qgis/showTips%1" ).arg( Qgis::QGIS_VERSION_INT / 100 ), true ).toBool() );
mDataSourceManagerNonModal->setChecked( mSettings->value( "/qgis/dataSourceManagerNonModal", false ).toBool() );
cbxCheckVersion->setChecked( mSettings->value( QStringLiteral( "/qgis/checkVersion" ), true ).toBool() );
cbxAttributeTableDocked->setChecked( mSettings->value( QStringLiteral( "/qgis/dockAttributeTable" ), false ).toBool() );
cbxAddPostgisDC->setChecked( mSettings->value( QStringLiteral( "/qgis/addPostgisDC" ), false ).toBool() );
Expand Down Expand Up @@ -1208,6 +1209,7 @@ void QgsOptions::saveOptions()
mSettings->setValue( QStringLiteral( "/qgis/legendGroupsBold" ), mLegendGroupsBoldChkBx->isChecked() );
mSettings->setValue( QStringLiteral( "/qgis/hideSplash" ), cbxHideSplash->isChecked() );
mSettings->setValue( QStringLiteral( "/qgis/showTips%1" ).arg( Qgis::QGIS_VERSION_INT / 100 ), cbxShowTips->isChecked() );
mSettings->setValue( QStringLiteral( "/qgis/dataSourceManagerNonModal" ), mDataSourceManagerNonModal->isChecked() );
mSettings->setValue( QStringLiteral( "/qgis/checkVersion" ), cbxCheckVersion->isChecked() );
mSettings->setValue( QStringLiteral( "/qgis/dockAttributeTable" ), cbxAttributeTableDocked->isChecked() );
mSettings->setValue( QStringLiteral( "/qgis/attributeTableBehavior" ), cmbAttrTableBehavior->currentData() );
Expand Down
59 changes: 33 additions & 26 deletions src/ui/qgsoptionsbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>843</width>
<height>702</height>
<width>857</width>
<height>678</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_28">
Expand Down Expand Up @@ -666,6 +666,13 @@
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_30">
<item>
<widget class="QCheckBox" name="mDataSourceManagerNonModal">
<property name="text">
<string>Modeless data source manager dialog</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="mCustomGroupBoxChkBx">
<property name="text">
Expand Down Expand Up @@ -1035,8 +1042,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>579</width>
<height>1110</height>
<width>561</width>
<height>1079</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_22">
Expand Down Expand Up @@ -1565,8 +1572,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>531</width>
<height>787</height>
<width>511</width>
<height>719</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_27">
Expand Down Expand Up @@ -1933,8 +1940,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>713</width>
<height>1110</height>
<width>692</width>
<height>994</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_22">
Expand Down Expand Up @@ -2684,8 +2691,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>151</width>
<height>239</height>
<width>146</width>
<height>241</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_46">
Expand Down Expand Up @@ -2835,8 +2842,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>523</width>
<height>370</height>
<width>514</width>
<height>334</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_25">
Expand Down Expand Up @@ -3178,8 +3185,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>640</width>
<height>660</height>
<width>625</width>
<height>612</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_30">
Expand Down Expand Up @@ -3622,8 +3629,8 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
<rect>
<x>0</x>
<y>0</y>
<width>509</width>
<height>623</height>
<width>487</width>
<height>588</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_39">
Expand Down Expand Up @@ -3891,8 +3898,8 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
<rect>
<x>0</x>
<y>0</y>
<width>572</width>
<height>828</height>
<width>556</width>
<height>740</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_31">
Expand Down Expand Up @@ -4469,8 +4476,8 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
<rect>
<x>0</x>
<y>0</y>
<width>435</width>
<height>402</height>
<width>427</width>
<height>380</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
Expand Down Expand Up @@ -4608,8 +4615,8 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
<rect>
<x>0</x>
<y>0</y>
<width>437</width>
<height>584</height>
<width>429</width>
<height>549</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_15">
Expand Down Expand Up @@ -4821,8 +4828,8 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
<rect>
<x>0</x>
<y>0</y>
<width>292</width>
<height>258</height>
<width>282</width>
<height>234</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_32">
Expand Down Expand Up @@ -4930,8 +4937,8 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
<rect>
<x>0</x>
<y>0</y>
<width>534</width>
<height>790</height>
<width>509</width>
<height>723</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_33">
Expand Down

0 comments on commit e43dfa2

Please sign in to comment.