Skip to content

Commit 75951ce

Browse files
author
timlinux
committed
Backport from grass-tidyup-branch to fix ticket #1036 (GRASS toolbox windows cannot be resized vertically)
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8911 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent c2b0406 commit 75951ce

File tree

1 file changed

+26
-11
lines changed

1 file changed

+26
-11
lines changed

src/plugins/grass/qgsgrassmodule.cpp

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ static QString getShortPath(const QString &path)
106106
bool QgsGrassModule::mExecPathInited = 0;
107107
QStringList QgsGrassModule::mExecPath;
108108

109+
110+
111+
112+
113+
109114
QString QgsGrassModule::findExec ( QString file )
110115
{
111116
QgsDebugMsg("called.");
@@ -208,8 +213,6 @@ QgsGrassModule::QgsGrassModule ( QgsGrassTools *tools, QString moduleName, QgisI
208213
mIface = iface;
209214
mCanvas = mIface->getMapCanvas();
210215
mParent = parent;
211-
//mAppDir = QgsApplication::applicationDirPath();
212-
mAppDir = mTools->appDir();
213216

214217
/* Read module description and create options */
215218

@@ -298,7 +301,10 @@ QgsGrassModule::QgsGrassModule ( QgsGrassTools *tools, QString moduleName, QgisI
298301
}
299302
else
300303
{
301-
QMessageBox::warning( 0, tr("Warning"), tr("Cannot find man page ") + manPath );
304+
mManualTextBrowser->clear();
305+
mManualTextBrowser->textCursor().insertImage( ":/grass/error.png");
306+
mManualTextBrowser->insertPlainText ( tr("Cannot find man page ") + manPath );
307+
mManualTextBrowser->insertPlainText ( tr("Please ensure you have the GRASS documentation installed.") );
302308
}
303309

304310
connect ( &mProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(readStdout()));
@@ -326,8 +332,6 @@ QgsGrassModuleOptions::QgsGrassModuleOptions (
326332
mModule = module;
327333
mIface = iface;
328334
mCanvas = mIface->getMapCanvas();
329-
//mAppDir = QgsApplication::applicationDirPath();
330-
mAppDir = mTools->appDir();
331335
}
332336

333337
QgsGrassModuleOptions::~QgsGrassModuleOptions()
@@ -408,8 +412,23 @@ QgsGrassModuleStandardOptions::QgsGrassModuleStandardOptions (
408412

409413
// Read QGIS options and create controls
410414
QDomNode n = qDocElem.firstChild();
411-
//QVBoxLayout *layout = new QVBoxLayout ( mTabWidget->page(0), 10 );
412-
QVBoxLayout *layout = new QVBoxLayout ( mParent, 10 );
415+
//
416+
//Set up dynamic inside a scroll box
417+
//
418+
QVBoxLayout * mypOuterLayout = new QVBoxLayout(mParent);
419+
mypOuterLayout->setContentsMargins(0,0,0,0);
420+
//transfers layout ownership so no need to call delete
421+
this->setLayout(mypOuterLayout);
422+
QScrollArea * mypScrollArea = new QScrollArea();
423+
//transfers scroll area ownership so no need to call delete
424+
mypOuterLayout->addWidget(mypScrollArea);
425+
QFrame * mypInnerFrame = new QFrame();
426+
mypInnerFrame->setFrameShape(QFrame::NoFrame);
427+
mypInnerFrame->setFrameShadow(QFrame::Plain);
428+
//transfers frame ownership so no need to call delete
429+
mypScrollArea->setWidget(mypInnerFrame);
430+
mypScrollArea->setWidgetResizable( true );
431+
QVBoxLayout *layout = new QVBoxLayout ( mypInnerFrame);
413432
while( !n.isNull() ) {
414433
QDomElement e = n.toElement();
415434
if( !e.isNull() ) {
@@ -1447,10 +1466,6 @@ void QgsGrassModule::readStderr()
14471466

14481467
void QgsGrassModule::close()
14491468
{
1450-
QgsDebugMsg("called.");
1451-
1452-
QTabWidget *tw = dynamic_cast<QTabWidget *>(mParent);
1453-
tw->removePage (this );
14541469
delete this;
14551470
}
14561471

0 commit comments

Comments
 (0)