summaryrefslogtreecommitdiffabout
path: root/kabc/distributionlisteditor.cpp
Unidiff
Diffstat (limited to 'kabc/distributionlisteditor.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/distributionlisteditor.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/kabc/distributionlisteditor.cpp b/kabc/distributionlisteditor.cpp
index bad1efc..9f5840b 100644
--- a/kabc/distributionlisteditor.cpp
+++ b/kabc/distributionlisteditor.cpp
@@ -1,73 +1,77 @@
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 <qpushbutton.h> 23#include <qpushbutton.h>
24#include <qcombobox.h> 24#include <qcombobox.h>
25#ifdef DESKTOP_VERSION
25#include <qinputdialog.h> 26#include <qinputdialog.h>
27#else
28#include <qtcompat/qinputdialog.h>
29#endif
26#include <qbuttongroup.h> 30#include <qbuttongroup.h>
27#include <qradiobutton.h> 31#include <qradiobutton.h>
28 32
29#include <klocale.h> 33#include <klocale.h>
30#include <kdebug.h> 34#include <kdebug.h>
31 35
32#include "addressbook.h" 36#include "addressbook.h"
33#include "addresseedialog.h" 37#include "addresseedialog.h"
34#include "distributionlist.h" 38#include "distributionlist.h"
35 39
36#include "distributionlisteditor.h" 40#include "distributionlisteditor.h"
37 41
38//US #include "distributionlisteditor.moc" 42//US #include "distributionlisteditor.moc"
39 43
40using namespace KABC; 44using namespace KABC;
41 45
42EmailSelectDialog::EmailSelectDialog( const QStringList &emails, const QString &current, 46EmailSelectDialog::EmailSelectDialog( const QStringList &emails, const QString &current,
43 QWidget *parent ) : 47 QWidget *parent ) :
44 KDialogBase( KDialogBase::Plain, i18n("Select Email Address"), Ok, Ok, 48 KDialogBase( KDialogBase::Plain, i18n("Select Email Address"), Ok, Ok,
45 parent ) 49 parent )
46{ 50{
47 QFrame *topFrame = plainPage(); 51 QFrame *topFrame = plainPage();
48 QBoxLayout *topLayout = new QVBoxLayout( topFrame ); 52 QBoxLayout *topLayout = new QVBoxLayout( topFrame );
49 53
50 mButtonGroup = new QButtonGroup( 1, Horizontal, i18n("Email Addresses"), 54 mButtonGroup = new QButtonGroup( 1, Horizontal, i18n("Email Addresses"),
51 topFrame ); 55 topFrame );
52 topLayout->addWidget( mButtonGroup ); 56 topLayout->addWidget( mButtonGroup );
53 57
54 QStringList::ConstIterator it; 58 QStringList::ConstIterator it;
55 for( it = emails.begin(); it != emails.end(); ++it ) { 59 for( it = emails.begin(); it != emails.end(); ++it ) {
56 QRadioButton *button = new QRadioButton( *it, mButtonGroup ); 60 QRadioButton *button = new QRadioButton( *it, mButtonGroup );
57 if ( (*it) == current ) { 61 if ( (*it) == current ) {
58 button->setDown( true ); 62 button->setDown( true );
59 } 63 }
60 } 64 }
61} 65}
62 66
63QString EmailSelectDialog::selected() 67QString EmailSelectDialog::selected()
64{ 68{
65 QButton *button = mButtonGroup->selected(); 69 QButton *button = mButtonGroup->selected();
66 if ( button ) return button->text(); 70 if ( button ) return button->text();
67 return QString::null; 71 return QString::null;
68} 72}
69 73
70QString EmailSelectDialog::getEmail( const QStringList &emails, const QString &current, 74QString EmailSelectDialog::getEmail( const QStringList &emails, const QString &current,
71 QWidget *parent ) 75 QWidget *parent )
72{ 76{
73 77