mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
Merge branch 'master' of github.com:qgis/Quantum-GIS
This commit is contained in:
commit
ccf3195760
@ -103,67 +103,9 @@ class GrassAlgorithm(GeoAlgorithm):
|
||||
raise e
|
||||
lines.close()
|
||||
|
||||
#=======================================================================
|
||||
# self.xmin = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_XMIN)
|
||||
# self.xmax = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_XMAX)
|
||||
# self.ymin = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_YMIN)
|
||||
# self.ymax = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_YMAX)
|
||||
# extentString = str(self.xmin) + "," + str(self.xmax) + str(self.xmin) + "," + str(self.xmax)
|
||||
# self.cellsize = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_CELLSIZE)
|
||||
#=======================================================================
|
||||
self.addParameter(ParameterExtent(self.GRASS_REGION_EXTENT_PARAMETER, "GRASS region extent"))
|
||||
self.addParameter(ParameterNumber(self.GRASS_REGION_CELLSIZE_PARAMETER, "GRASS region cellsize", 0, None, 1))
|
||||
|
||||
#===============================================================================
|
||||
# def calculateRegion(self):
|
||||
# auto = SextanteConfig.getSetting(GrassUtils.GRASS_AUTO_REGION)
|
||||
# if auto:
|
||||
# try:
|
||||
# self.cellsize = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_CELLSIZE)
|
||||
# except Exception:
|
||||
# self.cellsize = 0;
|
||||
# first = True;
|
||||
# for param in self.parameters:
|
||||
# if param.value:
|
||||
# if isinstance(param, (ParameterRaster, ParameterVector)):
|
||||
# if isinstance(param.value, (QgsRasterLayer, QgsVectorLayer)):
|
||||
# layer = param.value
|
||||
# else:
|
||||
# layer = QGisLayers.getObjectFromUri(param.value)
|
||||
# self.addToRegion(layer, first)
|
||||
# first = False
|
||||
# elif isinstance(param, ParameterMultipleInput):
|
||||
# layers = param.value.split(";")
|
||||
# for layername in layers:
|
||||
# layer = QGisLayers.getObjectFromUri(layername, first)
|
||||
# self.addToRegion(layer, first)
|
||||
# first = False
|
||||
# if self.cellsize == 0:
|
||||
# self.cellsize = 1
|
||||
# else:
|
||||
# self.xmin = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_XMIN)
|
||||
# self.xmax = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_XMAX)
|
||||
# self.ymin = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_YMIN)
|
||||
# self.ymax = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_YMAX)
|
||||
# self.cellsize = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_CELLSIZE)
|
||||
#
|
||||
#
|
||||
# def addToRegion(self, layer, first):
|
||||
# if first:
|
||||
# self.xmin = layer.extent().xMinimum()
|
||||
# self.xmax = layer.extent().xMaximum()
|
||||
# self.ymin = layer.extent().yMinimum()
|
||||
# self.ymax = layer.extent().yMaximum()
|
||||
# if isinstance(layer, QgsRasterLayer):
|
||||
# self.cellsize = (layer.extent().xMaximum() - layer.extent().xMinimum())/layer.width()
|
||||
# else:
|
||||
# self.xmin = min(self.xmin, layer.extent().xMinimum())
|
||||
# self.xmax = max(self.xmax, layer.extent().xMaximum())
|
||||
# self.ymin = min(self.ymin, layer.extent().yMinimum())
|
||||
# self.ymax = max(self.ymax, layer.extent().yMaximum())
|
||||
# if isinstance(layer, QgsRasterLayer):
|
||||
# self.cellsize = max(self.cellsize, (layer.extent().xMaximum() - layer.extent().xMinimum())/layer.width())
|
||||
#===============================================================================
|
||||
|
||||
def processAlgorithm(self, progress):
|
||||
if SextanteUtils.isWindows():
|
||||
@ -327,18 +269,3 @@ class GrassAlgorithm(GeoAlgorithm):
|
||||
|
||||
def commandLineName(self):
|
||||
return "grass:" + self.name[:self.name.find(" ")]
|
||||
|
||||
#===============================================================================
|
||||
# def checkBeforeOpeningParametersDialog(self):
|
||||
# for param in self.parameters:
|
||||
# if isinstance(param, (ParameterRaster, ParameterVector)):
|
||||
# return None
|
||||
# if isinstance(param, ParameterMultipleInput):
|
||||
# if not param.optional:
|
||||
# return None
|
||||
#
|
||||
# if SextanteConfig.getSetting(GrassUtils.GRASS_AUTO_REGION):
|
||||
# return "This algorithm cannot be run with the 'auto-region' setting\nPlease set a GRASS region before running it"
|
||||
# else:
|
||||
# return None
|
||||
#===============================================================================
|
||||
|
@ -230,7 +230,7 @@ class RAlgorithm(GeoAlgorithm):
|
||||
# if rgdal is not available, try to install it
|
||||
# just use US mirror
|
||||
commands.append('options("repos"="http://cran.us.r-project.org")')
|
||||
rLibDir = "%s/rlibs" % SextanteUtils.userFolder()
|
||||
rLibDir = "%s/rlibs" % SextanteUtils.userFolder().replace("\\","/")
|
||||
if not os.path.isdir(rLibDir): os.mkdir(rLibDir)
|
||||
commands.append(
|
||||
'tryCatch(find.package("rgdal"), error=function(e) install.packages("rgdal", lib="%s"))' % rLibDir)
|
||||
|
@ -268,15 +268,12 @@ QgsLabelingGui::QgsLabelingGui( QgsPalLabeling* lbl, QgsVectorLayer* layer, QgsM
|
||||
connect( quadrantRadios[i], SIGNAL( toggled( bool ) ), this, SLOT( updateQuadrant() ) );
|
||||
}
|
||||
|
||||
// Label tab collapsed groupboxes
|
||||
chkBuffer->setCollapsed( true );
|
||||
mFontMultiLineGroupBox->setCollapsed( true );
|
||||
chkFormattedNumbers->setCollapsed( true );
|
||||
chkScaleBasedVisibility->setCollapsed( true );
|
||||
|
||||
// Data defined tab collapsed groupboxes
|
||||
mBufferAttributesPropertiesGroupBox->setCollapsed( true );
|
||||
mFontAttributePropertiesGroupBox->setCollapsed( true );
|
||||
// Global settings group for groupboxes' saved/retored collapsed state
|
||||
// maintains state across different dialogs
|
||||
foreach ( QgsCollapsibleGroupBox *grpbox, findChildren<QgsCollapsibleGroupBox*>() )
|
||||
{
|
||||
grpbox->setSettingGroup( QString( "mAdvLabelingDlg" ) );
|
||||
}
|
||||
|
||||
connect( groupBox_mPreview,
|
||||
SIGNAL( collapsedStateChanged( QgsCollapsibleGroupBox* ) ),
|
||||
|
@ -52,6 +52,10 @@ void QgsCollapsibleGroupBox::init()
|
||||
// variables
|
||||
mCollapsed = false;
|
||||
mSaveState = true;
|
||||
// NOTE: only turn on mSaveCheckedState for groupboxes NOT used
|
||||
// in multiple places or used as options for different parent objects
|
||||
mSaveCheckedState = false;
|
||||
mSettingGroup = ""; // if not set, use window object name
|
||||
mInitFlat = false;
|
||||
mScrollOnExpand = true;
|
||||
mShown = false;
|
||||
@ -167,7 +171,8 @@ QString QgsCollapsibleGroupBox::saveKey() const
|
||||
// }
|
||||
// if ( parent() != NULL )
|
||||
// saveKey = "/" + parent()->objectName() + saveKey;
|
||||
saveKey = "/" + window()->objectName() + saveKey;
|
||||
QString setgrp = mSettingGroup.isEmpty() ? window()->objectName() : mSettingGroup;
|
||||
saveKey = "/" + setgrp + saveKey;
|
||||
saveKey = "QgsCollapsibleGroupBox" + saveKey;
|
||||
return saveKey;
|
||||
}
|
||||
@ -181,9 +186,13 @@ void QgsCollapsibleGroupBox::loadState()
|
||||
|
||||
QSettings settings;
|
||||
QString key = saveKey();
|
||||
QVariant val = settings.value( key + "/checked" );
|
||||
if ( ! val.isNull() )
|
||||
setChecked( val.toBool() );
|
||||
QVariant val;
|
||||
if ( mSaveCheckedState )
|
||||
{
|
||||
val = settings.value( key + "/checked" );
|
||||
if ( ! val.isNull() )
|
||||
setChecked( val.toBool() );
|
||||
}
|
||||
val = settings.value( key + "/collapsed" );
|
||||
if ( ! val.isNull() )
|
||||
setCollapsed( val.toBool() );
|
||||
@ -197,7 +206,8 @@ void QgsCollapsibleGroupBox::saveState()
|
||||
return;
|
||||
QSettings settings;
|
||||
QString key = saveKey();
|
||||
settings.setValue( key + "/checked", isChecked() );
|
||||
if ( mSaveCheckedState )
|
||||
settings.setValue( key + "/checked", isChecked() );
|
||||
settings.setValue( key + "/collapsed", isCollapsed() );
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,14 @@ class GUI_EXPORT QgsCollapsibleGroupBox : public QGroupBox
|
||||
|
||||
//! set this to false to not save/restore check and collapse state
|
||||
void setSaveState( bool save ) { mSaveState = save; }
|
||||
//! set this to true to save/restore checked state
|
||||
/** @note only turn on mSaveCheckedState for groupboxes NOT used
|
||||
* in multiple places or used as options for different parent objects */
|
||||
void setSaveCheckedState( bool save ) { mSaveCheckedState = save; }
|
||||
bool saveCheckedState() { return mSaveCheckedState; }
|
||||
//! set this to a defined string to share save/restore collapsed state across dialogs
|
||||
void setSettingGroup( const QString &group ) { mSettingGroup = group; }
|
||||
QString settingGroup() const { return mSettingGroup; }
|
||||
//! set this to false to not automatically scroll parent QScrollArea to this widget's contents when expanded
|
||||
void setScrollOnExpand( bool scroll ) { mScrollOnExpand = scroll; }
|
||||
|
||||
@ -71,6 +79,8 @@ class GUI_EXPORT QgsCollapsibleGroupBox : public QGroupBox
|
||||
|
||||
bool mCollapsed;
|
||||
bool mSaveState;
|
||||
bool mSaveCheckedState;
|
||||
QString mSettingGroup;
|
||||
bool mInitFlat;
|
||||
bool mScrollOnExpand;
|
||||
bool mShown;
|
||||
|
Loading…
x
Reference in New Issue
Block a user