From 6668b34bc5deb36e73aa45e0457ed6740f828efd Mon Sep 17 00:00:00 2001 From: Mavridis Philippe Date: Sun, 12 Dec 2021 15:50:37 +0200 Subject: Implemented icon theme option. Changes in this commit include: * The option itself; * A method of updating the option right after Apply or Ok is pressed in the settings dialog; * A new WeatherIconPrivate class to store the methods previously in WeatherIcons, as well as the settings; * Improved icon name helper function in METAR parser; * A few cleanups to the WeatherIcon class. Signed-off-by: Mavridis Philippe --- kweather/kcmweather.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'kweather/kcmweather.cpp') diff --git a/kweather/kcmweather.cpp b/kweather/kcmweather.cpp index 9251737..b480980 100644 --- a/kweather/kcmweather.cpp +++ b/kweather/kcmweather.cpp @@ -71,6 +71,8 @@ KCMWeather::KCMWeather( TQWidget *parent, const char *name ) TQT_SLOT( reportLocationChanged() ) ); connect( mWidget->m_textColor, TQT_SIGNAL( changed(const TQColor &) ), TQT_SLOT( textColorChanged(const TQColor &) ) ); + connect( mWidget->m_iconTheme, TQT_SIGNAL( released( int ) ), + TQT_SLOT( changed() ) ); TDEAboutData *about = new TDEAboutData( I18N_NOOP( "kcmweather" ), @@ -182,6 +184,9 @@ void KCMWeather::load() mWidget->m_viewMode->setButton( config.readNumEntry( "smallview_mode", dockwidget::ShowAll ) ); changeViewMode( config.readNumEntry( "smallview_mode", dockwidget::ShowAll ) ); + + mWidget->m_iconTheme->setButton( config.readBoolEntry("use_icon_theme", true) ? 0 : 1 ); + emit changed( false ); } @@ -202,6 +207,9 @@ void KCMWeather::save() config.writeEntry( "report_location", loc); config.writeEntry( "smallview_mode", mViewMode ); + + config.writeEntry( "use_icon_theme", mWidget->m_iconTheme->selectedId() == 0 ); + config.sync(); emit changed( false ); -- cgit v1.2.1