Skip to content
Permalink
Browse files

allow opening attribute table from plugins

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14749 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Nov 23, 2010
1 parent 874eb33 commit 009c8e5eca2b9c0edba8d85ae3a229b217ba18a4
Showing with 44 additions and 4 deletions.
  1. +5 −0 python/gui/qgisinterface.sip
  2. +18 −2 src/app/qgisappinterface.cpp
  3. +10 −0 src/app/qgisappinterface.h
  4. +11 −2 src/gui/qgisinterface.h
@@ -117,6 +117,11 @@ class QgisInterface : QObject
*/
virtual void showLayerProperties( QgsMapLayer * layer )=0;

/** open attribute table
\note added in 1.7
*/
virtual void showAttributeTable( QgsVectorLayer * layer )=0;

/** Add window to Window menu. The action title is the window title
* and the action should raise, unminimize and activate the window. */
virtual void addWindow( QAction *action ) = 0;
@@ -36,6 +36,7 @@
#include "qgsvectordataprovider.h"
#include "qgsfeatureaction.h"
#include "qgsattributeaction.h"
#include "qgsattributetabledialog.h"

QgisAppInterface::QgisAppInterface( QgisApp * _qgis )
: qgis( _qgis ),
@@ -231,9 +232,24 @@ void QgisAppInterface::showLayerProperties( QgsMapLayer *l )
}
}

void QgisAppInterface::addWindow( QAction *action ) { qgis->addWindow( action ); }
void QgisAppInterface::removeWindow( QAction *action ) { qgis->removeWindow( action ); }
void QgisAppInterface::showAttributeTable( QgsVectorLayer *l )
{
if ( l )
{
QgsAttributeTableDialog *dialog = new QgsAttributeTableDialog( l );
dialog->show();
}
}

void QgisAppInterface::addWindow( QAction *action )
{
qgis->addWindow( action );
}

void QgisAppInterface::removeWindow( QAction *action )
{
qgis->removeWindow( action );
}

bool QgisAppInterface::registerMainWindowAction( QAction* action, QString defaultShortcut )
{
@@ -120,8 +120,18 @@ class QgisAppInterface : public QgisInterface

virtual void refreshLegend( QgsMapLayer *l );

/** show layer properties dialog for layer
* @param l layer to show properties table for
* @note added in added in 1.5
*/
virtual void showLayerProperties( QgsMapLayer *l );

/** show layer attribute dialog for layer
* @param l layer to show attribute table for
* @note added in added in 1.7
*/
virtual void showAttributeTable( QgsVectorLayer *l );

/** Add window to Window menu. The action title is the window title
* and the action should raise, unminimize and activate the window. */
virtual void addWindow( QAction *action );
@@ -126,11 +126,15 @@ class GUI_EXPORT QgisInterface : public QObject

/** Add action to the plugins menu */
virtual void addPluginToMenu( QString name, QAction* action ) = 0;

/** Remove action from the plugins menu */
virtual void removePluginMenu( QString name, QAction* action ) = 0;

/** Add action to the Database menu */
/** Add action to the Database menu
* @note added in 1.7
*/
virtual void addPluginToDatabaseMenu( QString name, QAction* action ) = 0;

/** Remove action from the Database menu */
virtual void removePluginDatabaseMenu( QString name, QAction* action ) = 0;

@@ -150,6 +154,11 @@ class GUI_EXPORT QgisInterface : public QObject
*/
virtual void showLayerProperties( QgsMapLayer *l ) = 0;

/** open attribute table dialog
\note added in 1.7
*/
virtual void showAttributeTable( QgsVectorLayer *l ) = 0;

/** Add window to Window menu. The action title is the window title
* and the action should raise, unminimize and activate the window. */
virtual void addWindow( QAction *action ) = 0;
@@ -346,7 +355,7 @@ class GUI_EXPORT QgisInterface : public QObject
Added in v1.6
*/
void newProjectCreated();
void newProjectCreated();

};

0 comments on commit 009c8e5

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