Skip to content
Permalink
Browse files

[layout][need-docs] Renamed GUI elements from composer to layouts

Also renamed some .ui variables
  • Loading branch information
elpaso authored and nyalldawson committed Jan 11, 2018
1 parent 5522f10 commit 90c07ef04536de1bd31624755ad87116a0083082
Showing with 62 additions and 62 deletions.
  1. +20 −20 src/app/qgsprojectproperties.cpp
  2. +2 −2 src/app/qgsprojectproperties.h
  3. +29 −29 src/ui/qgsoptionsbase.ui
  4. +11 −11 src/ui/qgsprojectpropertiesbase.ui
@@ -54,6 +54,7 @@
#include "qgsunittypes.h"
#include "qgstablewidgetitem.h"
#include "qgslayertree.h"
#include "qgsprintlayout.h"

#include "qgsmessagelog.h"

@@ -82,8 +83,8 @@ QgsProjectProperties::QgsProjectProperties( QgsMapCanvas *mapCanvas, QWidget *pa
connect( pbnWMSAddSRS, &QToolButton::clicked, this, &QgsProjectProperties::pbnWMSAddSRS_clicked );
connect( pbnWMSRemoveSRS, &QToolButton::clicked, this, &QgsProjectProperties::pbnWMSRemoveSRS_clicked );
connect( pbnWMSSetUsedSRS, &QPushButton::clicked, this, &QgsProjectProperties::pbnWMSSetUsedSRS_clicked );
connect( mAddWMSComposerButton, &QToolButton::clicked, this, &QgsProjectProperties::mAddWMSComposerButton_clicked );
connect( mRemoveWMSComposerButton, &QToolButton::clicked, this, &QgsProjectProperties::mRemoveWMSComposerButton_clicked );
connect( mAddWMSPrintLayoutButton, &QToolButton::clicked, this, &QgsProjectProperties::mAddWMSPrintLayoutButton_clicked );
connect( mRemoveWMSPrintLayoutButton, &QToolButton::clicked, this, &QgsProjectProperties::mRemoveWMSPrintLayoutButton_clicked );
connect( mAddLayerRestrictionButton, &QToolButton::clicked, this, &QgsProjectProperties::mAddLayerRestrictionButton_clicked );
connect( mRemoveLayerRestrictionButton, &QToolButton::clicked, this, &QgsProjectProperties::mRemoveLayerRestrictionButton_clicked );
connect( mWMSInspireScenario1, &QGroupBox::toggled, this, &QgsProjectProperties::mWMSInspireScenario1_toggled );
@@ -558,12 +559,12 @@ QgsProjectProperties::QgsProjectProperties( QgsMapCanvas *mapCanvas, QWidget *pa

grpWMSList->setChecked( mWMSList->count() > 0 );

//composer restriction for WMS
//Layout restriction for WMS
values = QgsProject::instance()->readListEntry( QStringLiteral( "WMSRestrictedComposers" ), QStringLiteral( "/" ), QStringList(), &ok );
mWMSComposerGroupBox->setChecked( ok );
mWMSPrintLayoutGroupBox->setChecked( ok );
if ( ok )
{
mComposerListWidget->addItems( values );
mPrintLayoutListWidget->addItems( values );
}

//layer restriction for WMS
@@ -1069,12 +1070,12 @@ void QgsProjectProperties::apply()
}

//WMS composer restrictions
if ( mWMSComposerGroupBox->isChecked() )
if ( mWMSPrintLayoutGroupBox->isChecked() )
{
QStringList composerTitles;
for ( int i = 0; i < mComposerListWidget->count(); ++i )
for ( int i = 0; i < mPrintLayoutListWidget->count(); ++i )
{
composerTitles << mComposerListWidget->item( i )->text();
composerTitles << mPrintLayoutListWidget->item( i )->text();
}
QgsProject::instance()->writeEntry( QStringLiteral( "WMSRestrictedComposers" ), QStringLiteral( "/" ), composerTitles );
}
@@ -1424,33 +1425,32 @@ void QgsProjectProperties::pbnWMSSetUsedSRS_clicked()
mWMSList->addItems( crsList.values() );
}

void QgsProjectProperties::mAddWMSComposerButton_clicked()
void QgsProjectProperties::mAddWMSPrintLayoutButton_clicked()
{
QList<QgsComposition *> projectComposers = QgsProject::instance()->layoutManager()->compositions();
QStringList composerTitles;
QList<QgsComposition *>::const_iterator cIt = projectComposers.constBegin();
for ( ; cIt != projectComposers.constEnd(); ++cIt )
const QList<QgsPrintLayout *> projectLayouts( QgsProject::instance()->layoutManager()->printLayouts() );
QStringList layoutTitles;
for ( const auto &layout : projectLayouts )
{
composerTitles << ( *cIt )->name();
layoutTitles << layout->name();
}

bool ok;
QString name = QInputDialog::getItem( this, tr( "Select print composer" ), tr( "Composer Title" ), composerTitles, 0, false, &ok );
QString name = QInputDialog::getItem( this, tr( "Select layout" ), tr( "Layout Title" ), layoutTitles, 0, false, &ok );
if ( ok )
{
if ( mComposerListWidget->findItems( name, Qt::MatchExactly ).empty() )
if ( mPrintLayoutListWidget->findItems( name, Qt::MatchExactly ).empty() )
{
mComposerListWidget->addItem( name );
mPrintLayoutListWidget->addItem( name );
}
}
}

void QgsProjectProperties::mRemoveWMSComposerButton_clicked()
void QgsProjectProperties::mRemoveWMSPrintLayoutButton_clicked()
{
QListWidgetItem *currentItem = mComposerListWidget->currentItem();
QListWidgetItem *currentItem = mPrintLayoutListWidget->currentItem();
if ( currentItem )
{
delete mComposerListWidget->takeItem( mComposerListWidget->row( currentItem ) );
delete mPrintLayoutListWidget->takeItem( mPrintLayoutListWidget->row( currentItem ) );
}
}

@@ -95,8 +95,8 @@ class APP_EXPORT QgsProjectProperties : public QgsOptionsDialogBase, private Ui:
void pbnWMSAddSRS_clicked();
void pbnWMSRemoveSRS_clicked();
void pbnWMSSetUsedSRS_clicked();
void mAddWMSComposerButton_clicked();
void mRemoveWMSComposerButton_clicked();
void mAddWMSPrintLayoutButton_clicked();
void mRemoveWMSPrintLayoutButton_clicked();
void mAddLayerRestrictionButton_clicked();
void mRemoveLayerRestrictionButton_clicked();
void mWMSInspireScenario1_toggled( bool on );
@@ -205,10 +205,10 @@
</item>
<item>
<property name="text">
<string>Composer</string>
<string>Layouts</string>
</property>
<property name="toolTip">
<string>Composer</string>
<string>Print layouts</string>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
@@ -320,7 +320,7 @@
<item>
<widget class="QStackedWidget" name="mOptionsStackedWidget">
<property name="currentIndex">
<number>0</number>
<number>9</number>
</property>
<widget class="QWidget" name="mOptionsPageGeneral">
<layout class="QVBoxLayout" name="verticalLayout_3">
@@ -349,8 +349,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>855</width>
<height>827</height>
<width>866</width>
<height>822</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_28">
@@ -1044,8 +1044,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>839</width>
<height>1042</height>
<width>846</width>
<height>1128</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_22">
@@ -1580,8 +1580,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>855</width>
<height>827</height>
<width>866</width>
<height>822</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_15">
@@ -1747,8 +1747,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>855</width>
<height>827</height>
<width>866</width>
<height>822</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_27">
@@ -2115,8 +2115,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>839</width>
<height>982</height>
<width>846</width>
<height>1043</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_22">
@@ -2866,8 +2866,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>855</width>
<height>827</height>
<width>866</width>
<height>822</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_25">
@@ -3123,8 +3123,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>855</width>
<height>827</height>
<width>866</width>
<height>822</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_30">
@@ -3567,8 +3567,8 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
<rect>
<x>0</x>
<y>0</y>
<width>855</width>
<height>827</height>
<width>866</width>
<height>822</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_46">
@@ -3718,8 +3718,8 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
<rect>
<x>0</x>
<y>0</y>
<width>855</width>
<height>827</height>
<width>846</width>
<height>855</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_31">
@@ -4313,8 +4313,8 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
<rect>
<x>0</x>
<y>0</y>
<width>855</width>
<height>827</height>
<width>866</width>
<height>822</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_39">
@@ -4324,7 +4324,7 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
<bool>true</bool>
</property>
<property name="title">
<string>Composition defaults</string>
<string>Layout defaults</string>
</property>
<layout class="QGridLayout" name="gridLayout_8">
<item row="1" column="0">
@@ -4472,7 +4472,7 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
<item>
<widget class="QgsCollapsibleGroupBox" name="groupBox_27">
<property name="title">
<string>Composer Paths</string>
<string>Layout Paths</string>
</property>
<layout class="QGridLayout" name="_7">
<item row="0" column="0">
@@ -4582,8 +4582,8 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
<rect>
<x>0</x>
<y>0</y>
<width>855</width>
<height>827</height>
<width>866</width>
<height>822</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
@@ -4751,8 +4751,8 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
<rect>
<x>0</x>
<y>0</y>
<width>855</width>
<height>827</height>
<width>617</width>
<height>786</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_33">
@@ -1901,9 +1901,9 @@
</widget>
</item>
<item row="2" column="0">
<widget class="QgsCollapsibleGroupBox" name="mWMSComposerGroupBox">
<widget class="QgsCollapsibleGroupBox" name="mWMSPrintLayoutGroupBox">
<property name="title">
<string>Exclude composers</string>
<string>Exclude layouts</string>
</property>
<property name="checkable">
<bool>true</bool>
@@ -1919,12 +1919,12 @@
</property>
<layout class="QGridLayout" name="gridLayout_10">
<item row="0" column="0" colspan="3">
<widget class="QListWidget" name="mComposerListWidget"/>
<widget class="QListWidget" name="mPrintLayoutListWidget"/>
</item>
<item row="1" column="0">
<widget class="QToolButton" name="mAddWMSComposerButton">
<widget class="QToolButton" name="mAddWMSPrintLayoutButton">
<property name="toolTip">
<string>Add composer to exclude</string>
<string>Add layout to exclude</string>
</property>
<property name="text">
<string/>
@@ -1936,9 +1936,9 @@
</widget>
</item>
<item row="1" column="1">
<widget class="QToolButton" name="mRemoveWMSComposerButton">
<widget class="QToolButton" name="mRemoveWMSPrintLayoutButton">
<property name="toolTip">
<string>Remove selected composer</string>
<string>Remove selected layout</string>
</property>
<property name="text">
<string/>
@@ -2783,10 +2783,10 @@
<tabstop>pbnWMSRemoveSRS</tabstop>
<tabstop>pbnWMSSetUsedSRS</tabstop>
<tabstop>mWMSList</tabstop>
<tabstop>mWMSComposerGroupBox</tabstop>
<tabstop>mAddWMSComposerButton</tabstop>
<tabstop>mRemoveWMSComposerButton</tabstop>
<tabstop>mComposerListWidget</tabstop>
<tabstop>mWMSPrintLayoutGroupBox</tabstop>
<tabstop>mAddWMSPrintLayoutButton</tabstop>
<tabstop>mRemoveWMSPrintLayoutButton</tabstop>
<tabstop>mPrintLayoutListWidget</tabstop>
<tabstop>mLayerRestrictionsGroupBox</tabstop>
<tabstop>mAddLayerRestrictionButton</tabstop>
<tabstop>mRemoveLayerRestrictionButton</tabstop>

0 comments on commit 90c07ef

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