Skip to content

Commit

Permalink
Backport from grass-tidyup-branch to fix ticket #1036 (GRASS toolbox …
Browse files Browse the repository at this point in the history
…windows cannot be resized vertically)

git-svn-id: http://svn.osgeo.org/qgis/trunk@8911 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Jul 25, 2008
1 parent 69c48ef commit cd47855
Showing 1 changed file with 26 additions and 11 deletions.
37 changes: 26 additions & 11 deletions src/plugins/grass/qgsgrassmodule.cpp
Expand Up @@ -106,6 +106,11 @@ static QString getShortPath(const QString &path)
bool QgsGrassModule::mExecPathInited = 0;
QStringList QgsGrassModule::mExecPath;






QString QgsGrassModule::findExec ( QString file )
{
QgsDebugMsg("called.");
Expand Down Expand Up @@ -208,8 +213,6 @@ QgsGrassModule::QgsGrassModule ( QgsGrassTools *tools, QString moduleName, QgisI
mIface = iface;
mCanvas = mIface->getMapCanvas();
mParent = parent;
//mAppDir = QgsApplication::applicationDirPath();
mAppDir = mTools->appDir();

/* Read module description and create options */

Expand Down Expand Up @@ -298,7 +301,10 @@ QgsGrassModule::QgsGrassModule ( QgsGrassTools *tools, QString moduleName, QgisI
}
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()));
Expand Down Expand Up @@ -326,8 +332,6 @@ QgsGrassModuleOptions::QgsGrassModuleOptions (
mModule = module;
mIface = iface;
mCanvas = mIface->getMapCanvas();
//mAppDir = QgsApplication::applicationDirPath();
mAppDir = mTools->appDir();
}

QgsGrassModuleOptions::~QgsGrassModuleOptions()
Expand Down Expand Up @@ -408,8 +412,23 @@ QgsGrassModuleStandardOptions::QgsGrassModuleStandardOptions (

// 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() ) {
Expand Down Expand Up @@ -1447,10 +1466,6 @@ void QgsGrassModule::readStderr()

void QgsGrassModule::close()
{
QgsDebugMsg("called.");

QTabWidget *tw = dynamic_cast<QTabWidget *>(mParent);
tw->removePage (this );
delete this;
}

Expand Down

0 comments on commit cd47855

Please sign in to comment.