Diffstat (limited to 'core/pim/addressbook/addressbook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index 86d1760..e11cf4c 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp | |||
@@ -128,24 +128,38 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
128 | actionEdit = a; | 128 | actionEdit = a; |
129 | connect( a, SIGNAL( activated() ), this, SLOT( slotViewEdit() ) ); | 129 | connect( a, SIGNAL( activated() ), this, SLOT( slotViewEdit() ) ); |
130 | a->addTo( edit ); | 130 | a->addTo( edit ); |
131 | a->addTo( listTools ); | 131 | a->addTo( listTools ); |
132 | 132 | ||
133 | a = new QAction( tr( "Delete" ), Resource::loadPixmap( "trash" ), QString::null, | 133 | a = new QAction( tr( "Delete" ), Resource::loadPixmap( "trash" ), QString::null, |
134 | 0, this, 0 ); | 134 | 0, this, 0 ); |
135 | actionTrash = a; | 135 | actionTrash = a; |
136 | connect( a, SIGNAL( activated() ), this, SLOT( slotListDelete() ) ); | 136 | connect( a, SIGNAL( activated() ), this, SLOT( slotListDelete() ) ); |
137 | a->addTo( edit ); | 137 | a->addTo( edit ); |
138 | a->addTo( listTools ); | 138 | a->addTo( listTools ); |
139 | 139 | ||
140 | |||
141 | // make it possible to go directly to businesscard via qcop call | ||
142 | #if defined(Q_WS_QWS) | ||
143 | #if !defined(QT_NO_COP) | ||
144 | QCopChannel *addressChannel = new QCopChannel("QPE/Addressbook" , this ); | ||
145 | connect (addressChannel, SIGNAL( received(const QCString &, const QByteArray &)), | ||
146 | this, SLOT ( appMessage(const QCString &, const QByteArray &) ) ); | ||
147 | #endif | ||
148 | #endif | ||
149 | |||
150 | |||
151 | |||
152 | |||
153 | |||
140 | #ifndef MAKE_FOR_SHARP_ROM | 154 | #ifndef MAKE_FOR_SHARP_ROM |
141 | a = new QAction( tr( "Find" ), Resource::loadPixmap( "mag" ), | 155 | a = new QAction( tr( "Find" ), Resource::loadPixmap( "mag" ), |
142 | QString::null, 0, this, 0 ); | 156 | QString::null, 0, this, 0 ); |
143 | actionFind = a; | 157 | actionFind = a; |
144 | connect( a, SIGNAL(activated()), this, SLOT(slotFind()) ); | 158 | connect( a, SIGNAL(activated()), this, SLOT(slotFind()) ); |
145 | a->addTo( edit ); | 159 | a->addTo( edit ); |
146 | a->addTo( listTools ); | 160 | a->addTo( listTools ); |
147 | #endif | 161 | #endif |
148 | 162 | ||
149 | 163 | ||
150 | a = new QAction( tr( "Write Mail To" ), Resource::loadPixmap( "qtmail/reply" ), | 164 | a = new QAction( tr( "Write Mail To" ), Resource::loadPixmap( "qtmail/reply" ), |
151 | QString::null, 0, this, 0 ); | 165 | QString::null, 0, this, 0 ); |
@@ -241,24 +255,26 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
241 | fontMenu->insertItem(tr( "Normal" ), 1); | 255 | fontMenu->insertItem(tr( "Normal" ), 1); |
242 | fontMenu->insertItem(tr( "Large" ), 2); | 256 | fontMenu->insertItem(tr( "Large" ), 2); |
243 | 257 | ||
244 | defaultFont = new QFont( abList->font() ); | 258 | defaultFont = new QFont( abList->font() ); |
245 | 259 | ||
246 | slotSetFont(startFontSize); | 260 | slotSetFont(startFontSize); |
247 | 261 | ||
248 | mbList->insertItem( tr("Font"), fontMenu); | 262 | mbList->insertItem( tr("Font"), fontMenu); |
249 | setCentralWidget(listContainer); | 263 | setCentralWidget(listContainer); |
250 | 264 | ||
251 | // qDebug("adressbook contrsuction: t=%d", t.elapsed() ); | 265 | // qDebug("adressbook contrsuction: t=%d", t.elapsed() ); |
252 | } | 266 | } |
267 | |||
268 | |||
253 | void AddressbookWindow::slotSetFont( int size ) { | 269 | void AddressbookWindow::slotSetFont( int size ) { |
254 | 270 | ||
255 | if (size > 2 || size < 0) | 271 | if (size > 2 || size < 0) |
256 | size = 1; | 272 | size = 1; |
257 | 273 | ||
258 | startFontSize = size; | 274 | startFontSize = size; |
259 | 275 | ||
260 | QFont *currentFont; | 276 | QFont *currentFont; |
261 | 277 | ||
262 | switch (size) { | 278 | switch (size) { |
263 | case 0: | 279 | case 0: |
264 | fontMenu->setItemChecked(0, true); | 280 | fontMenu->setItemChecked(0, true); |
@@ -284,25 +300,25 @@ void AddressbookWindow::slotSetFont( int size ) { | |||
284 | currentFont = new QFont (abList->font()); | 300 | currentFont = new QFont (abList->font()); |
285 | abList->resizeRows(currentFont->pixelSize() + 7); | 301 | abList->resizeRows(currentFont->pixelSize() + 7); |
286 | break; | 302 | break; |
287 | } | 303 | } |
288 | } | 304 | } |
289 | 305 | ||
290 | 306 | ||
291 | 307 | ||
292 | void AddressbookWindow::importvCard() { | 308 | void AddressbookWindow::importvCard() { |
293 | QString str = OFileDialog::getOpenFileName( 1,"/");//,"", "*", this ); | 309 | QString str = OFileDialog::getOpenFileName( 1,"/");//,"", "*", this ); |
294 | if(!str.isEmpty() ) | 310 | if(!str.isEmpty() ) |
295 | setDocument((const QString&) str ); | 311 | setDocument((const QString&) str ); |
296 | 312 | ||
297 | } | 313 | } |
298 | 314 | ||
299 | void AddressbookWindow::setDocument( const QString &filename ) | 315 | void AddressbookWindow::setDocument( const QString &filename ) |
300 | { | 316 | { |
301 | if ( filename.find(".vcf") != int(filename.length()) - 4 ) return; | 317 | if ( filename.find(".vcf") != int(filename.length()) - 4 ) return; |
302 | 318 | ||
303 | QValueList<Contact> cl = Contact::readVCard( filename ); | 319 | QValueList<Contact> cl = Contact::readVCard( filename ); |
304 | for( QValueList<Contact>::Iterator it = cl.begin(); it != cl.end(); ++it ) { | 320 | for( QValueList<Contact>::Iterator it = cl.begin(); it != cl.end(); ++it ) { |
305 | // QString msg = tr("You received a vCard for\n%1.\nDo You want to add it to your\naddressbook?") | 321 | // QString msg = tr("You received a vCard for\n%1.\nDo You want to add it to your\naddressbook?") |
306 | // .arg( (*it).fullName() ); | 322 | // .arg( (*it).fullName() ); |
307 | // if ( QMessageBox::information( this, tr("received contact"), msg, QMessageBox::Ok, QMessageBox::Cancel ) == | 323 | // if ( QMessageBox::information( this, tr("received contact"), msg, QMessageBox::Ok, QMessageBox::Cancel ) == |
308 | // QMessageBox::Ok ) { | 324 | // QMessageBox::Ok ) { |