-rw-r--r-- | kaddressbook/kabcore.cpp | 146 |
1 files changed, 78 insertions, 68 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index ab2824c..03b44d1 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -34,28 +34,38 @@ $Id$ | |||
34 | #include <klocale.h> | 34 | #include <klocale.h> |
35 | #include <kfiledialog.h> | 35 | #include <kfiledialog.h> |
36 | #include <qtimer.h> | 36 | #include <qtimer.h> |
37 | #include <qlabel.h> | 37 | #include <qlabel.h> |
38 | #include <qregexp.h> | 38 | #include <qregexp.h> |
39 | #include <qlineedit.h> | 39 | #include <qlineedit.h> |
40 | #include <qcheckbox.h> | 40 | #include <qcheckbox.h> |
41 | #include <qpushbutton.h> | 41 | #include <qpushbutton.h> |
42 | #include <qprogressbar.h> | 42 | #include <q3progressbar.h> |
43 | #include <QDesktopWidget> | ||
44 | //Added by qt3to4: | ||
45 | #include <QResizeEvent> | ||
46 | #include <QPixmap> | ||
47 | #include <Q3ValueList> | ||
48 | #include <Q3HBoxLayout> | ||
49 | #include <Q3VBoxLayout> | ||
50 | #include <Q3CString> | ||
51 | #include <Q3PopupMenu> | ||
52 | #include <Q3PtrList> | ||
43 | #include <libkdepim/phoneaccess.h> | 53 | #include <libkdepim/phoneaccess.h> |
44 | 54 | ||
45 | #ifndef KAB_EMBEDDED | 55 | #ifndef KAB_EMBEDDED |
46 | #include <qclipboard.h> | 56 | #include <qclipboard.h> |
47 | #include <qdir.h> | 57 | #include <qdir.h> |
48 | #include <qfile.h> | 58 | #include <qfile.h> |
49 | #include <qapplicaton.h> | 59 | #include <qapplicaton.h> |
50 | #include <qprogressbar.h> | 60 | #include <q3progressbar.h> |
51 | #include <qlayout.h> | 61 | #include <qlayout.h> |
52 | #include <qregexp.h> | 62 | #include <qregexp.h> |
53 | #include <qvbox.h> | 63 | #include <q3vbox.h> |
54 | #include <kabc/addresseelist.h> | 64 | #include <kabc/addresseelist.h> |
55 | #include <kabc/errorhandler.h> | 65 | #include <kabc/errorhandler.h> |
56 | #include <kabc/resource.h> | 66 | #include <kabc/resource.h> |
57 | #include <kabc/vcardconverter.h> | 67 | #include <kabc/vcardconverter.h> |
58 | #include <kapplication.h> | 68 | #include <kapplication.h> |
59 | #include <kactionclasses.h> | 69 | #include <kactionclasses.h> |
60 | #include <kcmultidialog.h> | 70 | #include <kcmultidialog.h> |
61 | #include <kdebug.h> | 71 | #include <kdebug.h> |
@@ -83,17 +93,17 @@ $Id$ | |||
83 | #include <kapplication.h> | 93 | #include <kapplication.h> |
84 | #include "KDGanttMinimizeSplitter.h" | 94 | #include "KDGanttMinimizeSplitter.h" |
85 | #include "kaddressbookmain.h" | 95 | #include "kaddressbookmain.h" |
86 | #include "kactioncollection.h" | 96 | #include "kactioncollection.h" |
87 | #include "addresseedialog.h" | 97 | #include "addresseedialog.h" |
88 | //US | 98 | //US |
89 | #include <addresseeview.h> | 99 | #include <addresseeview.h> |
90 | 100 | ||
91 | #include <qapp.h> | 101 | #include <qapplication.h> |
92 | #include <qmenubar.h> | 102 | #include <qmenubar.h> |
93 | //#include <qtoolbar.h> | 103 | //#include <qtoolbar.h> |
94 | #include <qmessagebox.h> | 104 | #include <qmessagebox.h> |
95 | #include <kdebug.h> | 105 | #include <kdebug.h> |
96 | #include <kiconloader.h> // needed for SmallIcon | 106 | #include <kiconloader.h> // needed for SmallIcon |
97 | #include <kresources/kcmkresources.h> | 107 | #include <kresources/kcmkresources.h> |
98 | #include <ktoolbar.h> | 108 | #include <ktoolbar.h> |
99 | #include <kprefsdialog.h> | 109 | #include <kprefsdialog.h> |
@@ -124,22 +134,22 @@ $Id$ | |||
124 | 134 | ||
125 | #include <picture.h> | 135 | #include <picture.h> |
126 | #include <resource.h> | 136 | #include <resource.h> |
127 | 137 | ||
128 | //US#include <qsplitter.h> | 138 | //US#include <qsplitter.h> |
129 | #include <qmap.h> | 139 | #include <qmap.h> |
130 | #include <qdir.h> | 140 | #include <qdir.h> |
131 | #include <qfile.h> | 141 | #include <qfile.h> |
132 | #include <qvbox.h> | 142 | #include <q3vbox.h> |
133 | #include <qlayout.h> | 143 | #include <qlayout.h> |
134 | #include <qclipboard.h> | 144 | #include <qclipboard.h> |
135 | #include <qtextstream.h> | 145 | #include <q3textstream.h> |
136 | #include <qradiobutton.h> | 146 | #include <qradiobutton.h> |
137 | #include <qbuttongroup.h> | 147 | #include <q3buttongroup.h> |
138 | 148 | ||
139 | #include <libkdepim/categoryselectdialog.h> | 149 | #include <libkdepim/categoryselectdialog.h> |
140 | #include <libkdepim/categoryeditdialog.h> | 150 | #include <libkdepim/categoryeditdialog.h> |
141 | #include <kabc/vcardconverter.h> | 151 | #include <kabc/vcardconverter.h> |
142 | 152 | ||
143 | 153 | ||
144 | #include "addresseeutil.h" | 154 | #include "addresseeutil.h" |
145 | #include "undocmds.h" | 155 | #include "undocmds.h" |
@@ -170,22 +180,22 @@ $Id$ | |||
170 | 180 | ||
171 | class KABCatPrefs : public QDialog | 181 | class KABCatPrefs : public QDialog |
172 | { | 182 | { |
173 | public: | 183 | public: |
174 | KABCatPrefs( QWidget *parent=0, const char *name=0 ) : | 184 | KABCatPrefs( QWidget *parent=0, const char *name=0 ) : |
175 | QDialog( parent, name, true ) | 185 | QDialog( parent, name, true ) |
176 | { | 186 | { |
177 | setCaption( i18n("Manage new Categories") ); | 187 | setCaption( i18n("Manage new Categories") ); |
178 | QVBoxLayout* lay = new QVBoxLayout( this ); | 188 | Q3VBoxLayout* lay = new Q3VBoxLayout( this ); |
179 | lay->setSpacing( 3 ); | 189 | lay->setSpacing( 3 ); |
180 | lay->setMargin( 3 ); | 190 | lay->setMargin( 3 ); |
181 | QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\naddressees\nwhich are not in the category list.\nPlease choose what to do:\n "), this ); | 191 | QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\naddressees\nwhich are not in the category list.\nPlease choose what to do:\n "), this ); |
182 | lay->addWidget( lab ); | 192 | lay->addWidget( lab ); |
183 | QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); | 193 | Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("New categories not in list:"), this ); |
184 | lay->addWidget( format ); | 194 | lay->addWidget( format ); |
185 | format->setExclusive ( true ) ; | 195 | format->setExclusive ( true ) ; |
186 | addCatBut = new QRadioButton(i18n("Add to category list"), format ); | 196 | addCatBut = new QRadioButton(i18n("Add to category list"), format ); |
187 | new QRadioButton(i18n("Remove from addressees"), format ); | 197 | new QRadioButton(i18n("Remove from addressees"), format ); |
188 | addCatBut->setChecked( true ); | 198 | addCatBut->setChecked( true ); |
189 | QPushButton * ok = new QPushButton( i18n("OK"), this ); | 199 | QPushButton * ok = new QPushButton( i18n("OK"), this ); |
190 | lay->addWidget( ok ); | 200 | lay->addWidget( ok ); |
191 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 201 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
@@ -202,22 +212,22 @@ private: | |||
202 | 212 | ||
203 | class KABFormatPrefs : public QDialog | 213 | class KABFormatPrefs : public QDialog |
204 | { | 214 | { |
205 | public: | 215 | public: |
206 | KABFormatPrefs( QWidget *parent=0, const char *name=0 ) : | 216 | KABFormatPrefs( QWidget *parent=0, const char *name=0 ) : |
207 | QDialog( parent, name, true ) | 217 | QDialog( parent, name, true ) |
208 | { | 218 | { |
209 | setCaption( i18n("Set formatted name") ); | 219 | setCaption( i18n("Set formatted name") ); |
210 | QVBoxLayout* lay = new QVBoxLayout( this ); | 220 | Q3VBoxLayout* lay = new Q3VBoxLayout( this ); |
211 | lay->setSpacing( 3 ); | 221 | lay->setSpacing( 3 ); |
212 | lay->setMargin( 3 ); | 222 | lay->setMargin( 3 ); |
213 | QLabel * lab = new QLabel( i18n("You can set the formatted name\nfor a list of contacts in one go."), this ); | 223 | QLabel * lab = new QLabel( i18n("You can set the formatted name\nfor a list of contacts in one go."), this ); |
214 | lay->addWidget( lab ); | 224 | lay->addWidget( lab ); |
215 | QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("Set formatted name to:"), this ); | 225 | Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("Set formatted name to:"), this ); |
216 | lay->addWidget( format ); | 226 | lay->addWidget( format ); |
217 | format->setExclusive ( true ) ; | 227 | format->setExclusive ( true ) ; |
218 | simple = new QRadioButton(i18n("Simple: James Bond"), format ); | 228 | simple = new QRadioButton(i18n("Simple: James Bond"), format ); |
219 | full = new QRadioButton(i18n("Full: Mr. James 007 Bond I"), format ); | 229 | full = new QRadioButton(i18n("Full: Mr. James 007 Bond I"), format ); |
220 | reverse = new QRadioButton(i18n("Reverse: Bond, James"), format ); | 230 | reverse = new QRadioButton(i18n("Reverse: Bond, James"), format ); |
221 | company = new QRadioButton(i18n("Organization: MI6"), format ); | 231 | company = new QRadioButton(i18n("Organization: MI6"), format ); |
222 | simple->setChecked( true ); | 232 | simple->setChecked( true ); |
223 | setCompany = new QCheckBox(i18n("Set formatted name to\norganization, if name empty"), this); | 233 | setCompany = new QCheckBox(i18n("Set formatted name to\norganization, if name empty"), this); |
@@ -240,39 +250,39 @@ public: | |||
240 | 250 | ||
241 | class KAex2phonePrefs : public QDialog | 251 | class KAex2phonePrefs : public QDialog |
242 | { | 252 | { |
243 | public: | 253 | public: |
244 | KAex2phonePrefs( QWidget *parent=0, const char *name=0 ) : | 254 | KAex2phonePrefs( QWidget *parent=0, const char *name=0 ) : |
245 | QDialog( parent, name, true ) | 255 | QDialog( parent, name, true ) |
246 | { | 256 | { |
247 | setCaption( i18n("Export to phone options") ); | 257 | setCaption( i18n("Export to phone options") ); |
248 | QVBoxLayout* lay = new QVBoxLayout( this ); | 258 | Q3VBoxLayout* lay = new Q3VBoxLayout( this ); |
249 | lay->setSpacing( 3 ); | 259 | lay->setSpacing( 3 ); |
250 | lay->setMargin( 3 ); | 260 | lay->setMargin( 3 ); |
251 | QLabel *lab; | 261 | QLabel *lab; |
252 | lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); | 262 | lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); |
253 | lab->setAlignment (AlignHCenter ); | 263 | lab->setAlignment (Qt::AlignHCenter ); |
254 | QHBox* temphb; | 264 | Q3HBox* temphb; |
255 | temphb = new QHBox( this ); | 265 | temphb = new Q3HBox( this ); |
256 | new QLabel( i18n("I/O device: "), temphb ); | 266 | new QLabel( i18n("I/O device: "), temphb ); |
257 | mPhoneDevice = new QLineEdit( temphb); | 267 | mPhoneDevice = new QLineEdit( temphb); |
258 | lay->addWidget( temphb ); | 268 | lay->addWidget( temphb ); |
259 | temphb = new QHBox( this ); | 269 | temphb = new Q3HBox( this ); |
260 | new QLabel( i18n("Connection: "), temphb ); | 270 | new QLabel( i18n("Connection: "), temphb ); |
261 | mPhoneConnection = new QLineEdit( temphb); | 271 | mPhoneConnection = new QLineEdit( temphb); |
262 | lay->addWidget( temphb ); | 272 | lay->addWidget( temphb ); |
263 | temphb = new QHBox( this ); | 273 | temphb = new Q3HBox( this ); |
264 | new QLabel( i18n("Model(opt.): "), temphb ); | 274 | new QLabel( i18n("Model(opt.): "), temphb ); |
265 | mPhoneModel = new QLineEdit( temphb); | 275 | mPhoneModel = new QLineEdit( temphb); |
266 | lay->addWidget( temphb ); | 276 | lay->addWidget( temphb ); |
267 | // mWriteToSim = new QCheckBox( i18n("Write Contacts to SIM card\n(if not, write to phone memory)"), this ); | 277 | // mWriteToSim = new QCheckBox( i18n("Write Contacts to SIM card\n(if not, write to phone memory)"), this ); |
268 | // lay->addWidget( mWriteToSim ); | 278 | // lay->addWidget( mWriteToSim ); |
269 | lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ncontact data on phone!"), this ) ); | 279 | lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ncontact data on phone!"), this ) ); |
270 | lab->setAlignment (AlignHCenter); | 280 | lab->setAlignment (Qt::AlignHCenter); |
271 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); | 281 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); |
272 | lay->addWidget( ok ); | 282 | lay->addWidget( ok ); |
273 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 283 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
274 | lay->addWidget( cancel ); | 284 | lay->addWidget( cancel ); |
275 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); | 285 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); |
276 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | 286 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); |
277 | resize( 220, 240 ); | 287 | resize( 220, 240 ); |
278 | 288 | ||
@@ -402,33 +412,33 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const | |||
402 | infrared = 0; | 412 | infrared = 0; |
403 | #endif | 413 | #endif |
404 | //toggleBeamReceive( ); | 414 | //toggleBeamReceive( ); |
405 | mMainWindow->toolBar()->show(); | 415 | mMainWindow->toolBar()->show(); |
406 | // we have a toolbar repainting error on the Zaurus when starting KA/Pi | 416 | // we have a toolbar repainting error on the Zaurus when starting KA/Pi |
407 | //QTimer::singleShot( 10, this , SLOT ( updateToolBar())); | 417 | //QTimer::singleShot( 10, this , SLOT ( updateToolBar())); |
408 | QTimer::singleShot( 100, this, SLOT ( loadDataAfterStart() )); | 418 | QTimer::singleShot( 100, this, SLOT ( loadDataAfterStart() )); |
409 | } | 419 | } |
410 | void KABCore::receiveStart( const QCString& cmsg, const QByteArray& data ) | 420 | void KABCore::receiveStart( const Q3CString& cmsg, const QByteArray& data ) |
411 | { | 421 | { |
412 | //qDebug("KO: QCOP start message received: %s ", cmsg.data() ); | 422 | //qDebug("KO: QCOP start message received: %s ", cmsg.data() ); |
413 | mCStringMess = cmsg; | 423 | mCStringMess = cmsg; |
414 | mByteData = data; | 424 | mByteData = data; |
415 | } | 425 | } |
416 | 426 | ||
417 | void KABCore::loadDataAfterStart() | 427 | void KABCore::loadDataAfterStart() |
418 | { | 428 | { |
419 | //qDebug("KABCore::loadDataAfterStart() "); | 429 | //qDebug("KABCore::loadDataAfterStart() "); |
420 | ((StdAddressBook*)mAddressBook)->init( true ); | 430 | ((StdAddressBook*)mAddressBook)->init( true ); |
421 | mViewManager->refreshView(); | 431 | mViewManager->refreshView(); |
422 | 432 | ||
423 | #ifndef DESKTOP_VERSION | 433 | #ifndef DESKTOP_VERSION |
424 | disconnect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT (receiveStart ( const QCString &, const QByteArray & ))); | 434 | disconnect(qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), this, SLOT (receiveStart ( const Q3CString &, const QByteArray & ))); |
425 | 435 | ||
426 | QObject::connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); | 436 | QObject::connect(qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const Q3CString &, const QByteArray & ))); |
427 | if ( !mCStringMess.isEmpty() ) | 437 | if ( !mCStringMess.isEmpty() ) |
428 | ExternalAppHandler::instance()->appMessage( mCStringMess, mByteData ); | 438 | ExternalAppHandler::instance()->appMessage( mCStringMess, mByteData ); |
429 | #endif | 439 | #endif |
430 | // QTimer::singleShot( 10, this , SLOT ( updateToolBar())); | 440 | // QTimer::singleShot( 10, this , SLOT ( updateToolBar())); |
431 | setCaptionBack(); | 441 | setCaptionBack(); |
432 | } | 442 | } |
433 | void KABCore::updateToolBar() | 443 | void KABCore::updateToolBar() |
434 | { | 444 | { |
@@ -448,21 +458,21 @@ KABCore::~KABCore() | |||
448 | KABC::StdAddressBook::close(); | 458 | KABC::StdAddressBook::close(); |
449 | 459 | ||
450 | delete syncManager; | 460 | delete syncManager; |
451 | #ifndef DESKTOP_VERSION | 461 | #ifndef DESKTOP_VERSION |
452 | if ( infrared ) | 462 | if ( infrared ) |
453 | delete infrared; | 463 | delete infrared; |
454 | #endif | 464 | #endif |
455 | } | 465 | } |
456 | void KABCore::receive( const QCString& cmsg, const QByteArray& data ) | 466 | void KABCore::receive( const Q3CString& cmsg, const QByteArray& data ) |
457 | { | 467 | { |
458 | //qDebug("KA: QCOP message received: %s ", cmsg.data() ); | 468 | //qDebug("KA: QCOP message received: %s ", cmsg.data() ); |
459 | if ( cmsg == "setDocument(QString)" ) { | 469 | if ( cmsg == "setDocument(QString)" ) { |
460 | QDataStream stream( data, IO_ReadOnly ); | 470 | QDataStream stream( const_cast<QByteArray*>(&data), QIODevice::ReadOnly ); |
461 | QString fileName; | 471 | QString fileName; |
462 | stream >> fileName; | 472 | stream >> fileName; |
463 | recieve( fileName ); | 473 | recieve( fileName ); |
464 | return; | 474 | return; |
465 | } | 475 | } |
466 | } | 476 | } |
467 | void KABCore::toggleBeamReceive( ) | 477 | void KABCore::toggleBeamReceive( ) |
468 | { | 478 | { |
@@ -475,17 +485,17 @@ void KABCore::toggleBeamReceive( ) | |||
475 | infrared = 0; | 485 | infrared = 0; |
476 | mActionBR->setChecked(false); | 486 | mActionBR->setChecked(false); |
477 | return; | 487 | return; |
478 | } | 488 | } |
479 | qDebug("KA: AB enable BeamReceive "); | 489 | qDebug("KA: AB enable BeamReceive "); |
480 | mActionBR->setChecked(true); | 490 | mActionBR->setChecked(true); |
481 | 491 | ||
482 | infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ; | 492 | infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ; |
483 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& ))); | 493 | QObject::connect( infrared, SIGNAL (received ( const Q3CString &, const QByteArray & )),this, SLOT(receive( const Q3CString&, const QByteArray& ))); |
484 | #endif | 494 | #endif |
485 | } | 495 | } |
486 | 496 | ||
487 | 497 | ||
488 | void KABCore::disableBR(bool b) | 498 | void KABCore::disableBR(bool b) |
489 | { | 499 | { |
490 | #ifndef DESKTOP_VERSION | 500 | #ifndef DESKTOP_VERSION |
491 | if ( b ) { | 501 | if ( b ) { |
@@ -555,17 +565,17 @@ void KABCore::restoreSettings() | |||
555 | int wid = width(); | 565 | int wid = width(); |
556 | if ( wid < 10 ) | 566 | if ( wid < 10 ) |
557 | wid = 400; | 567 | wid = 400; |
558 | #else | 568 | #else |
559 | int wid = QApplication::desktop()->width(); | 569 | int wid = QApplication::desktop()->width(); |
560 | if ( wid < 640 ) | 570 | if ( wid < 640 ) |
561 | wid = QApplication::desktop()->height(); | 571 | wid = QApplication::desktop()->height(); |
562 | #endif | 572 | #endif |
563 | QValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter; | 573 | Q3ValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter; |
564 | if ( true /*splitterSize.count() == 0*/ ) { | 574 | if ( true /*splitterSize.count() == 0*/ ) { |
565 | splitterSize.append( wid / 2 ); | 575 | splitterSize.append( wid / 2 ); |
566 | splitterSize.append( wid / 2 ); | 576 | splitterSize.append( wid / 2 ); |
567 | } | 577 | } |
568 | mMiniSplitter->setSizes( splitterSize ); | 578 | mMiniSplitter->setSizes( splitterSize ); |
569 | if ( mExtensionBarSplitter ) { | 579 | if ( mExtensionBarSplitter ) { |
570 | //splitterSize = KABPrefs::instance()->mExtensionsSplitter; | 580 | //splitterSize = KABPrefs::instance()->mExtensionsSplitter; |
571 | if ( true /*splitterSize.count() == 0*/ ) { | 581 | if ( true /*splitterSize.count() == 0*/ ) { |
@@ -645,20 +655,20 @@ KABC::Field *KABCore::currentSearchField() const | |||
645 | 655 | ||
646 | QStringList KABCore::selectedUIDs() const | 656 | QStringList KABCore::selectedUIDs() const |
647 | { | 657 | { |
648 | return mViewManager->selectedUids(); | 658 | return mViewManager->selectedUids(); |
649 | } | 659 | } |
650 | 660 | ||
651 | KABC::Resource *KABCore::requestResource( QWidget *parent ) | 661 | KABC::Resource *KABCore::requestResource( QWidget *parent ) |
652 | { | 662 | { |
653 | QPtrList<KABC::Resource> kabcResources = addressBook()->resources(); | 663 | Q3PtrList<KABC::Resource> kabcResources = addressBook()->resources(); |
654 | 664 | ||
655 | QPtrList<KRES::Resource> kresResources; | 665 | Q3PtrList<KRES::Resource> kresResources; |
656 | QPtrListIterator<KABC::Resource> resIt( kabcResources ); | 666 | Q3PtrListIterator<KABC::Resource> resIt( kabcResources ); |
657 | KABC::Resource *resource; | 667 | KABC::Resource *resource; |
658 | while ( ( resource = resIt.current() ) != 0 ) { | 668 | while ( ( resource = resIt.current() ) != 0 ) { |
659 | ++resIt; | 669 | ++resIt; |
660 | if ( !resource->readOnly() ) { | 670 | if ( !resource->readOnly() ) { |
661 | KRES::Resource *res = static_cast<KRES::Resource*>( resource ); | 671 | KRES::Resource *res = static_cast<KRES::Resource*>( resource ); |
662 | if ( res ) | 672 | if ( res ) |
663 | kresResources.append( res ); | 673 | kresResources.append( res ); |
664 | } | 674 | } |
@@ -790,24 +800,24 @@ void KABCore::mailVCard( const QStringList& uids ) | |||
790 | continue; | 800 | continue; |
791 | 801 | ||
792 | QString name = a.givenName() + "_" + a.familyName() + ".vcf"; | 802 | QString name = a.givenName() + "_" + a.familyName() + ".vcf"; |
793 | 803 | ||
794 | QString fileName = dirName + "/" + name; | 804 | QString fileName = dirName + "/" + name; |
795 | 805 | ||
796 | QFile outFile(fileName); | 806 | QFile outFile(fileName); |
797 | 807 | ||
798 | if ( outFile.open(IO_WriteOnly) ) { // file opened successfully | 808 | if ( outFile.open(QIODevice::WriteOnly) ) { // file opened successfully |
799 | KABC::VCardConverter converter; | 809 | KABC::VCardConverter converter; |
800 | QString vcard; | 810 | QString vcard; |
801 | 811 | ||
802 | converter.addresseeToVCard( a, vcard ); | 812 | converter.addresseeToVCard( a, vcard ); |
803 | 813 | ||
804 | QTextStream t( &outFile ); // use a text stream | 814 | Q3TextStream t( &outFile ); // use a text stream |
805 | t.setEncoding( QTextStream::UnicodeUTF8 ); | 815 | t.setEncoding( Q3TextStream::UnicodeUTF8 ); |
806 | t << vcard; | 816 | t << vcard; |
807 | 817 | ||
808 | outFile.close(); | 818 | outFile.close(); |
809 | 819 | ||
810 | urls.append( fileName ); | 820 | urls.append( fileName ); |
811 | } | 821 | } |
812 | } | 822 | } |
813 | 823 | ||
@@ -1011,21 +1021,21 @@ void KABCore::beamVCard(const QStringList& uids) | |||
1011 | datastream +=vcard.mid( start, next - start); | 1021 | datastream +=vcard.mid( start, next - start); |
1012 | datastream +=vcard.mid( next+5,sep -next -5 ).upper(); | 1022 | datastream +=vcard.mid( next+5,sep -next -5 ).upper(); |
1013 | start = sep; | 1023 | start = sep; |
1014 | } | 1024 | } |
1015 | datastream += vcard.mid( start,vcard.length() ); | 1025 | datastream += vcard.mid( start,vcard.length() ); |
1016 | } | 1026 | } |
1017 | #ifndef DESKTOP_VERSION | 1027 | #ifndef DESKTOP_VERSION |
1018 | QFile outFile(fileName); | 1028 | QFile outFile(fileName); |
1019 | if ( outFile.open(IO_WriteOnly) ) { | 1029 | if ( outFile.open(QIODevice::WriteOnly) ) { |
1020 | datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" ); | 1030 | datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" ); |
1021 | QTextStream t( &outFile ); // use a text stream | 1031 | Q3TextStream t( &outFile ); // use a text stream |
1022 | //t.setEncoding( QTextStream::UnicodeUTF8 ); | 1032 | //t.setEncoding( QTextStream::UnicodeUTF8 ); |
1023 | t.setEncoding( QTextStream::Latin1 ); | 1033 | t.setEncoding( Q3TextStream::Latin1 ); |
1024 | t <<datastream.latin1(); | 1034 | t <<datastream.latin1(); |
1025 | outFile.close(); | 1035 | outFile.close(); |
1026 | Ir *ir = new Ir( this ); | 1036 | Ir *ir = new Ir( this ); |
1027 | connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) ); | 1037 | connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) ); |
1028 | ir->send( fileName, description, "text/x-vCard" ); | 1038 | ir->send( fileName, description, "text/x-vCard" ); |
1029 | } else { | 1039 | } else { |
1030 | qDebug("KA: Error open temp beam file "); | 1040 | qDebug("KA: Error open temp beam file "); |
1031 | return; | 1041 | return; |
@@ -1292,20 +1302,20 @@ void KABCore::addrModified( const KABC::Addressee &addr ,bool updateDetails ) | |||
1292 | mDetails->setAddressee( addr ); | 1302 | mDetails->setAddressee( addr ); |
1293 | setModified( true ); | 1303 | setModified( true ); |
1294 | } | 1304 | } |
1295 | 1305 | ||
1296 | void KABCore::newContact() | 1306 | void KABCore::newContact() |
1297 | { | 1307 | { |
1298 | 1308 | ||
1299 | 1309 | ||
1300 | QPtrList<KABC::Resource> kabcResources = mAddressBook->resources(); | 1310 | Q3PtrList<KABC::Resource> kabcResources = mAddressBook->resources(); |
1301 | 1311 | ||
1302 | QPtrList<KRES::Resource> kresResources; | 1312 | Q3PtrList<KRES::Resource> kresResources; |
1303 | QPtrListIterator<KABC::Resource> it( kabcResources ); | 1313 | Q3PtrListIterator<KABC::Resource> it( kabcResources ); |
1304 | KABC::Resource *resource; | 1314 | KABC::Resource *resource; |
1305 | while ( ( resource = it.current() ) != 0 ) { | 1315 | while ( ( resource = it.current() ) != 0 ) { |
1306 | ++it; | 1316 | ++it; |
1307 | if ( !resource->readOnly() ) { | 1317 | if ( !resource->readOnly() ) { |
1308 | KRES::Resource *res = static_cast<KRES::Resource*>( resource ); | 1318 | KRES::Resource *res = static_cast<KRES::Resource*>( resource ); |
1309 | if ( res ) | 1319 | if ( res ) |
1310 | kresResources.append( res ); | 1320 | kresResources.append( res ); |
1311 | } | 1321 | } |
@@ -1851,25 +1861,25 @@ AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent, | |||
1851 | void KABCore::slotEditorDestroyed( const QString &uid ) | 1861 | void KABCore::slotEditorDestroyed( const QString &uid ) |
1852 | { | 1862 | { |
1853 | //mEditorDict.remove( uid ); | 1863 | //mEditorDict.remove( uid ); |
1854 | } | 1864 | } |
1855 | 1865 | ||
1856 | void KABCore::initGUI() | 1866 | void KABCore::initGUI() |
1857 | { | 1867 | { |
1858 | #ifndef KAB_EMBEDDED | 1868 | #ifndef KAB_EMBEDDED |
1859 | QHBoxLayout *topLayout = new QHBoxLayout( this ); | 1869 | Q3HBoxLayout *topLayout = new Q3HBoxLayout( this ); |
1860 | topLayout->setSpacing( KDialogBase::spacingHint() ); | 1870 | topLayout->setSpacing( KDialogBase::spacingHint() ); |
1861 | 1871 | ||
1862 | mExtensionBarSplitter = new QSplitter( this ); | 1872 | mExtensionBarSplitter = new QSplitter( this ); |
1863 | mExtensionBarSplitter->setOrientation( Qt::Vertical ); | 1873 | mExtensionBarSplitter->setOrientation( Qt::Vertical ); |
1864 | 1874 | ||
1865 | mDetailsSplitter = new QSplitter( mExtensionBarSplitter ); | 1875 | mDetailsSplitter = new QSplitter( mExtensionBarSplitter ); |
1866 | 1876 | ||
1867 | QVBox *viewSpace = new QVBox( mDetailsSplitter ); | 1877 | Q3VBox *viewSpace = new Q3VBox( mDetailsSplitter ); |
1868 | mIncSearchWidget = new IncSearchWidget( viewSpace ); | 1878 | mIncSearchWidget = new IncSearchWidget( viewSpace ); |
1869 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), | 1879 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), |
1870 | SLOT( incrementalSearch( const QString& ) ) ); | 1880 | SLOT( incrementalSearch( const QString& ) ) ); |
1871 | 1881 | ||
1872 | mViewManager = new ViewManager( this, viewSpace ); | 1882 | mViewManager = new ViewManager( this, viewSpace ); |
1873 | viewSpace->setStretchFactor( mViewManager, 1 ); | 1883 | viewSpace->setStretchFactor( mViewManager, 1 ); |
1874 | 1884 | ||
1875 | mDetails = new ViewContainer( mDetailsSplitter ); | 1885 | mDetails = new ViewContainer( mDetailsSplitter ); |
@@ -1883,58 +1893,58 @@ void KABCore::initGUI() | |||
1883 | topLayout->addWidget( mJumpButtonBar ); | 1893 | topLayout->addWidget( mJumpButtonBar ); |
1884 | //topLayout->setStretchFactor( mJumpButtonBar, 1 ); | 1894 | //topLayout->setStretchFactor( mJumpButtonBar, 1 ); |
1885 | 1895 | ||
1886 | mXXPortManager = new XXPortManager( this, this ); | 1896 | mXXPortManager = new XXPortManager( this, this ); |
1887 | 1897 | ||
1888 | #else //KAB_EMBEDDED | 1898 | #else //KAB_EMBEDDED |
1889 | //US initialize viewMenu before settingup viewmanager. | 1899 | //US initialize viewMenu before settingup viewmanager. |
1890 | // Viewmanager needs this menu to plugin submenues. | 1900 | // Viewmanager needs this menu to plugin submenues. |
1891 | viewMenu = new QPopupMenu( this ); | 1901 | viewMenu = new Q3PopupMenu( this ); |
1892 | settingsMenu = new QPopupMenu( this ); | 1902 | settingsMenu = new Q3PopupMenu( this ); |
1893 | //filterMenu = new QPopupMenu( this ); | 1903 | //filterMenu = new QPopupMenu( this ); |
1894 | ImportMenu = new QPopupMenu( this ); | 1904 | ImportMenu = new Q3PopupMenu( this ); |
1895 | ExportMenu = new QPopupMenu( this ); | 1905 | ExportMenu = new Q3PopupMenu( this ); |
1896 | syncMenu = new QPopupMenu( this ); | 1906 | syncMenu = new Q3PopupMenu( this ); |
1897 | changeMenu= new QPopupMenu( this ); | 1907 | changeMenu= new Q3PopupMenu( this ); |
1898 | beamMenu= new QPopupMenu( this ); | 1908 | beamMenu= new Q3PopupMenu( this ); |
1899 | 1909 | ||
1900 | //US since we have no splitter for the embedded system, setup | 1910 | //US since we have no splitter for the embedded system, setup |
1901 | // a layout with two frames. One left and one right. | 1911 | // a layout with two frames. One left and one right. |
1902 | 1912 | ||
1903 | QBoxLayout *topLayout; | 1913 | Q3BoxLayout *topLayout; |
1904 | 1914 | ||
1905 | // = new QHBoxLayout( this ); | 1915 | // = new QHBoxLayout( this ); |
1906 | // QBoxLayout *topLayout = (QBoxLayout*)layout(); | 1916 | // QBoxLayout *topLayout = (QBoxLayout*)layout(); |
1907 | 1917 | ||
1908 | // QWidget *mainBox = new QWidget( this ); | 1918 | // QWidget *mainBox = new QWidget( this ); |
1909 | // QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox); | 1919 | // QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox); |
1910 | 1920 | ||
1911 | #ifdef DESKTOP_VERSION | 1921 | #ifdef DESKTOP_VERSION |
1912 | topLayout = new QHBoxLayout( this ); | 1922 | topLayout = new Q3HBoxLayout( this ); |
1913 | 1923 | ||
1914 | 1924 | ||
1915 | mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); | 1925 | mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); |
1916 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); | 1926 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); |
1917 | 1927 | ||
1918 | topLayout->addWidget(mMiniSplitter ); | 1928 | topLayout->addWidget(mMiniSplitter ); |
1919 | 1929 | ||
1920 | mExtensionBarSplitter = new KDGanttMinimizeSplitter( Qt::Vertical,mMiniSplitter ); | 1930 | mExtensionBarSplitter = new KDGanttMinimizeSplitter( Qt::Vertical,mMiniSplitter ); |
1921 | mExtensionBarSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); | 1931 | mExtensionBarSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); |
1922 | mViewManager = new ViewManager( this, mExtensionBarSplitter ); | 1932 | mViewManager = new ViewManager( this, mExtensionBarSplitter ); |
1923 | mDetails = new ViewContainer( mMiniSplitter ); | 1933 | mDetails = new ViewContainer( mMiniSplitter ); |
1924 | mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); | 1934 | mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); |
1925 | #else | 1935 | #else |
1926 | if ( QApplication::desktop()->width() > 480 ) { | 1936 | if ( QApplication::desktop()->width() > 480 ) { |
1927 | topLayout = new QHBoxLayout( this ); | 1937 | topLayout = new Q3HBoxLayout( this ); |
1928 | mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); | 1938 | mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); |
1929 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); | 1939 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); |
1930 | } else { | 1940 | } else { |
1931 | 1941 | ||
1932 | topLayout = new QHBoxLayout( this ); | 1942 | topLayout = new Q3HBoxLayout( this ); |
1933 | mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this); | 1943 | mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this); |
1934 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); | 1944 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); |
1935 | } | 1945 | } |
1936 | 1946 | ||
1937 | topLayout->addWidget(mMiniSplitter ); | 1947 | topLayout->addWidget(mMiniSplitter ); |
1938 | mViewManager = new ViewManager( this, mMiniSplitter ); | 1948 | mViewManager = new ViewManager( this, mMiniSplitter ); |
1939 | mDetails = new ViewContainer( mMiniSplitter ); | 1949 | mDetails = new ViewContainer( mMiniSplitter ); |
1940 | 1950 | ||
@@ -2029,27 +2039,27 @@ void KABCore::initActions() | |||
2029 | connect( QApplication::clipboard(), SIGNAL( dataChanged() ), | 2039 | connect( QApplication::clipboard(), SIGNAL( dataChanged() ), |
2030 | SLOT( clipboardDataChanged() ) ); | 2040 | SLOT( clipboardDataChanged() ) ); |
2031 | #endif //KAB_EMBEDDED | 2041 | #endif //KAB_EMBEDDED |
2032 | 2042 | ||
2033 | // file menu | 2043 | // file menu |
2034 | 2044 | ||
2035 | mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() ); | 2045 | mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() ); |
2036 | //mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() ); | 2046 | //mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() ); |
2037 | mActionPrint = new KAction( i18n( "&Print View" ), "fileprint", CTRL + Key_P, mViewManager, | 2047 | mActionPrint = new KAction( i18n( "&Print View" ), "fileprint", Qt::CTRL + Qt::Key_P, mViewManager, |
2038 | SLOT( printView() ), actionCollection(), "kaddressbook_print" ); | 2048 | SLOT( printView() ), actionCollection(), "kaddressbook_print" ); |
2039 | 2049 | ||
2040 | 2050 | ||
2041 | mActionPrintDetails = new KAction( i18n( "&Print Details" ), "fileprint", 0, mDetails, | 2051 | mActionPrintDetails = new KAction( i18n( "&Print Details" ), "fileprint", 0, mDetails, |
2042 | SLOT( printView() ), actionCollection(), "kaddressbook_print2" ); | 2052 | SLOT( printView() ), actionCollection(), "kaddressbook_print2" ); |
2043 | 2053 | ||
2044 | mActionSave = new KAction( i18n( "&Save" ), "filesave", CTRL+Key_S, this, | 2054 | mActionSave = new KAction( i18n( "&Save" ), "filesave", Qt::CTRL+Qt::Key_S, this, |
2045 | SLOT( save() ), actionCollection(), "file_sync" ); | 2055 | SLOT( save() ), actionCollection(), "file_sync" ); |
2046 | 2056 | ||
2047 | mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", CTRL+Key_N, this, | 2057 | mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", Qt::CTRL+Qt::Key_N, this, |
2048 | SLOT( newContact() ), actionCollection(), "file_new_contact" ); | 2058 | SLOT( newContact() ), actionCollection(), "file_new_contact" ); |
2049 | 2059 | ||
2050 | mActionMailVCard = new KAction(i18n("Mail &vCard..."), "mail_post_to", 0, | 2060 | mActionMailVCard = new KAction(i18n("Mail &vCard..."), "mail_post_to", 0, |
2051 | this, SLOT( mailVCard() ), | 2061 | this, SLOT( mailVCard() ), |
2052 | actionCollection(), "file_mail_vcard"); | 2062 | actionCollection(), "file_mail_vcard"); |
2053 | 2063 | ||
2054 | mActionExport2phone = new KAction( i18n( "Export to phone" ), "ex2phone", 0, this, | 2064 | mActionExport2phone = new KAction( i18n( "Export to phone" ), "ex2phone", 0, this, |
2055 | SLOT( export2phone() ), actionCollection(), | 2065 | SLOT( export2phone() ), actionCollection(), |
@@ -2078,45 +2088,45 @@ void KABCore::initActions() | |||
2078 | // mActionQuit = KStdAction::quit( mMainWindow, SLOT( exit() ), actionCollection() ); | 2088 | // mActionQuit = KStdAction::quit( mMainWindow, SLOT( exit() ), actionCollection() ); |
2079 | mActionQuit = new KAction( i18n( "&Exit" ), "exit", 0, | 2089 | mActionQuit = new KAction( i18n( "&Exit" ), "exit", 0, |
2080 | mMainWindow, SLOT( exit() ), | 2090 | mMainWindow, SLOT( exit() ), |
2081 | actionCollection(), "quit" ); | 2091 | actionCollection(), "quit" ); |
2082 | #endif //KAB_EMBEDDED | 2092 | #endif //KAB_EMBEDDED |
2083 | 2093 | ||
2084 | // edit menu | 2094 | // edit menu |
2085 | if ( mIsPart ) { | 2095 | if ( mIsPart ) { |
2086 | mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this, | 2096 | mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", Qt::CTRL + Qt::Key_C, this, |
2087 | SLOT( copyContacts() ), actionCollection(), | 2097 | SLOT( copyContacts() ), actionCollection(), |
2088 | "kaddressbook_copy" ); | 2098 | "kaddressbook_copy" ); |
2089 | mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this, | 2099 | mActionCut = new KAction( i18n( "Cu&t" ), "editcut", Qt::CTRL + Qt::Key_X, this, |
2090 | SLOT( cutContacts() ), actionCollection(), | 2100 | SLOT( cutContacts() ), actionCollection(), |
2091 | "kaddressbook_cut" ); | 2101 | "kaddressbook_cut" ); |
2092 | mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this, | 2102 | mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", Qt::CTRL + Qt::Key_V, this, |
2093 | SLOT( pasteContacts() ), actionCollection(), | 2103 | SLOT( pasteContacts() ), actionCollection(), |
2094 | "kaddressbook_paste" ); | 2104 | "kaddressbook_paste" ); |
2095 | mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this, | 2105 | mActionSelectAll = new KAction( i18n( "Select &All" ), Qt::CTRL + Qt::Key_A, this, |
2096 | SLOT( selectAllContacts() ), actionCollection(), | 2106 | SLOT( selectAllContacts() ), actionCollection(), |
2097 | "kaddressbook_select_all" ); | 2107 | "kaddressbook_select_all" ); |
2098 | mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this, | 2108 | mActionUndo = new KAction( i18n( "&Undo" ), "undo", Qt::CTRL + Qt::Key_Z, this, |
2099 | SLOT( undo() ), actionCollection(), | 2109 | SLOT( undo() ), actionCollection(), |
2100 | "kaddressbook_undo" ); | 2110 | "kaddressbook_undo" ); |
2101 | mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z, | 2111 | mActionRedo = new KAction( i18n( "Re&do" ), "redo", Qt::CTRL + Qt::SHIFT + Qt::Key_Z, |
2102 | this, SLOT( redo() ), actionCollection(), | 2112 | this, SLOT( redo() ), actionCollection(), |
2103 | "kaddressbook_redo" ); | 2113 | "kaddressbook_redo" ); |
2104 | } else { | 2114 | } else { |
2105 | mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() ); | 2115 | mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() ); |
2106 | mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() ); | 2116 | mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() ); |
2107 | mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() ); | 2117 | mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() ); |
2108 | mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() ); | 2118 | mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() ); |
2109 | mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() ); | 2119 | mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() ); |
2110 | mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() ); | 2120 | mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() ); |
2111 | } | 2121 | } |
2112 | 2122 | ||
2113 | mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete", | 2123 | mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete", |
2114 | Key_Delete, this, SLOT( deleteContacts() ), | 2124 | Qt::Key_Delete, this, SLOT( deleteContacts() ), |
2115 | actionCollection(), "edit_delete" ); | 2125 | actionCollection(), "edit_delete" ); |
2116 | 2126 | ||
2117 | mActionUndo->setEnabled( false ); | 2127 | mActionUndo->setEnabled( false ); |
2118 | mActionRedo->setEnabled( false ); | 2128 | mActionRedo->setEnabled( false ); |
2119 | 2129 | ||
2120 | // settings menu | 2130 | // settings menu |
2121 | #ifdef KAB_EMBEDDED | 2131 | #ifdef KAB_EMBEDDED |
2122 | //US special menuentry to configure the addressbook resources. On KDE | 2132 | //US special menuentry to configure the addressbook resources. On KDE |
@@ -2241,19 +2251,19 @@ void KABCore::initActions() | |||
2241 | 2251 | ||
2242 | //US we need this function, to plug all actions into the correct menues. | 2252 | //US we need this function, to plug all actions into the correct menues. |
2243 | // KDE uses a XML format to plug the actions, but we work her without this overhead. | 2253 | // KDE uses a XML format to plug the actions, but we work her without this overhead. |
2244 | void KABCore::addActionsManually() | 2254 | void KABCore::addActionsManually() |
2245 | { | 2255 | { |
2246 | //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); | 2256 | //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); |
2247 | 2257 | ||
2248 | #ifdef KAB_EMBEDDED | 2258 | #ifdef KAB_EMBEDDED |
2249 | QPopupMenu *fileMenu = new QPopupMenu( this ); | 2259 | Q3PopupMenu *fileMenu = new Q3PopupMenu( this ); |
2250 | QPopupMenu *editMenu = new QPopupMenu( this ); | 2260 | Q3PopupMenu *editMenu = new Q3PopupMenu( this ); |
2251 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 2261 | Q3PopupMenu *helpMenu = new Q3PopupMenu( this ); |
2252 | 2262 | ||
2253 | KToolBar* tb = mMainWindow->toolBar(); | 2263 | KToolBar* tb = mMainWindow->toolBar(); |
2254 | mMainWindow->setToolBarsMovable (false ); | 2264 | mMainWindow->setToolBarsMovable (false ); |
2255 | #ifndef DESKTOP_VERSION | 2265 | #ifndef DESKTOP_VERSION |
2256 | if ( KABPrefs::instance()->mFullMenuBarVisible ) { | 2266 | if ( KABPrefs::instance()->mFullMenuBarVisible ) { |
2257 | #endif | 2267 | #endif |
2258 | QMenuBar* mb = mMainWindow->menuBar(); | 2268 | QMenuBar* mb = mMainWindow->menuBar(); |
2259 | 2269 | ||
@@ -2271,17 +2281,17 @@ void KABCore::addActionsManually() | |||
2271 | //mb->insertItem( i18n("&Change"), changeMenu ); | 2281 | //mb->insertItem( i18n("&Change"), changeMenu ); |
2272 | mb->insertItem( i18n("&Help"), helpMenu ); | 2282 | mb->insertItem( i18n("&Help"), helpMenu ); |
2273 | mIncSearchWidget = new IncSearchWidget( tb ); | 2283 | mIncSearchWidget = new IncSearchWidget( tb ); |
2274 | // tb->insertWidget(-1, 0, mIncSearchWidget); | 2284 | // tb->insertWidget(-1, 0, mIncSearchWidget); |
2275 | #ifndef DESKTOP_VERSION | 2285 | #ifndef DESKTOP_VERSION |
2276 | } else { | 2286 | } else { |
2277 | //US setup toolbar | 2287 | //US setup toolbar |
2278 | QPEMenuBar *menuBarTB = new QPEMenuBar( tb ); | 2288 | QPEMenuBar *menuBarTB = new QPEMenuBar( tb ); |
2279 | QPopupMenu *popupBarTB = new QPopupMenu( this ); | 2289 | Q3PopupMenu *popupBarTB = new Q3PopupMenu( this ); |
2280 | menuBarTB->insertItem( SmallIcon( "z_menu" ) , popupBarTB); | 2290 | menuBarTB->insertItem( SmallIcon( "z_menu" ) , popupBarTB); |
2281 | tb->insertWidget(-1, 0, menuBarTB); | 2291 | tb->insertWidget(-1, 0, menuBarTB); |
2282 | mIncSearchWidget = new IncSearchWidget( tb ); | 2292 | mIncSearchWidget = new IncSearchWidget( tb ); |
2283 | tb->enableMoving(false); | 2293 | tb->enableMoving(false); |
2284 | popupBarTB->insertItem( i18n("&File"), fileMenu ); | 2294 | popupBarTB->insertItem( i18n("&File"), fileMenu ); |
2285 | popupBarTB->insertItem( i18n("&Edit"), editMenu ); | 2295 | popupBarTB->insertItem( i18n("&Edit"), editMenu ); |
2286 | popupBarTB->insertItem( i18n("&View"), viewMenu ); | 2296 | popupBarTB->insertItem( i18n("&View"), viewMenu ); |
2287 | popupBarTB->insertItem( i18n("&Settings"), settingsMenu ); | 2297 | popupBarTB->insertItem( i18n("&Settings"), settingsMenu ); |
@@ -2626,17 +2636,17 @@ void KABCore::configureKeyBindings() | |||
2626 | #else //KAB_EMBEDDED | 2636 | #else //KAB_EMBEDDED |
2627 | qDebug("KABCore::configureKeyBindings() not implemented"); | 2637 | qDebug("KABCore::configureKeyBindings() not implemented"); |
2628 | #endif //KAB_EMBEDDED | 2638 | #endif //KAB_EMBEDDED |
2629 | } | 2639 | } |
2630 | 2640 | ||
2631 | #ifdef KAB_EMBEDDED | 2641 | #ifdef KAB_EMBEDDED |
2632 | void KABCore::configureResources() | 2642 | void KABCore::configureResources() |
2633 | { | 2643 | { |
2634 | KRES::KCMKResources dlg( this, "" , 0 ); | 2644 | KRES::KCMKResources dlg( this, "" , QStringList() ); |
2635 | 2645 | ||
2636 | if ( !dlg.exec() ) | 2646 | if ( !dlg.exec() ) |
2637 | return; | 2647 | return; |
2638 | KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); | 2648 | KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); |
2639 | } | 2649 | } |
2640 | #endif //KAB_EMBEDDED | 2650 | #endif //KAB_EMBEDDED |
2641 | 2651 | ||
2642 | 2652 | ||
@@ -2722,17 +2732,17 @@ void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString | |||
2722 | QStringList uidList; | 2732 | QStringList uidList; |
2723 | 2733 | ||
2724 | KABC::AddressBook::Iterator it; | 2734 | KABC::AddressBook::Iterator it; |
2725 | 2735 | ||
2726 | int count = 0; | 2736 | int count = 0; |
2727 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { | 2737 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { |
2728 | ++count; | 2738 | ++count; |
2729 | } | 2739 | } |
2730 | QProgressBar bar(count,0 ); | 2740 | Q3ProgressBar bar(count,0 ); |
2731 | int w = 300; | 2741 | int w = 300; |
2732 | if ( QApplication::desktop()->width() < 320 ) | 2742 | if ( QApplication::desktop()->width() < 320 ) |
2733 | w = 220; | 2743 | w = 220; |
2734 | int h = bar.sizeHint().height() ; | 2744 | int h = bar.sizeHint().height() ; |
2735 | int dw = QApplication::desktop()->width(); | 2745 | int dw = QApplication::desktop()->width(); |
2736 | int dh = QApplication::desktop()->height(); | 2746 | int dh = QApplication::desktop()->height(); |
2737 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 2747 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
2738 | bar.show(); | 2748 | bar.show(); |
@@ -2903,17 +2913,17 @@ KABC::Addressee KABCore::getLastSyncAddressee() | |||
2903 | if (lse.isEmpty()) { | 2913 | if (lse.isEmpty()) { |
2904 | qDebug("KA: Creating new last-syncAddressee "); | 2914 | qDebug("KA: Creating new last-syncAddressee "); |
2905 | lse.setUid( "last-syncAddressee-"+mCurrentSyncDevice ); | 2915 | lse.setUid( "last-syncAddressee-"+mCurrentSyncDevice ); |
2906 | QString sum = ""; | 2916 | QString sum = ""; |
2907 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) | 2917 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) |
2908 | sum = "E: "; | 2918 | sum = "E: "; |
2909 | lse.setFamilyName("!"+sum+mCurrentSyncDevice + i18n(" - sync event")); | 2919 | lse.setFamilyName("!"+sum+mCurrentSyncDevice + i18n(" - sync event")); |
2910 | lse.setRevision( mLastAddressbookSync ); | 2920 | lse.setRevision( mLastAddressbookSync ); |
2911 | lse.setCategories( i18n("SyncEvent") ); | 2921 | lse.setCategories( QStringList(i18n("SyncEvent")) ); |
2912 | mAddressBook->insertAddressee( lse ); | 2922 | mAddressBook->insertAddressee( lse ); |
2913 | } | 2923 | } |
2914 | return lse; | 2924 | return lse; |
2915 | } | 2925 | } |
2916 | int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ) | 2926 | int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ) |
2917 | { | 2927 | { |
2918 | 2928 | ||
2919 | //void setZaurusId(int id); | 2929 | //void setZaurusId(int id); |
@@ -3094,17 +3104,17 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo | |||
3094 | } else { | 3104 | } else { |
3095 | //qDebug("FULLDATE 1"); | 3105 | //qDebug("FULLDATE 1"); |
3096 | fullDateRange = true; | 3106 | fullDateRange = true; |
3097 | Addressee newAdd; | 3107 | Addressee newAdd; |
3098 | addresseeRSync = newAdd; | 3108 | addresseeRSync = newAdd; |
3099 | addresseeRSync.setFamilyName(mCurrentSyncName + i18n(" - sync addressee")); | 3109 | addresseeRSync.setFamilyName(mCurrentSyncName + i18n(" - sync addressee")); |
3100 | addresseeRSync.setUid("last-syncAddressee-"+mCurrentSyncName ); | 3110 | addresseeRSync.setUid("last-syncAddressee-"+mCurrentSyncName ); |
3101 | addresseeRSync.setRevision( mLastAddressbookSync ); | 3111 | addresseeRSync.setRevision( mLastAddressbookSync ); |
3102 | addresseeRSync.setCategories( i18n("SyncAddressee") ); | 3112 | addresseeRSync.setCategories( QStringList(i18n("SyncAddressee")) ); |
3103 | } | 3113 | } |
3104 | } | 3114 | } |
3105 | if ( addresseeLSync.revision() == mLastAddressbookSync ) { | 3115 | if ( addresseeLSync.revision() == mLastAddressbookSync ) { |
3106 | // qDebug("FULLDATE 2"); | 3116 | // qDebug("FULLDATE 2"); |
3107 | fullDateRange = true; | 3117 | fullDateRange = true; |
3108 | } | 3118 | } |
3109 | if ( ! fullDateRange ) { | 3119 | if ( ! fullDateRange ) { |
3110 | if ( addresseeLSync.revision() != addresseeRSync.revision() ) { | 3120 | if ( addresseeLSync.revision() != addresseeRSync.revision() ) { |