Warning, /maui/pix/src/widgets/views/Cloud/CloudView.qml is written in an unsupported language. File is not indexed.

0001 // Copyright 2018-2020 Camilo Higuita <milo.h@aol.com>
0002 // Copyright 2018-2020 Nitrux Latinoamericana S.C.
0003 //
0004 // SPDX-License-Identifier: GPL-3.0-or-later
0005 
0006 
0007 import QtQuick 2.9
0008 import QtQuick.Controls 2.2
0009 import org.mauikit.controls 1.0 as Maui
0010 
0011 import "../Viewer/Viewer.js" as VIEWER
0012 import "../Pix.js" as PIX
0013 import "../../../view_models"
0014 
0015 import CloudList 1.0
0016 import PixModel 1.0
0017 
0018 PixGrid
0019 {
0020     id: control
0021     property alias list : _cloudList
0022     headBarExit: false
0023     visible: true
0024     holder.emojiSize: Maui.Style.iconSizes.huge
0025     holder.emoji: if(!_cloudList.contentReady)
0026                       "qrc:/assets/animat-rocket-color.gif"
0027                   else
0028                       "qrc:/assets/ElectricPlug.png"
0029 
0030     holder.isGif: !_cloudList.contentReady
0031     holder.isMask: false
0032     holder.title : if(!_cloudList.contentReady)
0033                        i18n("Loading content!")
0034                    else
0035                        i18n("Nothing here")
0036 
0037     holder.body: if(!_cloudList.contentReady)
0038                      i18n("Almost ready!")
0039                  else
0040                      i18n("Make sure you're online and your cloud account is working")
0041 
0042     grid.delegate: PixPic
0043     {
0044         id: delegate
0045         source: "file://"+encodeURIComponent(model.thumbnail)
0046         label: model.label
0047         picSize : control.itemSize
0048         picRadius : control.itemRadius
0049         fit: control.fitPreviews
0050         showLabel: control.showLabels
0051         height: control.grid.cellHeight * 0.9
0052         width: control.grid.cellWidth * 0.8
0053 
0054         Connections
0055         {
0056             target: delegate
0057             onClicked:
0058             {
0059                 control.grid.currentIndex = index
0060 
0061                 if(selectionMode)
0062                     PIX.selectItem(pixList.get(index))
0063                 else if(Maui.Handy.isMobile)
0064                     VIEWER.open(_cloudList, index)
0065             }
0066 
0067             onDoubleClicked:
0068             {
0069                 control.grid.currentIndex = index
0070                 //picClicked(index)
0071                 if(!Maui.Handy.isMobile)
0072                     VIEWER.open(_cloudList, index)
0073                 //                    else
0074                 //                        selectionBox.append(gridModel.get(index))
0075 
0076             }
0077 
0078             onPressAndHold:
0079             {
0080                 control.grid.currentIndex = index
0081                 _picMenu.open()
0082             }
0083 
0084             onRightClicked:
0085             {
0086                 control.grid.currentIndex = index
0087                 _picMenu.open()
0088             }
0089             onEmblemClicked:
0090             {
0091                 control.grid.currentIndex = index
0092                 var item = _cloudList.get(index)
0093                 PIX.selectItem(item)
0094             }
0095         }
0096 
0097     }
0098 
0099     PixModel
0100     {
0101         id: _cloudModel
0102         list: _cloudList
0103     }
0104 
0105     CloudList
0106     {
0107         id: _cloudList
0108         account: currentAccount
0109         onWarning:
0110         {
0111             notify("dialog-information", "An error happened", error)
0112         }
0113     }
0114 
0115     grid.model: _cloudModel
0116 
0117     PixMenu
0118     {
0119         id: _picMenu
0120         index: control.grid.currentIndex
0121     }
0122 
0123     //    property alias list : _cloudList
0124 
0125 
0126 
0127 
0128     //    model.list: _cloudList
0129     //        CloudList
0130     //    {
0131     //id: _cloudList
0132     //    }
0133 
0134 }