new version with hashtags

This commit is contained in:
LubuWest 2020-11-25 21:40:17 +01:00
commit 56bdb80ea0
47 changed files with 1424 additions and 825 deletions

View file

@ -45,6 +45,8 @@ Page{
height: root.height
property var users:[]
property var userdata: ({})
property string imagestoredir: ""
function setServericon(server){
try {Helperjs.friendicaWebRequest(server+"/api/statusnet/config",accountPage, function (obj){
@ -57,7 +59,8 @@ Page{
id:userButton
height: 8*mm
text:qsTr("User")
font.pixelSize: 3*mm
//font.pixelSize: 3*mm
font.pointSize: 16
x: mm
y: mm
width: root.width/2
@ -75,6 +78,7 @@ Page{
username.text= obj.username;
password.text=Qt.atob(obj.password);
imagestore.text=obj.imagestore;
imagestoredir=obj.imagestore;
if( obj.isActive==0){userButton.font.bold='true'} else {userButton.font.bold='false'}
},'username','"+ accountPage.users[i].username+"')}}"
}
@ -85,43 +89,32 @@ Page{
Text {
text: qsTr("Server")
font.pixelSize:3*mm
//font.pixelSize:3*mm
font.pointSize: 16
x: 4*mm; y: 10*mm
}
Text {
text: qsTr("Nickname")
font.pixelSize:3*mm
//font.pixelSize:3*mm
font.pointSize: 16
x: 4*mm; y: 20*mm
}
Text {
text: qsTr("Password")
font.pixelSize:3*mm
//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.pixelSize:3*mm
font.pointSize: 16
x: 4*mm; y: 40*mm
}
// Text {
// text: qsTr("Max. News")
// 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("Show Website")
// x: 4*mm; y:80*mm; width: 20*mm
// }
Image{
id:servericon
x:4*mm;y:13.5*mm
@ -141,6 +134,7 @@ Page{
id:serverSearchButton
text:"\uf002"
font.pixelSize: 3*mm
font.pointSize: 16
x:4*mm
y:13.5*mm
width: 5*mm; height:5*mm
@ -160,7 +154,8 @@ Page{
width: servernameFlickable.width
height: servernameFlickable.height
focus: true
font.pixelSize:3*mm
//font.pixelSize:3*mm
font.pointSize: 16
text:"https://"
onEditingFinished:{
if((servername.text).substring(0,11) =="https://http"){
@ -178,12 +173,15 @@ Page{
TextInput {
id: username
anchors.fill: parent
font.pixelSize:3*mm
//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)
}
imagestoredir=filesystem.homePath+"/"+username.text+"/"
//if (imagestore.text==filesystem.homePath+"/.friendiqa/"){imagestore.text=filesystem.homePath+"/.friendiqa/"+username.text+"/"}
}
}
}
@ -202,25 +200,29 @@ Page{
TextInput {
id: password
anchors.fill: parent
font.pixelSize:3*mm
//font.pixelSize:3*mm
font.pointSize: 16
selectByMouse: true
echoMode: TextInput.PasswordEchoOnEdit
}
}
Rectangle{color: "light grey"; x: 4*mm; y: 43.5*mm; width: root.width-14*mm; height: 5*mm;}
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
text: (osSettings.osType=="Android") && (filesystem.fileexist("/storage/emulated/0/Pictures/"))?"/storage/emulated/0/Pictures/":""
//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
}
}
@ -238,81 +240,39 @@ 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
onClicked:
{imagestoreDialog.open()}
//font.pixelSize: 3*mm
font.pointSize: 16
onClicked:{imagestoreDialog.open()}
}
// Slider{ id: maxNews
// x:19*mm; y: 53.5*mm;width: root.width/2;height:5*mm
// from: 0;to:2000; stepSize: 100
// }
// Rectangle{color: "light grey"; x: 4*mm; y: 53.5*mm; width: 9*mm; height: 5*mm;
// TextEdit{id:maxNewsText;
// anchors.fill: parent
// font.pixelSize:3*mm
// verticalAlignment:TextEdit.AlignRight
// text:maxNews.value
// focus: true
// selectByMouse: true
// }
// }
// 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
anchors.horizontalCenter: parent.horizontalCenter
y: 63.5*mm
y: 53.5*mm
width:10*mm
height: 10*mm
running: false
}
// CheckBox{
// id:showwebsiteCheckbox
// x:35*mm;y:80*mm
// onClicked:{
// if (checked==true){
// Service.updateglobaloptions(root.db,"showWebsiteForLinks","true")
// root.globaloptions.showWebsiteForLinks="true"
// }
// else {
// Service.updateglobaloptions(root.db,"showWebsiteForLinks","false")
// root.globaloptions.showWebsiteForLinks="false"
// }
// }
// }
Button {
x: 4*mm; y: 63.5*mm
x: 4*mm; y: 53.5*mm
height: 8*mm
text: qsTr("Confirm")
font.pixelSize: 3*mm
//font.pixelSize: 3*mm
font.pointSize: 16
onClicked:{
accountBusy.running=true;
var userconfig={server: servername.text, username: username.text, password:Qt.btoa(password.text), imagestore:imagestore.text, maxnews:"",interval: ""};
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 (imagestore.text=="") {errormessage+=qsTr("No image directory 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=="") {
@ -324,7 +284,12 @@ Page{
}
else{
if (users.length==0){Service.setDefaultOptions(db);}
filesystem.Directory=userconfig.imagestore;
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);
@ -356,7 +321,8 @@ Page{
x: parent.width/2+2*mm; y: mm; width: 5*mm; height: 8*mm;
visible: users.length>0
text: "-"
font.pixelSize: 3*mm
//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(){
@ -386,17 +352,15 @@ Page{
x: parent.width/2+8*mm; y: mm; width: 5*mm; height: 8*mm;
visible: users.length>0
text: "+"
font.pixelSize: 3*mm
//font.pixelSize: 3*mm
font.pointSize: 16
onClicked:{
servername.text="https://"
servericon.visible=false;
servericon.source="";
username.text=""
password.text=""
imagestore.text=""
//maxNews.value=0
//newsTypeField.text="Conversations"
//messageIntervalSlider.value=30
imagestore.text="" //filesystem.homePath+"/.friendiqa/"+username.text//""
userButton.text=qsTr("User")
}
}
@ -404,7 +368,8 @@ Page{
Button {
x: parent.width/2+14*mm; y: mm; width: 5*mm; height: 8*mm;
text: "?"
font.pixelSize: 3*mm
//font.pixelSize: 3*mm
font.pointSize: 16
onClicked:{
root.push("qrc:/qml/configqml/InfoBox.qml");
}
@ -419,22 +384,11 @@ Page{
anchors.right: parent.right
anchors.rightMargin: 1*mm
text: "\uf057"
font.pixelSize: 3*mm
//font.pixelSize: 3*mm
font.pointSize: 16
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"}
// }
// }
Component.onCompleted: {
try{Helperjs.readData(db,"config","",function(storedUsers){
@ -449,19 +403,11 @@ Page{
username.text= obj.username;
password.text=Qt.atob(obj.password);
imagestore.text=obj.imagestore;
//maxNews.value=obj.maxnews;
//newsTypeField.text=obj.newsViewType;
//messageIntervalSlider.value=obj.timerInterval;
imagestoredir=obj.imagestore;
if( obj.isActive==0){userButton.font.bold='true'} else {userButton.font.bold='false'}
},"isActive",0)
})}
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 ");
// var baseurl=html.substring(html.indexOf("http",bpos),html.indexOf('"',html.indexOf("http",bpos)));
// servername.text=baseurl
// })
}
}
}

View file

@ -43,7 +43,7 @@ Rectangle{
textFormat: Text.RichText
width: root.width-mm
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
text: "<b>Friendiqa v0.5.3 </b><br>Licensed under GPL 3 with the exception of OpenSSL <br> "+
text: "<b>Friendiqa v0.5.4 </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>"+