Fixed log output window. Rearranted components to increase space for the
[openvpnui.git] / qml / pages / ConnectPage.qml
index 88d0b8e..08cbdb6 100644 (file)
@@ -1,6 +1,6 @@
 /*
-  Copyright (C) 2013 Jolla Ltd.
-  Contact: Thomas Perl <thomas.perl@jollamobile.com>
+  Copyright (C) 2014 David Llewellyn-Jones
+  Contact: David Llewellyn-Jones <david@flypig.co.uk>
   All rights reserved.
 
   You may use this file under the terms of BSD license as follows:
   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+  Built using the standard template from Jolla
+  Copyright (C) 2013 Jolla Ltd.
+  Contact: Thomas Perl <thomas.perl@jollamobile.com>
 */
 
 import QtQuick 2.0
 import Sailfish.Silica 1.0
 
-
 Page {
     id: connectPage
 
@@ -119,7 +122,10 @@ Page {
                     id: connect
                     text: "Connect"
                     enabled: true
-                    onClicked: VpnControl.vpnConnect()
+                    onClicked: {
+                        VpnControl.logAppend('\n')
+                        VpnControl.vpnConnect()
+                    }
                 }
                 Button {
                     id : disconnect
@@ -128,6 +134,7 @@ Page {
                     onClicked: VpnControl.vpnDisconnect();
                 }
             }
+
             Label {
                 id: statusText
                 text: "No status"
@@ -141,10 +148,42 @@ Page {
                 BusyIndicator {
                     id: busy
                     running: false
-                    size: BusyIndicatorSize.Large
+                    size: BusyIndicatorSize.Medium
                     anchors.verticalCenter: parent.verticalCenter
                 }
             }
+
+            Rectangle {
+                color: "transparent"
+                border {
+                    color: Theme.highlightBackgroundColor
+                    width: 1
+                }
+                //radius: Theme.paddingSmall
+                anchors.horizontalCenter: parent.horizontalCenter
+                height: (24 * Theme.fontSizeTiny) + (2 * Theme.paddingLarge)
+                width: parent.width - 2 * Theme.paddingLarge
+                x: Theme.paddingLarge
+
+                //TextEdit {
+                Label {
+                    id: logOutput
+                    textFormat: Text.PlainText
+                    width: parent.width - 2 * Theme.paddingSmall
+                    height: parent.height - 0 * Theme.paddingSmall
+                    wrapMode: Text.WrapAnywhere
+                    font.pixelSize: Theme.fontSizeTiny * 0.6
+                    font.family: "Monospace"
+                    color: Theme.highlightColor
+                    visible: true
+                    text: VpnControl.logText
+                    verticalAlignment: Text.AlignBottom
+                    x: Theme.paddingSmall
+                    y: Theme.paddingSmall
+                    //readOnly: true
+                    clip: true
+                }
+            }
         }
     }
 }