summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-01-30 00:33:46 (UTC)
committer zautrix <zautrix>2005-01-30 00:33:46 (UTC)
commita8fae20ad7bcb59df9a603c88accf3a10401c2f9 (patch) (side-by-side diff)
tree12deeef9bae6d470c244ce9a9916c59d6879f9b2 /korganizer
parentd94b52aa95cc52aa1bef7c9cd99f43c725ed8042 (diff)
downloadkdepimpi-a8fae20ad7bcb59df9a603c88accf3a10401c2f9.zip
kdepimpi-a8fae20ad7bcb59df9a603c88accf3a10401c2f9.tar.gz
kdepimpi-a8fae20ad7bcb59df9a603c88accf3a10401c2f9.tar.bz2
f
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.cpp2
-rw-r--r--korganizer/koeditordetails.cpp13
-rw-r--r--korganizer/koeditordetails.h1
-rw-r--r--korganizer/koeventviewer.cpp4
4 files changed, 18 insertions, 2 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 74aefb7..96fb5ca 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1498,61 +1498,61 @@ void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthd
++addCount;
}
if ( anniversary.isValid() ){
a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction,
KCal::Attendee::ReqParticipant,uid) ;
if ( addAnniversary( anniversary, assembledName, a, false ) )
++addCount;
}
}
updateView();
topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!"));
}
}
bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a, bool birthday)
{
//qDebug("addAnni ");
Event * ev = new Event();
+ ev->setOrganizer(KOPrefs::instance()->email());
if ( a ) {
ev->addAttendee( a );
}
QString kind;
if ( birthday ) {
kind = i18n( "Birthday" );
ev->setSummary( name + " (" + QString::number(date.year()) +")");
}
else {
kind = i18n( "Anniversary" );
ev->setSummary( name + " (" + QString::number(date.year()) +") " + kind );
}
- //ev->setOrganizer(a->email());
ev->setCategories( kind );
ev->setDtStart( QDateTime(date) );
ev->setDtEnd( QDateTime(date) );
ev->setFloats( true );
Recurrence * rec = ev->recurrence();
rec->setYearly(Recurrence::rYearlyMonth,1,-1);
rec->addYearlyNum( date.month() );
if ( !mCalendar->addAnniversaryNoDup( ev ) ) {
delete ev;
return false;
}
return true;
}
bool CalendarView::importQtopia( const QString &categories,
const QString &datebook,
const QString &todolist )
{
QtopiaFormat qtopiaFormat;
qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories));
if ( !categories.isEmpty() ) qtopiaFormat.load( mCalendar, categories );
if ( !datebook.isEmpty() ) qtopiaFormat.load( mCalendar, datebook );
if ( !todolist.isEmpty() ) qtopiaFormat.load( mCalendar, todolist );
diff --git a/korganizer/koeditordetails.cpp b/korganizer/koeditordetails.cpp
index cf0a458..ef8025b 100644
--- a/korganizer/koeditordetails.cpp
+++ b/korganizer/koeditordetails.cpp
@@ -69,52 +69,56 @@ void CustomListViewItem<class Attendee *>::updateItem()
setPixmap(4,SmallIcon("mailappt"));
else
setPixmap(4,SmallIcon("nomailappt"));
}
KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name)
: QWidget( parent, name), mDisableItemUpdate( false )
{
QGridLayout *topLayout = new QGridLayout(this);
topLayout->setSpacing(spacing);
QString organizer = KOPrefs::instance()->email();
mOrganizerLabel = new QLabel(i18n("Organizer: %1").arg(organizer),this);
mListView = new KListView(this,"mListView");
mListView->addColumn(i18n("Name"),180);
mListView->addColumn(i18n("Email"),180);
mListView->addColumn(i18n("Role"),60);
mListView->addColumn(i18n("Status"),100);
mListView->addColumn(i18n("RSVP"),35);
if ( KOPrefs::instance()->mCompactDialogs ) {
//mListView->setFixedHeight(78);
}
-
+ mListView->setAllColumnsShowFocus (true );
+ //mListView->setSingleClick( true );
connect(mListView,SIGNAL(selectionChanged(QListViewItem *)),
SLOT(updateAttendeeInput()));
+ connect(mListView,SIGNAL(executed(QListViewItem * ,const QPoint&, int )),
+ SLOT(itemClicked(QListViewItem * ,const QPoint& , int )));
+
QLabel *attendeeLabel = new QLabel(this);
attendeeLabel->setText(i18n("Name:"));
attendeeLabel->setFixedSize( attendeeLabel->sizeHint() );
mNameEdit = new QLineEdit(this);
connect(mNameEdit,SIGNAL(textChanged(const QString &)),
SLOT(updateAttendeeItem()));
mUidEdit = new QLineEdit(0);
mUidEdit->setText("");
QLabel *emailLabel = new QLabel(this);
emailLabel->setText(i18n("Email:"));
mEmailEdit = new QLineEdit(this);
connect(mEmailEdit,SIGNAL(textChanged(const QString &)),
SLOT(updateAttendeeItem()));
QLabel *attendeeRoleLabel = new QLabel(this);
attendeeRoleLabel->setText(i18n("Role:"));
mRoleCombo = new QComboBox(false,this);
mRoleCombo->insertStringList(Attendee::roleList());
connect(mRoleCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem()));
QLabel *statusLabel = new QLabel(this);
statusLabel->setText( i18n("Status:") );
@@ -400,42 +404,49 @@ void KOEditorDetails::fillAttendeeInput( AttendeeListItem *aItem )
mDisableItemUpdate = true;
mNameEdit->setText(a->name());
mUidEdit->setText(a->uid());
mEmailEdit->setText(a->email());
mRoleCombo->setCurrentItem(a->role());
mStatusCombo->setCurrentItem(a->status());
mRsvpButton->setChecked(a->RSVP());
mDisableItemUpdate = false;
setEnabledAttendeeInput( true );
}
void KOEditorDetails::setEnabledAttendeeInput( bool enabled )
{
mNameEdit->setEnabled( enabled );
mEmailEdit->setEnabled( enabled );
mRoleCombo->setEnabled( enabled );
mStatusCombo->setEnabled( enabled );
mRsvpButton->setEnabled( enabled );
mRemoveButton->setEnabled( enabled );
}
+void KOEditorDetails::itemClicked(QListViewItem * item ,const QPoint & pnt, int c )
+{
+ if ( item && c == 4 ) {
+ mRsvpButton->setChecked( !mRsvpButton->isChecked() );
+ updateAttendeeItem();
+ }
+}
void KOEditorDetails::updateAttendeeItem()
{
if (mDisableItemUpdate) return;
QListViewItem *item = mListView->selectedItem();
AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item );
if ( !aItem ) return;
Attendee *a = aItem->data();
a->setName( mNameEdit->text() );
a->setUid( mUidEdit->text() );
a->setEmail( mEmailEdit->text() );
a->setRole( Attendee::Role( mRoleCombo->currentItem() ) );
a->setStatus( Attendee::PartStat( mStatusCombo->currentItem() ) );
a->setRSVP( mRsvpButton->isChecked() );
aItem->updateItem();
}
diff --git a/korganizer/koeditordetails.h b/korganizer/koeditordetails.h
index 0cc807f..a33ee82 100644
--- a/korganizer/koeditordetails.h
+++ b/korganizer/koeditordetails.h
@@ -62,47 +62,48 @@ class KOEditorDetails : public QWidget
/** Read event object and setup widgets accordingly */
void readEvent(Incidence *);
/** Write event settings to event object */
void writeEvent(Incidence *);
/** return a clone of the event with attendees to be canceld*/
void cancelAttendeeEvent(Incidence *);
/** Check if the input is valid. */
bool validateInput();
public slots:
void insertAttendee(Attendee *);
// called when the app recieves a list of name/email/uid (=addresses) from another app. Usually Ka/Pi
// The first parameter is a uniqueid. It can be used to identify if event
void insertAttendees(const QString&, const QStringList& namelist, const QStringList& emaillist, const QStringList& uidlist);
protected slots:
void addNewAttendee();
void removeAttendee();
void openAddressBook();
void updateAttendeeInput();
void clearAttendeeInput();
void fillAttendeeInput(AttendeeListItem *);
+ void itemClicked(QListViewItem *,const QPoint & pnt, int c);
void updateAttendeeItem();
void setEnabledAttendeeInput(bool);
private:
bool mDisableItemUpdate;
QLineEdit *mNameEdit;
QLineEdit *mUidEdit;
QLineEdit *mEmailEdit;
KListView *mListView;
QComboBox* mRoleCombo;
QCheckBox* mRsvpButton;
QComboBox* mStatusCombo;
QLabel *mOrganizerLabel;
QPushButton* mAddButton;
QPushButton* mRemoveButton;
QPushButton* mAddressBookButton;
QPtrList<Attendee> mdelAttendees;
};
#endif
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index 5de667e..2f0fa9e 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -396,48 +396,49 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
mText.append( to->summary()+" [" +QString::number(to->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%]<br>");
}
setText(mText);
}
void KOEventViewer::formatCategories(Incidence *event)
{
if (!event->categoriesStr().isEmpty()) {
if (event->categories().count() == 1) {
addTag("h3",i18n("Category"));
} else {
addTag("h3",i18n("Categories"));
}
addTag("p",event->categoriesStr());
}
}
void KOEventViewer::formatAttendees(Incidence *event)
{
QPtrList<Attendee> attendees = event->attendees();
if (attendees.count()) {
QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small);
+ QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small);
addTag("h3",i18n("Organizer"));
mText.append("<ul><li>");
#ifndef KORG_NOKABC
#ifdef DESKTOP_VERSION
KABC::AddressBook *add_book = KABC::StdAddressBook::self();
KABC::Addressee::List addressList;
addressList = add_book->findByEmail(event->organizer());
KABC::Addressee o = addressList.first();
if (!o.isEmpty() && addressList.size()<2) {
mText += "<a href=\"uid:" + o.uid() + "\">";
mText += o.formattedName();
mText += "</a>\n";
} else {
mText.append(event->organizer());
}
#else //DESKTOP_VERSION
mText += "<a href=\"uid:organizer\">";
mText += event->organizer();
mText += "</a>\n";
#endif //DESKTOP_VERSION
#else
@@ -472,49 +473,52 @@ void KOEventViewer::formatAttendees(Incidence *event)
} else {
mText += "<li><a href=\"uid:" + a->uid() + "\">";
if (!a->name().isEmpty()) mText += a->name();
else mText += a->email();
mText += "</a>\n";
}
#else //DESKTOP_VERSION
mText += "<li><a href=\"uid:" + a->uid() + "\">";
if (!a->name().isEmpty()) mText += a->name();
else mText += a->email();
mText += "</a>\n";
#endif //DESKTOP_VERSION
#else
//qDebug("nokabc ");
mText += "<li><a href=\"uid:" + a->uid() + "\">";
if (!a->name().isEmpty()) mText += a->name();
else mText += a->email();
mText += "</a>\n";
#endif
if (!a->email().isEmpty()) {
if (iconPath) {
mText += "<a href=\"mailto:" + a->name() +" <" + a->email() + ">:" + mMailSubject + "\">";
+ if ( a->RSVP() )
mText += "<IMG src=\"" + iconPath + "\">";
+ else
+ mText += "<IMG src=\"" + NOiconPath + "\">";
mText += "</a>\n";
}
}
if (a->status() != Attendee::NeedsAction )
mText +="[" + a->statusStr() + "] ";
if (a->role() == Attendee::Chair )
mText +="(" + a->roleStr().left(1) + ".)";
}
mText.append("</li></ul>");
}
}
void KOEventViewer::appendJournal(Journal *jour, int mode )
{
bool shortDate = KOPrefs::instance()->mShortDateInViewer;
if (mode == 0 ) {
addTag("h2",i18n("Journal from: "));
}
else {
if ( mode == 1 ) {
addTag("h2",i18n( "Local: " ) +i18n("Journal from: "));
} else {
addTag("h2",i18n( "Remote: " ) +i18n("Journal from: "));
}