Skip to content
Permalink
Browse files

[GRASS] fixed modules file filters

  • Loading branch information
blazek committed Aug 31, 2015
1 parent 5326c6b commit dff2ed5f73fedfebf41a15f73f2e7b0221f13c46
@@ -5,7 +5,7 @@
<file key="input" type="old" filters="Binary (*.bin)" />
<option key="bytes" />
<option key="anull" />
<option key="output" filters="(*.bin)"/>
<option key="output" />
<flag key="f" answer="off" />
<flag key="d" answer="off" />
<flag key="s" answer="off" />
@@ -2,7 +2,7 @@
<!DOCTYPE qgisgrassmodule SYSTEM "http://mrcc.com/qgisgrassmodule.dtd">

<qgisgrassmodule label="Import raster from coordinates using univariate statistics" module="r.in.xyz">
<file key="input" type="old" filters="TXT (*.txt), CSV (*.csv)"/>
<file key="input" type="old" filters="TXT (*.txt);;CSV (*.csv)"/>
<option key="method" />
<option key="type" />
<option key="fs" version_max="6.4" />
@@ -3,6 +3,6 @@

<qgisgrassmodule label="Recode raster" module="r.recode.file">
<option key="input"/>
<file key="rules_file" type="new" fileoption="olayer" label="Text file" filters="Txt (*.txt), Csv (*.csv)" />
<file key="rules_file" type="new" fileoption="olayer" label="Text file" filters="Txt (*.txt);;Csv (*.csv)" />
<option key="output" />
</qgisgrassmodule>
@@ -1934,20 +1934,7 @@ QgsGrassModuleFile::QgsGrassModuleFile(
mType = Directory;
}

if ( !qdesc.attribute( "filters" ).isNull() )
{
mFilters = qdesc.attribute( "filters" ).split( ";;" );

if ( mFilters.size() > 0 )
{
QRegExp rx( ".*\\( *..([^ )]*).*" );
QString ext;
if ( rx.indexIn( mFilters.at( 0 ) ) == 0 )
{
mSuffix = rx.cap( 1 );
}
}
}
mFilters = qdesc.attribute( "filters" );

mFileOption = qdesc.attribute( "fileoption" );

@@ -1997,7 +1984,7 @@ void QgsGrassModuleFile::browse()
else
path = QFileInfo( path ).absolutePath();

QStringList files = QFileDialog::getOpenFileNames( this, 0, path );
QStringList files = QFileDialog::getOpenFileNames( this, 0, path, mFilters );
if ( files.isEmpty() )
return;

@@ -2016,7 +2003,7 @@ void QgsGrassModuleFile::browse()
else if ( mType == Directory )
selectedFile = QFileDialog::getExistingDirectory( this, 0, selectedFile );
else
selectedFile = QFileDialog::getOpenFileName( this, 0, selectedFile );
selectedFile = QFileDialog::getOpenFileName( this, 0, selectedFile, mFilters );

lastDir = QFileInfo( selectedFile ).absolutePath();

@@ -634,17 +634,14 @@ class QgsGrassModuleFile : public QgsGrassModuleGroupBoxItem
// ! Optionaly split file to dir and file path
QString mFileOption;

// ! Default suffix
QString mSuffix;

//! Line
QLineEdit *mLineEdit;

//! Browse button
QPushButton *mBrowseButton;

//! File filters
QStringList mFilters;
QString mFilters;
};

#endif // QGSGRASSMODULEPARAM_H

0 comments on commit dff2ed5

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