[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [declarative-plasmoids] microblog: WOrk a bit on the authorization status
From:       Sebastian_Kügler <sebas () kde ! org>
Date:       2012-02-01 1:50:01
Message-ID: 20120201015001.3161FA60BE () git ! kde ! org
[Download RAW message or body]

Git commit 3ae19fea02ab969cbbe700a74afe144f8109b5d4 by Sebastian Kügler.
Committed on 28/01/2012 at 18:32.
Pushed by sebas into branch 'master'.

WOrk a bit on the authorization status

Correctly displays it now for twitter, identi.ca has problems accepting
the requesttoken, but that happens in the dataengine. Getting closer,
but posting does not work yet.

M  +1    -1    microblog/contents/config/main.xml
A  +73   -0    microblog/contents/ui/BasicComponents/AuthorizationWidget.qml     \
[License: LGPL (v2+)] M  +108  -34   \
microblog/contents/ui/BasicComponents/PostingWidget.qml M  +6    -2    \
microblog/contents/ui/ComplexComponents/Avatar.qml M  +1    -21   \
microblog/contents/ui/main.qml A  +90   -0    \
microblog/platformcontents/application/generic/ui/BasicComponents/AuthorizationWidget.qml \
[License: LGPL (v2+)] M  +21   -19   \
microblog/platformcontents/application/generic/ui/BasicComponents/PostingWidget.qml M \
+2    -1    microblog/platformcontents/application/generic/ui/BasicComponents/qmldir \
M  +50   -2    microblog/platformcontents/application/tablet/ui/MainWidget/AuthorizationWidget.qml
 M  +7    -5    microblog/platformcontents/application/tablet/ui/MainWidget/MainWidget.qml
 M  +1    -1    microblog/platformcontents/application/tablet/ui/MainWidget/qmldir

http://commits.kde.org/declarative-plasmoids/3ae19fea02ab969cbbe700a74afe144f8109b5d4

diff --git a/microblog/contents/config/main.xml b/microblog/contents/config/main.xml
index d11078c..09d0e24 100644
--- a/microblog/contents/config/main.xml
+++ b/microblog/contents/config/main.xml
@@ -8,7 +8,7 @@
   <group name="General">
     <entry name="serviceUrl" type="String">
       <label>Microblog service</label>
-      <default>https://twitter.com/</default>
+      <default>https://identi.ca/api/</default>
     </entry>
     <entry name="userName" type="String">
       <label>User name</label>
diff --git a/microblog/contents/ui/BasicComponents/AuthorizationWidget.qml \
b/microblog/contents/ui/BasicComponents/AuthorizationWidget.qml new file mode 100644
index 0000000..9c83e73
--- /dev/null
+++ b/microblog/contents/ui/BasicComponents/AuthorizationWidget.qml
@@ -0,0 +1,73 @@
+/*
+ *   Copyright 2012 Sebastian Kügler <sebas@kde.org>
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU Library General Public License as
+ *   published by the Free Software Foundation; either version 2 or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU Library General Public License for more details
+ *
+ *   You should have received a copy of the GNU Library General Public
+ *   License along with this program; if not, write to the
+ *   Free Software Foundation, Inc.,
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+import QtQuick 1.1
+import org.kde.plasma.core 0.1 as PlasmaCore
+import org.kde.plasma.components 0.1 as PlasmaComponents
+import org.kde.plasma.mobilecomponents 0.1 as MobileComponents
+import org.kde.qtextracomponents 0.1 as QtExtraComponents
+
+import "plasmapackage:/ui/ComplexComponents"
+import "plasmapackage:/ui/BasicComponents"
+Item {
+
+    property alias statusMessage: statusLabel.text
+    property string status: "Idle";
+
+    width: childrenRect.width
+    height: childrenRect.height
+
+    PlasmaComponents.BusyIndicator {
+        id: busyIndicator
+        width: 36; height: width;
+        visible: status == "Busy"
+        anchors { left: parent.left; verticalCenter: parent.verticalCenter; \
leftMargin: 12; topMargin: 12} +        running: status == "Busy"
+    }
+
+    PlasmaComponents.Label {
+        id: statusLabel
+        width: 300
+        height: 48
+        anchors { left: busyIndicator.right; verticalCenter: \
busyIndicator.verticalCenter; leftMargin: 12; } +        //text: \
statusSource.data["Status:https://twitter.com/"]["Authorization"] +        //text: \
"Status:" + statusSource.data["Status:https://twitter.com/"]["Authorization"] +       \
text: status == "Busy" ? "Logging in..." : status == "Ok" ? "<h2>@" + userName + \
"</h2>" : ""; +    }
+    PlasmaCore.DataSource {
+        id: statusSource
+        engine: "microblog"
+        interval: 0
+        onDataChanged: {
+            if (statusSource.data["Status:"+serviceUrl]) {
+                print(" status: " + statusSource.data);
+                //authStatusWidget.statusMessage = \
statusSource.data["Status:"+serviceUrl]["Authorization"] + ": " + \
statusSource.data["Status:"+serviceUrl]["AuthorizationMessage"] ; +                \
authStatusWidget.status = statusSource.data["Status:"+serviceUrl]["Authorization"] +  \
} else { +//                 authStatusWidget.statusMessage = "Unknown status"
+//                 authStatusWidget.status = "Idle"
+
+            }
+        }
+        Component.onCompleted: statusSource.connectSource("Status:"+serviceUrl);
+
+    }
+    
+}
+ 
diff --git a/microblog/contents/ui/BasicComponents/PostingWidget.qml \
b/microblog/contents/ui/BasicComponents/PostingWidget.qml index 57b9a0c..bdbfbb9 \
                100644
--- a/microblog/contents/ui/BasicComponents/PostingWidget.qml
+++ b/microblog/contents/ui/BasicComponents/PostingWidget.qml
@@ -17,15 +17,21 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
-import QtQuick 1.1
+import Qt 4.7
 import org.kde.plasma.core 0.1 as PlasmaCore
 import org.kde.plasma.components 0.1 as PlasmaComponents
 import org.kde.qtextracomponents 0.1 as QtExtraComponents
 
 import "plasmapackage:/code/logic.js" as Logic
+import "plasmapackage:/ui/BasicComponents"
+import "plasmapackage:/ui/ComplexComponents"
 
-ListItem {
-    height: 100
+Item {
+    id: pwItem
+    //width: 300
+    //height: 300
+    state: "inactive"
+    visible: authStatusWidget.status == "Ok"
 
     function refresh()
     {
@@ -34,61 +40,78 @@ ListItem {
         Logic.refresh()
         plasmoid.busy = true
     }
+    //Rectangle { anchors.fill: postWidget; color: "blue"; opacity: 0.3 }
+
+    AuthorizationWidget {
+        id: authStatusWidget
+        anchors { left: parent.left; verticalCenter: postWidget.verticalCenter; }
+    }
 
     PlasmaCore.FrameSvgItem {
         id: postWidget
-        anchors.left: parent.left
-        anchors.right: parent.right
+        //width: 520
+        anchors.fill: parent
         imagePath: "widgets/frame"
         prefix: "plain"
+        property alias textWidth: postTextEdit.width
 
-        QtExtraComponents.QImageItem {
+        Avatar {
             id: profileIcon
-            smooth: true
-            anchors {
-                left: postWidget.left
-                top: postWidget.top
-                leftMargin: postWidget.margins.left
-                topMargin: postWidget.margins.top
-            }
-            width: 48
-            height: 48
-            //image: microblogSource.data["UserImages:"+serviceUrl][userName]
-        }
-
-        QtExtraComponents.QIconItem {
-            icon: QIcon("meeting-chair")
-            anchors.fill: profileIcon
-        }
-        PlasmaComponents.Label {
-            anchors.top: profileIcon.bottom
-            text: userName
+            height: 32
+            width: height
+            anchors.left: postWidget.left
+            anchors.verticalCenter: postTextEdit.verticalCenter
+            userId: userName
         }
+//         PlasmaComponents.Label {
+//             anchors.top: profileIcon.bottom
+//             text: userName
+//         }
 
         PlasmaComponents.TextArea {
             id: postTextEdit
-            height: 96
+            placeholderText: i18n("Share your thoughts...")
+            height: 90
+            interactive: false
+            //width: 300
+
             anchors {
                 left: profileIcon.right
                 right: postWidget.right
-                //verticalCenter: parent.verticalCenter
-                //top: parent.top
-                //bottom: parent.bottom
+                top: postWidget.top
+                bottom: postWidget.bottom
                 rightMargin: postWidget.margins.right
-                //topMargin: postWidget.margins.top
+                leftMargin: 6
+                topMargin: postWidget.margins.top
             }
             wrapMode: TextEdit.WordWrap
             property string inReplyToStatusId: ""
 
             onTextChanged: {
+                var txt = text; // prevent copying text more often than necessary
+                characterCountLabel.characterCount = txt.length;
                 //yes, TextEdit doesn't have returnPressed sadly
-                if (text[text.length-1] == "\n") {
-                    Logic.update(text, inReplyToStatusId);
-                    refresh()
-                } else if (text.length == 0) {
+                if (txt[txt.length-1] == "\n") {
+                    //Logic.update(txt, inReplyToStatusId);
+                    //refresh();
+                    print(" RETURN ");
+                } else if (txt.length == 0) {
                     inReplyToStatusId = ""
                 }
             }
+
+            Keys.onReturnPressed: {
+                //Logic.update(txt, inReplyToStatusId);
+                //refresh();
+                print(" Sending Update: " + txt + " to statusId: " + \
inReplyToStatusId); +                ///print(" sending update");
+            }
+
+            onActiveFocusChanged: {
+                print("Focus " + activeFocus);
+                activeFocus ? pwItem.state = "active" : pwItem.state = "inactive";
+            }
+
             Connections {
                 target: main
                 onReplyAsked: {
@@ -107,5 +130,56 @@ ListItem {
                 }
             }
         }
+        PlasmaComponents.Label {
+            id: characterCountLabel
+            anchors { bottom: postTextEdit.bottom; right: postTextEdit.right; \
rightMargin: 8 } +            property int characterCount: 0
+            opacity: 0.6
+            visible: (characterCount != 0 && postTextEdit.activeFocus)
+
+            onCharacterCountChanged: {
+                text = 140 - characterCount;
+                if (characterCount <= 140) {
+                    color = "green"
+                } else {
+                    color = "red"
+                }
+            }
+        }
+    }
+
+    states: [
+        State {
+            name: "active"
+            PropertyChanges { target: topItem; height: 120 }
+            PropertyChanges { target: pwItem; width: 384 }
+            PropertyChanges { target: profileIcon; height: 64 }
+        },
+        State {
+            name: "inactive"
+            PropertyChanges { target: topItem; height: 64 }
+            PropertyChanges { target: pwItem; width: 320 }
+            PropertyChanges { target: profileIcon; height: 32 }
+        }
+    ]
+
+    property int animation_duration: 150
+
+    transitions: [
+        Transition {
+            from: "inactive"; to: "active"
+            PropertyAnimation { target: topItem; properties: "height"; duration: \
animation_duration } +            PropertyAnimation { target: pwItem; properties: \
"width"; duration: animation_duration } +            PropertyAnimation { target: \
profileIcon; properties: "height"; duration: animation_duration } +        },
+        Transition {
+            from: "active"; to: "inactive"
+            PropertyAnimation { target: topItem; properties: "height"; duration: \
animation_duration } +            PropertyAnimation { target: pwItem; properties: \
"width"; duration: animation_duration } +            PropertyAnimation { target: \
profileIcon; properties: "height"; duration: animation_duration } +        }
+    ]
+    Component.onCompleted: {
+        //topItem.height = 120
     }
 }
diff --git a/microblog/contents/ui/ComplexComponents/Avatar.qml \
b/microblog/contents/ui/ComplexComponents/Avatar.qml index c40cee6..eb62940 100644
--- a/microblog/contents/ui/ComplexComponents/Avatar.qml
+++ b/microblog/contents/ui/ComplexComponents/Avatar.qml
@@ -31,7 +31,7 @@ QtExtraComponents.QImageItem {
 
     image: {
         var sourceName = "UserImages:"+serviceUrl;
-        //print(" avatar for user: ", userId, sourceName);
+        print(" avatar for user: ", userId, sourceName);
         var d = imageSource.data[sourceName];
         if (typeof(d) != "undefined" &&
             typeof(d[userId]) != "undefined") {
@@ -42,6 +42,10 @@ QtExtraComponents.QImageItem {
     }
     MouseArea {
         anchors.fill: parent
-        onClicked: userInfo.login = userId
+        onClicked: {
+            print("Avatar clicked: " + userId);
+            userInfo.login = userId
+            
+        }
     }
 }
diff --git a/microblog/contents/ui/main.qml b/microblog/contents/ui/main.qml
index 8fd6ce3..30a5fe3 100644
--- a/microblog/contents/ui/main.qml
+++ b/microblog/contents/ui/main.qml
@@ -31,7 +31,7 @@ Item {
     width: 200
     height: 300
 
-    property string serviceUrl: "https://twitter.com/"
+    property string serviceUrl//: "https://twitter.com/"
     property string userName//: "sebasje" // FIXME: remove until config doesn't get \
nuked all the time  property string password
 
@@ -129,28 +129,8 @@ Item {
         interval: 0
     }
 
-    PlasmaCore.DataSource {
-        id: statusSource
-        engine: "microblog"
-        interval: 0
-        onDataChanged: {
-            if (statusSource.data["Status:"+serviceUrl]) {
-                print(" status: " + statusSource.data);
-                authStatusWidget.statusMessage = \
statusSource.data["Status:"+serviceUrl]["Authorization"] + ": " + \
                statusSource.data["Status:"+serviceUrl]["AuthorizationMessage"] ;
-            } else {
-                authStatusWidget.statusMessage = "Unknown status"
-            }
-        }
-        Component.onCompleted: statusSource.connectSource("Status:"+serviceUrl);
-
-    }
 
     MainWidget {
         anchors.fill: main
     }
-
-    AuthorizationWidget {
-        id: authStatusWidget
-        anchors { left: parent.left; right: parent.right; }
-    }
 }
diff --git a/microblog/platformcontents/application/generic/ui/BasicComponents/AuthorizationWidget.qml \
b/microblog/platformcontents/application/generic/ui/BasicComponents/AuthorizationWidget.qml
 new file mode 100644
index 0000000..d23a387
--- /dev/null
+++ b/microblog/platformcontents/application/generic/ui/BasicComponents/AuthorizationWidget.qml
 @@ -0,0 +1,90 @@
+/*
+ *   Copyright 2012 Sebastian Kügler <sebas@kde.org>
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU Library General Public License as
+ *   published by the Free Software Foundation; either version 2 or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU Library General Public License for more details
+ *
+ *   You should have received a copy of the GNU Library General Public
+ *   License along with this program; if not, write to the
+ *   Free Software Foundation, Inc.,
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+import QtQuick 1.1
+import org.kde.plasma.core 0.1 as PlasmaCore
+import org.kde.plasma.components 0.1 as PlasmaComponents
+import org.kde.plasma.mobilecomponents 0.1 as MobileComponents
+import org.kde.qtextracomponents 0.1 as QtExtraComponents
+
+import "plasmapackage:/ui/ComplexComponents"
+import "plasmapackage:/ui/BasicComponents"
+Item {
+    id: authStatusWidget
+     width: 800
+     height: 200
+    property alias statusMessage: statusLabel.text
+    property string status: "Idle"
+
+//     width: childrenRect.width
+//     height: childrenRect.height
+
+    PlasmaComponents.BusyIndicator {
+        id: busyIndicator
+        width: authStatusWidget.height; height: width
+//       width: 64; height: width;
+        visible: status == "Busy"
+        anchors { left: parent.left; verticalCenter: parent.verticalCenter; \
leftMargin: 12; topMargin: 12} +        running: status == "Busy"
+        //Rectangle { color: "green"; anchors.fill: parent; opacity: 0.5 }
+    }
+    Avatar {
+        id: profileIcon
+        height: parent.height
+        width: height
+        anchors { left: parent.left; verticalCenter: parent.verticalCenter; \
leftMargin: 12; topMargin: 6} +        visible: status == "Ok"
+        userId: {
+            print(" USER NAME: " + userName);
+            userName
+        }
+        //Rectangle { color: "green"; anchors.fill: parent; opacity: 0.5 }
+    }
+
+    PlasmaComponents.Label {
+        id: statusLabel
+        width: 300
+        height: 48
+        font.pointSize: theme.defaultFont.pointSize+3
+        anchors { left: busyIndicator.right; verticalCenter: \
busyIndicator.verticalCenter; leftMargin: 12; } +        //text: \
statusSource.data["Status:https://twitter.com/"]["Authorization"] +        //text: \
"Status:" + statusSource.data["Status:https://twitter.com/"]["Authorization"] +       \
text: status == "Busy" ? i18n("Logging in...") : status == "Ok" ? "@" + userName : \
""; +    }
+    PlasmaCore.DataSource {
+        id: statusSource
+        engine: "microblog"
+        interval: 0
+        onDataChanged: {
+            if (statusSource.data["Status:"+serviceUrl]) {
+                print(" status: " + statusSource.data);
+                //authStatusWidget.statusMessage = \
statusSource.data["Status:"+serviceUrl]["Authorization"] + ": " + \
statusSource.data["Status:"+serviceUrl]["AuthorizationMessage"] ; +                \
authStatusWidget.status = statusSource.data["Status:"+serviceUrl]["Authorization"] +  \
} else { +//                 authStatusWidget.statusMessage = "Unknown status"
+//                 authStatusWidget.status = "Idle"
+
+            }
+        }
+        Component.onCompleted: statusSource.connectSource("Status:"+serviceUrl);
+
+    }
+
+}
+
diff --git a/microblog/platformcontents/application/generic/ui/BasicComponents/PostingWidget.qml \
b/microblog/platformcontents/application/generic/ui/BasicComponents/PostingWidget.qml \
                index bfc0099..2041a6a 100644
--- a/microblog/platformcontents/application/generic/ui/BasicComponents/PostingWidget.qml
                
+++ b/microblog/platformcontents/application/generic/ui/BasicComponents/PostingWidget.qml
 @@ -23,6 +23,7 @@ import org.kde.plasma.components 0.1 as PlasmaComponents
 import org.kde.qtextracomponents 0.1 as QtExtraComponents
 
 import "plasmapackage:/code/logic.js" as Logic
+import "plasmapackage:/ui/BasicComponents"
 import "plasmapackage:/ui/ComplexComponents"
 
 Item {
@@ -38,24 +39,24 @@ Item {
         Logic.refresh()
         plasmoid.busy = true
     }
-    //Rectangle { anchors.fill: postWidget; color: "blue"; opacity: 0.3 }
+
+    AuthorizationWidget {
+        id: authStatusWidget
+        anchors { left: parent.left; right: postWidget.left; verticalCenter: \
postWidget.verticalCenter; } +        Rectangle { anchors.fill: postWidget; color: \
"blue"; opacity: 0.3 } +    }
 
     PlasmaCore.FrameSvgItem {
         id: postWidget
-        //width: 520
-        anchors.fill: parent
+        width: 400
+        anchors.top: parent.top
+        anchors.bottom: parent.bottom
         imagePath: "widgets/frame"
         prefix: "plain"
+        visible: authStatusWidget.status == "Ok"
         property alias textWidth: postTextEdit.width
+        anchors.horizontalCenter: parent.horizontalCenter
 
-        Avatar {
-            id: profileIcon
-            height: 32
-            width: height
-            anchors.left: postWidget.left
-            anchors.verticalCenter: postTextEdit.verticalCenter
-            userId: userName
-        }
 //         PlasmaComponents.Label {
 //             anchors.top: profileIcon.bottom
 //             text: userName
@@ -69,10 +70,11 @@ Item {
             //width: 300
 
             anchors {
-                left: profileIcon.right
-                right: postWidget.right
-                top: postWidget.top
-                bottom: postWidget.bottom
+//                 left: parent.right
+//                 right: postWidget.right
+//                 top: postWidget.top
+//                 bottom: postWidget.bottom
+                fill: parent;
                 rightMargin: postWidget.margins.right
                 leftMargin: 6
                 topMargin: postWidget.margins.top
@@ -146,13 +148,13 @@ Item {
             name: "active"
             PropertyChanges { target: topItem; height: 120 }
             PropertyChanges { target: pwItem; width: 384 }
-            PropertyChanges { target: profileIcon; height: 64 }
+            PropertyChanges { target: authStatusWidget; height: 64 }
         },
         State {
             name: "inactive"
             PropertyChanges { target: topItem; height: 64 }
             PropertyChanges { target: pwItem; width: 320 }
-            PropertyChanges { target: profileIcon; height: 32 }
+            PropertyChanges { target: authStatusWidget; height: 32 }
         }
     ]
 
@@ -163,13 +165,13 @@ Item {
             from: "inactive"; to: "active"
             PropertyAnimation { target: topItem; properties: "height"; duration: \
                animation_duration }
             PropertyAnimation { target: pwItem; properties: "width"; duration: \
                animation_duration }
-            PropertyAnimation { target: profileIcon; properties: "height"; duration: \
animation_duration } +            PropertyAnimation { target: authStatusWidget; \
properties: "height"; duration: animation_duration }  },
         Transition {
             from: "active"; to: "inactive"
             PropertyAnimation { target: topItem; properties: "height"; duration: \
                animation_duration }
             PropertyAnimation { target: pwItem; properties: "width"; duration: \
                animation_duration }
-            PropertyAnimation { target: profileIcon; properties: "height"; duration: \
animation_duration } +            PropertyAnimation { target: authStatusWidget; \
properties: "height"; duration: animation_duration }  }
     ]
     Component.onCompleted: {
diff --git a/microblog/platformcontents/application/generic/ui/BasicComponents/qmldir \
b/microblog/platformcontents/application/generic/ui/BasicComponents/qmldir index \
                5fe1aad..d0065e3 100644
--- a/microblog/platformcontents/application/generic/ui/BasicComponents/qmldir
+++ b/microblog/platformcontents/application/generic/ui/BasicComponents/qmldir
@@ -1,3 +1,4 @@
+AuthorizationWidget 1.0 AuthorizationWidget.qml
 MessageWidget 1.0 MessageWidget.qml
 PostingWidget 1.0 PostingWidget.qml
-ListItem 1.0 ListItem.qml
\ No newline at end of file
+ListItem 1.0 ListItem.qml
diff --git a/microblog/platformcontents/application/tablet/ui/MainWidget/AuthorizationWidget.qml \
b/microblog/platformcontents/application/tablet/ui/MainWidget/AuthorizationWidget.qml \
                index 4897a5d..0b83a04 100644
--- a/microblog/platformcontents/application/tablet/ui/MainWidget/AuthorizationWidget.qml
                
+++ b/microblog/platformcontents/application/tablet/ui/MainWidget/AuthorizationWidget.qml
 @@ -26,16 +26,64 @@ import org.kde.qtextracomponents 0.1 as QtExtraComponents
 import "plasmapackage:/ui/ComplexComponents"
 import "plasmapackage:/ui/BasicComponents"
 Item {
+    id: authStatusWidget
+    width: 800
+    height: 200
     property alias statusMessage: statusLabel.text
-    property string status;
+    property string status: "Idle";
+
+    width: childrenRect.width
+    height: childrenRect.height
+
+    PlasmaComponents.BusyIndicator {
+        id: busyIndicator
+        width: authStatusWidget.height, height: width
+//       width: 64; height: width;
+        //visible: status == "Busy"
+        anchors { left: parent.left; verticalCenter: parent.verticalCenter; \
leftMargin: 12; topMargin: 12} +        running: status == "Busy"
+        Rectangle { color: "green"; fill: parent; opacity: 0.5 }
+    }
+    Avatar {
+        id: profileIcon
+        height: 48
+        width: 48
+        anchors { left: parent.left; verticalCenter: parent.verticalCenter; \
leftMargin: 12; topMargin: 12} +        //visible: status == "Ok"
+        userId: {
+            print(" USER NAME: " + userName);
+            userName
+        }
+        Rectangle { color: "green"; fill: parent; opacity: 0.5 }
+    }
 
     PlasmaComponents.Label {
         id: statusLabel
         width: 300
         height: 48
+        anchors { left: busyIndicator.right; verticalCenter: \
                busyIndicator.verticalCenter; leftMargin: 12; }
         //text: statusSource.data["Status:https://twitter.com/"]["Authorization"]
         //text: "Status:" + \
                statusSource.data["Status:https://twitter.com/"]["Authorization"]
-        text: "Status..."
+        text: status == "Busy" ? "Logging in..." : status == "Ok" ? "<h2>@" + \
userName + "</h2>" : ""; +    }
+    PlasmaCore.DataSource {
+        id: statusSource
+        engine: "microblog"
+        interval: 0
+        onDataChanged: {
+            if (statusSource.data["Status:"+serviceUrl]) {
+                print(" status: " + statusSource.data);
+                //authStatusWidget.statusMessage = \
statusSource.data["Status:"+serviceUrl]["Authorization"] + ": " + \
statusSource.data["Status:"+serviceUrl]["AuthorizationMessage"] ; +                \
authStatusWidget.status = statusSource.data["Status:"+serviceUrl]["Authorization"] +  \
} else { +//                 authStatusWidget.statusMessage = "Unknown status"
+//                 authStatusWidget.status = "Idle"
+
+            }
+        }
+        Component.onCompleted: statusSource.connectSource("Status:"+serviceUrl);
+
     }
+    
 }
  
diff --git a/microblog/platformcontents/application/tablet/ui/MainWidget/MainWidget.qml \
b/microblog/platformcontents/application/tablet/ui/MainWidget/MainWidget.qml index \
                25c9b71..ec5815a 100644
--- a/microblog/platformcontents/application/tablet/ui/MainWidget/MainWidget.qml
+++ b/microblog/platformcontents/application/tablet/ui/MainWidget/MainWidget.qml
@@ -69,13 +69,15 @@ Image {
 
 
         }
+        
         PostingWidget {
             id: postingWidget
-            anchors.horizontalCenter: parent.horizontalCenter
-            anchors.top: topItem.top
-            anchors.bottom: topItem.bottom
-            //height: 200
-            width: 400
+//             anchors.horizontalCenter: parent.horizontalCenter
+//             anchors.top: topItem.top
+//             anchors.bottom: topItem.bottom
+//             //height: 200
+//             width: 400
+            anchors.fill: topItem
             anchors.topMargin: 8
             anchors.bottomMargin: 16
         }
diff --git a/microblog/platformcontents/application/tablet/ui/MainWidget/qmldir \
b/microblog/platformcontents/application/tablet/ui/MainWidget/qmldir index \
                092d2a9..4e3cf12 100644
--- a/microblog/platformcontents/application/tablet/ui/MainWidget/qmldir
+++ b/microblog/platformcontents/application/tablet/ui/MainWidget/qmldir
@@ -1,3 +1,3 @@
 MainWidget 1.0 MainWidget.qml
 MessageWidgetDetails 1.0 MessageWidgetDetails.qml
-AuthorizationWidget 1.0 AuthorizationWidget.qml
+//AuthorizationWidget 1.0 AuthorizationWidget.qml


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic