QTfrontend/HWApplication.cpp
changeset 8716 e09633d10f16
parent 8715 70a586fc76fd
child 8722 2dead6b84bca
--- a/QTfrontend/HWApplication.cpp	Sun Mar 10 11:29:00 2013 +0100
+++ b/QTfrontend/HWApplication.cpp	Sun Mar 10 15:44:03 2013 +0100
@@ -50,23 +50,28 @@
 bool HWApplication::event(QEvent *event)
 {
     QFileOpenEvent *openEvent;
-    QString scheme, path;
+    QString scheme, path, address;
 
     if (event->type() == QEvent::FileOpen) {
         openEvent = (QFileOpenEvent *)event;
         scheme = openEvent->url().scheme();
         path = openEvent->url().path();
+        address = openEvent->url().host();
 
         QFile file(path);
         if (scheme == "file" && file.exists()) {
             form->PlayDemoQuick(openEvent->file());
             return true;
+        } else if (scheme == "hwplay") {
+            int port = openEvent->url().port(NETGAME_DEFAULT_PORT);
+            form->NetConnectQuick(address, (quint16) port);
+            return true;
         } else {
             const QString errmsg = tr("Not yet implemented").arg(path);
             MessageDialog::ShowErrorMessage(errmsg, form);
             return false;
         }
-     }
+    }
 
     return QApplication::event(event);
 }