version v0.6

This commit is contained in:
LubuWest 2021-05-12 21:41:34 +02:00
commit 8482bde3ed
86 changed files with 7064 additions and 3208 deletions

View file

@ -32,7 +32,7 @@
import QtQuick 2.7
import QtQuick.Dialogs 1.2
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import "qrc:/js/service.js" as Service
import "qrc:/js/layout.js" as Layoutjs
import "qrc:/js/helper.js" as Helperjs
@ -55,22 +55,21 @@ Page{
servericon.source=serverdata.site.logo})} catch(e){print(e)}
}
Button{
MButton{
id:userButton
height: 8*mm
text:qsTr("User")
//font.pixelSize: 3*mm
font.pointSize: 16
x: mm
y: mm
width: root.width/2
font.pointSize: osSettings.bigFontSize
x: root.fontFactor*osSettings.bigFontSize
y: root.fontFactor*osSettings.bigFontSize
width: root.width/2 - 2*mm
height: 2*root.fontFactor*osSettings.bigFontSize
visible: users.length>0
onClicked:{
var useritems="";
for (var i=0;i<accountPage.users.length;i++){
useritems=useritems+"MenuItem{font.pixelSize: 3*mm;width:accountPage.width*2/3; text:'"+accountPage.users[i].username+
useritems=useritems+"MenuItem{font.pointSize: osSettings.bigFontSize;width:accountPage.width*2/3; text:'"+accountPage.users[i].username+
"'; onTriggered: {Service.readConfig(db,function(obj){
userButton.text=obj.username;
servername.text=obj.server;
@ -82,43 +81,17 @@ Page{
if( obj.isActive==0){userButton.font.bold='true'} else {userButton.font.bold='false'}
},'username','"+ accountPage.users[i].username+"')}}"
}
var menuString="import QtQuick.Controls 2.12;import 'qrc:/js/service.js' as Service; Menu {"+useritems+"}";
var menuString="import QtQuick.Controls 2.12;import 'qrc:/js/service.js' as Service;"+
" Menu {width:8*root.fontFactor*osSettings.bigFontSize;"+useritems+"}";
var userlistObject=Qt.createQmlObject(menuString,accountPage,"usermenuOutput")
userlistObject.popup() }
}
Text {
text: qsTr("Server")
//font.pixelSize:3*mm
font.pointSize: 16
x: 4*mm; y: 10*mm
}
Text {
text: qsTr("Nickname")
//font.pixelSize:3*mm
font.pointSize: 16
x: 4*mm; y: 20*mm
}
Text {
text: qsTr("Password")
//font.pixelSize:3*mm
font.pointSize: 16
x: 4*mm; y: 30*mm
}
Text {
id: imagedirlabel
visible: imagestore.text!=""
text: qsTr("Image dir.")
//font.pixelSize:3*mm
font.pointSize: 16
x: 4*mm; y: 40*mm
}
Image{
id:servericon
x:4*mm;y:13.5*mm
width:5*mm; height: 5*mm
x:root.fontFactor*osSettings.bigFontSize;y:3*root.fontFactor*osSettings.bigFontSize
width:2.5*root.fontFactor*osSettings.bigFontSize; height: 2.5*root.fontFactor*osSettings.bigFontSize
visible: false
source:""
MouseArea{
@ -129,102 +102,87 @@ Page{
}
}
}
Button{
FontLoader{id: fontAwesome; source: "qrc:/images/fontawesome-webfont.ttf"}
MButton{
id:serverSearchButton
text:"\uf002"
font.pixelSize: 3*mm
font.pointSize: 16
x:4*mm
y:13.5*mm
width: 5*mm; height:5*mm
icon.name: "search"
font.pointSize: osSettings.bigFontSize
x:root.fontFactor*osSettings.bigFontSize
y:3*root.fontFactor*osSettings.bigFontSize
width: 2*root.fontFactor*osSettings.bigFontSize; height:2*root.fontFactor*osSettings.bigFontSize
visible: servericon.visible?false:true
onClicked:{Qt.openUrlExternally(Qt.resolvedUrl("https://dir.friendica.social/servers"))}
}
Rectangle{color: "light grey"; x: 10*mm; y: 13.5*mm; width: root.width-12*mm; height: 5*mm;}
Flickable {
id: servernameFlickable
x: 10*mm; y: 13.5*mm; width: root.width-12*mm; height: 5*mm;
contentWidth: servername.paintedWidth
contentHeight: servername.paintedHeight
clip: true
TextEdit {
id: servername
width: servernameFlickable.width
height: servernameFlickable.height
focus: true
//font.pixelSize:3*mm
font.pointSize: 16
text:"https://"
onEditingFinished:{
if((servername.text).substring(0,11) =="https://http"){
serverstring.text= (serverstring.text).substring(8)
}
accountPage.setServericon(servername.text)
}
onCursorRectangleChanged: Layoutjs.ensureVisibility(cursorRectangle,servernameFlickable)
}
}
Rectangle{
color: "light grey"
x: 4*mm; y: 23.5*mm; width: root.width-6*mm; height: 5*mm;
TextInput {
id: username
anchors.fill: parent
//font.pixelSize:3*mm
font.pointSize: 16
selectByMouse: true
onEditingFinished:{
if (username.text.indexOf('@')>-1){
Helperjs.showMessage(qsTr("Error"),qsTr("Nicknames containing @ symbol currently not supported"),accountPage)
TextField {
id: servername
x: 4*root.fontFactor*osSettings.bigFontSize; y: 4*root.fontFactor*osSettings.bigFontSize; width: root.width-18*mm; //height: 5*mm;
placeholderText: qsTr("Server")
font.pointSize: osSettings.systemFontSize
onEditingFinished: {
if ((servername.text)==""){}
else if((servername.text).substring(0,7) !=="https://"){
servername.text= "https://"+text//(serverstring.text).substring(8)
}
imagestoredir=filesystem.homePath+"/"+username.text+"/"
//if (imagestore.text==filesystem.homePath+"/.friendiqa/"){imagestore.text=filesystem.homePath+"/.friendiqa/"+username.text+"/"}
}
}
accountPage.setServericon(servername.text)}
}
// 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"
x: 4*mm; y: 33.5*mm; width: root.width-6*mm; height: 5*mm;
TextInput {
id: password
anchors.fill: parent
//font.pixelSize:3*mm
font.pointSize: 16
selectByMouse: true
echoMode: TextInput.PasswordEchoOnEdit
TextField {
id: username
x: root.fontFactor*osSettings.bigFontSize; y: 6*root.fontFactor*osSettings.bigFontSize; width: root.width-9*mm; //height: 5*mm;
font.pointSize: osSettings.systemFontSize
placeholderText: qsTr("Nickname")
selectByMouse: true
onEditingFinished: {
if (username.text.indexOf('@')>-1){
Helperjs.showMessage(qsTr("Error"),qsTr("Nicknames containing @ symbol currently not supported"),accountPage)
}
imagestoredir=filesystem.homePath+"/"+username.text+"/"
//if (imagestore.text==filesystem.homePath+"/.friendiqa/"){imagestore.text=filesystem.homePath+"/.friendiqa/"+username.text+"/"}
}
}
TextField {
id: password
x: root.fontFactor*osSettings.bigFontSize; y: 9*root.fontFactor*osSettings.bigFontSize; width: root.width-9*mm; //height: 5*mm;
//font.pixelSize:3*mm
font.pointSize: osSettings.systemFontSize
selectByMouse: true
echoMode: TextInput.Password
placeholderText: qsTr("Password")
inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText | Qt.ImhSensitiveData
}
Text {
id: imagedirlabel
visible: imagestore.text!=""
text: qsTr("Image dir.")
font.pointSize: osSettings.systemFontSize
x: root.fontFactor*osSettings.bigFontSize; y: 12*root.fontFactor*osSettings.bigFontSize
}
TextField {
id: imagestore
x: root.fontFactor*osSettings.bigFontSize; y: 13*root.fontFactor*osSettings.bigFontSize; width: root.width-17*mm; //height: 5*mm;
visible:imagestore.text!=""
font.pointSize: osSettings.systemFontSize
selectByMouse: true
text: "" //filesystem.homePath+"/.friendiqa/"+username.text+"/" //(osSettings.osType=="Android") && (filesystem.fileexist("/storage/emulated/0/Pictures/"))?"/storage/emulated/0/Pictures/":""
wrapMode: TextEdit.NoWrap
onTextChanged: imagestoredir=imagestore.text
}
MButton {
x: root.width-3*root.fontFactor*osSettings.bigFontSize; y: 13*root.fontFactor*osSettings.bigFontSize;
height: 2*root.fontFactor*osSettings.bigFontSize;
visible:imagestore.text!=""
text: "..."
font.pointSize: osSettings.bigFontSize
onClicked:{imagestoreDialog.open()}
}
Rectangle{color: "light grey"; x: 4*mm; y: 43.5*mm; width: root.width-14*mm; height: 5*mm;visible:imagestore.text!=""}
Flickable {
id: imagestoreFlickable
visible:imagestore.text!="" //filesystem.homePath+"/"+username.text+"/""
x: 4*mm; y: 43.5*mm; width: root.width-14*mm; height: 5*mm;
clip: true
TextInput {
id: imagestore
width: imagestoreFlickable.width
height: imagestoreFlickable.height
//font.pixelSize:3*mm
font.pointSize: 16
text: "" //filesystem.homePath+"/.friendiqa/"+username.text+"/" //(osSettings.osType=="Android") && (filesystem.fileexist("/storage/emulated/0/Pictures/"))?"/storage/emulated/0/Pictures/":""
wrapMode: TextEdit.NoWrap
onCursorRectangleChanged: Layoutjs.ensureVisibility(cursorRectangle,imagestoreFlickable)
onTextChanged: imagestoredir=imagestore.text
}
}
FileDialog {
id: imagestoreDialog
@ -238,76 +196,66 @@ Page{
}
}
Button {
x: root.width-9*mm; y: 43.5*mm; width: 5*mm; height: 5*mm;
visible:imagestore.text!=""
text: "..."
//font.pixelSize: 3*mm
font.pointSize: 16
onClicked:{imagestoreDialog.open()}
}
BusyIndicator{
id: accountBusy
anchors.horizontalCenter: parent.horizontalCenter
y: 53.5*mm
y: 16*root.fontFactor*osSettings.bigFontSize
width:10*mm
height: 10*mm
running: false
}
Button {
x: 4*mm; y: 53.5*mm
height: 8*mm
MButton {
x: root.fontFactor*osSettings.bigFontSize; y: 16*root.fontFactor*osSettings.bigFontSize
text: qsTr("Confirm")
//font.pixelSize: 3*mm
font.pointSize: 16
font.pointSize: osSettings.bigFontSize
onClicked:{
accountBusy.running=true;
var userconfig={server: servername.text, username: username.text, password:Qt.btoa(password.text), imagestore:imagestoredir, maxnews:"",interval: ""};
var errormessage="";
if (servername.text==""){errormessage=qsTr("No server given! ")}
else if (username.text==""){errormessage+=qsTr("No nickname given! ")}
else if (password.text=="") {errormessage+=qsTr("No password given! ")}
else if (imagestoredir=="") {errormessage+=qsTr("No image directory given!")}
//else if (imagestore.text=="") {errormessage+=qsTr("No image directory given!")}
var userconfig={server: servername.text, username: username.text, password:Qt.btoa(password.text), imagestore:imagestoredir, maxnews:"",interval: ""};
var errormessage="";
if (servername.text==""){errormessage=qsTr("No server given! ")}
else if (username.text==""){errormessage+=qsTr("No nickname given! ")}
else if (password.text=="") {errormessage+=qsTr("No password given! ")}
else if (imagestoredir=="") {errormessage+=qsTr("No image directory given!")}
//else if (imagestore.text=="") {errormessage+=qsTr("No image directory given!")}
//else if (maxNewsText.text=="") {errormessage+=qsTr("No maximum news number given!")}
else {errormessage=""}
if (errormessage=="") {
Helperjs.friendicaRequest(userconfig,"/api/account/verify_credentials?skip_status=true",root,function(obj){
else {errormessage=""}
if (errormessage=="") {
Helperjs.friendicaRequest(userconfig,"/api/account/verify_credentials?skip_status=true",root,function(obj){
accountBusy.running=false;
var credentials=JSON.parse(obj);
if (credentials.hasOwnProperty('status')){
Helperjs.showMessage(qsTr("Error"),qsTr("Wrong password!"),root)
}
else{
if (users.length==0){Service.setDefaultOptions(db);}
print("imagestore" + userconfig.imagestore + " path "+ filesystem.homePath+"/"+username.text)
if(userconfig.imagestore == filesystem.homePath+"/"+username.text+"/")
{//filesystem.Directory=filesystem.homePath;
filesystem.makePath(filesystem.homePath+"/"+username.text);
}
filesystem.Directory=imagestoredir //userconfig.imagestore;
filesystem.makeDir("contacts");
filesystem.makeDir("albums");
Service.storeConfig(db,userconfig);
Service.readConfig(db,function(userconfig){
Helperjs.readData(db,"config","",function(storedUsers){
storedUsers.sort(function(obj1, obj2) {
return obj1.isActive - obj2.isActive;
});
accountPage.users=storedUsers});
var credentials=JSON.parse(obj);
if (credentials.hasOwnProperty('status')){
Helperjs.showMessage(qsTr("Error"),qsTr("Wrong password!"),root)
}
else{
if (users.length==0){Service.setDefaultOptions(db);}
//print("imagestore" + userconfig.imagestore + " path "+ filesystem.homePath+"/"+username.text)
if(userconfig.imagestore == filesystem.homePath+"/"+username.text+"/")
{//filesystem.Directory=filesystem.homePath;
filesystem.makePath(filesystem.homePath+"/"+username.text);
}
filesystem.Directory=imagestoredir //userconfig.imagestore;
filesystem.makeDir("contacts");
filesystem.makeDir("albums");
Service.storeConfig(db,userconfig);
Service.readConfig(db,function(userconfig){
Helperjs.readData(db,"config","",function(storedUsers){
storedUsers.sort(function(obj1, obj2) {
return obj1.isActive - obj2.isActive;
});
accountPage.users=storedUsers});
//reset values
root.login=userconfig;
root.news=[];
rootstack.currentIndex=0;
root.newstypeSignal("refresh");
},"isActive",0);
login=userconfig;
news=[];
rootstack.currentIndex=0;
newstypeSignal("refresh");
},"isActive",0);
//Service.requestProfile(userconfig,db,root,function(nc){root.newContacts=nc});
Helperjs.showMessage(qsTr("Success"),qsTr("Name")+": "+credentials.name+"\nScreen Name: "+credentials.screen_name,root)
rootstackView.pop()
}
});
@ -316,79 +264,82 @@ 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
font.pointSize: 16
onClicked:{
var userconfig={server: servername.text, username: username.text, password: Qt.btoa(password.text)};
Service.deleteConfig(db,userconfig,function(){
filesystem.Directory=imagestore.text+"contacts";
filesystem.rmDir();
filesystem.Directory=imagestore.text+"albums";
filesystem.rmDir();
servername.text="https://";
servericon.visible=false;
servericon.source="";
username.text="";
password.text="";
imagestore.text="";
//maxNews.value=0;
//newsTypeField.text="Conversations";
//messageIntervalSlider.value=30;
userButton.text=qsTr("User");
Helperjs.readData(db,"config","",function(storedUsers){
storedUsers.sort(function(obj1, obj2) {
return obj1.isActive - obj2.isActive;
})
accountPage.users=storedUsers;})
})
}}
Button {
x: parent.width/2+8*mm; y: mm; width: 5*mm; height: 8*mm;
visible: users.length>0
text: "+"
//font.pixelSize: 3*mm
font.pointSize: 16
onClicked:{
servername.text="https://"
servericon.visible=false;
servericon.source="";
username.text=""
password.text=""
imagestore.text="" //filesystem.homePath+"/.friendiqa/"+username.text//""
userButton.text=qsTr("User")
}
}
Button {
x: parent.width/2+14*mm; y: mm; width: 5*mm; height: 8*mm;
text: "?"
//font.pixelSize: 3*mm
font.pointSize: 16
onClicked:{
root.push("qrc:/qml/configqml/InfoBox.qml");
}
}
Button{
id:closeButton
height: 8*mm
width: 5*mm
visible: users.length>0
Row{
spacing:0.5*mm
anchors.top: parent.top
anchors.topMargin: 1*mm
anchors.topMargin: root.fontFactor*osSettings.bigFontSize
anchors.right: parent.right
anchors.rightMargin: 1*mm
text: "\uf057"
//font.pixelSize: 3*mm
font.pointSize: 16
onClicked:{root.pop()}
}
MButton {
//x: parent.width/2+4*mm; y: mm;
width: 5*mm;
//height: 3*root.fontFactor*osSettings.bigFontSize
visible: users.length>0
text: "-"
font.pointSize: osSettings.bigFontSize
onClicked:{
var userconfig={server: servername.text, username: username.text, password: Qt.btoa(password.text)};
Service.deleteConfig(db,userconfig,function(){
filesystem.Directory=imagestore.text+"contacts";
filesystem.rmDir();
filesystem.Directory=imagestore.text+"albums";
filesystem.rmDir();
servername.text="https://";
servericon.visible=false;
servericon.source="";
username.text="";
password.text="";
imagestore.text="";
//maxNews.value=0;
//newsTypeField.text="Conversations";
//messageIntervalSlider.value=30;
userButton.text=qsTr("User");
Helperjs.readData(db,"config","",function(storedUsers){
storedUsers.sort(function(obj1, obj2) {
return obj1.isActive - obj2.isActive;
})
accountPage.users=storedUsers;})
})
}}
MButton {
//x: parent.width/2+10*mm; y: mm; //width: 5*mm; height: 8*mm;
//height: 3*root.fontFactor*osSettings.bigFontSize
width: 5*mm;
visible: users.length>0
text: "+"
font.pointSize: osSettings.bigFontSize
onClicked:{
servername.text="https://"
servericon.visible=false;
servericon.source="";
username.text=""
password.text=""
imagestore.text="" //filesystem.homePath+"/.friendiqa/"+username.text//""
userButton.text=qsTr("User")
}
}
MButton {
//x: parent.width-12*mm; y: mm; //width: 5*mm; height: 8*mm;
//height: 3*root.fontFactor*osSettings.bigFontSize
width: 5*mm;
text: "?"
font.pointSize: osSettings.bigFontSize
onClicked:{
rootstackView.push("qrc:/qml/configqml/InfoBox.qml");
}
}
MButton{
id:closeButton
//height: 3*root.fontFactor*osSettings.bigFontSize
width: 5*mm;
visible: users.length>0
text: "\uf057"
font.pointSize: osSettings.bigFontSize
onClicked:{rootstackView.pop()}
}
}
Component.onCompleted: {
try{Helperjs.readData(db,"config","",function(storedUsers){

View file

@ -38,40 +38,42 @@ import "qrc:/qml/configqml"
import "qrc:/qml/genericqml"
Page{
//anchors.fill: parent
//anchors.fill: parent
width:root.width
height:root.height
Rectangle{
x: 4*mm; y:13.5*mm; width: parent.width - 14*mm; height: 5*mm;
color:"light grey"
x: root.fontFactor*osSettings.bigFontSize; y:4*root.fontFactor*osSettings.bigFontSize;
width: parent.width - 6*root.fontFactor*osSettings.bigFontSize; height: 2*root.fontFactor*osSettings.bigFontSize
color:"#F3F3F3"
radius: 0.5*mm
Text{
anchors.fill: parent
font.pixelSize:3*mm
font.pointSize: osSettings.bigFontSize
text:qsTr("Sync")
}
MouseArea{
anchors.fill:parent
onClicked:root.push("qrc:qml/configqml/SyncConfig.qml");
onClicked:rootstackView.push("qrc:qml/configqml/SyncConfig.qml");
}
}
Text {
text: qsTr("News as")
font.pixelSize:3*mm
x: 4*mm; y: 20*mm
font.pointSize:osSettings.systemFontSize
x: root.fontFactor*osSettings.bigFontSize; y: 8*root.fontFactor*osSettings.bigFontSize
}
Rectangle{
x: 4*mm; y: 23.5*mm; width: newsTypeField.contentWidth+2*mm; height: 5*mm;
color:"light grey"
radius: 0.5*mm
Text{
id: newsTypeField
anchors.fill: parent
font.pixelSize:3*mm
text:qsTr("Conversations")
x: root.fontFactor*osSettings.bigFontSize; y: 10*root.fontFactor*osSettings.bigFontSize;
width: newsTypeField.contentWidth+2*mm; height: 2*root.fontFactor*osSettings.bigFontSize
color:"#F3F3F3"
radius: 0.5*mm
Text{
id: newsTypeField
anchors.fill: parent
font.pointSize:osSettings.bigFontSize
text:qsTr("Conversations")
}
MouseArea{
anchors.fill:parent
@ -80,38 +82,43 @@ Page{
}
Menu {
id:newstypemenu
width:8*root.fontFactor*osSettings.bigFontSize
MenuItem {
font.pixelSize: 3*mm
font.pointSize: osSettings.bigFontSize
text: qsTr("Timeline")
onTriggered: {newsTypeField.text=qsTr("Timeline");
Service.updateglobaloptions(root.db,"newsViewType","Timeline");}
}
}
MenuItem {
font.pixelSize: 3*mm
font.pointSize: osSettings.bigFontSize
text: qsTr("Conversations")
onTriggered: {newsTypeField.text=qsTr("Conversations");
Service.updateglobaloptions(root.db,"newsViewType","Conversations");}
}
}
}
Text {
text: qsTr("Max. News")
font.pixelSize:3*mm
x: 4*mm; y:30*mm
font.pointSize: osSettings.systemFontSize
x: root.fontFactor*osSettings.bigFontSize; y:14*root.fontFactor*osSettings.bigFontSize
}
Slider{ id: maxNews
x:19*mm; y: 33.5*mm;width: root.width/2;height:5*mm
x:6*root.fontFactor*osSettings.bigFontSize; y: 16*root.fontFactor*osSettings.bigFontSize;
width: root.width/2;height:2*root.fontFactor*osSettings.bigFontSize
from: 0;to:2000; stepSize: 100
value: root.globaloptions.hasOwnProperty("max_news")?root.globaloptions.max_news:1000
}
Rectangle{color: "light grey"; x: 4*mm; y: 33.5*mm; width: 9*mm; height: 5*mm;
Rectangle{
color: "#F3F3F3";
x: root.fontFactor*osSettings.bigFontSize; y: 16*root.fontFactor*osSettings.bigFontSize;
width: 4*root.fontFactor*osSettings.bigFontSize; height: 2*root.fontFactor*osSettings.bigFontSize;
radius: 0.5*mm
TextEdit{id:maxNewsText;
anchors.fill: parent
font.pixelSize:3*mm
font.pointSize: osSettings.bigFontSize
verticalAlignment:TextEdit.AlignRight
text:maxNews.value
selectByMouse: true
@ -125,10 +132,9 @@ Page{
CheckBox{
id: nsfwCheckbox
x: 4*mm
y: 43.5*mm
font.pixelSize: 3*mm
//width:5*mm
x: root.fontFactor*osSettings.bigFontSize
y: 20*root.fontFactor*osSettings.bigFontSize
font.pointSize: osSettings.bigFontSize
text: qsTr("Hide #nsfw?")
checked:(globaloptions["hide_nsfw"]==1)?true:false
onClicked: {
@ -146,24 +152,24 @@ Page{
MButton {
anchors.right: closeButton.left; anchors.rightMargin: mm;
anchors.top: parent.top
anchors.topMargin: 1*mm
width: 8*mm; height: 6*mm;
anchors.topMargin:root.fontFactor*osSettings.bigFontSize
width: 2*root.fontFactor*osSettings.bigFontSize;
text: "?"
font.pixelSize: 3*mm
font.pointSize: osSettings.bigFontSize
onClicked:{
root.push("qrc:/qml/configqml/InfoBox.qml");
}
}
rootstackView.push("qrc:/qml/configqml/InfoBox.qml");
}
}
MButton{
id:closeButton
height: 6*mm
width :8*mm
anchors.top: parent.top
anchors.topMargin: 1*mm
anchors.right: parent.right
anchors.rightMargin: 1*mm
text: "\uf057"
font.pixelSize: 3*mm
onClicked:{root.pop()}
id:closeButton
// height: 2*root.fontFactor*osSettings.bigFontSize
width: 2*root.fontFactor*osSettings.bigFontSize;
anchors.top: parent.top
anchors.topMargin:root.fontFactor*osSettings.bigFontSize
anchors.right: parent.right
anchors.rightMargin: 1*mm
text: "\uf057"
font.pointSize: osSettings.bigFontSize
onClicked:{rootstackView.pop()}
}
}

View file

@ -33,39 +33,38 @@ import QtQuick 2.0
import QtQuick.Controls 2.12
import "qrc:/qml/genericqml"
Rectangle{
color:"white"
width:infoBoxText.contentWidth
height:infoBoxText.contentHeight
Page{
//color:"white"
// width:infoBoxText.contentWidth
// height:infoBoxText.contentHeight
Text{id:infoBoxText
anchors.top:closeButton.bottom
anchors.topMargin: mm
textFormat: Text.RichText
width: root.width-mm
font.pointSize: osSettings.systemFontSize
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
text: "<b>Friendiqa v0.5.4 </b><br>Licensed under GPL 3 with the exception of OpenSSL <br> "+
text: "<b>Friendiqa v0.6 </b><br>Licensed under GPL 3 with the exception of OpenSSL <br> "+
"Website <a href='https://friendiqa.ma-nic.de'>https://friendiqa.ma-nic.de</a><br>"+
"Sourcecode: <a href='https://git.friendi.ca/LubuWest/Friendiqa'>https://git.friendi.ca/LubuWest/Friendiqa</a><br>"+
"Privacy Policy: <a href='https://git.friendi.ca/lubuwest/Friendiqa/src/branch/master/PrivacyPolicy.md'>http://git.friendi.ca/lubuwest/Friendiqa/src/branch/master/PrivacyPolicy.md</a><br>"+
"Code by <a href='https://freunde.ma-nic.de/profile/pankraz'>Marco</a><br>"+
"Qt Framework <a href='https://www.qt.io'>www.qt.io</a><br>"+
"Icons by <a href='http://fontawesome.io'>FontAwesome</a><br>"+
"Folder Icon by <a href='https://github.com/KDE/breeze-icons'>KDE Breeze Icons</a><br>"+
"AndroidNative by <a href='https://github.com/benlau/androidnative.pri'>Ben Lau</a><br>"+
"This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (<a href='http://www.openssl.org/'>http://www.openssl.org/</a>)"
onLinkActivated:{
"Code by <a href='https://freunde.ma-nic.de/profile/pankraz'>Marco</a><br>"+
"Qt Framework <a href='https://www.qt.io'>www.qt.io</a><br>"+
"Icons by <a href='http://fontawesome.io'>FontAwesome</a><br>"+
"Folder Icon by <a href='https://github.com/KDE/breeze-icons'>KDE Breeze Icons</a><br>"+
"AndroidNative by <a href='https://github.com/benlau/androidnative.pri'>Ben Lau</a><br>"+
"This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (<a href='http://www.openssl.org/'>http://www.openssl.org/</a>)"
onLinkActivated:{
Qt.openUrlExternally(link)}
}
Button{
id:closeButton
height: 6*mm
width: 8*mm
anchors.top: parent.top
anchors.topMargin: 1*mm
anchors.right: parent.right
anchors.rightMargin: 1*mm
text: "\uf057"
font.pixelSize: 3*mm
onClicked:{root.pop()}
}
}
MButton{
id:closeButton
anchors.top: parent.top
anchors.topMargin: root.fontFactor*osSettings.bigFontSize
anchors.right: parent.right
anchors.rightMargin: 1*mm
text: "\uf057"
font.pointSize: osSettings.bigFontSize
onClicked:{rootstackView.pop()}
}
}

View file

@ -0,0 +1,113 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// 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
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// In addition, as a special exception, the copyright holders give
// permission to link the code of portions of this program with the
// OpenSSL library under certain conditions as described in each
// individual source file, and distribute linked combinations including
// the two.
//
// You must obey the GNU General Public License in all respects for all
// of the code used other than OpenSSL. If you modify file(s) with this
// exception, you may extend this exception to your version of the
// file(s), but you are not obligated to do so. If you do not wish to do
// so, delete this exception statement from your version. If you delete
// this exception statement from all source files in the program, then
// also delete it here.
//
// 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.0
import QtQuick.Controls 2.12
import "qrc:/qml/genericqml"
import "qrc:/js/service.js" as Service
ScrollView{
id:leftDrawerScrollviewId
clip: true
width:parent.width-mm
height: parent.height
contentHeight: leftDrawerColumn.height
property string currentnewstabstatus:root.globaloptions.hasOwnProperty("newsViewType")?root.globaloptions.newsViewType:"Conversations";
Column{
id:leftDrawerColumn
x:mm
y:0.5*root.fontFactor*osSettings.bigFontSize
width:parent.width-2*mm
height: 4*root.fontFactor*osSettings.bigFontSize
spacing: 0.7*root.fontFactor*osSettings.bigFontSize
Label{
width:implicitWidth
font.pointSize: osSettings.systemFontSize
text: "\uf085 "+ qsTr("Settings")
MouseArea{
anchors.fill:parent
onClicked:{rootstackView.push("qrc:qml/configqml/ConfigPage.qml");
if(!wideScreen){leftDrawerAndroid.close()}
}
}
}
Label{y: 2*root.fontFactor*osSettings.bigFontSize
width:implicitWidth
font.pointSize: osSettings.systemFontSize
text: "\uf2bb " + qsTr("Accounts")
MouseArea{
anchors.fill:parent
onClicked:{rootstackView.push("qrc:qml/configqml/AccountPage.qml");
if(!wideScreen){leftDrawerAndroid.close()}
}
}
}
Label{y: 4*root.fontFactor*osSettings.bigFontSize
width:implicitWidth
font.pointSize: osSettings.systemFontSize
text: "\uf08b " +qsTr("Quit")
MouseArea{
anchors.fill:parent
onClicked:{
Service.cleanNews(root.db,function(){
Service.cleanHashtags(root.db,function(){
Service.cleanContacts(root.login,root.db,function(){
Qt.quit()})
})})
}
}
}
}
Component.onCompleted:{
Service.readAllLogins(db,function(accounts){
if (accounts.length>0 && bar.currentIndex==0){
leftDrawerColumn.height=4.5*root.fontFactor*osSettings.bigFontSize+accounts.length*13*root.fontFactor*osSettings.bigFontSize
for(var i = 0; i < accounts.length; i++) {
var accountComponent = Qt.createComponent("qrc:/qml/genericqml/DrawerAccountComponent.qml");
var accountQml = accountComponent.createObject(leftDrawerColumn,{
"y":4.5*root.fontFactor*osSettings.bigFontSize+i*13*root.fontFactor*osSettings.bigFontSize,
"currentnewstabstatus":currentnewstabstatus,
"account":accounts[i]});
}
}else if(accounts.length>0 && bar.currentIndex==1){
leftDrawerColumn.height=4.5*root.fontFactor*osSettings.bigFontSize+accounts.length*6.5*root.fontFactor*osSettings.bigFontSize
for(var i = 0; i < accounts.length; i++) {
var accountComponent = Qt.createComponent("qrc:/qml/genericqml/DrawerAccountComponentContacts.qml");
var accountQml = accountComponent.createObject(leftDrawerColumn,{
"y":4.5*root.fontFactor*osSettings.bigFontSize+i*6.5*root.fontFactor*osSettings.bigFontSize,
"account":accounts[i]});
}
}
})}
}

View file

@ -37,6 +37,8 @@ QtObject{
property int backKey: Qt.Key_Back
//property string attachImageDir:filesystem.cameraPath+"/"
property string osType: "Android"
property int systemFontSize: root.font.pointSize*1.1
property int bigFontSize: systemFontSize*1.3
property string imagePickQml: "ImagePicker"
property string imagePicker:'import QtQuick 2.0; import "qrc:/qml/genericqml";'+
imagePickQml+'{multiple : true;onReady: {attachImageURLs.push(imageUrl);'+

View file

@ -32,10 +32,12 @@
import QtQuick.Window 2.0
import QtQuick 2.0
QtObject{
property real appWidth: Screen.desktopAvailableWidth/3
property real appHeight: Screen.desktopAvailableHeight/3*2
property real appWidth: Screen.desktopAvailableWidth/4*3
property real appHeight: Screen.desktopAvailableHeight/4*3
property int backKey: Qt.Key_Escape
property string osType: "Linux"
property int systemFontSize: root.font.pointSize*1.1
property int bigFontSize: systemFontSize*1.5
//property string attachImageDir:filesystem.homePath+"/Pictures/"
property string imagePickQml: "ImagePickerLinux"
}

View file

@ -36,10 +36,7 @@ import "qrc:/qml/genericqml"
Rectangle{
color:"white"
//border.color: "light grey"
property alias url:htmlview.url
// width:root.width-5*mm
// height:root.height-12*mm
WebView {id:htmlview;
height:parent.height-7*mm
@ -55,13 +52,13 @@ Rectangle{
}
Button{
id:closeButton
height:6*mm
height: 3*root.fontFactor*osSettings.bigFontSize
anchors.top: parent.top
anchors.topMargin: 1*mm
anchors.right: parent.right
anchors.rightMargin: 1*mm
text: "\uf057"
font.pixelSize: 3*mm
font.pointSize: osSettings.bigFontSize
onClicked:{root.pop()}
}
}

View file

@ -39,22 +39,22 @@ Rectangle{
color: "#EEEEEE" //Material.Grey
property string adapter: ""
width: parent.width
height: 12*mm
height: 4*root.fontFactor*osSettings.bigFontSize
Label{
x: mm
y: 0.5*mm
font.pixelSize:3*mm
font.pointSize: osSettings.systemFontSize
text: qsTr(adapter)
}
CheckBox{
id: syncCheckbox
x: mm
y: 5*mm
width:20*mm
y: root.fontFactor*osSettings.bigFontSize
width: 10*root.fontFactor*osSettings.bigFontSize
checked:(globaloptions["sync_"+adapter]==1)?true:false
//style: CheckBoxStyle {
text: qsTr("sync")
font.pixelSize:3*mm
font.pointSize: osSettings.bigFontSize
onClicked: {
toggle();
if(syncCheckbox.checked==true){
@ -67,13 +67,13 @@ Rectangle{
}
CheckBox{
id: notifyCheckbox
x:25*mm
y: 5*mm
width:25*mm
x: 10*root.fontFactor*osSettings.bigFontSize
y: root.fontFactor*osSettings.bigFontSize
width: 10*root.fontFactor*osSettings.bigFontSize
enabled: adapter!="Notifications"
checked:(globaloptions["notify_"+adapter]==1)?true:false
text: qsTr("notify")
font.pixelSize:3*mm
font.pointSize: osSettings.bigFontSize
onClicked: {
toggle();
if(notifyCheckbox.checked==true){

View file

@ -43,44 +43,50 @@ Rectangle{
//height:root.height
Text {
text: qsTr("Sync Interval (0=None)")
font.pixelSize:3*mm
font.pointSize: osSettings.bigFontSize
//visible: false
x: 4*mm; y: 10*mm; //width:35*mm;wrapMode: Text.Wrap
x: root.fontFactor*osSettings.bigFontSize; y: root.fontFactor*osSettings.bigFontSize; //width:35*mm;wrapMode: Text.Wrap
}
Slider{ id: messageIntervalSlider
x:22*mm; y: 13.5*mm;width: root.width/2;height:5*mm
x:8*root.fontFactor*osSettings.bigFontSize; y: 4*root.fontFactor*osSettings.bigFontSize;
width: root.width-10*root.fontFactor*osSettings.bigFontSize;
height:2*root.fontFactor*osSettings.bigFontSize
value: globaloptions.hasOwnProperty("syncinterval")?globaloptions.syncinterval:0
from: 0;to:120; stepSize: 15
}
Rectangle{
x: 4*mm; y: 13.5*mm; width: 9*mm; height: 5*mm;
TextEdit{
id: messageIntervalField
anchors.fill: parent
font.pixelSize:3*mm
verticalAlignment:TextEdit.AlignRight
text:messageIntervalSlider.value
focus: true
selectByMouse: true
onTextChanged: {
Service.updateglobaloptions(root.db,"syncinterval",text);
if(osSettings.osType=="Android"){
x: root.fontFactor*osSettings.bigFontSize; y:4*root.fontFactor*osSettings.bigFontSize;
width: 4*root.fontFactor*osSettings.bigFontSize; height: 2*root.fontFactor*osSettings.bigFontSize;
TextEdit{
id: messageIntervalField
anchors.fill: parent
font.pointSize: osSettings.bigFontSize
verticalAlignment:TextEdit.AlignRight
text:messageIntervalSlider.value
focus: true
selectByMouse: true
onTextChanged: {
Service.updateglobaloptions(root.db,"syncinterval",text);
if(osSettings.osType=="Android"){
//print("setalarm")
alarm.setAlarm(text);
} else if(osSettings.osType=="Linux" && text !=0){
root.updateSyncinterval(parseInt(text))
}
}
} else if(osSettings.osType=="Linux" && text !=0){
root.updateSyncinterval(parseInt(text))
}
}
}
}
Text{x: 14*mm; y: 13.5*mm; width: 5*mm; height: 5*mm;
font.pixelSize:3*mm
Text{x: 6*root.fontFactor*osSettings.bigFontSize; y: 4*root.fontFactor*osSettings.bigFontSize;
width: 2*root.fontFactor*osSettings.bigFontSize; height: 1.5*root.fontFactor*osSettings.bigFontSize;
font.pointSize: osSettings.bigFontSize
text:qsTr("Min.")
}
ScrollView{
width: root.width
height: root.height - 25*mm;y:22*mm
height: root.height - 10*root.fontFactor*osSettings.bigFontSize;
y:7*root.fontFactor*osSettings.bigFontSize
clip:true
Column{
//height: implicitHeight
@ -92,19 +98,19 @@ Rectangle{
SyncComponent{ adapter:"DirectMessages"}
SyncComponent{ adapter:"Notifications"}
SyncComponent{ adapter: "Events"}
SyncComponent{adapter: "FriendRequests"}
}
}
MButton{
id:closeButton
anchors.top: parent.top
anchors.topMargin: 1*mm
anchors.right: parent.right
anchors.rightMargin: 1*mm
height: 6*mm
width: 8*mm
text: "\uf057"
font.pixelSize: 3*mm
onClicked:{root.pop()}
}
MButton{
id:closeButton
anchors.top: parent.top
anchors.topMargin: osSettings.bigFontSize
anchors.right: parent.right
anchors.rightMargin: 1*mm
width: 2*root.fontFactor*osSettings.bigFontSize;
text: "\uf057"
font.pointSize: osSettings.bigFontSize
onClicked:{rootstackView.pop()}
}
}