kalarm Library API Documentation

prefdlg.cpp

00001 /*
00002  *  prefdlg.cpp  -  program preferences dialog
00003  *  Program:  kalarm
00004  *  (C) 2001, 2002 by David Jarvie  software@astrojar.org.uk
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., 675 Mass Ave, Cambridge, MA 02139, USA.
00019  *
00020  *  As a special exception, permission is given to link this program
00021  *  with any edition of Qt, and distribute the resulting executable,
00022  *  without including the source code for Qt in the source distribution.
00023  */
00024 
00025 #include <qvbox.h>
00026 
00027 #include <kapplication.h>
00028 #include <klocale.h>
00029 #include <kiconloader.h>
00030 #include <kdebug.h>
00031 
00032 #include "prefs.h"
00033 #include "prefdlg.moc"
00034 
00035 
00036 KAlarmPrefDlg::KAlarmPrefDlg(Settings* sets)
00037    : KDialogBase(IconList, i18n("Preferences"), Help | Default | Ok | Apply | Cancel, Ok, 0, 0, true, true)
00038 {
00039    setIconListAllVisible(true);
00040 
00041    QVBox* frame = addVBoxPage(i18n("General"), i18n("General"), DesktopIcon("misc"));
00042    m_miscPage = new MiscPrefTab(frame);
00043    m_miscPage->setSettings(sets);
00044 
00045    frame = addVBoxPage(i18n("Alarm Defaults"), i18n("Default Alarm Settings"), DesktopIcon("edit"));
00046    m_defaultPage = new DefaultPrefTab(frame);
00047    m_defaultPage->setSettings(sets);
00048 
00049    frame = addVBoxPage(i18n("Appearance"), i18n("Default Message Appearance"), DesktopIcon("colorize"));
00050    m_appearancePage = new AppearancePrefTab(frame);
00051    m_appearancePage->setSettings(sets);
00052 
00053    adjustSize();
00054 }
00055 
00056 KAlarmPrefDlg::~KAlarmPrefDlg()
00057 {
00058 }
00059 
00060 // Restore all defaults in the options...
00061 void KAlarmPrefDlg::slotDefault()
00062 {
00063    kdDebug(5950) << "KAlarmPrefDlg::slotDefault()" << endl;
00064    m_appearancePage->setDefaults();
00065    m_defaultPage->setDefaults();
00066    m_miscPage->setDefaults();
00067 }
00068 
00069 void KAlarmPrefDlg::slotHelp()
00070 {
00071    kapp->invokeHelp("preferences");
00072 }
00073 
00074 // Apply the settings that are currently selected
00075 void KAlarmPrefDlg::slotApply()
00076 {
00077    kdDebug(5950) << "KAlarmPrefDlg::slotApply()" << endl;
00078    m_appearancePage->apply(false);
00079    m_defaultPage->apply(false);
00080    m_miscPage->apply(true);
00081 }
00082 
00083 // Apply the settings that are currently selected
00084 void KAlarmPrefDlg::slotOk()
00085 {
00086    kdDebug(5950) << "KAlarmPrefDlg::slotOk()" << endl;
00087    slotApply();
00088    KDialogBase::slotOk();
00089 }
00090 
00091 // Discard the current settings and use the present ones
00092 void KAlarmPrefDlg::slotCancel()
00093 {
00094    kdDebug(5950) << "KAlarmPrefDlg::slotCancel()" << endl;
00095    m_appearancePage->restore();
00096    m_defaultPage->restore();
00097    m_miscPage->restore();
00098 
00099    KDialogBase::slotCancel();
00100 }
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Feb 15 11:41:03 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001