Browse Source

Merge pull request #358 from Gelmir/raise_wnd

Raise main window when starting another instance w/o params
adaptive-webui-19844
Christophe Dumez 12 years ago
parent
commit
6838edb4fe
  1. 2
      src/main.cpp
  2. 10
      src/mainwindow.cpp

2
src/main.cpp

@ -197,6 +197,8 @@ int main(int argc, char *argv[]) { @@ -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;
}

10
src/mainwindow.cpp

@ -960,6 +960,16 @@ void MainWindow::processParams(const QStringList& params) { @@ -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…
Cancel
Save