korganizer

statusdialog.cpp

00001 /*
00002     This file is part of KOrganizer.
00003 
00004     Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
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 Qt, and distribute the resulting executable,
00022     without including the source code for Qt in the source distribution.
00023 */
00024 
00025 #include <qlabel.h>
00026 #include <qstringlist.h>
00027 #include <qlayout.h>
00028 #include <qcombobox.h>
00029 
00030 #include <kdebug.h>
00031 #include <klocale.h>
00032 #include <kpushbutton.h>
00033 #include <kstdguiitem.h>
00034 
00035 #include "statusdialog.h"
00036 #include "statusdialog.moc"
00037 
00038 StatusDialog::StatusDialog(QWidget* parent, const char* name) :
00039   KDialog(parent,name,true)
00040 {
00041   setCaption(i18n("Set Your Status"));
00042 
00043   QBoxLayout *topLayout = new QVBoxLayout( this );
00044   topLayout->setSpacing( spacingHint() );
00045   topLayout->setMargin( marginHint() );
00046 
00047   QBoxLayout *statusLayout = new QHBoxLayout( topLayout );
00048 
00049   QLabel *text = new QLabel(i18n("Set your status"),this);
00050   statusLayout->addWidget( text );
00051 
00052   mStatus = new QComboBox(false,this);
00053   mStatus->insertStringList(Attendee::statusList());
00054   statusLayout->addWidget( mStatus );
00055 
00056   QBoxLayout *buttonLayout = new QHBoxLayout( topLayout );
00057 
00058   QPushButton *ok = new KPushButton(KStdGuiItem::ok(), this);
00059   connect ( ok,SIGNAL(clicked()), this,SLOT(accept()) );
00060   buttonLayout->addWidget( ok );
00061 
00062   QPushButton *cancel = new KPushButton(KStdGuiItem::cancel(), this);
00063   connect ( cancel,SIGNAL(clicked()), this,SLOT(reject()) );
00064   buttonLayout->addWidget( cancel );
00065 }
00066 
00067 StatusDialog::~StatusDialog()
00068 {
00069 }
00070 
00071 Attendee::PartStat StatusDialog::status()
00072 {
00073   return Attendee::PartStat( mStatus->currentItem() ) ;
00074 }
KDE Home | KDE Accessibility Home | Description of Access Keys