7 #include <tqobjectlist.h>
10 #include <tqtooltip.h>
11 #include <ksystemtray.h>
14 #include "kwindowinfo.h"
15 #include "kwindowinfo.moc"
17 static const int UNSPECIFIED_TIMEOUT = -1;
18 static const int DEFAULT_MESSAGE_TIMEOUT = 3000;
21 : TQObject( parent, name ), win( parent ), autoDel( false )
42 info->
message( text, pix, timeout );
47 message( text, TQPixmap(), UNSPECIFIED_TIMEOUT );
52 message( text, pix, UNSPECIFIED_TIMEOUT );
57 message( text, TQPixmap(), timeout );
68 timeout = DEFAULT_MESSAGE_TIMEOUT;
70 TQTimer::singleShot( timeout,
this, TQT_SLOT(
restore() ) );
76 oldMiniIcon =
KWin::icon( win->winId(), 16, 16, true );
77 oldIcon =
KWin::icon( win->winId(), 34, 34, false );
78 if ( oldIcon.isNull() )
79 oldIcon =
KWin::icon( win->winId(), 32, 32, true );
87 if ( !oldText.isNull() ) {
88 TQObjectList *l = queryList( TQTIMER_OBJECT_NAME_STRING );
89 TQObjectListIt it( *l );
92 while ( (obj = it.current()) != 0 ) {
99 oldText = TQString::null;
107 icon.load(
"bell.png" );
111 if ( win->inherits(
"KSystemTray" ) ) {
114 TQToolTip::add( tray, text );
118 win->setCaption( text );
119 win->setIcon( icon );
127 if ( !oldText.isNull() )
130 if ( win->inherits(
"KSystemTray" ) ) {
132 oldIcon = *(tray->pixmap());
133 oldText = TQToolTip::textFor( tray );
137 oldText = win->caption();
139 oldMiniIcon =
KWin::icon( win->winId(), 16, 16, true );
140 oldIcon =
KWin::icon( win->winId(), 34, 34, false );
141 if ( oldIcon.isNull() )
142 oldIcon =
KWin::icon( win->winId(), 32, 32, true );
145 if ( oldIcon.isNull() ) {
146 const TQPixmap *px = win->icon();
150 oldIcon.resize( 0, 0 );
156 if ( win->inherits(
"KSystemTray" ) ) {
159 TQToolTip::add( tray, oldText );
160 oldText = TQString::null;
164 win->setIcon( oldIcon );
168 win->setCaption( oldText );
169 oldText = TQString::null;