Skip to content
Permalink
Browse files

refactored the addvector, addraster and selectmapset GUI for the GRAS…

…S plugin

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14630 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
brushtyler
brushtyler committed Nov 14, 2010
1 parent 3862f6d commit 08bc655478d45e8206253f1b7c0aecd968e81706
Showing with 94 additions and 191 deletions.
  1. +2 −2 src/plugins/grass/qgsgrassmodule.cpp
  2. +6 −4 src/plugins/grass/qgsgrassselect.cpp
  3. +86 −185 src/plugins/grass/qgsgrassselectbase.ui
@@ -305,7 +305,7 @@ QgsGrassModuleStandardOptions::QgsGrassModuleStandardOptions(
: QWidget( parent, f ),
QgsGrassModuleOptions( tools, module, iface )
{
QgsDebugMsg( "called." );
//QgsDebugMsg( "called." );
QgsDebugMsg( QString( "PATH = %1" ).arg( getenv( "PATH" ) ) );

// Attention!: sh.exe (MSYS) sets $0 in scripts to file name
@@ -1047,7 +1047,7 @@ QString QgsGrassModule::label( QString path )

QPixmap QgsGrassModule::pixmap( QString path, int height )
{
QgsDebugMsg( QString( "path = %1" ).arg( path ) );
//QgsDebugMsg( QString( "path = %1" ).arg( path ) );

std::vector<QPixmap> pixmaps;

@@ -34,6 +34,8 @@ QgsGrassSelect::QgsGrassSelect( int type ): QgsGrassSelectBase()
QgsDebugMsg( QString( "QgsGrassSelect() type = %1" ).arg( type ) );

setupUi( this );
connect( buttonBox, SIGNAL( accepted() ), SLOT( on_ok_clicked() ) );
connect( buttonBox, SIGNAL( rejected() ), this, SLOT( on_cancel_clicked() ) );

if ( first )
{
@@ -101,7 +103,7 @@ QgsGrassSelect::~QgsGrassSelect()

void QgsGrassSelect::restorePosition()
{
optionsFrame->adjustSize();
//optionsFrame->adjustSize();
adjustSize();

QSettings settings;
@@ -185,7 +187,7 @@ void QgsGrassSelect::setLocations()
{
elocation->setCurrentIndex( sel );
}
ok->setDefault( true );
buttonBox->button(QDialogButtonBox::Ok)->setDefault( true );
GisdbaseBrowse->setDefault( elocation->count() == 0 );

setMapsets();
@@ -228,7 +230,7 @@ void QgsGrassSelect::setMapsets()
}
if ( emap->isHidden() )
{
ok->setDefault( emapset->count() > 0 );
buttonBox->button(QDialogButtonBox::Ok)->setDefault( emapset->count() > 0 );
}

setMaps();
@@ -323,7 +325,7 @@ void QgsGrassSelect::setMaps()
*/
if ( !emap->isHidden() )
{
ok->setDefault( emap->count() > 0 );
buttonBox->button(QDialogButtonBox::Ok)->setDefault( emap->count() > 0 );
}

setLayers();
@@ -1,211 +1,112 @@
<ui version="4.0" >
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QgsGrassSelectBase</class>
<widget class="QDialog" name="QgsGrassSelectBase" >
<property name="geometry" >
<widget class="QDialog" name="QgsGrassSelectBase">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>511</width>
<height>175</height>
<width>393</width>
<height>221</height>
</rect>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Minimum" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle" >
<property name="windowTitle">
<string>Add GRASS Layer</string>
</property>
<property name="sizeGripEnabled" >
<bool>true</bool>
</property>
<property name="modal" >
<bool>true</bool>
</property>
<layout class="QHBoxLayout" >
<property name="spacing" >
<number>5</number>
</property>
<property name="leftMargin" >
<number>5</number>
</property>
<property name="topMargin" >
<number>5</number>
</property>
<property name="rightMargin" >
<number>5</number>
</property>
<property name="bottomMargin" >
<number>5</number>
</property>
<item>
<widget class="QFrame" name="optionsFrame" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Minimum" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="Gisdbase">
<property name="text">
<string>Gisdbase</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="egisdbase">
<property name="text">
<string/>
</property>
<property name="frameShape" >
<enum>QFrame::StyledPanel</enum>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="Location">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow" >
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="lineWidth" >
<number>0</number>
<property name="text">
<string>Location</string>
</property>
<layout class="QGridLayout" >
<property name="leftMargin" >
<number>5</number>
</property>
<property name="topMargin" >
<number>5</number>
</property>
<property name="rightMargin" >
<number>5</number>
</property>
<property name="bottomMargin" >
<number>5</number>
</property>
<property name="horizontalSpacing" >
<number>5</number>
</property>
<property name="verticalSpacing" >
<number>5</number>
</property>
<item row="0" column="0" >
<widget class="QLabel" name="Gisdbase" >
<property name="text" >
<string>Gisdbase</string>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="Location" >
<property name="frameShape" >
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow" >
<enum>QFrame::Plain</enum>
</property>
<property name="text" >
<string>Location</string>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QLabel" name="Mapset" >
<property name="text" >
<string>Mapset</string>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLineEdit" name="egisdbase" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QComboBox" name="elocation" />
</item>
<item row="3" column="1" >
<widget class="QComboBox" name="emap" >
<property name="toolTip" >
<string>Select or type map name (wildcards '*' and '?' accepted for rasters)</string>
</property>
<property name="editable" >
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="1" >
<widget class="QComboBox" name="emapset" />
</item>
<item row="4" column="1" >
<widget class="QComboBox" name="elayer" />
</item>
<item row="3" column="0" >
<widget class="QLabel" name="MapName" >
<property name="text" >
<string>Map name</string>
</property>
</widget>
</item>
<item row="4" column="0" >
<widget class="QLabel" name="Layer" >
<property name="text" >
<string>Layer</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QFrame" name="buttonsFrame" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="1" column="1" colspan="2">
<widget class="QComboBox" name="elocation"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="Mapset">
<property name="text">
<string>Mapset</string>
</property>
<property name="frameShape" >
<enum>QFrame::StyledPanel</enum>
</widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="QComboBox" name="emapset"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="MapName">
<property name="text">
<string>Map name</string>
</property>
<property name="frameShadow" >
<enum>QFrame::Plain</enum>
</widget>
</item>
<item row="3" column="1" colspan="2">
<widget class="QComboBox" name="emap">
<property name="toolTip">
<string>Select or type map name (wildcards '*' and '?' accepted for rasters)</string>
</property>
<property name="lineWidth" >
<number>0</number>
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="Layer">
<property name="text">
<string>Layer</string>
</property>
</widget>
</item>
<item row="4" column="1" colspan="2">
<widget class="QComboBox" name="elayer"/>
</item>
<item row="6" column="0" colspan="3">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="GisdbaseBrowse">
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
<item row="5" column="0" colspan="3">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<layout class="QVBoxLayout" >
<property name="spacing" >
<number>5</number>
</property>
<property name="leftMargin" >
<number>5</number>
</property>
<property name="topMargin" >
<number>5</number>
</property>
<property name="rightMargin" >
<number>5</number>
</property>
<property name="bottomMargin" >
<number>5</number>
</property>
<item>
<widget class="QPushButton" name="GisdbaseBrowse" >
<property name="text" >
<string>Browse</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cancel" >
<property name="text" >
<string>Cancel</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="ok" >
<property name="text" >
<string>OK</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />
<resources/>
<connections/>
</ui>

0 comments on commit 08bc655

Please sign in to comment.
You can’t perform that action at this time.