• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kde-runtime API Reference
  • KDE Home
  • Contact Us
 

KNotify

  • sources
  • kde-4.14
  • kde-runtime
  • knotify
notifybypopupgrowl.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2010 by Sjors Gielen <dazjorz@dazjorz.com>
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2, or (at your option)
7  any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 
18  */
19 
20 #include "notifybypopupgrowl.h"
21 #include <QFile>
22 #include <QSystemTrayIcon>
23 
24 #define GROWL_LOCATION_MACOSX "/Library/PreferencePanes/Growl.prefPane/" \
25  "Contents/MacOS/Growl"
26 #define GROWL_LOCATION_WIN32 "C:/Program Files/Growl for Windows/Growl.exe"
27 
34 bool NotifyByPopupGrowl::canPopup()
35 {
36  return QFile::exists( GROWL_LOCATION_MACOSX )
37  || QFile::exists( GROWL_LOCATION_WIN32 );
38 }
39 
43 QStringList NotifyByPopupGrowl::capabilities()
44 {
45  return QStringList();
46 }
47 
55 void NotifyByPopupGrowl::popup( const QPixmap *icon, int timeout,
56  const QString &title, const QString &message )
57 {
58  Q_UNUSED( icon );
59 
60  QSystemTrayIcon i;
61  i.show();
62  i.showMessage( title, message,
63  QSystemTrayIcon::Information, timeout );
64  i.hide();
65 }
GROWL_LOCATION_MACOSX
#define GROWL_LOCATION_MACOSX
Definition: notifybypopupgrowl.cpp:24
NotifyByPopupGrowl::canPopup
static bool canPopup()
Check if Growl can display plugins.
Definition: notifybypopupgrowl.cpp:34
QSystemTrayIcon::showMessage
void showMessage(const QString &title, const QString &message, MessageIcon icon, int millisecondsTimeoutHint)
GROWL_LOCATION_WIN32
#define GROWL_LOCATION_WIN32
Definition: notifybypopupgrowl.cpp:26
QFile::exists
bool exists() const
QSystemTrayIcon::hide
void hide()
notifybypopupgrowl.h
QString
QStringList
QPixmap
NotifyByPopupGrowl::popup
static void popup(const QPixmap *icon, int timeout, const QString &title, const QString &message)
Send a popup through Growl.
Definition: notifybypopupgrowl.cpp:55
NotifyByPopupGrowl::capabilities
static QStringList capabilities()
Get the capabilities supported by Growl.
Definition: notifybypopupgrowl.cpp:43
QSystemTrayIcon
QSystemTrayIcon::show
void show()
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:08:23 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KNotify

Skip menu "KNotify"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kde-runtime API Reference

Skip menu "kde-runtime API Reference"
  • KCMShell
  • KNotify
  • Plasma Runtime
  •     PlasmaCore
  •     DragAndDrop
  •     PlasmaComponents
  •     PlasmaExtraComponents
  •     QtExtraComponents

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal