This commit is contained in:
LubuWest 2019-06-25 20:59:10 +02:00
commit d48847d183
135 changed files with 8879 additions and 3693 deletions

View file

@ -30,7 +30,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.0
import QtQuick.Controls 1.3
import QtQuick.Controls 2.4
import "qrc:/qml/genericqml"
Item {
@ -83,7 +83,8 @@ Item {
MouseArea{
anchors.fill: parent
onClicked:{
root.currentIndex=0;
rootstack.currentIndex=0;
bar.currentIndex=0;
root.contactdetailsSignal(contact)
}
}

View file

@ -30,7 +30,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.0
import QtQuick.Controls 1.3
import QtQuick.Controls 2.4
import "qrc:/qml/genericqml"
Item {
@ -78,7 +78,7 @@ Rectangle{
ScrollView{
horizontalScrollBarPolicy:Qt.ScrollBarAlwaysOff
frameVisible: true
//frameVisible: true
id:namelabelflickable
width: root.width-10*mm
height:root.height-50*mm
@ -105,8 +105,10 @@ Rectangle{
x: mm
spacing:4
BlueButton{
MButton{
id:photobutton
height: 6*mm
width: 8*mm
text: "\uf03e" // "Photos"
visible:(contact.network=="dfrn")
onClicked:{
@ -118,8 +120,10 @@ Rectangle{
}
}
BlueButton{
MButton{
id:messagebutton
height: 6*mm
width: 8*mm
text: "\uf0e6" //"Messages"
onClicked:{
root.currentIndex=0;
@ -129,23 +133,26 @@ Rectangle{
}
}
BlueButton{
MButton{
id:dmbutton
visible: (contact.following=="true")
height: 6*mm
width: 8*mm
text: "\uf040" //"DM"
onClicked:{
root.currentIndex=0;
//newstab.active=true;
root.directmessageSignal(contact.screen_name);
contactLargeComponent.destroy();
}
}
BlueButton{
Button{
id:eventbutton
visible:(contact.network=="dfrn")
text:"\uf073"
height: 6*mm
width: 8*mm
text:"\uf073" //Events
onClicked:{
root.currentIndex=3;
calendartab.active=true;
@ -155,8 +162,10 @@ Rectangle{
}
}
BlueButton{
Button{
id: closeButton
height: 6*mm
width: 8*mm
text: "\uf057" //"close"
onClicked:{contactLargeComponent.destroy();
}

View file

@ -31,6 +31,7 @@
// List of people
import QtQuick 2.0
import QtQuick.Controls 2.5
import "qrc:/js/helper.js" as Helperjs
import "qrc:/qml/genericqml"
@ -109,13 +110,15 @@ Rectangle {
}
}
BlueButton {
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"
//color:"white"
text: "\uf057"
onClicked: {
groupModelAppend(contacts,function(){

View file

@ -29,9 +29,10 @@
// 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 1.2
import QtQuick.Controls.Styles 1.4
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
@ -69,14 +70,37 @@ Rectangle {
callback(profile)
}
TabView{
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
tabPosition: Qt.TopEdge
//anchors.fill: parent
x:mm
y:mm
width: root.width-2*mm
height: root.height-10*mm
currentIndex: 1
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:{
@ -88,27 +112,28 @@ Rectangle {
}
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
}
// 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
// }
Tab{
Item{
id:profileGridTab
title: qsTr("Me")
Layout.fillWidth:true
Layout.fillHeight: true
Component.onCompleted:{
showProfile(function(profile){
var component = Qt.createComponent("qrc:/qml/contactqml/ProfileComponent.qml");
@ -117,11 +142,11 @@ Rectangle {
}
}
Tab{
title: qsTr("Friends")
Rectangle{
Item{
id: friendsGridTab
property int currentContact:0
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){
@ -140,17 +165,21 @@ Rectangle {
onDownloaded:{
if(type=="contactlist"){
//print(url+" "+filename+" "+i)
currentContact=i+1;
if(currentContact==root.newContacts.length){showFriends(root.login.username)}
friendsGridTab.currentContact=i+1;
if(friendsGridTab.currentContact==root.newContacts.length){
friendsGridTab.showFriends(root.login.username)
}
}
}
}
BlueButton {
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";
@ -167,8 +196,8 @@ Rectangle {
anchors.top: parent.top
anchors.right:updateFriendsButton.left
anchors.rightMargin:mm
visible: (currentContact!=(root.newContacts.length))?true:false
value: currentContact/root.newContacts.length
visible: (friendsGridTab.currentContact!=(root.newContacts.length))?true:false
value: friendsGridTab.currentContact/root.newContacts.length
}
//GridView {
@ -196,13 +225,11 @@ Rectangle {
root.newContacts=[]
}
}
}
Tab{
title: qsTr("Contacts")
Rectangle{
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){
@ -213,12 +240,14 @@ Rectangle {
}
},"isFriend",0,"screen_name ASC");
}
BlueButton {
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)};
@ -252,11 +281,13 @@ Rectangle {
friendsTabView.contactsSignal.connect(showContacts);
}
}
}
Tab{
title: qsTr("Groups")
Rectangle{
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){
@ -289,16 +320,18 @@ Rectangle {
showGroups(root.login.username)});
}
}
BlueButton {
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(){
showGroups(root.login.username)})}
groupsGridTab.showGroups(root.login.username)})}
}
// BlueButton {
// id: newGroupButton
@ -351,9 +384,9 @@ Rectangle {
friendsTabView.groupsSignal.connect(showGroups);
}
}
}
}
}
Component.onCompleted: {
root.contactdetailsSignal.connect(showContactdetails);
//root.contactdetailsSignal.connect(showContactdetails);
}
}

View file

@ -29,7 +29,8 @@
// 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 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"
@ -76,15 +77,34 @@ Item {
}
}
BlueButton{
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: 5*mm
height: 5*mm
color:"transparent"
width: 4*mm
height: 6*mm
//color:"transparent"
text:"?"
font.pixelSize: 3*mm
anchors.left: photoImage.right
anchors.leftMargin: 3
anchors.topMargin: 3
anchors.leftMargin: mm
anchors.topMargin: mm
anchors.top: parent.top
onClicked:{
//if(group.new){
@ -109,7 +129,7 @@ Item {
Rectangle{
id: detailsrectangle
anchors.top: namelabelRect.bottom
anchors.topMargin: 2*mm
anchors.topMargin: mm
opacity: 0
Component {
@ -165,7 +185,7 @@ Item {
x:1
//anchors.top: parent.top
width: root.width-10*mm
height:groupsView.height -31*mm
height:groupsView.height - 24*mm
clip: true
spacing: 2
model: groupModel
@ -178,12 +198,7 @@ Item {
anchors.top: groupListView.bottom
anchors.topMargin: mm
spacing: mm
BlueButton{
id: closeButton
text: "\uf057"
onClicked:{groupComponent.state="";
if (group.new){groupsModel.remove(index)}
}
}
// BlueButton{
@ -232,7 +247,7 @@ Item {
// groupsModel.remove(index)})
// }
// }
}
}
Component.onCompleted:{if(group.new){groupComponent.state="large"}}
}
@ -242,11 +257,13 @@ Item {
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}
}
]
}

View file

@ -30,13 +30,14 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.0
import QtQuick.Controls 1.3
import QtQuick.Controls 2.4
import "qrc:/qml/genericqml"
import "qrc:/js/service.js" as Service
Rectangle {
width:root.width-2*mm
height:root.height-14*mm
// width:parent.width-2*mm
// height:parent.height-14*mm
anchors.fill:parent
color:"white"
property var profile:({})
property var attachImageURLs:[]
@ -102,12 +103,15 @@ Rectangle {
callback(profiletext)
}
BlueButton {
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;
@ -132,8 +136,9 @@ Rectangle {
Image {
id: photoImage
x:mm
y:mm
anchors.top: parent.top
anchors.topMargin: mm
anchors.left: parent.left
width: 15*mm
height:15*mm
source: "file://"+profile.friendica_owner.profile_image
@ -170,11 +175,13 @@ Rectangle {
font.pixelSize: 4*mm
}
BlueButton{
MButton{
id:updatebutton
height: 5*mm
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
@ -184,7 +191,7 @@ Rectangle {
Label {
id: namelabel
x: mm
width: root.width-6*mm
width: parent.width-6*mm
height: 3*mm
text:(Qt.atob(profile.friendica_owner.name))+" (@"+profile.friendica_owner.screen_name+")"
elide:Text.ElideRight
@ -230,7 +237,7 @@ Rectangle {
font.pixelSize: 3*mm
textFormat:Text.RichText
wrapMode: Text.Wrap
text:"<b>"+qsTr("Description")+": </b> "+(profile.friendica_owner.description)+"<br> <b>"+qsTr("Location")+":</b> "+profile.friendica_owner.location+"<br> <b>"+qsTr("Posts")+":</b> "+profile.friendica_owner.statuses_count+
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: {
@ -238,32 +245,32 @@ Rectangle {
}
}
Rectangle{
id: detailsrectangle
anchors.top: namelabel.bottom
anchors.topMargin: 2*mm
// Rectangle{
// id: detailsrectangle
ScrollView{
horizontalScrollBarPolicy:Qt.ScrollBarAlwaysOff
frameVisible: true
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
id:namelabelflickable
width: root.width-10*mm
height:root.height-36*mm//friendsTabView.height-45*mm
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:root.width-10*mm
height: root.height
clip: true
// width:parent.width
// height: root.height
// clip: true
spacing: 0
model: profileModel
delegate: profileItem
}
}
}
// }
Component.onCompleted: {
profile.profiles.sort(function(obj1, obj2) {