Skip to content
Permalink
Browse files

reload browser if mapset changed

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5199 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek
rblazek committed Apr 6, 2006
1 parent 74cd48d commit 56329d2c1cdfc38f93b141704325a5a830db37ba
@@ -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 @@ public slots:
//! QGIS directory
QString mAppDir;

//! Browser
QgsGrassBrowser *mBrowser;

QgsGrassToolsTabWidget *mTabWidget;
Q3ListView *mModulesListView;
};

0 comments on commit 56329d2

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