configdialog.cpp
00001 /* 00002 This file is part of Akregator. 00003 00004 Copyright (C) 2005 Frank Osterfeld <frank.osterfeld@kdemail.net> 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00019 00020 As a special exception, permission is given to link this program 00021 with any edition of TQt, and distribute the resulting executable, 00022 without including the source code for TQt in the source distribution. 00023 */ 00024 00025 #include <tqstringlist.h> 00026 00027 #include <kcombobox.h> 00028 #include <klocale.h> 00029 00030 #include "configdialog.h" 00031 00032 #include "akregatorconfig.h" 00033 #include "settings_advanced.h" 00034 #include "settings_appearance.h" 00035 #include "settings_archive.h" 00036 #include "settings_browser.h" 00037 #include "settings_general.h" 00038 #include <tqslider.h> 00039 #include <tqlabel.h> 00040 00041 namespace Akregator 00042 { 00043 00044 ConfigDialog::ConfigDialog(TQWidget* parent, const char* name, KConfigSkeleton* config, DialogType dialogType, int dialogButtons, ButtonCode defaultButton, bool modal) : KConfigDialog(parent, name, config, dialogType, dialogButtons, defaultButton, modal) 00045 { 00046 addPage(new SettingsGeneral(this, "General"), i18n("General"), "package_settings"); 00047 addPage(new SettingsArchive(this, "Archive"), i18n("Archive"), "package_settings"); 00048 m_settingsAppearance = new SettingsAppearance(this, "Appearance"); 00049 addPage(m_settingsAppearance, i18n("Appearance"), "fonts"); 00050 addPage(new SettingsBrowser(this, "Browser"), i18n("Browser"), "package_network"); 00051 m_settingsAdvanced = new SettingsAdvanced(this, "Advanced"); 00052 addPage(m_settingsAdvanced, i18n("Advanced"), "package_network"); 00053 m_settingsAdvanced->selectFactory(Settings::archiveBackend()); 00054 m_config = config; 00055 } 00056 00057 void ConfigDialog::updateSettings() 00058 { 00059 Settings::setArchiveBackend(m_settingsAdvanced->selectedFactory()); 00060 KConfigDialog::updateSettings(); 00061 } 00062 00063 void ConfigDialog::updateWidgets() 00064 { 00065 m_settingsAdvanced->selectFactory(Settings::archiveBackend()); 00066 m_settingsAppearance->slider_minimumFontSize->setDisabled(m_config->isImmutable("MinimumFontSize")); 00067 m_settingsAppearance->slider_mediumFontSize->setDisabled(m_config->isImmutable("MediumFontSize")); 00068 m_settingsAppearance->lbl_MinimumFontSize->setDisabled(m_config->isImmutable("MinimumFontSize")); 00069 m_settingsAppearance->lbl_MediumFontSize->setDisabled(m_config->isImmutable("MediumFontSize")); 00070 KConfigDialog::updateWidgets(); 00071 } 00072 00073 ConfigDialog::~ConfigDialog() {} 00074 00075 } // namespace Akregator 00076 00077 #include "configdialog.moc"