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

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sat Nov 13 19:50:43 EST 2010


Author: brushtyler
Date: 2010-11-13 16:50:43 -0800 (Sat, 13 Nov 2010)
New Revision: 14630

Modified:
   trunk/qgis/src/plugins/grass/qgsgrassmodule.cpp
   trunk/qgis/src/plugins/grass/qgsgrassselect.cpp
   trunk/qgis/src/plugins/grass/qgsgrassselectbase.ui
Log:
refactored the addvector, addraster and selectmapset GUI for the GRASS plugin


Modified: trunk/qgis/src/plugins/grass/qgsgrassmodule.cpp
===================================================================
--- trunk/qgis/src/plugins/grass/qgsgrassmodule.cpp	2010-11-14 00:47:37 UTC (rev 14629)
+++ trunk/qgis/src/plugins/grass/qgsgrassmodule.cpp	2010-11-14 00:50:43 UTC (rev 14630)
@@ -305,7 +305,7 @@
     : 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 @@
 
 QPixmap QgsGrassModule::pixmap( QString path, int height )
 {
-  QgsDebugMsg( QString( "path = %1" ).arg( path ) );
+  //QgsDebugMsg( QString( "path = %1" ).arg( path ) );
 
   std::vector<QPixmap> pixmaps;
 

Modified: trunk/qgis/src/plugins/grass/qgsgrassselect.cpp
===================================================================
--- trunk/qgis/src/plugins/grass/qgsgrassselect.cpp	2010-11-14 00:47:37 UTC (rev 14629)
+++ trunk/qgis/src/plugins/grass/qgsgrassselect.cpp	2010-11-14 00:50:43 UTC (rev 14630)
@@ -34,6 +34,8 @@
   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 @@
 
 void QgsGrassSelect::restorePosition()
 {
-  optionsFrame->adjustSize();
+  //optionsFrame->adjustSize();
   adjustSize();
 
   QSettings settings;
@@ -185,7 +187,7 @@
   {
     elocation->setCurrentIndex( sel );
   }
-  ok->setDefault( true );
+  buttonBox->button(QDialogButtonBox::Ok)->setDefault( true );
   GisdbaseBrowse->setDefault( elocation->count() == 0 );
 
   setMapsets();
@@ -228,7 +230,7 @@
   }
   if ( emap->isHidden() )
   {
-    ok->setDefault( emapset->count() > 0 );
+    buttonBox->button(QDialogButtonBox::Ok)->setDefault( emapset->count() > 0 );
   }
 
   setMaps();
@@ -323,7 +325,7 @@
   */
   if ( !emap->isHidden() )
   {
-    ok->setDefault( emap->count() > 0 );
+    buttonBox->button(QDialogButtonBox::Ok)->setDefault( emap->count() > 0 );
   }
 
   setLayers();

Modified: trunk/qgis/src/plugins/grass/qgsgrassselectbase.ui
===================================================================
--- trunk/qgis/src/plugins/grass/qgsgrassselectbase.ui	2010-11-14 00:47:37 UTC (rev 14629)
+++ trunk/qgis/src/plugins/grass/qgsgrassselectbase.ui	2010-11-14 00:50:43 UTC (rev 14630)
@@ -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>
-     <property name="frameShape" >
-      <enum>QFrame::StyledPanel</enum>
+    </widget>
+   </item>
+   <item row="0" column="1">
+    <widget class="QLineEdit" name="egisdbase">
+     <property name="text">
+      <string/>
      </property>
-     <property name="frameShadow" >
+    </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="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>
-     <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>
+   <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>
+    </widget>
+   </item>
   </layout>
  </widget>
- <layoutdefault spacing="6" margin="11" />
  <resources/>
  <connections/>
 </ui>



More information about the QGIS-commit mailing list