forked from lubuwest/Friendiqa
v0.5.1
This commit is contained in:
parent
01e9ae06f4
commit
7119d5bdf4
292 changed files with 790 additions and 16347 deletions
1
source-android/qml/calendarqml
Symbolic link
1
source-android/qml/calendarqml
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
./../../source-linux/qml/calendarqml/
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
// 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
|
||||
|
||||
Item {
|
||||
id: calendarDay
|
||||
width:7*mm
|
||||
height: 7*mm
|
||||
property int dateInt:Math.floor((Date.parse(model.date)-(new Date().getTimezoneOffset() * 60 * 1000))/86400000)
|
||||
Rectangle {
|
||||
id: placeHolder
|
||||
color: 'lightblue'; antialiasing: true
|
||||
anchors.fill:parent
|
||||
}
|
||||
Text {
|
||||
id:daytext
|
||||
anchors.right: parent.right
|
||||
anchors.margins: 0.5*mm
|
||||
color:(model.month==monthgrid.month)?"black":"grey"
|
||||
wrapMode: Text.WrapAnywhere
|
||||
text: model.day
|
||||
font.bold: model.today
|
||||
font.pixelSize: 4*mm
|
||||
}
|
||||
Rectangle {
|
||||
id:eventRect
|
||||
color:"black"
|
||||
anchors.margins: 0.5*mm
|
||||
anchors.bottom: calendarDay.bottom
|
||||
width: parent.width-mm
|
||||
height: mm
|
||||
visible: eventdays.indexOf(dateInt)>-1
|
||||
}
|
||||
MouseArea {
|
||||
anchors.fill: calendarDay
|
||||
onClicked: {
|
||||
var eventDate=[];
|
||||
var idx = eventdays.indexOf(dateInt);
|
||||
while (idx != -1) {
|
||||
eventDate.push(idx);
|
||||
idx = eventdays.indexOf(dateInt,idx + 1)
|
||||
}
|
||||
var component = Qt.createComponent("qrc:/qml/calendarqml/EventList.qml");
|
||||
if (component.status== Component.Ready){
|
||||
var eventlist = component.createObject(calendartab,{"daylist": eventDate})}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,174 +0,0 @@
|
|||
// 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.0
|
||||
import QtQuick.Controls 2.4
|
||||
import QtQml 2.2
|
||||
import Qt.labs.calendar 1.0
|
||||
//import QtQuick.Controls 1.2 as Oldcontrol
|
||||
import QtQuick.Layouts 1.3
|
||||
import "qrc:/js/service.js" as Service
|
||||
import "qrc:/js/helper.js" as Helperjs
|
||||
import "qrc:/qml/calendarqml"
|
||||
import "qrc:/qml/genericqml"
|
||||
|
||||
Rectangle {
|
||||
id:calendarrectangle
|
||||
// y:1
|
||||
// width:root.width-mm
|
||||
// height:root.height-5*mm
|
||||
anchors.fill: parent
|
||||
color: '#fff'
|
||||
property date currentTime: new Date()
|
||||
property int offsetTime: currentTime.getTimezoneOffset() * 60 * 1000
|
||||
property var events:[]
|
||||
property var eventdays:[]
|
||||
//onEventdaysChanged: print(JSON.stringify(eventdays))
|
||||
|
||||
function showEvents(friend){
|
||||
if(friend=="backButton"){Service.eventsfromdb(db,login.username,function(eventArray,dayArray){
|
||||
events=eventArray;
|
||||
eventdays=dayArray})
|
||||
}
|
||||
else if (friend!=""){
|
||||
calendartab.calendartabstatus=friend.url.substring(friend.url.lastIndexOf("/")+1,friend.url.length)
|
||||
Service.newRequestFriendsEvents(login,friend,calendartab,function(eventArray,dayArray){
|
||||
events=eventArray;
|
||||
eventdays=dayArray})
|
||||
}
|
||||
else {calendartab.calendartabstatus="Events";
|
||||
Service.eventsfromdb(db,login.username,function(eventArray,dayArray){
|
||||
events=eventArray;
|
||||
eventdays=dayArray;
|
||||
calBusy.running=false
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
BusyIndicator{
|
||||
id: calBusy
|
||||
anchors.horizontalCenter: calendarView.horizontalCenter
|
||||
anchors.top:calendarView.top
|
||||
anchors.topMargin: 2*mm
|
||||
width:10*mm
|
||||
height: 10*mm
|
||||
running: false
|
||||
}
|
||||
|
||||
|
||||
MButton{
|
||||
id: updateEvents
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 0.5*mm
|
||||
anchors.right:calendartabstatusButton.left
|
||||
anchors.rightMargin:mm
|
||||
height: 6*mm
|
||||
width: 8*mm
|
||||
text:"\uf021"
|
||||
onClicked: {
|
||||
Service.getEvents(db,login, calendartab,function(){
|
||||
showEvents("")
|
||||
})}}
|
||||
|
||||
MButton{
|
||||
id: calendartabstatusButton
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 0.5*mm
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin:2*mm
|
||||
height: 6*mm
|
||||
width: Math.max(10*mm,implicitWidth)
|
||||
text: calendartab.calendartabstatus=="Events"?qsTr("Events"):calendartabstatus
|
||||
Menu {
|
||||
id:calendartabmenu
|
||||
width: 40*mm
|
||||
MenuItem {
|
||||
text: qsTr("Own Calendar")
|
||||
font.pixelSize: 3*mm
|
||||
onTriggered: {
|
||||
calendartab.calendartabstatus="Events";
|
||||
// calendartabstatusButton.text=qsTr("own Calendar");
|
||||
showEvents("")}
|
||||
}
|
||||
}
|
||||
onClicked: {calendartabmenu.popup()}
|
||||
}
|
||||
|
||||
|
||||
ListView{
|
||||
id: calendarView
|
||||
x: mm;y:8*mm
|
||||
width: parent.width-2*mm; height: parent.height-9*mm
|
||||
clip: true
|
||||
snapMode: ListView.SnapOneItem
|
||||
orientation: ListView.Horizontal
|
||||
highlightRangeMode: ListView.StrictlyEnforceRange
|
||||
model: CalendarModel {id:calendarModel
|
||||
from: new Date()
|
||||
to: new Date(new Date().valueOf()+93312000000)
|
||||
}
|
||||
delegate:
|
||||
ColumnLayout{
|
||||
width:calendarView.width
|
||||
Text{
|
||||
font.bold: true
|
||||
Layout.fillWidth: true
|
||||
horizontalAlignment:Text.AlignHCenter
|
||||
text: model.year
|
||||
}
|
||||
Text{
|
||||
text: Qt.locale().standaloneMonthName(model.month)
|
||||
Layout.fillWidth: true
|
||||
horizontalAlignment:Text.AlignHCenter
|
||||
}
|
||||
DayOfWeekRow{
|
||||
locale: monthgrid.locale
|
||||
Layout.fillWidth: true
|
||||
font.pixelSize: 3*mm
|
||||
}
|
||||
|
||||
MonthGrid {
|
||||
id: monthgrid
|
||||
Layout.fillWidth: true
|
||||
month: model.month
|
||||
year: model.year
|
||||
locale: Qt.locale()
|
||||
delegate: CalendarDay{}
|
||||
}
|
||||
}
|
||||
ScrollIndicator.horizontal: ScrollIndicator { }
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
root.eventSignal.connect(showEvents);
|
||||
if (calendartab.calendartabstatus=="Events"){showEvents("")}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,117 +0,0 @@
|
|||
// 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.0
|
||||
import QtQuick.Controls 2.4
|
||||
import "qrc:/js/service.js" as Service
|
||||
import "qrc:/js/helper.js" as Helperjs
|
||||
import "qrc:/qml/genericqml"
|
||||
|
||||
Rectangle{
|
||||
id:eventList
|
||||
z:2
|
||||
border.color: "grey"
|
||||
width: parent.width-4*mm
|
||||
height:parent.height-12*mm
|
||||
x:mm
|
||||
y:mm
|
||||
property var daylist:[]
|
||||
|
||||
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"
|
||||
onClicked:{eventList.destroy()}
|
||||
}
|
||||
ListView {
|
||||
id: eventlistView
|
||||
x: mm
|
||||
y:closeButton.height+2*mm
|
||||
width: eventList.width-2*mm
|
||||
height: eventList.height-closeButton.height-4*mm
|
||||
clip: true
|
||||
model: eventModel
|
||||
delegate: eventItem
|
||||
}
|
||||
|
||||
ListModel{
|
||||
id: eventModel
|
||||
}
|
||||
|
||||
Component.onCompleted:{
|
||||
for (var i=0; i<daylist.length;i++){
|
||||
var liststate="";if(daylist.length<2){liststate="large"}
|
||||
eventModel.append({"event":events[daylist[i]],"eventstatus":liststate});
|
||||
}
|
||||
}
|
||||
|
||||
Component{
|
||||
id:eventItem
|
||||
Rectangle{
|
||||
property string status: eventstatus
|
||||
width:eventlistView.width
|
||||
height:eventNameText.height+eventDetailsText.height+mm
|
||||
border.color: "light grey"
|
||||
border.width: 1
|
||||
Text {
|
||||
id:eventNameText
|
||||
x:mm
|
||||
width:parent.width
|
||||
height:contentHeight
|
||||
text: new Date(event.start+calendarrectangle.offsetTime).toLocaleTimeString()+": "+event.title
|
||||
font.pixelSize: 3*mm
|
||||
wrapMode:Text.Wrap
|
||||
}
|
||||
|
||||
Text {
|
||||
id:eventDetailsText
|
||||
x:mm
|
||||
z:4
|
||||
width: parent.width
|
||||
height: contentHeight
|
||||
text: status==""?"":Qt.atob(event.html)
|
||||
anchors.top: eventNameText.bottom
|
||||
font.pixelSize: 3*mm
|
||||
wrapMode:Text.Wrap
|
||||
}
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
onClicked:{if (status==""){status="large"} else {status=""}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
1
source-android/qml/configqml
Symbolic link
1
source-android/qml/configqml
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
./../../source-linux/qml/configqml/
|
||||
|
|
@ -1,463 +0,0 @@
|
|||
// 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
|
||||
// })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,227 +0,0 @@
|
|||
// 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}
|
||||
// })
|
||||
// }
|
||||
}
|
||||
|
|
@ -1,482 +0,0 @@
|
|||
// 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 1.2
|
||||
|
||||
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"
|
||||
|
||||
StackView{
|
||||
id: configStack
|
||||
anchors.fill:parent
|
||||
initialItem: Flickable{
|
||||
width:root.width-5*mm
|
||||
height:root.height-12*mm
|
||||
contentHeight: configBackground.height
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
|
||||
Rectangle{
|
||||
id:configBackground
|
||||
color: "white"
|
||||
width:parent.width
|
||||
height:Math.max(90*mm,root.height-12*mm)
|
||||
property var users:[]
|
||||
property bool registeredUser: true
|
||||
property var userdata: ({})
|
||||
|
||||
function setServericon(server){
|
||||
try {Helperjs.friendicaWebRequest(server+"/api/statusnet/config",configBackground, function (obj){
|
||||
var serverdata = JSON.parse(obj);
|
||||
servericon.visible=true;
|
||||
servericon.source=serverdata.site.logo})} catch(e){print(e)}
|
||||
}
|
||||
|
||||
BlueButton{
|
||||
id:userButton
|
||||
text:qsTr("User")
|
||||
y:mm
|
||||
width: root.width/2
|
||||
onClicked:{
|
||||
var useritems="";
|
||||
for (var i=0;i<configBackground.users.length;i++){
|
||||
|
||||
useritems=useritems+"MenuItem{text:'"+configBackground.users[i].username+
|
||||
"'; onTriggered: {Service.readConfig(db,function(obj){
|
||||
configBackground.registeredUser=true;
|
||||
userButton.text=obj.username;
|
||||
servername.text=obj.server;
|
||||
configBackground.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;
|
||||
if( obj.isActive==0){userButton.fontColor='black'} else {userButton.fontColor='grey'}
|
||||
},'username','"+configBackground.users[i].username+"')}}"
|
||||
}
|
||||
var menuString="import QtQuick.Controls 1.4;import 'qrc:/js/service.js' as Service; Menu {"+useritems+"}";
|
||||
var userlistObject=Qt.createQmlObject(menuString,configBackground,"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: 60*mm
|
||||
}
|
||||
Text {
|
||||
text: qsTr("Sync Interval (0=None)")
|
||||
font.pixelSize:3*mm
|
||||
//visible: false
|
||||
x: 4*mm; y: 70*mm; //width:35*mm;wrapMode: Text.Wrap
|
||||
}
|
||||
|
||||
// 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, configBackground, function(configString){
|
||||
var serverconfigObject=Qt.createQmlObject(configString,configBackground,"serverconfigOutput");})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BlueButton{
|
||||
id:serverSearchButton
|
||||
text:"\uf002"
|
||||
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,14) =="https://...http"){
|
||||
serverstring.text= (serverstring.text).substring(11)
|
||||
}
|
||||
configBackground.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"),configBackground)
|
||||
}
|
||||
// Helperjs.friendicaWebRequest(servername.text+'/api/users/show?screen_name='+username.text,configBackground,function(obj){
|
||||
// var screennametest=JSON.parse(obj);
|
||||
// if (screennametest.hasOwnProperty('status')){
|
||||
// Helperjs.showMessage(qsTr("Error"),qsTr("Nickname not registered at given server!"),configBackground);
|
||||
// configBackground.registeredUser=false;
|
||||
// }else{configBackground.registeredUser=true}
|
||||
// });
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
BlueButton {
|
||||
x: root.width-9*mm; y: 23.5*mm; width:7*mm
|
||||
text: "\uf234"
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
BlueButton {
|
||||
x: root.width-9*mm; y: 43.5*mm; width: 7*mm; height: 5*mm;
|
||||
text: "..."
|
||||
onClicked:
|
||||
{imagestoreDialog.open()}
|
||||
}
|
||||
|
||||
|
||||
Slider{ id: maxNews
|
||||
x:19*mm; y: 53.5*mm;width: root.width/2;height:5*mm
|
||||
minimumValue: 0;maximumValue: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: 63.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()
|
||||
}
|
||||
}
|
||||
Slider{ id: messageIntervalSlider
|
||||
x:22*mm; y: 73.5*mm;width: root.width/2;height:5*mm
|
||||
minimumValue: 0;maximumValue: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"
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
BlueButton {
|
||||
x: 4*mm; y: 83.5*mm
|
||||
text: qsTr("Confirm")
|
||||
onClicked:{
|
||||
var userconfig={server: servername.text, username: username.text, password:Qt.btoa(password.text), imagestore:imagestore.text,maxnews:maxNewsText.text,interval: messageIntervalField.text, newsViewType:newsTypeField.text};
|
||||
var errormessage="";
|
||||
if (servername.text==""){errormessage=qsTr("No server given! ")}
|
||||
else if (username.text==""){errormessage+=qsTr("No nickname given! ")}
|
||||
else if ((configBackground.registeredUser==false)){errormessage+=qsTr("Nickname not registered at given server! ")}
|
||||
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){
|
||||
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;
|
||||
});
|
||||
configBackground.users=storedUsers});
|
||||
userButton.color="black"
|
||||
//reset values
|
||||
root.login=userconfig;
|
||||
root.news=[];
|
||||
},"isActive",0);
|
||||
Service.requestProfile(userconfig,db,root,function(nc){root.newContacts=nc});
|
||||
if(osSettings.osType=="Android" && userconfig.timerInterval !=0){
|
||||
alarm.setAlarm(userconfig.timerInterval);
|
||||
}
|
||||
Helperjs.showMessage(qsTr("Success"),qsTr("Name")+": "+credentials.name+"\nScreen Name: "+credentials.screen_name,root)
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
else {Helperjs.showMessage(qsTr("Error"), errormessage,root)}
|
||||
}}
|
||||
|
||||
|
||||
|
||||
BlueButton {
|
||||
x: root.width/2+2*mm; y: mm; width: 5*mm; height: 5*mm;
|
||||
text: "-"
|
||||
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();
|
||||
configBackground.registeredUser=true;
|
||||
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;
|
||||
})
|
||||
configBackground.users=storedUsers;})
|
||||
})
|
||||
}}
|
||||
|
||||
BlueButton {
|
||||
x: root.width/2+8*mm; y: mm; width: 5*mm; height: 5*mm;
|
||||
text: "+"
|
||||
onClicked:{
|
||||
configBackground.registeredUser=true;
|
||||
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")
|
||||
}
|
||||
}
|
||||
|
||||
BlueButton {
|
||||
x: root.width/2+14*mm; y: mm; width: 5*mm; height: 5*mm;
|
||||
text: "?"
|
||||
onClicked:{
|
||||
configStack.push({item:"qrc:/qml/configqml/InfoBox.qml"});
|
||||
}
|
||||
}
|
||||
|
||||
Menu {
|
||||
id:newstypemenu
|
||||
MenuItem {
|
||||
text: qsTr("Timeline")
|
||||
onTriggered: {newsTypeField.text="Timeline"}
|
||||
}
|
||||
MenuItem {
|
||||
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;
|
||||
})
|
||||
configBackground.users=storedUsers;
|
||||
Service.readConfig(db,function(obj){
|
||||
userButton.text=obj.username;
|
||||
servername.text=obj.server;
|
||||
configBackground.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.fontColor='black'} else {userButton.fontColor='grey'}},"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",configBackground,function(html){
|
||||
var bpos=html.indexOf("baseurl");
|
||||
var baseurl=html.substring(html.indexOf("http",bpos),html.indexOf('"',html.indexOf("http",bpos)));
|
||||
servername.text=baseurl
|
||||
})}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,72 +0,0 @@
|
|||
// 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.0
|
||||
import QtQuick.Controls 2.4
|
||||
import "qrc:/qml/genericqml"
|
||||
|
||||
Rectangle{
|
||||
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
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
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>"+
|
||||
"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()}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
// 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.Window 2.0
|
||||
import QtQuick 2.0
|
||||
QtObject{
|
||||
property int appWidth: Screen.desktopAvailableWidth
|
||||
property int appHeight: Screen.desktopAvailableHeight
|
||||
property int backKey: Qt.Key_Back
|
||||
//property string attachImageDir:filesystem.cameraPath+"/"
|
||||
property string osType: "Android"
|
||||
property string imagePickQml: "ImagePicker"
|
||||
property string imagePicker:'import QtQuick 2.0; import "qrc:/qml/genericqml";'+
|
||||
imagePickQml+'{multiple : true;onReady: {attachImageURLs.push(imageUrl);'+
|
||||
'attachImage(imageUrl)}}'
|
||||
}
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
// 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.0
|
||||
QtObject{
|
||||
property real appWidth: 500
|
||||
property real appHeight: 500
|
||||
property int backKey: Qt.Key_Escape
|
||||
property string osType: "Linux"
|
||||
//property string attachImageDir:filesystem.homePath+"/Pictures/"
|
||||
property string imagePickQml: "ImagePickerLinux"
|
||||
}
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
// 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.9
|
||||
import QtQuick.Controls 2.5
|
||||
import QtWebView 1.1
|
||||
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
|
||||
width:parent.width
|
||||
y:7*mm
|
||||
MouseArea {anchors.fill:parent;
|
||||
onClicked:{
|
||||
//print(url)
|
||||
}
|
||||
}
|
||||
//onLoadingChanged: print(loadProgress)
|
||||
}
|
||||
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()}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
// 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,101 +0,0 @@
|
|||
// 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()}
|
||||
}
|
||||
}
|
||||
1
source-android/qml/contactqml
Symbolic link
1
source-android/qml/contactqml
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
./../../source-linux/qml/contactqml/
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
// 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.0
|
||||
import QtQuick.Controls 2.4
|
||||
import "qrc:/qml/genericqml"
|
||||
|
||||
Item {
|
||||
id: contactComponent
|
||||
height: 8*mm
|
||||
width: parent.width
|
||||
property var createdAtDate: new Date(contact.created_at)
|
||||
property string connectUrl: (contact.network!=="dfrn")||(contact.isFriend==1)?"":( "<a href='"+contact.url.replace("profile","dfrn_request") +"'>"+qsTr("Connect")+"</a><br>")
|
||||
|
||||
Rectangle {
|
||||
id: wrapper
|
||||
width:parent.width
|
||||
height: 8*mm
|
||||
border.color: "grey"
|
||||
color:"white"
|
||||
Image {
|
||||
id: photoImage
|
||||
x:0.5*mm
|
||||
y:0.5*mm
|
||||
width: 7*mm
|
||||
height:7*mm
|
||||
source:((contact.profile_image!="") && (typeof(contact.profile_image)=="string"))? "file://"+contact.profile_image : contact.profile_image_url
|
||||
onStatusChanged: {if (photoImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}}
|
||||
}
|
||||
|
||||
Column{
|
||||
width: wrapper.width-8*mm
|
||||
anchors.left: photoImage.right
|
||||
anchors.margins: 1*mm
|
||||
spacing: mm
|
||||
Label {
|
||||
id: namelabel
|
||||
width: wrapper.width-4
|
||||
height: 3*mm
|
||||
text: contact.name
|
||||
elide:Text.ElideRight
|
||||
color: "#303030"
|
||||
font.pixelSize: 3*mm
|
||||
}
|
||||
Label {
|
||||
id: screennamelabel
|
||||
width: wrapper.width-8*mm
|
||||
height: 2.5*mm
|
||||
text: "@"+contact.screen_name
|
||||
elide:Text.ElideRight
|
||||
color: "#303030"
|
||||
font.pixelSize: 2.5*mm
|
||||
}
|
||||
}
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
onClicked:{
|
||||
rootstack.currentIndex=0;
|
||||
bar.currentIndex=0;
|
||||
root.contactdetailsSignal(contact)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,176 +0,0 @@
|
|||
// 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.0
|
||||
import QtQuick.Controls 2.4
|
||||
import "qrc:/qml/genericqml"
|
||||
|
||||
Item {
|
||||
id: contactLargeComponent
|
||||
x:mm
|
||||
y:mm
|
||||
property var contact:({})
|
||||
property var createdAtDate: new Date(contact.created_at)
|
||||
property string connectUrl: (contact.network!=="dfrn")||(contact.isFriend!=0)?"":( "<a href='"+contact.url.replace("profile","dfrn_request") +"'>"+qsTr("Connect")+"</a><br>")
|
||||
|
||||
Rectangle {
|
||||
id: wrapper
|
||||
|
||||
width:root.width-2*mm //friendsTabView.width;
|
||||
height:root.height-20*mm// friendsTabView.height-15*mm
|
||||
border.color: "grey"
|
||||
color:"white"
|
||||
Image {
|
||||
id: photoImage
|
||||
x:mm
|
||||
y:mm
|
||||
width: 15*mm
|
||||
height:15*mm
|
||||
source:(contact.profile_image!="")? "file://"+contact.profile_image : contact.profile_image_url
|
||||
onStatusChanged: if (photoImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
|
||||
}
|
||||
|
||||
Label {
|
||||
id: namelabel
|
||||
x: mm
|
||||
width: root.width-6*mm //friendsTabView.width-4*mm
|
||||
height: 3*mm
|
||||
text:contact.name+" (@"+contact.screen_name+")"
|
||||
elide:Text.ElideRight
|
||||
anchors.topMargin: 0
|
||||
anchors.left: photoImage.left
|
||||
color: "#303030"
|
||||
font.pixelSize: 4*mm
|
||||
anchors.top: photoImage.bottom
|
||||
}
|
||||
Rectangle{
|
||||
id: detailsrectangle
|
||||
anchors.top: namelabel.bottom
|
||||
anchors.topMargin: 2*mm
|
||||
|
||||
ScrollView{
|
||||
horizontalScrollBarPolicy:Qt.ScrollBarAlwaysOff
|
||||
//frameVisible: true
|
||||
id:namelabelflickable
|
||||
width: root.width-10*mm
|
||||
height:root.height-50*mm
|
||||
x: mm
|
||||
clip:true
|
||||
Text{
|
||||
id:namelabeltext
|
||||
width: namelabelflickable.width
|
||||
height: implicitHeight
|
||||
font.pixelSize: 3*mm
|
||||
textFormat:Text.RichText
|
||||
wrapMode: Text.Wrap
|
||||
text:"<b>"+qsTr("Description")+": </b> "+contact.description+"<br> <b>"+qsTr("Location")+":</b> "+contact.location+"<br> <b>"+qsTr("Posts")+":</b> "+contact.statuses_count+
|
||||
"<br> <b>"+qsTr("URL")+":</b> <a href='"+ contact.url+"'>"+contact.url+"</a><br>"+
|
||||
connectUrl+ "<b>"+qsTr("Created at")+":</b> "+createdAtDate.toLocaleString(Qt.locale())
|
||||
onLinkActivated: {
|
||||
Qt.openUrlExternally(link)}
|
||||
}
|
||||
}
|
||||
|
||||
Row{
|
||||
anchors.top: namelabelflickable.bottom
|
||||
anchors.topMargin: 2*mm
|
||||
x: mm
|
||||
spacing:4
|
||||
|
||||
MButton{
|
||||
id:photobutton
|
||||
height: 6*mm
|
||||
width: 8*mm
|
||||
text: "\uf03e" // "Photos"
|
||||
visible:(contact.network=="dfrn")
|
||||
onClicked:{
|
||||
fotostab.phototabstatus="Contact";
|
||||
root.currentIndex=2;
|
||||
fotostab.active=true;
|
||||
root.fotoSignal(contact) ;
|
||||
contactLargeComponent.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
MButton{
|
||||
id:messagebutton
|
||||
height: 6*mm
|
||||
width: 8*mm
|
||||
text: "\uf0e6" //"Messages"
|
||||
onClicked:{
|
||||
root.currentIndex=0;
|
||||
//newstab.active=true;
|
||||
root.messageSignal(contact) ;
|
||||
contactLargeComponent.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
MButton{
|
||||
id:dmbutton
|
||||
visible: (contact.following=="true")
|
||||
height: 6*mm
|
||||
width: 8*mm
|
||||
text: "\uf040" //"DM"
|
||||
onClicked:{
|
||||
root.currentIndex=0;
|
||||
root.directmessageSignal(contact.screen_name);
|
||||
contactLargeComponent.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Button{
|
||||
id:eventbutton
|
||||
visible:(contact.network=="dfrn")
|
||||
height: 6*mm
|
||||
width: 8*mm
|
||||
text:"\uf073" //Events
|
||||
onClicked:{
|
||||
root.currentIndex=3;
|
||||
calendartab.active=true;
|
||||
calendartab.calendartabstatus="Friend"
|
||||
root.eventSignal(contact);
|
||||
contactLargeComponent.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
Button{
|
||||
id: closeButton
|
||||
height: 6*mm
|
||||
width: 8*mm
|
||||
text: "\uf057" //"close"
|
||||
onClicked:{contactLargeComponent.destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,135 +0,0 @@
|
|||
// 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/>.
|
||||
|
||||
// List of people
|
||||
import QtQuick 2.0
|
||||
import QtQuick.Controls 2.5
|
||||
import "qrc:/js/helper.js" as Helperjs
|
||||
import "qrc:/qml/genericqml"
|
||||
|
||||
Rectangle {
|
||||
id:contactlistRectangle
|
||||
property var contacts:[]
|
||||
property var possibleUsers: []
|
||||
//y:8*mm
|
||||
color: "white"
|
||||
border.color: "light grey"
|
||||
radius:0.5*mm
|
||||
width:groupListView.width
|
||||
height:groupListView.height
|
||||
|
||||
ListView {
|
||||
id: contactView
|
||||
x:mm
|
||||
y:6*mm
|
||||
width: contactlistRectangle.width-2*mm
|
||||
height: contactlistRectangle.height-10*mm
|
||||
clip: true
|
||||
spacing: 0
|
||||
model: contactModel
|
||||
delegate: listContact
|
||||
}
|
||||
|
||||
ListModel{id: contactModel}
|
||||
|
||||
Component { id:listContact
|
||||
Rectangle{
|
||||
border.color: "#EEEEEE"
|
||||
border.width: 1
|
||||
radius:0.5*mm
|
||||
width:contactView.width
|
||||
height:6*mm
|
||||
Image {
|
||||
id: contactImage
|
||||
x:1
|
||||
y:1
|
||||
width: 5*mm
|
||||
height:5*mm
|
||||
source:(contact.profile_image!="")? "file://"+contact.profile_image : contact.profile_image_url
|
||||
onStatusChanged: if (contactImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
|
||||
}
|
||||
Text{
|
||||
font.pixelSize: 3*mm
|
||||
anchors.left: contactImage.right
|
||||
anchors.margins: 1*mm
|
||||
text:Qt.atob(contact.name)
|
||||
}
|
||||
Text {
|
||||
id:selected
|
||||
anchors.right:parent.right
|
||||
visible: contactlist.indexOf(contact)>-1
|
||||
z:4
|
||||
text: "\u2713"
|
||||
width: 5*mm
|
||||
anchors.top: parent.top
|
||||
color: "green"
|
||||
font.pixelSize: 3*mm
|
||||
}
|
||||
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
onClicked:{
|
||||
if(selected.visible==true){
|
||||
contacts.splice(Helperjs.inArray(contacts,"id",contact.id),1);
|
||||
selected.visible=false
|
||||
}
|
||||
else{
|
||||
contacts.push(contact);
|
||||
selected.visible=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
//color:"white"
|
||||
text: "\uf057"
|
||||
onClicked: {
|
||||
groupModelAppend(contacts,function(){
|
||||
contactlistRectangle.destroy()
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
for (var user in possibleUsers){
|
||||
contactModel.append({"contact":possibleUsers[user]})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,392 +0,0 @@
|
|||
// 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 QtQuick.Controls.Styles 1.4
|
||||
import QtQuick.Layouts 1.11
|
||||
import QtQuick.LocalStorage 2.0
|
||||
import "qrc:/js/helper.js" as Helperjs
|
||||
import "qrc:/js/news.js" as Newsjs
|
||||
import "qrc:/js/service.js" as Service
|
||||
import "qrc:/qml/contactqml"
|
||||
import "qrc:/qml/genericqml"
|
||||
|
||||
Rectangle {
|
||||
y:1
|
||||
color: "white"
|
||||
|
||||
function showContactdetails(contact){
|
||||
var component = Qt.createComponent("qrc:/qml/contactqml/ContactDetailsComponent.qml");
|
||||
if(contact.isFriend){
|
||||
friendsTabView.currentIndex=1;
|
||||
var contactDetails = component.createObject(friendstab,{"contact": contact})
|
||||
}
|
||||
else{friendsTabView.currentIndex=2;
|
||||
var contactDetails = component.createObject(friendstab,{"contact": contact})
|
||||
}
|
||||
}
|
||||
|
||||
function showProfile(callback){
|
||||
var profile=({});
|
||||
Helperjs.readData(db,"profiles",login.username,function(profileobject){
|
||||
var profilearray=[];
|
||||
for (var i in profileobject){
|
||||
profilearray.push(JSON.parse(Qt.atob(profileobject[i].profiledata)));
|
||||
}
|
||||
profile.profiles=profilearray;
|
||||
});
|
||||
Helperjs.readData(db,"contacts",login.username,function(owner){
|
||||
profile.friendica_owner=owner[0];
|
||||
},"isFriend",2);
|
||||
callback(profile)
|
||||
}
|
||||
|
||||
TabBar {
|
||||
id: friendsbar
|
||||
width: parent.width
|
||||
height: 9*mm
|
||||
position:TabBar.Header
|
||||
currentIndex: 1
|
||||
TabButton {
|
||||
text: qsTr("Me")
|
||||
font.pixelSize: 2*mm
|
||||
}
|
||||
TabButton {
|
||||
text: qsTr("Friends")
|
||||
font.pixelSize: 2*mm
|
||||
}
|
||||
TabButton {
|
||||
text: qsTr("Contacts")
|
||||
font.pixelSize: 2*mm
|
||||
}
|
||||
TabButton {
|
||||
text: qsTr("Groups")
|
||||
font.pixelSize: 2*mm
|
||||
}
|
||||
}
|
||||
StackLayout{
|
||||
id:friendsTabView
|
||||
//anchors.fill: parent
|
||||
x:mm
|
||||
y:10*mm
|
||||
width: parent.width-2*mm
|
||||
height: parent.height-10*mm
|
||||
currentIndex: friendsbar.currentIndex
|
||||
signal contactsSignal(var contact)
|
||||
signal groupsSignal(var username)
|
||||
onCurrentIndexChanged:{
|
||||
if (currentIndex==1){
|
||||
contactsSignal("")
|
||||
}
|
||||
else if (currentIndex==2){
|
||||
contactsSignal("")
|
||||
}
|
||||
else if (currentIndex==3){groupsSignal(root.login.username)}
|
||||
}
|
||||
// style: TabViewStyle {
|
||||
// frameOverlap: 1
|
||||
// tab: Rectangle {
|
||||
// color: "white"
|
||||
// implicitWidth: root.width/4-2*mm
|
||||
// implicitHeight: 4*mm
|
||||
// Text { id: text
|
||||
// anchors.centerIn: parent
|
||||
// text: styleData.title
|
||||
// color: "dark grey"
|
||||
// font.pixelSize:2.5*mm
|
||||
// font.bold: styleData.selected
|
||||
// }
|
||||
// }
|
||||
// frame: Rectangle { color: "light grey" }
|
||||
// tabsAlignment:Qt.AlignHCenter
|
||||
// }
|
||||
|
||||
Item{
|
||||
id:profileGridTab
|
||||
Layout.fillWidth:true
|
||||
Layout.fillHeight: true
|
||||
Component.onCompleted:{
|
||||
showProfile(function(profile){
|
||||
var component = Qt.createComponent("qrc:/qml/contactqml/ProfileComponent.qml");
|
||||
var profilecomp = component.createObject(profileGridTab,{"profile": profile});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Item{
|
||||
id: friendsGridTab
|
||||
Layout.fillWidth:true
|
||||
Layout.fillHeight: true
|
||||
property int currentContact: 0
|
||||
function showFriends(contact){
|
||||
try {friendsModel.clear()} catch(e){print(e)};
|
||||
Helperjs.readData(root.db,"contacts",login.username,function(friendsobject){
|
||||
for (var i=0;i<friendsobject.length;i++){
|
||||
friendsobject[i].description=Qt.atob(friendsobject[i].description);
|
||||
friendsobject[i].name=Qt.atob(friendsobject[i].name);
|
||||
if(Helperjs.getCount(db,login,"contacts","screen_name",friendsobject[i].screen_name)>1){
|
||||
friendsobject[i].screen_name=friendsobject[i].screen_name+"+"+friendsobject[i].cid
|
||||
}
|
||||
friendsModel.append({"contact":friendsobject[i]});
|
||||
}
|
||||
},"isFriend",1,"screen_name ASC");
|
||||
}
|
||||
Connections{
|
||||
target:xhr
|
||||
onDownloaded:{
|
||||
if(type=="contactlist"){
|
||||
//print(url+" "+filename+" "+i)
|
||||
friendsGridTab.currentContact=i+1;
|
||||
if(friendsGridTab.currentContact==root.newContacts.length){
|
||||
friendsGridTab.showFriends(root.login.username)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
MButton {
|
||||
id: updateFriendsButton
|
||||
text: "\uf021"
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: mm
|
||||
anchors.right: parent.right
|
||||
height: 6*mm
|
||||
width: 8*mm
|
||||
onClicked: {
|
||||
try {friendsModel.clear()} catch(e){print(e)};
|
||||
//root.contactLoadType="friends";
|
||||
Newsjs.requestFriends(root.login,db,root,function(nc){
|
||||
root.newContacts=nc
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
ProgressBar{
|
||||
id: newContactsProgress
|
||||
width: 15*mm
|
||||
height: updateFriendsButton.height
|
||||
anchors.top: parent.top
|
||||
anchors.right:updateFriendsButton.left
|
||||
anchors.rightMargin:mm
|
||||
visible: (friendsGridTab.currentContact!=(root.newContacts.length))?true:false
|
||||
value: friendsGridTab.currentContact/root.newContacts.length
|
||||
}
|
||||
|
||||
//GridView {
|
||||
ListView{
|
||||
id: friendsView
|
||||
x:mm
|
||||
y:updateFriendsButton.height+2*mm
|
||||
width:friendsGridTab.width-2*mm
|
||||
height:friendsGridTab.height-updateFriendsButton.height-2*mm
|
||||
clip: true
|
||||
spacing: 2
|
||||
//add: Transition {
|
||||
// NumberAnimation { properties: "x,y"; from: 300; duration: 1000 }
|
||||
// }
|
||||
model: friendsModel
|
||||
delegate: ContactComponent { }
|
||||
}
|
||||
|
||||
ListModel{id:friendsModel}
|
||||
|
||||
Component.onCompleted: {
|
||||
root.friendsSignal.connect(showFriends);
|
||||
friendsTabView.contactsSignal.connect(showFriends);
|
||||
showFriends(root.login.username);
|
||||
root.newContacts=[]
|
||||
}
|
||||
}
|
||||
|
||||
Item{
|
||||
id: contactsGridTab
|
||||
Layout.fillWidth:true
|
||||
Layout.fillHeight: true
|
||||
function showContacts(contact){
|
||||
try {contactsModel.clear()} catch(e){print(e)};
|
||||
Helperjs.readData(db, "contacts",root.login.username,function(contactsobject){
|
||||
for (var j=0;j<contactsobject.length;j++){
|
||||
contactsobject[j].description=Qt.atob(contactsobject[j].description);
|
||||
contactsobject[j].name=Qt.atob(contactsobject[j].name);
|
||||
contactsModel.append({"contact":contactsobject[j]});
|
||||
}
|
||||
},"isFriend",0,"screen_name ASC");
|
||||
}
|
||||
MButton {
|
||||
id: cleanButton
|
||||
text: "\uf021"
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: mm
|
||||
anchors.right: parent.right
|
||||
height: 6*mm
|
||||
width: 8*mm
|
||||
onClicked: {
|
||||
Service.cleanContacts(root.login,root.db,function(){
|
||||
try {contactsModel.clear()} catch(e){print(e)};
|
||||
Helperjs.readData(db, "contacts",root.login.username,function(contactsobject){
|
||||
for (var j=0;j<contactsobject.length;j++){
|
||||
contactsobject[j].description=Qt.atob(contactsobject[j].description);
|
||||
contactsobject[j].name=Qt.atob(contactsobject[j].name);
|
||||
contactsModel.append({"contact":contactsobject[j]});
|
||||
}
|
||||
},"isFriend",0,"screen_name ASC");
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
ListView {
|
||||
id: contactsView
|
||||
x:mm
|
||||
y:cleanButton.height+2*mm
|
||||
width:contactsGridTab.width-2*mm
|
||||
height:contactsGridTab.height-cleanButton.height-2*mm
|
||||
clip: true
|
||||
//add: Transition {
|
||||
// NumberAnimation { properties: "x,y"; from: 300; duration: 1000 }
|
||||
// }
|
||||
model: contactsModel
|
||||
delegate: ContactComponent { }
|
||||
}
|
||||
|
||||
ListModel{id: contactsModel}
|
||||
Component.onCompleted: {
|
||||
friendsTabView.contactsSignal.connect(showContacts);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Item{
|
||||
id: groupsGridTab
|
||||
Layout.fillWidth:true
|
||||
Layout.fillHeight: true
|
||||
|
||||
function showGroups(username){
|
||||
try {groupsModel.clear()} catch(e){print(e)};
|
||||
Helperjs.readData(db, "groups",root.login.username,function(groupsobject){
|
||||
for (var j=0;j<groupsobject.length;j++){
|
||||
groupsModel.append({"group":groupsobject[j]});
|
||||
}})}
|
||||
|
||||
function updateGroup(login,database,group){
|
||||
// update groups
|
||||
//var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
|
||||
//var groupdata={"gid":group.id,"name":group.name,"user":group.user};
|
||||
//print("Groupdata "+JSON.stringify(group));
|
||||
var api="";
|
||||
if (group.new){api="/api/friendica/group_create.json?name="+group.name}else{api="/api/friendica/group_update.json?gid="+group.id}
|
||||
xhr.url= login.server + api;
|
||||
xhr.setLogin(login.username+":"+Qt.atob(login.password));
|
||||
xhr.clearParams();
|
||||
xhr.setParam("gid",group.id);
|
||||
xhr.setParam("name",group.name);
|
||||
xhr.setParam("user", group.user);
|
||||
xhr.setParam("json",group);
|
||||
xhr.post();
|
||||
}
|
||||
|
||||
Connections{
|
||||
target:xhr
|
||||
onError:{print(data)}//if (data=="image"){Helperjs.showMessage()}}
|
||||
onSuccess:{print("gruppe "+data);
|
||||
Newsjs.requestGroups(root.login,root.db,root,function(){
|
||||
showGroups(root.login.username)});
|
||||
}
|
||||
}
|
||||
MButton {
|
||||
id: updateGroupsButton
|
||||
text: "\uf021"
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: mm
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: mm
|
||||
height: 6*mm
|
||||
width: 8*mm
|
||||
onClicked: {
|
||||
Newsjs.requestGroups(root.login,root.db,root,function(){
|
||||
groupsGridTab.showGroups(root.login.username)})}
|
||||
}
|
||||
// BlueButton {
|
||||
// id: newGroupButton
|
||||
// text: "\uf234"
|
||||
// anchors.top: parent.top
|
||||
// anchors.topMargin: mm
|
||||
// anchors.right: updateGroupsButton.left
|
||||
// anchors.rightMargin: mm
|
||||
// onClicked: {
|
||||
// groupsModel.append({"group": {"new":true}});
|
||||
// }
|
||||
// }
|
||||
GridView {
|
||||
id: groupsView
|
||||
x:mm
|
||||
y:updateGroupsButton.height+2*mm
|
||||
width:groupsGridTab.width-2*mm
|
||||
height:groupsGridTab.height-updateGroupsButton.height-2*mm
|
||||
clip: true
|
||||
cellHeight: 16*mm
|
||||
cellWidth: 17*mm
|
||||
add: Transition {
|
||||
NumberAnimation { properties: "x,y"; from: 300; duration: 1000 }
|
||||
}
|
||||
model: groupsModel
|
||||
delegate: GroupComponent {}
|
||||
//footer:groupFooter
|
||||
}
|
||||
ListModel{
|
||||
id: groupsModel
|
||||
}
|
||||
// Component{
|
||||
// id: groupFooter
|
||||
// Image{
|
||||
// id: footerImage
|
||||
// width: 15*mm
|
||||
// height: 15*mm
|
||||
// fillMode: Image.PreserveAspectFit
|
||||
// source:"qrc:/images/addImage.png"
|
||||
// MouseArea{
|
||||
// anchors.fill: parent
|
||||
// onClicked:{
|
||||
// print("new group")
|
||||
// var component = Qt.createComponent("qrc:/qml/contactqml/GroupComponent.qml");
|
||||
// var imagedialog = component.createObject(groupsView,{"group": []});}
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
Component.onCompleted: {
|
||||
friendsTabView.groupsSignal.connect(showGroups);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Component.onCompleted: {
|
||||
//root.contactdetailsSignal.connect(showContactdetails);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,269 +0,0 @@
|
|||
// 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:/js/helper.js" as Helperjs
|
||||
import "qrc:/js/news.js" as Newsjs
|
||||
import "qrc:/qml/genericqml"
|
||||
|
||||
Item {
|
||||
id: groupComponent
|
||||
property var groupmembers:[]
|
||||
//property bool newGroup: false
|
||||
function groupModelAppend(groupcontacts,callback){
|
||||
for (var n in groupcontacts){
|
||||
groupModel.append({"groupmember":groupcontacts[n]});}
|
||||
callback()
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: wrapper
|
||||
width: 16*mm
|
||||
height: 15*mm
|
||||
border.color: "grey"
|
||||
color:"white"
|
||||
|
||||
Image {
|
||||
id: photoImage
|
||||
x:1
|
||||
y:1
|
||||
width: 10*mm
|
||||
height:10*mm
|
||||
source:"qrc:/images/defaultcontact.jpg"
|
||||
}
|
||||
Rectangle{
|
||||
id:namelabelRect
|
||||
x: 1
|
||||
width: wrapper.width-2
|
||||
height: 3.5*mm
|
||||
anchors.top: photoImage.bottom
|
||||
border.color: "light grey"
|
||||
TextInput {
|
||||
id: namelabel
|
||||
anchors.fill: parent
|
||||
readOnly: true
|
||||
text: group.new?"":group.groupname
|
||||
color: "#303030"
|
||||
font.pixelSize: 3*mm
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
MButton{
|
||||
id: closeButton
|
||||
visible: false
|
||||
width: 8*mm
|
||||
height: 6*mm
|
||||
anchors.left: infobutton.right
|
||||
anchors.margins: mm
|
||||
anchors.top: parent.top
|
||||
|
||||
text: "\uf057"
|
||||
font.pixelSize: 3*mm
|
||||
onClicked:{groupComponent.state="";
|
||||
if (group.new){groupsModel.remove(index)}
|
||||
}
|
||||
}
|
||||
|
||||
MButton{
|
||||
id:infobutton
|
||||
width: 4*mm
|
||||
height: 6*mm
|
||||
|
||||
//color:"transparent"
|
||||
text:"?"
|
||||
font.pixelSize: 3*mm
|
||||
anchors.left: photoImage.right
|
||||
anchors.leftMargin: mm
|
||||
anchors.topMargin: mm
|
||||
anchors.top: parent.top
|
||||
onClicked:{
|
||||
//if(group.new){
|
||||
Helperjs.readField("members",root.db,"groups",root.login.username,function(groups){
|
||||
try {groupModel.clear()}catch (e){print(e)}
|
||||
groupmembers=JSON.parse(groups);
|
||||
for (var user in groupmembers){
|
||||
Helperjs.readData(root.db,"contacts",root.login.username,function(userdata){
|
||||
if (userdata[0]){
|
||||
userdata[0].name=Qt.atob(userdata[0].name);
|
||||
userdata[0].description=Qt.atob(userdata[0].description)
|
||||
groupModel.append({"groupmember":userdata[0]
|
||||
})}
|
||||
},"id",groupmembers[user])
|
||||
} //catch(e){}
|
||||
},"groupname",group.groupname);
|
||||
//}
|
||||
groupComponent.state="large"
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle{
|
||||
id: detailsrectangle
|
||||
anchors.top: namelabelRect.bottom
|
||||
anchors.topMargin: mm
|
||||
opacity: 0
|
||||
|
||||
Component {
|
||||
id:groupMember
|
||||
Rectangle{
|
||||
width:parent.width
|
||||
height:6*mm
|
||||
Rectangle{id:memberrectangle
|
||||
border.color: "#EEEEEE"
|
||||
border.width: 1
|
||||
width:parent.width-12*mm
|
||||
height:6*mm
|
||||
Image {
|
||||
id: memberImage
|
||||
x:1
|
||||
y:1
|
||||
width: 5*mm
|
||||
height:5*mm
|
||||
source:(groupmember.isFriend==1)? "file://"+groupmember.profile_image :groupmember.profile_image_url
|
||||
onStatusChanged: if (photoImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
|
||||
}
|
||||
Text{
|
||||
font.pixelSize: 3*mm
|
||||
anchors.left: memberImage.right
|
||||
anchors.margins: 1*mm
|
||||
width:parent.width-1
|
||||
text:groupmember.name
|
||||
}
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
onClicked:{
|
||||
// root.currentIndex=1;
|
||||
// friendstab.active=true;
|
||||
// root.contactdetailsSignal(groupmember)
|
||||
root.currentIndex=0;
|
||||
root.contactdetailsSignal(groupmember)
|
||||
}
|
||||
}
|
||||
// BlueButton{
|
||||
// anchors.left: memberrectangle.right
|
||||
// anchors.margins: 1*mm
|
||||
// text: "\uf056"
|
||||
// onClicked:{
|
||||
// groupModel.remove(index)
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ListView{
|
||||
id: groupListView
|
||||
x:1
|
||||
//anchors.top: parent.top
|
||||
width: root.width-10*mm
|
||||
height:groupsView.height - 24*mm
|
||||
clip: true
|
||||
spacing: 2
|
||||
model: groupModel
|
||||
delegate: groupMember
|
||||
}
|
||||
|
||||
ListModel{id: groupModel}
|
||||
|
||||
Row{
|
||||
anchors.top: groupListView.bottom
|
||||
anchors.topMargin: mm
|
||||
spacing: mm
|
||||
|
||||
}
|
||||
|
||||
// BlueButton{
|
||||
// id: addMembers
|
||||
// text:"\uf234"
|
||||
// onClicked: {
|
||||
// Newsjs.listFriends(root.login,root.db,function(userdata){
|
||||
// var newlistcontacts=[];
|
||||
// for (var n in userdata){
|
||||
// if (groupmembers.indexOf(userdata[n].id)==-1){
|
||||
// newlistcontacts.push(userdata[n])
|
||||
// }
|
||||
// }
|
||||
// var component = Qt.createComponent("qrc:/qml/contactqml/Contactlist.qml");
|
||||
// var contactlistobject = component.createObject(groupListView,{"possibleUsers":newlistcontacts});
|
||||
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
|
||||
// BlueButton{
|
||||
// id: updateButton
|
||||
// text: "\uf0ee"
|
||||
// onClicked:{
|
||||
// var groupobject={};
|
||||
// var groupmembers=[];
|
||||
// for (var i=0;i<groupModel.count;i++){groupmembers.push(groupModel.get(i).groupmember)}
|
||||
// try{ groupobject.id=group.gid} catch(e){};
|
||||
// try{ groupobject.new=group.new} catch(e){};
|
||||
// if (namelabel.text==""){
|
||||
// Helperjs.showMessage(qsTr("Error"),qsTr("No name given"),root)}
|
||||
// else {
|
||||
// groupobject.name=namelabel.text;
|
||||
// groupobject.user=groupmembers;
|
||||
// updateGroup(login,db,groupobject)
|
||||
// groupComponent.state="";
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// BlueButton{
|
||||
// id: deleteButton
|
||||
// text: "\uf056"
|
||||
// onClicked:{
|
||||
// Newsjs.deleteGroup(root.login,root.db,root,group,function(){
|
||||
// groupComponent.state="";
|
||||
// groupsModel.remove(index)})
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
Component.onCompleted:{if(group.new){groupComponent.state="large"}}
|
||||
}
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "large"
|
||||
PropertyChanges { target: namelabel; font.pixelSize: 4*mm; width:groupsView.width; readOnly:false}
|
||||
PropertyChanges { target: namelabelRect; height: 4.5*mm}
|
||||
PropertyChanges { target: closeButton; visible: true}
|
||||
PropertyChanges { target: groupComponent; z: 2 }
|
||||
PropertyChanges { target: wrapper; width:groupsView.width;height:groupsView.height -2*mm-1}
|
||||
PropertyChanges { target: photoImage; width:15*mm;height:15*mm }
|
||||
PropertyChanges { target:groupComponent.GridView.view ;contentY:groupComponent.y;contentX:groupComponent.x;interactive:false}
|
||||
PropertyChanges { target: detailsrectangle; opacity:1 }
|
||||
PropertyChanges { target: infobutton; visible: false}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -1,285 +0,0 @@
|
|||
// 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.0
|
||||
import QtQuick.Controls 2.4
|
||||
import "qrc:/qml/genericqml"
|
||||
import "qrc:/js/service.js" as Service
|
||||
|
||||
Rectangle {
|
||||
// width:parent.width-2*mm
|
||||
// height:parent.height-14*mm
|
||||
anchors.fill:parent
|
||||
color:"white"
|
||||
property var profile:({})
|
||||
property var attachImageURLs:[]
|
||||
property var createdAtDate: new Date(profile.friendica_owner.created_at)
|
||||
|
||||
function updateProfileImage(){
|
||||
xhr.url= login.server + "/api/account/update_profile_image.json";
|
||||
xhr.setLogin(login.username+":"+Qt.atob(login.password));
|
||||
xhr.clearParams();
|
||||
xhr.setImageFileParam("image", photoImage.source );
|
||||
xhr.post();
|
||||
}
|
||||
|
||||
function buildProfiletext(pobject,callback){
|
||||
var profileobject={};
|
||||
var profiletext="";
|
||||
for (var key in pobject){//print(key+obj[key])
|
||||
if(pobject[key]!=""&&key!="users"&&key!="profile_id"){
|
||||
var keytext="";
|
||||
switch(key){
|
||||
case "profile_name":keytext=qsTr("profile name");break;
|
||||
case "is_default":keytext=qsTr("is default");break;
|
||||
case "hide_friends":keytext=qsTr("hide friends");break;
|
||||
case "profile_photo":keytext=qsTr("profile photo");break;
|
||||
case "profile_thumb":keytext=qsTr("profile thumb");break;
|
||||
case "publish":keytext=qsTr("publish");break;
|
||||
case "net_publish":keytext=qsTr("publish in network");break;
|
||||
case "description":keytext=qsTr("description");break;
|
||||
case "date_of_birth":keytext=qsTr("date of birth");break;
|
||||
case "address":keytext=qsTr("address");break;
|
||||
case "city":keytext=qsTr("city");break;
|
||||
case "region":keytext=qsTr("region");break;
|
||||
case "postal_code":keytext=qsTr("postal code");break;
|
||||
case "country":keytext=qsTr("country");break;
|
||||
case "hometown":keytext=qsTr("hometown");break;
|
||||
case "gender":keytext=qsTr("gender");break;
|
||||
case "marital":keytext=qsTr("marital status");break;
|
||||
case "marital_with":keytext=qsTr("married with");break;
|
||||
case "marital_since":keytext=qsTr("married since");break;
|
||||
case "sexual":keytext=qsTr("sexual");break;
|
||||
case "politic":keytext=qsTr("politics");break;
|
||||
case "religion":keytext=qsTr("religion");break;
|
||||
case "public_keywords":keytext=qsTr("public keywords");break;
|
||||
case "private_keywords":keytext=qsTr("private keywords");break;
|
||||
case "likes":keytext=qsTr("likes");break;
|
||||
case "dislikes":keytext=qsTr("dislikes");break;
|
||||
case "about":keytext=qsTr("about");break;
|
||||
case "music":keytext=qsTr("music");break;
|
||||
case "book":keytext=qsTr("book");break;
|
||||
case "tv":keytext=qsTr("tv");break;
|
||||
case "film":keytext=qsTr("film");break;
|
||||
case "interest":keytext=qsTr("interest");break;
|
||||
case "romance":keytext=qsTr("romance");break;
|
||||
case "work":keytext=qsTr("work");break;
|
||||
case "education":keytext=qsTr("education");break;
|
||||
case "social_networks":keytext=qsTr("social networks");break;
|
||||
case "homepage":keytext=qsTr("homepage");break;
|
||||
default:keytext=key;
|
||||
}
|
||||
profiletext=profiletext+("<b>"+keytext+": </b> "+(pobject[key])+"<br>");
|
||||
}
|
||||
}
|
||||
callback(profiletext)
|
||||
}
|
||||
|
||||
MButton {
|
||||
id: update
|
||||
height: 6*mm
|
||||
width: 8*mm
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: mm
|
||||
anchors.right: parent.right
|
||||
text: "\uf021"
|
||||
font.pixelSize: 3*mm
|
||||
onClicked: {
|
||||
Service.requestProfile(root.login,root.db,root,function(nc){
|
||||
root.newContacts=nc;
|
||||
photoImage.source="";
|
||||
showProfile(function(newprofile){
|
||||
profile=newprofile;
|
||||
try {profileModel.clear()} catch(e){print(e)};
|
||||
newprofile.profiles.sort(function(obj1, obj2) {
|
||||
return obj1.profile_id - obj2.profile_id;
|
||||
})
|
||||
for(var i in newprofile.profiles){var obj=newprofile.profiles[i];
|
||||
buildProfiletext(obj,function(profiletext){
|
||||
profileModel.append({"profileid":obj.profile_id,"profiletext":profiletext})
|
||||
})
|
||||
}
|
||||
photoImage.source="file://"+newprofile.friendica_owner.profile_image;
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Image {
|
||||
id: photoImage
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: mm
|
||||
anchors.left: parent.left
|
||||
width: 15*mm
|
||||
height:15*mm
|
||||
source: "file://"+profile.friendica_owner.profile_image
|
||||
onStatusChanged: if (photoImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
onClicked:{
|
||||
imagePicking=true;
|
||||
var imagePicker = Qt.createQmlObject('import QtQuick 2.0; import "qrc:/qml/genericqml";'+
|
||||
osSettings.imagePickQml+'{multiple: false;onReady: {photoImage.source=imageUrl;'+
|
||||
'}}',profileGridTab,"imagePicker");
|
||||
imagePicker.pickImage()
|
||||
}
|
||||
}
|
||||
}
|
||||
Rectangle{
|
||||
id:phototextRectangle
|
||||
color:"black"
|
||||
z:3
|
||||
opacity: 0.5
|
||||
width:6*mm
|
||||
height: phototext.contentHeight
|
||||
anchors.top: photoImage.top
|
||||
anchors.right: photoImage.right
|
||||
}
|
||||
Text {
|
||||
id:phototext
|
||||
z:4
|
||||
text: "\uf040"
|
||||
width:5*mm
|
||||
anchors.top: photoImage.top
|
||||
anchors.right:photoImage.right
|
||||
color: "white"
|
||||
font.pixelSize: 4*mm
|
||||
}
|
||||
|
||||
MButton{
|
||||
id:updatebutton
|
||||
height: 6*mm
|
||||
width:8*mm
|
||||
visible: "file://"+profile.friendica_owner.profile_image!= photoImage.source
|
||||
text:qsTr("Update")
|
||||
font.pixelSize: 3*mm
|
||||
anchors.left: photoImage.right
|
||||
anchors.leftMargin: 0.5*mm
|
||||
anchors.topMargin: mm
|
||||
anchors.top: parent.top
|
||||
onClicked:{updateProfileImage()}
|
||||
}
|
||||
Label {
|
||||
id: namelabel
|
||||
x: mm
|
||||
width: parent.width-6*mm
|
||||
height: 3*mm
|
||||
text:(Qt.atob(profile.friendica_owner.name))+" (@"+profile.friendica_owner.screen_name+")"
|
||||
elide:Text.ElideRight
|
||||
anchors.topMargin: 0
|
||||
anchors.left: photoImage.left
|
||||
wrapMode: Text.Wrap
|
||||
color: "#303030"
|
||||
font.pixelSize: 4*mm
|
||||
anchors.top: photoImage.bottom
|
||||
}
|
||||
|
||||
ListModel{id:profileModel}
|
||||
Component{
|
||||
id:profileItem
|
||||
Rectangle{
|
||||
id:profileRect
|
||||
width:profileView.width
|
||||
height: 5*mm+profiletextfield.height
|
||||
Text{
|
||||
y:mm
|
||||
font.pixelSize: 3*mm
|
||||
text:"<b>"+qsTr("profile id")+": </b> "+profileid+"<br>"
|
||||
color:"black"
|
||||
}
|
||||
Text{
|
||||
id:profiletextfield
|
||||
x:2*mm
|
||||
y:4.5*mm
|
||||
width:parent.width-2.5*mm
|
||||
wrapMode: Text.Wrap
|
||||
font.pixelSize: 3*mm
|
||||
text:profiletext
|
||||
color:"black"
|
||||
}
|
||||
}
|
||||
}
|
||||
Component{
|
||||
id:textcomponent
|
||||
Text{
|
||||
id:namelabeltext
|
||||
width: namelabelflickable.width
|
||||
height: implicitHeight
|
||||
font.pixelSize: 3*mm
|
||||
textFormat:Text.RichText
|
||||
wrapMode: Text.Wrap
|
||||
text:"<b>"+qsTr("Description")+": </b> "+(Qt.atob(profile.friendica_owner.description))+"<br> <b>"+qsTr("Location")+":</b> "+profile.friendica_owner.location+"<br> <b>"+qsTr("Posts")+":</b> "+profile.friendica_owner.statuses_count+
|
||||
"<br> <b>"+qsTr("URL")+":</b> <a href='"+ profile.friendica_owner.url+"'>"+profile.friendica_owner.url+"</a><br>"+
|
||||
"<b>"+qsTr("Created at")+":</b> "+createdAtDate.toLocaleString(Qt.locale())
|
||||
onLinkActivated: {
|
||||
Qt.openUrlExternally(link)}
|
||||
}
|
||||
}
|
||||
|
||||
// Rectangle{
|
||||
// id: detailsrectangle
|
||||
|
||||
|
||||
ScrollView{
|
||||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
||||
id:namelabelflickable
|
||||
anchors.top: namelabel.bottom
|
||||
anchors.topMargin: 2*mm
|
||||
width: parent.width-mm
|
||||
height:parent.height-22*mm//friendsTabView.height-45*mm
|
||||
x: mm
|
||||
clip:true
|
||||
|
||||
ListView {
|
||||
id: profileView
|
||||
header:textcomponent
|
||||
// width:parent.width
|
||||
// height: root.height
|
||||
// clip: true
|
||||
spacing: 0
|
||||
model: profileModel
|
||||
delegate: profileItem
|
||||
}
|
||||
}
|
||||
// }
|
||||
|
||||
Component.onCompleted: {
|
||||
profile.profiles.sort(function(obj1, obj2) {
|
||||
return obj1.profile_id - obj2.profile_id;
|
||||
})
|
||||
for(var i in profile.profiles){var obj=profile.profiles[i];
|
||||
buildProfiletext(obj,function(profiletext){
|
||||
profileModel.append({"profileid":obj.profile_id,"profiletext":profiletext})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -31,14 +31,14 @@
|
|||
|
||||
import QtQuick 2.5
|
||||
import QtQuick.LocalStorage 2.0
|
||||
import QtQuick.Window 2.0
|
||||
import QtQuick.Window 2.13
|
||||
import QtQuick.Controls 2.4
|
||||
import QtQuick.Layouts 1.11
|
||||
import "qrc:/js/news.js" as Newsjs
|
||||
import "qrc:/js/service.js" as Service
|
||||
|
||||
|
||||
StackView{
|
||||
|
||||
id:root
|
||||
property QtObject osSettings: {var tmp=Qt.createComponent("qrc:/qml/configqml/OSSettingsAndroid.qml");return tmp.createObject(root)}
|
||||
width: osSettings.appWidth
|
||||
|
|
@ -107,7 +107,8 @@ StackView{
|
|||
|
||||
Keys.onReleased: {
|
||||
if (event.key === osSettings.backKey) {
|
||||
if (currentIndex==0){
|
||||
|
||||
if (rootstack.currentIndex==0){
|
||||
newstab.active=true;
|
||||
if (newstab.newstabstatus!=login.newsViewType){
|
||||
newstab.newstabstatus=login.newsViewType;
|
||||
|
|
@ -120,13 +121,14 @@ StackView{
|
|||
})}
|
||||
}
|
||||
else if (newstab.conversation.length>0){newstab.conversation=[]}
|
||||
else if (root.depth>1){root.pop()}
|
||||
else{Service.cleanNews(root.db,function(){
|
||||
Service.cleanContacts(root.login,root.db,function(){
|
||||
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
|
||||
}}
|
||||
|
||||
|
|
@ -387,9 +389,10 @@ StackView{
|
|||
}
|
||||
|
||||
}
|
||||
Component.onCompleted: {
|
||||
|
||||
Component.onCompleted: {
|
||||
forceActiveFocus();
|
||||
Service.readGlobaloptions(db,function(go){globaloptions=go})
|
||||
//print(xhr.networktype());
|
||||
if(osSettings.osType=="Android"){
|
||||
var component = Qt.createComponent("qrc:/qml/genericqml/IntentReceiver.qml");
|
||||
var IntentReceiverQml = component.createObject(root);
|
||||
|
|
|
|||
1
source-android/qml/genericqml
Symbolic link
1
source-android/qml/genericqml
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
./../../source-linux/qml/genericqml/
|
||||
|
|
@ -1,73 +0,0 @@
|
|||
// This file is part of Friendiqa
|
||||
// https://github.com/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.0
|
||||
Rectangle{
|
||||
id: blueButton
|
||||
width: Math.max(mainText.width+2*mm,8*mm)
|
||||
height: 5*mm
|
||||
color:"light blue"//"#EFEAEA" "sky blue"
|
||||
property alias fontColor: mainText.color
|
||||
// border.color:"grey"
|
||||
// border.width:1
|
||||
radius: mm
|
||||
property alias text: mainText.text
|
||||
property alias font: mainText.font
|
||||
signal clicked
|
||||
state:""
|
||||
|
||||
Text{
|
||||
id:mainText
|
||||
color: "black"
|
||||
anchors.centerIn: parent
|
||||
width: contentWidth
|
||||
height: contentHeight
|
||||
font.family:fontAwesome.name
|
||||
font.pixelSize: 3*mm
|
||||
text: ""
|
||||
}
|
||||
MouseArea{
|
||||
id:buttonArea
|
||||
anchors.fill:parent
|
||||
onPressed: blueButton.state="Pressed"
|
||||
onReleased: blueButton.state=""
|
||||
onClicked: {parent.clicked()}
|
||||
}
|
||||
|
||||
states: [
|
||||
State { name: "Pressed"
|
||||
PropertyChanges { target: blueButton; color: "white"} }
|
||||
]
|
||||
transitions: [
|
||||
Transition { to:"*"
|
||||
ColorAnimation { target: blueButton; duration: 100} }
|
||||
]
|
||||
}
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
import QtQuick 2.0
|
||||
import AndroidNative 1.0
|
||||
|
||||
Item {
|
||||
|
||||
/// Set it to true if multiple images should be picked.
|
||||
property bool multiple: false
|
||||
|
||||
/// If it is true, it will broadcast the taked photo to other application (e.g Let it show in Google Photos)
|
||||
property bool broadcast: true
|
||||
|
||||
/// The URL of the image chosen. If multiple images are picked, it will be equal to the first image.
|
||||
property string imageUrl: ""
|
||||
|
||||
/// A list of images chosen
|
||||
property var imageUrls: []
|
||||
|
||||
/// It is emitted whatever photo(s) are picked/taken.
|
||||
signal ready();
|
||||
|
||||
function pickImage() {
|
||||
SystemDispatcher.dispatch(m_PICK_IMAGE_MESSAGE,{ multiple: multiple});
|
||||
}
|
||||
|
||||
function takePhoto() {
|
||||
SystemDispatcher.dispatch(m_TAKE_PHOTO_MESSAGE,{
|
||||
broadcast: broadcast
|
||||
})
|
||||
}
|
||||
|
||||
property string m_PICK_IMAGE_MESSAGE: "androidnative.ImagePicker.pickImage";
|
||||
|
||||
property string m_TAKE_PHOTO_MESSAGE: "androidnative.ImagePicker.takePhoto";
|
||||
|
||||
property string m_CHOSEN_MESSAGE: "androidnative.ImagePicker.chosen";
|
||||
|
||||
|
||||
Connections {
|
||||
target: SystemDispatcher
|
||||
onDispatched: {
|
||||
if ((type === m_CHOSEN_MESSAGE) && (root.imagePicking==true)) {
|
||||
var h=[];
|
||||
for (var n in message.imageUrls){
|
||||
h.push("file://"+ decodeURIComponent(message.imageUrls[n]).substring(5))
|
||||
}
|
||||
imageUrls=h;
|
||||
imageUrl=h[0];
|
||||
ready();
|
||||
root.imagePicking=false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
SystemDispatcher.loadClass("androidnative.ImagePicker");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,187 +0,0 @@
|
|||
// This file is part of Friendiqa
|
||||
// https://github.com/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.0
|
||||
import QtQuick.Controls 2.4
|
||||
import Qt.labs.folderlistmodel 2.1
|
||||
import "qrc:/js/service.js" as Service
|
||||
import "qrc:/js/helper.js" as Helperjs
|
||||
import "qrc:/qml/genericqml"
|
||||
|
||||
Rectangle{
|
||||
id:imageDialog
|
||||
z:2
|
||||
border.color: "grey"
|
||||
width: parent.width-4*mm
|
||||
height:parent.height-12*mm
|
||||
x:2*mm
|
||||
y:10*mm
|
||||
property string directory: ""
|
||||
property bool multiple: false
|
||||
property string imageUrl: ""
|
||||
property var imageUrls: []
|
||||
signal ready();
|
||||
function pickImage() {}
|
||||
|
||||
Text{
|
||||
id:directoryText
|
||||
x:0.5*mm
|
||||
y:0.5*mm
|
||||
width: imageDialog.width-15*mm
|
||||
height:contentHeight
|
||||
wrapMode: Text.Wrap
|
||||
text: directory
|
||||
}
|
||||
Button{
|
||||
id:closeButton
|
||||
height: 8*mm
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 0.5*mm
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 1*mm
|
||||
text: "\uf057"
|
||||
onClicked:{ready();imageDialog.destroy()}
|
||||
}
|
||||
|
||||
ListView {
|
||||
id: imageView
|
||||
x:0.5*mm
|
||||
y: Math.max(directoryText.height, closeButton.height)+mm
|
||||
width: imageDialog.width-2*mm
|
||||
height: imageDialog.height-imageView.y-4*mm
|
||||
clip: true
|
||||
model: imageModel
|
||||
delegate: imageItem
|
||||
}
|
||||
|
||||
FolderListModel{
|
||||
id: imageModel
|
||||
nameFilters: ["*.png", "*.jpg",".jpeg","*.JPG","*.gif"]
|
||||
sortField: FolderListModel.Time
|
||||
sortReversed:false
|
||||
showDotAndDotDot: true
|
||||
showDirs: true
|
||||
showDirsFirst: true
|
||||
folder:directory
|
||||
}
|
||||
|
||||
BusyIndicator{
|
||||
id: imageBusy
|
||||
anchors.horizontalCenter: imageView.horizontalCenter
|
||||
anchors.top:imageView.top
|
||||
anchors.topMargin: 2*mm
|
||||
width:10*mm
|
||||
height: 10*mm
|
||||
running:false
|
||||
}
|
||||
|
||||
Component{
|
||||
id:imageItem
|
||||
Item{
|
||||
width:imageView.width
|
||||
height:folderImage.height+2*mm
|
||||
Rectangle{
|
||||
id:imagetextRectangle
|
||||
color:"black"
|
||||
x:mm
|
||||
z:3
|
||||
opacity: fileIsDir?0:0.5
|
||||
width:imagetext.contentWidth
|
||||
height: imagetext.contentHeight
|
||||
anchors.bottom: folderImage.bottom
|
||||
}
|
||||
Text {
|
||||
id:imagetext
|
||||
x:fileIsDir?11*mm:mm
|
||||
z:4
|
||||
text: fileName
|
||||
width: fileIsDir?parent.width - 12*mm :imageView.width-mm
|
||||
anchors.bottom: folderImage.bottom
|
||||
color: fileIsDir?"black":"white"
|
||||
font.pixelSize: 3*mm
|
||||
wrapMode:Text.Wrap
|
||||
}
|
||||
Text {
|
||||
id:selected
|
||||
anchors.right:parent.right
|
||||
visible: attachImageURLs.indexOf(fileURL)>-1
|
||||
z:4
|
||||
text: "\u2713"
|
||||
width: 10*mm
|
||||
anchors.top: folderImage.top
|
||||
color: "green"
|
||||
font.pixelSize: 10*mm
|
||||
}
|
||||
|
||||
Image{id:folderImage
|
||||
width: fileIsDir?10*mm: imageView.width-mm
|
||||
fillMode:Image.PreserveAspectFit
|
||||
source:fileIsDir?"qrc:/images/folder-blue.png":fileURL
|
||||
}
|
||||
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
onClicked:{
|
||||
if (fileName==".."){
|
||||
imageModel.folder=imageModel.parentFolder;
|
||||
directory=imageModel.parentFolder
|
||||
}
|
||||
else if (fileIsDir){
|
||||
imageModel.folder=fileURL;
|
||||
directory=fileURL
|
||||
}
|
||||
else{
|
||||
if (multiple!=true){
|
||||
//attachImageURLs.push(fileURL);
|
||||
//attachImage(fileURL);
|
||||
imageUrls.push(fileURL);
|
||||
imageUrl=fileURL;
|
||||
ready();
|
||||
imageDialog.destroy()
|
||||
}
|
||||
else {
|
||||
if(selected.visible==true){
|
||||
imageUrls.splice(imageUrls.indexOf(fileURL,1))
|
||||
selected.visible=false
|
||||
}
|
||||
else{
|
||||
imageUrls.push(fileURL);
|
||||
selected.visible=true;
|
||||
|
||||
}
|
||||
imageUrl=fileURL
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
import QtQuick 2.0
|
||||
import AndroidNative 1.0
|
||||
|
||||
Item {
|
||||
id:intent
|
||||
/// The URL of the image chosen. If multiple images are picked, it will be equal to the first image.
|
||||
property string imageUrl: ""
|
||||
|
||||
/// A list of images chosen
|
||||
property var imageUrls: []
|
||||
|
||||
property string m_TEXT_MESSAGE: "androidnative.TextIntent.chosen";
|
||||
property string m_IMAGE_MESSAGE: "androidnative.ImagePicker.chosen";
|
||||
|
||||
|
||||
Connections {
|
||||
target: SystemDispatcher
|
||||
onDispatched: {
|
||||
if ((type === m_IMAGE_MESSAGE)&& (root.imagePicking==false)) {
|
||||
var h=[];
|
||||
for (var n in message.imageUrls){
|
||||
h.push("file://"+ decodeURIComponent(message.imageUrls[n]).substring(5))
|
||||
}
|
||||
imageUrls=h;
|
||||
if(imageUrls.length==1){
|
||||
rootstack.currentIndex=0;newstab.active=true;
|
||||
root.uploadSignal(imageUrls)
|
||||
} else{
|
||||
rootstack.currentIndex=2;fotostab.active=true;
|
||||
root.uploadSignal(imageUrls)
|
||||
}
|
||||
} else if (type==m_TEXT_MESSAGE){
|
||||
rootstack.currentIndex=0;newstab.active=true;
|
||||
root.sendtextSignal(message)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
SystemDispatcher.setInitialized();
|
||||
if (root.globaloptions.hasOwnProperty("syncinterval") && root.globaloptions.syncinterval !=null && root.globaloptions.syncinterval !=0){
|
||||
alarm.setAlarm(root.globaloptions.syncinterval);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
import QtQuick 2.4
|
||||
|
||||
|
||||
Item {
|
||||
Timer{
|
||||
id:syncTimer
|
||||
repeat: true
|
||||
onTriggered: {
|
||||
updatenews.setDatabase();
|
||||
updatenews.login();
|
||||
updatenews.startsync();
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (root.globaloptions.hasOwnProperty("syncinterval") && root.globaloptions.syncinterval !=null && root.globaloptions.syncinterval !=0){
|
||||
syncTimer.interval=root.globaloptions.syncinterval*60000;
|
||||
syncTimer.start()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
// This file is part of Friendiqa
|
||||
// https://github.com/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.Controls 2.4
|
||||
Button{
|
||||
id: mButton
|
||||
width: Math.max(text.width+2*mm,8*mm)
|
||||
height: 6*mm
|
||||
//color: Material.grey
|
||||
font.pixelSize: 3*mm
|
||||
}
|
||||
|
|
@ -1,220 +0,0 @@
|
|||
// This file is part of Friendiqa
|
||||
// https://github.com/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 "qrc:/js/service.js" as Service
|
||||
import "qrc:/js/helper.js" as Helperjs
|
||||
import "qrc:/qml/genericqml"
|
||||
|
||||
Rectangle{
|
||||
id:permissionDialog
|
||||
// x: mm
|
||||
width: parent.width-5*mm
|
||||
height:root.height/3
|
||||
function updatePerms(){
|
||||
for (var i=0;i<groupModel.count;i++)
|
||||
{if (groupModel.get(i).groupstatus=="positive"){
|
||||
group_allow.push(groupModel.get(i).group.gid)
|
||||
}
|
||||
if (groupModel.get(i).groupstatus=="negative"){
|
||||
group_deny.push(groupModel.get(i).group.gid)
|
||||
}
|
||||
}
|
||||
for (var j=0;j<contactModel.count;j++){
|
||||
if (contactModel.get(j).contactstatus=="positive"){
|
||||
contact_allow.push(contactModel.get(j).contact.cid)
|
||||
}
|
||||
if (contactModel.get(j).contactstatus=="negative"){
|
||||
contact_deny.push(contactModel.get(j).contact.cid)
|
||||
}
|
||||
if ((contact_allow.length==0)&&(contact_deny.length==0)&&(group_allow.length==0)&&(group_deny.length==0))
|
||||
{permButton.text="\uf09c"}
|
||||
else{permButton.text="\uf023"}
|
||||
}}
|
||||
|
||||
Text{
|
||||
x:0.5*mm
|
||||
y:0.5*mm
|
||||
text: qsTr("Friends")
|
||||
}
|
||||
ListView {
|
||||
id: contactView
|
||||
x:0.5*mm
|
||||
y:5.5*mm
|
||||
width: permissionDialog.width/2-2*mm
|
||||
height: permissionDialog.height-14*mm
|
||||
clip: true
|
||||
spacing: 1
|
||||
model: contactModel
|
||||
delegate: contactItem
|
||||
}
|
||||
|
||||
ListModel{id: contactModel}
|
||||
Component{
|
||||
id:contactItem
|
||||
Rectangle{
|
||||
id:contactitemRect
|
||||
width:contactView.width
|
||||
height: 5*mm
|
||||
radius: 0.5*mm
|
||||
property string contactstatus
|
||||
onContactstatusChanged:{
|
||||
if(contactstatus=="positive"){contactitemRect.color="light green"}
|
||||
else if (contactstatus=="negative"){contactitemRect.color= "ffe6e6"}
|
||||
else{contactitemRect.color= "white"}}
|
||||
color: "white"
|
||||
border.color:"grey"
|
||||
Text{
|
||||
color:"grey"
|
||||
text:contact.screen_name
|
||||
}
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
onClicked:{
|
||||
if(contactModel.get(index).contactstatus=="neutral"){
|
||||
contactModel.set(index,{"contactstatus":"positive"});
|
||||
contactstatus="positive"
|
||||
}
|
||||
else if (contactModel.get(index).contactstatus=="positive"){
|
||||
contactModel.set(index,{"contactstatus":"negative"})
|
||||
contactstatus="negative"
|
||||
}
|
||||
else{contactModel.set(index,{"contactstatus":"neutral"});
|
||||
contactstatus="neutral";
|
||||
}
|
||||
}}
|
||||
Component.onCompleted:{
|
||||
if (contactModel.get(index).contactstatus=="positive"){
|
||||
contactstatus="positive"
|
||||
}
|
||||
else if (contactModel.get(index).contactstatus=="negative"){
|
||||
contactstatus="negative"
|
||||
}
|
||||
else {contactstatus="neutral"} }
|
||||
}
|
||||
}
|
||||
Text{
|
||||
x:contactView.width+2*mm
|
||||
y:0.5*mm
|
||||
text: qsTr("Groups")
|
||||
}
|
||||
ListView {
|
||||
id: groupView
|
||||
x:contactView.width+2*mm
|
||||
y:5.5*mm
|
||||
width: permissionDialog.width/2-2*mm
|
||||
height: permissionDialog.height-14*mm
|
||||
clip: true
|
||||
spacing: 1
|
||||
model: groupModel
|
||||
delegate: groupItem
|
||||
}
|
||||
|
||||
ListModel{id: groupModel}
|
||||
Component{
|
||||
id:groupItem
|
||||
Rectangle{
|
||||
id:groupitemRect
|
||||
width:groupView.width
|
||||
radius: 0.5*mm
|
||||
height: 5*mm
|
||||
property string groupstatus:"neutral"
|
||||
onGroupstatusChanged:
|
||||
{if(groupstatus=="positive"){groupitemRect.color="light green"}
|
||||
else if (groupstatus=="negative"){groupitemRect.color= "#ffe6e6"}
|
||||
else{groupitemRect.color= "white"}}
|
||||
color: "white"
|
||||
border.color:"grey"
|
||||
Text{
|
||||
color:"grey"
|
||||
text:group.groupname
|
||||
}
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
onClicked:{
|
||||
if(groupModel.get(index).groupstatus=="neutral"){
|
||||
groupModel.set(index,{"groupstatus":"positive"});
|
||||
groupstatus="positive"}
|
||||
else if (groupModel.get(index).groupstatus=="positive"){
|
||||
groupModel.set(index,{"groupstatus":"negative"});
|
||||
groupstatus="negative"}
|
||||
else{groupModel.set(index,{"groupstatus":"neutral"})
|
||||
groupstatus="neutral"}
|
||||
}}
|
||||
Component.onCompleted:{ if (groupModel.get(index).groupstatus=="positive"){
|
||||
groupstatus="positive"
|
||||
}
|
||||
else if (groupModel.get(index).groupstatus=="negative"){
|
||||
groupstatus="negative"
|
||||
}
|
||||
else {groupstatus="neutral"} }
|
||||
}
|
||||
}
|
||||
MButton{
|
||||
x:0.5*mm
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin:1
|
||||
text:"\uf0c7"
|
||||
onClicked:{
|
||||
updatePerms();
|
||||
var perms=[];
|
||||
perms.push(contact_allow,contact_deny,group_allow,group_deny);
|
||||
Service.savePermissions(db,perms)
|
||||
}
|
||||
}
|
||||
MButton{
|
||||
x:contactView.width+2*mm
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin:1
|
||||
text:"\u2713"
|
||||
onClicked:{updatePerms();
|
||||
permissionDialog.visible=false;
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted:{
|
||||
Helperjs.readData(db,"contacts",login.username,function(contacts){
|
||||
for (var name in contacts){
|
||||
var contactstatus="neutral";
|
||||
if (contact_allow.indexOf(contacts[name].cid)>-1){contactstatus="positive"}
|
||||
else if (contact_deny.indexOf(contacts[name].cid)>-1){contactstatus="negative"}
|
||||
contactModel.append({"contact":contacts[name],"contactstatus":contactstatus})
|
||||
}},"isFriend",1);
|
||||
|
||||
Helperjs.readData(db,"groups",login.username,function(owngroups){
|
||||
for (var number in owngroups){
|
||||
var groupstatus= "neutral";
|
||||
if (group_allow.indexOf(owngroups[number].gid)>-1){groupstatus="positive"}
|
||||
else if (group_deny.indexOf(owngroups[number].gid)>-1){groupstatus="negative"}
|
||||
groupModel.append({"group":owngroups[number],"groupstatus":groupstatus})
|
||||
}});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
// This file is part of Friendiqa
|
||||
// https://github.com/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.Controls 1.2
|
||||
import "qrc:/qml/genericqml"
|
||||
//import "qrc:/js/news.js" as Newsjs
|
||||
//import "qrc:/js/helper.js" as Helperjs
|
||||
//import "qrc:/js/service.js" as Service
|
||||
|
||||
|
||||
Rectangle {
|
||||
id:searchComponent
|
||||
//onActiveFocusChanged: searchText.forceActiveFocus()
|
||||
//onVisibleChanged: if (visible) searchText.forceActiveFocus()
|
||||
// border.color: "#EEEEEE"
|
||||
// border.width: 1
|
||||
color:"lightgrey"
|
||||
// width:conversationView.width
|
||||
// height:Math.max(replyText.contentHeight+2*mm,6*mm)
|
||||
Rectangle{
|
||||
color: "white"
|
||||
radius:0.5*mm
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin:mm
|
||||
anchors.top:parent.top
|
||||
anchors.topMargin: 0.5*mm
|
||||
width:parent.width-2*mm
|
||||
height: 4*mm //Math.max( searchText.contentHeight,5*mm)
|
||||
|
||||
TextInput {
|
||||
id: searchText
|
||||
focus: true
|
||||
font.pixelSize: 3*mm
|
||||
wrapMode: Text.Wrap
|
||||
anchors.fill: parent
|
||||
selectByMouse: true
|
||||
cursorVisible: false
|
||||
onEditingFinished:{ if (displayText!=""){search(displayText)};searchComponent.destroy()}
|
||||
//onHeightChanged: newsView.contentY+=4.5*mm
|
||||
|
||||
}
|
||||
Component.onCompleted: searchText.forceActiveFocus()
|
||||
// BlueButton {
|
||||
// id: sendButton
|
||||
// text: "\uf002"
|
||||
// anchors.left: parent.right
|
||||
// anchors.leftMargin:mm
|
||||
// anchors.top:parent.top
|
||||
// //anchors.topMargin: 0.5*mm
|
||||
// color:"white"
|
||||
// onClicked: {
|
||||
// var body=searchText.getText(0,searchText.length);
|
||||
// search(body)
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
1
source-android/qml/newsqml
Symbolic link
1
source-android/qml/newsqml
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
./../../source-linux/qml/newsqml/
|
||||
|
|
@ -1,217 +0,0 @@
|
|||
// 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.0
|
||||
import QtQuick.Controls 2.4
|
||||
import "qrc:/js/helper.js" as Helperjs
|
||||
import "qrc:/qml/genericqml"
|
||||
|
||||
Rectangle {
|
||||
id:contactList
|
||||
color: "white"
|
||||
property var contact:({})
|
||||
property string profileimagesource:contact.profile_image
|
||||
ListView {
|
||||
id: contactView
|
||||
x:mm
|
||||
y:9*mm
|
||||
width: contactList.width-4*mm
|
||||
height:contactList.height-10*mm
|
||||
clip: true
|
||||
spacing: 0
|
||||
header: contactHeader
|
||||
model: contactModel
|
||||
delegate: Newsitem{}
|
||||
}
|
||||
BusyIndicator{
|
||||
id: contactBusy
|
||||
anchors.centerIn:parent
|
||||
width:10*mm
|
||||
height: 10*mm
|
||||
running: true
|
||||
}
|
||||
|
||||
Component { id: contactHeader
|
||||
Rectangle{
|
||||
border.color: "#EEEEEE"
|
||||
border.width: 1
|
||||
color:"white"
|
||||
width:contactView.width
|
||||
height: profileImage.height+namelabel.height+detailtext.height+7*mm
|
||||
//height: wrapper.height
|
||||
property var createdAtDate: new Date(contact.created_at)
|
||||
property string connectUrl: (contact.network!=="dfrn")||(contact.isFriend!=0)?"":( "<a href='"+contact.url.replace("profile","dfrn_request") +"'>"+qsTr("Connect")+"</a><br>")
|
||||
|
||||
Image {
|
||||
id: profileImage
|
||||
x:mm
|
||||
y:mm
|
||||
width: contactView.width/2
|
||||
height:width
|
||||
source:(contact.profile_image!="")? "file://"+contact.profile_image : contact.profile_image_url
|
||||
onStatusChanged: if (profileImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
|
||||
Connections{
|
||||
target:contactList
|
||||
onProfileimagesourceChanged:profileImage.source=profileimagesource
|
||||
}
|
||||
}
|
||||
Column{id:buttoncolumn
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: mm
|
||||
y: mm
|
||||
spacing:4
|
||||
|
||||
MButton{
|
||||
id:photobutton
|
||||
height: 6*mm
|
||||
width: 8*mm
|
||||
text: "\uf03e" // "Photos"
|
||||
//font.pixelSize: 3*mm
|
||||
visible:(contact.network=="dfrn")
|
||||
onClicked:{
|
||||
rootstack.currentIndex=2;
|
||||
bar.currentIndex=2;
|
||||
fotostab.phototabstatus="Contact";
|
||||
|
||||
//fotostab.active=true;
|
||||
fotoSignal(root.login,contact) ;
|
||||
newsStack.pop();
|
||||
}
|
||||
}
|
||||
|
||||
MButton{
|
||||
id:dmbutton
|
||||
height: 6*mm
|
||||
width: 8*mm
|
||||
visible: (contact.following=="true")
|
||||
text: "\uf040" //"DM"
|
||||
//font.pixelSize: 3*mm
|
||||
onClicked:{
|
||||
rootstack.currentIndex=0;
|
||||
newsSwipeview.currentIndex=2;
|
||||
directmessageSignal(contact)
|
||||
}
|
||||
}
|
||||
|
||||
MButton{
|
||||
id:eventbutton
|
||||
visible:(contact.network=="dfrn")
|
||||
height: 6*mm
|
||||
width: 8*mm
|
||||
text:"\uf073"
|
||||
//font.pixelSize: 3*mm
|
||||
onClicked:{
|
||||
rootstack.currentIndex=3;
|
||||
bar.currentIndex=3;
|
||||
calendartab.calendartabstatus="Friend"
|
||||
eventSignal(contact);
|
||||
newsStack.pop()
|
||||
}
|
||||
}
|
||||
|
||||
}//Column end
|
||||
Label {
|
||||
id: namelabel
|
||||
x:mm
|
||||
width: contactView.width-2*mm
|
||||
height: implicitHeight
|
||||
text:contact.name+" (@"+contact.screen_name+")"
|
||||
wrapMode: Text.Wrap//elide:Text.ElideRight
|
||||
color: "#303030"
|
||||
font.pixelSize: 4*mm
|
||||
anchors.top: profileImage.bottom
|
||||
anchors.topMargin: mm
|
||||
}
|
||||
Text{
|
||||
id:detailtext
|
||||
anchors.top: namelabel.bottom
|
||||
anchors.topMargin: 2*mm
|
||||
x:mm
|
||||
width: contactView.width-2*mm
|
||||
height: implicitHeight
|
||||
font.pixelSize: 2.5*mm
|
||||
textFormat:Text.RichText
|
||||
wrapMode: Text.Wrap
|
||||
text:"<b>"+qsTr("Description")+": </b> "+contact.description+"<br> <b>"+qsTr("Location")+":</b> "+contact.location+"<br> <b>"+qsTr("Posts")+":</b> "+contact.statuses_count+
|
||||
"<br> <b>"+qsTr("URL")+":</b> <a href='"+ contact.url+"'>"+contact.url+"</a><br>"+
|
||||
connectUrl+ "<b>"+qsTr("Created at")+":</b> "+createdAtDate.toLocaleString(Qt.locale())
|
||||
onLinkActivated: {
|
||||
Qt.openUrlExternally(link)}
|
||||
}
|
||||
|
||||
|
||||
//}
|
||||
}
|
||||
|
||||
}//Component end
|
||||
Connections{
|
||||
target:newstab
|
||||
onContactpostsChanged:{
|
||||
if (newstab.contactposts.length>0){profileimagesource=newstab.contactposts[0].user.profile_image_url_large}
|
||||
contactBusy.running=false;
|
||||
contactModel.clear();
|
||||
var currentTime= new Date();
|
||||
var msg = {'currentTime': currentTime, 'model': contactModel,'news':newstab.contactposts, 'options':globaloptions};
|
||||
contactWorker.sendMessage(msg)
|
||||
}
|
||||
}
|
||||
|
||||
ListModel{id: contactModel}
|
||||
|
||||
WorkerScript {
|
||||
id: contactWorker
|
||||
source: "qrc:/js/newsworker.js"
|
||||
}
|
||||
|
||||
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: {
|
||||
newsStack.pop()
|
||||
}
|
||||
}
|
||||
Component.onCompleted: {
|
||||
xhr.clearParams();
|
||||
xhr.setLogin(login.username+":"+Qt.atob(login.password));
|
||||
xhr.setUrl(login.server);
|
||||
xhr.setApi("/api/statuses/user_timeline");
|
||||
xhr.setParam("user_id",contact.id)
|
||||
xhr.get();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,189 +0,0 @@
|
|||
// 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/>.
|
||||
|
||||
// ConversationView with button
|
||||
import QtQuick 2.0
|
||||
import QtQuick.Controls 2.4
|
||||
import "qrc:/js/helper.js" as Helperjs
|
||||
import "qrc:/qml/genericqml"
|
||||
import "qrc:/qml/newsqml"
|
||||
|
||||
Rectangle {
|
||||
id:conversationList
|
||||
// width:root.width-5*mm
|
||||
// height:root.height-12*mm
|
||||
//property var news
|
||||
// y:1
|
||||
// z:2
|
||||
color: "white"
|
||||
// border.color: "grey"
|
||||
// width:root.width-5*mm
|
||||
// height: conversationView.height+10*mm
|
||||
|
||||
ListView {
|
||||
id: conversationView
|
||||
x:3*mm
|
||||
y:8*mm
|
||||
width: conversationList.width-4*mm
|
||||
//height: contentHeight
|
||||
height:conversationList.height-10*mm
|
||||
clip: true
|
||||
spacing: 0
|
||||
footer: MessageSend{conversation:true}//footerReply
|
||||
model: conversationModel
|
||||
delegate: Newsitem{}
|
||||
}
|
||||
BusyIndicator{
|
||||
id: conversationBusy
|
||||
anchors.horizontalCenter: conversationView.horizontalCenter
|
||||
anchors.top:conversationList.top
|
||||
anchors.topMargin: 2*mm
|
||||
width:10*mm
|
||||
height: 10*mm
|
||||
running: true
|
||||
}
|
||||
|
||||
Connections{
|
||||
target:newstab
|
||||
onConversationChanged:{
|
||||
//if(newsitem.itemindex==newsStack.conversationIndex){
|
||||
if(newstab.conversation.length==0){
|
||||
newsStack.pop()
|
||||
//newsView.positionViewAtIndex(newsStack.conversationIndex,ListView.Beginning);
|
||||
//conversationList.destroy(); conversationsymbol.color="grey"
|
||||
} else { conversationBusy.running=false;
|
||||
conversationModel.clear();
|
||||
var currentTime= new Date();
|
||||
var msg = {'currentTime': currentTime, 'model': conversationModel,'news':newstab.conversation, 'options':globaloptions};
|
||||
conversationWorker.sendMessage(msg)
|
||||
//conversationsymbol.color="grey"
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
// Component { id:footerReply
|
||||
// Rectangle{
|
||||
// border.color: "#EEEEEE"
|
||||
// border.width: 1
|
||||
// color:"lightgrey"
|
||||
// width:conversationView.width
|
||||
// height:Math.max(replyText.contentHeight+2*mm,6*mm)
|
||||
// Rectangle{
|
||||
// color: "white"
|
||||
// radius:0.5*mm
|
||||
// anchors.left: parent.left
|
||||
// anchors.leftMargin:mm
|
||||
// anchors.top:parent.top
|
||||
// anchors.topMargin: 0.5*mm
|
||||
// width:parent.width-12*mm
|
||||
// height:Math.max( replyText.contentHeight,5*mm)
|
||||
|
||||
// TextInput {
|
||||
// id: replyText
|
||||
// font.pixelSize: 3*mm
|
||||
// wrapMode: Text.Wrap
|
||||
// anchors.fill: parent
|
||||
// selectByMouse: true
|
||||
// onHeightChanged: conversationView.contentY+=4.5*mm
|
||||
// }
|
||||
// }
|
||||
|
||||
// Button {
|
||||
// id: sendButton
|
||||
// height: 8*mm
|
||||
// width:8*mm
|
||||
// text: "\uf1d9"
|
||||
// anchors.right: parent.right
|
||||
// anchors.rightMargin:mm
|
||||
// anchors.top:parent.top
|
||||
// anchors.topMargin: 0.5*mm
|
||||
// //color:"white"
|
||||
// onClicked: { try{
|
||||
// var body=replyText.getText(0,replyText.length);
|
||||
// newsBusy.running=true;
|
||||
// replyText.text=""
|
||||
// xhr.clearParams();
|
||||
// xhr.setLogin(login.username+":"+Qt.atob(login.password));
|
||||
// if (conversationModel.get(0).newsitemobject.messagetype==0){
|
||||
|
||||
// //xhr.url= login.server + "/api/statuses/update.json";
|
||||
// xhr.setUrl(login.server);
|
||||
// xhr.setApi("/api/statuses/update");
|
||||
// xhr.setParam("source", "Friendiqa");
|
||||
// xhr.setParam("status", body);
|
||||
// xhr.setParam("in_reply_to_status_id", conversationModel.get(conversationModel.count-1).newsitemobject.id)}
|
||||
// else {//xhr.url= login.server + "/api/direct_messages/new.json";
|
||||
// xhr.setUrl(login.server);
|
||||
// xhr.setApi("/api/direct_messages/new");
|
||||
// xhr.setParam("text", body);
|
||||
// xhr.setParam("screen_name",conversationModel.get(conversationModel.count-1).newsitemobject.screen_name);
|
||||
// xhr.setParam("replyto", conversationModel.get(conversationModel.count-1).newsitemobject.id)
|
||||
// }
|
||||
// xhr.post();
|
||||
// } catch(e){Helperjs.showMessage("Error",e.toString(),root)}
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
ListModel{id: conversationModel}
|
||||
|
||||
WorkerScript {
|
||||
id: conversationWorker
|
||||
source: "qrc:/js/newsworker.js"
|
||||
}
|
||||
|
||||
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"
|
||||
onClicked: {
|
||||
//newsView.positionViewAtIndex(newsStack.conversationIndex,ListView.Beginning);
|
||||
newsStack.pop()
|
||||
//conversationList.destroy();
|
||||
//conversationsymbol.color="grey"
|
||||
}
|
||||
}
|
||||
|
||||
// Component.onCompleted: {
|
||||
// if (news){var currentTime= new Date();
|
||||
// var msg = {'currentTime': currentTime, 'model': conversationModel,'news':news};
|
||||
// conversationWorker.sendMessage(msg)}
|
||||
// }
|
||||
}
|
||||
|
|
@ -1,108 +0,0 @@
|
|||
// 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/>.
|
||||
|
||||
// List of people from Friendica Activities
|
||||
import QtQuick 2.0
|
||||
import "qrc:/js/helper.js" as Helperjs
|
||||
import "qrc:/qml/genericqml"
|
||||
|
||||
Rectangle {
|
||||
id:activitiesRectangle
|
||||
property var activitymembers
|
||||
color: "white"
|
||||
border.color: "light grey"
|
||||
radius:0.5*mm
|
||||
width:root.width/2
|
||||
height:Math.min(root.height/2,(10*mm+6*activitymembers.length*mm))
|
||||
|
||||
ListView {
|
||||
id: contactView
|
||||
x:mm
|
||||
y:8*mm
|
||||
width: activitiesRectangle.width-2*mm
|
||||
height: activitiesRectangle.height-10*mm
|
||||
clip: true
|
||||
spacing: 0
|
||||
model: activitiesModel
|
||||
delegate: activitiesContact
|
||||
}
|
||||
|
||||
ListModel{id: activitiesModel}
|
||||
|
||||
Component { id:activitiesContact
|
||||
Rectangle{
|
||||
border.color: "#EEEEEE"
|
||||
border.width: 1
|
||||
radius:0.5*mm
|
||||
width:parent.width
|
||||
height:6*mm
|
||||
Image {
|
||||
id: contactImage
|
||||
x:1
|
||||
y:1
|
||||
width: 5*mm
|
||||
height:5*mm
|
||||
source:(contact.profile_image!="")? "file://"+contact.profile_image : contact.profile_image_url
|
||||
onStatusChanged: if (contactImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
|
||||
}
|
||||
Text{
|
||||
font.pixelSize: 3*mm
|
||||
anchors.left: contactImage.right
|
||||
anchors.margins: 1*mm
|
||||
text:contact.name
|
||||
}
|
||||
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
onClicked:{showContact(contact)}
|
||||
}
|
||||
}}
|
||||
|
||||
BlueButton {
|
||||
id: closeButton
|
||||
//width:10*mm
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 1*mm
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 1*mm
|
||||
color:"white"
|
||||
text: "\uf057"// qsTr("Close")
|
||||
onClicked: {
|
||||
activitiesRectangle.destroy()
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
for (var user in activitymembers){
|
||||
activitiesModel.append({"contact":activitymembers[user]})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
// 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.0
|
||||
|
||||
Rectangle {
|
||||
id:hasgtagRectangle
|
||||
color: "light grey"
|
||||
property alias text: hashtagText.text
|
||||
radius:0.3*mm
|
||||
width:hashtagText.contentWidth+mm
|
||||
height:2.5* mm
|
||||
Text{
|
||||
id:hashtagText
|
||||
font.pixelSize: 1.5*mm
|
||||
anchors.centerIn: parent
|
||||
anchors.margins: 0.5*mm
|
||||
}
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
onClicked:{search(hashtagText.text.replace("#",""))}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,427 +0,0 @@
|
|||
// 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/>.
|
||||
|
||||
// message.qml
|
||||
// message with buttons
|
||||
import QtQuick 2.4
|
||||
import QtQuick.Controls 2.4
|
||||
//import QtQuick.Dialogs 1.2
|
||||
import "qrc:/js/helper.js" as Helperjs
|
||||
import "qrc:/js/smiley.js" as Smileyjs
|
||||
import "qrc:/js/news.js" as Newsjs
|
||||
import "qrc:/qml/genericqml"
|
||||
|
||||
|
||||
Rectangle{
|
||||
color:"#EEEEEE"
|
||||
width:parent.width
|
||||
height: (newsSwipeview.stacktype!="Notifications")?messageColumn.height+mm:0
|
||||
id:messageSend
|
||||
visible:(newsSwipeview.stacktype!="Notifications")?true:false
|
||||
property string parentId: ""
|
||||
//property var parentObject:({})
|
||||
property bool conversation: false
|
||||
property string reply_to_user:""
|
||||
property alias bodyMessage: bodyField.text
|
||||
property var attachImageURLs: [];
|
||||
//property int directmessage: 0;
|
||||
property var contacts: []
|
||||
property var groups: []
|
||||
property var contact_allow:login.permissions[0]
|
||||
property var contact_deny:login.permissions[1]
|
||||
property var group_allow:login.permissions[2]
|
||||
property var group_deny:login.permissions[3]
|
||||
|
||||
onReply_to_userChanged: {
|
||||
if (reply_to_user!=""){
|
||||
receiverLabel.visible=true
|
||||
}
|
||||
}
|
||||
|
||||
function directmessagePrepare(friend){
|
||||
messageSend.state="active";
|
||||
reply_to_user=friend.screen_name;
|
||||
receiverLabel.text=qsTr("to:")+ " "+ friend.screen_name;
|
||||
}
|
||||
|
||||
|
||||
function sendUrls(urls){
|
||||
if((urls.length==1 && attachImageURLs.length==0)){
|
||||
attachImage(urls);
|
||||
attachImageURLs.push(urls);
|
||||
messageSend.state="active";
|
||||
}
|
||||
}
|
||||
|
||||
function sendtext(text){
|
||||
if(text){
|
||||
if (text.subject=="undefined"){text.subject=""}
|
||||
if(text.plaintext.lastIndexOf(".jpg")>-1 || text.plaintext.lastIndexOf(".jpeg")>-1 || text.plaintext.lastIndexOf(".png")>-1 || text.plaintext.lastIndexOf(".gif")>-1){
|
||||
text.plaintext="<a href="+text.plaintext+"><img src="+text.plaintext+"></a>"}
|
||||
bodyField.text=text.subject+"\n"+text.plaintext;
|
||||
messageSend.state="active";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function attachImage(url){
|
||||
var imageAttachmentObject=Qt.createQmlObject('import QtQuick 2.0; Image {id:imageAttachment'+attachImageURLs.length+'; source:"'+
|
||||
url.toString()+'"; x:2*mm; width: 45*mm; height: 45*mm;fillMode: Image.PreserveAspectFit;MouseArea{anchors.fill:parent;onClicked:{attachImageURLs.splice(attachImageURLs.indexOf("'+
|
||||
url+'"),1); imageAttachment'+attachImageURLs.length+'.destroy()}}}',messageColumn,"attachedImage");
|
||||
}
|
||||
|
||||
function statusUpdate(title,status,in_reply_to_status_id,attachImageURL) {
|
||||
//xhr.url= login.server + "/api/statuses/update.json";
|
||||
newsBusy.running=true;
|
||||
xhr.setLogin(login.username+":"+Qt.atob(login.password));
|
||||
xhr.setUrl(login.server);
|
||||
xhr.setApi("/api/statuses/update");
|
||||
xhr.clearParams();
|
||||
xhr.setParam("source", "Friendiqa");
|
||||
xhr.setParam("htmlstatus", status);
|
||||
if (parentId!="") {xhr.setParam("in_reply_to_status_id", parentId)};
|
||||
if (title!=="") {xhr.setParam("title", title)};
|
||||
if (group_allow.length>0) {xhr.setParam("group_allow", Helperjs.cleanArray(group_allow))};
|
||||
if (group_deny.length>0) {xhr.setParam("group_deny", Helperjs.cleanArray(group_deny))};
|
||||
if (contact_allow.length>0) {xhr.setParam("contact_allow", Helperjs.cleanArray(contact_allow))};
|
||||
if (contact_deny.length>0) {xhr.setParam("contact_deny", Helperjs.cleanArray(contact_deny))};
|
||||
if (attachImageURL.length>0) {for (var image in attachImageURL){xhr.setImageFileParam("media", attachImageURL[image] )}};
|
||||
xhr.post();
|
||||
}
|
||||
|
||||
function dmUpdate(title,text,replyto,screen_name,attachImageURL) {
|
||||
newsBusy.running=true;
|
||||
//xhr.url= login.server + "/api/direct_messages/new.json";
|
||||
xhr.setLogin(login.username+":"+Qt.atob(login.password));
|
||||
xhr.setUrl(login.server);
|
||||
xhr.setApi("/api/direct_messages/new");
|
||||
xhr.clearParams();
|
||||
xhr.setParam("text", text);
|
||||
xhr.setParam("screen_name", screen_name);
|
||||
if (parentId!="") {xhr.setParam("replyto", replyto)};
|
||||
//if (title!=="") {xhr.setParam("title", title)};
|
||||
xhr.post();
|
||||
}
|
||||
|
||||
function setParent(newsitemobject){
|
||||
//print("Newsobject "+newsitemobject.id+ " "+JSON.stringify(newsitemobject.user));
|
||||
if (newsitemobject!=""){
|
||||
messageSend.state="conversation"
|
||||
reply_to_user=newsitemobject.user.screen_name;
|
||||
receiverLabel.text=qsTr("to:")+ " "+ newsitemobject.user.screen_name;
|
||||
parentId=newsitemobject.id
|
||||
} else {
|
||||
messageSend.state=""
|
||||
reply_to_user="";
|
||||
receiverLabel.text=qsTr("to:");
|
||||
parentId="";
|
||||
bodyField.text="";
|
||||
attachImageURLs.pop();
|
||||
try{imageAttachment.destroy()}catch(e){}
|
||||
}
|
||||
}
|
||||
|
||||
function contactmenu(letter){
|
||||
Newsjs.listFriends(login,db,function(contacts){
|
||||
var contactitems="";
|
||||
for (var i=0;i<contacts.length;i++){
|
||||
if(Helperjs.getCount(db,login,"contacts","screen_name",contacts[i].screen_name)>1){
|
||||
contacts[i].screen_name=contacts[i].screen_name+"+"+contacts[i].cid
|
||||
}
|
||||
contactitems=contactitems+"MenuItem{text:'"+contacts[i].screen_name+
|
||||
"'; onTriggered:{if (newsSwipeview.stacktype=='DirectMessages'){reply_to_user='"+
|
||||
contacts[i].screen_name+"'} else {bodyField.insert("+
|
||||
bodyField.cursorPosition+",' "+contacts[i].screen_name.substring(1)+" ');bodyField.cursorPosition=bodyField.cursorPosition+"+contacts[i].screen_name.length+"}}}"
|
||||
//}
|
||||
}
|
||||
var menuString="import QtQuick.Controls 2.4; Menu {width:40*mm; font.pixelSize: 3*mm; "+contactitems+"}";
|
||||
var contactlistObject=Qt.createQmlObject(menuString,messageColumn,"contactmenuOutput");
|
||||
if (contacts.length>0){contactlistObject.popup()}
|
||||
},letter);
|
||||
}
|
||||
// Flickable{
|
||||
// anchors.fill: parent
|
||||
// contentHeight: messageColumn.height
|
||||
// boundsBehavior: Flickable.StopAtBounds
|
||||
|
||||
Column {
|
||||
y:0.5*mm
|
||||
id:messageColumn
|
||||
spacing: 0.5*mm
|
||||
width: parent.width
|
||||
height: 10*mm//implicitHeight
|
||||
Label{
|
||||
id:receiverLabel
|
||||
x: 0.5*mm
|
||||
width: parent.width-mm
|
||||
font.pixelSize: 3*mm
|
||||
text: newsSwipeview.stacktype=="DirectMessages"?qsTr("to:")+ " "+ reply_to_user:""
|
||||
visible:false// ((parentId !== "") || (newsStack.parent.stacktype=="DirectMessages"))
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
onClicked:{}
|
||||
}
|
||||
}
|
||||
TextField {
|
||||
id: titleField
|
||||
x: 0.5*mm
|
||||
width: parent.width-mm
|
||||
font.pixelSize: 3*mm
|
||||
placeholderText: qsTr("Title (optional)")
|
||||
visible: false//(parentId === "") && (bodyField.length>1)
|
||||
onVisibleChanged: if ((visible==true)&&(conversation==true)){
|
||||
conversationView.contentY=conversationView.contentY+titleField.height
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Rectangle{
|
||||
color: "white"
|
||||
radius: 0.5*mm
|
||||
x:mm
|
||||
width: parent.width-2*mm
|
||||
height:Math.max(bodyField.contentHeight+4*mm,10*mm)
|
||||
TextArea {
|
||||
id: bodyField
|
||||
anchors.fill: parent
|
||||
font.pixelSize: 3*mm
|
||||
font.family: "Noto Sans"
|
||||
wrapMode: Text.Wrap
|
||||
selectByMouse: true
|
||||
placeholderText: conversation?"": qsTr("What's on your mind?")
|
||||
textFormat: TextEdit.RichText //TextEdit.PlainText
|
||||
onLineCountChanged: (conversation==true)?conversationView.contentY=conversationView.contentY+3*mm:newsView.contentY=newsView.contentY+3*mm
|
||||
onLinkActivated:{Qt.openUrlExternally(link)}
|
||||
onActiveFocusChanged:{
|
||||
if (activeFocus==true){
|
||||
if (conversation==true){
|
||||
setParent(conversationModel.get(0).newsitemobject);
|
||||
messageSend.state="conversation"
|
||||
} else{
|
||||
messageSend.state="active"
|
||||
}
|
||||
}
|
||||
}
|
||||
onTextChanged:{
|
||||
if (text!=""){
|
||||
//print(getText(bodyField.cursorPosition-2,bodyField.cursorPosition) +" preedit: "+ preeditText+cursorPosition);
|
||||
var regex1 = /@[a-z]/;var regex2 = /![a-z]/;
|
||||
//print(text.substring(cursorPosition-2,cursorPosition));
|
||||
//if (regex.test(getText(bodyField.cursorPosition-2,bodyField.cursorPosition)) || regex.test(preeditText) || regex.test(text)){
|
||||
if (regex1.test(getText(bodyField.cursorPosition-2,bodyField.cursorPosition)+preeditText) || regex2.test(getText(bodyField.cursorPosition-2,bodyField.cursorPosition)+preeditText)){
|
||||
var letter=(getText(bodyField.cursorPosition-2,bodyField.cursorPosition)).match(/[a-z]/);
|
||||
contactmenu(letter)
|
||||
}
|
||||
}}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Row{
|
||||
// spacing: 2
|
||||
// width: parent.width
|
||||
// CheckBox{
|
||||
// id:dmCheckbox
|
||||
// text:"DM"
|
||||
// enabled: false
|
||||
// checked: (directmessage==1)?true:false
|
||||
// onClicked:{
|
||||
// if(dmCheckbox.checkedState==Qt.Checked){directmessage=1}
|
||||
// else if(dmCheckbox.checkedState==Qt.Unchecked){directmessage=0}
|
||||
// }
|
||||
// }
|
||||
|
||||
// Button{
|
||||
// text:"\uf0c1"
|
||||
// height:8*mm
|
||||
// onClicked: {
|
||||
// if(bodyField.selectedText==""){Helperjs.showMessage("Error","No text selected",messageSend)}
|
||||
// else{urlTextEdit.text="";
|
||||
// urlRectangle.visible=true}}
|
||||
// }
|
||||
// }
|
||||
// Rectangle{
|
||||
// id:urlRectangle
|
||||
// height: 7*mm //parent.height
|
||||
// width:parent.width-2*mm
|
||||
// visible:false
|
||||
// TextField{
|
||||
// id:urlTextEdit
|
||||
// width:parent.width-7*mm
|
||||
// height:parent.height
|
||||
// }
|
||||
// Button{
|
||||
// anchors.left:urlTextEdit.right
|
||||
// anchors.leftMargin:mm
|
||||
// height:8*mm
|
||||
// text:"\u2713"
|
||||
// onClicked: {if(urlTextEdit.text!=""){
|
||||
// var start = bodyField.selectionStart;
|
||||
// var text=bodyField.selectedText
|
||||
// if(text.lastIndexOf(".jpg")>-1 || text.lastIndexOf(".jpeg")>-1 || text.lastIndexOf(".png")>-1){text="<img src="+text+">"}
|
||||
// text = "[url="+urlTextEdit.text+"]" + text + "[/url]";
|
||||
// bodyField.remove(start,bodyField.selectionEnd);
|
||||
// bodyField.insert(start,text);}
|
||||
// urlRectangle.visible=false}
|
||||
// }
|
||||
// }
|
||||
Row{
|
||||
id:buttonRow
|
||||
visible:false //(bodyField.length>1)||(attachImageURLs.length>0)
|
||||
spacing: mm
|
||||
height: 12*mm
|
||||
MButton{id:permButton
|
||||
visible: (newsSwipeview.stacktype!=="DirectMessages")
|
||||
height: 6*mm
|
||||
width: 7*mm
|
||||
text: ((contact_allow.length==0)&&(contact_deny.length==0)&&(group_allow.length==0)&&(group_deny.length==0))?"\uf09c":"\uf023"
|
||||
onClicked: { if (permissionDialog.visible==false){permissionDialog.visible=true} else{permissionDialog.visible=false}}
|
||||
}
|
||||
MButton {
|
||||
id: attachButton
|
||||
height: 6*mm
|
||||
width: 7*mm
|
||||
text: "\uf03e"
|
||||
visible:(newsSwipeview.stacktype!="DirectMessages")
|
||||
onClicked: {
|
||||
if (attachImageURLs.length>0){//Server currently accepts only one attachment
|
||||
Helperjs.showMessage( qsTr("Error"),qsTr("Only one attachment supported at the moment.\n Remove other attachment first!"), messageColumn)
|
||||
}
|
||||
else{
|
||||
root.imagePicking=false;
|
||||
var imagePicker = Qt.createQmlObject('import QtQuick 2.0; import "qrc:/qml/genericqml";'+
|
||||
osSettings.imagePickQml+'{multiple : false;onReady: {attachImageURLs.push(imageUrl);'+
|
||||
'attachImage(imageUrl)}}',root,"imagePicker");
|
||||
imagePicker.pickImage()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MButton{
|
||||
id:smileyButton
|
||||
text: "\uf118"
|
||||
height: 6*mm
|
||||
width: 7*mm
|
||||
onClicked: {if (smileyDialog.visible==false){smileyDialog.visible=true} else{smileyDialog.visible=false}}
|
||||
}
|
||||
|
||||
MButton {
|
||||
id: cancelButton
|
||||
height: 6*mm
|
||||
width: 7*mm
|
||||
text: "\uf057"
|
||||
onClicked: {
|
||||
bodyField.text="";
|
||||
messageSend.state="";
|
||||
permissionDialog.visible=false;
|
||||
receiverLabel.visible=false;
|
||||
reply_to_user="";
|
||||
attachImage("");
|
||||
attachImageURLs.pop();
|
||||
}
|
||||
}
|
||||
MButton {
|
||||
id: sendButton
|
||||
height: 6*mm
|
||||
width: 7*mm
|
||||
text: "\uf1d9"
|
||||
onClicked: {
|
||||
var title=titleField.text.replace("\"","\'");
|
||||
var body=bodyField.getFormattedText(0,bodyField.length);
|
||||
var dmbody=bodyField.getText(0,bodyField.length);
|
||||
if (newsSwipeview.stacktype!=="DirectMessages"){
|
||||
statusUpdate(title,body,parentId,attachImageURLs)}
|
||||
else {
|
||||
if (reply_to_user!=""){dmUpdate(title,dmbody,parentId,reply_to_user)}
|
||||
else{Helperjs.showMessage(qsTr("Error"),qsTr("No receiver supplied!"),root)}
|
||||
}
|
||||
if (conversation==true){
|
||||
newstab.newstabstatus=login.newsViewType; newsStack.pop(null)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
PermissionDialog{id:permissionDialog;x:mm;visible: false}
|
||||
SmileyDialog{id:smileyDialog;x:mm;visible: false}
|
||||
}
|
||||
Component.onCompleted:{
|
||||
//
|
||||
//parentId=conversationModel.get(conversationModel.count-1).newsitemobject.id
|
||||
//if(attachImageURLs.length>0){attachImage(attachImageURLs[0])}
|
||||
newsStack.replySignal.connect(setParent);
|
||||
root.directmessageSignal.connect(directmessagePrepare);
|
||||
root.uploadSignal.connect(sendUrls);
|
||||
root.sendtextSignal.connect(sendtext);
|
||||
}
|
||||
|
||||
states: [ State {
|
||||
name: "active"
|
||||
PropertyChanges {
|
||||
target: messageColumn; height: implicitHeight
|
||||
}
|
||||
PropertyChanges {
|
||||
target: buttonRow; visible:true
|
||||
}
|
||||
PropertyChanges {
|
||||
target: titleField; visible:(newsSwipeview.stacktype!="DirectMessages")//true
|
||||
}
|
||||
PropertyChanges {
|
||||
target: receiverLabel; visible:(newsSwipeview.stacktype=="DirectMessages");
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "conversation"
|
||||
PropertyChanges {
|
||||
target: messageColumn; height: implicitHeight
|
||||
}
|
||||
PropertyChanges {
|
||||
target: buttonRow; visible:true
|
||||
}
|
||||
PropertyChanges {
|
||||
target: titleField; visible:(newsSwipeview.stacktype!="DirectMessages")
|
||||
}
|
||||
|
||||
// PropertyChanges {
|
||||
// target: receiverLabel; visible:true; text:qsTr("to")+": "+ conversationModel.get(0).newsitemobject.user.name
|
||||
// }
|
||||
|
||||
// PropertyChanges {
|
||||
// target: messageSend; reply_to_user: conversationModel.get(0).newsitemobject.user.screen_name
|
||||
// }
|
||||
|
||||
// PropertyChanges {
|
||||
// target: messageSend; parentId: conversationModel.get(0).newsitemobject.status_id
|
||||
// }
|
||||
} ]
|
||||
}
|
||||
//}
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
// 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.9
|
||||
AnimatedImage {id:gif;
|
||||
width:newscolumn.width;
|
||||
property string mimetype:""
|
||||
fillMode: Image.PreserveAspectFit;
|
||||
onStatusChanged: playing = (status == AnimatedImage.Ready);
|
||||
MouseArea {anchors.fill:parent;
|
||||
onClicked:{
|
||||
if (mimetype!="image/gif"){
|
||||
var attachcomponent = Qt.createQmlObject('import QtQuick 2.0; '+
|
||||
'Rectangle{id:recfullscreen;color:"white";width:root.width;height:root.height;'+
|
||||
'MouseArea {anchors.fill:parent;onClicked:{recfullscreen.destroy()}}'+
|
||||
'AnimatedImage {id:giffullscreen;source: "'+gif.source+
|
||||
'";anchors.centerIn:parent; width:root.width;fillMode: Image.PreserveAspectFit; onStatusChanged: playing = (status == AnimatedImage.Ready);'+
|
||||
'}}',root,"Attachmentlarge")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
// 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.9
|
||||
import "qrc:/js/helper.js" as Helperjs
|
||||
//import QtWebView 1.1
|
||||
|
||||
Rectangle{
|
||||
color:"transparent"
|
||||
width:newscolumn.width;
|
||||
height:newscolumn.width/4*3
|
||||
property string url:""//htmlview.text
|
||||
|
||||
Text{id:htmlview
|
||||
textFormat:Text.RichText
|
||||
}
|
||||
// WebView {id:htmlview;
|
||||
// anchors.fill: parent
|
||||
// }
|
||||
Component.onCompleted:{
|
||||
|
||||
// Helperjs.friendicaWebRequest(url,parent,function(document){
|
||||
// print(document);
|
||||
|
||||
//// var metas = document.getElementsByTagName('meta'); //get all the meta tag elements
|
||||
//// //iterate through them
|
||||
//// for (i=0; i<metas.length; i++) {
|
||||
//// if (metas[i].getAttribute("name") == "keywords") {
|
||||
//// print(metas[i].getAttribute("content"));
|
||||
//// }
|
||||
//// else if (metas[i].getAttribute("name") == "description") {
|
||||
//// console.log(metas[i].getAttribute("content"));
|
||||
//// }
|
||||
//// }
|
||||
// //print(html);
|
||||
// htmlview.text=""
|
||||
// })
|
||||
}
|
||||
}
|
||||
|
|
@ -1,579 +0,0 @@
|
|||
// 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:/js/news.js" as Newsjs
|
||||
import "qrc:/js/helper.js" as Helperjs
|
||||
import "qrc:/js/service.js" as Service
|
||||
|
||||
StackView{
|
||||
id: newsStack
|
||||
anchors.fill: parent
|
||||
property string updateMethodNews: "refresh"
|
||||
property var allchats: ({})
|
||||
signal replySignal(var newsobject)
|
||||
property int lastnewsid:0
|
||||
|
||||
function newstypeHandling(newstype){
|
||||
newsBusy.running=true;
|
||||
replySignal("");
|
||||
//messagesend.state="";
|
||||
newsModel.clear();
|
||||
switch(newstype){
|
||||
case "timeline":
|
||||
newstab.newstabstatus="Timeline";
|
||||
try{ Newsjs.newsfromdb(root.db,root.login,0, function(dbnews,lastid){
|
||||
lastnewsid=lastid;
|
||||
showNews(dbnews)
|
||||
})}catch(e){Helperjs.showMessage("Error",e,root)};
|
||||
break;
|
||||
case "conversation":
|
||||
newstab.newstabstatus="Conversations";
|
||||
Newsjs.chatsfromdb(root.db,root.login,0,function(news,lastid){
|
||||
lastnewsid=lastid;
|
||||
showNews(news)});
|
||||
break;
|
||||
case "favorites":
|
||||
newsStack.updateMethodNews="refresh";
|
||||
newstab.newstabstatus="Favorites";
|
||||
Service.updateView("Favorites");
|
||||
break;
|
||||
case "replies":
|
||||
newsStack.updateMethodNews="refresh";
|
||||
newstab.newstabstatus="Replies";
|
||||
Service.updateView("Replies");
|
||||
break;
|
||||
case "publictimeline":
|
||||
newsStack.updateMethodNews="refresh";
|
||||
newstab.newstabstatus="Public Timeline";
|
||||
Service.updateView("Public Timeline");
|
||||
break;
|
||||
case "groupnews":
|
||||
newsStack.updateMethodNews="refresh";
|
||||
Service.showGroups();
|
||||
break;
|
||||
case "search":
|
||||
newsView.anchors.topMargin=7*mm;
|
||||
newsBusy.running=false;
|
||||
var component = Qt.createComponent("qrc:/qml/genericqml/Search.qml");
|
||||
var searchItem = component.createObject(newsStack,{y:mm,width:root.width,height: 5*mm});
|
||||
break;
|
||||
case "refresh":
|
||||
if (newstab.newstabstatus=="Timeline"){
|
||||
newsStack.updateMethodNews="append"
|
||||
} else {newsStack.updateMethodNews="refresh"}
|
||||
//root.contactLoadType="news";
|
||||
if (newsSwipeview.stacktype=="Home"){
|
||||
Service.updateView(newstab.newstabstatus)
|
||||
}
|
||||
else if (newsSwipeview.stacktype=="DirectMessage"){
|
||||
Service.updateView("Direct Messages")
|
||||
}
|
||||
else if (newsSwipeview.stacktype=="Notifications"){
|
||||
Service.updateView("Notifications")
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (newstab.newstabstatus=="Timeline"){
|
||||
newsStack.updateMethodNews="append"
|
||||
} else {newsStack.updateMethodNews="refresh"}
|
||||
//root.contactLoadType="news";
|
||||
if (newsSwipeview.stacktype=="Home"){
|
||||
Service.updateView(newstab.newstabstatus)
|
||||
}
|
||||
else if (newsSwipeview.stacktype=="Directmessage"){
|
||||
Service.updateView("Direct Messages")
|
||||
}
|
||||
else if (newsSwipeview.stacktype=="Notifications"){
|
||||
Service.updateView("Notifications")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function showNews(newsToShow){
|
||||
try{
|
||||
if (newsStack.depth>1){newsStack.pop()}
|
||||
}catch(e){}
|
||||
newsBusy.running=false;
|
||||
var currentTime= new Date();
|
||||
// downloadNotice.text=downloadNotice.text + "\n shownews start "+ Date.now();
|
||||
//print("appendnews "+JSON.stringify(newsToShow))
|
||||
var msg = {'currentTime': currentTime, 'model': newsModel,'news':newsToShow,'method':newsStack.updateMethodNews, 'options':globaloptions};
|
||||
newsWorker.sendMessage(msg);
|
||||
//newsStack.appendNews=false
|
||||
}
|
||||
|
||||
function showContact(contact){ //print(JSON.stringify(contact));
|
||||
//newstab.newstabstatus="Contact";
|
||||
newsStack.push("qrc:/qml/newsqml/ContactPage.qml",{"contact": contact});
|
||||
}
|
||||
|
||||
function search(term){//print("Search "+term)
|
||||
if (term!=""){
|
||||
newstab.newstabstatus="Search";
|
||||
newsBusy.running=true;
|
||||
newsStack.updateMethodNews="refresh";
|
||||
xhr.setLogin(login.username+":"+Qt.atob(login.password));
|
||||
xhr.setUrl(login.server);
|
||||
xhr.setApi("/api/search");
|
||||
xhr.clearParams();
|
||||
xhr.setParam("q",term)
|
||||
xhr.get();}
|
||||
newsView.anchors.topMargin=mm
|
||||
}
|
||||
|
||||
Connections{
|
||||
target:xhr
|
||||
onError:{
|
||||
Helperjs.showMessage(qsTr("Network Error"),"API:\n" +login.server+api+"\n Return: \n"+data,root);
|
||||
}
|
||||
onSuccess:{
|
||||
// downloadNotice.text=downloadNotice.text+ "\n xhr finished "+Date.now();
|
||||
Service.processNews(api,data);
|
||||
}
|
||||
}
|
||||
|
||||
Timer {id:replytimer; interval: 1000; running: false; repeat: false
|
||||
onTriggered: {
|
||||
newsBusy.running=true;
|
||||
if(newstab.newstabstatus=="Conversation"){
|
||||
showConversation(newsStack.timelineIndex-1,newsModel.get(0).newsitemobject)}
|
||||
else{
|
||||
if (newstab.newstabstatus=="Timeline"){
|
||||
newsStack.updateMethodNews="append"
|
||||
} else {newsStack.updateMethodNews="refresh"}
|
||||
if (newsSwipeview.stacktype=="Home"){
|
||||
Service.updateView(newstab.newstabstatus)
|
||||
}
|
||||
else if (newsSwipeview.stacktype=="DirectMessages"){
|
||||
Service.updateView("Direct Messages")
|
||||
}
|
||||
else if (newsSwipeview.stacktype=="Replies"){
|
||||
Service.updateView("Replies")
|
||||
}
|
||||
replySignal("")
|
||||
//Service.updateView(newstab.newstabstatus)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
initialItem: Rectangle {
|
||||
id:newslistRectangle
|
||||
y:1
|
||||
color: "white"
|
||||
|
||||
// Button{
|
||||
// id:newstabstatusButton
|
||||
// anchors.top: parent.top
|
||||
// anchors.topMargin: 0.5*mm
|
||||
// height: 8*mm
|
||||
// text: qsTr(newstab.newstabstatus)
|
||||
// visible: newsStack.parent.stacktype=="standard"
|
||||
// onClicked: {print(newsStack.parent.stacktype);
|
||||
// newstabmenu.popup(2*mm,6*mm)
|
||||
// }
|
||||
|
||||
// Menu{id:newstabmenu
|
||||
// width: 40*mm
|
||||
|
||||
// delegate:MenuItem{
|
||||
// contentItem: Text{
|
||||
// font.pixelSize: 3.5*mm
|
||||
// text:parent.text
|
||||
// }
|
||||
// background: Rectangle {
|
||||
// implicitWidth: 40*mm; implicitHeight: 5*mm
|
||||
// color: "#ffffff"
|
||||
// border.color: "grey"
|
||||
// }
|
||||
// }
|
||||
// Action {
|
||||
// text: qsTr("Timeline")
|
||||
// onTriggered: {
|
||||
|
||||
// }
|
||||
// Action {
|
||||
// text: qsTr("Conversations")
|
||||
// onTriggered:{
|
||||
// //newsModel.clear();
|
||||
// newstab.newstabstatus="Conversations";
|
||||
// Newsjs.chatsfromdb(db,root.login,function(news){showNews(news)})
|
||||
// }
|
||||
// }
|
||||
// Action {
|
||||
// text: qsTr("Favorites")
|
||||
// onTriggered:{
|
||||
// newsStack.updateMethodNews="refresh";
|
||||
// newstab.newstabstatus="Favorites";
|
||||
// Service.updateView("Favorites")
|
||||
// }
|
||||
// }
|
||||
// Action {
|
||||
// text: qsTr("Replies")
|
||||
// onTriggered:{
|
||||
// newsStack.updateMethodNews="refresh";
|
||||
// newstab.newstabstatus="Replies";
|
||||
// Service.updateView("Replies")
|
||||
// }
|
||||
// }
|
||||
// Action {
|
||||
// text: qsTr("Public timeline")
|
||||
// onTriggered:{
|
||||
// newsStack.updateMethodNews="refresh";
|
||||
// newstab.newstabstatus="Public Timeline";
|
||||
// Service.updateView("Public Timeline")
|
||||
// }
|
||||
// }
|
||||
|
||||
//// Action {
|
||||
//// text: qsTr("Direct Messages")
|
||||
//// onTriggered:{
|
||||
//// newsStack.updateMethodNews="refresh";
|
||||
//// newstab.newstabstatus="Direct Messages";
|
||||
//// Service.updateView("Direct Messages")
|
||||
//// }
|
||||
//// }
|
||||
//// Action {
|
||||
//// text: qsTr("Notifications")
|
||||
//// onTriggered:{
|
||||
//// newsStack.updateMethodNews="refresh";
|
||||
//// newstab.newstabstatus="Notifications";
|
||||
//// Service.updateView("Notifications")
|
||||
//// }
|
||||
//// }
|
||||
// Action {
|
||||
|
||||
// text: qsTr("Group news")
|
||||
// onTriggered:
|
||||
// {
|
||||
// newsStack.updateMethodNews="refresh";
|
||||
// Service.showGroups();
|
||||
// }
|
||||
// }
|
||||
// Action {
|
||||
|
||||
// text: qsTr("Settings")
|
||||
// onTriggered:
|
||||
// {
|
||||
// leftDrawer.open()
|
||||
// }
|
||||
// }
|
||||
|
||||
// Action {
|
||||
// text: qsTr("Quit")
|
||||
// onTriggered:{
|
||||
// Service.cleanNews(root.db,function(){
|
||||
// Service.cleanContacts(root.login,root.db,function(){
|
||||
// Qt.quit()})
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// Row{
|
||||
// spacing: mm
|
||||
// anchors.top: parent.top
|
||||
// anchors.topMargin: 0.5*mm
|
||||
// anchors.right: parent.right
|
||||
|
||||
// Button {
|
||||
// id: searchButton
|
||||
// height: 8*mm
|
||||
// text: "\uf002"
|
||||
// visible: newsStack.parent.stacktype=="standard"
|
||||
// onClicked: {
|
||||
// newsView.anchors.topMargin=18*mm;
|
||||
// var component = Qt.createComponent("qrc:/qml/genericqml/Search.qml");
|
||||
// var searchItem = component.createObject(newsStack,{y:8*mm,width:root.width,height: 8*mm});
|
||||
// }
|
||||
// }
|
||||
|
||||
// Button {
|
||||
// id: newMessageButton
|
||||
// text: "\uf040"
|
||||
// height: 8*mm
|
||||
// onClicked: {
|
||||
// var groups=[];
|
||||
// Helperjs.readData(root.db,"groups",root.login.username,function(groupobject){
|
||||
// groups=groupobject
|
||||
// });
|
||||
// newstab.newstabstatus="SendMessage";
|
||||
// Helperjs.readData(root.db,"contacts",root.login.username,function(friends){
|
||||
// newsStack.push("qrc:/qml/newsqml/MessageSend.qml",{"contacts": friends,"login":root.login})
|
||||
// },"isFriend",1);
|
||||
// }
|
||||
// }
|
||||
// BlueButton {
|
||||
// id: quitButton
|
||||
// text: "\uf08b"
|
||||
// onClicked: {Service.cleanNews(root.db,function(){
|
||||
// Service.cleanContacts(root.login,root.db,function(){
|
||||
// Qt.quit() })
|
||||
// })}
|
||||
// }
|
||||
// Button {
|
||||
// id: update
|
||||
// height: 8*mm
|
||||
// text: "\uf021"
|
||||
// onClicked: {
|
||||
// if (newstab.newstabstatus=="Timeline"){
|
||||
// newsStack.updateMethodNews="append"
|
||||
// } else {newsStack.updateMethodNews="refresh"}
|
||||
// //root.contactLoadType="news";
|
||||
// if (newsStack.parent.stacktype=="standard"){
|
||||
// Service.updateView(newstab.newstabstatus)
|
||||
// }
|
||||
// else if (newsStack.parent.stacktype=="directmessage"){
|
||||
// Service.updateView("Direct Messages")
|
||||
// }
|
||||
// else if (newsStack.parent.stacktype=="notifications"){
|
||||
// Service.updateView("Notifications")
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// }
|
||||
Component { id:footerComponent
|
||||
Rectangle{
|
||||
border.color: "#EEEEEE"
|
||||
border.width: 1
|
||||
width:newsView.width
|
||||
height:6*mm
|
||||
Text{
|
||||
font.pixelSize: 1.5*mm
|
||||
anchors.centerIn: parent
|
||||
text:qsTr("More")
|
||||
}
|
||||
MouseArea{anchors.fill:parent
|
||||
onClicked:{
|
||||
var currentTime= new Date();
|
||||
var lastnews_id=newsModel.get(newsModel.count-1).newsitemobject.created_at;
|
||||
var messagetype=0;
|
||||
switch(newsSwipeview.stacktype){
|
||||
case "Home":messagetype=0;break;
|
||||
case "DirectMessages": messagetype=1;break;
|
||||
case "Notifications":messagetype=2;break;
|
||||
case "Replies":messagetype=3;break;
|
||||
default:messagetype=0;
|
||||
}
|
||||
if(newstab.newstabstatus=="Timeline"){
|
||||
Newsjs.newsfromdb(root.db,root.login, messagetype,function(news){
|
||||
var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'appendnews':true, 'options':globaloptions};
|
||||
newsWorker.sendMessage(msg);
|
||||
},false,lastnews_id)}
|
||||
if(newstab.newstabstatus=="Conversations"){
|
||||
Newsjs.chatsfromdb(root.db,root.login, messagetype,function(news){
|
||||
var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'appendnews':true, 'options':globaloptions};
|
||||
newsWorker.sendMessage(msg);
|
||||
},lastnews_id)}
|
||||
// else if(newstab.newstabstatus=="Contact"){
|
||||
// Newsjs.newsfromdb(root.db,root.login, function(news){
|
||||
// var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'appendnews':true};
|
||||
// newsWorker.sendMessage(msg);
|
||||
// },newsModel.get(newsModel.count-1).newsitemobject.uid,lastnews_id)}
|
||||
else if (newstab.newstabstatus=="Notifications"){}
|
||||
else{
|
||||
//newsStack.appendNews=true;
|
||||
xhr.setParam("max_id",newsModel.get(newsModel.count-1).newsitemobject.id-1);
|
||||
xhr.get()
|
||||
}}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Label{
|
||||
// text:qsTr(stacktype)
|
||||
// font.pixelSize: 3* mm
|
||||
// anchors.horizontalCenter: parent.horizontalCenter
|
||||
// anchors.margins: mm
|
||||
// }
|
||||
|
||||
ListView {
|
||||
id: newsView
|
||||
property real oldContentY:0
|
||||
property bool viewdragged: false
|
||||
anchors.fill: parent
|
||||
anchors.margins: mm
|
||||
//anchors.topMargin: 6*mm
|
||||
// anchors.leftMargin: mm; anchors.rightMargin: mm
|
||||
// anchors.bottomMargin: mm
|
||||
clip: true
|
||||
spacing: 0
|
||||
header: MessageSend{id:messagesend;onHeightChanged: newsView.positionViewAtBeginning()}
|
||||
footer: footerComponent
|
||||
model: newsModel
|
||||
delegate: Newsitem{}
|
||||
onDragStarted: oldContentY=contentY
|
||||
onDragEnded: {
|
||||
if(verticalOvershoot<-5*mm){
|
||||
viewdragged=true
|
||||
}
|
||||
else{
|
||||
if((contentY-oldContentY)>15*mm){
|
||||
swipeIndicator.visible=false;
|
||||
newsSwipeview.height=rootStackItem.height;
|
||||
newsSwipeview.y=0;
|
||||
rootStackItem.state="fullscreen"
|
||||
}
|
||||
else if ((contentY-oldContentY)<-15*mm){
|
||||
swipeIndicator.visible=true;
|
||||
newsSwipeview.height=rootStackItem.height-12*mm;
|
||||
newsSwipeview.y=5*mm;
|
||||
rootStackItem.state=""
|
||||
}
|
||||
}
|
||||
}
|
||||
onViewdraggedChanged: {
|
||||
if (viewdragged){
|
||||
var onlynew=true;
|
||||
newsBusy.running=true;
|
||||
if (newstab.newstabstatus=="Timeline"){
|
||||
newsStack.updateMethodNews="append"
|
||||
} else {newsStack.updateMethodNews="refresh"}
|
||||
//root.contactLoadType="news";
|
||||
if (newsSwipeview.stacktype=="Home"){
|
||||
Newsjs.getLastNews(root.login,root.db,function(currentlastnews){
|
||||
if (currentlastnews>lastnewsid){
|
||||
if(newstab.newstabstatus=="Timeline"){
|
||||
try{ Newsjs.newsfromdb(root.db,root.login,0, function(dbnews,lastid){
|
||||
lastnewsid=lastid;
|
||||
showNews(dbnews)
|
||||
})}catch(e){Helperjs.showMessage("Error",e,root)};
|
||||
}
|
||||
if(newstab.newstabstatus=="Conversations"){
|
||||
Newsjs.chatsfromdb(db,root.login,0,function(news,lastid){
|
||||
lastnewsid=lastid;
|
||||
showNews(news)});
|
||||
}
|
||||
} else {
|
||||
Service.updateView(newstab.newstabstatus)
|
||||
}
|
||||
});
|
||||
}
|
||||
else if (newsSwipeview.stacktype=="DirectMessages"){
|
||||
Service.updateView("Direct Messages")
|
||||
}
|
||||
else if (newsSwipeview.stacktype=="Notifications"){
|
||||
Service.updateView("Notifications")
|
||||
}
|
||||
else if (newsSwipeview.stacktype=="Replies"){
|
||||
Service.updateView("Replies")
|
||||
}
|
||||
viewdragged=false
|
||||
}}
|
||||
}
|
||||
|
||||
ListModel{id: newsModel}
|
||||
|
||||
WorkerScript {
|
||||
id: newsWorker
|
||||
source: "qrc:/js/newsworker.js"
|
||||
}
|
||||
|
||||
BusyIndicator{
|
||||
id: newsBusy
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.top:parent.top
|
||||
anchors.topMargin: 2*mm
|
||||
width:10*mm
|
||||
height: 10*mm
|
||||
}
|
||||
Rectangle{
|
||||
id:downloadNotice
|
||||
property alias text: noticeText.text
|
||||
color:"white"
|
||||
border.color:"grey"
|
||||
z:1
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.bottom:parent.bottom
|
||||
anchors.bottomMargin: 2*mm
|
||||
width: noticeText.width+2*mm
|
||||
height: noticeText.height+2*mm
|
||||
visible: (downloadNotice.text!="")
|
||||
|
||||
Text{
|
||||
id:noticeText
|
||||
color: "grey"
|
||||
anchors.centerIn: parent
|
||||
width: contentWidth
|
||||
height: contentHeight
|
||||
font.pixelSize: 2*mm
|
||||
text:""
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
//print(newsSwipeview.stacktype);
|
||||
root.newstypeSignal.connect(newstypeHandling);
|
||||
root.messageSignal.connect(onFriendsMessages);
|
||||
root.contactdetailsSignal.connect(showContact);
|
||||
root.newsSignal.connect(showNews);
|
||||
|
||||
try{newsModel.clear()} catch(e){}
|
||||
swipeIndicator.visible=true;
|
||||
newsSwipeview.height=rootStackItem.height-12*mm;
|
||||
newsSwipeview.y=5*mm;
|
||||
rootStackItem.state=""
|
||||
|
||||
// xhr.setLogin(login.username+":"+Qt.atob(login.password));
|
||||
// xhr.setUrl(login.server);
|
||||
// if((newsStack.parent.stacktype=="standard") && (root.news.length>0)){
|
||||
// showNews(root.news)
|
||||
// }
|
||||
//else{
|
||||
newstab.newstabstatus=login.newsViewType;
|
||||
var messagetype=0;
|
||||
switch(newsSwipeview.stacktype){
|
||||
case "Home":messagetype=0;break;
|
||||
case "DirectMessages": messagetype=1;break;
|
||||
case "Notifications":messagetype=2;break;
|
||||
case "Replies":messagetype=3;break;
|
||||
default:messagetype=0;
|
||||
}
|
||||
if((login.newsViewType=="Conversations")&&(newsSwipeview.stacktype=="Home")){
|
||||
Newsjs.chatsfromdb(db,login,messagetype,function(dbnews,lastid){
|
||||
lastnewsid=lastid;
|
||||
showNews(dbnews);
|
||||
})
|
||||
}
|
||||
else{Newsjs.newsfromdb(db,login,messagetype,function(dbnews,lastid){
|
||||
lastnewsid=lastid;
|
||||
showNews(dbnews)
|
||||
})}
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,184 +0,0 @@
|
|||
// 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 QtQuick.Controls.Styles 2.3
|
||||
//import QtQuick.Dialogs 1.3
|
||||
import "qrc:/qml/newsqml"
|
||||
import "qrc:/js/news.js" as Newsjs
|
||||
import "qrc:/js/helper.js" as Helperjs
|
||||
import "qrc:/js/service.js" as Service
|
||||
|
||||
Item {
|
||||
|
||||
// Connections{
|
||||
// target:xhr
|
||||
// onError:{
|
||||
// Helperjs.showMessage(qsTr("Network Error"),"API:\n" +login.server+api+"\n Return: \n"+data,root);
|
||||
// }
|
||||
// onSuccess:{
|
||||
// if (api=="/api/statuses/friends_timeline"){
|
||||
// // downloadNotice.text=downloadNotice.text+ "\n xhr finished "+Date.now();
|
||||
// //Service.processNews(api,data);
|
||||
// if(login.newsViewType=="Timeline"){
|
||||
// Newsjs.newsfromdb(db,login.username,function(dbnews){showNews(dbnews)})}
|
||||
// else{Newsjs.chatsfromdb(db,login.username,function(dbnews){
|
||||
// showNews(dbnews);
|
||||
// })}
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
Timer {id:contacttimer; interval: 50; running: false; repeat: false
|
||||
onTriggered: {//print("Contacttimer "+JSON.stringify(root.news));
|
||||
// downloadNotice.text=downloadNotice.text + "\n contactTimer start "+ Date.now()
|
||||
root.newContacts=Newsjs.findNewContacts(root.news,root.contactlist);
|
||||
Newsjs.storeNews(login,db,root.news,root)
|
||||
}
|
||||
}
|
||||
|
||||
function showConversation(conversationIndex,newsitemobject){
|
||||
if(newsitemobject.messagetype==0 || newsitemobject.messagetype==3){
|
||||
xhr.clearParams();
|
||||
xhr.setLogin(login.username+":"+Qt.atob(login.password));
|
||||
xhr.setUrl(login.server);
|
||||
xhr.setApi("/api/conversation/show");
|
||||
xhr.setParam("id",newsitemobject.id)
|
||||
xhr.get();
|
||||
}
|
||||
else{
|
||||
xhr.clearParams();
|
||||
xhr.setLogin(login.username+":"+Qt.atob(login.password));
|
||||
xhr.setUrl(login.server);
|
||||
xhr.setApi("/api/direct_messages/conversation");
|
||||
xhr.setParam("uri",newsitemobject.statusnet_conversation_id)
|
||||
xhr.get();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function onFriendsMessages(friend){
|
||||
newstab.newstabstatus="Contact"
|
||||
Newsjs.newsfromdb(db,root.login.username, 0,function(dbnews){
|
||||
if (dbnews.length==0){
|
||||
Newsjs.newsfromdb(db,login.username,0,function(forumnews){
|
||||
showNews(forumnews)
|
||||
},friend.url)
|
||||
}
|
||||
else showNews(dbnews)
|
||||
},friend.id)
|
||||
}
|
||||
|
||||
Label{
|
||||
text:"\uf0c9 "
|
||||
font.pixelSize: 5* mm
|
||||
anchors.left: parent.left
|
||||
anchors.margins: mm
|
||||
color: "#B0BEC5"
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
onClicked:{
|
||||
leftDrawer.open()
|
||||
}
|
||||
}
|
||||
}
|
||||
Label{
|
||||
text:qsTr(newsSwipeview.stacktype)
|
||||
font.pixelSize: 3* mm
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.margins: 2*mm
|
||||
}
|
||||
SwipeView{
|
||||
id: newsSwipeview
|
||||
property string stacktype:"Home"
|
||||
currentIndex: 0
|
||||
width: parent.width
|
||||
height: parent.height-6*mm
|
||||
y: 5*mm
|
||||
function onDirectMessage(friend){currentIndex=2}
|
||||
|
||||
transitions: Transition {
|
||||
PropertyAnimation { properties: "height";
|
||||
easing.type: Easing.InOutQuad
|
||||
duration: 1000
|
||||
}
|
||||
}
|
||||
|
||||
onCurrentIndexChanged: {
|
||||
switch(currentIndex){
|
||||
case 0: stacktype="Home";break;
|
||||
case 1: stacktype="Replies";break;
|
||||
case 2: stacktype="DirectMessages";break;
|
||||
case 3: stacktype="Notifications";break;
|
||||
default: stacktype="Home";
|
||||
}
|
||||
}
|
||||
//anchors.fill: parent
|
||||
Loader{
|
||||
id: friendstimeline
|
||||
source:(newsSwipeview.currentIndex==0)? "qrc:/qml/newsqml/NewsStack.qml":""
|
||||
//onLoaded: newsSwipeview.stacktype="Home"
|
||||
}
|
||||
Loader{
|
||||
id: replies
|
||||
//property string stacktype:"Replies"
|
||||
source:(newsSwipeview.currentIndex==1)? "qrc:/qml/newsqml/NewsStack.qml":""
|
||||
//onLoaded: newsSwipeview.stacktype="Replies"
|
||||
}
|
||||
Loader{
|
||||
id: directmessages
|
||||
property var friend:({})
|
||||
source:(newsSwipeview.currentIndex==2)? "qrc:/qml/newsqml/NewsStack.qml":""
|
||||
//onLoaded: newsSwipeview.stacktype="DirectMessages"
|
||||
}
|
||||
Loader{
|
||||
id: notifications
|
||||
//property string stacktype:"Notifications"
|
||||
source:(newsSwipeview.currentIndex==3)? "qrc:/qml/newsqml/NewsStack.qml":""
|
||||
//onLoaded: newsSwipeview.stacktype="Notifications"
|
||||
}
|
||||
Component.onCompleted: {root.directmessageSignal.connect(onDirectMessage);}
|
||||
}
|
||||
|
||||
PageIndicator {
|
||||
id: swipeIndicator
|
||||
count: newsSwipeview.count
|
||||
currentIndex: newsSwipeview.currentIndex
|
||||
|
||||
anchors.bottom: newsSwipeview.bottom
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
// 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 QtMultimedia 5.8
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Controls.Styles 1.4
|
||||
|
||||
Rectangle{
|
||||
color:"black"
|
||||
//border.color: "light grey"
|
||||
width:newscolumn.width;
|
||||
height:newscolumn.width/4*3//video.hasVideo?newscolumn.width/4*3:10*mm
|
||||
property alias source:video.source
|
||||
Text{
|
||||
id:noticeText
|
||||
text:"\uf144";
|
||||
color:"light grey"
|
||||
width:parent.width
|
||||
font.pixelSize: parent.height/2
|
||||
x:parent.width/2-parent.height/4
|
||||
y:parent.height/5
|
||||
visible: video.playbackState!=MediaPlayer.PlayingState
|
||||
}
|
||||
|
||||
Video {id:video;
|
||||
anchors.fill:parent
|
||||
property string mimetype:""
|
||||
onErrorChanged:{noticeText.font.pixelSize=3*mm;noticeText.text=errorString}
|
||||
fillMode: Image.PreserveAspectFit;
|
||||
autoLoad: false
|
||||
audioRole: MediaPlayer.VideoRole
|
||||
MouseArea {anchors.fill:parent;
|
||||
onClicked:{if(video.playbackState!=MediaPlayer.PlayingState){
|
||||
video.play()} else{video.pause()}
|
||||
}
|
||||
}
|
||||
}
|
||||
ProgressBar{
|
||||
id: videoProgress
|
||||
width: parent.width
|
||||
height: 2*mm
|
||||
anchors.top: video.bottom
|
||||
z:2
|
||||
visible:video.playbackState!=MediaPlayer.StoppedState
|
||||
value: video.position/video.duration
|
||||
}
|
||||
ProgressBar{
|
||||
id: videoBuffer
|
||||
width: parent.width
|
||||
height: 2*mm
|
||||
anchors.top: video.bottom
|
||||
visible:video.playbackState!=MediaPlayer.StoppedState
|
||||
value: video.bufferProgress
|
||||
style:ProgressBarStyle{
|
||||
progress: Rectangle{
|
||||
color:"light grey"
|
||||
}
|
||||
}
|
||||
}
|
||||
// Slider{ id: videoSlider
|
||||
// width: parent.width
|
||||
// height: 3*mm
|
||||
// anchors.top: video.bottom
|
||||
// visible:video.playbackState!=MediaPlayer.StoppedState && video.seekable
|
||||
// value: video.position/video.duration
|
||||
// onPressed:video.seek(value*video.duration)
|
||||
// }
|
||||
}
|
||||
|
|
@ -1,100 +0,0 @@
|
|||
|
||||
|
||||
// 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.8
|
||||
import "qrc:/js/helper.js" as Helperjs
|
||||
//import QtWebView 1.1
|
||||
|
||||
Rectangle{
|
||||
color:"transparent"
|
||||
width:newscolumn.width;
|
||||
height:newscolumn.width/4*3
|
||||
property string url:""//htmlview.text
|
||||
WebView {
|
||||
id: webView
|
||||
anchors.fill: parent
|
||||
opacity: 0
|
||||
|
||||
url: "qrc:///content/player.html?" + currentVideo.vId
|
||||
|
||||
Behavior on opacity { NumberAnimation { duration: 200 } }
|
||||
|
||||
onLoadingChanged: {
|
||||
switch (loadRequest.status)
|
||||
{
|
||||
case WebView.LoadSucceededStatus:
|
||||
opacity = 1
|
||||
return
|
||||
case WebView.LoadStartedStatus:
|
||||
case WebView.LoadStoppedStatus:
|
||||
break
|
||||
case WebView.LoadFailedStatus:
|
||||
topInfo.text = "Failed to load the requested video"
|
||||
break
|
||||
}
|
||||
opacity = 0
|
||||
}
|
||||
onTitleChanged: {
|
||||
currentVideo.status = 1 * title
|
||||
if (title == videoStatus.paused || title == videoStatus.ready)
|
||||
panel.state = "list"
|
||||
else if (title == videoStatus.playing)
|
||||
panel.state = "hidden"
|
||||
}
|
||||
}
|
||||
Text{id:htmlview
|
||||
textFormat:Text.RichText
|
||||
}
|
||||
// WebView {id:htmlview;
|
||||
// anchors.fill: parent
|
||||
// }
|
||||
Component.onCompleted:{
|
||||
|
||||
// Helperjs.friendicaWebRequest(url,parent,function(document){
|
||||
// print(document);
|
||||
|
||||
//// var metas = document.getElementsByTagName('meta'); //get all the meta tag elements
|
||||
//// //iterate through them
|
||||
//// for (i=0; i<metas.length; i++) {
|
||||
//// if (metas[i].getAttribute("name") == "keywords") {
|
||||
//// print(metas[i].getAttribute("content"));
|
||||
//// }
|
||||
//// else if (metas[i].getAttribute("name") == "description") {
|
||||
//// console.log(metas[i].getAttribute("content"));
|
||||
//// }
|
||||
//// }
|
||||
// //print(html);
|
||||
// htmlview.text=""
|
||||
// })
|
||||
}
|
||||
}
|
||||
|
|
@ -1,484 +0,0 @@
|
|||
// 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.0
|
||||
import QtQuick.Controls 2.4
|
||||
//import QtQuick.Controls.Styles 1.4
|
||||
import "qrc:/js/news.js" as Newsjs
|
||||
import "qrc:/js/helper.js" as Helperjs
|
||||
import "qrc:/qml/genericqml"
|
||||
|
||||
Item {
|
||||
id: newsitem
|
||||
width: parent.width
|
||||
height:toprow.height+friendicaActivities.height+controlrow.height+1//Math.max((itemMessage.height+topFlow.height+friendicaActivities.height+4*mm),profileImage.height+user_name.height+mm)
|
||||
property int itemindex: index
|
||||
|
||||
property string attending: ""
|
||||
onAttendingChanged: {attendLabel.visible=true;
|
||||
attendLabel.text= qsTr("attending: ")+ qsTr(attending)}
|
||||
|
||||
signal replyto(string parent_id)
|
||||
|
||||
function showActivityContacts(contacts){
|
||||
var component = Qt.createComponent("qrc:/qml/newsqml/FriendicaActivities.qml");
|
||||
var imagedialog = component.createObject(friendicaActivities,{"activitymembers": contacts});
|
||||
}
|
||||
|
||||
function findTags(fulltext){
|
||||
return fulltext.match(/\s+[#]+[A-Za-z0-9-_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]+/g)
|
||||
}
|
||||
|
||||
Rectangle{width:newsitem.width; height: 1; anchors.bottom: newsitem.bottom; color:"light grey"}
|
||||
|
||||
Rectangle{
|
||||
width:newsitem.width
|
||||
height:newsitem.height-1
|
||||
color: "white"//(newsitemobject.messagetype==1)?"#ffe6e6" : "white"
|
||||
|
||||
Row{id:toprow
|
||||
Column {
|
||||
id: authorcolumn
|
||||
width: 8*mm
|
||||
|
||||
Image {
|
||||
id:profileImage
|
||||
source: ((newsitemobject.user.profile_image!="") && (typeof(newsitemobject.user.profile_image)=="string"))? "file://"+newsitemobject.user.profile_image : newsitemobject.user.profile_image_url
|
||||
x:1
|
||||
width: 7*mm
|
||||
height: 7*mm
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
onClicked:{
|
||||
showContact(newsitemobject.user)}
|
||||
}
|
||||
onStatusChanged: if (profileImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
|
||||
}
|
||||
Label {
|
||||
id:user_name
|
||||
color: "grey"
|
||||
width:parent.width
|
||||
font.pixelSize: 1.5*mm
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
text: newsitemobject.user.name+forumname
|
||||
}
|
||||
}
|
||||
Column {
|
||||
id:newscolumn
|
||||
width: newsitem.width-8*mm
|
||||
|
||||
Flow{
|
||||
id:topFlow
|
||||
spacing: mm
|
||||
width:parent.width
|
||||
Label {
|
||||
id:messageTypeLabel
|
||||
color: "grey"
|
||||
text: if (newsitemobject.messagetype==1){ qsTr("Direct Message")} else if(newsitemobject.messagetype==2) {" Notification"} else {qsTr("Source: ")+newsitemobject.source}
|
||||
font.pixelSize: 1.5*mm
|
||||
}
|
||||
Label {
|
||||
id:createdAtLabel
|
||||
color: "grey"
|
||||
font.pixelSize: 1.5*mm
|
||||
horizontalAlignment: Label.AlignRight
|
||||
text: dateDiff
|
||||
}
|
||||
Label {
|
||||
id:replytoLabel
|
||||
color: "grey"
|
||||
font.pixelSize: 1.5*mm
|
||||
font.family: "Noto Sans"
|
||||
horizontalAlignment: Label.AlignRight
|
||||
text: try {qsTr("In reply to ")+newsitemobject.reply_user.screen_name
|
||||
}catch(e){" "}
|
||||
}
|
||||
|
||||
Label {
|
||||
id:newscountLabel
|
||||
visible:((newstabstatus=="Conversations")&&(newsitemobject.newscount>1))?true:false
|
||||
color: "grey"
|
||||
height:3.5*mm
|
||||
font.pixelSize: 1.5*mm
|
||||
font.bold: true
|
||||
horizontalAlignment: Label.AlignRight
|
||||
text: try {(newsitemobject.newscount-1)+qsTr(" comments") }catch(e){" "}
|
||||
MouseArea{
|
||||
anchors.fill:parent
|
||||
onClicked: {
|
||||
newsStack.push("qrc:/qml/newsqml/Conversation.qml");
|
||||
showConversation(index,newsitemobject)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Column{ id: messageColumn
|
||||
//anchors.top:topFlow.bottom
|
||||
width:parent.width
|
||||
spacing:mm
|
||||
clip:true
|
||||
height: Math.min(implicitHeight,3/4*root.height)
|
||||
MouseArea{
|
||||
width: newsitem.width-8*mm-2
|
||||
height: itemMessage.height
|
||||
onPressAndHold: {
|
||||
newsStack.push("qrc:/qml/newsqml/Conversation.qml");
|
||||
showConversation(index,newsitemobject)
|
||||
}
|
||||
Text {
|
||||
color: "#404040"
|
||||
linkColor: "light green"
|
||||
id: itemMessage
|
||||
textFormat: Text.RichText
|
||||
font.family: "Noto Sans"
|
||||
text: newsitemobject.statusnet_html//newsitemobject.attachmentList.length>0?newsitemobject.text : newsitemobject.statusnet_html
|
||||
width: newsitem.width-8*mm-2
|
||||
height: implicitHeight
|
||||
wrapMode: Text.Wrap
|
||||
clip:true
|
||||
//MouseArea{anchors.fill:parent;onClicked: print("Test")}
|
||||
onLinkActivated:{
|
||||
Qt.openUrlExternally(link)}
|
||||
Component.onCompleted:{
|
||||
if (newsitemobject.messagetype==0){
|
||||
var hashtags=[];
|
||||
hashtags=findTags(newsitemobject.text);
|
||||
var component = Qt.createComponent("qrc:/qml/newsqml/Hashtag.qml");
|
||||
for (var tags in hashtags){
|
||||
var hashtagQml = component.createObject(friendicaActivities,{"text":hashtags[tags].trim()});
|
||||
}}
|
||||
|
||||
if (newsitemobject.attachmentList.length>0){
|
||||
for(var attachments in newsitemobject.attachmentList){// (newsitemobject.attachmentList[attachments].url);
|
||||
if(newsitemobject.attachmentList[attachments].mimetype.substring(0,5)=="image"){
|
||||
var component = Qt.createComponent("qrc:/qml/newsqml/NewsImage.qml");
|
||||
var imageQml = component.createObject(messageColumn,{"source":newsitemobject.attachmentList[attachments].url,"mimetype":newsitemobject.attachmentList[attachments].mimetype});
|
||||
}
|
||||
else if(newsitemobject.attachmentList[attachments].mimetype=="text/html"){
|
||||
var component = Qt.createComponent("qrc:/qml/newsqml/NewsLink.qml");
|
||||
var linkQml = component.createObject(messageColumn,{"url":newsitemobject.attachmentList[attachments].url});
|
||||
}
|
||||
else {//print(newsitemobject.attachmentList[attachments].url+" Type: "+newsitemobject.attachmentList[attachments].mimetype)
|
||||
var component = Qt.createComponent("qrc:/qml/newsqml/NewsVideo.qml");
|
||||
var videoQml = component.createObject(messageColumn,{"source":newsitemobject.attachmentList[attachments].url,"mimetype":newsitemobject.attachmentList[attachments].mimetype});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}}
|
||||
}
|
||||
BlueButton{
|
||||
width: newsitem.width-8*mm-2
|
||||
height:5*mm
|
||||
//anchors.bottom: messageColumn.bottom//itemMessage.bottom
|
||||
visible: messageColumn.implicitHeight>3/4*root.height//itemMessage.implicitHeight>3/4*root.height
|
||||
text:"\uf078"
|
||||
fontColor:"grey"
|
||||
border.color: "transparent"
|
||||
color:"white"
|
||||
// gradient: Gradient {
|
||||
// GradientStop { position: 0.0; color: "transparent" }
|
||||
// GradientStop { position: 0.5; color: "white" }
|
||||
// }
|
||||
radius:0
|
||||
onClicked: {
|
||||
if (text=="\uf078"){
|
||||
messageColumn.height=messageColumn.implicitHeight+10*mm;text="\uf077"
|
||||
} else {
|
||||
messageColumn.height=Math.min(messageColumn.implicitHeight,3/4*root.height);
|
||||
text="\uf078";
|
||||
newsView.positionViewAtIndex(index,ListView.Beginning);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Flow{
|
||||
id:friendicaActivities
|
||||
anchors.top:toprow.bottom
|
||||
width:parent.width
|
||||
spacing:mm
|
||||
|
||||
Label{color: "grey"
|
||||
height:3.5*mm
|
||||
font.pixelSize: 1.5*mm
|
||||
text: friendica_activities.likeText
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
onClicked: { showActivityContacts(newsitemobject.friendica_activities.like)}
|
||||
}
|
||||
}
|
||||
Label{color: "grey"
|
||||
height:3.5*mm
|
||||
font.pixelSize: 1.5*mm
|
||||
text: friendica_activities.dislikeText
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
onClicked: { showActivityContacts(newsitemobject.friendica_activities.dislike)}
|
||||
}
|
||||
}
|
||||
Label{color: "grey"
|
||||
height:3.5*mm
|
||||
font.pixelSize: 1.5*mm
|
||||
text: friendica_activities.attendyesText
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
onClicked: { showActivityContacts(newsitemobject.friendica_activities.attendyes)}
|
||||
}}
|
||||
Label{color: "grey"
|
||||
height:3.5*mm
|
||||
font.pixelSize: 1.5*mm
|
||||
text: friendica_activities.attendnoText
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
onClicked: { showActivityContacts(newsitemobject.friendica_activities.attendno)}
|
||||
}
|
||||
}
|
||||
Label{color: "grey"
|
||||
height:3.5*mm
|
||||
font.pixelSize: 1.5*mm
|
||||
text: friendica_activities.attendmaybeText
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
onClicked: { showActivityContacts(newsitemobject.friendica_activities.attendmaybe)}
|
||||
}
|
||||
}
|
||||
Label{
|
||||
id:attendLabel
|
||||
color: "grey"
|
||||
height:3.5*mm
|
||||
font.pixelSize: 1.5*mm
|
||||
horizontalAlignment: Label.AlignRight
|
||||
text: (friendica_activities.self.attending)?(qsTr("Attending: ")+ qsTr(friendica_activities.self.attending)):""
|
||||
}
|
||||
}
|
||||
Row{id:controlrow
|
||||
anchors.top:friendicaActivities.bottom
|
||||
|
||||
CheckBox{
|
||||
id:likeCheckbox
|
||||
width:10*mm
|
||||
visible: ((newsitemobject.messagetype==0)||(newsitemobject.messagetype==3))? true:false
|
||||
checked:(friendica_activities.self.liked==1)?true:false
|
||||
//style: CheckBoxStyle {
|
||||
indicator: Rectangle{
|
||||
implicitWidth: 10*mm
|
||||
implicitHeight:3*mm
|
||||
Text{
|
||||
anchors.centerIn: parent
|
||||
font.pixelSize: 2.5*mm
|
||||
font.family:fontAwesome.name
|
||||
color:likeCheckbox.checked?"black": "grey"
|
||||
text:likeCheckbox.checked?"\uf118"+"!":"\uf118"
|
||||
}
|
||||
}
|
||||
//}
|
||||
onClicked: {
|
||||
if(likeCheckbox.checked==true){Newsjs.like(root.login,root.db,1,"like",newsitemobject.id,root);dislikeCheckbox.checked=false; model.friendica_activities.self.liked=0 }
|
||||
else{Newsjs.like(root.login,root.db,0,"like",newsitemobject.id,root); model.friendica_activities.self.liked=1}}
|
||||
}
|
||||
CheckBox{
|
||||
id: dislikeCheckbox
|
||||
width:10*mm
|
||||
visible: ((newsitemobject.messagetype==0)||(newsitemobject.messagetype==3))? true:false
|
||||
checked: (friendica_activities.self.disliked==1)?true:false
|
||||
//style: CheckBoxStyle {
|
||||
indicator: Rectangle{
|
||||
implicitWidth: 10*mm
|
||||
implicitHeight:3*mm
|
||||
Text{
|
||||
anchors.centerIn: parent
|
||||
font.pixelSize: 2.5*mm
|
||||
font.family:fontAwesome.name
|
||||
color:dislikeCheckbox.checked?"black": "grey"
|
||||
text: dislikeCheckbox.checked?"\uf119"+"!":"\uf119"
|
||||
}
|
||||
}
|
||||
//}
|
||||
onClicked: {
|
||||
if (dislikeCheckbox.checked==true){Newsjs.like(root.login,root.db,1,"dislike",newsitemobject.id,root);likeCheckbox.checked=false; model.friendica_activities.self.disliked=0}
|
||||
else {Newsjs.like(root.login,root.db,0,"dislike",newsitemobject.id,root); model.friendica_activities.self.disliked=1}}
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
id:favoritedCheckbox
|
||||
visible:((newsitemobject.messagetype==0)||(newsitemobject.messagetype==3))
|
||||
width: 10*mm
|
||||
//style: CheckBoxStyle {
|
||||
indicator:Rectangle{
|
||||
x:4*mm
|
||||
width: 3*mm
|
||||
implicitHeight:4*mm
|
||||
Text{
|
||||
color: favoritedCheckbox.checked?"black":"grey"
|
||||
font.pixelSize: 2.5*mm
|
||||
text:"\uf005"
|
||||
}
|
||||
}
|
||||
//}
|
||||
checked:(newsitemobject.favorited>0)
|
||||
onClicked:{
|
||||
if(favoritedCheckbox.checkedState==Qt.Checked){
|
||||
Newsjs.favorite(login,true,newsitemobject.id,root); model.newsitemobject.favorited=1}
|
||||
else if(favoritedCheckbox.checkedState==Qt.Unchecked){
|
||||
Newsjs.favorite(login,false,newsitemobject.id,root);model.newsitemobject.favorited=0}
|
||||
}
|
||||
}
|
||||
Rectangle{
|
||||
width: 10*mm
|
||||
height: 4*mm
|
||||
visible:(newsitemobject.messagetype!==2)
|
||||
color:"transparent"
|
||||
Text{
|
||||
id:newsmenusymbol
|
||||
color: "grey"
|
||||
anchors.centerIn: parent
|
||||
font.pixelSize: 2.5*mm
|
||||
font.family:fontAwesome.name
|
||||
text: "\uf142"
|
||||
}
|
||||
MouseArea{
|
||||
anchors.fill:parent
|
||||
onClicked: {newsmenu.popup()}}
|
||||
}
|
||||
Rectangle{
|
||||
width: 10*mm
|
||||
height: 4*mm
|
||||
visible:(newsitemobject.messagetype!==2)&&(newstab.newstabstatus!="Conversation")
|
||||
color:"transparent"
|
||||
Text{
|
||||
id:conversationsymbol
|
||||
color: "grey"
|
||||
anchors.centerIn: parent
|
||||
font.pixelSize: 2.5*mm
|
||||
font.family: fontAwesome.name
|
||||
text: "\uf086"
|
||||
}
|
||||
MouseArea{
|
||||
anchors.fill:parent
|
||||
onClicked:{
|
||||
//conversationsymbol.color="black";
|
||||
// var component = Qt.createComponent("qrc:/qml/newsqml/Conversation.qml");
|
||||
// var conversationItem = component.createObject(friendicaActivities);
|
||||
newsStack.push("qrc:/qml/newsqml/Conversation.qml")
|
||||
showConversation(index,newsitemobject)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Menu {
|
||||
id:newsmenu
|
||||
width: 30*mm
|
||||
delegate: MenuItem{
|
||||
contentItem: Text{
|
||||
font.pixelSize: 3*mm
|
||||
text: parent.text
|
||||
}
|
||||
}
|
||||
Action{
|
||||
text: qsTr("Reply")
|
||||
onTriggered: {
|
||||
var directmessage=0;
|
||||
if (newsitemobject.messagetype==1){ directmessage=1}
|
||||
replySignal(newsitemobject)
|
||||
//newsStack.push("qrc:/qml/newsqml/MessageSend.qml",{"reply_to_user": newsitemobject.user.screen_name,"parentId":newsitemobject.id,"login":root.login,"directmessage":directmessage});
|
||||
}
|
||||
}
|
||||
Action {
|
||||
text: qsTr("DM")
|
||||
onTriggered: {
|
||||
root.directmessageSignal(newsitemobject.user.screen_name);
|
||||
}
|
||||
}
|
||||
Action {
|
||||
text: qsTr("Repost")
|
||||
onTriggered: {
|
||||
Newsjs.retweetNews(root.login,db,newsitemobject.id,root,function(reply){
|
||||
Helperjs.showMessage("Repost",qsTr("Success!"),root)
|
||||
})
|
||||
}
|
||||
}
|
||||
Action {
|
||||
text: qsTr("Conversation")
|
||||
onTriggered: {
|
||||
conversationsymbol.color="black";
|
||||
var component = Qt.createComponent("qrc:/qml/newsqml/Conversation.qml");
|
||||
var conversationItem = component.createObject(friendicaActivities,{"news":newsitemobject.chatArray});
|
||||
showConversation(index,newsitemobject)
|
||||
}
|
||||
}
|
||||
|
||||
Menu{
|
||||
title: qsTr("Attending")
|
||||
width: 20*mm
|
||||
delegate: MenuItem{
|
||||
contentItem: Text{
|
||||
font.pixelSize: 3*mm
|
||||
text: parent.text
|
||||
}
|
||||
}
|
||||
Action{
|
||||
text:qsTr("yes")
|
||||
onTriggered: {Newsjs.attend(root.login,db,"yes",newsitemobject.id,root,function(){
|
||||
model.friendica_activities.self.attending="yes";attending="yes"})
|
||||
}
|
||||
}
|
||||
Action{text:qsTr("maybe")
|
||||
onTriggered: {Newsjs.attend(root.login,db,"maybe",newsitemobject.id,root,function(){
|
||||
model.friendica_activities.self.attending="maybe";attending="maybe"})
|
||||
}
|
||||
}
|
||||
Action{text:qsTr("no")
|
||||
onTriggered: {Newsjs.attend(root.login,db,"no",newsitemobject.id,root,function(){
|
||||
model.friendica_activities.self.attending="no";attending="no"})}
|
||||
}
|
||||
}
|
||||
|
||||
Action {
|
||||
text: qsTr("Delete")
|
||||
onTriggered: {
|
||||
Newsjs.deleteNews(root.login,root.db,newsitemobject.id,newsitemobject.messagetype,root,function(reply){
|
||||
var msg = {'deleteId': index, 'model': newsModel};
|
||||
newsWorker.sendMessage(msg);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
//MenuItem{
|
||||
// text:qsTr("Show on website")
|
||||
// onTriggered:Qt.openUrlExternally(login.server+"/display/"+newsitemobject
|
||||
//}
|
||||
}
|
||||
}}
|
||||
|
|
@ -1,229 +0,0 @@
|
|||
// 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.0
|
||||
import QtQuick.Controls 2.3
|
||||
import "qrc:/js/service.js" as Service
|
||||
import "qrc:/js/helper.js" as Helperjs
|
||||
import "qrc:/qml/genericqml"
|
||||
|
||||
Rectangle{
|
||||
id:permissionDialog
|
||||
x: mm
|
||||
width: messageColumn.width-3*mm
|
||||
height:root.height/3
|
||||
function updatePerms(){
|
||||
for (var i=0;i<groupModel.count;i++)
|
||||
{if (groupModel.get(i).groupstatus=="positive"){
|
||||
group_allow.push(groupModel.get(i).group.gid)
|
||||
}
|
||||
if (groupModel.get(i).groupstatus=="negative"){
|
||||
group_deny.push(groupModel.get(i).group.gid)
|
||||
}
|
||||
}
|
||||
for (var j=0;j<contactModel.count;j++){
|
||||
if (contactModel.get(j).contactstatus=="positive"){
|
||||
contact_allow.push(contactModel.get(j).contact.cid)
|
||||
}
|
||||
if (contactModel.get(j).contactstatus=="negative"){
|
||||
contact_deny.push(contactModel.get(j).contact.cid)
|
||||
}
|
||||
if ((contact_allow.length==0)&&(contact_deny.length==0)&&(group_allow.length==0)&&(group_deny.length==0))
|
||||
{permButton.text="\uf09c"}
|
||||
else{permButton.text="\uf023"}
|
||||
}}
|
||||
|
||||
Text{
|
||||
x:0.5*mm
|
||||
y:0.5*mm
|
||||
text: qsTr("Friends")
|
||||
font.pixelSize: 2*mm
|
||||
}
|
||||
ListView {
|
||||
id: contactView
|
||||
x:0.5*mm
|
||||
y:5.5*mm
|
||||
width: permissionDialog.width/2-2*mm
|
||||
height: permissionDialog.height-14*mm
|
||||
clip: true
|
||||
spacing: 1
|
||||
model: contactModel
|
||||
delegate: contactItem
|
||||
}
|
||||
|
||||
ListModel{id: contactModel}
|
||||
Component{
|
||||
id:contactItem
|
||||
Rectangle{
|
||||
id:contactitemRect
|
||||
width:contactView.width
|
||||
height: 5*mm
|
||||
radius: 0.5*mm
|
||||
property string contactstatus
|
||||
onContactstatusChanged:{
|
||||
if(contactstatus=="positive"){contactitemRect.color="light green"}
|
||||
else if (contactstatus=="negative"){contactitemRect.color= "ffe6e6"}
|
||||
else{contactitemRect.color= "white"}}
|
||||
color: "white"
|
||||
border.color:"grey"
|
||||
Text{
|
||||
color:"grey"
|
||||
text:contact.screen_name
|
||||
font.pixelSize: 2*mm
|
||||
}
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
onClicked:{
|
||||
if(contactModel.get(index).contactstatus=="neutral"){
|
||||
contactModel.set(index,{"contactstatus":"positive"});
|
||||
contactstatus="positive"
|
||||
}
|
||||
else if (contactModel.get(index).contactstatus=="positive"){
|
||||
contactModel.set(index,{"contactstatus":"negative"})
|
||||
contactstatus="negative"
|
||||
}
|
||||
else{contactModel.set(index,{"contactstatus":"neutral"});
|
||||
contactstatus="neutral";
|
||||
}
|
||||
}}
|
||||
Component.onCompleted:{
|
||||
if (contactModel.get(index).contactstatus=="positive"){
|
||||
contactstatus="positive"
|
||||
}
|
||||
else if (contactModel.get(index).contactstatus=="negative"){
|
||||
contactstatus="negative"
|
||||
}
|
||||
else {contactstatus="neutral"} }
|
||||
}
|
||||
}
|
||||
Text{
|
||||
x:contactView.width+2*mm
|
||||
y:0.5*mm
|
||||
text: qsTr("Groups")
|
||||
font.pixelSize: 2*mm
|
||||
}
|
||||
ListView {
|
||||
id: groupView
|
||||
x:contactView.width+2*mm
|
||||
y:5.5*mm
|
||||
width: permissionDialog.width/2-2*mm
|
||||
height: permissionDialog.height-14*mm
|
||||
clip: true
|
||||
spacing: 1
|
||||
model: groupModel
|
||||
delegate: groupItem
|
||||
}
|
||||
|
||||
ListModel{id: groupModel}
|
||||
Component{
|
||||
id:groupItem
|
||||
Rectangle{
|
||||
id:groupitemRect
|
||||
width:groupView.width
|
||||
radius: 0.5*mm
|
||||
height: 5*mm
|
||||
property string groupstatus:"neutral"
|
||||
onGroupstatusChanged:
|
||||
{if(groupstatus=="positive"){groupitemRect.color="light green"}
|
||||
else if (groupstatus=="negative"){groupitemRect.color= "#ffe6e6"}
|
||||
else{groupitemRect.color= "white"}}
|
||||
color: "white"
|
||||
border.color:"grey"
|
||||
Text{
|
||||
color:"grey"
|
||||
text:group.groupname
|
||||
font.pixelSize: 2*mm
|
||||
}
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
onClicked:{
|
||||
if(groupModel.get(index).groupstatus=="neutral"){
|
||||
groupModel.set(index,{"groupstatus":"positive"});
|
||||
groupstatus="positive"}
|
||||
else if (groupModel.get(index).groupstatus=="positive"){
|
||||
groupModel.set(index,{"groupstatus":"negative"});
|
||||
groupstatus="negative"}
|
||||
else{groupModel.set(index,{"groupstatus":"neutral"})
|
||||
groupstatus="neutral"}
|
||||
}}
|
||||
Component.onCompleted:{ if (groupModel.get(index).groupstatus=="positive"){
|
||||
groupstatus="positive"
|
||||
}
|
||||
else if (groupModel.get(index).groupstatus=="negative"){
|
||||
groupstatus="negative"
|
||||
}
|
||||
else {groupstatus="neutral"} }
|
||||
}
|
||||
}
|
||||
MButton{
|
||||
x:0.5*mm
|
||||
height: 6*mm
|
||||
width: 8*mm
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin:1
|
||||
text:"\uf0c7"
|
||||
onClicked:{
|
||||
updatePerms();
|
||||
var perms=[];
|
||||
perms.push(contact_allow,contact_deny,group_allow,group_deny);
|
||||
Service.savePermissions(db,perms)
|
||||
}
|
||||
}
|
||||
MButton{
|
||||
x:contactView.width+2*mm
|
||||
height: 6*mm
|
||||
width: 8*mm
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin:1
|
||||
text:"\u2713"
|
||||
onClicked:{updatePerms();
|
||||
permissionDialog.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted:{
|
||||
Helperjs.readData(db,"contacts",login.username,function(contacts){
|
||||
for (var name in contacts){
|
||||
var contactstatus="neutral";
|
||||
if (contact_allow.indexOf(contacts[name].cid)>-1){contactstatus="positive"}
|
||||
else if (contact_deny.indexOf(contacts[name].cid)>-1){contactstatus="negative"}
|
||||
contactModel.append({"contact":contacts[name],"contactstatus":contactstatus})
|
||||
}},"isFriend",1);
|
||||
|
||||
Helperjs.readData(db,"groups",login.username,function(owngroups){
|
||||
for (var number in owngroups){
|
||||
var groupstatus= "neutral";
|
||||
if (group_allow.indexOf(owngroups[number].gid)>-1){groupstatus="positive"}
|
||||
else if (group_deny.indexOf(owngroups[number].gid)>-1){groupstatus="negative"}
|
||||
groupModel.append({"group":owngroups[number],"groupstatus":groupstatus})
|
||||
}});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,242 +0,0 @@
|
|||
// 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 QtQuick.Layouts 1.11
|
||||
//import QtQuick.Controls.Styles 1.4
|
||||
import "qrc:/js/smiley.js" as Smileyjs
|
||||
import "qrc:/js/helper.js" as Helperjs
|
||||
import "qrc:/qml/genericqml"
|
||||
|
||||
Rectangle{
|
||||
id:smileyDialog
|
||||
x: mm
|
||||
width: messageColumn.width-5*mm
|
||||
height:root.height/2
|
||||
|
||||
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"
|
||||
onClicked:{smileyDialog.visible=false}
|
||||
}
|
||||
|
||||
|
||||
TabBar {
|
||||
id: smileybar
|
||||
width: parent.width
|
||||
height: 9*mm
|
||||
position:TabBar.Header
|
||||
TabButton {
|
||||
text:qsTr("Unicode")
|
||||
font.pixelSize: 2*mm
|
||||
}
|
||||
TabButton {
|
||||
text: qsTr("Standard")
|
||||
font.pixelSize: 2*mm
|
||||
}
|
||||
TabButton {
|
||||
text: qsTr("Addon")
|
||||
font.pixelSize: 2*mm
|
||||
}
|
||||
|
||||
TabButton {
|
||||
text: qsTr("Adult")
|
||||
font.pixelSize: 2*mm
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
StackLayout{
|
||||
id:smileyTabView
|
||||
currentIndex: smileybar.currentIndex
|
||||
anchors.top: closeButton.bottom
|
||||
anchors.topMargin: 1*mm
|
||||
width: smileyDialog.width-2*mm
|
||||
height: smileyDialog.height-7*mm
|
||||
// style: TabViewStyle {
|
||||
// frameOverlap: 1
|
||||
// tab: Rectangle {
|
||||
// color: "white"
|
||||
// implicitWidth: smileyTabView.width/4-2*mm
|
||||
// implicitHeight: 4*mm
|
||||
// Text { id: text
|
||||
// anchors.centerIn: parent
|
||||
// text: styleData.title
|
||||
// color: "dark grey"
|
||||
// font.pixelSize:2.5*mm
|
||||
// font.bold: styleData.selected
|
||||
// }
|
||||
// }
|
||||
// frame: Rectangle { color: "light grey" }
|
||||
// tabsAlignment:Qt.AlignHCenter
|
||||
// }
|
||||
|
||||
Rectangle{
|
||||
id: htmlGridTab
|
||||
GridView {
|
||||
id:htmlView
|
||||
anchors.fill: parent
|
||||
cellWidth: 5*mm
|
||||
cellHeight: 5*mm
|
||||
clip: true
|
||||
model: htmlModel
|
||||
delegate: htmlItem
|
||||
}
|
||||
|
||||
ListModel{
|
||||
id:htmlModel
|
||||
}
|
||||
Component.onCompleted:{
|
||||
for (var icon in Smileyjs.html){
|
||||
htmlModel.append({"emoji":Smileyjs.html[icon]})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle{
|
||||
id: coreGridTab
|
||||
GridView {
|
||||
id: coreSmileyView
|
||||
anchors.fill: parent
|
||||
cellWidth: 5*mm
|
||||
cellHeight: 5*mm
|
||||
clip: true
|
||||
model: coreSmileyModel
|
||||
delegate: smileyItem
|
||||
}
|
||||
|
||||
ListModel{
|
||||
id: coreSmileyModel
|
||||
}
|
||||
|
||||
Component.onCompleted:{
|
||||
var smileyarray=Smileyjs.core
|
||||
for (var icon in smileyarray){
|
||||
coreSmileyModel.append({"emoji":smileyarray[icon]})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle{
|
||||
id: addonGridTab
|
||||
GridView {
|
||||
id: addonView
|
||||
anchors.fill: parent
|
||||
cellWidth: 5*mm
|
||||
cellHeight: 5*mm
|
||||
clip: true
|
||||
model: addonModel
|
||||
delegate: smileyItem
|
||||
}
|
||||
|
||||
ListModel{
|
||||
id: addonModel
|
||||
}
|
||||
Component.onCompleted:{
|
||||
for (var icon in Smileyjs.addon){
|
||||
addonModel.append({"emoji":Smileyjs.addon[icon]})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Rectangle{
|
||||
id: adultGridTab
|
||||
GridView {
|
||||
id: adultView
|
||||
anchors.fill: parent
|
||||
cellWidth: 5*mm
|
||||
cellHeight: 5*mm
|
||||
clip: true
|
||||
model: adultModel
|
||||
delegate: smileyItem
|
||||
}
|
||||
|
||||
ListModel{
|
||||
id: adultModel
|
||||
}
|
||||
Component.onCompleted:{
|
||||
for (var icon in Smileyjs.adult){
|
||||
adultModel.append({"emoji":Smileyjs.adult[icon]})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Component{
|
||||
id:smileyItem
|
||||
AnimatedImage{id:smileyImage
|
||||
width:4.5*mm
|
||||
height: 4.5*mm
|
||||
fillMode:Image.PreserveAspectFit
|
||||
source:emoji.url
|
||||
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
onClicked:{
|
||||
//bodyField.append(emoji.name+" ")
|
||||
bodyField.insert(bodyField.cursorPosition,emoji.name+" ");
|
||||
smileyDialog.visible=false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component{
|
||||
id:htmlItem
|
||||
Text{id:smileText
|
||||
width:4.5*mm
|
||||
height: 4.5*mm
|
||||
textFormat:Text.RichText
|
||||
font.pixelSize: 4*mm
|
||||
text: emoji
|
||||
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
onClicked:{
|
||||
//bodyField.append(emoji.name+" ")
|
||||
bodyField.insert(bodyField.cursorPosition,emoji+" ");
|
||||
smileyDialog.visible=false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
1
source-android/qml/photoqml
Symbolic link
1
source-android/qml/photoqml
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
./../../source-linux/qml/photoqml/
|
||||
|
|
@ -1,306 +0,0 @@
|
|||
// 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.5
|
||||
import QtQuick.Controls 2.4
|
||||
import "qrc:/js/helper.js" as Helperjs
|
||||
import "qrc:/js/image.js" as Imagejs
|
||||
import "qrc:/qml/genericqml"
|
||||
|
||||
Rectangle{
|
||||
id:imageDialog
|
||||
property var attachImageURLs: []
|
||||
property string imageId: ""
|
||||
property string currentAlbum:""
|
||||
property var contacts: []
|
||||
property var groups: []
|
||||
property var contact_allow:login.permissions[0]
|
||||
property var contact_deny:login.permissions[1]
|
||||
property var group_allow:login.permissions[2]
|
||||
property var group_deny:login.permissions[3]
|
||||
property int imageNo: 0
|
||||
|
||||
function uploadSelectedImage(inumber){
|
||||
xhr.url= login.server + "/api/friendica/photo/create.json";
|
||||
xhr.setLogin(login.username+":"+Qt.atob(login.password));
|
||||
xhr.clearParams();
|
||||
xhr.setParam("desc",imageUploadModel.get(inumber).description);
|
||||
xhr.setParam("album", album.currentText);
|
||||
//if (group_allow.length>0) {xhr.setParam("group_allow", Helperjs.cleanArray(group_allow))};
|
||||
//if (group_deny.length>0) {xhr.setParam("group_deny", Helperjs.cleanArray(group_deny))};
|
||||
//if (contact_allow.length>0) {xhr.setParam("contact_allow", Helperjs.cleanArray(contact_allow))};
|
||||
//if (contact_deny.length>0) {xhr.setParam("contact_deny", Helperjs.cleanArray(contact_deny))};
|
||||
xhr.setImageFileParam("media", imageUploadModel.get(inumber).imageUrl );
|
||||
xhr.post();
|
||||
}
|
||||
|
||||
|
||||
function updateImage(){
|
||||
xhr.url= login.server + "/api/friendica/photo/update.json";
|
||||
xhr.setLogin(login.username+":"+Qt.atob(login.password));
|
||||
xhr.clearParams();
|
||||
xhr.setParam("desc",imageUploadModel.get(0).description);
|
||||
xhr.setParam("album", currentAlbum);
|
||||
xhr.setParam("album_new", album.currentText);
|
||||
xhr.setParam("photo_id", imageId);
|
||||
xhr.post();
|
||||
}
|
||||
|
||||
|
||||
function attachImage(url){
|
||||
imageUploadModel.append({"imageUrl":url,"description":""})
|
||||
}
|
||||
|
||||
//border.color: "grey"
|
||||
y:1
|
||||
width:root.width-mm
|
||||
height:root.height-5*mm
|
||||
property string directory: ""
|
||||
|
||||
Connections{
|
||||
target:xhr
|
||||
onError:{print(data)}//if (data=="image"){Helperjs.showMessage()}}
|
||||
onSuccess:{
|
||||
if (imageId==""){
|
||||
imageNo=imageNo+1;
|
||||
if(imageNo<imageUploadModel.count){
|
||||
uploadSelectedImage(imageNo);
|
||||
}else{
|
||||
Imagejs.requestList(login,db, true,root,function(obj){
|
||||
fotorectangle.newimages=obj;
|
||||
imageDialog.destroy()
|
||||
})
|
||||
|
||||
}} else{
|
||||
Imagejs.updateImage(db,login,"image",filesystem,imageId,root,function(){
|
||||
Imagejs.requestList(login,db, true,root,function(obj){
|
||||
fotorectangle.newimages=obj;
|
||||
fotoSignal(login,"backButton");
|
||||
//photoStack.pop()
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Row{
|
||||
id:buttonRow
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 1*mm
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 1*mm
|
||||
spacing:5*mm
|
||||
Text{
|
||||
font.pixelSize: 3.5*mm
|
||||
font.bold: true
|
||||
text:qsTr("Upload to album")
|
||||
}
|
||||
// BlueButton{
|
||||
// id:permButton
|
||||
// text: ((contact_allow.length==0)&&(contact_deny.length==0)&&(group_allow.length==0)&&(group_deny.length==0))?"\uf09c":"\uf023"
|
||||
// onClicked: {
|
||||
// var component = Qt.createComponent("qrc:/qml/genericqml/PermissionDialog.qml");
|
||||
// var permissions = component.createObject(imageDialog,{"x":mm,"y":40*mm});
|
||||
// }
|
||||
// }
|
||||
|
||||
Button{
|
||||
id:closeButton
|
||||
height: 8*mm
|
||||
text: "\uf057"
|
||||
font.pixelSize: 3*mm
|
||||
onClicked:{photoStack.pop();
|
||||
//imageDialog.destroy()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Text {
|
||||
// text: qsTr("Album")
|
||||
// x: 4*mm; y: 10*mm
|
||||
// }
|
||||
|
||||
// Text {
|
||||
// text: qsTr("Image")
|
||||
// x: 4*mm; y: 17*mm
|
||||
// }
|
||||
|
||||
// Text {
|
||||
// text: qsTr("Description")
|
||||
// x: 4*mm; y: 33*mm
|
||||
// }
|
||||
|
||||
ListView{
|
||||
id: imageUploadView
|
||||
x:3*mm //23*mm
|
||||
y:17*mm
|
||||
width: imageDialog.width-5*mm //25*mm
|
||||
height: root.width/2 //25*mm
|
||||
model: imageUploadModel
|
||||
delegate: imageDelegate
|
||||
footer: imageId==""?imageFooter:null
|
||||
clip:true
|
||||
orientation: ListView.Horizontal
|
||||
spacing: mm
|
||||
}
|
||||
BusyIndicator{
|
||||
id: uploadBusy
|
||||
running: false
|
||||
anchors.horizontalCenter: imageUploadView.horizontalCenter
|
||||
anchors.top:imageUploadView.top
|
||||
anchors.topMargin: 2*mm
|
||||
width:10*mm
|
||||
height: 10*mm
|
||||
}
|
||||
ListModel{
|
||||
id: imageUploadModel
|
||||
}
|
||||
|
||||
Component{
|
||||
id: imageDelegate
|
||||
Rectangle{
|
||||
width:root.width/2 //Math.max(20*mm,descriptionInput.contentWidth)
|
||||
height:imageUploadView.height-5*mm // 20*mm
|
||||
Image{
|
||||
id: uploadImage
|
||||
width: root.width/2-mm //20*mm
|
||||
height: imageUploadView.height-6*mm//height: 14*mm
|
||||
fillMode: Image.PreserveAspectFit
|
||||
source:imageUrl
|
||||
onVisibleChanged: descriptionInput.focus=true;
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
onClicked:{
|
||||
imageUploadModel.remove(index)
|
||||
// attachImageURLs.splice(attachImageURLs.indexOf(imageUrl,1))
|
||||
// attachImage(imageUrl)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle{
|
||||
color: "light grey"
|
||||
border.color: "grey"
|
||||
anchors.top: uploadImage.bottom
|
||||
anchors.topMargin: mm
|
||||
//x: mm; y: 15*mm;
|
||||
width: root.width/2-mm //Math.max(root.width/2-mm, descriptionInput.contentWidth);
|
||||
height: 5*mm;
|
||||
TextField{
|
||||
//TextInput {
|
||||
id: descriptionInput
|
||||
anchors.fill: parent
|
||||
font.pixelSize: 3*mm
|
||||
selectByMouse: true
|
||||
placeholderText: qsTr("Description")
|
||||
text:description!=""?description:""
|
||||
onTextChanged: imageUploadModel.set(index,{"description":descriptionInput.text});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Component{
|
||||
id: imageFooter
|
||||
Image{
|
||||
id: footerImage
|
||||
height: root.width/4
|
||||
width: root.width/4 //15*mm
|
||||
//15*mm
|
||||
fillMode: Image.PreserveAspectFit
|
||||
source:"qrc:/images/addImage.png"
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
onClicked:{
|
||||
imagePicking=true;
|
||||
var imagePicker = Qt.createQmlObject('import QtQuick 2.0; import "qrc:/qml/genericqml";'+
|
||||
osSettings.imagePickQml+'{multiple : false;onReady: {attachImageURLs.push(imageUrl);'+
|
||||
'attachImage(imageUrl)}}',imageDialog,"imagePicker");
|
||||
imagePicker.pickImage()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ComboBox{
|
||||
id: album
|
||||
x: 3*mm
|
||||
y: 10*mm
|
||||
width: root.width/2;
|
||||
height: 5*mm;
|
||||
editable:true
|
||||
model: albumModel
|
||||
onAccepted: {
|
||||
if (find(currentText) === -1) {
|
||||
albumModel.append({text: editText})
|
||||
currentIndex = find(editText)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ListModel{id:albumModel}
|
||||
|
||||
Button{
|
||||
id:uploadButton
|
||||
height: 8*mm
|
||||
x:4*mm; y:root.width/2+18*mm //40*mm
|
||||
text: imageId==""?qsTr("Upload"):qsTr("Change")
|
||||
font.pixelSize: 3*mm
|
||||
onClicked:{
|
||||
if(album.currentText==""){Helperjs.showMessage(qsTr("Error"),qsTr(" No album name given"), imageDialog)}
|
||||
else if (imageId!=""){uploadBusy.running=true; updateImage()}
|
||||
else{newimageProgress.visible=true;
|
||||
if (imageUploadModel.count>0){
|
||||
uploadSelectedImage(0)
|
||||
}}
|
||||
}
|
||||
}
|
||||
ProgressBar{
|
||||
id: newimageProgress
|
||||
width: 15*mm
|
||||
height: buttonRow.height
|
||||
anchors.top: parent.top
|
||||
anchors.right:buttonRow.left
|
||||
anchors.rightMargin:mm
|
||||
visible: false
|
||||
value: imageNo/imageUploadModel.count
|
||||
}
|
||||
|
||||
Component.onCompleted:{
|
||||
albumModel.append({"text":""});
|
||||
try{Helperjs.readField("album",db,"imageData",login.username,function(storedAlbums){
|
||||
for (var n in storedAlbums){
|
||||
albumModel.append({"text":storedAlbums[n]})}
|
||||
})}
|
||||
catch (e){print(e)}
|
||||
if(attachImageURLs.length>0){
|
||||
for (var n in attachImageURLs){attachImage(attachImageURLs[n])}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,148 +0,0 @@
|
|||
// 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.5
|
||||
import QtQuick.Controls 1.2
|
||||
import "qrc:/qml/photoqml"
|
||||
|
||||
Package {
|
||||
Item { id: stackItem; Package.name: 'stack'; z: stackItem.PathView.z;width:16.5*mm;height:16.5*mm}
|
||||
Item { id: listItem; Package.name: 'list'; width: root.width-1*mm; height: root.height-8*mm; }
|
||||
Item { id: gridItem; Package.name: 'grid';}
|
||||
|
||||
Item {
|
||||
id: photoWrapper
|
||||
width: 16.5*mm; height: 16.5*mm
|
||||
z: stackItem.PathView.z
|
||||
property string hqphotolink: photoLink
|
||||
property string imageId:""
|
||||
|
||||
Rectangle {
|
||||
id: placeHolder
|
||||
color: 'lightblue'; antialiasing: true
|
||||
anchors.fill:parent
|
||||
}
|
||||
BusyIndicator { anchors.centerIn: parent; running: realImage.status != Image.Ready }
|
||||
Image {
|
||||
id: realImage;
|
||||
visible: (albumWrapper.state != '')||(index==0)
|
||||
width: photoWrapper.width; height: photoWrapper.height
|
||||
antialiasing: true;
|
||||
asynchronous: true
|
||||
autoTransform:true
|
||||
cache: false
|
||||
fillMode: Image.PreserveAspectFit;
|
||||
source: (albumWrapper.state == '')&&(index>0)?"":imageLocation
|
||||
}
|
||||
Rectangle{
|
||||
id:phototextRectangle
|
||||
color:"black"
|
||||
z:3
|
||||
opacity: 0.5
|
||||
width:phototext.contentWidth
|
||||
height: phototext.contentHeight
|
||||
anchors.bottom: photoWrapper.bottom
|
||||
}
|
||||
Text {
|
||||
id:phototext
|
||||
z:4
|
||||
text: photoDescription.trim()
|
||||
width:15*mm
|
||||
anchors.bottom: photoWrapper.bottom
|
||||
color: "white"
|
||||
font.pixelSize: 2*mm
|
||||
wrapMode:Text.Wrap
|
||||
}
|
||||
MouseArea {
|
||||
width: realImage.paintedWidth; height: realImage.paintedHeight; anchors.centerIn: realImage
|
||||
onPressAndHold:{
|
||||
var menuString="import QtQuick 2.5;import QtQuick.Controls 1.4; "+
|
||||
"Menu {MenuItem {text:qsTr('Delete on client and server'); onTriggered: {"+
|
||||
"changeimage('delete','image','"+imageLocation+"');photoModel.remove(index)}}"+
|
||||
"MenuItem {text:qsTr('Move to album'); onTriggered: {"+
|
||||
"changeimage('update','image','"+imageId+"');}}"+
|
||||
"}";
|
||||
var imagemenuObject=Qt.createQmlObject(menuString,photoWrapper,"imagemenuOutput")
|
||||
imagemenuObject.popup()
|
||||
}
|
||||
onClicked: {
|
||||
if (albumWrapper.state == 'inGrid') {
|
||||
gridItem.GridView.view.currentIndex = index;
|
||||
albumWrapper.state = 'fullscreen';
|
||||
listItem.ListView.view.currentIndex=index
|
||||
} else {
|
||||
gridItem.GridView.view.currentIndex = index;
|
||||
albumWrapper.state = 'inGrid'
|
||||
}
|
||||
}
|
||||
}
|
||||
PinchArea {
|
||||
id:imagePinch
|
||||
pinch.target: realImage
|
||||
anchors.fill: realImage
|
||||
pinch.minimumScale: 0.1
|
||||
pinch.maximumScale: 10
|
||||
enabled: false
|
||||
}
|
||||
|
||||
// onStateChanged: print("State"+photoWrapper.state+index)
|
||||
states: [
|
||||
State {
|
||||
name: 'stacked'; when: albumWrapper.state == ''
|
||||
ParentChange { target: photoWrapper; parent: stackItem; }//x: 1*mm; y: 1*mm }
|
||||
PropertyChanges { target: photoWrapper; opacity: stackItem.PathView.onPath ? 1.0 : 0.0 }
|
||||
PropertyChanges { target: phototext; opacity: 0.0 }
|
||||
PropertyChanges { target: phototextRectangle; opacity: 0.0 }
|
||||
},
|
||||
State {
|
||||
name: 'inGrid'; when: albumWrapper.state == 'inGrid'
|
||||
ParentChange { target: photoWrapper; parent: gridItem; x: 1*mm; y: 1*mm;}
|
||||
PropertyChanges { target: phototext; opacity: 1.0 }
|
||||
PropertyChanges { target: phototextRectangle; opacity: 0.5 }
|
||||
PropertyChanges { target: placeHolder; opacity: 1.0 }
|
||||
},
|
||||
State {
|
||||
name: 'fullscreen'; when: albumWrapper.state == 'fullscreen'
|
||||
ParentChange {
|
||||
target: photoWrapper; parent: listItem; x: 1; y: 1;
|
||||
width: root.width-mm; height: root.height-8*mm
|
||||
}
|
||||
PropertyChanges { target: placeHolder; opacity: 0.0 }
|
||||
PropertyChanges { target: realImage; source: photoWrapper.hqphotolink}
|
||||
PropertyChanges { target: phototext; anchors.bottom: realImage.bottom}
|
||||
PropertyChanges { target: phototext; width:realImage.width }
|
||||
PropertyChanges { target: phototextRectangle; anchors.bottom: realImage.bottom }
|
||||
PropertyChanges { target: imagePinch; enabled:true}
|
||||
// PropertyChanges { target: realImage; width: Math.min(listItem.width,sourceSize.width);height: Math.min(listItem.height,sourceSize.height) }
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -1,305 +0,0 @@
|
|||
// 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.5
|
||||
import QtQuick.Controls 2.4
|
||||
import QtQml.Models 2.1
|
||||
import "qrc:/js/image.js" as Imagejs
|
||||
import "qrc:/js/helper.js" as Helperjs
|
||||
import "qrc:/qml/photoqml"
|
||||
import "qrc:/qml/genericqml"
|
||||
|
||||
|
||||
StackView{
|
||||
id: photoStack
|
||||
//anchors.fill:parent
|
||||
initialItem:Rectangle {
|
||||
id:fotorectangle
|
||||
anchors.fill:parent
|
||||
// y:1
|
||||
// width:root.width-mm
|
||||
// height:root.height-5*mm
|
||||
color: '#fff'
|
||||
property var newimages:[]
|
||||
property int currentimageno: 0
|
||||
property bool remoteContact: false
|
||||
|
||||
|
||||
onNewimagesChanged:{
|
||||
if(fotorectangle.newimages.length>0){
|
||||
//print("newimages "+JSON.stringify(newimages));
|
||||
var ownimagelist=[];
|
||||
Helperjs.readField("album",root.db,"imageData",root.login.username,function(albums){
|
||||
for (var i=0;i<fotorectangle.newimages.length;i++){
|
||||
if(albums.indexOf(fotorectangle.newimages[i].album)==-1){
|
||||
filesystem.Directory=root.login.imagestore+"/albums";
|
||||
filesystem.makeDir(fotorectangle.newimages[i].album)}
|
||||
ownimagelist.push(root.login.server+"/api/friendica/photo?scale='0'&photo_id="+fotorectangle.newimages[i].id);
|
||||
}
|
||||
})
|
||||
xhr.setLogin(login.username+":"+Qt.atob(login.password));
|
||||
xhr.setImagedir(login.imagestore);
|
||||
xhr.setFilelist(ownimagelist);
|
||||
xhr.setDownloadtype("picturelist");
|
||||
xhr.getlist();
|
||||
newImagesProgress.visible=true
|
||||
}
|
||||
}
|
||||
|
||||
onCurrentimagenoChanged:{
|
||||
if(fotorectangle.currentimageno==fotorectangle.newimages.length){newImagesProgress.visible=false;showFotos(root.login,"");
|
||||
fotorectangle.newimages=[];fotorectangle.currentimageno=0}
|
||||
// download next image
|
||||
}
|
||||
|
||||
Connections{
|
||||
target:xhr
|
||||
onDownloadedjson:{
|
||||
if(type=="picturelist"){
|
||||
fotorectangle.currentimageno=fotorectangle.currentimageno+1
|
||||
Imagejs.storeImagedata(login,db,jsonObject,fotorectangle)
|
||||
}
|
||||
}
|
||||
onDownloaded:{
|
||||
if(type=="picture"){fotorectangle.currentimageno=fotorectangle.currentimageno+1}
|
||||
}
|
||||
onError:{if(data=="picturelist"){
|
||||
var requestid=url.substring(url.lastIndexOf("=")+1);
|
||||
Imagejs.dataRequest(login,requestid,db,xhr,fotorectangle)
|
||||
} else {fotorectangle.currentimageno=fotorectangle.currentimageno+1}
|
||||
}
|
||||
}
|
||||
// Connections{
|
||||
// target:filesystem
|
||||
// onError:{print("Error deleting");
|
||||
// }
|
||||
// onSuccess:print("Success deleting");
|
||||
// }
|
||||
|
||||
function showFotos(login,friend){
|
||||
if(friend=="backButton"){
|
||||
if (photoStack.depth>1){photoStack.pop()}
|
||||
if(!albumgridview.currentItem){root.currentIndex=0}
|
||||
if(albumgridview.currentItem.state=='fullscreen'){
|
||||
albumgridview.currentItem.state = 'inGrid'}
|
||||
else if (albumgridview.currentItem.state == 'inGrid'){albumgridview.currentItem.state=''}
|
||||
else{root.currentIndex=0}
|
||||
}
|
||||
else{
|
||||
try {photogroupModel.clear()}catch (e){print(e)}
|
||||
if (friend){
|
||||
Imagejs.newRequestFriendsAlbumPictures(root.login,friend,fotorectangle,function(albums,remoteAuthBool){
|
||||
remoteContact=remoteAuthBool;
|
||||
var msg = {'model': photogroupModel,'albums':albums,'firstalbum':0,'foreignPicture':true,'friend':friend}
|
||||
photoWorker.sendMessage(msg);
|
||||
})
|
||||
phototabstatusButton.text=friend.screen_name+qsTr("\'s images")
|
||||
|
||||
}
|
||||
else {
|
||||
Helperjs.readField("album", root.db, "imageData",login.username,function(albums){
|
||||
if (albums[0]) {
|
||||
var msg = { 'model': photogroupModel,'albums':albums,'firstalbum':0,'foreignPicture': false};
|
||||
photoWorker.sendMessage(msg);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function deletepics(method, type,id){
|
||||
if(method=="delete"){Imagejs.deleteImage(db,login,type, id,filesystem,root,function(){//showFotos("")
|
||||
})}
|
||||
}
|
||||
function updatepic(method,type,id){
|
||||
if(method=="update"){
|
||||
Helperjs.readData(db,"imageData",login.username,function(url){
|
||||
photoStack.push(
|
||||
"qrc:/qml/photoqml/ImageUploadDialog.qml",{"attachImageURLs":[url[0].location+url[0].filename],"imageId":id,"currentAlbum":url[0].album}
|
||||
)
|
||||
},"id",id)}
|
||||
}
|
||||
|
||||
function uploadUrls(urls){
|
||||
photoStack.push("qrc:/qml/photoqml/ImageUploadDialog.qml",{"attachImageURLs":urls})
|
||||
}
|
||||
|
||||
ProgressBar{
|
||||
id: newImagesProgress
|
||||
width: 15*mm
|
||||
height: updatePhotolist.height
|
||||
anchors.top: parent.top
|
||||
anchors.right:uploadPhoto.left
|
||||
anchors.rightMargin:mm
|
||||
visible: false
|
||||
value: fotorectangle.currentimageno/fotorectangle.newimages.length
|
||||
}
|
||||
|
||||
MButton{
|
||||
id: uploadPhoto
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 0.5*mm
|
||||
anchors.right:updatePhotolist.left
|
||||
anchors.rightMargin:mm
|
||||
height: 6*mm
|
||||
width: 8*mm
|
||||
text:"\uf0ee"
|
||||
onClicked: {
|
||||
photoStack.push("qrc:/qml/photoqml/ImageUploadDialog.qml");
|
||||
// var component = Qt.createComponent("qrc:/qml/photoqml/ImageUploadDialog.qml");
|
||||
// var imageUpload = component.createObject(fotorectangle);
|
||||
}}
|
||||
|
||||
MButton{
|
||||
id: updatePhotolist
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 0.5*mm
|
||||
anchors.right:phototabstatusButton.left
|
||||
anchors.rightMargin:mm
|
||||
height: 6*mm
|
||||
width: 8*mm
|
||||
text:"\uf0ed"
|
||||
|
||||
Menu {
|
||||
id:photoupdatemenu
|
||||
width:40*mm
|
||||
MenuItem {
|
||||
text: qsTr("All Images")
|
||||
font.pixelSize: 3*mm
|
||||
onTriggered: {
|
||||
Imagejs.requestList(root.login,root.db, false, fotostab,function(obj){fotorectangle.newimages=obj})}
|
||||
}
|
||||
MenuItem {
|
||||
text: qsTr("Only new")
|
||||
font.pixelSize: 3*mm
|
||||
onTriggered: {
|
||||
Imagejs.requestList(root.login,root.db, true,fotostab,function(obj){fotorectangle.newimages=obj})}
|
||||
}
|
||||
}
|
||||
onClicked: {photoupdatemenu.popup()}
|
||||
}
|
||||
|
||||
MButton{
|
||||
id: phototabstatusButton
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 0.5*mm
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin:2*mm
|
||||
height: 6*mm
|
||||
width: Math.max(10*mm,implicitWidth)
|
||||
text: fotostab.phototabstatus=="Images"?qsTr("Own Images"):fotostab.phototabstatus
|
||||
Menu {
|
||||
id:phototabmenu
|
||||
width: 40*mm
|
||||
MenuItem {
|
||||
text: qsTr("Own Images")
|
||||
font.pixelSize: 3*mm
|
||||
onTriggered: {
|
||||
fotostab.phototabstatus="Images";
|
||||
// phototabstatusButton.text=qsTr("Own images");
|
||||
showFotos(root.login,"")}
|
||||
}
|
||||
}
|
||||
onClicked: {phototabmenu.popup()}
|
||||
}
|
||||
|
||||
|
||||
DelegateModel{
|
||||
id: visualphotoModel
|
||||
delegate: PhotogroupComponent{}
|
||||
model: photogroupModel
|
||||
}
|
||||
|
||||
ListModel{
|
||||
id: photogroupModel
|
||||
}
|
||||
|
||||
GridView {
|
||||
id: albumgridview
|
||||
cellWidth: 17*mm
|
||||
cellHeight: 17*mm
|
||||
x: mm;y:8*mm
|
||||
width: parent.width-2*mm; height: parent.height-9*mm
|
||||
clip: true
|
||||
model: visualphotoModel.parts.album
|
||||
footer:Rectangle{
|
||||
border.color: "#EEEEEE"
|
||||
border.width: 1
|
||||
width:12*mm
|
||||
height:6*mm
|
||||
Text{
|
||||
font.pixelSize: 1.5*mm
|
||||
anchors.centerIn: parent
|
||||
text:qsTr("More")
|
||||
}
|
||||
MouseArea{anchors.fill:parent
|
||||
onClicked:{print(photogroupModel.get(0).foreignPicture);
|
||||
var lastalbum_id=photogroupModel.count-1;
|
||||
if(photogroupModel.get(photogroupModel.count-1).foreignPicture==true){
|
||||
Imagejs.newRequestFriendsAlbumPictures(login,photogroupModel.get(0).friend,fotorectangle,function(albums,remoteAuthBool){
|
||||
remoteContact=remoteAuthBool;
|
||||
var msg = {'model': photogroupModel,'albums':albums,'firstalbum':lastalbum_id+1,'foreignPicture':true,'friend':photogroupModel.get(0).friend}
|
||||
photoWorker.sendMessage(msg)
|
||||
})
|
||||
}
|
||||
else{Helperjs.readField("album",root.db, "imageData",root.login.username,function(albums){
|
||||
var msg = { 'model': photogroupModel,'albums':albums,'foreignPicture': false,'firstalbum':lastalbum_id+1};
|
||||
photoWorker.sendMessage(msg)})}
|
||||
}}}
|
||||
}
|
||||
|
||||
Rectangle { id: photoBackground; color: 'light grey'; width: parent.width; height: parent.height; opacity: 0; visible: opacity != 0.0 }
|
||||
|
||||
ListView { width: parent.width; height:parent.height; model: visualphotoModel.parts.browser; interactive: false }
|
||||
|
||||
MButton {
|
||||
id: backButton
|
||||
height: 6*mm
|
||||
width: 8*mm
|
||||
text: "\uf057"
|
||||
x: parent.width - backButton.width - 3*mm
|
||||
y: -backButton.height - 4*mm
|
||||
z:2
|
||||
onClicked: {photoBackground.opacity=0}
|
||||
}
|
||||
|
||||
ListView {anchors.fill: parent; model: visualphotoModel.parts.fullscreen; interactive: false }
|
||||
WorkerScript{id: photoWorker;source: "qrc:/js/photoworker.js"}
|
||||
|
||||
Component.onCompleted: {
|
||||
root.fotoSignal.connect(showFotos);
|
||||
root.uploadSignal.connect(uploadUrls);
|
||||
root.changeimage.connect(deletepics);
|
||||
root.changeimage.connect(updatepic);
|
||||
if (fotostab.phototabstatus=="Images"){showFotos(root.login,"")}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,155 +0,0 @@
|
|||
// 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.5
|
||||
import QtQuick.Controls 1.3
|
||||
import QtQml.Models 2.1
|
||||
//import "qrc:/js/service.js" as Service
|
||||
import "qrc:/js/image.js" as Imagejs
|
||||
import "qrc:/js/helper.js" as Helperjs
|
||||
|
||||
Package {
|
||||
Item {
|
||||
Package.name: 'browser'
|
||||
GridView {
|
||||
id: photosGridView; model: visualModel.parts.grid; width: albumgridview.width; height: albumgridview.height;y:albumgridview.y
|
||||
cellWidth: 16.5*mm; cellHeight: 16.5*mm; interactive: false//anchors.margins:2*mm
|
||||
onCurrentIndexChanged: photosListView.positionViewAtIndex(currentIndex, ListView.Contain)
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
Package.name: 'fullscreen'
|
||||
ListView {
|
||||
id: photosListView; model: visualModel.parts.list; orientation: Qt.Horizontal
|
||||
width: albumgridview.width; height: albumgridview.height; //y:albumgridview.y
|
||||
//width: parent.width; height: parent.height;
|
||||
interactive: false
|
||||
onCurrentIndexChanged: photosGridView.positionViewAtIndex(currentIndex, GridView.Contain)
|
||||
highlightRangeMode: ListView.StrictlyEnforceRange; snapMode: ListView.SnapOneItem
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
Package.name: 'album'
|
||||
id: albumWrapper; width: 16.5*mm; height: 16.5*mm
|
||||
DelegateModel {
|
||||
id: visualModel; delegate: PhotoComponent { }
|
||||
model: photoModel
|
||||
}
|
||||
|
||||
PathView {
|
||||
id: photosPathView;
|
||||
model: visualModel.parts.stack;
|
||||
pathItemCount: 1
|
||||
anchors.centerIn: parent;
|
||||
path: Path {
|
||||
PathAttribute { name: 'z'; value: 9999.0 }
|
||||
PathLine { x: 1; y: 1 }
|
||||
PathAttribute { name: 'z'; value: 0.0 }
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle{
|
||||
color:"black"
|
||||
opacity: 0.5
|
||||
width:albumtext.contentWidth
|
||||
height: albumtext.contentHeight
|
||||
anchors.bottom: albumWrapper.bottom
|
||||
}
|
||||
Text {
|
||||
id:albumtext
|
||||
text: albumname
|
||||
width:albumWrapper.width-1*mm
|
||||
height: albumtext.contentHeight
|
||||
wrapMode:Text.Wrap
|
||||
color: "white"
|
||||
font.family: "Monospace"
|
||||
font.pixelSize: 2*mm
|
||||
anchors.bottom: albumWrapper.bottom
|
||||
}
|
||||
|
||||
ListModel{
|
||||
id: photoModel
|
||||
}
|
||||
|
||||
Component.onCompleted:{
|
||||
try {photoModel.clear()}catch (e){print(e)}
|
||||
if(foreignPicture){
|
||||
Imagejs.newRequestFriendsPictures(login,albumlink,friend,photoStack.remoteContact,remoteauth,root,function(obj){
|
||||
if (obj) {
|
||||
for (var k=0;k<obj.length;k++){
|
||||
photoModel.append({"imageLocation": obj[k].thumb,"photoDescription":obj[k].name,"photoLink":obj[k].link})
|
||||
}
|
||||
}
|
||||
})}
|
||||
else{
|
||||
Helperjs.readData(db,"imageData",root.login.username,function(obj){
|
||||
if (obj) {
|
||||
for (var k=0;k<obj.length;k++){
|
||||
if(typeof(obj[k].desc)=="string" && obj[k].desc!=""){var name=obj[k].desc}else{var name=obj[k].filename}
|
||||
photoModel.append({"imageLocation": obj[k].location+obj[k].filename,"photoDescription":name,"photoLink":obj[k].location+obj[k].filename,"imageId":obj[k].id})
|
||||
}
|
||||
}
|
||||
},"album",albumname)}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onPressAndHold:{
|
||||
var menuString="import QtQuick.Controls 1.4; Menu {MenuItem{text:qsTr('Delete on client and server'); onTriggered: {deletepics('album',albumname);photogroupModel.remove(index)}}}";
|
||||
var albummenuObject=Qt.createQmlObject(menuString,albumWrapper,"albummenuOutput")
|
||||
albummenuObject.popup()
|
||||
}
|
||||
onClicked: albumWrapper.state = 'inGrid'
|
||||
}
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: 'inGrid'
|
||||
PropertyChanges { target: photosGridView; interactive: true }
|
||||
PropertyChanges { target: photoBackground; opacity: 1 }
|
||||
PropertyChanges { target: backButton; onClicked: albumWrapper.state = ''; y: 6 }
|
||||
},
|
||||
State {
|
||||
name: 'fullscreen'; extend: 'inGrid'
|
||||
PropertyChanges { target: photosGridView; interactive: false }
|
||||
PropertyChanges { target: photosListView; interactive: true }
|
||||
PropertyChanges { target: photoBackground; opacity: 1 }
|
||||
PropertyChanges { target: backButton;onClicked:{
|
||||
albumWrapper.state = 'inGrid'}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
} //album Ende
|
||||
} //Package Ende
|
||||
//item Ende
|
||||
Loading…
Add table
Add a link
Reference in a new issue