summaryrefslogtreecommitdiffabout
path: root/korganizer/koeventeditor.cpp
authorzautrix <zautrix>2005-06-25 16:06:31 (UTC)
committer zautrix <zautrix>2005-06-25 16:06:31 (UTC)
commit3867528ada39bb50a18802c499fbc3f6fae26e8c (patch) (side-by-side diff)
tree6b619b3bc6dea00e52648b4a394a61ab4ee8a072 /korganizer/koeventeditor.cpp
parent49d8fe456ce284a512227a7ca9d4d49688a39cd2 (diff)
downloadkdepimpi-3867528ada39bb50a18802c499fbc3f6fae26e8c.zip
kdepimpi-3867528ada39bb50a18802c499fbc3f6fae26e8c.tar.gz
kdepimpi-3867528ada39bb50a18802c499fbc3f6fae26e8c.tar.bz2
fixxxxx
Diffstat (limited to 'korganizer/koeventeditor.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeventeditor.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/korganizer/koeventeditor.cpp b/korganizer/koeventeditor.cpp
index 02d4a78..75dae34 100644
--- a/korganizer/koeventeditor.cpp
+++ b/korganizer/koeventeditor.cpp
@@ -27,97 +27,97 @@
#include <qhbox.h>
#include <qdir.h>
#include <qlayout.h>
#include <qwidgetstack.h>
#include <qapplication.h>
#include <kiconloader.h>
#include <kstandarddirs.h>
#include <kdebug.h>
#include <klocale.h>
#include <kfiledialog.h>
#include <kmessagebox.h>
#include <libkcal/calendarresources.h>
#include <libkcal/resourcecalendar.h>
#include <kresources/resourceselectdialog.h>
#include <libkdepim/categoryselectdialog.h>
#include <libkcal/calendarlocal.h>
#include <libkcal/icalformat.h>
#include "koprefs.h"
#include "koeventeditor.h"
extern int globalFlagBlockAgenda;
KOEventEditor::KOEventEditor( Calendar *calendar, QWidget *parent ) :
KOIncidenceEditor( i18n("Edit Event"), calendar, parent )
{
mEvent = 0;
init();
if ( QApplication::desktop()->height() <= 240 )
hideButtons();
}
KOEventEditor::~KOEventEditor()
{
//emit dialogClose( mEvent );
}
void KOEventEditor::init()
{
setupGeneral();
setupAttendeesTab();
setupRecurrence();
// Propagate date time settings to recurrence tab
connect(mGeneral,SIGNAL(dateTimesChanged(QDateTime,QDateTime)),
- mRecurrence,SLOT(setDateTimes(QDateTime,QDateTime)));
+ mRecurrence,SLOT(setDefaultsDates(QDateTime,QDateTime)));
connect(mGeneral,SIGNAL(dateTimeStrChanged(const QString &)),
mRecurrence,SLOT(setDateTimeStr(const QString &)));
// Category dialog
// connect(mGeneral,SIGNAL(openCategoryDialog()),mCategoryDialog,SLOT(show()));
//connect(mCategoryDialog,SIGNAL(categoriesSelected(const QString &)),
// mGeneral,SLOT(setCategories(const QString &)));
}
void KOEventEditor::reload()
{
if ( mEvent ) readEvent( mEvent );
}
void KOEventEditor::setSecrecy( int sec )
{
mGeneral->setSecrecy( sec );
}
void KOEventEditor::setCategories( QString s )
{
mGeneral->setCategories(s);
}
void KOEventEditor::setupGeneral()
{
mGeneral = new KOEditorGeneralEvent( this, "KOEditorGeneralEvent" );
connect ( mGeneral, SIGNAL ( allAccepted() ), this, SLOT ( slotOk () ) );
if( KOPrefs::instance()->mCompactDialogs ) {
QFrame *topFrame = addPage(i18n("General"));
QBoxLayout *topLayout = new QVBoxLayout(topFrame);
topLayout->setSpacing(spacingHint()-1);
topLayout->setMargin(marginHint()-1);
mGeneral->initHeader(topFrame,topLayout);
mGeneral->initTime(topFrame,topLayout);
// QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout);
mGeneral->initAlarm(topFrame,topLayout);
mGeneral->enableAlarm( false );
QBoxLayout *buttonLayout;
if ( QApplication::desktop()->width() < 500 && QApplication::desktop()->height() > 240 )
buttonLayout = new QVBoxLayout( topLayout );
else
buttonLayout = new QHBoxLayout( topLayout );
QHBox* buttonWidget = new QHBox (topFrame);
QIconSet icon;
@@ -235,97 +235,97 @@ bool KOEventEditor::processInput( bool emitTime )
emit jumpToTime( event->dtStart().date() );
globalFlagBlockAgenda = 2;
}
if (mEvent) {
event->setRevision(event->revision()+1);
emit eventChanged(event);
} else {
mCalendar->addEvent(event);
mEvent = event;
emit eventAdded(event);
}
return true;
}
void KOEventEditor::deleteEvent()
{
kdDebug() << "Delete event" << endl;
if (mEvent) {
if (KOPrefs::instance()->mConfirm) {
switch (msgItemDelete()) {
case KMessageBox::Continue: // OK
emit eventToBeDeleted(mEvent);
emit dialogClose(mEvent);
mCalendar->deleteEvent(mEvent);
emit eventDeleted();
reject();
break;
}
}
else {
emit eventToBeDeleted(mEvent);
emit dialogClose(mEvent);
mCalendar->deleteEvent(mEvent);
emit eventDeleted();
reject();
}
} else {
reject();
}
}
void KOEventEditor::setDefaults(QDateTime from, QDateTime to, bool allDay)
{
mGeneral->setDefaults(from,to,allDay);
mDetails->setDefaults();
- mRecurrence->setDefaults(from,to,allDay);
+ mRecurrence->setDefaults(from,to);
showPage( 0 );
mGeneral->setFocusOn( 2 );
}
void KOEventEditor::readEvent( Event *event, bool tmpl )
{
mGeneral->readEvent( event, tmpl );
mDetails->readEvent( event );
mRecurrence->readEvent( event );
// categories
//mCategoryDialog->setSelected( event->categories() );
}
void KOEventEditor::writeEvent(Event *event)
{
mGeneral->writeEvent( event );
mDetails->writeEvent( event );
if ( event->organizer() == KOPrefs::instance()->email() ) {
Event *ev = new Event( *event );
ev->registerObserver(0);
mDetails->cancelAttendeeEvent( ev );
if ( ev->attendeeCount() > 0 ) {
emit deleteAttendee( ev );
}
delete(ev);
}
mRecurrence->writeEvent(event);
}
bool KOEventEditor::validateInput()
{
if (!mGeneral->validateInput()) return false;
if (!mDetails->validateInput()) return false;
if (!mRecurrence->validateInput()) return false;
return true;
}
int KOEventEditor::msgItemDelete()
{
return KMessageBox::warningContinueCancel(this,
i18n("This item will be permanently deleted."),
i18n("KOrganizer Confirmation"),i18n("Delete"));
}
void KOEventEditor::slotLoadTemplate()