[QGIS Commit] r8911 - trunk/qgis/src/plugins/grass

svn_qgis at osgeo.org svn_qgis at osgeo.org
Fri Jul 25 19:59:41 EDT 2008


Author: timlinux
Date: 2008-07-25 19:59:41 -0400 (Fri, 25 Jul 2008)
New Revision: 8911

Modified:
   trunk/qgis/src/plugins/grass/qgsgrassmodule.cpp
Log:
Backport from grass-tidyup-branch to fix ticket #1036 (GRASS toolbox windows cannot be resized vertically)

Modified: trunk/qgis/src/plugins/grass/qgsgrassmodule.cpp
===================================================================
--- trunk/qgis/src/plugins/grass/qgsgrassmodule.cpp	2008-07-25 23:44:13 UTC (rev 8910)
+++ trunk/qgis/src/plugins/grass/qgsgrassmodule.cpp	2008-07-25 23:59:41 UTC (rev 8911)
@@ -106,6 +106,11 @@
 bool QgsGrassModule::mExecPathInited = 0;
 QStringList QgsGrassModule::mExecPath;
 
+
+
+
+
+
 QString QgsGrassModule::findExec ( QString file )
 {
   QgsDebugMsg("called.");
@@ -208,8 +213,6 @@
   mIface = iface;
   mCanvas = mIface->getMapCanvas();
   mParent = parent;
-  //mAppDir = QgsApplication::applicationDirPath();
-  mAppDir = mTools->appDir();
 
   /* Read module description and create options */
 
@@ -298,7 +301,10 @@
   }
   else
   {
-    QMessageBox::warning( 0, tr("Warning"), tr("Cannot find man page ") + manPath );
+    mManualTextBrowser->clear();
+    mManualTextBrowser->textCursor().insertImage( ":/grass/error.png");
+    mManualTextBrowser->insertPlainText (  tr("Cannot find man page ") + manPath );
+    mManualTextBrowser->insertPlainText (  tr("Please ensure you have the GRASS documentation installed.") );
   }
 
   connect ( &mProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(readStdout()));
@@ -326,8 +332,6 @@
   mModule = module;
   mIface = iface;
   mCanvas = mIface->getMapCanvas();
-  //mAppDir = QgsApplication::applicationDirPath();
-  mAppDir = mTools->appDir();
 }
 
 QgsGrassModuleOptions::~QgsGrassModuleOptions()
@@ -408,8 +412,23 @@
 
   // Read QGIS options and create controls
   QDomNode n = qDocElem.firstChild();
-  //QVBoxLayout *layout = new QVBoxLayout ( mTabWidget->page(0), 10 );
-  QVBoxLayout *layout = new QVBoxLayout ( mParent, 10 );
+  //
+  //Set up dynamic inside a scroll box
+  //
+  QVBoxLayout * mypOuterLayout = new QVBoxLayout(mParent);
+  mypOuterLayout->setContentsMargins(0,0,0,0);
+  //transfers layout ownership so no need to call delete
+  this->setLayout(mypOuterLayout);
+  QScrollArea * mypScrollArea = new QScrollArea();
+  //transfers scroll area ownership so no need to call delete
+  mypOuterLayout->addWidget(mypScrollArea);
+  QFrame * mypInnerFrame = new QFrame();
+  mypInnerFrame->setFrameShape(QFrame::NoFrame);
+  mypInnerFrame->setFrameShadow(QFrame::Plain);
+  //transfers frame ownership so no need to call delete
+  mypScrollArea->setWidget(mypInnerFrame);
+  mypScrollArea->setWidgetResizable( true );
+  QVBoxLayout *layout = new QVBoxLayout ( mypInnerFrame);
   while( !n.isNull() ) {
     QDomElement e = n.toElement();
     if( !e.isNull() ) {
@@ -1447,10 +1466,6 @@
 
 void QgsGrassModule::close()
 {
-  QgsDebugMsg("called.");
-
-  QTabWidget *tw = dynamic_cast<QTabWidget *>(mParent);
-  tw->removePage (this );
   delete this;
 }
 



More information about the QGIS-commit mailing list