Beispiel #1
0
void QgsCustomizationDialog::actionSave_triggered( bool checked )
{
  Q_UNUSED( checked );
  QSettings mySettings;
  QString lastDir = mySettings.value( mLastDirSettingsName, QDir::homePath() ).toString();

  QString fileName = QFileDialog::getSaveFileName( this,
                     tr( "Choose a customization INI file" ),
                     lastDir, tr( "Customization files (*.ini)" ) );

  if ( fileName.isEmpty() )
  {
    return;
  }

  if ( !fileName.endsWith( QLatin1String( ".ini" ), Qt::CaseInsensitive ) )
  {
    fileName += QLatin1String( ".ini" );
  }

  QFileInfo fileInfo( fileName );
  mySettings.setValue( mLastDirSettingsName, fileInfo.absoluteDir().absolutePath() );

  QSettings fileSettings( fileName, QSettings::IniFormat );
  treeToSettings( &fileSettings );
}
Beispiel #2
0
void QgsCustomizationDialog::apply()
{
  QgsDebugMsg( QString( "columnCount = %1" ).arg( treeWidget->columnCount() ) );
  treeToSettings( mSettings );
  mSettings->setValue( QgsCustomization::instance()->statusPath(), QgsCustomization::User );
  mSettings->sync();

  QSettings settings;
  settings.setValue( "/UI/Customization/enabled", mCustomizationEnabledCheckBox->isChecked() );
}
Beispiel #3
0
void QgsCustomizationDialog::on_actionSave_triggered( bool checked )
{
  Q_UNUSED( checked );
  QSettings mySettings;
  QString lastDir = mySettings.value( mLastDirSettingsName, "." ).toString();

  QString fileName = QFileDialog::getSaveFileName( this,
                     tr( "Choose a customization INI file" ),
                     lastDir, tr( "Customization files (*.ini)" ) );

  if ( fileName.isEmpty() )
    return;
  QFileInfo fileInfo( fileName );
  mySettings.setValue( mLastDirSettingsName, fileInfo.absoluteDir().absolutePath() );

  QSettings fileSettings( fileName, QSettings::IniFormat );
  treeToSettings( &fileSettings );
}