Diffstat (limited to 'korganizer/publishdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/publishdialog.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/korganizer/publishdialog.cpp b/korganizer/publishdialog.cpp index 2ae6720..ede9840 100644 --- a/korganizer/publishdialog.cpp +++ b/korganizer/publishdialog.cpp | |||
@@ -6,146 +6,146 @@ | |||
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 the hope that it will be useful, | 10 | This program is distributed in the 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 <qlineedit.h> | 24 | #include <qlineedit.h> |
25 | #include <kdebug.h> | 25 | #include <kdebug.h> |
26 | 26 | ||
27 | #include <kglobal.h> | 27 | #include <kglobal.h> |
28 | #include <klocale.h> | 28 | #include <klocale.h> |
29 | #ifndef KORG_NOKABC | 29 | #ifndef KORG_NOKABC |
30 | #define KORG_NOKABC | 30 | #define KORG_NOKABC |
31 | //#include <kabc/addresseedialog.h> | 31 | //#include <kabc/addresseedialog.h> |
32 | #endif | 32 | #endif |
33 | 33 | ||
34 | #include "koprefs.h" | 34 | #include "koprefs.h" |
35 | #include "publishdialog.h" | 35 | #include "publishdialog.h" |
36 | 36 | ||
37 | PublishDialog::PublishDialog(QWidget* parent, const char* name, | 37 | PublishDialog::PublishDialog(QWidget* parent, const char* name, |
38 | bool modal, WFlags fl) | 38 | bool modal, Qt::WFlags fl) |
39 | : PublishDialog_base(parent,name,modal,fl) | 39 | : PublishDialog_base(parent,name,modal,fl) |
40 | { | 40 | { |
41 | setCaption(i18n("Select Addresses")); | 41 | setCaption(i18n("Select Addresses")); |
42 | mNameLineEdit->setEnabled(false); | 42 | mNameLineEdit->setEnabled(false); |
43 | mEmailLineEdit->setEnabled(false); | 43 | mEmailLineEdit->setEnabled(false); |
44 | connect(mAddressListView,SIGNAL(selectionChanged(QListViewItem *)), | 44 | connect(mAddressListView,SIGNAL(selectionChanged(Q3ListViewItem *)), |
45 | SLOT(updateInput())); | 45 | SLOT(updateInput())); |
46 | } | 46 | } |
47 | 47 | ||
48 | PublishDialog::~PublishDialog() | 48 | PublishDialog::~PublishDialog() |
49 | { | 49 | { |
50 | } | 50 | } |
51 | 51 | ||
52 | void PublishDialog::addAttendee(Attendee *attendee) | 52 | void PublishDialog::addAttendee(Attendee *attendee) |
53 | { | 53 | { |
54 | mNameLineEdit->setEnabled(true); | 54 | mNameLineEdit->setEnabled(true); |
55 | mEmailLineEdit->setEnabled(true); | 55 | mEmailLineEdit->setEnabled(true); |
56 | QListViewItem *item = new QListViewItem(mAddressListView); | 56 | Q3ListViewItem *item = new Q3ListViewItem(mAddressListView); |
57 | item->setText(0,attendee->name()); | 57 | item->setText(0,attendee->name()); |
58 | item->setText(1,attendee->email()); | 58 | item->setText(1,attendee->email()); |
59 | mAddressListView->insertItem(item); | 59 | mAddressListView->insertItem(item); |
60 | } | 60 | } |
61 | 61 | ||
62 | QString PublishDialog::addresses() | 62 | QString PublishDialog::addresses() |
63 | { | 63 | { |
64 | QString to = ""; | 64 | QString to = ""; |
65 | QListViewItem *item; | 65 | Q3ListViewItem *item; |
66 | int i, count; | 66 | int i, count; |
67 | count = mAddressListView->childCount(); | 67 | count = mAddressListView->childCount(); |
68 | for (i=0;i<count;i++) { | 68 | for (i=0;i<count;i++) { |
69 | item = mAddressListView->firstChild(); | 69 | item = mAddressListView->firstChild(); |
70 | mAddressListView->takeItem(item); | 70 | mAddressListView->takeItem(item); |
71 | to += item->text(1); | 71 | to += item->text(1); |
72 | if (i<count-1) { | 72 | if (i<count-1) { |
73 | to += ", "; | 73 | to += ", "; |
74 | } | 74 | } |
75 | } | 75 | } |
76 | return to; | 76 | return to; |
77 | } | 77 | } |
78 | 78 | ||
79 | void PublishDialog::addItem() | 79 | void PublishDialog::addItem() |
80 | { | 80 | { |
81 | mNameLineEdit->setEnabled(true); | 81 | mNameLineEdit->setEnabled(true); |
82 | mEmailLineEdit->setEnabled(true); | 82 | mEmailLineEdit->setEnabled(true); |
83 | QListViewItem *item = new QListViewItem(mAddressListView); | 83 | Q3ListViewItem *item = new Q3ListViewItem(mAddressListView); |
84 | mAddressListView->insertItem(item); | 84 | mAddressListView->insertItem(item); |
85 | mAddressListView->setSelected(item,true); | 85 | mAddressListView->setSelected(item,true); |
86 | mNameLineEdit->setText(i18n("(EmptyName)")); | 86 | mNameLineEdit->setText(i18n("(EmptyName)")); |
87 | mEmailLineEdit->setText(i18n("(EmptyEmail)")); | 87 | mEmailLineEdit->setText(i18n("(EmptyEmail)")); |
88 | } | 88 | } |
89 | 89 | ||
90 | void PublishDialog::removeItem() | 90 | void PublishDialog::removeItem() |
91 | { | 91 | { |
92 | QListViewItem *item; | 92 | Q3ListViewItem *item; |
93 | item = mAddressListView->selectedItem(); | 93 | item = mAddressListView->selectedItem(); |
94 | if (!item) return; | 94 | if (!item) return; |
95 | mAddressListView->takeItem(item); | 95 | mAddressListView->takeItem(item); |
96 | item = mAddressListView->selectedItem(); | 96 | item = mAddressListView->selectedItem(); |
97 | if (!item) { | 97 | if (!item) { |
98 | mNameLineEdit->setText(""); | 98 | mNameLineEdit->setText(""); |
99 | mEmailLineEdit->setText(""); | 99 | mEmailLineEdit->setText(""); |
100 | mNameLineEdit->setEnabled(false); | 100 | mNameLineEdit->setEnabled(false); |
101 | mEmailLineEdit->setEnabled(false); | 101 | mEmailLineEdit->setEnabled(false); |
102 | } | 102 | } |
103 | if (mAddressListView->childCount() == 0) { | 103 | if (mAddressListView->childCount() == 0) { |
104 | mNameLineEdit->setEnabled(false); | 104 | mNameLineEdit->setEnabled(false); |
105 | mEmailLineEdit->setEnabled(false); | 105 | mEmailLineEdit->setEnabled(false); |
106 | } | 106 | } |
107 | } | 107 | } |
108 | 108 | ||
109 | void PublishDialog::openAddressbook() | 109 | void PublishDialog::openAddressbook() |
110 | { | 110 | { |
111 | #ifndef KORG_NOKABC | 111 | #ifndef KORG_NOKABC |
112 | KABC::Addressee::List addressList; | 112 | KABC::Addressee::List addressList; |
113 | addressList = KABC::AddresseeDialog::getAddressees(this); | 113 | addressList = KABC::AddresseeDialog::getAddressees(this); |
114 | //KABC::Addressee a = KABC::AddresseeDialog::getAddressee(this); | 114 | //KABC::Addressee a = KABC::AddresseeDialog::getAddressee(this); |
115 | KABC::Addressee a = addressList.first(); | 115 | KABC::Addressee a = addressList.first(); |
116 | if (!a.isEmpty()) { | 116 | if (!a.isEmpty()) { |
117 | uint i; | 117 | uint i; |
118 | for (i=0;i<addressList.count();i++) { | 118 | for (i=0;i<addressList.count();i++) { |
119 | a = addressList[i]; | 119 | a = addressList[i]; |
120 | mNameLineEdit->setEnabled(true); | 120 | mNameLineEdit->setEnabled(true); |
121 | mEmailLineEdit->setEnabled(true); | 121 | mEmailLineEdit->setEnabled(true); |
122 | QListViewItem *item = new QListViewItem(mAddressListView); | 122 | Q3ListViewItem *item = new Q3ListViewItem(mAddressListView); |
123 | mAddressListView->setSelected(item,true); | 123 | mAddressListView->setSelected(item,true); |
124 | mNameLineEdit->setText(a.realName()); | 124 | mNameLineEdit->setText(a.realName()); |
125 | mEmailLineEdit->setText(a.preferredEmail()); | 125 | mEmailLineEdit->setText(a.preferredEmail()); |
126 | mAddressListView->insertItem(item); | 126 | mAddressListView->insertItem(item); |
127 | } | 127 | } |
128 | } | 128 | } |
129 | #endif | 129 | #endif |
130 | } | 130 | } |
131 | 131 | ||
132 | void PublishDialog::updateItem() | 132 | void PublishDialog::updateItem() |
133 | { | 133 | { |
134 | QListViewItem *item; | 134 | Q3ListViewItem *item; |
135 | item = mAddressListView->selectedItem(); | 135 | item = mAddressListView->selectedItem(); |
136 | if (!item) return; | 136 | if (!item) return; |
137 | item->setText(0,mNameLineEdit->text()); | 137 | item->setText(0,mNameLineEdit->text()); |
138 | item->setText(1,mEmailLineEdit->text()); | 138 | item->setText(1,mEmailLineEdit->text()); |
139 | } | 139 | } |
140 | 140 | ||
141 | void PublishDialog::updateInput() | 141 | void PublishDialog::updateInput() |
142 | { | 142 | { |
143 | QListViewItem *item; | 143 | Q3ListViewItem *item; |
144 | item = mAddressListView->selectedItem(); | 144 | item = mAddressListView->selectedItem(); |
145 | if (!item) return; | 145 | if (!item) return; |
146 | mNameLineEdit->setEnabled(true); | 146 | mNameLineEdit->setEnabled(true); |
147 | mEmailLineEdit->setEnabled(true); | 147 | mEmailLineEdit->setEnabled(true); |
148 | QString mail = item->text(1); | 148 | QString mail = item->text(1); |
149 | mNameLineEdit->setText(item->text(0)); | 149 | mNameLineEdit->setText(item->text(0)); |
150 | mEmailLineEdit->setText(mail); | 150 | mEmailLineEdit->setText(mail); |
151 | } | 151 | } |