v.0.5
This commit is contained in:
parent
63dfb9b197
commit
d48847d183
135 changed files with 8879 additions and 3693 deletions
463
source-android/qml/configqml/AccountPage.qml
Normal file
463
source-android/qml/configqml/AccountPage.qml
Normal file
|
@ -0,0 +1,463 @@
|
|||
// This file is part of Friendiqa
|
||||
// https://git.friendi.ca/lubuwest/Friendiqa
|
||||
// Copyright (C) 2017 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.7
|
||||
import QtQuick.Dialogs 1.2
|
||||
import QtQuick.Controls 2.4
|
||||
|
||||
import "qrc:/js/service.js" as Service
|
||||
import "qrc:/js/layout.js" as Layoutjs
|
||||
import "qrc:/js/helper.js" as Helperjs
|
||||
import "qrc:/qml/configqml"
|
||||
import "qrc:/qml/genericqml"
|
||||
|
||||
Page{
|
||||
id:accountPage
|
||||
width: root.width
|
||||
height: root.height
|
||||
property var users:[]
|
||||
property var userdata: ({})
|
||||
|
||||
function setServericon(server){
|
||||
try {Helperjs.friendicaWebRequest(server+"/api/statusnet/config",accountPage, function (obj){
|
||||
var serverdata = JSON.parse(obj);
|
||||
servericon.visible=true;
|
||||
servericon.source=serverdata.site.logo})} catch(e){print(e)}
|
||||
}
|
||||
|
||||
Button{
|
||||
id:userButton
|
||||
height: 8*mm
|
||||
text:qsTr("User")
|
||||
font.pixelSize: 3*mm
|
||||
x: mm
|
||||
y: mm
|
||||
width: root.width/2
|
||||
onClicked:{
|
||||
var useritems="";
|
||||
for (var i=0;i<accountPage.users.length;i++){
|
||||
|
||||
useritems=useritems+"MenuItem{font.pixelSize: 3*mm; text:'"+accountPage.users[i].username+
|
||||
"'; onTriggered: {Service.readConfig(db,function(obj){
|
||||
userButton.text=obj.username;
|
||||
servername.text=obj.server;
|
||||
accountPage.setServericon(obj.server);
|
||||
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 userlistObject=Qt.createQmlObject(menuString,accountPage,"usermenuOutput")
|
||||
userlistObject.popup() }
|
||||
}
|
||||
|
||||
Text {
|
||||
text: qsTr("Server")
|
||||
font.pixelSize:3*mm
|
||||
x: 4*mm; y: 10*mm
|
||||
}
|
||||
Text {
|
||||
text: qsTr("Nickname")
|
||||
font.pixelSize:3*mm
|
||||
x: 4*mm; y: 20*mm
|
||||
}
|
||||
|
||||
Text {
|
||||
text: qsTr("Password")
|
||||
font.pixelSize:3*mm
|
||||
x: 4*mm; y: 30*mm
|
||||
}
|
||||
Text {
|
||||
text: qsTr("Image dir.")
|
||||
font.pixelSize:3*mm
|
||||
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
|
||||
width:5*mm; height: 5*mm
|
||||
visible: false
|
||||
source:""
|
||||
MouseArea{
|
||||
anchors.fill:parent
|
||||
onClicked:{
|
||||
Service.showServerConfig(servername.text, accountPage, function(configString){
|
||||
var serverconfigObject=Qt.createQmlObject(configString,accountPage,"serverconfigOutput");})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Button{
|
||||
id:serverSearchButton
|
||||
text:"\uf002"
|
||||
font.pixelSize: 3*mm
|
||||
x:4*mm
|
||||
y:13.5*mm
|
||||
width: 5*mm; height:5*mm
|
||||
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
|
||||
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-14*mm; height: 5*mm;
|
||||
TextInput {
|
||||
id: username
|
||||
anchors.fill: parent
|
||||
font.pixelSize:3*mm
|
||||
selectByMouse: true
|
||||
onEditingFinished:{
|
||||
if (username.text.indexOf('@')>-1){
|
||||
Helperjs.showMessage(qsTr("Error"),qsTr("Nicknames containing @ symbol currently not supported"),accountPage)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Button {
|
||||
x: root.width-9*mm; y: 23.5*mm; width:5*mm; height:5*mm
|
||||
text: "\uf234"
|
||||
font.pixelSize: 3*mm
|
||||
onClicked: {
|
||||
configStack.push({item:"qrc:/qml/configqml/RegisterPage.qml",properties:{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
|
||||
selectByMouse: true
|
||||
echoMode: TextInput.PasswordEchoOnEdit
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle{color: "light grey"; x: 4*mm; y: 43.5*mm; width: root.width-14*mm; height: 5*mm;}
|
||||
Flickable {
|
||||
id: imagestoreFlickable
|
||||
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
|
||||
wrapMode: TextEdit.NoWrap
|
||||
onCursorRectangleChanged: Layoutjs.ensureVisibility(cursorRectangle,imagestoreFlickable)
|
||||
}
|
||||
}
|
||||
|
||||
FileDialog {
|
||||
id: imagestoreDialog
|
||||
title: "Please choose a directory"
|
||||
folder: shortcuts.pictures
|
||||
selectFolder: true
|
||||
onAccepted: {
|
||||
var imagestoreString=imagestoreDialog.folder.toString();
|
||||
imagestoreString=imagestoreString.replace(/^(file:\/{2})/,"")+"/"
|
||||
imagestore.text=imagestoreString
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
x: root.width-9*mm; y: 43.5*mm; width: 5*mm; height: 5*mm;
|
||||
text: "..."
|
||||
font.pixelSize: 3*mm
|
||||
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
|
||||
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
|
||||
height: 8*mm
|
||||
text: qsTr("Confirm")
|
||||
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 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 (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){
|
||||
accountBusy.running=false;
|
||||
var credentials=JSON.parse(obj);
|
||||
if (credentials.hasOwnProperty('status')){
|
||||
Helperjs.showMessage(qsTr("Error"),qsTr("Wrong password!"),root)
|
||||
}
|
||||
else{
|
||||
filesystem.Directory=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=[];
|
||||
},"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)
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
else {Helperjs.showMessage(qsTr("Error"), errormessage,root)}
|
||||
}}
|
||||
|
||||
|
||||
|
||||
Button {
|
||||
x: parent.width/2+2*mm; y: mm; width: 5*mm; height: 8*mm;
|
||||
text: "-"
|
||||
font.pixelSize: 3*mm
|
||||
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;
|
||||
text: "+"
|
||||
font.pixelSize: 3*mm
|
||||
onClicked:{
|
||||
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")
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
x: parent.width/2+14*mm; y: mm; width: 5*mm; height: 8*mm;
|
||||
text: "?"
|
||||
font.pixelSize: 3*mm
|
||||
onClicked:{
|
||||
root.push("qrc:/qml/configqml/InfoBox.qml");
|
||||
}
|
||||
}
|
||||
Button{
|
||||
id:closeButton
|
||||
height: 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()}
|
||||
}
|
||||
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){
|
||||
storedUsers.sort(function(obj1, obj2) {
|
||||
return obj1.isActive - obj2.isActive;
|
||||
})
|
||||
accountPage.users=storedUsers;
|
||||
Service.readConfig(db,function(obj){
|
||||
userButton.text=obj.username;
|
||||
servername.text=obj.server;
|
||||
accountPage.setServericon(obj.server);
|
||||
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;
|
||||
if( obj.isActive==0){userButton.font.bold='true'} else {userButton.font.bold='false'}
|
||||
},"isActive",0)
|
||||
})
|
||||
// Service.readGlobaloptions(db,function(go){
|
||||
// if (root.globaloptions.showWebsiteForLinks!="false"){showwebsiteCheckbox.checked=true}
|
||||
// })
|
||||
|
||||
}
|
||||
catch (e){print(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
|
||||
// })
|
||||
}
|
||||
}
|
||||
}
|
227
source-android/qml/configqml/ConfigPage.qml
Normal file
227
source-android/qml/configqml/ConfigPage.qml
Normal file
|
@ -0,0 +1,227 @@
|
|||
// This file is part of Friendiqa
|
||||
// https://git.friendi.ca/lubuwest/Friendiqa
|
||||
// Copyright (C) 2017 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.11
|
||||
import QtQuick.Dialogs 1.2
|
||||
import QtQuick.Controls 2.4
|
||||
|
||||
import "qrc:/js/service.js" as Service
|
||||
//import "qrc:/js/layout.js" as Layoutjs
|
||||
//import "qrc:/js/helper.js" as Helperjs
|
||||
import "qrc:/qml/configqml"
|
||||
import "qrc:/qml/genericqml"
|
||||
|
||||
Page{
|
||||
//anchors.fill: parent
|
||||
width:root.width
|
||||
height:root.height
|
||||
//contentHeight: configBackground.height
|
||||
//boundsBehavior: Flickable.StopAtBounds
|
||||
|
||||
// Rectangle{
|
||||
// id:configBackground
|
||||
// color: "white"
|
||||
// anchors.fill: parent
|
||||
// width:parent.width
|
||||
// height:Math.max(90*mm,root.height-12*mm)
|
||||
// property var users:[]
|
||||
// property bool registeredUser: true
|
||||
// property var userdata: ({})
|
||||
|
||||
// Text {
|
||||
// text: qsTr("Image dir.")
|
||||
// //text: qsTr("Max. News")
|
||||
// font.pixelSize:3*mm
|
||||
// x: 4*mm; y: 10*mm
|
||||
// }
|
||||
Text {
|
||||
text: qsTr("Max. News")
|
||||
//text: qsTr("News as")
|
||||
font.pixelSize:3*mm
|
||||
x: 4*mm; y:10*mm
|
||||
}
|
||||
|
||||
|
||||
// Text {
|
||||
// text: qsTr("Show Website")
|
||||
// x: 4*mm; y: 40*mm; width: 20*mm
|
||||
// }
|
||||
|
||||
|
||||
// Rectangle{color: "light grey"; x: 4*mm; y: 13.5*mm; width: root.width-14*mm; height: 5*mm;}
|
||||
// Flickable {
|
||||
// id: imagestoreFlickable
|
||||
// x: 4*mm; y: 13.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
|
||||
// wrapMode: TextEdit.NoWrap
|
||||
// onCursorRectangleChanged: Layoutjs.ensureVisibility(cursorRectangle,imagestoreFlickable)
|
||||
// }
|
||||
// }
|
||||
|
||||
// FileDialog {
|
||||
// id: imagestoreDialog
|
||||
// title: "Please choose a directory"
|
||||
// folder: shortcuts.pictures
|
||||
// selectFolder: true
|
||||
// onAccepted: {
|
||||
// var imagestoreString=imagestoreDialog.folder.toString();
|
||||
// imagestoreString=imagestoreString.replace(/^(file:\/{2})/,"")+"/"
|
||||
// imagestore.text=imagestoreString
|
||||
// }
|
||||
// }
|
||||
|
||||
// Button {
|
||||
// x: root.width-9*mm; y: 13.5*mm; width: 7*mm; height: 8*mm;
|
||||
// text: "..."
|
||||
// onClicked:
|
||||
// {imagestoreDialog.open()}
|
||||
// }
|
||||
|
||||
|
||||
Slider{ id: maxNews
|
||||
x:19*mm; y: 13.5*mm;width: root.width/2;height:5*mm
|
||||
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: 13.5*mm; width: 9*mm; height: 5*mm;
|
||||
radius: 0.5*mm
|
||||
TextEdit{id:maxNewsText;
|
||||
anchors.fill: parent
|
||||
font.pixelSize:3*mm
|
||||
verticalAlignment:TextEdit.AlignRight
|
||||
text:maxNews.value
|
||||
focus: true
|
||||
selectByMouse: true
|
||||
onTextChanged: {
|
||||
Service.updateglobaloptions(root.db,"max_news",text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle{
|
||||
x: 4*mm; y:23.5*mm; width: parent.width - 14*mm; height: 5*mm;
|
||||
color:"light grey"
|
||||
radius: 0.5*mm
|
||||
Text{
|
||||
anchors.fill: parent
|
||||
font.pixelSize:3*mm
|
||||
text:qsTr("Sync")
|
||||
}
|
||||
MouseArea{
|
||||
anchors.fill:parent
|
||||
onClicked:root.push("qrc:qml/configqml/SyncConfig.qml");
|
||||
}
|
||||
}
|
||||
// Slider{ id: messageIntervalSlider
|
||||
// x:22*mm; y: 73.5*mm;width: root.width/2;height:5*mm
|
||||
// from: 0;to:120; stepSize: 15
|
||||
// }
|
||||
// Rectangle{
|
||||
// x: 4*mm; y: 73.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
|
||||
// }
|
||||
// }
|
||||
// Text{x: 14*mm; y: 73.5*mm; width: 5*mm; height: 5*mm;
|
||||
// font.pixelSize:3*mm
|
||||
// text:qsTr("Min.")
|
||||
// }
|
||||
|
||||
// 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"
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
MButton {
|
||||
anchors.right: closeButton.left; anchors.rightMargin: mm;
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 1*mm
|
||||
width: 8*mm; height: 6*mm;
|
||||
text: "?"
|
||||
font.pixelSize: 3*mm
|
||||
onClicked:{
|
||||
root.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()}
|
||||
}
|
||||
// Menu {
|
||||
// id:newstypemenu
|
||||
// MenuItem {
|
||||
// text: qsTr("Timeline")
|
||||
// onTriggered: {newsTypeField.text="Timeline"}
|
||||
// }
|
||||
// MenuItem {
|
||||
// text: qsTr("Conversations")
|
||||
// onTriggered: {newsTypeField.text="Conversations"}
|
||||
// }
|
||||
// }
|
||||
|
||||
// Component.onCompleted: {
|
||||
// Service.readGlobaloptions(db,function(go){
|
||||
// if(go.hasOwnProperty("max_news")){maxNews.value=go.max_news}else{maxNews.value=1000}
|
||||
// //if (root.globaloptions.showWebsiteForLinks!="false"){showwebsiteCheckbox.checked=true}
|
||||
// })
|
||||
// }
|
||||
}
|
|
@ -30,7 +30,7 @@
|
|||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import QtQuick 2.0
|
||||
import QtQuick.Controls 1.2
|
||||
import QtQuick.Controls 2.4
|
||||
import "qrc:/qml/genericqml"
|
||||
|
||||
Rectangle{
|
||||
|
@ -41,11 +41,12 @@ Rectangle{
|
|||
anchors.top:closeButton.bottom
|
||||
anchors.topMargin: mm
|
||||
textFormat: Text.RichText
|
||||
width: parent.width
|
||||
width: root.width-mm
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
text: "<b>Friendiqa v0.4 </b><br>Licensed under GPL 3 with the exception of OpenSSL <br> "+
|
||||
text: "<b>Friendiqa v0.5 </b><br>Licensed under GPL 3 with the exception of OpenSSL <br> "+
|
||||
"Profile <a href='https://freunde.ma-nic.de/profile/friendiqa'>https://freunde.ma-nic.de/profile/friendiqa</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>"+
|
||||
"Most of C++ code by <a href='https://kirgroup.com/profile/fabrixxm'>Fabio</a><br>"+
|
||||
"QML and Javascript code by <a href='https://freunde.ma-nic.de/profile/marco'>Marco</a><br>"+
|
||||
"Qt Framework <a href='https://www.qt.io'>www.qt.io</a><br>"+
|
||||
|
@ -56,13 +57,16 @@ Rectangle{
|
|||
onLinkActivated:{
|
||||
Qt.openUrlExternally(link)}
|
||||
}
|
||||
BlueButton{
|
||||
id:closeButton
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 1*mm
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 1*mm
|
||||
text: "\uf057"
|
||||
onClicked:{configStack.pop()}
|
||||
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()}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ QtObject{
|
|||
property real appWidth: 500
|
||||
property real appHeight: 500
|
||||
property int backKey: Qt.Key_Escape
|
||||
property string osType: "Android"
|
||||
property string osType: "Linux"
|
||||
//property string attachImageDir:filesystem.homePath+"/Pictures/"
|
||||
property string imagePickQml: "ImagePickerLinux"
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Controls 2.5
|
||||
import QtWebView 1.1
|
||||
import "qrc:/qml/genericqml"
|
||||
|
||||
|
@ -45,17 +46,21 @@ Rectangle{
|
|||
width:parent.width
|
||||
y:7*mm
|
||||
MouseArea {anchors.fill:parent;
|
||||
onClicked:{print(url)}
|
||||
onClicked:{
|
||||
//print(url)
|
||||
}
|
||||
}
|
||||
onLoadingChanged: print(loadProgress)
|
||||
//onLoadingChanged: print(loadProgress)
|
||||
}
|
||||
BlueButton{
|
||||
Button{
|
||||
id:closeButton
|
||||
height: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:{configStack.pop()}
|
||||
}
|
||||
}
|
||||
|
|
87
source-android/qml/configqml/SyncComponent.qml
Normal file
87
source-android/qml/configqml/SyncComponent.qml
Normal file
|
@ -0,0 +1,87 @@
|
|||
// This file is part of Friendiqa
|
||||
// https://git.friendi.ca/lubuwest/Friendiqa
|
||||
// Copyright (C) 2017 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.11
|
||||
import QtQuick.Controls 2.4
|
||||
import "qrc:/qml/configqml"
|
||||
import "qrc:/js/service.js" as Service
|
||||
|
||||
Rectangle{
|
||||
color: "#EEEEEE" //Material.Grey
|
||||
property string adapter: ""
|
||||
width: parent.width
|
||||
height: 12*mm
|
||||
Label{
|
||||
x: mm
|
||||
y: 0.5*mm
|
||||
font.pixelSize:3*mm
|
||||
text: qsTr(adapter)
|
||||
}
|
||||
CheckBox{
|
||||
id: syncCheckbox
|
||||
x: mm
|
||||
y: 5*mm
|
||||
width:20*mm
|
||||
checked:(globaloptions["sync_"+adapter]==1)?true:false
|
||||
//style: CheckBoxStyle {
|
||||
text: qsTr("sync")
|
||||
font.pixelSize:3*mm
|
||||
onClicked: {
|
||||
toggle();
|
||||
if(syncCheckbox.checked==true){
|
||||
Service.updateglobaloptions(root.db,"sync_"+adapter,0);syncCheckbox.checked=false;
|
||||
}
|
||||
else{
|
||||
Service.updateglobaloptions(root.db,"sync_"+adapter,1);syncCheckbox.checked=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
CheckBox{
|
||||
id: notifyCheckbox
|
||||
x:25*mm
|
||||
y: 5*mm
|
||||
width:25*mm
|
||||
enabled: adapter!="Notifications"
|
||||
checked:(globaloptions["notify_"+adapter]==1)?true:false
|
||||
text: qsTr("notify")
|
||||
font.pixelSize:3*mm
|
||||
onClicked: {
|
||||
toggle();
|
||||
if(notifyCheckbox.checked==true){
|
||||
Service.updateglobaloptions(root.db,"notify_"+adapter,0);notifyCheckbox.checked=false;
|
||||
}
|
||||
else{
|
||||
Service.updateglobaloptions(root.db,"notify_"+adapter,1);notifyCheckbox.checked=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
101
source-android/qml/configqml/SyncConfig.qml
Normal file
101
source-android/qml/configqml/SyncConfig.qml
Normal file
|
@ -0,0 +1,101 @@
|
|||
// This file is part of Friendiqa
|
||||
// https://git.friendi.ca/lubuwest/Friendiqa
|
||||
// Copyright (C) 2017 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.11
|
||||
import QtQuick.Controls 2.4
|
||||
import "qrc:/qml/configqml"
|
||||
import "qrc:/js/service.js" as Service
|
||||
|
||||
Rectangle{
|
||||
color:"white"
|
||||
width:root.width
|
||||
height:root.height
|
||||
Text {
|
||||
text: qsTr("Sync Interval (0=None)")
|
||||
font.pixelSize:3*mm
|
||||
//visible: false
|
||||
x: 4*mm; y: 10*mm; //width:35*mm;wrapMode: Text.Wrap
|
||||
}
|
||||
|
||||
Slider{ id: messageIntervalSlider
|
||||
x:22*mm; y: 13.5*mm;width: root.width/2;height:5*mm
|
||||
value: globaloptions.syncinterval
|
||||
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" && text !=0){
|
||||
alarm.setAlarm(text);
|
||||
} else if(osSettings.osType=="Linux" && text !=0){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Text{x: 14*mm; y: 13.5*mm; width: 5*mm; height: 5*mm;
|
||||
font.pixelSize:3*mm
|
||||
text:qsTr("Min.")
|
||||
}
|
||||
|
||||
Column{
|
||||
y:22*mm
|
||||
width: parent.width
|
||||
spacing:mm
|
||||
//anchors.fill: parent
|
||||
SyncComponent{adapter:"Timeline"}
|
||||
SyncComponent{adapter:"Replies"}
|
||||
SyncComponent{ adapter:"DirectMessages"}
|
||||
SyncComponent{ adapter:"Notifications"}
|
||||
}
|
||||
|
||||
Button{
|
||||
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()}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue