Show
Ignore:
Timestamp:
03/02/08 23:16:21 (9 months ago)
Author:
flynd
Message:

Move popup implementation to dock icon as kde want's the tray icon as reference. Added use of showMessage when building without kde support.

Location:
trunk/qt4-gui/src/dockicons
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/qt4-gui/src/dockicons/defaultdockicon.h

    r6058 r6079  
    5353  virtual void updateIconMessages(int newMsg, int sysMsg); 
    5454 
     55  /** 
     56   * Popup message from system tray 
     57   * NOT IMPLEMENTED FOR DEFAULT ICON 
     58   * 
     59   * @param title Popup title text 
     60   * @param message Message text 
     61   * @param icon Icon to display in the popup 
     62   * @param timeout Time before hiding popup 
     63   */ 
     64  virtual void popupMessage(QString /* title */, QString /* message */, const QPixmap& /* icon */, int /* timeout */) {} 
     65 
    5566protected slots: 
    5667  /** 
  • trunk/qt4-gui/src/dockicons/dockicon.h

    r6058 r6079  
    6666  virtual void updateIconMessages(int newMsg, int sysMsg); 
    6767 
     68  /** 
     69   * Popup message from system tray 
     70   * 
     71   * @param title Popup title text 
     72   * @param message Message text 
     73   * @param icon Icon to display in the popup 
     74   * @param timeout Time before hiding popup 
     75   */ 
     76  virtual void popupMessage(QString title, QString message, const QPixmap& icon, int timeout) = 0; 
     77 
    6878signals: 
    6979  /** 
  • trunk/qt4-gui/src/dockicons/systemtrayicon.cpp

    r6058 r6079  
    2121 
    2222#include "config.h" 
     23 
     24#ifdef USE_KDE 
     25#include <KDE/KPassivePopup> 
     26#endif 
    2327 
    2428#include "config/general.h" 
     
    6064 
    6165  DockIcon::updateIconMessages(newMsg, sysMsg); 
     66} 
     67 
     68#ifdef USE_KDE 
     69void SystemTrayIcon::popupMessage(QString title, QString message, const QPixmap& icon, int timeout) 
     70#else 
     71void SystemTrayIcon::popupMessage(QString title, QString message, const QPixmap& /* icon */, int timeout) 
     72#endif 
     73{ 
     74#ifdef USE_KDE 
     75  // Escape HTML 
     76  title.replace('&', "&amp;"); 
     77  title.replace('<', "&lt;"); 
     78  title.replace('>', "&gt;"); 
     79  message.replace('&', "&amp;"); 
     80  message.replace('<', "&lt;"); 
     81  message.replace('>', "&gt;"); 
     82  KPassivePopup::message(title, message, icon, myTrayIcon, timeout); 
     83#else 
     84  if (myTrayIcon->supportsMessages()) 
     85    myTrayIcon->showMessage(title, message, QSystemTrayIcon::NoIcon, timeout); 
     86#endif 
    6287} 
    6388 
  • trunk/qt4-gui/src/dockicons/systemtrayicon.h

    r6058 r6079  
    5050   */ 
    5151  virtual void updateIconMessages(int newMsg, int sysMsg); 
     52 
     53  /** 
     54   * Popup message from system tray 
     55   * 
     56   * @param title Popup title text 
     57   * @param message Message text 
     58   * @param icon Icon to display in the popup 
     59   * @param timeout Time before hiding popup 
     60   */ 
     61  virtual void popupMessage(QString title, QString message, const QPixmap& icon, int timeout); 
    5262 
    5363protected slots: 
  • trunk/qt4-gui/src/dockicons/themeddockicon.h

    r6058 r6079  
    6161  virtual void updateIconMessages(int newMsg, int sysMsg); 
    6262 
     63  /** 
     64   * Popup message from system tray 
     65   * NOT IMPLEMENTED FOR THEMED ICON 
     66   * 
     67   * @param title Popup title text 
     68   * @param message Message text 
     69   * @param icon Icon to display in the popup 
     70   * @param timeout Time before hiding popup 
     71   */ 
     72  virtual void popupMessage(QString /* title */, QString /* message */, const QPixmap& /* icon */, int /* timeout */) {} 
     73 
    6374protected slots: 
    6475  /**