From kde-core-devel Sat Jan 15 01:44:44 2005 From: "Aaron J. Seigo" Date: Sat, 15 Jan 2005 01:44:44 +0000 To: kde-core-devel Subject: KSystemTray and Quit Message-Id: <200501141844.55745.aseigo () kde ! org> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=110575249313429 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--nextPart1352369.HGgYYAzNZA" --nextPart1352369.HGgYYAzNZA Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline hey all... i just added this to the KSystemTray API: /** * A convenience function to use when a quit is launched from the system=20 tray. Provides * a consistent set of verbage for the user and should be used by all=20 system tray using * apps for this consistency. * @return returns true if the user confirms the quit, or false if they= =20 cancel it * @since 3.4 */ bool confirmQuit(); if your app ships with KDE 3.4 and has a systemtray icon and it doesn't hav= e a=20 quit confirmation (e.g. it isn't an editor with a "Save this file?"=20 confirmation), it would be good to modified your app to use confirmQuit()=20 whenever a quit is requested via the system tray icon. (note: if you pass n= o=20 parent to the system tray, then it gets handled automatically by KSystemTra= y) 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" b= ugs=20 from people who aren't careful with their mouse. =2D-=20 Aaron J. Seigo GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA EE75 D6B7 2EB1 A7F1 DB43 --nextPart1352369.HGgYYAzNZA Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB6HWX1rcusafx20MRAtpkAJ0eW/6YY/5G2wk06g1oNtRrIIhgMACeKbDg TpO7e+o6LI/GGCBrw/vZVhY= =vllX -----END PGP SIGNATURE----- --nextPart1352369.HGgYYAzNZA--