Skip to content

Commit

Permalink
Display the grass modules list as second tab which avoids rendering i…
Browse files Browse the repository at this point in the history
…ssues. Enabled list mode.

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8595 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Jun 5, 2008
1 parent 41e4dea commit 366645d
Showing 1 changed file with 34 additions and 27 deletions.
61 changes: 34 additions & 27 deletions src/plugins/grass/qgsgrasstools.cpp
Expand Up @@ -133,6 +133,34 @@ QgsGrassTools::QgsGrassTools ( QgisInterface *iface,
QVBoxLayout *layout1 = new QVBoxLayout(this);
layout1->addWidget(mTabWidget);

//
// Radims original tree view code.
//
// Warning: if the tree is not the first page modules are
// displayed over the other pages on first load

mModulesListView = new QTreeWidget();
mTabWidget->addTab( mModulesListView, tr("Modules Tree") );
mModulesListView->setColumnCount(1);
QStringList headers;
headers << tr("Modules");
mModulesListView->setHeaderLabels(headers);
// Set list view
mModulesListView->clear();
mModulesListView->setSortingEnabled(false);
mModulesListView->setRootIsDecorated(true);
// mModulesListView->setResizeMode(QTreeWidget::AllColumns);
mModulesListView->header()->hide();

connect( mModulesListView, SIGNAL(itemClicked(QTreeWidgetItem *, int)),
this, SLOT(moduleClicked( QTreeWidgetItem *, int)) );

QString title = tr("GRASS Tools: ") + QgsGrass::getDefaultLocation()
+ "/" + QgsGrass::getDefaultMapset();
setCaption(title);
mModulesListView->show();


//
// Tims experimental list view with filter
//
Expand All @@ -145,12 +173,13 @@ QgsGrassTools::QgsGrassTools ( QgisInterface *iface,
mListView->setFocus();
mListView->setItemDelegateForColumn(0,new QgsDetailedItemDelegate());
mListView->setUniformItemSizes(false);
mListView->show();
QWidget * mypBase = new QWidget(this);
QVBoxLayout * mypListTabLayout = new QVBoxLayout(mypBase);
mypListTabLayout->addWidget(mListView);
mFilterInput = new QLineEdit(this);
mypListTabLayout->addWidget(mFilterInput);
//mTabWidget->addTab( mypBase, tr("Modules List") );
mTabWidget->addTab( mypBase, tr("Modules List") );
connect( mFilterInput, SIGNAL(textChanged(QString)),
this, SLOT(filterChanged(QString)) );
connect( mListView, SIGNAL(clicked(const QModelIndex)),
Expand All @@ -159,41 +188,19 @@ QgsGrassTools::QgsGrassTools ( QgisInterface *iface,
// End of Tims experimental bit
//

mModulesListView = new QTreeWidget();
mTabWidget->addTab( mModulesListView, tr("Modules Tree") );
mModulesListView->setColumnCount(1);
QStringList headers;
headers << tr("Modules");
mModulesListView->setHeaderLabels(headers);
// Set list view
mModulesListView->clear();
mModulesListView->setSortingEnabled(false);
mModulesListView->setRootIsDecorated(true);
// mModulesListView->setResizeMode(QTreeWidget::AllColumns);
mModulesListView->header()->hide();

connect( mModulesListView, SIGNAL(itemClicked(QTreeWidgetItem *, int)),
this, SLOT(moduleClicked( QTreeWidgetItem *, int)) );

QString title = tr("GRASS Tools: ") + QgsGrass::getDefaultLocation()
+ "/" + QgsGrass::getDefaultMapset();
setCaption(title);

//
// Load the modules lists
//
// Show before loadConfig() so that user can see loading
QString conf = QgsApplication::pkgDataPath() + "/grass/config/default.qgc";

restorePosition();

// Show before loadConfig() so that user can see loading
mModulesListView->show();

QApplication::setOverrideCursor(Qt::waitCursor);
loadConfig ( conf );
QApplication::restoreOverrideCursor();
//statusBar()->hide();

// Add map browser
// Warning: if browser is on the first page modules are
// displayed over the browser
mBrowser = new QgsGrassBrowser ( mIface, this );
mTabWidget->addTab( mBrowser, tr("Browser") );

Expand Down

0 comments on commit 366645d

Please sign in to comment.