• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

korganizer

freebusyurldialog.cpp

Go to the documentation of this file.
00001 /*
00002   This file is part of KOrganizer.
00003 
00004   Copyright (c) 2004 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 along
00017   with this program; if not, write to the Free Software Foundation, Inc.,
00018   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 "freebusyurldialog.h"
00026 
00027 #include <kcal/attendee.h>
00028 #include <kcal/freebusyurlstore.h>
00029 
00030 #include <klineedit.h>
00031 #include <klocale.h>
00032 #include <kdebug.h>
00033 #include <kstandarddirs.h>
00034 
00035 #include <QLayout>
00036 #include <QLabel>
00037 #include <QVBoxLayout>
00038 #include <QFrame>
00039 #include <QBoxLayout>
00040 
00041 FreeBusyUrlDialog::FreeBusyUrlDialog( KCal::Attendee *attendee, QWidget *parent )
00042   : KDialog( parent )
00043 {
00044   QFrame *topFrame = new QFrame( this );
00045   setMainWidget( topFrame );
00046   setModal( true );
00047   setCaption( i18n( "Edit Free/Busy Location" ) );
00048   setButtons( Ok|Cancel );
00049   setDefaultButton( Ok );
00050 
00051   QBoxLayout *topLayout = new QVBoxLayout( topFrame );
00052   topLayout->setSpacing( spacingHint() );
00053   topLayout->setMargin( 0 );
00054 
00055   mWidget = new FreeBusyUrlWidget( attendee, topFrame );
00056   topLayout->addWidget( mWidget );
00057 
00058   mWidget->loadConfig();
00059   connect( this, SIGNAL(okClicked()), this, SLOT(slotOk()) );
00060 }
00061 
00062 void FreeBusyUrlDialog::slotOk()
00063 {
00064   mWidget->saveConfig();
00065   accept();
00066 }
00067 
00068 FreeBusyUrlWidget::FreeBusyUrlWidget( KCal::Attendee *attendee, QWidget *parent )
00069   : QWidget( parent ), mAttendee( attendee )
00070 {
00071   QBoxLayout *topLayout = new QVBoxLayout( this );
00072   topLayout->setSpacing( KDialog::spacingHint() );
00073 
00074   QLabel *label =
00075     new QLabel( i18n( "Location of Free/Busy information for %1 <placeholder>%2</placeholder>:",
00076                      mAttendee->name(), mAttendee->email() ), this );
00077   topLayout->addWidget( label );
00078 
00079   mUrlEdit = new KLineEdit( this );
00080   topLayout->addWidget( mUrlEdit );
00081 }
00082 
00083 FreeBusyUrlWidget::~FreeBusyUrlWidget()
00084 {
00085 }
00086 
00087 void FreeBusyUrlWidget::loadConfig()
00088 {
00089   kDebug();
00090 
00091   QString url = KCal::FreeBusyUrlStore::self()->readUrl( mAttendee->email() );
00092   mUrlEdit->setText( url );
00093 }
00094 
00095 void FreeBusyUrlWidget::saveConfig()
00096 {
00097   kDebug();
00098 
00099   QString url = mUrlEdit->text();
00100   KCal::FreeBusyUrlStore::self()->writeUrl( mAttendee->email(), url );
00101   KCal::FreeBusyUrlStore::self()->sync();
00102 }
00103 
00104 #include "freebusyurldialog.moc"

korganizer

Skip menu "korganizer"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  •   doc
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal