mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
[MSSQL] Add toogle action to browser node to show non spatial tables
This commit is contained in:
parent
15e1129bb1
commit
885a303109
@ -306,6 +306,12 @@ QList<QAction*> QgsMssqlConnectionItem::actions()
|
|||||||
{
|
{
|
||||||
QList<QAction*> lst;
|
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 );
|
QAction* actionEdit = new QAction( tr( "Edit..." ), this );
|
||||||
connect( actionEdit, SIGNAL( triggered() ), this, SLOT( editConnection() ) );
|
connect( actionEdit, SIGNAL( triggered() ), this, SLOT( editConnection() ) );
|
||||||
lst.append( actionEdit );
|
lst.append( actionEdit );
|
||||||
@ -317,6 +323,15 @@ QList<QAction*> QgsMssqlConnectionItem::actions()
|
|||||||
return lst;
|
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()
|
void QgsMssqlConnectionItem::editConnection()
|
||||||
{
|
{
|
||||||
QgsMssqlNewConnection nc( NULL, mName );
|
QgsMssqlNewConnection nc( NULL, mName );
|
||||||
|
@ -70,6 +70,7 @@ class QgsMssqlConnectionItem : public QgsDataCollectionItem
|
|||||||
public slots:
|
public slots:
|
||||||
void editConnection();
|
void editConnection();
|
||||||
void deleteConnection();
|
void deleteConnection();
|
||||||
|
void setAllowGeometrylessTables( bool allow );
|
||||||
|
|
||||||
void setLayerType( QgsMssqlLayerProperty layerProperty );
|
void setLayerType( QgsMssqlLayerProperty layerProperty );
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user