Linked key and ca file configuration to vpn execution. Added option to
[openvpnui.git] / src / vpncontrol.h
index 542ec95..12ff248 100644 (file)
@@ -25,11 +25,18 @@ class VPNControl : public QObject
     Q_PROPERTY (bool compressed READ getCompressed WRITE setCompressed NOTIFY compressedChanged)
     Q_PROPERTY (bool useTLS READ getUseTLS WRITE setUseTLS NOTIFY useTLSChanged)
     Q_PROPERTY (int tlsDirection READ getTlsDirection WRITE setTlsDirection NOTIFY tlsDirectionChanged)
+    Q_PROPERTY (QString caCertFile READ getCaCertFile WRITE setCaCertFile NOTIFY caCertFileChanged)
+    Q_PROPERTY (QString clientCertFile READ getClientCertFile WRITE setClientCertFile NOTIFY clientCertFileChanged)
+    Q_PROPERTY (QString clientKeyFile READ getClientKeyFile WRITE setClientKeyFile NOTIFY clientKeyFileChanged)
+    Q_PROPERTY (QString tlsKeyFile READ getTlsKeyFile WRITE setTlsKeyFile NOTIFY tlsKeyFileChanged)
+
+    Q_PROPERTY (QString logText READ getLogText WRITE setLogText NOTIFY logTextChanged)
 
 private:
     QProcess * vpnProcess;
     VPNSTATUS vpnStatus;
     QStringList arguments;
+    QString logText;
 
     // Configuration options
     QString server;
@@ -37,11 +44,16 @@ private:
     bool compressed;
     bool useTLS;
     int tlsDirection;
+    QString caCertFile;
+    QString clientCertFile;
+    QString clientKeyFile;
+    QString tlsKeyFile;
 
     void collectArguments ();
     void setStatus (VPNSTATUS newStatus);
     void addArgument (QString key, QString value);
     void addArgument (QString key);
+    void addArgumentNonempty (QString key, QString value);
     void addOption (QString key, bool add);
     void addValue (QString key);
     void settingsSetValue (QString key, QString value);
@@ -55,14 +67,26 @@ public:
     bool getCompressed() const;
     bool getUseTLS() const;
     int getTlsDirection() const;
+    QString getCaCertFile () const;
+    QString getClientCertFile () const;
+    QString getClientKeyFile () const;
+    QString getTlsKeyFile () const;
+
+    QString getLogText() const;
 
 signals:
     void statusChanged(int status);
-    void serverChanged(QString server);
+    void serverChanged(QString &server);
     void portChanged(unsigned int port);
     void compressedChanged(bool compressed);
     void useTLSChanged(bool useTLS);
-    void tlsDirectionChanged (int direction);
+    void tlsDirectionChanged(int direction);
+    void caCertFileChanged(QString &caCertFile);
+    void clientCertFileChanged(QString &clientCertFile);
+    void clientKeyFileChanged(QString &clientKeyFile);
+    void tlsKeyFileChanged(QString &tlsKeyFile);
+
+    void logTextChanged (QString &logText);
 
 public slots:
     void vpnConnect ();
@@ -77,6 +101,13 @@ public slots:
     void setCompressed(bool value);
     void setUseTLS(bool value);
     void setTlsDirection(int value);
+    void setCaCertFile(const QString &value);
+    void setClientCertFile(const QString &value);
+    void setClientKeyFile(const QString &value);
+    void setTlsKeyFile(const QString &value);
+
+    void setLogText(const QString &value);
+    void logAppend(const QString &text);
 };
 
 #endif // VPNCONTROL_H