From 88960556e3217a265496617c9106f17d614bc730 Mon Sep 17 00:00:00 2001 From: Nick Tiskov Date: Tue, 22 Jan 2013 15:38:09 +0400 Subject: [PATCH] Raise main window when starting another instance w/o params --- src/main.cpp | 2 ++ src/mainwindow.cpp | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 3803e4ce2..79950e74c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -197,6 +197,8 @@ int main(int argc, char *argv[]) { qDebug("Passing program parameters to running instance..."); qDebug("Message: %s", qPrintable(message)); app.sendMessage(message); + } else { // Raise main window + app.sendMessage("qbt://show"); } return 0; } diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 43a5383c0..dec5e3ca2 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -960,6 +960,14 @@ void MainWindow::processParams(const QStringList& params) { if (misc::isUrl(param)) { QBtSession::instance()->downloadFromUrl(param); }else{ + if(param.startsWith("qbt://show", Qt::CaseInsensitive)) { + if(!ui_locked) { + show(); + activateWindow(); + raise(); + } + return; // Do not process more params + } if (param.startsWith("bc://bt/", Qt::CaseInsensitive)) { qDebug("Converting bc link to magnet link"); param = misc::bcLinkToMagnet(param);