Commit 09d9b839 authored by Camilo higuita's avatar Camilo higuita

push latest changes

parent e4ddfcb8
...@@ -27,6 +27,7 @@ set(pix_SRCS ...@@ -27,6 +27,7 @@ set(pix_SRCS
src/models/albums/albums.cpp src/models/albums/albums.cpp
src/models/folders/folders.cpp src/models/folders/folders.cpp
src/models/folders/foldermodel.cpp src/models/folders/foldermodel.cpp
src/models/cloud/cloud.cpp
) )
set(pix_HDRS set(pix_HDRS
...@@ -41,6 +42,7 @@ set(pix_HDRS ...@@ -41,6 +42,7 @@ set(pix_HDRS
src/models/albums/albums.h src/models/albums/albums.h
src/models/folders/folders.h src/models/folders/folders.h
src/models/folders/foldermodel.h src/models/folders/foldermodel.h
src/models/cloud/cloud.h
) )
set(pix_ASSETS set(pix_ASSETS
......
...@@ -53,6 +53,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -53,6 +53,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "./src/models/baselist.h" #include "./src/models/baselist.h"
#include "./src/models/gallery/gallery.h" #include "./src/models/gallery/gallery.h"
#include "./src/models/albums/albums.h" #include "./src/models/albums/albums.h"
#include "./src/models/cloud/cloud.h"
#include "./src/models/folders/foldermodel.h" #include "./src/models/folders/foldermodel.h"
#include "./src/models/folders/folders.h" #include "./src/models/folders/folders.h"
...@@ -144,6 +145,7 @@ int main(int argc, char *argv[]) ...@@ -144,6 +145,7 @@ int main(int argc, char *argv[])
qmlRegisterType<Albums>("AlbumsList", 1, 0, "AlbumsList"); qmlRegisterType<Albums>("AlbumsList", 1, 0, "AlbumsList");
qmlRegisterType<FolderModel>("FolderModel", 1, 0, "FolderModel"); qmlRegisterType<FolderModel>("FolderModel", 1, 0, "FolderModel");
qmlRegisterType<Folders>("FoldersList", 1, 0, "FoldersList"); qmlRegisterType<Folders>("FoldersList", 1, 0, "FoldersList");
qmlRegisterType<Cloud>("CloudList", 1, 0, "CloudList");
#ifdef STATIC_KIRIGAMI #ifdef STATIC_KIRIGAMI
KirigamiPlugin::getInstance().registerTypes(); KirigamiPlugin::getInstance().registerTypes();
......
...@@ -51,6 +51,8 @@ SOURCES += main.cpp \ ...@@ -51,6 +51,8 @@ SOURCES += main.cpp \
src/models/albums/albums.cpp \ src/models/albums/albums.cpp \
src/models/folders/folders.cpp \ src/models/folders/folders.cpp \
src/models/folders/foldermodel.cpp \ src/models/folders/foldermodel.cpp \
src/models/cloud/cloud.cpp
# Additional import path used to resolve QML modules in Qt Creator's code model # Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH = QML_IMPORT_PATH =
...@@ -79,7 +81,8 @@ HEADERS += \ ...@@ -79,7 +81,8 @@ HEADERS += \
src/models/gallery/gallery.h \ src/models/gallery/gallery.h \
src/models/albums/albums.h \ src/models/albums/albums.h \
src/models/folders/folders.h \ src/models/folders/folders.h \
src/models/folders/foldermodel.h src/models/folders/foldermodel.h \
src/models/cloud/cloud.h
include(install.pri) include(install.pri)
......
...@@ -35,6 +35,7 @@ import "widgets/views/Settings" ...@@ -35,6 +35,7 @@ import "widgets/views/Settings"
import "widgets/views/Tags" import "widgets/views/Tags"
import "widgets/views/Viewer" import "widgets/views/Viewer"
import "widgets/views/Search" import "widgets/views/Search"
import "widgets/views/Cloud"
import "view_models" import "view_models"
import "widgets/dialogs/Albums" import "widgets/dialogs/Albums"
...@@ -50,6 +51,9 @@ import AlbumsList 1.0 ...@@ -50,6 +51,9 @@ import AlbumsList 1.0
import TagsModel 1.0 import TagsModel 1.0
import TagsList 1.0 import TagsList 1.0
import SyncingModel 1.0
import SyncingList 1.0
Maui.ApplicationWindow Maui.ApplicationWindow
{ {
id: root id: root
...@@ -68,7 +72,8 @@ Maui.ApplicationWindow ...@@ -68,7 +72,8 @@ Maui.ApplicationWindow
folders: 2, folders: 2,
albums: 3, albums: 3,
tags: 4, tags: 4,
search: 5 cloud: 5,
search: 6
}) })
/*PROPS*/ /*PROPS*/
...@@ -113,6 +118,39 @@ Maui.ApplicationWindow ...@@ -113,6 +118,39 @@ Maui.ApplicationWindow
] ]
headBar.visible: !fullScreen headBar.visible: !fullScreen
headBar.leftContent:[
Maui.ToolButton
{
text: "mauitest"
onClicked: _accountMenu.popup()
iconName: "list-add-user"
Maui.Menu
{
id: _accountMenu
contentItem: ListView
{
model: _syncingModel
delegate: Maui.MenuItem
{
text: model.user
}
}
}
}
]
SyncingModel
{
id: _syncingModel
list: _syncingList
}
SyncingList
{
id: _syncingList
}
headBar.middleContent: [ headBar.middleContent: [
Maui.ToolButton Maui.ToolButton
...@@ -159,9 +197,9 @@ Maui.ApplicationWindow ...@@ -159,9 +197,9 @@ Maui.ApplicationWindow
Maui.ToolButton Maui.ToolButton
{ {
// text: qsTr("Cloud") // text: qsTr("Cloud")
iconColor: currentView === views.tags? highlightColor : headBarFGColor iconColor: currentView === views.cloud? highlightColor : headBarFGColor
iconName: "folder-cloud" iconName: "folder-cloud"
onClicked: currentView = views.tags onClicked: currentView = views.cloud
} }
] ]
...@@ -206,6 +244,11 @@ Maui.ApplicationWindow ...@@ -206,6 +244,11 @@ Maui.ApplicationWindow
id: tagsView id: tagsView
} }
CloudView
{
id: cloudView
}
SearchView SearchView
{ {
id: searchView id: searchView
......
#ifndef BASELIST_H #ifndef BASELIST_H
#define BASELIST_H #define BASELIST_H
#include <QObject>
#ifdef Q_OS_ANDROID #ifdef Q_OS_ANDROID
#include "fm.h"
#include "fmh.h" #include "fmh.h"
#else #else
#include <MauiKit/fm.h>
#include <MauiKit/fmh.h> #include <MauiKit/fmh.h>
#endif #endif
......
#include "cloud.h"
#ifdef Q_OS_ANDROID
#include "fm.h"
#include "fmh.h"
#else
#include <MauiKit/fm.h>
#include <MauiKit/fmh.h>
#endif
Cloud::Cloud(QObject *parent) : BaseList (parent)
{
this->fm = FM::getInstance();
this->setList();
connect(this->fm, &FM::cloudServerContentReady, [](const FMH::MODEL_LIST &list, const QString &url)
{
// Q_UNUSED(url);
// emit this->preListChanged();
// this->list = list;
// emit this->postListChanged();
});
}
FMH::MODEL_LIST Cloud::items() const
{
return this->list;
}
void Cloud::setAccount(const QString value)
{
if(this->account == value)
return;
this->account = value;
emit this->accountChanged();
this->setList();
}
QString Cloud::getAccount() const
{
return this->account;
}
void Cloud::setList()
{
this->fm->getCloudServerContent(FMH::PATHTYPE_NAME[FMH::PATHTYPE_KEY::CLOUD_PATH]+"/"+this->account);
}
QVariantMap Cloud::get(const int &index) const
{
if(index >= this->list.size() || index < 0)
return QVariantMap();
QVariantMap res;
const auto pic = this->list.at(index);
for(auto key : pic.keys())
res.insert(FMH::MODEL_NAME[key], pic[key]);
return res;
}
#ifndef CLOUD_H
#define CLOUD_H
#include <QObject>
#include "./src/models/baselist.h"
class FM;
class Cloud : public BaseList
{
Q_OBJECT
Q_PROPERTY(QString account READ getAccount WRITE setAccount NOTIFY accountChanged)
public:
explicit Cloud(QObject *parent = nullptr);
// ~Cloud();
FMH::MODEL_LIST items() const override;
void setAccount(const QString value);
QString getAccount() const;
private:
FMH::MODEL_LIST list;
void setList();
QString account;
FM *fm;
public slots:
QVariantMap get(const int &index) const override;
signals:
void accountChanged();
};
#endif // CLOUD_H
...@@ -29,5 +29,6 @@ ...@@ -29,5 +29,6 @@
<file>widgets/views/Viewer/ViewerDelegate.qml</file> <file>widgets/views/Viewer/ViewerDelegate.qml</file>
<file>view_models/PixMenu.qml</file> <file>view_models/PixMenu.qml</file>
<file>widgets/SelectionBar.qml</file> <file>widgets/SelectionBar.qml</file>
<file>widgets/views/Cloud/CloudView.qml</file>
</qresource> </qresource>
</RCC> </RCC>
...@@ -26,6 +26,7 @@ Maui.Page ...@@ -26,6 +26,7 @@ Maui.Page
property alias grid: grid property alias grid: grid
property alias holder: holder property alias holder: holder
property alias list : pixList property alias list : pixList
property alias model: pixModel
/*signals*/ /*signals*/
signal picClicked(int index) signal picClicked(int index)
......
import QtQuick 2.9
import QtQuick.Controls 2.2
import org.kde.mauikit 1.0 as Maui
import "../../../view_models"
//import CloudList 1.0
import FMList 1.0
import FMModel 1.0
PixGrid
{
id: galleryViewRoot
headBarExit: false
visible: true
holder.emoji: "qrc:/img/assets/ElectricPlug.png"
holder.isMask: false
holder.title : "No Pics!"
holder.body: "Add new image sources"
holder.emojiSize: iconSizes.huge
FMModel
{
id: _cloudModel
list: _cloudList
}
FMList
{
id: _cloudList
}
grid.model: _cloudModel
// property alias list : _cloudList
// model.list: _cloudList
// CloudList
// {
//id: _cloudList
// }
}
import QtQuick 2.9 import QtQuick 2.9
import QtQuick.Controls 2.2 import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import "../../../db/Query.js" as Q
import "../../../widgets/views/Viewer/Viewer.js" as VIEWER
import "../../../view_models" import "../../../view_models"
PixGrid PixGrid
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment