author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /kabc/distributionlisteditor.cpp | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
Diffstat (limited to 'kabc/distributionlisteditor.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kabc/distributionlisteditor.cpp | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/kabc/distributionlisteditor.cpp b/kabc/distributionlisteditor.cpp index 9f5840b..ca5ecb7 100644 --- a/kabc/distributionlisteditor.cpp +++ b/kabc/distributionlisteditor.cpp | |||
@@ -15,23 +15,27 @@ | |||
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 <q3listview.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 | #ifdef DESKTOP_VERSION |
26 | #include <qinputdialog.h> | 26 | #include <qinputdialog.h> |
27 | #else | 27 | #else |
28 | #include <qtcompat/qinputdialog.h> | 28 | #include <qtcompat/qinputdialog.h> |
29 | #endif | 29 | #endif |
30 | #include <qbuttongroup.h> | 30 | #include <q3buttongroup.h> |
31 | #include <qradiobutton.h> | 31 | #include <qradiobutton.h> |
32 | //Added by qt3to4: | ||
33 | #include <Q3HBoxLayout> | ||
34 | #include <Q3Frame> | ||
35 | #include <Q3VBoxLayout> | ||
32 | 36 | ||
33 | #include <klocale.h> | 37 | #include <klocale.h> |
34 | #include <kdebug.h> | 38 | #include <kdebug.h> |
35 | 39 | ||
36 | #include "addressbook.h" | 40 | #include "addressbook.h" |
37 | #include "addresseedialog.h" | 41 | #include "addresseedialog.h" |
@@ -45,16 +49,16 @@ using namespace KABC; | |||
45 | 49 | ||
46 | EmailSelectDialog::EmailSelectDialog( const QStringList &emails, const QString ¤t, | 50 | EmailSelectDialog::EmailSelectDialog( const QStringList &emails, const QString ¤t, |
47 | QWidget *parent ) : | 51 | QWidget *parent ) : |
48 | KDialogBase( KDialogBase::Plain, i18n("Select Email Address"), Ok, Ok, | 52 | KDialogBase( KDialogBase::Plain, i18n("Select Email Address"), Ok, Ok, |
49 | parent ) | 53 | parent ) |
50 | { | 54 | { |
51 | QFrame *topFrame = plainPage(); | 55 | Q3Frame *topFrame = plainPage(); |
52 | QBoxLayout *topLayout = new QVBoxLayout( topFrame ); | 56 | Q3BoxLayout *topLayout = new Q3VBoxLayout( topFrame ); |
53 | 57 | ||
54 | mButtonGroup = new QButtonGroup( 1, Horizontal, i18n("Email Addresses"), | 58 | mButtonGroup = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("Email Addresses"), |
55 | topFrame ); | 59 | topFrame ); |
56 | topLayout->addWidget( mButtonGroup ); | 60 | topLayout->addWidget( mButtonGroup ); |
57 | 61 | ||
58 | QStringList::ConstIterator it; | 62 | QStringList::ConstIterator it; |
59 | for( it = emails.begin(); it != emails.end(); ++it ) { | 63 | for( it = emails.begin(); it != emails.end(); ++it ) { |
60 | QRadioButton *button = new QRadioButton( *it, mButtonGroup ); | 64 | QRadioButton *button = new QRadioButton( *it, mButtonGroup ); |
@@ -63,13 +67,13 @@ EmailSelectDialog::EmailSelectDialog( const QStringList &emails, const QString & | |||
63 | } | 67 | } |
64 | } | 68 | } |
65 | } | 69 | } |
66 | 70 | ||
67 | QString EmailSelectDialog::selected() | 71 | QString EmailSelectDialog::selected() |
68 | { | 72 | { |
69 | QButton *button = mButtonGroup->selected(); | 73 | QAbstractButton *button = mButtonGroup->selected(); |
70 | if ( button ) return button->text(); | 74 | if ( button ) return button->text(); |
71 | return QString::null; | 75 | return QString::null; |
72 | } | 76 | } |
73 | 77 | ||
74 | QString EmailSelectDialog::getEmail( const QStringList &emails, const QString ¤t, | 78 | QString EmailSelectDialog::getEmail( const QStringList &emails, const QString ¤t, |
75 | QWidget *parent ) | 79 | QWidget *parent ) |
@@ -82,18 +86,18 @@ QString EmailSelectDialog::getEmail( const QStringList &emails, const QString &c | |||
82 | 86 | ||
83 | delete dlg; | 87 | delete dlg; |
84 | 88 | ||
85 | return result; | 89 | return result; |
86 | } | 90 | } |
87 | 91 | ||
88 | class EditEntryItem : public QListViewItem | 92 | class EditEntryItem : public Q3ListViewItem |
89 | { | 93 | { |
90 | public: | 94 | public: |
91 | EditEntryItem( QListView *parent, const Addressee &addressee, | 95 | EditEntryItem( Q3ListView *parent, const Addressee &addressee, |
92 | const QString &email=QString::null ) : | 96 | const QString &email=QString::null ) : |
93 | QListViewItem( parent ), | 97 | Q3ListViewItem( parent ), |
94 | mAddressee( addressee ), | 98 | mAddressee( addressee ), |
95 | mEmail( email ) | 99 | mEmail( email ) |
96 | { | 100 | { |
97 | setText( 0, addressee.realName() ); | 101 | setText( 0, addressee.realName() ); |
98 | if( email.isEmpty() ) { | 102 | if( email.isEmpty() ) { |
99 | setText( 1, addressee.preferredEmail() ); | 103 | setText( 1, addressee.preferredEmail() ); |
@@ -122,17 +126,17 @@ class EditEntryItem : public QListViewItem | |||
122 | DistributionListEditor::DistributionListEditor( AddressBook *addressBook, QWidget *parent) : | 126 | DistributionListEditor::DistributionListEditor( AddressBook *addressBook, QWidget *parent) : |
123 | QWidget( parent ), | 127 | QWidget( parent ), |
124 | mAddressBook( addressBook ) | 128 | mAddressBook( addressBook ) |
125 | { | 129 | { |
126 | kdDebug(5700) << "DistributionListEditor()" << endl; | 130 | kdDebug(5700) << "DistributionListEditor()" << endl; |
127 | 131 | ||
128 | QBoxLayout *topLayout = new QVBoxLayout( this ); | 132 | Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); |
129 | topLayout->setMargin( KDialog::marginHint() ); | 133 | topLayout->setMargin( KDialog::marginHint() ); |
130 | topLayout->setSpacing( KDialog::spacingHint() ); | 134 | topLayout->setSpacing( KDialog::spacingHint() ); |
131 | 135 | ||
132 | QBoxLayout *nameLayout = new QHBoxLayout( topLayout) ; | 136 | Q3BoxLayout *nameLayout = new Q3HBoxLayout( topLayout) ; |
133 | 137 | ||
134 | mNameCombo = new QComboBox( this ); | 138 | mNameCombo = new QComboBox( this ); |
135 | nameLayout->addWidget( mNameCombo ); | 139 | nameLayout->addWidget( mNameCombo ); |
136 | connect( mNameCombo, SIGNAL( activated( int ) ), SLOT( updateEntryView() ) ); | 140 | connect( mNameCombo, SIGNAL( activated( int ) ), SLOT( updateEntryView() ) ); |
137 | 141 | ||
138 | newButton = new QPushButton( i18n("New List"), this ); | 142 | newButton = new QPushButton( i18n("New List"), this ); |
@@ -140,13 +144,13 @@ DistributionListEditor::DistributionListEditor( AddressBook *addressBook, QWidge | |||
140 | connect( newButton, SIGNAL( clicked() ), SLOT( newList() ) ); | 144 | connect( newButton, SIGNAL( clicked() ), SLOT( newList() ) ); |
141 | 145 | ||
142 | removeButton = new QPushButton( i18n("Remove List"), this ); | 146 | removeButton = new QPushButton( i18n("Remove List"), this ); |
143 | nameLayout->addWidget( removeButton ); | 147 | nameLayout->addWidget( removeButton ); |
144 | connect( removeButton, SIGNAL( clicked() ), SLOT( removeList() ) ); | 148 | connect( removeButton, SIGNAL( clicked() ), SLOT( removeList() ) ); |
145 | 149 | ||
146 | mEntryView = new QListView( this ); | 150 | mEntryView = new Q3ListView( this ); |
147 | mEntryView->addColumn( i18n("Name") ); | 151 | mEntryView->addColumn( i18n("Name") ); |
148 | mEntryView->addColumn( i18n("Email") ); | 152 | mEntryView->addColumn( i18n("Email") ); |
149 | mEntryView->addColumn( i18n("Use Preferred") ); | 153 | mEntryView->addColumn( i18n("Use Preferred") ); |
150 | topLayout->addWidget( mEntryView ); | 154 | topLayout->addWidget( mEntryView ); |
151 | connect(mEntryView,SIGNAL(selectionChanged ()),this, SLOT(slotSelectionEntryViewChanged())); | 155 | connect(mEntryView,SIGNAL(selectionChanged ()),this, SLOT(slotSelectionEntryViewChanged())); |
152 | 156 | ||
@@ -159,13 +163,13 @@ DistributionListEditor::DistributionListEditor( AddressBook *addressBook, QWidge | |||
159 | connect( removeEntryButton, SIGNAL( clicked() ), SLOT( removeEntry() ) ); | 163 | connect( removeEntryButton, SIGNAL( clicked() ), SLOT( removeEntry() ) ); |
160 | 164 | ||
161 | addEntryButton = new QPushButton( i18n("Add Entry"), this ); | 165 | addEntryButton = new QPushButton( i18n("Add Entry"), this ); |
162 | topLayout->addWidget( addEntryButton ); | 166 | topLayout->addWidget( addEntryButton ); |
163 | connect( addEntryButton, SIGNAL( clicked() ), SLOT( addEntry() ) ); | 167 | connect( addEntryButton, SIGNAL( clicked() ), SLOT( addEntry() ) ); |
164 | 168 | ||
165 | mAddresseeView = new QListView( this ); | 169 | mAddresseeView = new Q3ListView( this ); |
166 | mAddresseeView->addColumn( i18n("Name") ); | 170 | mAddresseeView->addColumn( i18n("Name") ); |
167 | mAddresseeView->addColumn( i18n("Preferred Email") ); | 171 | mAddresseeView->addColumn( i18n("Preferred Email") ); |
168 | topLayout->addWidget( mAddresseeView ); | 172 | topLayout->addWidget( mAddresseeView ); |
169 | 173 | ||
170 | 174 | ||
171 | connect(mAddresseeView,SIGNAL(selectionChanged ()),this, SLOT(slotSelectionAddresseeViewChanged())); | 175 | connect(mAddresseeView,SIGNAL(selectionChanged ()),this, SLOT(slotSelectionAddresseeViewChanged())); |