From 8d55368f6a5fa57a015b6419b7ed690a341e1d0d Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Thu, 4 Mar 2010 08:23:16 +0000 Subject: [PATCH] BUGFIX: Only one log window can be opened at a time --- Changelog | 1 + src/GUI.cpp | 14 ++++++++++++-- src/GUI.h | 2 ++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Changelog b/Changelog index f270828ea..7bb2a37c9 100644 --- a/Changelog +++ b/Changelog @@ -3,6 +3,7 @@ - BUGFIX: Fix save path display in properties - BUGFIX: Fix ratio calculation for directly seeded torrents (Thanks phorane) - BUGFIX: Fix memory leak in RSS parser + - BUGFIX: Only one log window can be opened at a time * Web Feb 10 2010 - Christophe Dumez - v2.1.5 - BUGFIX: Fix actions on selected torrents (non-selected torrents could be affected) diff --git a/src/GUI.cpp b/src/GUI.cpp index 2e0808ab5..436102b65 100644 --- a/src/GUI.cpp +++ b/src/GUI.cpp @@ -217,7 +217,10 @@ GUI::~GUI() { delete status_bar; delete transferList; delete guiUpdater; - + if (console) + delete console; + if(options) + delete options; if(rssWidget) delete rssWidget; delete searchEngine; @@ -420,7 +423,11 @@ void GUI::on_actionSet_global_upload_limit_triggered() { } void GUI::on_actionShow_console_triggered() { - new consoleDlg(this, BTSession); + if(!console) { + console = new consoleDlg(this, BTSession); + } else { + console->setFocus(); + } } void GUI::on_actionSet_global_download_limit_triggered() { @@ -911,6 +918,9 @@ void GUI::on_actionOptions_triggered() { if(!options) { options = new options_imp(this); connect(options, SIGNAL(status_changed()), this, SLOT(optionsSaved())); + } else { + // Get focus + options->setFocus(); } } diff --git a/src/GUI.h b/src/GUI.h index 0bf1812c8..88af38771 100644 --- a/src/GUI.h +++ b/src/GUI.h @@ -55,6 +55,7 @@ class TransferListFiltersWidget; class QSplitter; class PropertiesWidget; class StatusBar; +class consoleDlg; class GUI : public QMainWindow, private Ui::MainWindow{ Q_OBJECT @@ -68,6 +69,7 @@ private: QTabWidget *tabs; StatusBar *status_bar; QPointer options; + QPointer console; QPointer systrayIcon; QPointer systrayCreator; QMenu *myTrayIconMenu;