version v0.6.7 with moderation

This commit is contained in:
LubuWest 2023-02-09 21:39:43 +01:00
commit 48a70b8395
46 changed files with 2106 additions and 1026 deletions

View file

@ -42,12 +42,13 @@ Rectangle{
radius: mm
property alias text: mainText.text
property alias font: mainText.font
property alias fontSize: mainText.font.pointSize
signal clicked
state:""
Text{
id:mainText
color: "black"
color: Material.primaryTextColor//"black"
anchors.centerIn: parent
width: contentWidth
height: contentHeight

View file

@ -63,10 +63,10 @@ Item {
onClicked: {
login=account;
if(!wideScreen){leftDrawerAndroid.close()}
newstypeSignal("refresh")
// updatenews.setDatabase();
// updatenews.login();
// updatenews.startsync();
// newstypeSignal("refresh")
updatenews.setDatabase();
updatenews.login();
updatenews.startsync();
}
}
}

View file

@ -29,161 +29,180 @@
// 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.12
import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import Qt.labs.folderlistmodel 2.1
import QtQuick.Dialogs 1.2
import Qt.labs.folderlistmodel 2.12
import "qrc:/js/service.js" as Service
import "qrc:/js/helper.js" as Helperjs
import "qrc:/qml/genericqml"
Rectangle{
Item{
id:imageDialog
z:2
border.color: "grey"
color: Material.backgroundColor
width: parent.width-4*mm
height:parent.height-12*mm
x:2*mm
y:10*mm
// border.color: "grey"
// color: Material.backgroundColor
// width: parent.width-root.fontFactor*osSettings.bigFontSize
// height: parent.height-3*root.fontFactor*osSettings.bigFontSize
// x: 0.5*root.fontFactor*osSettings.bigFontSize
// y: 2*root.fontFactor*osSettings.bigFontSize
property string directory: ""
property bool multiple: false
property string imageUrl: ""
property var imageUrls: []
//property var imageUrls: []
signal ready();
function pickImage() {}
function pickImage() {imageFileDialog.open()}
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: 3*root.fontFactor*osSettings.bigFontSize
anchors.top: parent.top
anchors.topMargin: 0.5*mm
anchors.right: parent.right
anchors.rightMargin: 1*mm
text: "\uf057"
onClicked:{ready();imageDialog.destroy()}
// Text{
// id:directoryText
// anchors.bottom: parent.bottom
//// x:0.5*mm
//// y:0.5*mm
// width: imageDialog.width-3.5*root.fontFactor*osSettings.bigFontSize
// height:contentHeight
// font.pointSize: osSettings.bigFontSize
// wrapMode: Text.Wrap
// text: directory
// color: Material.primaryTextColor
// }
// Button{
// id:closeButton
// height: 2*root.fontFactor*osSettings.bigFontSize
// anchors.top: parent.top
// anchors.topMargin: 0.5*mm
// anchors.right: parent.right
// anchors.rightMargin: 1*mm
// text: "\uf057"
// onClicked:{
// ready();imageDialog.destroy()
// }
// }
FileDialog {
id: imageFileDialog
title: "Please choose a file"
folder: shortcuts.pictures
selectFolder: false
selectMultiple: true
onAccepted: {
imageUrl=imageFileDialog.fileUrls.toString();
ready();
}
}
// ListView {
// id: imageView
// x:0.5*mm
// y: 2.5*root.fontFactor*osSettings.bigFontSize//Math.max(directoryText.height, closeButton.height)+mm
// width: parent.width-2*mm
// height: parent.height-3*root.fontFactor*osSettings.bigFontSize
// boundsBehavior:Flickable.StopAtBounds
// clip: true
// model: imageModel
// delegate: imageItem
// ScrollBar.vertical: ScrollBar { }
// }
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
// }
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: 2*root.fontFactor*osSettings.bigFontSize
// height: 2*root.fontFactor*osSettings.bigFontSize
// running:false
// }
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: Math.max(fileImage.height,1.5*root.fontFactor*osSettings.bigFontSize)+2*mm
// Rectangle{
// id:imagetextRectangle
// color:"black"
// x:mm
// z:3
// opacity: fileIsDir?0:0.5
// width:imagetext.contentWidth
// height: imagetext.contentHeight
// anchors.bottom: fileImage.bottom
// }
// Text {
// id:imagetext
// x: mm//fileIsDir?11*mm:mm
// z:4
// text: fileIsDir?"\uf07b "+fileName:fileName
// width: fileIsDir?parent.width - 2.5*root.fontFactor*osSettings.bigFontSize :imageView.width-mm
// anchors.bottom: fileImage.bottom
// color: fileIsDir?Material.primaryTextColor:"white"
// font.pointSize: osSettings.bigFontSize
// wrapMode:Text.Wrap
// }
// Text {
// id:selected
// anchors.right:parent.right
// visible: attachImageURLs.indexOf(fileURL)>-1
// z:4
// text: "\u2713"
// width: 2*root.fontFactor*osSettings.bigFontSize
// anchors.top: fileImage.top
// color: "green"
// font.pointSize: 3*osSettings.bigFontSize
// }
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.pointSize: osSettings.bigFontSize
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.pointSize: 3*osSettings.bigFontSize
}
// Image{id:fileImage
// width: imageView.width-mm
// fillMode:Image.PreserveAspectFit
// source:fileIsDir?"":fileURL
// }
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;
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
}
}
}
}
}
}
// }
// imageUrl=fileURL
// }
// }
// }
// }
// }
// }
// Component.onCompleted: imageFileDialog.open()
}

View file

@ -22,13 +22,15 @@ Item {
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)
}
rootstack.currentIndex=0;newstab.active=true;
root.uploadSignal(imageUrls.join(","))
// 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)

View file

@ -15,7 +15,6 @@ Item {
function startSyncTimer(interval){
syncTimer.interval=interval*60000;
//print("synctimer interval "+syncTimer.interval)
syncTimer.start()
}