Skip to content

Commit

Permalink
Remove option to set icon themes
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 21, 2015
1 parent 4e09d4d commit d019e72
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 99 deletions.
3 changes: 0 additions & 3 deletions src/app/qgisapp.cpp
Expand Up @@ -7704,9 +7704,6 @@ void QgisApp::showOptionsDialog( QWidget *parent, QString currentPage )

if ( optionsDialog->exec() )
{
// set the theme if it changed
setTheme( optionsDialog->theme() );

QgsProject::instance()->layerTreeRegistryBridge()->setNewLayersVisible( mySettings.value( "/qgis/new_layers_visible", true ).toBool() );

setupLayerTreeViewFromSettings();
Expand Down
45 changes: 0 additions & 45 deletions src/app/qgsoptions.cpp
Expand Up @@ -83,10 +83,6 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl ) :
mStyleSheetNewOpts = mStyleSheetBuilder->defaultOptions();
mStyleSheetOldOpts = QMap<QString, QVariant>( mStyleSheetNewOpts );

connect( cmbTheme, SIGNAL( activated( const QString& ) ), this, SLOT( themeChanged( const QString& ) ) );
connect( cmbTheme, SIGNAL( highlighted( const QString& ) ), this, SLOT( themeChanged( const QString& ) ) );
connect( cmbTheme, SIGNAL( textChanged( const QString& ) ), this, SLOT( themeChanged( const QString& ) ) );

connect( mFontFamilyRadioCustom, SIGNAL( toggled( bool ) ), mFontFamilyComboBox, SLOT( setEnabled( bool ) ) );

connect( cmbIconSize, SIGNAL( activated( const QString& ) ), this, SLOT( iconSizeChanged( const QString& ) ) );
Expand Down Expand Up @@ -301,9 +297,6 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl ) :
//wms search server
leWmsSearch->setText( settings.value( "/qgis/WMSSearchUrl", "http://geopole.org/wms/search?search=%1&type=rss" ).toString() );

// set the current theme
cmbTheme->setItemText( cmbTheme->currentIndex(), settings.value( "/Themes" ).toString() );

// set the attribute table default filter
cmbAttrTableBehaviour->clear();
cmbAttrTableBehaviour->addItem( tr( "Show all features" ), QgsAttributeTableFilterModel::ShowAll );
Expand Down Expand Up @@ -488,22 +481,6 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl ) :
mKeepBaseUnitCheckBox->setChecked( false );
}


// add the themes to the combo box on the option dialog
QDir myThemeDir( ":/images/themes/" );
myThemeDir.setFilter( QDir::Dirs );
QStringList myDirList = myThemeDir.entryList( QStringList( "*" ) );
cmbTheme->clear();
for ( int i = 0; i < myDirList.count(); i++ )
{
if ( myDirList[i] != "." && myDirList[i] != ".." )
{
cmbTheme->addItem( myDirList[i] );
}
}

// set the theme combo
cmbTheme->setCurrentIndex( cmbTheme->findText( settings.value( "/Themes", "default" ).toString() ) );
cmbIconSize->setCurrentIndex( cmbIconSize->findText( settings.value( "/IconSize", QGIS_ICON_SIZE ).toString() ) );

// set font size and family
Expand Down Expand Up @@ -945,12 +922,6 @@ void QgsOptions::on_pbnTemplateFolderReset_pressed()
leTemplateFolder->setText( QgsApplication::qgisSettingsDirPath() + QString( "project_templates" ) );
}

void QgsOptions::themeChanged( const QString &newThemeName )
{
// Slot to change the theme as user scrolls through the choices
QgisApp::instance()->setTheme( newThemeName );
}

void QgsOptions::iconSizeChanged( const QString &iconSize )
{
QgisApp::instance()->setIconSizes( iconSize.toInt() );
Expand Down Expand Up @@ -978,12 +949,6 @@ void QgsOptions::on_mProjectOnLaunchPushBtn_pressed()
}
}

QString QgsOptions::theme()
{
// returns the current theme (as selected in the cmbTheme combo box)
return cmbTheme->currentText();
}

void QgsOptions::saveOptions()
{
QSettings settings;
Expand Down Expand Up @@ -1142,16 +1107,6 @@ void QgsOptions::saveOptions()

settings.setValue( "/qgis/nullValue", leNullValue->text() );
settings.setValue( "/qgis/style", cmbStyle->currentText() );

if ( cmbTheme->currentText().length() == 0 )
{
settings.setValue( "/Themes", "default" );
}
else
{
settings.setValue( "/Themes", cmbTheme->currentText() );
}

settings.setValue( "/IconSize", cmbIconSize->currentText() );

settings.setValue( "/qgis/messageTimeout", mMessageTimeoutSpnBx->value() );
Expand Down
7 changes: 0 additions & 7 deletions src/app/qgsoptions.h
Expand Up @@ -46,11 +46,6 @@ class APP_EXPORT QgsOptions : public QgsOptionsDialogBase, private Ui::QgsOption
QgsOptions( QWidget *parent = 0, Qt::WindowFlags fl = QgisGui::ModalDialogFlags );
//! Destructor
~QgsOptions();
/**
* Return the currently selected theme
* @return theme name (a directory name in the themes directory)
*/
QString theme();

/** Sets the page with the specified widget name as the current page
* @note added in QGIS 2.1
Expand All @@ -76,8 +71,6 @@ class APP_EXPORT QgsOptions : public QgsOptionsDialogBase, private Ui::QgsOption
* Slot to reset any temporarily applied options on dialog close/cancel */
void rejectOptions();
//! Slot to change the theme this is handled when the user
// activates or highlights a theme name in the drop-down list
void themeChanged( const QString & );

void iconSizeChanged( const QString &iconSize );

Expand Down
45 changes: 1 addition & 44 deletions src/ui/qgsoptionsbase.ui
Expand Up @@ -311,7 +311,7 @@
<x>0</x>
<y>0</y>
<width>635</width>
<height>670</height>
<height>635</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_28">
Expand Down Expand Up @@ -351,48 +351,6 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="textLabel1_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Icon theme</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QComboBox" name="cmbTheme">
<property name="duplicatesEnabled">
<bool>false</bool>
</property>
<item>
<property name="text">
<string/>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
Expand Down Expand Up @@ -4960,7 +4918,6 @@
<tabstop>mOptionsListWidget</tabstop>
<tabstop>mOptionsScrollArea_01</tabstop>
<tabstop>cmbStyle</tabstop>
<tabstop>cmbTheme</tabstop>
<tabstop>cmbIconSize</tabstop>
<tabstop>mFontFamilyRadioQt</tabstop>
<tabstop>mFontFamilyRadioCustom</tabstop>
Expand Down

1 comment on commit d019e72

@NathanW2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

;)

Please sign in to comment.