Added a Notify class
[shopper.git] / src / ui / notify.cc
blob6d0a20c2a315c65796c269be48ce9b45e1d9ae32
1 /* Shopper
2 * Copyright (C) 2008 David Greaves
4 * This software is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public License
6 * as published by the Free Software Foundation; either version 2.1 of
7 * the License, or (at your option) any later version.
9 * This software is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this software; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
17 * 02110-1301 USA
21 #define DEBUG_SHOPPER 1
22 #include "shopper.h" // automake, i8n, gettext
23 #include "notify.h"
24 #include <QMessageBox>
26 namespace Shopper
28 Notify::Notify(const QIcon & icon) :
29 QSystemTrayIcon(icon)
32 void Notify::showMessage ( const QString & title, const QString & message, MessageIcon icon, int millisecondsTimeoutHint )
34 if (supportsMessages()) {
35 DEBUG("supportsMessages");
36 showMessage(title, message, icon, millisecondsTimeoutHint );
37 } else {
38 QMessageBox msgBox;
39 msgBox.setText(title);
40 msgBox.setInformativeText(message);
41 msgBox.exec();