Skip to content
Permalink
Browse files

Standardize capitalization, use modern stable method to populate

and set combobox values
  • Loading branch information
nyalldawson committed Jan 13, 2020
1 parent f64d9c1 commit 12fb06b3832fb0da6b20c3062fad0d42f3706d8d
@@ -77,18 +77,27 @@ QgsLayoutAttributeTableWidget::QgsLayoutAttributeTableWidget( QgsLayoutFrame *fr

blockAllSignals( true );

mResizeModeComboBox->addItem( tr( "Use existing frames" ), QgsLayoutMultiFrame::UseExistingFrames );
mResizeModeComboBox->addItem( tr( "Extend to next page" ), QgsLayoutMultiFrame::ExtendToNextPage );
mResizeModeComboBox->addItem( tr( "Repeat until finished" ), QgsLayoutMultiFrame::RepeatUntilFinished );
mResizeModeComboBox->addItem( tr( "Use Existing Frames" ), QgsLayoutMultiFrame::UseExistingFrames );
mResizeModeComboBox->addItem( tr( "Extend to Next Page" ), QgsLayoutMultiFrame::ExtendToNextPage );
mResizeModeComboBox->addItem( tr( "Repeat Until Finished" ), QgsLayoutMultiFrame::RepeatUntilFinished );

mEmptyModeComboBox->addItem( tr( "Draw headers only" ), QgsLayoutTable::HeadersOnly );
mEmptyModeComboBox->addItem( tr( "Hide entire table" ), QgsLayoutTable::HideTable );
mEmptyModeComboBox->addItem( tr( "Show set message" ), QgsLayoutTable::ShowMessage );
mEmptyModeComboBox->addItem( tr( "Draw Headers Only" ), QgsLayoutTable::HeadersOnly );
mEmptyModeComboBox->addItem( tr( "Hide Entire Table" ), QgsLayoutTable::HideTable );
mEmptyModeComboBox->addItem( tr( "Show Set Message" ), QgsLayoutTable::ShowMessage );

mWrapBehaviorComboBox->addItem( tr( "Truncate text" ), QgsLayoutTable::TruncateText );
mWrapBehaviorComboBox->addItem( tr( "Wrap text" ), QgsLayoutTable::WrapText );
mWrapBehaviorComboBox->addItem( tr( "Truncate Text" ), QgsLayoutTable::TruncateText );
mWrapBehaviorComboBox->addItem( tr( "Wrap Text" ), QgsLayoutTable::WrapText );

mSourceComboBox->addItem( tr( "Layer features" ), QgsLayoutItemAttributeTable::LayerAttributes );
mHeaderModeComboBox->addItem( tr( "On First Frame" ), QgsLayoutTable::FirstFrame );
mHeaderModeComboBox->addItem( tr( "On All Frames" ), QgsLayoutTable::AllFrames );
mHeaderModeComboBox->addItem( tr( "No Header" ), QgsLayoutTable::NoHeaders );

mHeaderHAlignmentComboBox->addItem( tr( "Follow Column Alignment" ), QgsLayoutTable::FollowColumn );
mHeaderHAlignmentComboBox->addItem( tr( "Left" ), QgsLayoutTable::HeaderLeft );
mHeaderHAlignmentComboBox->addItem( tr( "Center" ), QgsLayoutTable::HeaderCenter );
mHeaderHAlignmentComboBox->addItem( tr( "Right" ), QgsLayoutTable::HeaderRight );

mSourceComboBox->addItem( tr( "Layer Features" ), QgsLayoutItemAttributeTable::LayerAttributes );
toggleAtlasSpecificControls( static_cast< bool >( coverageLayer() ) );

//update relations combo when relations modified in project
@@ -156,7 +165,7 @@ void QgsLayoutAttributeTableWidget::setReportTypeString( const QString &string )
const int atlasFeatureIndex = mSourceComboBox->findData( QgsLayoutItemAttributeTable::AtlasFeature );
if ( atlasFeatureIndex != -1 )
{
mSourceComboBox->setItemText( atlasFeatureIndex, tr( "Current %1 feature" ).arg( string ) );
mSourceComboBox->setItemText( atlasFeatureIndex, tr( "Current %1 Feature" ).arg( string ) );
}
}

@@ -479,8 +488,8 @@ void QgsLayoutAttributeTableWidget::updateGuiElements()
mFeatureFilterButton->setEnabled( mTable->filterFeatures() );
mUseConditionalStylingCheckBox->setChecked( mTable->useConditionalStyling() );

mHeaderHAlignmentComboBox->setCurrentIndex( static_cast<int>( mTable->headerHAlignment() ) );
mHeaderModeComboBox->setCurrentIndex( static_cast<int>( mTable->headerMode() ) );
mHeaderHAlignmentComboBox->setCurrentIndex( mHeaderHAlignmentComboBox->findData( mTable->headerHAlignment() ) );
mHeaderModeComboBox->setCurrentIndex( mHeaderModeComboBox->findData( mTable->headerMode() ) );

mEmptyModeComboBox->setCurrentIndex( mEmptyModeComboBox->findData( mTable->emptyTableBehavior() ) );
mEmptyMessageLineEdit->setText( mTable->emptyTableMessage() );
@@ -566,12 +575,12 @@ void QgsLayoutAttributeTableWidget::toggleAtlasSpecificControls( const bool atla
if ( mSourceComboBox->findData( QgsLayoutItemAttributeTable::AtlasFeature ) == -1 )
{
//add missing atlasfeature option to combobox
mSourceComboBox->addItem( tr( "Current atlas feature" ), QgsLayoutItemAttributeTable::AtlasFeature );
mSourceComboBox->addItem( tr( "Current Atlas Feature" ), QgsLayoutItemAttributeTable::AtlasFeature );
}
if ( mSourceComboBox->findData( QgsLayoutItemAttributeTable::RelationChildren ) == -1 )
{
//add missing relation children option to combobox
mSourceComboBox->addItem( tr( "Relation children" ), QgsLayoutItemAttributeTable::RelationChildren );
mSourceComboBox->addItem( tr( "Relation Children" ), QgsLayoutItemAttributeTable::RelationChildren );
}

//add relations for coverage layer
@@ -751,27 +760,27 @@ void QgsLayoutAttributeTableWidget::mFeatureFilterButton_clicked()
}
}

void QgsLayoutAttributeTableWidget::mHeaderHAlignmentComboBox_currentIndexChanged( int index )
void QgsLayoutAttributeTableWidget::mHeaderHAlignmentComboBox_currentIndexChanged( int )
{
if ( !mTable )
{
return;
}

mTable->beginCommand( tr( "Change Table Alignment" ) );
mTable->setHeaderHAlignment( static_cast< QgsLayoutTable::HeaderHAlignment >( index ) );
mTable->setHeaderHAlignment( static_cast< QgsLayoutTable::HeaderHAlignment >( mHeaderHAlignmentComboBox->currentData().toInt() ) );
mTable->endCommand();
}

void QgsLayoutAttributeTableWidget::mHeaderModeComboBox_currentIndexChanged( int index )
void QgsLayoutAttributeTableWidget::mHeaderModeComboBox_currentIndexChanged( int )
{
if ( !mTable )
{
return;
}

mTable->beginCommand( tr( "Change Table Header Mode" ) );
mTable->setHeaderMode( ( QgsLayoutTable::HeaderMode )index );
mTable->setHeaderMode( static_cast< QgsLayoutTable::HeaderMode >( mHeaderModeComboBox->currentData().toInt() ) );
mTable->endCommand();
}

@@ -59,10 +59,10 @@ QgsLayoutHtmlWidget::QgsLayoutHtmlWidget( QgsLayoutFrame *frame )
stylesheetEditorLayout->addWidget( mStylesheetEditor );

blockSignals( true );
mResizeModeComboBox->addItem( tr( "Use existing frames" ), QgsLayoutMultiFrame::UseExistingFrames );
mResizeModeComboBox->addItem( tr( "Extend to next page" ), QgsLayoutMultiFrame::ExtendToNextPage );
mResizeModeComboBox->addItem( tr( "Repeat on every page" ), QgsLayoutMultiFrame::RepeatOnEveryPage );
mResizeModeComboBox->addItem( tr( "Repeat until finished" ), QgsLayoutMultiFrame::RepeatUntilFinished );
mResizeModeComboBox->addItem( tr( "Use Existing Frames" ), QgsLayoutMultiFrame::UseExistingFrames );
mResizeModeComboBox->addItem( tr( "Extend to Next Page" ), QgsLayoutMultiFrame::ExtendToNextPage );
mResizeModeComboBox->addItem( tr( "Repeat on Every Page" ), QgsLayoutMultiFrame::RepeatOnEveryPage );
mResizeModeComboBox->addItem( tr( "Repeat Until Finished" ), QgsLayoutMultiFrame::RepeatUntilFinished );
blockSignals( false );
setGuiElementValues();

@@ -54,12 +54,12 @@ QgsLayoutManualTableWidget::QgsLayoutManualTableWidget( QgsLayoutFrame *frame )

blockAllSignals( true );

mResizeModeComboBox->addItem( tr( "Use existing frames" ), QgsLayoutMultiFrame::UseExistingFrames );
mResizeModeComboBox->addItem( tr( "Extend to next page" ), QgsLayoutMultiFrame::ExtendToNextPage );
mResizeModeComboBox->addItem( tr( "Repeat until finished" ), QgsLayoutMultiFrame::RepeatUntilFinished );
mResizeModeComboBox->addItem( tr( "Use Existing Frames" ), QgsLayoutMultiFrame::UseExistingFrames );
mResizeModeComboBox->addItem( tr( "Extend to Next Page" ), QgsLayoutMultiFrame::ExtendToNextPage );
mResizeModeComboBox->addItem( tr( "Repeat Until Finished" ), QgsLayoutMultiFrame::RepeatUntilFinished );

mWrapBehaviorComboBox->addItem( tr( "Truncate text" ), QgsLayoutTable::TruncateText );
mWrapBehaviorComboBox->addItem( tr( "Wrap text" ), QgsLayoutTable::WrapText );
mWrapBehaviorComboBox->addItem( tr( "Truncate Text" ), QgsLayoutTable::TruncateText );
mWrapBehaviorComboBox->addItem( tr( "Wrap Text" ), QgsLayoutTable::WrapText );

mContentFontColorButton->setColorDialogTitle( tr( "Select Content Font Color" ) );
mContentFontColorButton->setAllowOpacity( true );
@@ -276,23 +276,7 @@
<widget class="QComboBox" name="mEmptyModeComboBox"/>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="mHeaderModeComboBox">
<item>
<property name="text">
<string>On first frame</string>
</property>
</item>
<item>
<property name="text">
<string>On all frames</string>
</property>
</item>
<item>
<property name="text">
<string>No header</string>
</property>
</item>
</widget>
<widget class="QComboBox" name="mHeaderModeComboBox"/>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_11">
@@ -611,26 +595,6 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>Follow column alignment</string>
</property>
</item>
<item>
<property name="text">
<string>Left</string>
</property>
</item>
<item>
<property name="text">
<string>Center</string>
</property>
</item>
<item>
<property name="text">
<string>Right</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
@@ -656,7 +620,7 @@
</sizepolicy>
</property>
<property name="text">
<string>Heading font</string>
<string>Heading Font</string>
</property>
</widget>
</item>
@@ -728,7 +692,7 @@
</sizepolicy>
</property>
<property name="text">
<string>Contents font</string>
<string>Contents Font</string>
</property>
</widget>
</item>
@@ -365,7 +365,7 @@
</sizepolicy>
</property>
<property name="text">
<string>Contents font</string>
<string>Contents Font</string>
</property>
</widget>
</item>

0 comments on commit 12fb06b

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