[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: KSystemTray and Quit
From: "Aaron J. Seigo" <aseigo () kde ! org>
Date: 2005-01-15 1:44:44
Message-ID: 200501141844.55745.aseigo () kde ! org
[Download RAW message or body]
hey all...
i just added this to the KSystemTray API:
/**
* A convenience function to use when a quit is launched from the system
tray. Provides
* a consistent set of verbage for the user and should be used by all
system tray using
* apps for this consistency.
* @return returns true if the user confirms the quit, or false if they
cancel it
* @since 3.4
*/
bool confirmQuit();
if your app ships with KDE 3.4 and has a systemtray icon and it doesn't have a
quit confirmation (e.g. it isn't an editor with a "Save this file?"
confirmation), it would be good to modified your app to use confirmQuit()
whenever a quit is requested via the system tray icon. (note: if you pass no
parent to the system tray, then it gets handled automatically by KSystemTray)
e.g.:
connect(m_systemTray, SIGNAL(quitSelected()), SLOT(systemTrayQuit()));
void MyCoolApp::systemTrayQuit()
{
if (m_systemTray->confirmQuit())
{
kapp->closeAllWindows(); // or however your app closes
}
}
i'm trying to avoid any more "it's too easy to quit from the system tray" bugs
from people who aren't careful with their mouse.
--
Aaron J. Seigo
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA EE75 D6B7 2EB1 A7F1 DB43
[Attachment #3 (application/pgp-signature)]
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic