This commit is contained in:
LubuWest 2020-01-27 21:53:51 +01:00
commit c1bdcbf963
48 changed files with 1333 additions and 1229 deletions

View file

@ -105,10 +105,11 @@ StackView{
FontLoader{id: fontAwesome; source: "qrc:/images/fontawesome-webfont.ttf"}
Keys.onReleased: {
Keys.onReleased: {print("Backkey"+newstab.conversation.length+" "+root.depth)
if (event.key === osSettings.backKey) {
if (currentIndex==0){
if (rootstack.currentIndex==0){
newstab.active=true;
print(newstab.newstabstatus)
if (newstab.newstabstatus!=login.newsViewType){
newstab.newstabstatus=login.newsViewType;
if(login.newsViewType=="Timeline"){Newsjs.newsfromdb(db,login.username,0,function(dbnews){
@ -118,7 +119,9 @@ StackView{
Newsjs.chatsfromdb(db,login.username,function(dbnews){
newsSignal(dbnews)
})}
print(newstab.conversation.length);
}
else if (newstab.conversation.length>0){newstab.conversation=[]}
else if (root.depth>1){root.pop()}
else{Service.cleanNews(root.db,function(){
@ -126,8 +129,8 @@ StackView{
Qt.quit()})
})}
}
else if (currentIndex==2){fotoSignal("backButton")}
else {currentIndex=0}
else if (rootstack.currentIndex==2){fotoSignal("backButton")}
else {rootstack.currentIndex=0}
event.accepted = true
}}
@ -160,10 +163,10 @@ StackView{
anchors.fill: parent
onClicked:{
leftDrawer.close();
newstypeSignal("refresh")
// updatenews.setDatabase();
// updatenews.login();
// updatenews.startsync();
// newstypeSignal("refresh")
updatenews.setDatabase();
updatenews.login();
updatenews.startsync();
}
}
}
@ -307,6 +310,8 @@ StackView{
Item{
id:rootStackItem
width:parent.width
height: parent.height
//anchors.fill:parent
states: State {
name: "fullscreen";
@ -389,6 +394,7 @@ StackView{
}
Component.onCompleted: {
forceActiveFocus();
Service.readGlobaloptions(db,function(go){globaloptions=go})
//print(xhr.networktype());
if(osSettings.osType=="Android"){