Skip to content
This repository has been archived by the owner on Jan 2, 2018. It is now read-only.

Patch splashscreen #224

Open
wants to merge 9 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions src/client/UI/Contacts/js/contacts.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,24 +67,20 @@ function populateContacts(contacts)
console.log("Populating contacts of amount: "+contacts.length);

if(!initializationDone) {
splashPage.resetProgress()
splashPage.setProgressMax(contacts.length)
}

for(var i =0; i<contacts.length; i++)
{
//console.log("APPENDING CONTACT: " + contacts[i].jid + " - " + contacts[i].name)
//contacts[i].newContact = false;
contactsModel.append(contacts[i]);

if(!initializationDone){
splashPage.setSubOperation(contacts[i].jid)
splashPage.setProgress(i)
splashPage.setProgress(i+1)
breathe()
}
else if(i%4 == 0) {
breathe();
}
//console.log("APPENDING CONTACT: " + contacts[i].jid + " - " + contacts[i].name)
//contacts[i].newContact = false;
contactsModel.append(contacts[i]);

var cachedConv = conversations[contacts[i].jid];
if(cachedConv){
Expand Down
125 changes: 90 additions & 35 deletions src/client/UI/Misc/WASplash.qml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,36 +1,54 @@
// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
import QtQuick 1.1
import "../common"
import com.nokia.meego 1.0
WAPage {

property string operation:qsTr("Initializing")
property string subOperation:""
property string version
property int stage: 0
orientationLock: PageOrientation.LockPortrait
property int curProgress
property int maximumValue
property bool showSubProgress: true
property int position: 0

function setCurrentOperation(op) {
progress.visible = false
subOperation = ""
operation = qsTr(op)
subOperation = ""
operation = qsTr(op)
}

function nextStage() {
stage++
position=0
}

function setSubOperation(subop) {
subOperation = subop
}

function setProgressMax(val) {
progress.maximumValue = val
function setProgressMax(val) {
maximumValue = val
}

function step() {
if (position+1 <= maximumValue) {
position++
setProgress(position)
setOpacity(position)
}
}

function setProgress(val) {
progress.value = val
}
function setProgress(val) {
var part = 100/maximumValue
curProgress = parseInt(part*val /10)
progress.source = "images/" + stage + curProgress + "0.png"
}

function resetProgress() {
//progress.visible = true
progress.value = 0
}
function setOpacity(val) {
if (!theme.inverted)
blackbg.opacity = 1.0 - (1.0/maximumValue) * val
background.opacity = (myBackgroundOpacity/maximumValue/10.0) * val
}

onStatusChanged: {
/* if(status == PageStatus.Activating){
Expand All @@ -41,54 +59,91 @@ WAPage {
appWindow.showToolBar = true
}*/
}


Rectangle {
id: whitebg
anchors.fill: parent
color: "white"
}

Rectangle {
id: blackbg
anchors.fill: parent
color: "black"
opacity: 1.0

transitions: Transition {
NumberAnimation {
target: blackbg
property: "opacity"
from: blackbg.opacity
alwaysRunToEnd: true
duration: 7000
}
}
}

Image {
id: name
source: "../common/images/splash/wasplash90.png"
anchors.fill: parent
smooth: true

id: background
anchors.fill: parent
source: myBackgroundImage!="none" ? (WAConstants.CACHE_PATH+"/"+"background-portrait.jpg" + "?ran=" + Math.random()) : ""
fillMode: Image.PreserveAspectCrop
opacity: 0

transitions: Transition {
NumberAnimation {
target: background
property: "opacity"
from: background.opacity
alwaysRunToEnd: true
duration: 7000
}
}
}

Image {
id: progress
width: 180
height: 180
anchors.left: parent.left
anchors.top: parent.top
anchors.topMargin: 246
anchors.leftMargin: 150
source: "images/100.png"
}

Column{
id: textColumn
width:parent.width
spacing: 20
spacing: 20
y:450

Label{
text:operation
color: "white"
color: "gray"
horizontalAlignment: Text.AlignHCenter
font.bold: true
//font.bold: true
width:parent.width
}

ProgressBar{
id: progress
width: 360
visible:false
anchors.horizontalCenter: parent.horizontalCenter
minimumValue: 0
platformStyle: ProgressBarStyle {
knownTexture: "../common/images/splashprogress.png"
}
}

Label{
text:subOperation
color: "white"
horizontalAlignment: Text.AlignHCenter
width:parent.width
visible: showSubProgress
}
}

Label{
id: verlabel
text:version
width:parent.width
horizontalAlignment: Text.AlignHCenter
color:"white"
color:"#269f1a"
anchors.bottom: parent.bottom
anchors.bottomMargin: 20
opacity: 0.8
}

}
Binary file added src/client/UI/Misc/images/100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/client/UI/Misc/images/110.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/client/UI/Misc/images/1100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/client/UI/Misc/images/120.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/client/UI/Misc/images/130.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/client/UI/Misc/images/140.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/client/UI/Misc/images/150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/client/UI/Misc/images/160.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/client/UI/Misc/images/170.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/client/UI/Misc/images/180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/client/UI/Misc/images/190.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/client/UI/Misc/images/200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/client/UI/Misc/images/210.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/client/UI/Misc/images/2100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/client/UI/Misc/images/220.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/client/UI/Misc/images/230.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/client/UI/Misc/images/240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/client/UI/Misc/images/250.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/client/UI/Misc/images/260.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/client/UI/Misc/images/270.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/client/UI/Misc/images/280.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/client/UI/Misc/images/290.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/client/UI/common/images/splash/wasplash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 19 additions & 6 deletions src/client/UI/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,14 @@ WAStackWindow {
}

function setSplashOperation(op) {
splashPage.setCurrentOperation(op)
if (op=="contacts")
splashPage.setCurrentOperation("Loading Contacts")
else if (op=="convs")
splashPage.setCurrentOperation("Loading Conversations")
else if (op=="phone")
splashPage.setCurrentOperation("Loading Phone Contacts")

splashPage.nextStage()
}

function onInitDone(){
Expand Down Expand Up @@ -724,15 +731,17 @@ WAStackWindow {


/****Conversation related slots****/

function conversationsCount(max) {
if(!initializationDone)
splashPage.setProgressMax(max)
splashPage.step()
}

function conversationReady(conv){
//This should be called if and only if conversation start point is backend
consoleDebug("Got a conv in conversationReady slot: " + conv.jid);


if(!initializationDone)
splashPage.setSubOperation(conv.jid)

breathe()
var conversation = waChats.getOrCreateConversation(conv.jid);

Expand All @@ -759,7 +768,6 @@ WAStackWindow {
contact.setConversation(conversation);

}

}

signal reorderConversation(string cjid) //@@THIS IS FUCKING RETARDED!!!!!!!!
Expand Down Expand Up @@ -794,6 +802,10 @@ WAStackWindow {
if(messages.data.length == 1 && messages.data[0].type == 0)
onPaused(messages.jid)

if(!initializationDone) {
splashPage.setSubOperation(messages.jid)
splashPage.step()
}
}

function checkUnreadMessages() {
Expand Down Expand Up @@ -903,6 +915,7 @@ WAStackWindow {
WASplash{
id:splashPage
version:waversion
showSubProgress: false
}

AboutDialog{
Expand Down
3 changes: 3 additions & 0 deletions src/client/messagestore.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class MessageStore(QObject):
messageStatusUpdated = QtCore.Signal(str,int,int);
messagesReady = QtCore.Signal(dict,bool);
conversationReady = QtCore.Signal(dict);
conversationsCount = QtCore.Signal(int);
conversationExported = QtCore.Signal(str, str); #jid, exportePath
conversationMedia = QtCore.Signal(list);
conversationGroups = QtCore.Signal(list);
Expand Down Expand Up @@ -243,6 +244,8 @@ def loadConversations(self):

convList = sorted(convList, key=lambda k: k['lastdate']);
convList.reverse();

self.conversationsCount.emit(len(convList));

for ci in convList:
messages = []
Expand Down
11 changes: 6 additions & 5 deletions src/client/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ def initConnections(self,store):
self.messageStore = MessageStore(self.store);
self.messageStore.messagesReady.connect(self.rootObject().messagesReady)
self.messageStore.conversationReady.connect(self.rootObject().conversationReady)
self.messageStore.conversationsCount.connect(self.rootObject().conversationsCount)
self.rootObject().loadMessages.connect(self.messageStore.loadMessages);


Expand Down Expand Up @@ -294,12 +295,12 @@ def populateContacts(self, mode, status=""):
self.rootObject().updateContactStatus(status)

else:
if not self.initializationDone:
self.splashOperationUpdated.emit("Loading Contacts")

contacts = self.c.getContacts();
self._d("POPULATE CONTACTS: " + str(len(contacts)));

if not self.initializationDone:
self.splashOperationUpdated.emit("contacts")


contactsFiltered = filter(lambda c: c["jid"]!=self.accountJid, contacts)
self.rootObject().pushContacts(mode,contactsFiltered);
Expand All @@ -310,14 +311,14 @@ def populateContacts(self, mode, status=""):

def populateConversations(self):
if not self.initializationDone:
self.splashOperationUpdated.emit("Loading Conversations")
self.splashOperationUpdated.emit("convs")
self.messageStore.loadConversations()


def populatePhoneContacts(self):

if not self.initializationDone:
self.splashOperationUpdated.emit("Loading Phone Contacts")
self.splashOperationUpdated.emit("phone")

self._d("POPULATE PHONE CONTACTS");
contacts = self.c.getPhoneContacts();
Expand Down