-
Notifications
You must be signed in to change notification settings - Fork 1
/
MicroBlogger.qml
232 lines (186 loc) · 6.81 KB
/
MicroBlogger.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
import QtQuick 2.9
import QtGraphicalEffects 1.0
import IO 1.0
import QtQuick.LocalStorage 2.0 as Sql
import "microblogger.js" as MicroBlog
Item {
id:thisWindow
anchors.fill:parent
clip:true
property int narrativeList: 0
property var remotelog:[]
property bool fupdate: false
/* Component.onCompleted:{ if(heart !== "Offline") {MicroBlog.retrieve_log(currentcard_thecard,usercardNum);}
// MicroBlog.show_log(currentcard_thecard);
if(currentcard_thecard != usercardNum) {
// remotelogGet.start();
} else {
MicroBlog.show_log(currentcard_thecard);
}
// MicroBlog.dump();
remotelogGet.start();
} */
onVisibleChanged: if(visible == true ) {
if(heart !== "Offline") { MicroBlog.retrieve_log(cardId,usercardNum);}
// MicroBlog.show_log(currentcard_thecard);
if(currentcard_thecard != usercardNum) {
// remotelogGet.start();
} else {
MicroBlog.show_log(cardId);
}
// MicroBlog.dump();
remotelogGet.start();
}
// onFocusChanged: if(focus ==true) {console.log("I have focus");}
Timer {
id:remotelogGet
interval: 1000
repeat: true
running: false
onTriggered: { if(heart !== "Offline") {MicroBlog.retrieve_log(cardId,usercardNum);}
// MicroBlog.show_log(currentcard_thecard);
if(currentcard_thecard != usercardNum) {
// remotelogGet.start();
} else {
MicroBlog.show_log(currentcard_thecard);
}
remotelogGet.interval = remotelogGet.interval * 2;
// MicroBlog.dump();
}
}
/* onFupdateChanged: if(fupdate == true) {
if(heart !== "Offline") {MicroBlog.retrieve_log(currentcard_thecard,usercardNum);}
// MicroBlog.show_log(currentcard_thecard);
if(currentcard_thecard != usercardNum) {
// remotelogGet.start();
} else {
MicroBlog.show_log(currentcard_thecard);
}
fupdate = false;
} */
Rectangle {
anchors.fill: parent
color:backgroundColor
}
Item {
visible: if(narrativeList > 1) {false} else {true}
//anchors.centerIn: parent
anchors.fill: parent
Image {
source:"./img/overlay.svg"
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenterOffset:-mainView.width * 0.02
anchors.verticalCenter: parent.verticalCenter
width: parent.width
fillMode: Image.PreserveAspectFit
opacity: 0.5
Text {
anchors.top: parent.bottom
anchors.topMargin: mainView.width * 0.02
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("No Micro Blog Entries")
color:fontColor
}
}
}
ListView {
id:statlistView
visible: if(narrativeList == 0) {false} else {true}
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom:parent.bottom
width:parent.width * 0.98
height:parent.height
spacing: mainView.width * 0.05
model:statlist
delegate: Item {
id:microBlogPost
width:parent.width
height:logContent.height + mainView.width * 0.1
Rectangle {
id:postbg
anchors.horizontalCenter: parent.horizontalCenter
width:parent.width * 0.98
height:parent.height
color: cardcolor
visible: false
}
DropShadow {
anchors.fill:postbg
horizontalOffset: 0
verticalOffset: 2
radius: 4.0
samples: 17
color: "#80000000"
source:postbg
}
Column {
id:logContent
anchors.centerIn: parent
width:parent.width * 0.98
spacing: mainView.width * 0.015
clip:true
padding:5
Item {
width: parent.width
height:mainView.width * 0.1
CirclePic {
id:pic
width: parent.height
height: parent.height
whichPic: card
where: listget
// thesource:imgsource
}
Text {
anchors.left: pic.right
anchors.verticalCenter: pic.verticalCenter
text:who
font.pixelSize: mainView.width * 0.06
color:fontColor
}
}
Text {
anchors.right:parent.right
text:if(compname !="") {"Company: "+compname} else {""}
font.pixelSize: mainView.width * 0.03
color:fontColor
}
Rectangle {
width: parent.width
height: mainView.width * 0.007
color:seperatorColor1
}
Text {
width: parent.width * 0.98
padding:mainView.width * 0.01
horizontalAlignment: Text.AlignJustify
wrapMode: Text.WordWrap
text:status
color:fontColor
}
Text {
width: parent.width * 0.98
anchors.rightMargin: mainView.width * 0.01
anchors.right: parent.right
horizontalAlignment: Text.AlignRight
text:date
color:"gray"
}
Rectangle {
width: parent.width
height: mainView.width * 0.007
color:seperatorColor1
}
Actions {
menu: 2
backingColor: cardcolor
width: parent.width
height: mainView.width * 0.1
}
}
}
}
ListModel {
id:statlist
}
}