summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-01-21 19:36:09 (UTC)
committer zautrix <zautrix>2005-01-21 19:36:09 (UTC)
commit243562861a82aa2793362029a6c93b2b300b9477 (patch) (unidiff)
tree2ec9c81f21ef058dedf506d1d0be7213b9301eef
parent5cbac3131e5cecde6042db12ca73d5cd72fbed77 (diff)
downloadkdepimpi-243562861a82aa2793362029a6c93b2b300b9477.zip
kdepimpi-243562861a82aa2793362029a6c93b2b300b9477.tar.gz
kdepimpi-243562861a82aa2793362029a6c93b2b300b9477.tar.bz2
added tr.h
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/distributionlisteditor.cpp4
-rw-r--r--kaddressbook/tr.h2
-rw-r--r--korganizer/tr.h2
3 files changed, 8 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,153 +1,157 @@
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
74 EmailSelectDialog *dlg = new EmailSelectDialog( emails, current, parent ); 78 EmailSelectDialog *dlg = new EmailSelectDialog( emails, current, parent );
75 dlg->exec(); 79 dlg->exec();
76 80
77 QString result = dlg->selected(); 81 QString result = dlg->selected();
78 82
79 delete dlg; 83 delete dlg;
80 84
81 return result; 85 return result;
82} 86}
83 87
84class EditEntryItem : public QListViewItem 88class EditEntryItem : public QListViewItem
85{ 89{
86 public: 90 public:
87 EditEntryItem( QListView *parent, const Addressee &addressee, 91 EditEntryItem( QListView *parent, const Addressee &addressee,
88 const QString &email=QString::null ) : 92 const QString &email=QString::null ) :
89 QListViewItem( parent ), 93 QListViewItem( parent ),
90 mAddressee( addressee ), 94 mAddressee( addressee ),
91 mEmail( email ) 95 mEmail( email )
92 { 96 {
93 setText( 0, addressee.realName() ); 97 setText( 0, addressee.realName() );
94 if( email.isEmpty() ) { 98 if( email.isEmpty() ) {
95 setText( 1, addressee.preferredEmail() ); 99 setText( 1, addressee.preferredEmail() );
96 setText( 2, i18n("Yes") ); 100 setText( 2, i18n("Yes") );
97 } else { 101 } else {
98 setText( 1, email ); 102 setText( 1, email );
99 setText( 2, i18n("No") ); 103 setText( 2, i18n("No") );
100 } 104 }
101 } 105 }
102 106
103 Addressee addressee() const 107 Addressee addressee() const
104 { 108 {
105 return mAddressee; 109 return mAddressee;
106 } 110 }
107 111
108 QString email() const 112 QString email() const
109 { 113 {
110 return mEmail; 114 return mEmail;
111 } 115 }
112 116
113 private: 117 private:
114 Addressee mAddressee; 118 Addressee mAddressee;
115 QString mEmail; 119 QString mEmail;
116}; 120};
117 121
118DistributionListEditor::DistributionListEditor( AddressBook *addressBook, QWidget *parent) : 122DistributionListEditor::DistributionListEditor( AddressBook *addressBook, QWidget *parent) :
119 QWidget( parent ), 123 QWidget( parent ),
120 mAddressBook( addressBook ) 124 mAddressBook( addressBook )
121{ 125{
122 kdDebug(5700) << "DistributionListEditor()" << endl; 126 kdDebug(5700) << "DistributionListEditor()" << endl;
123 127
124 QBoxLayout *topLayout = new QVBoxLayout( this ); 128 QBoxLayout *topLayout = new QVBoxLayout( this );
125 topLayout->setMargin( KDialog::marginHint() ); 129 topLayout->setMargin( KDialog::marginHint() );
126 topLayout->setSpacing( KDialog::spacingHint() ); 130 topLayout->setSpacing( KDialog::spacingHint() );
127 131
128 QBoxLayout *nameLayout = new QHBoxLayout( topLayout) ; 132 QBoxLayout *nameLayout = new QHBoxLayout( topLayout) ;
129 133
130 mNameCombo = new QComboBox( this ); 134 mNameCombo = new QComboBox( this );
131 nameLayout->addWidget( mNameCombo ); 135 nameLayout->addWidget( mNameCombo );
132 connect( mNameCombo, SIGNAL( activated( int ) ), SLOT( updateEntryView() ) ); 136 connect( mNameCombo, SIGNAL( activated( int ) ), SLOT( updateEntryView() ) );
133 137
134 newButton = new QPushButton( i18n("New List"), this ); 138 newButton = new QPushButton( i18n("New List"), this );
135 nameLayout->addWidget( newButton ); 139 nameLayout->addWidget( newButton );
136 connect( newButton, SIGNAL( clicked() ), SLOT( newList() ) ); 140 connect( newButton, SIGNAL( clicked() ), SLOT( newList() ) );
137 141
138 removeButton = new QPushButton( i18n("Remove List"), this ); 142 removeButton = new QPushButton( i18n("Remove List"), this );
139 nameLayout->addWidget( removeButton ); 143 nameLayout->addWidget( removeButton );
140 connect( removeButton, SIGNAL( clicked() ), SLOT( removeList() ) ); 144 connect( removeButton, SIGNAL( clicked() ), SLOT( removeList() ) );
141 145
142 mEntryView = new QListView( this ); 146 mEntryView = new QListView( this );
143 mEntryView->addColumn( i18n("Name") ); 147 mEntryView->addColumn( i18n("Name") );
144 mEntryView->addColumn( i18n("Email") ); 148 mEntryView->addColumn( i18n("Email") );
145 mEntryView->addColumn( i18n("Use Preferred") ); 149 mEntryView->addColumn( i18n("Use Preferred") );
146 topLayout->addWidget( mEntryView ); 150 topLayout->addWidget( mEntryView );
147 connect(mEntryView,SIGNAL(selectionChanged ()),this, SLOT(slotSelectionEntryViewChanged())); 151 connect(mEntryView,SIGNAL(selectionChanged ()),this, SLOT(slotSelectionEntryViewChanged()));
148 152
149 changeEmailButton = new QPushButton( i18n("Change Email"), this ); 153 changeEmailButton = new QPushButton( i18n("Change Email"), this );
150 topLayout->addWidget( changeEmailButton ); 154 topLayout->addWidget( changeEmailButton );
151 connect( changeEmailButton, SIGNAL( clicked() ), SLOT( changeEmail() ) ); 155 connect( changeEmailButton, SIGNAL( clicked() ), SLOT( changeEmail() ) );
152 156
153 removeEntryButton = new QPushButton( i18n("Remove Entry"), this ); 157 removeEntryButton = new QPushButton( i18n("Remove Entry"), this );
diff --git a/kaddressbook/tr.h b/kaddressbook/tr.h
new file mode 100644
index 0000000..981e2c1
--- a/dev/null
+++ b/kaddressbook/tr.h
@@ -0,0 +1,2 @@
1#include <klocale.h>
2#define tr i18n
diff --git a/korganizer/tr.h b/korganizer/tr.h
new file mode 100644
index 0000000..981e2c1
--- a/dev/null
+++ b/korganizer/tr.h
@@ -0,0 +1,2 @@
1#include <klocale.h>
2#define tr i18n