v0.5.3 events and indentation

This commit is contained in:
LubuWest 2020-05-24 21:14:23 +02:00
commit 18c7255b91
103 changed files with 1601 additions and 1906 deletions

View file

@ -1,6 +1,6 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// Copyright (C) 2020 Marco R. <thomasschmidt45@gmx.net>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@ -31,7 +31,7 @@
import QtQuick 2.7
import QtQuick.Dialogs 1.2
import QtQuick.Controls 2.4
import QtQuick.Controls 2.12
import "qrc:/js/service.js" as Service
import "qrc:/js/layout.js" as Layoutjs
@ -61,6 +61,8 @@ Page{
x: mm
y: mm
width: root.width/2
visible: users.length>0
onClicked:{
var useritems="";
for (var i=0;i<accountPage.users.length;i++){
@ -73,11 +75,10 @@ Page{
username.text= obj.username;
password.text=Qt.atob(obj.password);
imagestore.text=obj.imagestore;
newsTypeField.text=obj.newsViewType;
if( obj.isActive==0){userButton.font.bold='true'} else {userButton.font.bold='false'}
},'username','"+ accountPage.users[i].username+"')}}"
}
var menuString="import QtQuick.Controls 2.4;import 'qrc:/js/service.js' as Service; Menu {"+useritems+"}";
var menuString="import QtQuick.Controls 2.12;import 'qrc:/js/service.js' as Service; Menu {"+useritems+"}";
var userlistObject=Qt.createQmlObject(menuString,accountPage,"usermenuOutput")
userlistObject.popup() }
}
@ -109,11 +110,11 @@ Page{
// font.pixelSize:3*mm
// x: 4*mm; y: 50*mm
// }
Text {
text: qsTr("News as")
font.pixelSize:3*mm
x: 4*mm; y: 50*mm
}
// Text {
// text: qsTr("News as")
// font.pixelSize:3*mm
// x: 4*mm; y: 50*mm
// }
// Text {
@ -173,7 +174,7 @@ Page{
Rectangle{
color: "light grey"
x: 4*mm; y: 23.5*mm; width: root.width-14*mm; height: 5*mm;
x: 4*mm; y: 23.5*mm; width: root.width-6*mm; height: 5*mm;
TextInput {
id: username
anchors.fill: parent
@ -186,14 +187,14 @@ Page{
}
}
}
Button {
x: root.width-9*mm; y: 23.5*mm; width:5*mm; height:5*mm
text: "\uf234"
font.pixelSize: 3*mm
onClicked: {
root.push("qrc:/qml/configqml/RegisterPage.qml",{url:servername.text+"/register?nickname="+username.getText(0,username.length)})
}
}
// Button {
// x: root.width-9*mm; y: 23.5*mm; width:5*mm; height:5*mm
// text: "\uf234"
// font.pixelSize: 3*mm
// onClicked: {
// root.push("qrc:/qml/configqml/RegisterPage.qml",{url:servername.text+"/register?nickname="+username.getText(0,username.length)})
// }
// }
Rectangle{
color: "light grey"
@ -261,20 +262,20 @@ Page{
// }
// }
Rectangle{
x: 4*mm; y: 53.5*mm; width: newsTypeField.contentWidth+2*mm; height: 5*mm;
color:"light grey"
Text{
id: newsTypeField
anchors.fill: parent
font.pixelSize:3*mm
text:"Conversations"
}
MouseArea{
anchors.fill:parent
onClicked:newstypemenu.popup()
}
}
// Rectangle{
// x: 4*mm; y: 53.5*mm; width: newsTypeField.contentWidth+2*mm; height: 5*mm;
// color:"light grey"
// Text{
// id: newsTypeField
// anchors.fill: parent
// font.pixelSize:3*mm
// text:"Conversations"
// }
// MouseArea{
// anchors.fill:parent
// onClicked:newstypemenu.popup()
// }
// }
BusyIndicator{
id: accountBusy
@ -306,7 +307,7 @@ Page{
font.pixelSize: 3*mm
onClicked:{
accountBusy.running=true;
var userconfig={server: servername.text, username: username.text, password:Qt.btoa(password.text), imagestore:imagestore.text, maxnews:"",interval: "",newsViewType:newsTypeField.text};
var userconfig={server: servername.text, username: username.text, password:Qt.btoa(password.text), imagestore:imagestore.text, maxnews:"",interval: ""};
var errormessage="";
if (servername.text==""){errormessage=qsTr("No server given! ")}
else if (username.text==""){errormessage+=qsTr("No nickname given! ")}
@ -322,6 +323,7 @@ Page{
Helperjs.showMessage(qsTr("Error"),qsTr("Wrong password!"),root)
}
else{
if (users.length==0){Service.setDefaultOptions(db);}
filesystem.Directory=userconfig.imagestore;
filesystem.makeDir("contacts");
filesystem.makeDir("albums");
@ -352,6 +354,7 @@ Page{
Button {
x: parent.width/2+2*mm; y: mm; width: 5*mm; height: 8*mm;
visible: users.length>0
text: "-"
font.pixelSize: 3*mm
onClicked:{
@ -368,7 +371,7 @@ Page{
password.text="";
imagestore.text="";
//maxNews.value=0;
newsTypeField.text="Conversations";
//newsTypeField.text="Conversations";
//messageIntervalSlider.value=30;
userButton.text=qsTr("User");
Helperjs.readData(db,"config","",function(storedUsers){
@ -381,6 +384,7 @@ Page{
Button {
x: parent.width/2+8*mm; y: mm; width: 5*mm; height: 8*mm;
visible: users.length>0
text: "+"
font.pixelSize: 3*mm
onClicked:{
@ -391,7 +395,7 @@ Page{
password.text=""
imagestore.text=""
//maxNews.value=0
newsTypeField.text="Conversations"
//newsTypeField.text="Conversations"
//messageIntervalSlider.value=30
userButton.text=qsTr("User")
}
@ -409,6 +413,7 @@ Page{
id:closeButton
height: 8*mm
width: 5*mm
visible: users.length>0
anchors.top: parent.top
anchors.topMargin: 1*mm
anchors.right: parent.right
@ -417,19 +422,19 @@ Page{
font.pixelSize: 3*mm
onClicked:{root.pop()}
}
Menu {
id:newstypemenu
MenuItem {
font.pixelSize: 3*mm
text: qsTr("Timeline")
onTriggered: {newsTypeField.text="Timeline"}
}
MenuItem {
font.pixelSize: 3*mm
text: qsTr("Conversations")
onTriggered: {newsTypeField.text="Conversations"}
}
}
// Menu {
// id:newstypemenu
// MenuItem {
// font.pixelSize: 3*mm
// text: qsTr("Timeline")
// onTriggered: {newsTypeField.text="Timeline"}
// }
// MenuItem {
// font.pixelSize: 3*mm
// text: qsTr("Conversations")
// onTriggered: {newsTypeField.text="Conversations"}
// }
// }
Component.onCompleted: {
try{Helperjs.readData(db,"config","",function(storedUsers){
@ -445,12 +450,12 @@ Page{
password.text=Qt.atob(obj.password);
imagestore.text=obj.imagestore;
//maxNews.value=obj.maxnews;
newsTypeField.text=obj.newsViewType;
//newsTypeField.text=obj.newsViewType;
//messageIntervalSlider.value=obj.timerInterval;
if( obj.isActive==0){userButton.font.bold='true'} else {userButton.font.bold='false'}
},"isActive",0)
})}
catch (e){print(e)
catch (e){//print("onCompleted" +users.count +e)
// Helperjs.friendicaWebRequest("https://dir.friendica.social/servers/surprise",accountPage,function(html){
// print(html);
// var bpos=html.indexOf("base ");