/*
    knetd, KDE Network Daemon

    Copyright (c) 2005 by Engin AYDOGAN		<engin @ bzzzt.biz>

    *************************************************************************
    *                                                                       *
    * This program is free software; you can redistribute it and/or modify  *
    * it under the terms of the GNU General Public License as published by  *
    * the Free Software Foundation; either version 2 of the License, or     *
    * (at your option) any later version.                                   *
    *                                                                       *
    *************************************************************************
*/

#include "systemtray.h"
#include "knetd.h"

#include <qpixmap.h>
#include <qtimer.h>

#include <kpassivepopup.h>

SystemTray::SystemTray( KNetD* daemon )
 : KSystemTray(), m_daemon( daemon )
{
	setPixmap( loadIcon( "systemtray" ) );
	show();
}

void
SystemTray::deviceFound( QString dev )
{
	message( QString( "New device found " ) + dev );
}

void
SystemTray::deviceRemoved( QString dev )
{
	message( QString( "Device removed " ) + dev );
}

void
SystemTray::message( const QString& m )
{
	if( !isVisible() )
	{
		show();
		QTimer::singleShot( 5000, this, SLOT( hide() ) );
	}
	KPassivePopup::message( m, this );
}

#include "systemtray.moc"
