summaryrefslogtreecommitdiffabout
path: root/korganizer/koeditordetails.cpp
Unidiff
Diffstat (limited to 'korganizer/koeditordetails.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koeditordetails.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/korganizer/koeditordetails.cpp b/korganizer/koeditordetails.cpp
index b90b9eb..9a4b4ec 100644
--- a/korganizer/koeditordetails.cpp
+++ b/korganizer/koeditordetails.cpp
@@ -1,159 +1,159 @@
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 <kdialog.h> 36#include <kdialog.h>
37#include <kiconloader.h> 37#include <kiconloader.h>
38#include <kstandarddirs.h> 38#include <kstandarddirs.h>
39#include <kmessagebox.h> 39#include <kmessagebox.h>
40#ifndef KORG_NOKABC 40#ifndef KORG_NOKABC
41 41
42#ifdef DESKTOP_VERSION 42#ifdef DESKTOP_VERSION
43#include <kabc/addresseedialog.h> 43#include <kabc/addresseedialog.h>
44#else //DESKTOP_VERSION 44#else //DESKTOP_VERSION
45#include <externalapphandler.h> 45#include <externalapphandler.h>
46#endif //DESKTOP_VERSION 46#endif //DESKTOP_VERSION
47 47
48#endif 48#endif
49 49
50#include <libkcal/incidence.h> 50#include <libkcal/incidence.h>
51 51
52#include "koprefs.h" 52#include "koprefs.h"
53 53
54#include "koeditordetails.h" 54#include "koeditordetails.h"
55 55
56template <> 56template <>
57CustomListViewItem<class Attendee *>::~CustomListViewItem() 57CustomListViewItem<Attendee *>::~CustomListViewItem()
58{ 58{
59 delete mData; 59 delete mData;
60} 60}
61 61
62template <> 62template <>
63void CustomListViewItem<class Attendee *>::updateItem() 63void CustomListViewItem<Attendee *>::updateItem()
64{ 64{
65 setText(0,mData->name()); 65 setText(0,mData->name());
66 setText(1,mData->email()); 66 setText(1,mData->email());
67 setText(2,mData->roleStr()); 67 setText(2,mData->roleStr());
68 setText(3,mData->statusStr()); 68 setText(3,mData->statusStr());
69 if (mData->RSVP() && !mData->email().isEmpty()) { 69 if (mData->RSVP() && !mData->email().isEmpty()) {
70 setPixmap(4,SmallIcon("mailappt")); 70 setPixmap(4,SmallIcon("mailappt"));
71 setSortKey(4,"j"); 71 setSortKey(4,"j");
72 } 72 }
73 else { 73 else {
74 setPixmap(4,SmallIcon("nomailappt")); 74 setPixmap(4,SmallIcon("nomailappt"));
75 setSortKey(4,"n"); 75 setSortKey(4,"n");
76 } 76 }
77} 77}
78 78
79 79
80KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name) 80KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name)
81 : QWidget( parent, name), mDisableItemUpdate( false ) 81 : QWidget( parent, name), mDisableItemUpdate( false )
82{ 82{
83 QGridLayout *topLayout = new QGridLayout(this); 83 QGridLayout *topLayout = new QGridLayout(this);
84 topLayout->setSpacing(spacing); 84 topLayout->setSpacing(spacing);
85 topLayout->setMargin(KDialog::marginHint()-2); 85 topLayout->setMargin(KDialog::marginHint()-2);
86 86
87 QString organizer = KOPrefs::instance()->email(); 87 QString organizer = KOPrefs::instance()->email();
88 mOrganizerLabel = new QLabel(i18n("Organizer: %1").arg(organizer),this); 88 mOrganizerLabel = new QLabel(i18n("Organizer: %1").arg(organizer),this);
89 89
90 mListView = new KListView(this,"mListView"); 90 mListView = new KListView(this,"mListView");
91 mListView->addColumn(i18n("Name"),180); 91 mListView->addColumn(i18n("Name"),180);
92 mListView->addColumn(i18n("Email"),180); 92 mListView->addColumn(i18n("Email"),180);
93 mListView->addColumn(i18n("Role"),60); 93 mListView->addColumn(i18n("Role"),60);
94 mListView->addColumn(i18n("Status"),100); 94 mListView->addColumn(i18n("Status"),100);
95 mListView->addColumn(i18n("RSVP"),35); 95 mListView->addColumn(i18n("RSVP"),35);
96 if ( QApplication::desktop()->width() <= 320 || QApplication::desktop()->height() <= 240) { 96 if ( QApplication::desktop()->width() <= 320 || QApplication::desktop()->height() <= 240) {
97 int hei = 80; 97 int hei = 80;
98 if ( QApplication::desktop()->height() <= 240 ) 98 if ( QApplication::desktop()->height() <= 240 )
99 hei = 60; 99 hei = 60;
100 mListView->setFixedHeight(hei); 100 mListView->setFixedHeight(hei);
101 } 101 }
102 mListView->setAllColumnsShowFocus (true ); 102 mListView->setAllColumnsShowFocus (true );
103 //mListView->setSingleClick( true ); 103 //mListView->setSingleClick( true );
104 connect(mListView,SIGNAL(selectionChanged(QListViewItem *)), 104 connect(mListView,SIGNAL(selectionChanged(QListViewItem *)),
105 SLOT(updateAttendeeInput())); 105 SLOT(updateAttendeeInput()));
106 106
107 connect(mListView,SIGNAL(executed(QListViewItem * ,const QPoint&, int )), 107 connect(mListView,SIGNAL(executed(QListViewItem * ,const QPoint&, int )),
108 SLOT(itemClicked(QListViewItem * ,const QPoint& , int ))); 108 SLOT(itemClicked(QListViewItem * ,const QPoint& , int )));
109 109
110 mRsvpButton = new QCheckBox(this); 110 mRsvpButton = new QCheckBox(this);
111 mRsvpButton->setText(i18n("Request response")); 111 mRsvpButton->setText(i18n("Request response"));
112 mAddressBookButton = new QPushButton(i18n("Address &Book..."),this); 112 mAddressBookButton = new QPushButton(i18n("Address &Book..."),this);
113 QLabel *attendeeLabel = new QLabel(this); 113 QLabel *attendeeLabel = new QLabel(this);
114 attendeeLabel->setText(i18n("Name:")); 114 attendeeLabel->setText(i18n("Name:"));
115 attendeeLabel->setFixedSize( attendeeLabel->sizeHint() ); 115 attendeeLabel->setFixedSize( attendeeLabel->sizeHint() );
116 mNameEdit = new QLineEdit(this); 116 mNameEdit = new QLineEdit(this);
117 connect(mNameEdit,SIGNAL(textChanged(const QString &)), 117 connect(mNameEdit,SIGNAL(textChanged(const QString &)),
118 SLOT(updateAttendeeItem())); 118 SLOT(updateAttendeeItem()));
119 119
120 120
121 QLabel *emailLabel = new QLabel(this); 121 QLabel *emailLabel = new QLabel(this);
122 emailLabel->setText(i18n("Email:")); 122 emailLabel->setText(i18n("Email:"));
123 mEmailEdit = new QLineEdit(this); 123 mEmailEdit = new QLineEdit(this);
124 connect(mEmailEdit,SIGNAL(textChanged(const QString &)), 124 connect(mEmailEdit,SIGNAL(textChanged(const QString &)),
125 SLOT(updateAttendeeItem())); 125 SLOT(updateAttendeeItem()));
126 126
127 QLabel *attendeeRoleLabel = new QLabel(this); 127 QLabel *attendeeRoleLabel = new QLabel(this);
128 attendeeRoleLabel->setText(i18n("Role:")); 128 attendeeRoleLabel->setText(i18n("Role:"));
129 mRoleCombo = new QComboBox(false,this); 129 mRoleCombo = new QComboBox(false,this);
130 mRoleCombo->insertStringList(Attendee::roleList()); 130 mRoleCombo->insertStringList(Attendee::roleList());
131 connect(mRoleCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); 131 connect(mRoleCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem()));
132 132
133 QLabel *statusLabel = new QLabel(this); 133 QLabel *statusLabel = new QLabel(this);
134 statusLabel->setText( i18n("Status:") ); 134 statusLabel->setText( i18n("Status:") );
135 135
136 mStatusCombo = new QComboBox(false,this); 136 mStatusCombo = new QComboBox(false,this);
137 mStatusCombo->insertStringList(Attendee::statusList()); 137 mStatusCombo->insertStringList(Attendee::statusList());
138 connect(mStatusCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); 138 connect(mStatusCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem()));
139 139
140 140
141 connect(mRsvpButton,SIGNAL(clicked()),SLOT(updateAttendeeItem())); 141 connect(mRsvpButton,SIGNAL(clicked()),SLOT(updateAttendeeItem()));
142 QWidget *buttonBox = new QWidget(this); 142 QWidget *buttonBox = new QWidget(this);
143 QVBoxLayout *buttonLayout = new QVBoxLayout(buttonBox); 143 QVBoxLayout *buttonLayout = new QVBoxLayout(buttonBox);
144 144
145 QPushButton *newButton = new QPushButton(i18n("&New"),buttonBox); 145 QPushButton *newButton = new QPushButton(i18n("&New"),buttonBox);
146 buttonLayout->addWidget(newButton); 146 buttonLayout->addWidget(newButton);
147 connect(newButton,SIGNAL(clicked()),SLOT(addNewAttendee())); 147 connect(newButton,SIGNAL(clicked()),SLOT(addNewAttendee()));
148 148
149 mRemoveButton = new QPushButton(i18n("&Remove"),buttonBox); 149 mRemoveButton = new QPushButton(i18n("&Remove"),buttonBox);
150 buttonLayout->addWidget(mRemoveButton); 150 buttonLayout->addWidget(mRemoveButton);
151 connect(mRemoveButton, SIGNAL(clicked()),SLOT(removeAttendee())); 151 connect(mRemoveButton, SIGNAL(clicked()),SLOT(removeAttendee()));
152 152
153 // buttonLayout->addWidget(mAddressBookButton); 153 // buttonLayout->addWidget(mAddressBookButton);
154 connect(mAddressBookButton,SIGNAL(clicked()),SLOT(openAddressBook())); 154 connect(mAddressBookButton,SIGNAL(clicked()),SLOT(openAddressBook()));
155 //mRoleCombo->setFixedSize( mRoleCombo->sizeHint () ); 155 //mRoleCombo->setFixedSize( mRoleCombo->sizeHint () );
156 if ( QApplication::desktop()->height() <= 240 ) { 156 if ( QApplication::desktop()->height() <= 240 ) {
157 mRoleCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Minimum ,FALSE) ); 157 mRoleCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Minimum ,FALSE) );
158 mStatusCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Minimum ,FALSE) ); 158 mStatusCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Minimum ,FALSE) );
159 topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,5); 159 topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,5);