Skip to content

Commit f9a6f0a

Browse files
committed
raster properties pipe tab removed
1 parent ea694c7 commit f9a6f0a

File tree

3 files changed

+17
-209
lines changed

3 files changed

+17
-209
lines changed

src/app/qgsrasterlayerproperties.cpp

Lines changed: 0 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,6 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer* lyr, QgsMapCanv
382382
}
383383
on_mRenderTypeComboBox_currentIndexChanged( mRenderTypeComboBox->currentIndex() );
384384

385-
updatePipeList();
386-
387385
// update based on lyr's current state
388386
sync();
389387

@@ -902,8 +900,6 @@ void QgsRasterLayerProperties::apply()
902900

903901
// notify the project we've made a change
904902
QgsProject::instance()->dirty( true );
905-
906-
updatePipeList();
907903
}//apply
908904

909905
void QgsRasterLayerProperties::on_mLayerOrigNameLineEd_textEdited( const QString& text )
@@ -1691,107 +1687,6 @@ void QgsRasterLayerProperties::toggleBuildPyramidsButton()
16911687
}
16921688
}
16931689

1694-
void QgsRasterLayerProperties::updatePipeList()
1695-
{
1696-
QgsDebugMsg( "Entered" );
1697-
1698-
#ifndef QGISDEBUG
1699-
mOptionsStackedWidget->removeWidget( mOptsPage_Pipe ); // just delete instead?
1700-
#else
1701-
mPipeTreeWidget->clear();
1702-
1703-
mPipeTreeWidget->header()->setResizeMode( QHeaderView::ResizeToContents );
1704-
1705-
if ( mPipeTreeWidget->columnCount() <= 1 )
1706-
{
1707-
QStringList labels;
1708-
labels << tr( "Filter" ) << tr( "Bands" );
1709-
mPipeTreeWidget->setHeaderLabels( labels );
1710-
connect( mPipeTreeWidget, SIGNAL( itemClicked( QTreeWidgetItem *, int ) ), this, SLOT( pipeItemClicked( QTreeWidgetItem *, int ) ) );
1711-
}
1712-
1713-
QgsRasterPipe *pipe = mRasterLayer->pipe();
1714-
for ( int i = 0; i < pipe->size(); i++ )
1715-
{
1716-
QgsRasterInterface * interface = pipe->at( i );
1717-
QStringList texts;
1718-
QString name;
1719-
// Unfortunately at this moment not all interfaces inherits from QObject
1720-
QObject *o = dynamic_cast<QObject*>( interface );
1721-
if ( o )
1722-
{
1723-
//name = o->objectName(); // gives empty with provider
1724-
name = o->metaObject()->className();
1725-
}
1726-
else
1727-
{
1728-
name = QString( typeid( *interface ).name() ).replace( QRegExp( ".*Qgs" ), "Qgs" );
1729-
}
1730-
1731-
texts << name << QString( "%1" ).arg( interface->bandCount() );
1732-
//texts << QString( "%1 ms" ).arg( interface->time() );
1733-
QTreeWidgetItem *item = new QTreeWidgetItem( texts );
1734-
1735-
#if 0
1736-
// Switching on/off would be possible but problematic - drawer is not pipe
1737-
// memer so we don't know required output format
1738-
// Checkboxes are very useful however for QgsRasterPipe debugging.
1739-
bool on = interface->on();
1740-
item->setCheckState( 0, on ? Qt::Checked : Qt::Unchecked );
1741-
1742-
Qt::ItemFlags flags = Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDragEnabled;
1743-
#endif
1744-
Qt::ItemFlags flags = Qt::ItemIsEnabled;
1745-
item->setFlags( flags );
1746-
1747-
mPipeTreeWidget->addTopLevelItem( item );
1748-
}
1749-
updatePipeItems();
1750-
#endif
1751-
}
1752-
1753-
void QgsRasterLayerProperties::pipeItemClicked( QTreeWidgetItem * item, int column )
1754-
{
1755-
Q_UNUSED( column );
1756-
QgsDebugMsg( "Entered" );
1757-
int idx = mPipeTreeWidget->indexOfTopLevelItem( item );
1758-
1759-
// This should not fail because we have enabled only checkboxes of items
1760-
// which may be changed
1761-
mRasterLayer->pipe()->setOn( idx, item->checkState( 0 ) );
1762-
1763-
updatePipeItems();
1764-
}
1765-
1766-
void QgsRasterLayerProperties::updatePipeItems()
1767-
{
1768-
QgsDebugMsg( "Entered" );
1769-
1770-
QgsRasterPipe *pipe = mRasterLayer->pipe();
1771-
1772-
for ( int i = 0; i < pipe->size(); i++ )
1773-
{
1774-
if ( i >= mPipeTreeWidget->topLevelItemCount() ) break;
1775-
QTreeWidgetItem *item = mPipeTreeWidget->topLevelItem( i );
1776-
if ( !item ) continue;
1777-
// Checkboxes disabled for now, see above
1778-
#if 0
1779-
QgsRasterInterface * iface = pipe->at( i );
1780-
bool on = iface->on();
1781-
Qt::ItemFlags flags = item->flags();
1782-
if ( pipe->canSetOn( i, !on ) )
1783-
{
1784-
flags |= Qt::ItemIsUserCheckable;
1785-
}
1786-
else
1787-
{
1788-
flags |= ( Qt::ItemFlags )~Qt::ItemIsUserCheckable;
1789-
}
1790-
item->setFlags( flags );
1791-
#endif
1792-
}
1793-
}
1794-
17951690
void QgsRasterLayerProperties::on_mMinimumScaleSetCurrentPushButton_clicked()
17961691
{
17971692
cbMinimumScale->setScale( 1.0 / QgisApp::instance()->mapCanvas()->mapRenderer()->scale() );

src/app/qgsrasterlayerproperties.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,6 @@ class QgsRasterLayerProperties : public QgsOptionsDialogBase, private Ui::QgsRas
115115
/**Enable or disable colorize controls depending on checkbox */
116116
void toggleColorizeControls( bool colorizeEnabled );
117117

118-
/** Update items in pipe list */
119-
void pipeItemClicked( QTreeWidgetItem * item, int column );
120-
121118
/** Transparency cell changed */
122119
void transparencyCellTextEdited( const QString & text );
123120

@@ -181,12 +178,6 @@ class QgsRasterLayerProperties : public QgsOptionsDialogBase, private Ui::QgsRas
181178
qreal mGradientHeight;
182179
qreal mGradientWidth;
183180

184-
/** Update pipe tab - interfaces list */
185-
void updatePipeList();
186-
187-
/** Update items in pipe list */
188-
void updatePipeItems();
189-
190181
QgsMapCanvas* mMapCanvas;
191182
QgsMapToolEmitPoint* mPixelSelectorTool;
192183

src/ui/qgsrasterlayerpropertiesbase.ui

Lines changed: 17 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -152,18 +152,6 @@
152152
<normaloff>:/images/themes/default/propertyicons/histogram.png</normaloff>:/images/themes/default/propertyicons/histogram.png</iconset>
153153
</property>
154154
</item>
155-
<item>
156-
<property name="text">
157-
<string>Pipe</string>
158-
</property>
159-
<property name="toolTip">
160-
<string>Pipe</string>
161-
</property>
162-
<property name="icon">
163-
<iconset resource="../../images/images.qrc">
164-
<normaloff>:/images/themes/default/propertyicons/action.png</normaloff>:/images/themes/default/propertyicons/action.png</iconset>
165-
</property>
166-
</item>
167155
</widget>
168156
</item>
169157
</layout>
@@ -194,7 +182,7 @@
194182
</sizepolicy>
195183
</property>
196184
<property name="currentIndex">
197-
<number>0</number>
185+
<number>2</number>
198186
</property>
199187
<widget class="QWidget" name="mOptsPage_General">
200188
<layout class="QVBoxLayout" name="verticalLayout_6">
@@ -224,8 +212,8 @@
224212
<rect>
225213
<x>0</x>
226214
<y>0</y>
227-
<width>693</width>
228-
<height>646</height>
215+
<width>713</width>
216+
<height>686</height>
229217
</rect>
230218
</property>
231219
<layout class="QVBoxLayout" name="verticalLayout_7">
@@ -692,8 +680,8 @@
692680
<rect>
693681
<x>0</x>
694682
<y>0</y>
695-
<width>693</width>
696-
<height>646</height>
683+
<width>150</width>
684+
<height>236</height>
697685
</rect>
698686
</property>
699687
<layout class="QVBoxLayout" name="verticalLayout_10">
@@ -816,8 +804,8 @@
816804
<rect>
817805
<x>0</x>
818806
<y>0</y>
819-
<width>693</width>
820-
<height>646</height>
807+
<width>713</width>
808+
<height>686</height>
821809
</rect>
822810
</property>
823811
<layout class="QVBoxLayout" name="verticalLayout_13">
@@ -1331,8 +1319,8 @@
13311319
<rect>
13321320
<x>0</x>
13331321
<y>0</y>
1334-
<width>693</width>
1335-
<height>646</height>
1322+
<width>431</width>
1323+
<height>384</height>
13361324
</rect>
13371325
</property>
13381326
<layout class="QVBoxLayout" name="verticalLayout_5">
@@ -1537,6 +1525,9 @@
15371525
<attribute name="horizontalHeaderStretchLastSection">
15381526
<bool>true</bool>
15391527
</attribute>
1528+
<attribute name="horizontalHeaderStretchLastSection">
1529+
<bool>true</bool>
1530+
</attribute>
15401531
</widget>
15411532
</item>
15421533
<item row="0" column="0">
@@ -1748,8 +1739,8 @@
17481739
<rect>
17491740
<x>0</x>
17501741
<y>0</y>
1751-
<width>693</width>
1752-
<height>646</height>
1742+
<width>557</width>
1743+
<height>164</height>
17531744
</rect>
17541745
</property>
17551746
<layout class="QVBoxLayout" name="verticalLayout_12">
@@ -1812,7 +1803,7 @@
18121803
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
18131804
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
18141805
p, li { white-space: pre-wrap; }
1815-
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Lucida Grande'; font-size:13pt; font-weight:400; font-style:normal;&quot;&gt;
1806+
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'DejaVu Sans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
18161807
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Cantarell'; font-size:11pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
18171808
</property>
18181809
</widget>
@@ -1919,8 +1910,8 @@ p, li { white-space: pre-wrap; }
19191910
<rect>
19201911
<x>0</x>
19211912
<y>0</y>
1922-
<width>693</width>
1923-
<height>646</height>
1913+
<width>82</width>
1914+
<height>18</height>
19241915
</rect>
19251916
</property>
19261917
<layout class="QVBoxLayout" name="verticalLayout_16">
@@ -1951,75 +1942,6 @@ p, li { white-space: pre-wrap; }
19511942
</item>
19521943
</layout>
19531944
</widget>
1954-
<widget class="QWidget" name="mOptsPage_Pipe">
1955-
<layout class="QVBoxLayout" name="verticalLayout_17">
1956-
<property name="margin">
1957-
<number>0</number>
1958-
</property>
1959-
<item>
1960-
<widget class="QLabel" name="label_14">
1961-
<property name="styleSheet">
1962-
<string notr="true">font-weight:bold;</string>
1963-
</property>
1964-
<property name="text">
1965-
<string>Pipe</string>
1966-
</property>
1967-
</widget>
1968-
</item>
1969-
<item>
1970-
<widget class="QScrollArea" name="scrollArea_7">
1971-
<property name="frameShape">
1972-
<enum>QFrame::NoFrame</enum>
1973-
</property>
1974-
<property name="widgetResizable">
1975-
<bool>true</bool>
1976-
</property>
1977-
<widget class="QWidget" name="scrollAreaWidgetContents_7">
1978-
<property name="geometry">
1979-
<rect>
1980-
<x>0</x>
1981-
<y>0</y>
1982-
<width>693</width>
1983-
<height>646</height>
1984-
</rect>
1985-
</property>
1986-
<layout class="QVBoxLayout" name="verticalLayout_18">
1987-
<property name="topMargin">
1988-
<number>0</number>
1989-
</property>
1990-
<property name="bottomMargin">
1991-
<number>0</number>
1992-
</property>
1993-
<item>
1994-
<widget class="QGroupBox" name="mPipeGrpBx">
1995-
<property name="title">
1996-
<string/>
1997-
</property>
1998-
<layout class="QVBoxLayout" name="verticalLayout_20">
1999-
<item>
2000-
<widget class="QTreeWidget" name="mPipeTreeWidget">
2001-
<property name="rootIsDecorated">
2002-
<bool>false</bool>
2003-
</property>
2004-
<attribute name="headerStretchLastSection">
2005-
<bool>true</bool>
2006-
</attribute>
2007-
<column>
2008-
<property name="text">
2009-
<string notr="true">1</string>
2010-
</property>
2011-
</column>
2012-
</widget>
2013-
</item>
2014-
</layout>
2015-
</widget>
2016-
</item>
2017-
</layout>
2018-
</widget>
2019-
</widget>
2020-
</item>
2021-
</layout>
2022-
</widget>
20231945
</widget>
20241946
</item>
20251947
</layout>

0 commit comments

Comments
 (0)