From 9b6b357c9e4fe4b9113d5321ed0d90218e88dc0c Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Mon, 17 Jan 2011 17:29:25 +0000 Subject: [PATCH] Cleanup mainwindow startup code --- src/main.cpp | 2 -- src/mainwindow.cpp | 13 ++++++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index e93725daf..6f1cfe12b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -302,8 +302,6 @@ int main(int argc, char *argv[]){ #ifndef DISABLE_GUI MainWindow window(0, torrentCmdLine); - if(!no_splash) - window.raise(); QObject::connect(&app, SIGNAL(messageReceived(const QString&)), &window, SLOT(processParams(const QString&))); app.setActivationWindow(&window); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 30f2d6b48..a3797639b 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -233,8 +233,6 @@ MainWindow::MainWindow(QWidget *parent, QStringList torrentCmdLine) : QMainWindo if(!autoShutdownGroup->checkedAction()) actionAutoShutdown_Disabled->setChecked(true); - show(); - // Load Window state and sizes readSettings(); properties->readSettings(); @@ -242,13 +240,14 @@ MainWindow::MainWindow(QWidget *parent, QStringList torrentCmdLine) : QMainWindo // Limit status filters list height transferListFilters->getStatusFilters()->updateHeight(); - if(ui_locked) { - hide(); - } else { + if(!ui_locked) { if(pref.startMinimized()) showMinimized(); - else - setFocus(); + else { + show(); + activateWindow(); + raise(); + } } // Start watching the executable for updates