[QGIS Commit] r8595 - trunk/qgis/src/plugins/grass
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Thu Jun 5 17:13:48 EDT 2008
Author: timlinux
Date: 2008-06-05 17:13:47 -0400 (Thu, 05 Jun 2008)
New Revision: 8595
Modified:
trunk/qgis/src/plugins/grass/qgsgrasstools.cpp
Log:
Display the grass modules list as second tab which avoids rendering issues. Enabled list mode.
Modified: trunk/qgis/src/plugins/grass/qgsgrasstools.cpp
===================================================================
--- trunk/qgis/src/plugins/grass/qgsgrasstools.cpp 2008-06-05 09:48:02 UTC (rev 8594)
+++ trunk/qgis/src/plugins/grass/qgsgrasstools.cpp 2008-06-05 21:13:47 UTC (rev 8595)
@@ -134,6 +134,34 @@
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
//
mModelTools= new QStandardItemModel(0,1);
@@ -145,12 +173,13 @@
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)),
@@ -159,41 +188,19 @@
// 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") );
More information about the QGIS-commit
mailing list