1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-10 23:07:59 +00:00

Merge pull request #358 from Gelmir/raise_wnd

Raise main window when starting another instance w/o params
This commit is contained in:
Christophe Dumez 2013-01-26 11:59:09 -08:00
commit 6838edb4fe
2 changed files with 12 additions and 0 deletions

View File

@ -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;
}

View File

@ -960,6 +960,16 @@ void MainWindow::processParams(const QStringList& params) {
if (misc::isUrl(param)) {
QBtSession::instance()->downloadFromUrl(param);
}else{
if(param.startsWith("qbt://show")) {
if(ui_locked) {
if(!unlockUI())
return;
}
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);