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 TQt, and distribute the resulting executable,
00022     without including the source code for TQt in the source distribution.
00023 */
00024 
00025 #include <tqlabel.h>
00026 #include <tqstringlist.h>
00027 #include <tqlayout.h>
00028 #include <tqcombobox.h>
00029 
00030 #include <kdebug.h>
00031 #include <tdelocale.h>
00032 #include <kpushbutton.h>
00033 #include <kstdguiitem.h>
00034 
00035 #include "statusdialog.h"
00036 #include "statusdialog.moc"
00037 
00038 StatusDialog::StatusDialog(TQWidget* parent, const char* name) :
00039   KDialog(parent,name,true)
00040 {
00041   setCaption(i18n("Set Your Status"));
00042 
00043   TQBoxLayout *topLayout = new TQVBoxLayout( this );
00044   topLayout->setSpacing( spacingHint() );
00045   topLayout->setMargin( marginHint() );
00046 
00047   TQBoxLayout *statusLayout = new TQHBoxLayout( topLayout );
00048 
00049   TQLabel *text = new TQLabel(i18n("Set your status"),this);
00050   statusLayout->addWidget( text );
00051 
00052   mStatus = new TQComboBox(false,this);
00053   mStatus->insertStringList(Attendee::statusList());
00054   statusLayout->addWidget( mStatus );
00055 
00056   TQBoxLayout *buttonLayout = new TQHBoxLayout( topLayout );
00057 
00058   TQPushButton *ok = new KPushButton(KStdGuiItem::ok(), this);
00059   connect ( ok,TQT_SIGNAL(clicked()), this,TQT_SLOT(accept()) );
00060   buttonLayout->addWidget( ok );
00061 
00062   TQPushButton *cancel = new KPushButton(KStdGuiItem::cancel(), this);
00063   connect ( cancel,TQT_SIGNAL(clicked()), this,TQT_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 }