view ui/trayicon.h @ 1310:60e481aa75ca

(issue152) Do not return CryptUIDlgViewContext's return value The return value is false if the user cancels the dialog. But as the certificate has been shown this is not really an error.
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 13 Oct 2014 14:13:05 +0200
parents 2a1aa9df8f11
children
line wrap: on
line source
#ifndef TRAYICON_H
#define TRAYICON_H
/* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
 * Software engineering by Intevation GmbH
 *
 * This file is Free Software under the GNU GPL (v>=2)
 * and comes with ABSOLUTELY NO WARRANTY!
 * See LICENSE.txt for details.
 */

#include <QWidget>
#include <QSystemTrayIcon>


class QMessageBox;

/**@brief User notification interface
 *
 * This class provides an inherited implmentation of QSystemTrayIcon
 * to be more flexible on platforms where no SystemTray is available.
 *
 * This class should become obsolete once Qt improves the support for
 * StatusNotifier icons that are used in Plasma 5 and Unity.
 */
class TrayIcon :  public QSystemTrayIcon
{
    Q_OBJECT
public:
    TrayIcon (QObject *parent);

    void show();
    bool isAlternative() {return useAlt;}

public Q_SLOTS:
    void showMessage(const QString &title, const QString &msg,
                     QSystemTrayIcon::MessageIcon icon = QSystemTrayIcon::Information, int msecs = 10000,
                     const QString &okBtnText = QString());
private Q_SLOTS:
    void messageDestroyed();

private:
    bool useAlt;
    QMessageBox *mMessageBox;
};

#endif // TRAYICON_H

http://wald.intevation.org/projects/trustbridge/