summaryrefslogtreecommitdiffabout
path: root/korganizer/koeditordetails.cpp
Unidiff
Diffstat (limited to 'korganizer/koeditordetails.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeditordetails.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/korganizer/koeditordetails.cpp b/korganizer/koeditordetails.cpp
index 7c4c382..c0e7bdd 100644
--- a/korganizer/koeditordetails.cpp
+++ b/korganizer/koeditordetails.cpp
@@ -1,144 +1,143 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in thse hope that it will be useful, 10 This program is distributed in thse hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qtooltip.h> 24#include <qtooltip.h>
25#include <qfiledialog.h> 25#include <qfiledialog.h>
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qvbox.h> 27#include <qvbox.h>
28#include <qbuttongroup.h> 28#include <qbuttongroup.h>
29#include <qvgroupbox.h> 29#include <qvgroupbox.h>
30#include <qwidgetstack.h> 30#include <qwidgetstack.h>
31#include <qdatetime.h> 31#include <qdatetime.h>
32#include <qapp.h> 32#include <qapp.h>
33 33
34#include <klocale.h> 34#include <klocale.h>
35#include <kglobal.h> 35#include <kglobal.h>
36#include <kiconloader.h> 36#include <kiconloader.h>
37#include <kstandarddirs.h> 37#include <kstandarddirs.h>
38#include <kmessagebox.h> 38#include <kmessagebox.h>
39#ifndef KORG_NOKABC 39#ifndef KORG_NOKABC
40#include <kabc/addresseedialog.h> 40#include <kabc/addresseedialog.h>
41#endif 41#endif
42 42
43#include <libkcal/incidence.h> 43#include <libkcal/incidence.h>
44 44
45#include "koprefs.h" 45#include "koprefs.h"
46 46
47#include "koeditordetails.h" 47#include "koeditordetails.h"
48#include "koeditordetails.moc"
49 48
50template <> 49template <>
51CustomListViewItem<class Attendee *>::~CustomListViewItem() 50CustomListViewItem<class Attendee *>::~CustomListViewItem()
52{ 51{
53 delete mData; 52 delete mData;
54} 53}
55 54
56template <> 55template <>
57void CustomListViewItem<class Attendee *>::updateItem() 56void CustomListViewItem<class Attendee *>::updateItem()
58{ 57{
59 setText(0,mData->name()); 58 setText(0,mData->name());
60 setText(1,mData->email()); 59 setText(1,mData->email());
61 setText(2,mData->roleStr()); 60 setText(2,mData->roleStr());
62 setText(3,mData->statusStr()); 61 setText(3,mData->statusStr());
63 if (mData->RSVP() && !mData->email().isEmpty()) 62 if (mData->RSVP() && !mData->email().isEmpty())
64 setPixmap(4,SmallIcon("mailappt")); 63 setPixmap(4,SmallIcon("mailappt"));
65 else 64 else
66 setPixmap(4,SmallIcon("nomailappt")); 65 setPixmap(4,SmallIcon("nomailappt"));
67} 66}
68 67
69 68
70KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name) 69KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name)
71 : QWidget( parent, name), mDisableItemUpdate( false ) 70 : QWidget( parent, name), mDisableItemUpdate( false )
72{ 71{
73 QGridLayout *topLayout = new QGridLayout(this); 72 QGridLayout *topLayout = new QGridLayout(this);
74 topLayout->setSpacing(spacing); 73 topLayout->setSpacing(spacing);
75 74
76 QString organizer = KOPrefs::instance()->email(); 75 QString organizer = KOPrefs::instance()->email();
77 mOrganizerLabel = new QLabel(i18n("Organizer: %1").arg(organizer),this); 76 mOrganizerLabel = new QLabel(i18n("Organizer: %1").arg(organizer),this);
78 77
79 mListView = new KListView(this,"mListView"); 78 mListView = new KListView(this,"mListView");
80 mListView->addColumn(i18n("Name"),180); 79 mListView->addColumn(i18n("Name"),180);
81 mListView->addColumn(i18n("Email"),180); 80 mListView->addColumn(i18n("Email"),180);
82 mListView->addColumn(i18n("Role"),60); 81 mListView->addColumn(i18n("Role"),60);
83 mListView->addColumn(i18n("Status"),100); 82 mListView->addColumn(i18n("Status"),100);
84 mListView->addColumn(i18n("RSVP"),35); 83 mListView->addColumn(i18n("RSVP"),35);
85 if ( KOPrefs::instance()->mCompactDialogs ) { 84 if ( KOPrefs::instance()->mCompactDialogs ) {
86 //mListView->setFixedHeight(78); 85 //mListView->setFixedHeight(78);
87 } 86 }
88 87
89 connect(mListView,SIGNAL(selectionChanged(QListViewItem *)), 88 connect(mListView,SIGNAL(selectionChanged(QListViewItem *)),
90 SLOT(updateAttendeeInput())); 89 SLOT(updateAttendeeInput()));
91 90
92 QLabel *attendeeLabel = new QLabel(this); 91 QLabel *attendeeLabel = new QLabel(this);
93 attendeeLabel->setText(i18n("Name:")); 92 attendeeLabel->setText(i18n("Name:"));
94 attendeeLabel->setFixedSize( attendeeLabel->sizeHint() ); 93 attendeeLabel->setFixedSize( attendeeLabel->sizeHint() );
95 mNameEdit = new QLineEdit(this); 94 mNameEdit = new QLineEdit(this);
96 connect(mNameEdit,SIGNAL(textChanged(const QString &)), 95 connect(mNameEdit,SIGNAL(textChanged(const QString &)),
97 SLOT(updateAttendeeItem())); 96 SLOT(updateAttendeeItem()));
98 97
99 mUidEdit = new QLineEdit(0); 98 mUidEdit = new QLineEdit(0);
100 mUidEdit->setText(""); 99 mUidEdit->setText("");
101 100
102 QLabel *emailLabel = new QLabel(this); 101 QLabel *emailLabel = new QLabel(this);
103 emailLabel->setText(i18n("Email:")); 102 emailLabel->setText(i18n("Email:"));
104 mEmailEdit = new QLineEdit(this); 103 mEmailEdit = new QLineEdit(this);
105 connect(mEmailEdit,SIGNAL(textChanged(const QString &)), 104 connect(mEmailEdit,SIGNAL(textChanged(const QString &)),
106 SLOT(updateAttendeeItem())); 105 SLOT(updateAttendeeItem()));
107 106
108 QLabel *attendeeRoleLabel = new QLabel(this); 107 QLabel *attendeeRoleLabel = new QLabel(this);
109 attendeeRoleLabel->setText(i18n("Role:")); 108 attendeeRoleLabel->setText(i18n("Role:"));
110 mRoleCombo = new QComboBox(false,this); 109 mRoleCombo = new QComboBox(false,this);
111 mRoleCombo->insertStringList(Attendee::roleList()); 110 mRoleCombo->insertStringList(Attendee::roleList());
112 connect(mRoleCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); 111 connect(mRoleCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem()));
113 112
114 QLabel *statusLabel = new QLabel(this); 113 QLabel *statusLabel = new QLabel(this);
115 statusLabel->setText( i18n("Status:") ); 114 statusLabel->setText( i18n("Status:") );
116 115
117 mStatusCombo = new QComboBox(false,this); 116 mStatusCombo = new QComboBox(false,this);
118 mStatusCombo->insertStringList(Attendee::statusList()); 117 mStatusCombo->insertStringList(Attendee::statusList());
119 connect(mStatusCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); 118 connect(mStatusCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem()));
120 119
121 mRsvpButton = new QCheckBox(this); 120 mRsvpButton = new QCheckBox(this);
122 mRsvpButton->setText(i18n("Request response")); 121 mRsvpButton->setText(i18n("Request response"));
123 connect(mRsvpButton,SIGNAL(clicked()),SLOT(updateAttendeeItem())); 122 connect(mRsvpButton,SIGNAL(clicked()),SLOT(updateAttendeeItem()));
124 QWidget *buttonBox = new QWidget(this); 123 QWidget *buttonBox = new QWidget(this);
125 QVBoxLayout *buttonLayout = new QVBoxLayout(buttonBox); 124 QVBoxLayout *buttonLayout = new QVBoxLayout(buttonBox);
126 125
127 QPushButton *newButton = new QPushButton(i18n("&New"),buttonBox); 126 QPushButton *newButton = new QPushButton(i18n("&New"),buttonBox);
128 buttonLayout->addWidget(newButton); 127 buttonLayout->addWidget(newButton);
129 connect(newButton,SIGNAL(clicked()),SLOT(addNewAttendee())); 128 connect(newButton,SIGNAL(clicked()),SLOT(addNewAttendee()));
130 129
131 mRemoveButton = new QPushButton(i18n("&Remove"),buttonBox); 130 mRemoveButton = new QPushButton(i18n("&Remove"),buttonBox);
132 buttonLayout->addWidget(mRemoveButton); 131 buttonLayout->addWidget(mRemoveButton);
133 connect(mRemoveButton, SIGNAL(clicked()),SLOT(removeAttendee())); 132 connect(mRemoveButton, SIGNAL(clicked()),SLOT(removeAttendee()));
134 133
135 mAddressBookButton = new QPushButton(i18n("Address &Book..."),this); 134 mAddressBookButton = new QPushButton(i18n("Address &Book..."),this);
136 // buttonLayout->addWidget(mAddressBookButton); 135 // buttonLayout->addWidget(mAddressBookButton);
137 connect(mAddressBookButton,SIGNAL(clicked()),SLOT(openAddressBook())); 136 connect(mAddressBookButton,SIGNAL(clicked()),SLOT(openAddressBook()));
138 //mRoleCombo->setFixedSize( mRoleCombo->sizeHint () ); 137 //mRoleCombo->setFixedSize( mRoleCombo->sizeHint () );
139 138
140 if (qApp->desktop()->width() < 300 ) { 139 if (qApp->desktop()->width() < 300 ) {
141 mListView->setFixedHeight(80); 140 mListView->setFixedHeight(80);
142 topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,3); 141 topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,3);
143 topLayout->addMultiCellWidget(mListView,1,1,0,3); 142 topLayout->addMultiCellWidget(mListView,1,1,0,3);
144 topLayout->addWidget(attendeeLabel,3,0); 143 topLayout->addWidget(attendeeLabel,3,0);