[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[vidalia-svn] r1782: I am told QSystemTrayIcon::supportsMessages() lies about its (trunk/src/gui)
Author: edmanm
Date: 2007-06-12 20:10:57 -0400 (Tue, 12 Jun 2007)
New Revision: 1782
Modified:
trunk/src/gui/mainwindow.cpp
Log:
I am told QSystemTrayIcon::supportsMessages() lies about its ability to
support balloon messages on Windows 2000. See Ticket #253.
Modified: trunk/src/gui/mainwindow.cpp
===================================================================
--- trunk/src/gui/mainwindow.cpp 2007-06-10 02:12:45 UTC (rev 1781)
+++ trunk/src/gui/mainwindow.cpp 2007-06-13 00:10:57 UTC (rev 1782)
@@ -33,6 +33,7 @@
#include <QTimer>
#include <vidalia.h>
#include <util/html.h>
+#include <QSysInfo>
#include "common/vmessagebox.h"
#include "common/animatedpixmap.h"
@@ -726,13 +727,22 @@
ui.lblNewIdentity->setEnabled(false);
QTimer::singleShot(MIN_NEWIDENTITY_INTERVAL,
this, SLOT(enableNewIdentity()));
-
+
#if defined(USE_QSYSTEMTRAYICON)
+ /* Check if we support balloon messages. We support balloon messages only
+ * if we are built with Qt >= 4.2, but not if we are running on OS X or
+ * a version of Windows <= Windows 2000. */
+# if defined(Q_WS_WIN)
+ if (QSystemTrayIcon::supportsMessages() &&
+ QSysInfo::WindowsVersion > QSysInfo::WV_2000)
+# else
if (QSystemTrayIcon::supportsMessages())
+# endif
_trayIcon.showMessage(title, message, QSystemTrayIcon::Information);
else
VMessageBox::information(this, title, message, VMessageBox::Ok);
#else
+ /* No QSystemTrayIcon. Just show a message box */
VMessageBox::information(this, title, message, VMessageBox::Ok);
#endif
} else {