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:
commit
6838edb4fe
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user