korganizer Library API Documentation

birthdaysdialog.cpp

00001 /*
00002     This file is part of KOrganizer.
00003     Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
00004 
00005     This program is free software; you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation; either version 2 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program; if not, write to the Free Software
00017     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 */
00019 
00020 
00021 #include <qframe.h>
00022 #include <qlayout.h>
00023 
00024 #include <klocale.h>
00025 
00026 #include "birthdaysdialog.h"
00027 #include "birthdaysdialog.moc"
00028 
00029 BirthdaysDialog::BirthdaysDialog(QWidget *parent) :
00030   KDialogBase(Plain,i18n("Import Birthdays From KAddressBook"),User1|Cancel,
00031               User1,parent,"bimport",true,true,i18n("Import"))
00032 {
00033   setMaximumSize(350,200);
00034   QFrame *topFrame = plainPage();
00035   QGridLayout *topLayout = new QGridLayout(topFrame,2,1);
00036   mAlarm = new QCheckBox(i18n("Set alarm"),topFrame);
00037   topLayout->addWidget(mAlarm,0,0);
00038 
00039   QBoxLayout *alarmLayout = new QHBoxLayout(topLayout);
00040   topLayout->addLayout(alarmLayout,1,0);
00041 
00042   mALabel = new QLabel(i18n("Alarm before (in days):"),topFrame);
00043   alarmLayout->addWidget(mALabel);
00044   mAlarmTimeEdit = new KRestrictedLine(topFrame, "alarmTimeEdit","1234567890");
00045   mAlarmTimeEdit->setText("0");
00046   alarmLayout->addWidget(mAlarmTimeEdit);
00047 
00048   mAlarmTimeEdit->setDisabled(true);
00049   mALabel->setDisabled(true);
00050 
00051   connect(mAlarm,SIGNAL(clicked()),SLOT(alarmClicked()));
00052 }
00053 
00054 BirthdaysDialog::~BirthdaysDialog()
00055 {
00056 }
00057 
00058 void BirthdaysDialog::slotUser1()
00059 {
00060  accept();
00061 }
00062 
00063 void BirthdaysDialog::alarmClicked()
00064 {
00065   mAlarmTimeEdit->setDisabled(!mAlarm->isChecked());
00066   mALabel->setDisabled(!mAlarm->isChecked());
00067 }
00068 
00069 
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.4.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sat Oct 18 02:47:30 2003 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001