Skip to content

Commit

Permalink
[MSSQL] Add toogle action to browser node to show non spatial tables
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanW2 committed May 21, 2014
1 parent 15e1129 commit 885a303
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/providers/mssql/qgsmssqldataitems.cpp
Expand Up @@ -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 );
Expand All @@ -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 );
Expand Down
1 change: 1 addition & 0 deletions src/providers/mssql/qgsmssqldataitems.h
Expand Up @@ -70,6 +70,7 @@ class QgsMssqlConnectionItem : public QgsDataCollectionItem
public slots:
void editConnection();
void deleteConnection();
void setAllowGeometrylessTables( bool allow );

void setLayerType( QgsMssqlLayerProperty layerProperty );

Expand Down

0 comments on commit 885a303

Please sign in to comment.