From a95b1d75893041e418e93f4af571a347242752c2 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 4 Mar 2007 21:12:37 +0000 Subject: [PATCH] - Fixed exit from trayicon when "close to systray" is enabled --- src/GUI.cpp | 9 ++++++++- src/GUI.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/GUI.cpp b/src/GUI.cpp index e43273456..2a79d6716 100644 --- a/src/GUI.cpp +++ b/src/GUI.cpp @@ -146,7 +146,7 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent){ downloadList->header()->setClickable(true); downloadList->header()->setSortIndicatorShown(true); // Connecting Actions to slots - connect(actionExit, SIGNAL(triggered()), this, SLOT(close())); + connect(actionExit, SIGNAL(triggered()), this, SLOT(forceExit())); connect(actionOpen, SIGNAL(triggered()), this, SLOT(askForTorrents())); connect(actionDelete_Permanently, SIGNAL(triggered()), this, SLOT(deletePermanently())); connect(actionDelete, SIGNAL(triggered()), this, SLOT(deleteSelection())); @@ -408,6 +408,13 @@ void GUI::displayDLListMenu(const QPoint& pos){ myDLLlistMenu.exec(mapToGlobal(pos)+QPoint(22,180)); } +// Necessary if we want to close the window +// in one time if "close to systray" is enabled +void GUI::forceExit(){ + hide(); + close(); +} + void GUI::displayGUIMenu(const QPoint& pos){ QMenu myGUIMenu(this); myGUIMenu.addAction(actionOpen); diff --git a/src/GUI.h b/src/GUI.h index d537824e9..cce064a4d 100644 --- a/src/GUI.h +++ b/src/GUI.h @@ -142,6 +142,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{ void balloonClicked(); void writeSettings(); void readSettings(); + void forceExit(); // Torrent actions void showProperties(const QModelIndex &index); void propertiesSelection();