Browse Source

Raise main window when starting another instance w/o params

adaptive-webui-19844
Nick Tiskov 12 years ago
parent
commit
88960556e3
  1. 2
      src/main.cpp
  2. 8
      src/mainwindow.cpp

2
src/main.cpp

@ -197,6 +197,8 @@ int main(int argc, char *argv[]) {
qDebug("Passing program parameters to running instance..."); qDebug("Passing program parameters to running instance...");
qDebug("Message: %s", qPrintable(message)); qDebug("Message: %s", qPrintable(message));
app.sendMessage(message); app.sendMessage(message);
} else { // Raise main window
app.sendMessage("qbt://show");
} }
return 0; return 0;
} }

8
src/mainwindow.cpp

@ -960,6 +960,14 @@ void MainWindow::processParams(const QStringList& params) {
if (misc::isUrl(param)) { if (misc::isUrl(param)) {
QBtSession::instance()->downloadFromUrl(param); QBtSession::instance()->downloadFromUrl(param);
}else{ }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)) { if (param.startsWith("bc://bt/", Qt::CaseInsensitive)) {
qDebug("Converting bc link to magnet link"); qDebug("Converting bc link to magnet link");
param = misc::bcLinkToMagnet(param); param = misc::bcLinkToMagnet(param);

Loading…
Cancel
Save