Browse Source

Log more information when we can't bind to UniqueApplication socket

Related to #45
Tobias Hieta 9 years ago
parent
commit
0f13034b04
4 changed files with 5 additions and 4 deletions
  1. 1 1
      src/main.cpp
  2. 1 0
      src/shared/LocalJsonServer.h
  3. 2 2
      src/shared/UniqueApplication.h
  4. 1 1
      src/ui/errormessage.qml

+ 1 - 1
src/main.cpp

@@ -275,7 +275,7 @@ int main(int argc, char *argv[])
     QString text = e.message() + "<br>" + QObject::tr("Please visit Plex support forums for support.");
 
     QQmlApplicationEngine* engine = new QQmlApplicationEngine(NULL);
-    engine->rootContext()->setContextProperty("errorTitle", QObject::tr("A critical error happened!"));
+    engine->rootContext()->setContextProperty("errorTitle", QObject::tr("A critical error occurred."));
     engine->rootContext()->setContextProperty("errorText", text);
     engine->load(QUrl(QStringLiteral("qrc:/ui/errormessage.qml")));
 

+ 1 - 0
src/shared/LocalJsonServer.h

@@ -19,6 +19,7 @@ public:
   bool listen();
   static bool sendMessage(const QVariantMap& message, QLocalSocket* socket);
   static QVariantList readFromSocket(QLocalSocket* socket);
+  QString errorString() const { return m_server->errorString(); }
 
 Q_SIGNALS:
   void clientConnected(QLocalSocket* socket);

+ 2 - 2
src/shared/UniqueApplication.h

@@ -33,8 +33,8 @@ public:
         emit otherApplicationStarted();
     });
 
-    if (!m_server->listen())
-      throw FatalException("Failed to listen to uniqueApp socket!");
+    if (m_server->listen())
+      throw FatalException("Failed to listen to uniqueApp socket: " + m_server->errorString());
   }
 
   bool ensureUnique()

+ 1 - 1
src/ui/errormessage.qml

@@ -14,7 +14,7 @@ MessageDialog {
   }
 
   onHelp: {
-    Qt.openUrlExternally("https://forums.plex.tv")
+    Qt.openUrlExternally("https://forums.plex.tv/categories/plex-media-player")
     Qt.quit()
   }