summaryrefslogtreecommitdiffabout
authorulf69 <ulf69>2004-06-29 05:23:32 (UTC)
committer ulf69 <ulf69>2004-06-29 05:23:32 (UTC)
commitfbc79b15b58ca195fa63c741a89d6d098cc05a66 (patch) (unidiff)
treee17713fc73877f2ff133af8910d40e0ae0590df5
parent822dcc26ab3b70952679a1e12a010549659b6351 (diff)
downloadkdepimpi-fbc79b15b58ca195fa63c741a89d6d098cc05a66.zip
kdepimpi-fbc79b15b58ca195fa63c741a89d6d098cc05a66.tar.gz
kdepimpi-fbc79b15b58ca195fa63c741a89d6d098cc05a66.tar.bz2
removed inclusion of moc file
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/distributionlistdialog.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/kabc/distributionlistdialog.cpp b/kabc/distributionlistdialog.cpp
index 31d5944..d2e1144 100644
--- a/kabc/distributionlistdialog.cpp
+++ b/kabc/distributionlistdialog.cpp
@@ -1,138 +1,136 @@
1/* 1/*
2 This file is part of libkabc. 2 This file is part of libkabc.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library 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 GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#include <qlistview.h> 21#include <qlistview.h>
22#include <qlayout.h> 22#include <qlayout.h>
23#include <qlabel.h> 23#include <qlabel.h>
24#include <qpushbutton.h> 24#include <qpushbutton.h>
25#include <qcombobox.h> 25#include <qcombobox.h>
26#include <klineeditdlg.h> 26#include <klineeditdlg.h>
27#include <qbuttongroup.h> 27#include <qbuttongroup.h>
28#include <qradiobutton.h> 28#include <qradiobutton.h>
29 29
30#include <klocale.h> 30#include <klocale.h>
31#include <kdebug.h> 31#include <kdebug.h>
32#include <kmessagebox.h> 32#include <kmessagebox.h>
33 33
34#include "addressbook.h" 34#include "addressbook.h"
35#include "addresseedialog.h" 35#include "addresseedialog.h"
36#include "distributionlist.h" 36#include "distributionlist.h"
37 37
38#include "distributionlistdialog.h" 38#include "distributionlistdialog.h"
39 39
40#ifndef KAB_EMBEDDED 40//US #include "distributionlistdialog.moc"
41#include "distributionlistdialog.moc"
42#endif //KAB_EMBEDDED
43 41
44using namespace KABC; 42using namespace KABC;
45 43
46DistributionListDialog::DistributionListDialog( AddressBook *addressBook, QWidget *parent) 44DistributionListDialog::DistributionListDialog( AddressBook *addressBook, QWidget *parent)
47 : KDialogBase( parent, "", true, i18n("Configure Distribution Lists"), Ok, Ok, true) 45 : KDialogBase( parent, "", true, i18n("Configure Distribution Lists"), Ok, Ok, true)
48{ 46{
49 mEditor = new DistributionListEditorWidget( addressBook, this ); 47 mEditor = new DistributionListEditorWidget( addressBook, this );
50 setMainWidget( mEditor ); 48 setMainWidget( mEditor );
51 49
52 connect( this, SIGNAL( okClicked() ), mEditor, SLOT( save() ) ); 50 connect( this, SIGNAL( okClicked() ), mEditor, SLOT( save() ) );
53} 51}
54 52
55DistributionListDialog::~DistributionListDialog() 53DistributionListDialog::~DistributionListDialog()
56{ 54{
57} 55}
58 56
59 57
60EmailSelector::EmailSelector( const QStringList &emails, const QString &current, 58EmailSelector::EmailSelector( const QStringList &emails, const QString &current,
61 QWidget *parent ) : 59 QWidget *parent ) :
62 KDialogBase( KDialogBase::Plain, i18n("Select Email Address"), Ok, Ok, 60 KDialogBase( KDialogBase::Plain, i18n("Select Email Address"), Ok, Ok,
63 parent ) 61 parent )
64{ 62{
65 QFrame *topFrame = plainPage(); 63 QFrame *topFrame = plainPage();
66 QBoxLayout *topLayout = new QVBoxLayout( topFrame ); 64 QBoxLayout *topLayout = new QVBoxLayout( topFrame );
67 65
68 mButtonGroup = new QButtonGroup( 1, Horizontal, i18n("Email Addresses"), 66 mButtonGroup = new QButtonGroup( 1, Horizontal, i18n("Email Addresses"),
69 topFrame ); 67 topFrame );
70 topLayout->addWidget( mButtonGroup ); 68 topLayout->addWidget( mButtonGroup );
71 69
72 QStringList::ConstIterator it; 70 QStringList::ConstIterator it;
73 for( it = emails.begin(); it != emails.end(); ++it ) { 71 for( it = emails.begin(); it != emails.end(); ++it ) {
74 QRadioButton *button = new QRadioButton( *it, mButtonGroup ); 72 QRadioButton *button = new QRadioButton( *it, mButtonGroup );
75 if ( (*it) == current ) { 73 if ( (*it) == current ) {
76 button->setDown( true ); 74 button->setDown( true );
77 } 75 }
78 } 76 }
79} 77}
80 78
81QString EmailSelector::selected() 79QString EmailSelector::selected()
82{ 80{
83 QButton *button = mButtonGroup->selected(); 81 QButton *button = mButtonGroup->selected();
84 if ( button ) return button->text(); 82 if ( button ) return button->text();
85 return QString::null; 83 return QString::null;
86} 84}
87 85
88QString EmailSelector::getEmail( const QStringList &emails, const QString &current, 86QString EmailSelector::getEmail( const QStringList &emails, const QString &current,
89 QWidget *parent ) 87 QWidget *parent )
90{ 88{
91 EmailSelector *dlg = new EmailSelector( emails, current, parent ); 89 EmailSelector *dlg = new EmailSelector( emails, current, parent );
92 dlg->exec(); 90 dlg->exec();
93 91
94 QString result = dlg->selected(); 92 QString result = dlg->selected();
95 93
96 delete dlg; 94 delete dlg;
97 95
98 return result; 96 return result;
99} 97}
100 98
101class EntryItem : public QListViewItem 99class EntryItem : public QListViewItem
102{ 100{
103 public: 101 public:
104 EntryItem( QListView *parent, const Addressee &addressee, 102 EntryItem( QListView *parent, const Addressee &addressee,
105 const QString &email=QString::null ) : 103 const QString &email=QString::null ) :
106 QListViewItem( parent ), 104 QListViewItem( parent ),
107 mAddressee( addressee ), 105 mAddressee( addressee ),
108 mEmail( email ) 106 mEmail( email )
109 { 107 {
110 setText( 0, addressee.realName() ); 108 setText( 0, addressee.realName() );
111 if( email.isEmpty() ) { 109 if( email.isEmpty() ) {
112 setText( 1, addressee.preferredEmail() ); 110 setText( 1, addressee.preferredEmail() );
113 setText( 2, i18n("Yes") ); 111 setText( 2, i18n("Yes") );
114 } else { 112 } else {
115 setText( 1, email ); 113 setText( 1, email );
116 setText( 2, i18n("No") ); 114 setText( 2, i18n("No") );
117 } 115 }
118 } 116 }
119 117
120 Addressee addressee() const 118 Addressee addressee() const
121 { 119 {
122 return mAddressee; 120 return mAddressee;
123 } 121 }
124 122
125 QString email() const 123 QString email() const
126 { 124 {
127 return mEmail; 125 return mEmail;
128 } 126 }
129 127
130 private: 128 private:
131 Addressee mAddressee; 129 Addressee mAddressee;
132 QString mEmail; 130 QString mEmail;
133}; 131};
134 132
135DistributionListEditorWidget::DistributionListEditorWidget( AddressBook *addressBook, QWidget *parent) : 133DistributionListEditorWidget::DistributionListEditorWidget( AddressBook *addressBook, QWidget *parent) :
136 QWidget( parent ), 134 QWidget( parent ),
137 mAddressBook( addressBook ) 135 mAddressBook( addressBook )
138{ 136{