summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp10
-rw-r--r--microkde/kdeui/ktoolbar.cpp6
-rw-r--r--microkde/kdeui/ktoolbar.h3
3 files changed, 15 insertions, 4 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 76f9ab6..15cab73 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -298,136 +298,140 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
298 "X-Gender", "KADDRESSBOOK" ); 298 "X-Gender", "KADDRESSBOOK" );
299 mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal, 299 mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal,
300 "X-Children", "KADDRESSBOOK" ); 300 "X-Children", "KADDRESSBOOK" );
301 mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal, 301 mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal,
302 "X-FreeBusyUrl", "KADDRESSBOOK" ); 302 "X-FreeBusyUrl", "KADDRESSBOOK" );
303#endif 303#endif
304 initGUI(); 304 initGUI();
305 305
306 mIncSearchWidget->setFocus(); 306 mIncSearchWidget->setFocus();
307 307
308 308
309 connect( mViewManager, SIGNAL( selected( const QString& ) ), 309 connect( mViewManager, SIGNAL( selected( const QString& ) ),
310 SLOT( setContactSelected( const QString& ) ) ); 310 SLOT( setContactSelected( const QString& ) ) );
311 connect( mViewManager, SIGNAL( executed( const QString& ) ), 311 connect( mViewManager, SIGNAL( executed( const QString& ) ),
312 SLOT( executeContact( const QString& ) ) ); 312 SLOT( executeContact( const QString& ) ) );
313 313
314 connect( mViewManager, SIGNAL( deleteRequest( ) ), 314 connect( mViewManager, SIGNAL( deleteRequest( ) ),
315 SLOT( deleteContacts( ) ) ); 315 SLOT( deleteContacts( ) ) );
316 connect( mViewManager, SIGNAL( modified() ), 316 connect( mViewManager, SIGNAL( modified() ),
317 SLOT( setModified() ) ); 317 SLOT( setModified() ) );
318 318
319 connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) ); 319 connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) );
320 connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) ); 320 connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) );
321 321
322 connect( mXXPortManager, SIGNAL( modified() ), 322 connect( mXXPortManager, SIGNAL( modified() ),
323 SLOT( setModified() ) ); 323 SLOT( setModified() ) );
324 324
325 connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ), 325 connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ),
326 SLOT( incrementalSearch( const QString& ) ) ); 326 SLOT( incrementalSearch( const QString& ) ) );
327 connect( mIncSearchWidget, SIGNAL( fieldChanged() ), 327 connect( mIncSearchWidget, SIGNAL( fieldChanged() ),
328 mJumpButtonBar, SLOT( recreateButtons() ) ); 328 mJumpButtonBar, SLOT( recreateButtons() ) );
329 329
330 connect( mDetails, SIGNAL( sendEmail( const QString& ) ), 330 connect( mDetails, SIGNAL( sendEmail( const QString& ) ),
331 SLOT( sendMail( const QString& ) ) ); 331 SLOT( sendMail( const QString& ) ) );
332 332
333 333
334 connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&))); 334 connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&)));
335 connect( ExternalAppHandler::instance(), SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)),this, SLOT(requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&))); 335 connect( ExternalAppHandler::instance(), SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)),this, SLOT(requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)));
336 connect( ExternalAppHandler::instance(), SIGNAL (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&))); 336 connect( ExternalAppHandler::instance(), SIGNAL (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&)));
337 connect( ExternalAppHandler::instance(), SIGNAL (nextView()),this, SLOT(setDetailsToggle())); 337 connect( ExternalAppHandler::instance(), SIGNAL (nextView()),this, SLOT(setDetailsToggle()));
338 338
339 339
340#ifndef KAB_EMBEDDED 340#ifndef KAB_EMBEDDED
341 connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), 341 connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ),
342 mXXPortManager, SLOT( importVCard( const KURL& ) ) ); 342 mXXPortManager, SLOT( importVCard( const KURL& ) ) );
343 343
344 connect( mDetails, SIGNAL( browse( const QString& ) ), 344 connect( mDetails, SIGNAL( browse( const QString& ) ),
345 SLOT( browse( const QString& ) ) ); 345 SLOT( browse( const QString& ) ) );
346 346
347 347
348 mAddressBookService = new KAddressBookService( this ); 348 mAddressBookService = new KAddressBookService( this );
349 349
350#endif //KAB_EMBEDDED 350#endif //KAB_EMBEDDED
351 351
352 mMessageTimer = new QTimer( this ); 352 mMessageTimer = new QTimer( this );
353 connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) ); 353 connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) );
354 mEditorDialog = 0; 354 mEditorDialog = 0;
355 createAddresseeEditorDialog( this ); 355 createAddresseeEditorDialog( this );
356 setModified( false ); 356 setModified( false );
357 mBRdisabled = false; 357 mBRdisabled = false;
358#ifndef DESKTOP_VERSION 358#ifndef DESKTOP_VERSION
359 infrared = 0; 359 infrared = 0;
360#endif 360#endif
361 //toggleBeamReceive( ); 361 //toggleBeamReceive( );
362 362 //mMainWindow->toolBar()->show();
363 // we have a toolbar repainting error on the Zaurus when starting KA/Pi 363 // we have a toolbar repainting error on the Zaurus when starting KA/Pi
364 QTimer::singleShot( 10000, this , SLOT ( updateToolBar())); 364 QTimer::singleShot( 10, this , SLOT ( updateToolBar()));
365} 365}
366 366
367void KABCore::updateToolBar() 367void KABCore::updateToolBar()
368{ 368{
369 mMainWindow->toolBar()->update(); 369 static int iii = 0;
370 ++iii;
371 mMainWindow->toolBar()->repaintMe();
372 if ( iii < 5 )
373 QTimer::singleShot( 10, this , SLOT ( updateToolBar()));
370} 374}
371KABCore::~KABCore() 375KABCore::~KABCore()
372{ 376{
373 // save(); 377 // save();
374 //saveSettings(); 378 //saveSettings();
375 //KABPrefs::instance()->writeConfig(); 379 //KABPrefs::instance()->writeConfig();
376 delete AddresseeConfig::instance(); 380 delete AddresseeConfig::instance();
377 mAddressBook = 0; 381 mAddressBook = 0;
378 KABC::StdAddressBook::close(); 382 KABC::StdAddressBook::close();
379 383
380 delete syncManager; 384 delete syncManager;
381#ifndef DESKTOP_VERSION 385#ifndef DESKTOP_VERSION
382 if ( infrared ) 386 if ( infrared )
383 delete infrared; 387 delete infrared;
384#endif 388#endif
385} 389}
386void KABCore::receive( const QCString& cmsg, const QByteArray& data ) 390void KABCore::receive( const QCString& cmsg, const QByteArray& data )
387{ 391{
388 qDebug("KA: QCOP message received: %s ", cmsg.data() ); 392 qDebug("KA: QCOP message received: %s ", cmsg.data() );
389 if ( cmsg == "setDocument(QString)" ) { 393 if ( cmsg == "setDocument(QString)" ) {
390 QDataStream stream( data, IO_ReadOnly ); 394 QDataStream stream( data, IO_ReadOnly );
391 QString fileName; 395 QString fileName;
392 stream >> fileName; 396 stream >> fileName;
393 recieve( fileName ); 397 recieve( fileName );
394 return; 398 return;
395 } 399 }
396} 400}
397void KABCore::toggleBeamReceive( ) 401void KABCore::toggleBeamReceive( )
398{ 402{
399 if ( mBRdisabled ) 403 if ( mBRdisabled )
400 return; 404 return;
401#ifndef DESKTOP_VERSION 405#ifndef DESKTOP_VERSION
402 if ( infrared ) { 406 if ( infrared ) {
403 qDebug("AB disable BeamReceive "); 407 qDebug("AB disable BeamReceive ");
404 delete infrared; 408 delete infrared;
405 infrared = 0; 409 infrared = 0;
406 mActionBR->setChecked(false); 410 mActionBR->setChecked(false);
407 return; 411 return;
408 } 412 }
409 qDebug("AB enable BeamReceive "); 413 qDebug("AB enable BeamReceive ");
410 mActionBR->setChecked(true); 414 mActionBR->setChecked(true);
411 415
412 infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ; 416 infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ;
413 QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& ))); 417 QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& )));
414#endif 418#endif
415} 419}
416 420
417 421
418void KABCore::disableBR(bool b) 422void KABCore::disableBR(bool b)
419{ 423{
420#ifndef DESKTOP_VERSION 424#ifndef DESKTOP_VERSION
421 if ( b ) { 425 if ( b ) {
422 if ( infrared ) { 426 if ( infrared ) {
423 toggleBeamReceive( ); 427 toggleBeamReceive( );
424 } 428 }
425 mBRdisabled = true; 429 mBRdisabled = true;
426 } else { 430 } else {
427 if ( mBRdisabled ) { 431 if ( mBRdisabled ) {
428 mBRdisabled = false; 432 mBRdisabled = false;
429 //toggleBeamReceive( ); 433 //toggleBeamReceive( );
430 } 434 }
431 } 435 }
432#endif 436#endif
433 437
diff --git a/microkde/kdeui/ktoolbar.cpp b/microkde/kdeui/ktoolbar.cpp
index 79b0f9d..e9226c0 100644
--- a/microkde/kdeui/ktoolbar.cpp
+++ b/microkde/kdeui/ktoolbar.cpp
@@ -1349,128 +1349,134 @@ void KToolBar::rebuildLayout()
1349 l->addStretch(); 1349 l->addStretch();
1350 if ( stretchableWidget ) 1350 if ( stretchableWidget )
1351 l->setStretchFactor( stretchableWidget, 10 ); 1351 l->setStretchFactor( stretchableWidget, 10 );
1352 } 1352 }
1353 l->invalidate(); 1353 l->invalidate();
1354 QApplication::postEvent( this, new QEvent( QEvent::LayoutHint ) ); 1354 QApplication::postEvent( this, new QEvent( QEvent::LayoutHint ) );
1355 //#endif //DESKTOP_VERSION 1355 //#endif //DESKTOP_VERSION
1356} 1356}
1357 1357
1358void KToolBar::childEvent( QChildEvent *e ) 1358void KToolBar::childEvent( QChildEvent *e )
1359{ 1359{
1360 1360
1361 if ( e->child()->isWidgetType() ) { 1361 if ( e->child()->isWidgetType() ) {
1362 QWidget * w = (QWidget*)e->child(); 1362 QWidget * w = (QWidget*)e->child();
1363 if ( e->type() == QEvent::ChildInserted ) { 1363 if ( e->type() == QEvent::ChildInserted ) {
1364 if ( !e->child()->inherits( "QPopupMenu" ) && 1364 if ( !e->child()->inherits( "QPopupMenu" ) &&
1365 ::qstrcmp( "qt_dockwidget_internal", e->child()->name() ) != 0 ) { 1365 ::qstrcmp( "qt_dockwidget_internal", e->child()->name() ) != 0 ) {
1366 1366
1367 // prevent items that have been explicitly inserted by insert*() from 1367 // prevent items that have been explicitly inserted by insert*() from
1368 // being inserted again 1368 // being inserted again
1369 if ( !widget2id.contains( w ) ) 1369 if ( !widget2id.contains( w ) )
1370 { 1370 {
1371 int dummy = -1; 1371 int dummy = -1;
1372 insertWidgetInternal( w, dummy, -1 ); 1372 insertWidgetInternal( w, dummy, -1 );
1373 } 1373 }
1374 } 1374 }
1375 } else { 1375 } else {
1376 removeWidgetInternal( w ); 1376 removeWidgetInternal( w );
1377 } 1377 }
1378 if ( isVisibleTo( 0 ) ) 1378 if ( isVisibleTo( 0 ) )
1379 { 1379 {
1380 QBoxLayout *l = boxLayout(); 1380 QBoxLayout *l = boxLayout();
1381 // QLayout *l = layout(); 1381 // QLayout *l = layout();
1382 1382
1383 // clear the old layout so that we don't get unnecassery layout 1383 // clear the old layout so that we don't get unnecassery layout
1384 // changes till we have rebuild the thing 1384 // changes till we have rebuild the thing
1385 QLayoutIterator it = l->iterator(); 1385 QLayoutIterator it = l->iterator();
1386 while ( it.current() ) { 1386 while ( it.current() ) {
1387 it.deleteCurrent(); 1387 it.deleteCurrent();
1388 } 1388 }
1389 layoutTimer->start( 50, TRUE ); 1389 layoutTimer->start( 50, TRUE );
1390 } 1390 }
1391 } 1391 }
1392 QToolBar::childEvent( e ); 1392 QToolBar::childEvent( e );
1393} 1393}
1394 1394
1395void KToolBar::insertWidgetInternal( QWidget *w, int &index, int id ) 1395void KToolBar::insertWidgetInternal( QWidget *w, int &index, int id )
1396{ 1396{
1397 // we can't have it in widgets, or something is really wrong 1397 // we can't have it in widgets, or something is really wrong
1398 //widgets.removeRef( w ); 1398 //widgets.removeRef( w );
1399 1399
1400 connect( w, SIGNAL( destroyed() ), 1400 connect( w, SIGNAL( destroyed() ),
1401 this, SLOT( widgetDestroyed() ) ); 1401 this, SLOT( widgetDestroyed() ) );
1402 if ( index == -1 || index > (int)widgets.count() ) { 1402 if ( index == -1 || index > (int)widgets.count() ) {
1403 widgets.append( w ); 1403 widgets.append( w );
1404 index = (int)widgets.count(); 1404 index = (int)widgets.count();
1405 } 1405 }
1406 else 1406 else
1407 widgets.insert( index, w ); 1407 widgets.insert( index, w );
1408 if ( id == -1 ) 1408 if ( id == -1 )
1409 id = id2widget.count(); 1409 id = id2widget.count();
1410 id2widget.insert( id, w ); 1410 id2widget.insert( id, w );
1411 widget2id.insert( w, id ); 1411 widget2id.insert( w, id );
1412} 1412}
1413void KToolBar::repaintMe()
1414{
1415 setUpdatesEnabled( true );
1416 QToolBar::repaint( true );
1417 qDebug(" KToolBar::repaintMe() ");
1418}
1413 1419
1414void KToolBar::showEvent( QShowEvent *e ) 1420void KToolBar::showEvent( QShowEvent *e )
1415{ 1421{
1416 QToolBar::showEvent( e ); 1422 QToolBar::showEvent( e );
1417 rebuildLayout(); 1423 rebuildLayout();
1418} 1424}
1419 1425
1420void KToolBar::setStretchableWidget( QWidget *w ) 1426void KToolBar::setStretchableWidget( QWidget *w )
1421{ 1427{
1422 QToolBar::setStretchableWidget( w ); 1428 QToolBar::setStretchableWidget( w );
1423 stretchableWidget = w; 1429 stretchableWidget = w;
1424} 1430}
1425 1431
1426QSizePolicy KToolBar::sizePolicy() const 1432QSizePolicy KToolBar::sizePolicy() const
1427{ 1433{
1428 if ( orientation() == Horizontal ) 1434 if ( orientation() == Horizontal )
1429 return QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); 1435 return QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
1430 else 1436 else
1431 return QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Expanding ); 1437 return QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Expanding );
1432} 1438}
1433 1439
1434QSize KToolBar::sizeHint() const 1440QSize KToolBar::sizeHint() const
1435{ 1441{
1436 return QToolBar::sizeHint(); 1442 return QToolBar::sizeHint();
1437#if 0 1443#if 0
1438 QWidget::polish(); 1444 QWidget::polish();
1439 static int iii = 0; 1445 static int iii = 0;
1440 ++iii; 1446 ++iii;
1441 qDebug("++++++++ KToolBar::sizeHint() %d ", iii ); 1447 qDebug("++++++++ KToolBar::sizeHint() %d ", iii );
1442 int margin = static_cast<QWidget*>(ncThis)->layout()->margin(); 1448 int margin = static_cast<QWidget*>(ncThis)->layout()->margin();
1443 switch( barPos() ) 1449 switch( barPos() )
1444 { 1450 {
1445 case KToolBar::Top: 1451 case KToolBar::Top:
1446 case KToolBar::Bottom: 1452 case KToolBar::Bottom:
1447 for ( QWidget *w = widgets.first(); w; w =widgets.next() ) 1453 for ( QWidget *w = widgets.first(); w; w =widgets.next() )
1448 { 1454 {
1449 if ( w->inherits( "KToolBarSeparator" ) && 1455 if ( w->inherits( "KToolBarSeparator" ) &&
1450 !( static_cast<KToolBarSeparator*>(w)->showLine() ) ) 1456 !( static_cast<KToolBarSeparator*>(w)->showLine() ) )
1451 { 1457 {
1452 minSize += QSize(6, 0); 1458 minSize += QSize(6, 0);
1453 } 1459 }
1454 else 1460 else
1455 { 1461 {
1456 QSize sh = w->sizeHint(); 1462 QSize sh = w->sizeHint();
1457 if (!sh.isValid()) 1463 if (!sh.isValid())
1458 sh = w->minimumSize(); 1464 sh = w->minimumSize();
1459 minSize = minSize.expandedTo(QSize(0, sh.height())); 1465 minSize = minSize.expandedTo(QSize(0, sh.height()));
1460 minSize += QSize(sh.width()+1, 0); 1466 minSize += QSize(sh.width()+1, 0);
1461 } 1467 }
1462 } 1468 }
1463/*US 1469/*US
1464 minSize += QSize(QApplication::style().pixelMetric( QStyle::PM_DockWindowHandleExtent ), 0); 1470 minSize += QSize(QApplication::style().pixelMetric( QStyle::PM_DockWindowHandleExtent ), 0);
1465*/ 1471*/
1466 minSize += QSize(margin*2, margin*2); 1472 minSize += QSize(margin*2, margin*2);
1467 break; 1473 break;
1468 1474
1469 case KToolBar::Left: 1475 case KToolBar::Left:
1470 case KToolBar::Right: 1476 case KToolBar::Right:
1471 for ( QWidget *w = widgets.first(); w; w = widgets.next() ) 1477 for ( QWidget *w = widgets.first(); w; w = widgets.next() )
1472 { 1478 {
1473 if ( w->inherits( "KToolBarSeparator" ) && 1479 if ( w->inherits( "KToolBarSeparator" ) &&
1474 !( static_cast<KToolBarSeparator*>(w)->showLine() ) ) 1480 !( static_cast<KToolBarSeparator*>(w)->showLine() ) )
1475 { 1481 {
1476 minSize += QSize(0, 6); 1482 minSize += QSize(0, 6);
diff --git a/microkde/kdeui/ktoolbar.h b/microkde/kdeui/ktoolbar.h
index 2c061b5..61b5ea3 100644
--- a/microkde/kdeui/ktoolbar.h
+++ b/microkde/kdeui/ktoolbar.h
@@ -984,124 +984,125 @@ signals:
984 * 984 *
985 * Emitted also if you change state 985 * Emitted also if you change state
986 * with @ref setButton() or @ref toggleButton() 986 * with @ref setButton() or @ref toggleButton()
987 * If you make a button normal again, with 987 * If you make a button normal again, with
988 * setToggle(false), this signal won't 988 * setToggle(false), this signal won't
989 * be emitted. 989 * be emitted.
990 */ 990 */
991 void toggled(int); 991 void toggled(int);
992 992
993 /** 993 /**
994 * This signal is emitted when item id gets highlighted/unhighlighted 994 * This signal is emitted when item id gets highlighted/unhighlighted
995 * (i.e when mouse enters/exits). 995 * (i.e when mouse enters/exits).
996 * 996 *
997 * Note that this signal is emitted from 997 * Note that this signal is emitted from
998 * all buttons (normal, disabled and toggle) even when there is no visible 998 * all buttons (normal, disabled and toggle) even when there is no visible
999 * change in buttons (i.e., buttons do not raise when mouse enters). 999 * change in buttons (i.e., buttons do not raise when mouse enters).
1000 * The parameter @p isHighlighted is @p true when mouse enters and @p false when 1000 * The parameter @p isHighlighted is @p true when mouse enters and @p false when
1001 * mouse exits. 1001 * mouse exits.
1002 */ 1002 */
1003 void highlighted(int id, bool isHighlighted); 1003 void highlighted(int id, bool isHighlighted);
1004 1004
1005 /** 1005 /**
1006 * This signal is emitted when item id gets highlighted/unhighlighted 1006 * This signal is emitted when item id gets highlighted/unhighlighted
1007 * (i.e when mouse enters/exits). 1007 * (i.e when mouse enters/exits).
1008 * 1008 *
1009 * Note that this signal is emitted from 1009 * Note that this signal is emitted from
1010 * all buttons (normal, disabled and toggle) even when there is no visible 1010 * all buttons (normal, disabled and toggle) even when there is no visible
1011 * change in buttons (i.e., buttons do not raise when mouse enters). 1011 * change in buttons (i.e., buttons do not raise when mouse enters).
1012 */ 1012 */
1013 void highlighted(int id ); 1013 void highlighted(int id );
1014 1014
1015 /** 1015 /**
1016 * Emitted when toolbar changes position, or when 1016 * Emitted when toolbar changes position, or when
1017 * an item is removed from toolbar. 1017 * an item is removed from toolbar.
1018 * 1018 *
1019 * If you subclass @ref KMainWindow and reimplement 1019 * If you subclass @ref KMainWindow and reimplement
1020 * @ref KMainWindow::resizeEvent() be sure to connect to 1020 * @ref KMainWindow::resizeEvent() be sure to connect to
1021 * this signal. Note: You can connect this signal to a slot that 1021 * this signal. Note: You can connect this signal to a slot that
1022 * doesn't take parameter. 1022 * doesn't take parameter.
1023 */ 1023 */
1024 void moved( BarPosition ); 1024 void moved( BarPosition );
1025 1025
1026 /** 1026 /**
1027 * @internal 1027 * @internal
1028 * This signal is emitted when toolbar detects changing of 1028 * This signal is emitted when toolbar detects changing of
1029 * following parameters: 1029 * following parameters:
1030 * highlighting, button-size, button-mode. This signal is 1030 * highlighting, button-size, button-mode. This signal is
1031 * internal, aimed to buttons. 1031 * internal, aimed to buttons.
1032 */ 1032 */
1033 void modechange (); 1033 void modechange ();
1034 1034
1035 /** 1035 /**
1036 * This signal is emitted when the toolbar is getting deleted, 1036 * This signal is emitted when the toolbar is getting deleted,
1037 * and before ~KToolbar finishes (so it's still time to remove 1037 * and before ~KToolbar finishes (so it's still time to remove
1038 * widgets from the toolbar). 1038 * widgets from the toolbar).
1039 * Used by KWidgetAction. 1039 * Used by KWidgetAction.
1040 * @since 3.2 1040 * @since 3.2
1041 */ 1041 */
1042 void toolbarDestroyed(); 1042 void toolbarDestroyed();
1043 1043
1044public: 1044public:
1045 /** 1045 /**
1046 * @return global setting for "Highlight buttons under mouse" 1046 * @return global setting for "Highlight buttons under mouse"
1047 */ 1047 */
1048 void repaintMe();
1048 static bool highlightSetting(); 1049 static bool highlightSetting();
1049 1050
1050 /** 1051 /**
1051 * @return global setting for "Toolbars transparent when moving" 1052 * @return global setting for "Toolbars transparent when moving"
1052 */ 1053 */
1053 static bool transparentSetting(); 1054 static bool transparentSetting();
1054 1055
1055 /** 1056 /**
1056 * @return global setting for "Icon Text" 1057 * @return global setting for "Icon Text"
1057 */ 1058 */
1058 static IconText iconTextSetting(); 1059 static IconText iconTextSetting();
1059 1060
1060public slots: 1061public slots:
1061 virtual void setIconText( const QString &txt ) 1062 virtual void setIconText( const QString &txt )
1062 { QToolBar::setIconText( txt ); } 1063 { QToolBar::setIconText( txt ); }
1064 void slotRepaint();
1063 1065
1064protected: 1066protected:
1065 void mousePressEvent( QMouseEvent * ); 1067 void mousePressEvent( QMouseEvent * );
1066 void childEvent( QChildEvent *e ); 1068 void childEvent( QChildEvent *e );
1067 void showEvent( QShowEvent *e ); 1069 void showEvent( QShowEvent *e );
1068 void resizeEvent( QResizeEvent *e ); 1070 void resizeEvent( QResizeEvent *e );
1069 bool event( QEvent *e ); 1071 bool event( QEvent *e );
1070 void applyAppearanceSettings(KConfig *config, const QString &_configGroup, bool forceGlobal = false); 1072 void applyAppearanceSettings(KConfig *config, const QString &_configGroup, bool forceGlobal = false);
1071 QString settingsGroup(); 1073 QString settingsGroup();
1072 1074
1073private slots: 1075private slots:
1074 void rebuildLayout(); 1076 void rebuildLayout();
1075 void slotReadConfig (); 1077 void slotReadConfig ();
1076 void slotAppearanceChanged(); 1078 void slotAppearanceChanged();
1077 void slotIconChanged(int); 1079 void slotIconChanged(int);
1078 void slotRepaint();
1079 void toolBarPosChanged( QToolBar *tb ); 1080 void toolBarPosChanged( QToolBar *tb );
1080 void slotContextAboutToShow(); 1081 void slotContextAboutToShow();
1081 void widgetDestroyed(); 1082 void widgetDestroyed();
1082 1083
1083private: 1084private:
1084 void init( bool readConfig = true, bool honorStyle = false ); 1085 void init( bool readConfig = true, bool honorStyle = false );
1085 void doConnections( KToolBarButton *button ); 1086 void doConnections( KToolBarButton *button );
1086 void insertWidgetInternal( QWidget *w, int &index, int id ); 1087 void insertWidgetInternal( QWidget *w, int &index, int id );
1087 void removeWidgetInternal( QWidget *w ); 1088 void removeWidgetInternal( QWidget *w );
1088 void getAttributes( QString &position, QString &icontext, int &index ); 1089 void getAttributes( QString &position, QString &icontext, int &index );
1089//US KPopupMenu *contextMenu(); 1090//US KPopupMenu *contextMenu();
1090 QPopupMenu *contextMenu(); 1091 QPopupMenu *contextMenu();
1091 1092
1092 QMap<QWidget*, int > widget2id; 1093 QMap<QWidget*, int > widget2id;
1093 typedef QMap<int, QWidget* > Id2WidgetMap; 1094 typedef QMap<int, QWidget* > Id2WidgetMap;
1094 Id2WidgetMap id2widget; 1095 Id2WidgetMap id2widget;
1095//US KPopupMenu *context; 1096//US KPopupMenu *context;
1096 QPopupMenu *context; 1097 QPopupMenu *context;
1097 QPtrList<QWidget> widgets; 1098 QPtrList<QWidget> widgets;
1098 QTimer *layoutTimer; 1099 QTimer *layoutTimer;
1099 QGuardedPtr<QWidget> stretchableWidget, rightAligned; 1100 QGuardedPtr<QWidget> stretchableWidget, rightAligned;
1100protected: 1101protected:
1101 virtual void virtual_hook( int id, void* data ); 1102 virtual void virtual_hook( int id, void* data );
1102private: 1103private:
1103 KToolBarPrivate *d; 1104 KToolBarPrivate *d;
1104 bool inshutdownprocess; 1105 bool inshutdownprocess;
1105}; 1106};
1106 1107
1107#endif 1108#endif