[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r7296 - gnunet-qt/src/core
From: |
gnunet |
Subject: |
[GNUnet-SVN] r7296 - gnunet-qt/src/core |
Date: |
Sat, 21 Jun 2008 07:17:31 -0600 (MDT) |
Author: durner
Date: 2008-06-21 07:17:31 -0600 (Sat, 21 Jun 2008)
New Revision: 7296
Modified:
gnunet-qt/src/core/main.cc
gnunet-qt/src/core/main.h
gnunet-qt/src/core/wndMain.cc
gnunet-qt/src/core/wndMain.h
Log:
Windows: don't terminate gnunet-qt on OS close command, just hide to task tray
Modified: gnunet-qt/src/core/main.cc
===================================================================
--- gnunet-qt/src/core/main.cc 2008-06-21 12:05:40 UTC (rev 7295)
+++ gnunet-qt/src/core/main.cc 2008-06-21 13:17:31 UTC (rev 7296)
@@ -227,6 +227,20 @@
return &wnd;
}
+#if defined(Q_OS_WIN)
+bool GApplication::winEventFilter(MSG *msg, long *result)
+{
+ if (msg->message == WM_CLOSE)
+ {
+ *result = 0;
+ wnd.setVisible(false);
+ return true;
+ }
+
+ return false;
+}
+#endif
+
int
#if defined(Q_OS_WIN)
gn_main
Modified: gnunet-qt/src/core/main.h
===================================================================
--- gnunet-qt/src/core/main.h 2008-06-21 12:05:40 UTC (rev 7295)
+++ gnunet-qt/src/core/main.h 2008-06-21 13:17:31 UTC (rev 7296)
@@ -44,6 +44,10 @@
GMainWindow *getWindow();
protected:
+#if defined(Q_OS_WIN)
+ virtual bool winEventFilter(MSG *msg, long *result);
+#endif
+
GMainWindow wnd;
GPluginLoader loader;
QString strCfgFile;
Modified: gnunet-qt/src/core/wndMain.cc
===================================================================
--- gnunet-qt/src/core/wndMain.cc 2008-06-21 12:05:40 UTC (rev 7295)
+++ gnunet-qt/src/core/wndMain.cc 2008-06-21 13:17:31 UTC (rev 7296)
@@ -142,6 +142,12 @@
this, SLOT(setNetworkStatus(const QPixmap &, const QString)));
}
+void GMainWindow::setVisible(bool visible)
+{
+ trayIcon->contextMenu()->defaultAction()->setChecked(visible);
+ QMainWindow::setVisible(visible);
+}
+
void GMainWindow::setStatusText(const QPixmap &icon, const QString strText)
{
GStatusTextEvent *e;
Modified: gnunet-qt/src/core/wndMain.h
===================================================================
--- gnunet-qt/src/core/wndMain.h 2008-06-21 12:05:40 UTC (rev 7295)
+++ gnunet-qt/src/core/wndMain.h 2008-06-21 13:17:31 UTC (rev 7296)
@@ -42,6 +42,7 @@
public:
GMainWindow(QWidget *parent = NULL);
void addApplication(QWidget *wnd, const QIcon &icon, const QString &label);
+ virtual void setVisible (bool visible);
public:
QLabel statusIcon, statusText, networkIcon, networkText;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r7296 - gnunet-qt/src/core,
gnunet <=