korganizer

testalarmdlg.cpp

00001 /*
00002     This file is part of KOrganizer.
00003 
00004     Copyright (c) 2002 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 <qwidget.h>
00026 
00027 #include <kaboutdata.h>
00028 #include <kapplication.h>
00029 #include <kdebug.h>
00030 #include <klocale.h>
00031 #include <kcmdlineargs.h>
00032 
00033 #include "alarmdialog.h"
00034 
00035 int main(int argc,char **argv)
00036 {
00037   KAboutData aboutData("testkabc",I18N_NOOP("TestKabc"),"0.1");
00038   KCmdLineArgs::init(argc,argv,&aboutData);
00039 
00040   KApplication app;
00041 
00042   Event *e1 = new Event;
00043   e1->setSummary( "This is a summary." );
00044   QDateTime now = QDateTime::currentDateTime();
00045   e1->setDtStart( now );
00046   e1->setDtEnd( now.addDays( 1 ) );
00047   Alarm *a = e1->newAlarm();
00048 //  a->setProcedureAlarm( "/usr/X11R6/bin/xeyes" );
00049   a->setAudioAlarm( "/opt/kde/share/apps/korganizer/sounds/spinout.wav" );
00050 
00051   Todo *t1 = new Todo;
00052   t1->setSummary( "To-do A" );
00053   t1->setDtDue( now );
00054   t1->newAlarm();
00055 
00056   Event *e2 = new Event;
00057   e2->setSummary( "This is another summary." );
00058   e2->setDtStart( now );
00059   e2->setDtEnd( now.addDays( 1 ) );
00060   e2->newAlarm();
00061 
00062   AlarmDialog dlg( 0 );
00063   app.setMainWidget( &dlg );
00064   dlg.addIncidence( e1, QDateTime::currentDateTime() );
00065   dlg.addIncidence( t1, QDateTime::currentDateTime() );
00066   dlg.addIncidence( e2, QDateTime::currentDateTime() );
00067   dlg.show();
00068   dlg.eventNotification();
00069 
00070   app.exec();
00071 }
KDE Home | KDE Accessibility Home | Description of Access Keys