Commit e6a32e51 authored by Camilo higuita's avatar Camilo higuita

more work on the tagging model and list

parent a779c10b
......@@ -23,6 +23,10 @@ set(pix_SRCS
src/db/dbactions.cpp
src/models/basemodel.cpp
src/models/baselist.cpp
src/models/gallery/gallery.cpp
src/models/albums/albums.cpp
src/models/folders/folders.cpp
src/models/folders/foldermodel.cpp
)
set(pix_HDRS
......@@ -33,6 +37,10 @@ set(pix_HDRS
src/utils/pic.h
src/models/basemodel.h
src/models/baselist.h
src/models/gallery/gallery.h
src/models/albums/albums.h
src/models/folders/folders.h
src/models/folders/foldermodel.h
)
set(pix_ASSETS
......
......@@ -36,7 +36,7 @@ void DBActions::init()
qDebug()<< "Starting DBActions";
this->tag = Tagging::getInstance(PIX::App, PIX::version, "org.kde.pix", PIX::comment);
this->tag = Tagging::getInstance();
}
DBActions *DBActions::instance = nullptr;
......
......@@ -47,6 +47,9 @@ import "db/Query.js" as Q
import PixModel 1.0
import AlbumsList 1.0
import TagsModel 1.0
import TagsList 1.0
Maui.ApplicationWindow
{
id: root
......@@ -114,7 +117,7 @@ Maui.ApplicationWindow
headBar.middleContent: [
Maui.ToolButton
{
text: qsTr("Viewer")
// text: qsTr("Viewer")
visible: !pixViewer.holder.visible
iconColor: currentView === views.viewer ? highlightColor : headBarFGColor
iconName: "image"
......@@ -123,7 +126,7 @@ Maui.ApplicationWindow
Maui.ToolButton
{
text: qsTr("Gallery")
// text: qsTr("Gallery")
iconColor: currentView === views.gallery? highlightColor : headBarFGColor
iconName: "image-multiple"
onClicked: currentView = views.gallery
......@@ -131,7 +134,7 @@ Maui.ApplicationWindow
Maui.ToolButton
{
text: qsTr("Folders")
// text: qsTr("Folders")
iconColor: currentView === views.folders? highlightColor : headBarFGColor
iconName: "image-folder-view"
onClicked: currentView = views.folders
......@@ -139,7 +142,7 @@ Maui.ApplicationWindow
Maui.ToolButton
{
text: qsTr("Albums")
// text: qsTr("Albums")
iconColor: currentView === views.albums? highlightColor : headBarFGColor
iconName: "image-frames"
onClicked: currentView = views.albums
......@@ -147,10 +150,18 @@ Maui.ApplicationWindow
Maui.ToolButton
{
text: qsTr("Tags")
// text: qsTr("Tags")
iconColor: currentView === views.tags? highlightColor : headBarFGColor
iconName: "tag"
onClicked: currentView = views.tags
},
Maui.ToolButton
{
// text: qsTr("Cloud")
iconColor: currentView === views.tags? highlightColor : headBarFGColor
iconName: "folder-cloud"
onClicked: currentView = views.tags
}
]
......@@ -270,6 +281,17 @@ Maui.ApplicationWindow
query: Q.Query.allAlbums
}
TagsModel
{
id: tagsModel
list: tagsList
}
TagsList
{
id: tagsList
}
Connections
{
target: pix
......@@ -277,10 +299,4 @@ Maui.ApplicationWindow
onViewPics: VIEWER.openExternalPics(pics, 0)
onNewPic: console.log(pic.url)
}
Connections
{
target: tag
onTagged: tagsView.populate()
}
}
......@@ -92,7 +92,6 @@ Maui.Menu
Maui.MenuItem
{
text: qsTr("Show in folder...")
enabled: !isMultiple
onTriggered:
{
pix.showInFolder([list.get(index).url])
......
......@@ -38,8 +38,8 @@ Maui.Page
Maui.SideBar
{
id: tagsList
anchors.fill: parent
model: tagsModel
delegate: Maui.ListDelegate
{
id: delegate
......
......@@ -31,7 +31,7 @@ Kirigami.PageRow
title: qsTr("New tag")
onFinished:
{
tag.tag(text)
tagsList.insert(text)
}
}
TagsSidebar
......@@ -57,17 +57,7 @@ Kirigami.PageRow
tagsGrid.list.refresh()
}
function populate()
{
tagsSidebar.list.model.clear()
var tags = tag.getUrlsTags(true)
if(tags.length > 0)
for(var i in tags)
append(tags[i])
}
function populateGrid(myTag)
function populateGrid(myTag)
{
if(!wideMode && currentIndex === 0)
currentIndex = 1
......@@ -80,16 +70,4 @@ Kirigami.PageRow
tagsGrid.model.append(tags[i])
}
function clear()
{
tagsSidebar.list.model.clear()
// tagsGrid.model.clear()
}
function append(myTag)
{
tagsSidebar.list.model.append(myTag)
}
}
}
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