Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #2112 from slarosa/release-2_8
Backporting to 2.8.3
  • Loading branch information
slarosa committed Jul 13, 2015
2 parents b180dec + 1edcf3c commit 18c48f3
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 6 deletions.
3 changes: 1 addition & 2 deletions python/user.py
Expand Up @@ -23,8 +23,7 @@ def load_user_expressions(path):
except:
error = traceback.format_exc()
msgtitle = QCoreApplication.translate("UserExpressions", "User expressions")
msg = QCoreApplication.translate("UserExpressions",
"The user expression {0} is not valid".format(name))
msg = QCoreApplication.translate("UserExpressions", "The user expression {0} is not valid").format(name)
QgsMessageLog.logMessage(msg +"\n"+ error, msgtitle, QgsMessageLog.WARNING)


Expand Down
2 changes: 1 addition & 1 deletion scripts/update_ts.sh
Expand Up @@ -88,7 +88,7 @@ fi

echo Updating python translations
cd python
pylupdate4 utils.py {console,pyplugin_installer}/*.{py,ui} -ts python-i18n.ts
pylupdate4 user.py utils.py {console,pyplugin_installer}/*.{py,ui} -ts python-i18n.ts
perl ../scripts/ts2cpp.pl python-i18n.ts python-i18n.cpp
rm python-i18n.ts
cd ..
Expand Down
6 changes: 3 additions & 3 deletions src/app/qgsbookmarks.cpp
Expand Up @@ -267,7 +267,7 @@ void QgsBookmarks::importFromXML()
{
QSettings settings;

QString lastUsedDir = settings.value( "/Bookmark/LastUsedDirectory", QVariant() ).toString();
QString lastUsedDir = settings.value( "/Windows/Bookmarks/LastUsedDirectory", QVariant() ).toString();
QString fileName = QFileDialog::getOpenFileName( this, tr( "Import Bookmarks" ), lastUsedDir,
tr( "XML files (*.xml *XML)" ) );
if ( fileName.isEmpty() )
Expand Down Expand Up @@ -343,7 +343,7 @@ void QgsBookmarks::exportToXML()
{
QSettings settings;

QString lastUsedDir = settings.value( "/Bookmark/LastUsedDirectory", QVariant() ).toString();
QString lastUsedDir = settings.value( "/Windows/Bookmarks/LastUsedDirectory", QVariant() ).toString();
QString fileName = QFileDialog::getSaveFileName( this, tr( "Export bookmarks" ), lastUsedDir,
tr( "XML files( *.xml *.XML )" ) );
if ( fileName.isEmpty() )
Expand Down Expand Up @@ -399,5 +399,5 @@ void QgsBookmarks::exportToXML()
doc.save( out, 2 );
f.close();

settings.setValue( "/Bookmark/LastUsedDirectory", QFileInfo( fileName ).path() );
settings.setValue( "/Windows/Bookmarks/LastUsedDirectory", QFileInfo( fileName ).path() );
}
8 changes: 8 additions & 0 deletions src/gui/qgsexpressionbuilderwidget.cpp
Expand Up @@ -81,6 +81,11 @@ QgsExpressionBuilderWidget::QgsExpressionBuilderWidget( QWidget *parent )
{
tab_2->setEnabled( false );
}

// select the first item in the function list
// in order to avoid a blank help widget
QModelIndex firstItem = mProxyModel->index( 0, 0, QModelIndex() );
expressionTree->setCurrentIndex( firstItem );
}


Expand Down Expand Up @@ -132,6 +137,8 @@ void QgsExpressionBuilderWidget::runPythonCode( QString code )
QgsPythonRunner::run( pythontext );
}
updateFunctionTree();
loadFieldNames();
loadRecent( mRecentKey );
}

void QgsExpressionBuilderWidget::saveFunctionFile( QString fileName )
Expand Down Expand Up @@ -347,6 +354,7 @@ void QgsExpressionBuilderWidget::saveToRecent( QString key )

void QgsExpressionBuilderWidget::loadRecent( QString key )
{
mRecentKey = key;
QString name = tr( "Recent (%1)" ).arg( key );
if ( mExpressionGroups.contains( name ) )
{
Expand Down
1 change: 1 addition & 0 deletions src/gui/qgsexpressionbuilderwidget.h
Expand Up @@ -218,6 +218,7 @@ class GUI_EXPORT QgsExpressionBuilderWidget : public QWidget, private Ui::QgsExp
QgsExpressionHighlighter* highlighter;
bool mExpressionValid;
QgsDistanceArea mDa;
QString mRecentKey;

};

Expand Down
5 changes: 5 additions & 0 deletions src/gui/qgsrasterlayersaveasdialog.cpp
Expand Up @@ -203,6 +203,11 @@ void QgsRasterLayerSaveAsDialog::on_mBrowseButton_clicked()

if ( !fileName.isEmpty() )
{
// ensure the user never ommited the extension from the file name
if ( !fileName.toLower().endsWith( ".tif" ) && !fileName.toLower().endsWith( ".tiff" ) )
{
fileName += ".tif";
}
mSaveAsLineEdit->setText( fileName );
}
}
Expand Down

0 comments on commit 18c48f3

Please sign in to comment.