Logo Search packages:      
Sourcecode: kmess version File versions  Download package

void SystemTrayWidget::displayCloseMessage ( QString  fileMenu = QString() )

Display an Hide On Close dialog window with a trayicon screenshot

This method, taken from the Basket Note Pads project (see the related links below), is used when the user closes the main KMess contact list window. Then a custom dialog window is shown to notify that the app will still run in background. This useful method adds to it a screenshot of the system tray area of the users' desktop, highlighting the application's icons. The original code was KDE3, it's been ported to make better use of the new features of Qt4 and KDE4.

See also:
http://basket.kde.org/ - Official site of the Basket Note Pads project
http://basket.kde.org/systemtray-on-close-info.php - Specific tray dialog page

Definition at line 86 of file newsystemtraywidget.cpp.

  // Don't do all the computations if they are unneeded:
  if ( ! KMessageBox::shouldBeShownContinue("hideOnCloseInfo") )

  const QString message( i18n( "<p>Closing the main window will keep KMess running in the system tray.</p>"
                               "<p>You can open KMess again by clicking on the bird icon, which is "
                               "now flashing.<br/>"
                               "Use 'Quit' from the 'Connect' menu to quit the application.</p>" ) );

  kmDebug() << "Displaying close-to-tray dialog.";

  // Make the icon to blink to help the user find it
  setStatus( KStatusNotifierItem::NeedsAttention );

  KMessageBox::information( kapp->activeWindow(),
                            i18n( "Docking in System Tray" ),
                            "hideOnCloseInfo" );

  // Stop the blinking
  setStatus( KStatusNotifierItem::Active );

Generated by  Doxygen 1.6.0   Back to index