mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
reload browser if mapset changed
git-svn-id: http://svn.osgeo.org/qgis/trunk@5199 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
3271d3c3be
commit
ec144418c8
@ -537,3 +537,7 @@ void QgsGrassBrowser::currentChanged(const QModelIndex & current, const QModelIn
|
||||
#endif
|
||||
}
|
||||
|
||||
void QgsGrassBrowser::setLocation( const QString &gisbase, const QString &location )
|
||||
{
|
||||
mModel->setLocation(gisbase, location);
|
||||
}
|
||||
|
@ -62,6 +62,9 @@ public slots:
|
||||
// Write region
|
||||
void writeRegion ( struct Cell_head *window );
|
||||
|
||||
// Set Location
|
||||
void setLocation ( const QString &gisbase, const QString &location );
|
||||
|
||||
// Refresh model
|
||||
void refresh();
|
||||
|
||||
|
@ -913,8 +913,12 @@ QString QgsGrassModel::uri ( const QModelIndex &index ) const
|
||||
|
||||
void QgsGrassModel::setLocation( const QString &gisbase, const QString &location )
|
||||
{
|
||||
removeItems(mRoot, QStringList());
|
||||
mGisbase = gisbase;
|
||||
mLocation = location;
|
||||
mRoot->mGisbase = gisbase;
|
||||
mRoot->mLocation = location;
|
||||
refreshItem(mRoot);
|
||||
}
|
||||
|
||||
QVariant QgsGrassModel::headerData(int section,
|
||||
|
@ -239,8 +239,6 @@ void QgsGrassPlugin::initGui()
|
||||
|
||||
void QgsGrassPlugin::mapsetChanged ()
|
||||
{
|
||||
if ( mTools ) mTools->closeTools();
|
||||
|
||||
if ( !QgsGrass::activeMode() ) {
|
||||
mOpenToolsAction->setEnabled(false);
|
||||
mRegionAction->setEnabled(false);
|
||||
@ -274,7 +272,6 @@ void QgsGrassPlugin::mapsetChanged ()
|
||||
mTools->mapsetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void QgsGrassPlugin::saveMapset()
|
||||
|
@ -159,10 +159,10 @@ QgsGrassTools::QgsGrassTools ( QgisApp *qgisApp, QgisIface *iface,
|
||||
// Add map browser
|
||||
// Warning: if browser is on the first page modules are
|
||||
// displayed over the browser
|
||||
QgsGrassBrowser *browser = new QgsGrassBrowser ( mIface, this );
|
||||
mTabWidget->addTab( browser, "Browser" );
|
||||
mBrowser = new QgsGrassBrowser ( mIface, this );
|
||||
mTabWidget->addTab( mBrowser, "Browser" );
|
||||
|
||||
connect( browser, SIGNAL(regionChanged()),
|
||||
connect( mBrowser, SIGNAL(regionChanged()),
|
||||
this, SLOT(emitRegionChanged()) );
|
||||
}
|
||||
|
||||
@ -385,7 +385,8 @@ void QgsGrassTools::mapsetChanged()
|
||||
+ "/" + QgsGrass::getDefaultMapset();
|
||||
setCaption(title);
|
||||
|
||||
// TODO: Close opened tools (tabs) ?
|
||||
closeTools();
|
||||
mBrowser->setLocation( QgsGrass::getDefaultGisdbase(), QgsGrass::getDefaultLocation() );
|
||||
}
|
||||
|
||||
QgsGrassTools::~QgsGrassTools()
|
||||
|
@ -30,6 +30,7 @@ class QDomElement;
|
||||
#include "qgisiface.h"
|
||||
|
||||
class QgsGrassProvider;
|
||||
class QgsGrassBrowser;
|
||||
#include <QDialog>
|
||||
#include <QTabBar>
|
||||
class QSize;
|
||||
@ -115,6 +116,9 @@ private:
|
||||
//! QGIS directory
|
||||
QString mAppDir;
|
||||
|
||||
//! Browser
|
||||
QgsGrassBrowser *mBrowser;
|
||||
|
||||
QgsGrassToolsTabWidget *mTabWidget;
|
||||
Q3ListView *mModulesListView;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user