Skip to content

Commit

Permalink
More default path fixes. Remove What's This? from toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanW2 committed Dec 3, 2015
1 parent 3cbad7d commit 18c52ab
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/app/composer/qgscomposer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3043,7 +3043,7 @@ void QgsComposer::on_mActionLoadFromTemplate_triggered()
void QgsComposer::loadTemplate( const bool newComposer )
{
QSettings settings;
QString openFileDir = settings.value( "UI/lastComposerTemplateDir", "" ).toString();
QString openFileDir = settings.value( "UI/lastComposerTemplateDir", QDir::homePath() ).toString();
QString openFileString = QFileDialog::getOpenFileName( 0, tr( "Load template" ), openFileDir, "*.qpt" );

if ( openFileString.isEmpty() )
Expand Down
5 changes: 0 additions & 5 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1906,11 +1906,6 @@ void QgisApp::createToolBars()
connect( tbAddCircularString, SIGNAL( triggered( QAction * ) ), this, SLOT( toolButtonActionTriggered( QAction * ) ) );
mDigitizeToolBar->insertWidget( mActionMoveFeature, tbAddCircularString );

// Help Toolbar
QAction* actionWhatsThis = QWhatsThis::createAction( this );
actionWhatsThis->setIcon( QgsApplication::getThemeIcon( "/mActionWhatsThis.svg" ) );
mHelpToolBar->addAction( actionWhatsThis );

// Cad toolbar
mAdvancedDigitizeToolBar->insertAction( mActionUndo, mAdvancedDigitizingDockWidget->enableAction() );
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsfieldsproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ QgsAttributeEditorElement* QgsFieldsProperties::createAttributeEditorWidget( QTr
void QgsFieldsProperties::on_pbnSelectEditForm_clicked()
{
QSettings myQSettings;
QString lastUsedDir = myQSettings.value( "style/lastUIDir", "." ).toString();
QString lastUsedDir = myQSettings.value( "style/lastUIDir", QDir::homePath() ).toString();
QString uifilename = QFileDialog::getOpenFileName( this, tr( "Select edit form" ), lastUsedDir, tr( "UI file" ) + " (*.ui)" );

if ( uifilename.isNull() )
Expand Down
8 changes: 4 additions & 4 deletions src/app/qgsrasterlayerproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,7 @@ void QgsRasterLayerProperties::adjustTransparencyCellWidth( int row, int column
void QgsRasterLayerProperties::on_pbnExportTransparentPixelValues_clicked()
{
QSettings myQSettings;
QString myLastDir = myQSettings.value( "lastRasterFileFilterDir", "" ).toString();
QString myLastDir = myQSettings.value( "lastRasterFileFilterDir", QDir::homePath() ).toString();
QString myFileName = QFileDialog::getSaveFileName( this, tr( "Save file" ), myLastDir, tr( "Textfile" ) + " (*.txt)" );
if ( !myFileName.isEmpty() )
{
Expand Down Expand Up @@ -1391,7 +1391,7 @@ void QgsRasterLayerProperties::on_pbnImportTransparentPixelValues_clicked()
bool myImportError = false;
QString myBadLines;
QSettings myQSettings;
QString myLastDir = myQSettings.value( "lastRasterFileFilterDir", "" ).toString();
QString myLastDir = myQSettings.value( "lastRasterFileFilterDir", QDir::homePath() ).toString();
QString myFileName = QFileDialog::getOpenFileName( this, tr( "Open file" ), myLastDir, tr( "Textfile" ) + " (*.txt)" );
QFile myInputFile( myFileName );
if ( myInputFile.open( QFile::ReadOnly ) )
Expand Down Expand Up @@ -1684,7 +1684,7 @@ void QgsRasterLayerProperties::saveDefaultStyle_clicked()
void QgsRasterLayerProperties::loadStyle_clicked()
{
QSettings settings;
QString lastUsedDir = settings.value( "style/lastStyleDir", "." ).toString();
QString lastUsedDir = settings.value( "style/lastStyleDir", QDir::homePath() ).toString();

QString fileName = QFileDialog::getOpenFileName(
this,
Expand Down Expand Up @@ -1715,7 +1715,7 @@ void QgsRasterLayerProperties::loadStyle_clicked()
void QgsRasterLayerProperties::saveStyleAs_clicked()
{
QSettings settings;
QString lastUsedDir = settings.value( "style/lastStyleDir", "." ).toString();
QString lastUsedDir = settings.value( "style/lastStyleDir", QDir::homePath() ).toString();

QString outputFileName = QFileDialog::getSaveFileName(
this,
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgssavestyletodbdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void QgsSaveStyleToDbDialog::accept()
void QgsSaveStyleToDbDialog::on_mFilePickButton_clicked()
{
QSettings myQSettings; // where we keep last used filter in persistent state
QString myLastUsedDir = myQSettings.value( "style/lastStyleDir", "." ).toString();
QString myLastUsedDir = myQSettings.value( "style/lastStyleDir", QDir::homePath() ).toString();

QString myFileName = QFileDialog::getOpenFileName( this, tr( "Attach Qt Designer UI file" ), myLastUsedDir, tr( "Qt Designer UI file .ui" ) + " (*.ui)" );
if ( myFileName.isNull() )
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsvectorlayerproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ void QgsVectorLayerProperties::saveDefaultStyle_clicked()
void QgsVectorLayerProperties::loadStyle_clicked()
{
QSettings myQSettings; // where we keep last used filter in persistent state
QString myLastUsedDir = myQSettings.value( "style/lastStyleDir", "." ).toString();
QString myLastUsedDir = myQSettings.value( "style/lastStyleDir", QDir::homePath() ).toString();

QString myFileName = QFileDialog::getOpenFileName( this, tr( "Load layer properties from style file" ), myLastUsedDir,
tr( "QGIS Layer Style File" ) + " (*.qml);;" + tr( "SLD File" ) + " (*.sld)" );
Expand Down Expand Up @@ -875,7 +875,7 @@ void QgsVectorLayerProperties::saveStyleAsMenuTriggered( QAction *action )
void QgsVectorLayerProperties::saveStyleAs( StyleType styleType )
{
QSettings myQSettings; // where we keep last used filter in persistent state
QString myLastUsedDir = myQSettings.value( "style/lastStyleDir", "." ).toString();
QString myLastUsedDir = myQSettings.value( "style/lastStyleDir", QDir::homePath() ).toString();

QString format, extension;
if ( styleType == DB )
Expand Down
2 changes: 1 addition & 1 deletion src/gui/raster/qgssinglebandpseudocolorrendererwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ void QgsSingleBandPseudoColorRendererWidget::on_mLoadFromFileButton_clicked()
void QgsSingleBandPseudoColorRendererWidget::on_mExportToFileButton_clicked()
{
QSettings settings;
QString lastDir = settings.value( "lastRasterFileFilterDir", "" ).toString();
QString lastDir = settings.value( "lastRasterFileFilterDir", QDir::homePath() ).toString();
QString fileName = QFileDialog::getSaveFileName( this, tr( "Save file" ), lastDir, tr( "Textfile (*.txt)" ) );
if ( !fileName.isEmpty() )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ int QgsCategorizedSymbolRendererV2Widget::matchToSymbols( QgsStyleV2* style )
void QgsCategorizedSymbolRendererV2Widget::matchToSymbolsFromXml()
{
QSettings settings;
QString openFileDir = settings.value( "UI/lastMatchToSymbolsDir", "" ).toString();
QString openFileDir = settings.value( "UI/lastMatchToSymbolsDir", QDir::homePath() ).toString();

QString fileName = QFileDialog::getOpenFileName( this, tr( "Match to symbols from file" ), openFileDir,
tr( "XML files (*.xml *XML)" ) );
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/evis/eventbrowser/evisconfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ eVisConfiguration::eVisConfiguration()
setAttributeCompassOffset( myQSettings.value( "/eVis/attributecompassoffset", false ).toBool() );
setCompassOffsetField( myQSettings.value( "/eVis/compassoffsetfield", "" ).toString() );

setBasePath( myQSettings.value( "/eVis/basepath", "" ).toString() );
setBasePath( myQSettings.value( "/eVis/basepath", QDir::homePath() ).toString() );
mUseOnlyFilename = myQSettings.value( "/eVis/useonlyfilename", false ).toBool();
}

Expand Down
6 changes: 3 additions & 3 deletions src/plugins/georeferencer/qgstransformsettingsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ void QgsTransformSettingsDialog::resetSettings()
s.setValue( "/Plugin-GeoReferencer/user_specified_resx", 1.0 );
s.setValue( "/Plugin-GeoReferencer/user_specified_resy", -1.0 );
s.setValue( "/Plugin-GeoReferencer/word_file_checkbox", false );
s.setValue( "/Plugin-GeoReferencer/lastPDFReportDir", "" );
s.setValue( "/Plugin-GeoReferencer/lastPDFReportDir", QDir::homePath() );
}

void QgsTransformSettingsDialog::changeEvent( QEvent *e )
Expand Down Expand Up @@ -218,7 +218,7 @@ void QgsTransformSettingsDialog::on_tbnOutputRaster_clicked()
void QgsTransformSettingsDialog::on_tbnMapFile_clicked()
{
QSettings s;
QString myLastUsedDir = s.value( "/Plugin-GeoReferencer/lastPDFReportDir", "" ).toString();
QString myLastUsedDir = s.value( "/Plugin-GeoReferencer/lastPDFReportDir", QDir::homePath() ).toString();
QString initialFile = !mMapFileLineEdit->text().isEmpty() ? mMapFileLineEdit->text() : myLastUsedDir;
QString outputFileName = QFileDialog::getSaveFileName( this, tr( "Save Map File as" ), initialFile, tr( "PDF Format" ) + " (*.pdf *PDF)" );
if ( !outputFileName.isNull() )
Expand All @@ -234,7 +234,7 @@ void QgsTransformSettingsDialog::on_tbnMapFile_clicked()
void QgsTransformSettingsDialog::on_tbnReportFile_clicked()
{
QSettings s;
QString myLastUsedDir = s.value( "/Plugin-GeoReferencer/lastPDFReportDir", "" ).toString();
QString myLastUsedDir = s.value( "/Plugin-GeoReferencer/lastPDFReportDir", QDir::homePath() ).toString();
QString initialFile = !mReportFileLineEdit->text().isEmpty() ? mReportFileLineEdit->text() : myLastUsedDir;
QString outputFileName = QFileDialog::getSaveFileName( this, tr( "Save Report File as" ), initialFile, tr( "PDF Format" ) + " (*.pdf *PDF)" );
if ( !outputFileName.isNull() )
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/gps_importer/qgsgpsplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ void QgsGPSPlugin::run()
void QgsGPSPlugin::createGPX()
{
QSettings settings;
QString dir = settings.value( "/Plugin-GPS/gpxdirectory", "." ).toString();
QString dir = settings.value( "/Plugin-GPS/gpxdirectory", QDir::homePath() ).toString();
QString fileName =
QFileDialog::getSaveFileName( mQGisInterface->mainWindow(),
tr( "Save new GPX file as..." ),
Expand Down Expand Up @@ -562,7 +562,7 @@ void QgsGPSPlugin::setupBabel()
{
// where is gpsbabel?
QSettings settings;
mBabelPath = settings.value( "/Plugin-GPS/gpsbabelpath", "" ).toString();
mBabelPath = settings.value( "/Plugin-GPS/gpsbabelpath", QDir::homePath() ).toString();
if ( mBabelPath.isEmpty() )
mBabelPath = "gpsbabel";
// the importable formats
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/heatmap/heatmapgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ void HeatmapGui::on_mButtonBox_helpRequested()
void HeatmapGui::on_mBrowseButton_clicked()
{
QSettings s;
QString lastDir = s.value( "/Heatmap/lastOutputDir", "" ).toString();
QString lastDir = s.value( "/Heatmap/lastOutputDir", QDir::homePath() ).toString();

QString outputFilename = QFileDialog::getSaveFileName( 0, tr( "Save Heatmap as:" ), lastDir );
if ( !outputFilename.isEmpty() )
Expand Down

0 comments on commit 18c52ab

Please sign in to comment.