Skip to content
Permalink
Browse files
identify expand/collaps tools
  • Loading branch information
blazek committed Oct 19, 2012
1 parent 675e81c commit 4358e8e
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 9 deletions.
@@ -67,6 +67,7 @@
<file>themes/default/mActionEditCut.png</file>
<file>themes/default/mActionEditPaste.png</file>
<file>themes/default/mActionExpandTree.png</file>
<file>themes/default/mActionExpandNewTree.png</file>
<file>themes/default/mActionExportMapServer.png</file>
<file>themes/default/mActionFileExit.png</file>
<file>themes/default/mActionFileNew.png</file>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -88,6 +88,11 @@ QgsIdentifyResults::QgsIdentifyResults( QgsMapCanvas *canvas, QWidget *parent, Q
, mDock( NULL )
{
setupUi( this );

mExpandToolButton->setIcon( QgsApplication::getThemeIcon( "/mActionExpandTree.png" ) );
mCollapseToolButton->setIcon( QgsApplication::getThemeIcon( "/mActionCollapseTree.png" ) );
mExpandNewToolButton->setIcon( QgsApplication::getThemeIcon( "/mActionExpandNewTree.png" ) );

QSettings mySettings;
restoreGeometry( mySettings.value( "/Windows/Identify/geometry" ).toByteArray() );
bool myDockFlag = mySettings.value( "/qgis/dockIdentifyResults", false ).toBool();
@@ -98,6 +103,7 @@ QgsIdentifyResults::QgsIdentifyResults( QgsMapCanvas *canvas, QWidget *parent, Q
mDock->setWidget( this );
QgisApp::instance()->addDockWidget( Qt::LeftDockWidgetArea, mDock );
}
mExpandNewToolButton->setChecked( mySettings.value( "/Map/identifyExpand", false ).toBool() );
lstResults->setColumnCount( 2 );
setColumnText( 0, tr( "Feature" ) );
setColumnText( 1, tr( "Value" ) );
@@ -371,6 +377,12 @@ void QgsIdentifyResults::show()
layItem->setExpanded( true );
}

// expand all if enabled
if ( mExpandNewToolButton->isChecked() )
{
lstResults->expandAll();
}

QDialog::show();
raise();
}
@@ -948,7 +960,7 @@ void QgsIdentifyResults::layerProperties()
void QgsIdentifyResults::layerProperties( QTreeWidgetItem *item )
{
QgsVectorLayer *vlayer = vectorLayer( item );
if( !vlayer )
if ( !vlayer )
return;

QgisApp::instance()->showLayerProperties( vlayer );
@@ -1007,3 +1019,9 @@ void QgsIdentifyResults::openUrl( const QUrl &url )
QMessageBox::warning( this, tr( "Could not open url" ), tr( "Could not open URL '%1'" ).arg( url.toString() ) );
}
}

void QgsIdentifyResults:: on_mExpandNewToolButton_toggled( bool checked )
{
QSettings settings;
settings.setValue( "/Map/identifyExpand", checked );
}
@@ -113,6 +113,11 @@ class QgsIdentifyResults: public QDialog, private Ui::QgsIdentifyResultsBase

void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }

void on_mExpandNewToolButton_toggled( bool checked );

void on_mExpandToolButton_clicked( bool checked ) { expandAll(); }
void on_mCollapseToolButton_clicked( bool checked ) { collapseAll(); }

void openUrl( const QUrl &url );

private:
@@ -36,14 +36,82 @@
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Close|QDialogButtonBox::Help</set>
</property>
<property name="centerButtons">
<bool>false</bool>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QToolButton" name="mExpandToolButton">
<property name="toolTip">
<string>Expand tree.</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset>
<normaloff>../../images/themes/default/mActionExpandTree.png</normaloff>../../images/themes/default/mActionExpandTree.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="mCollapseToolButton">
<property name="toolTip">
<string>Collapse tree.</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset>
<normaloff>../../images/themes/default/mActionCollapseTree.png</normaloff>../../images/themes/default/mActionCollapseTree.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="mExpandNewToolButton">
<property name="toolTip">
<string>New results will be expanded by default.</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset>
<normaloff>../../images/themes/default/mActionExpandNewTree.png</normaloff>../../images/themes/default/mActionExpandNewTree.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Close|QDialogButtonBox::Help</set>
</property>
<property name="centerButtons">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>

0 comments on commit 4358e8e

Please sign in to comment.