Skip to content
Permalink
Browse files

[FEATURE] Added an option for docking the identify query results rath…

…er than having them float over the app. Default behaviour is not docked, but it can be enabled in the options panel

git-svn-id: http://svn.osgeo.org/qgis/trunk@11617 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux
timlinux committed Sep 10, 2009
1 parent a20eacd commit 19818f9959efd1115e05556d0e3c7a5cec400369
Showing with 556 additions and 449 deletions.
  1. +27 −1 src/app/qgsidentifyresults.cpp
  2. +3 −0 src/app/qgsidentifyresults.h
  3. +2 −0 src/app/qgsoptions.cpp
  4. +524 −448 src/ui/qgsoptionsbase.ui
@@ -36,9 +36,24 @@
#include <QSettings>
#include <QMenu>
#include <QClipboard>
#include <QDockWidget>

#include "qgslogger.h"

class QgsIdentifyResultsDock : public QDockWidget
{
public:
QgsIdentifyResultsDock( const QString & title, QWidget * parent = 0, Qt::WindowFlags flags = 0 )
: QDockWidget( title, parent, flags )
{
setObjectName( "IdentifyResultsTableDock" ); // set object name so the position can be saved
}

virtual void closeEvent( QCloseEvent * ev )
{
deleteLater();
}
};
// Tree hierachy
//
// layer [userrole: QgsMapLayer]
@@ -57,9 +72,20 @@ QgsIdentifyResults::QgsIdentifyResults( QgsMapCanvas *canvas, QWidget *parent, Q
: QDialog( parent, f ),
mActionPopup( 0 ),
mRubberBand( 0 ),
mCanvas( canvas )
mCanvas( canvas ),
mDock( NULL )
{
setupUi( this );
QSettings mySettings;
bool myDockFlag = mySettings.value( "/qgis/dockIdentifyResults", false ).toBool();
if ( myDockFlag )
{
mDock = new QgsIdentifyResultsDock( tr( "Identify Results" ) , QgisApp::instance() );
mDock->setAllowedAreas( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea );
mDock->setWidget( this );
QgisApp::instance()->addDockWidget( Qt::LeftDockWidgetArea, mDock );
buttonCancel->hide();
}
lstResults->setColumnCount( 2 );
setColumnText( 0, tr( "Feature" ) );
setColumnText( 1, tr( "Value" ) );
@@ -34,6 +34,7 @@ class QgsMapLayer;
class QgsVectorLayer;
class QgsRubberBand;
class QgsMapCanvas;
class QDockWidget;

/**
*@author Gary E.Sherman
@@ -117,6 +118,8 @@ class QgsIdentifyResults: public QDialog, private Ui::QgsIdentifyResultsBase
void editFeature( QTreeWidgetItem *item );

void doAction( QTreeWidgetItem *item, int action );

QDockWidget *mDock;
};

#endif
@@ -157,6 +157,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
cbxLegendClassifiers->setChecked( settings.value( "/qgis/showLegendClassifiers", false ).toBool() );
cbxHideSplash->setChecked( settings.value( "/qgis/hideSplash", false ).toBool() );
cbxAttributeTableDocked->setChecked( settings.value( "/qgis/dockAttributeTable", false ).toBool() );
cbxIdentifyResultsDocked->setChecked( settings.value( "/qgis/dockIdentifyResults", false ).toBool() );
cbxAddPostgisDC->setChecked( settings.value( "/qgis/addPostgisDC", false ).toBool() );

//set the colour for selections
@@ -360,6 +361,7 @@ void QgsOptions::saveOptions()
settings.setValue( "/qgis/showLegendClassifiers", cbxLegendClassifiers->isChecked() );
settings.setValue( "/qgis/hideSplash", cbxHideSplash->isChecked() );
settings.setValue( "/qgis/dockAttributeTable", cbxAttributeTableDocked->isChecked() );
settings.setValue( "/qgis/dockIdentifyResults", cbxIdentifyResultsDocked->isChecked() );
settings.setValue( "/qgis/addPostgisDC", cbxAddPostgisDC->isChecked() );
settings.setValue( "/qgis/new_layers_visible", chkAddedVisibility->isChecked() );
settings.setValue( "/qgis/enable_anti_aliasing", chkAntiAliasing->isChecked() );

0 comments on commit 19818f9

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