Skip to content
Permalink
Browse files
[MSSQL] Add toogle action to browser node to show non spatial tables
  • Loading branch information
NathanW2 committed May 21, 2014
1 parent 15e1129 commit 885a3031093d4fb2a16eb6d0134229513695fd94
Showing with 16 additions and 0 deletions.
  1. +15 −0 src/providers/mssql/qgsmssqldataitems.cpp
  2. +1 −0 src/providers/mssql/qgsmssqldataitems.h
@@ -306,6 +306,12 @@ QList<QAction*> QgsMssqlConnectionItem::actions()
{
QList<QAction*> lst;

QAction* actionShowNoGeom = new QAction( tr( "Show non-spatial tables" ), this );
actionShowNoGeom->setCheckable( true );
actionShowNoGeom->setChecked( mAllowGeometrylessTables );
connect( actionShowNoGeom, SIGNAL( toggled(bool) ), this, SLOT( setAllowGeometrylessTables(bool) ) );
lst.append( actionShowNoGeom );

QAction* actionEdit = new QAction( tr( "Edit..." ), this );
connect( actionEdit, SIGNAL( triggered() ), this, SLOT( editConnection() ) );
lst.append( actionEdit );
@@ -317,6 +323,15 @@ QList<QAction*> QgsMssqlConnectionItem::actions()
return lst;
}

void QgsMssqlConnectionItem::setAllowGeometrylessTables( bool allow )
{
mAllowGeometrylessTables = allow;
QString key = "/MSSQL/connections/" + mName;
QSettings settings;
settings.setValue(key + "/allowGeometrylessTables", allow );
refresh();
}

void QgsMssqlConnectionItem::editConnection()
{
QgsMssqlNewConnection nc( NULL, mName );
@@ -70,6 +70,7 @@ class QgsMssqlConnectionItem : public QgsDataCollectionItem
public slots:
void editConnection();
void deleteConnection();
void setAllowGeometrylessTables( bool allow );

void setLayerType( QgsMssqlLayerProperty layerProperty );

0 comments on commit 885a303

Please sign in to comment.