[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Regarding system tray
From:       Andreas Hartmetz <ahartmetz () gmail ! com>
Date:       2007-01-21 1:25:28
Message-ID: 200701210225.28937.ahartmetz () gmail ! com
[Download RAW message or body]

Am Sonntag, 21. Januar 2007 00:27 schrieb Paulo J. Matos:

> 1 - How to make application minimize to systray?
I assume you are talking about KDE 3...

1 - it's nontrivial, unfortunately. Have a look at kopete's kopetewindow.cpp 
or this very simple example from a utility I made. This shows you the minimum 
that you need to do. Also, in the example there is no provision to make 
minimization to tray optional if you click the "X" to close the main window.

quit() is a slot that will be called from File->Close, i.e. only if the 
application really should be terminated.
(class joyKop inherits KMainWindow)

--snip--
/*
 *Dear Reader,
 *you might notice that I don't care about sessions at all here.
 *At least I am in good company with Amarok and Kopete. It's just
 *a PITA if an application can "minimize" to tray.
 *That, and session management isn't typically much more useful
 *than our own state-saving code.
 */

void joyKop::closeEvent( QCloseEvent *e )
{
	e->accept();
}

bool joyKop::queryExit()
{
	saveOptions();
	emit saveState();
	return true;
}

void joyKop::quit()
{
	KApplication::kApplication()->quit();
}
--snip--

> 2 - Once on the systray, how to show up alerts in the style of Kopete
> notifications for user events?
2 - I can't answer this, never done it.

Cheers,
Andreas
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic