Commit afecb73d authored by camilo higuita's avatar camilo higuita
Browse files

add holder actions

parent 4039d8dd
......@@ -56,7 +56,7 @@ BinPackArguments: false
# don't move parameters to own lines if they are not all on the same
BinPackParameters: false
# In case we have an if statement whith multiple lines the operator should be at the beginning of the line
# In case we have an if statement with multiple lines the operator should be at the beginning of the line
# but we do not want to break assignments
BreakBeforeBinaryOperators: NonAssignment
......@@ -79,7 +79,7 @@ SpaceAfterTemplateKeyword: false
AlwaysBreakTemplateDeclarations: true
# macros for which the opening brace stays attached.
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH, forever, Q_FOREVER, QBENCHMARK, QBENCHMARK_ONCE ]
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH, forever, Q_FOREVER, QBENCHMARK, QBENCHMARK_ONCE , wl_resource_for_each, wl_resource_for_each_safe ]
# keep lambda formatting multi-line if not empty
AllowShortLambdasOnASingleLine: Empty
......
......@@ -125,30 +125,15 @@ Maui.ApplicationWindow
{
text: i18n("Open")
icon.name: "folder-open"
onTriggered:
{
dialogLoader.sourceComponent= fmDialogComponent
dialog.mode = dialog.modes.OPEN
dialog.settings.filterType= FB.FMList.IMAGE
dialog.settings.onlyDirs= false
dialog.callback = function(paths)
{
console.log("OPEN THIS PATHS", paths)
Pix.Collection.openPics(paths)
};
dialog.open()
}
onTriggered: openFileDialog()
}
MenuItem
{
text: i18n("Settings")
icon.name: "settings-configure"
onTriggered:
{
dialogLoader.sourceComponent = _settingsDialogComponent
dialog.open()
}
onTriggered: openSettingsDialog()
}
MenuItem
......@@ -405,4 +390,24 @@ Maui.ApplicationWindow
selectionBox.append(item.url, item)
}
function openFileDialog()
{
dialogLoader.sourceComponent= fmDialogComponent
dialog.mode = dialog.modes.OPEN
dialog.settings.filterType= FB.FMList.IMAGE
dialog.settings.onlyDirs= false
dialog.callback = function(paths)
{
Pix.Collection.openPics(paths)
dialogLoader.sourceComponent = null
};
dialog.open()
}
function openSettingsDialog()
{
dialogLoader.sourceComponent = _settingsDialogComponent
dialog.open()
}
}
......@@ -2,6 +2,7 @@
#include <QFileSystemWatcher>
#include <QDateTime>
#include <QDebug>
#include <QDir>
#include <MauiKit/FileBrowsing/fileloader.h>
#include <MauiKit/FileBrowsing/fmstatic.h>
#include <MauiKit/FileBrowsing/tagging.h>
......@@ -11,12 +12,12 @@ static FMH::MODEL picInfo(const QUrl &url)
{
const QFileInfo info(url.toLocalFile());
return FMH::MODEL{{FMH::MODEL_KEY::URL, url.toString()},
{FMH::MODEL_KEY::TITLE, info.baseName()},
{FMH::MODEL_KEY::TITLE, info.fileName()},
{FMH::MODEL_KEY::SIZE, QString::number(info.size())},
{FMH::MODEL_KEY::SOURCE, FMStatic::fileDir(url).toString ()},
{FMH::MODEL_KEY::SOURCE, QUrl::fromLocalFile(info.absoluteDir().absolutePath()).toString ()},
{FMH::MODEL_KEY::DATE, info.birthTime().toString(Qt::TextDate)},
{FMH::MODEL_KEY::MODIFIED, info.lastModified().toString(Qt::TextDate)},
{FMH::MODEL_KEY::FORMAT, info.suffix()}};
{FMH::MODEL_KEY::FORMAT, info.completeSuffix()}};
}
static FMH::MODEL picInfo2(const QUrl &url)
......@@ -25,13 +26,13 @@ static FMH::MODEL picInfo2(const QUrl &url)
const Exiv2Extractor exiv2(url);
return FMH::MODEL{{FMH::MODEL_KEY::URL, url.toString()},
{FMH::MODEL_KEY::TITLE, info.baseName()},
{FMH::MODEL_KEY::TITLE, info.fileName()},
{FMH::MODEL_KEY::SIZE, QString::number(info.size())},
{FMH::MODEL_KEY::SOURCE, FMStatic::fileDir(url).toString ()},
{FMH::MODEL_KEY::SOURCE,QUrl::fromLocalFile(info.absoluteDir().absolutePath()).toString ()},
{FMH::MODEL_KEY::DATE, info.birthTime().toString(Qt::TextDate)},
{FMH::MODEL_KEY::MODIFIED, info.lastModified().toString(Qt::TextDate)},
{FMH::MODEL_KEY::CITY, exiv2.cityId()},
{FMH::MODEL_KEY::FORMAT, info.suffix()}};
{FMH::MODEL_KEY::FORMAT, info.completeSuffix()}};
}
Gallery::Gallery(QObject *parent)
......
......@@ -33,14 +33,6 @@ Maui.Page
autoReload: browserSettings.autoReload
}
Maui.Holder
{
id: _holder
anchors.fill: parent
visible: _gridView.count === 0
emojiSize: Maui.Style.iconSizes.huge
}
showTitle: false
headBar.forceCenterMiddleContent: false
headBar.visible: true
......@@ -257,6 +249,14 @@ Maui.Page
}
}
Maui.Holder
{
id: _holder
anchors.fill: parent
visible: _gridView.count === 0
emojiSize: Maui.Style.iconSizes.huge
}
function filterSelectedItems(path)
{
if(selectionBox && selectionBox.count > 0 && selectionBox.contains(path))
......
......@@ -21,7 +21,20 @@ PixGrid
holder.emoji: "qrc:/assets/image-multiple.svg"
holder.emojiSize: Maui.Style.iconSizes.huge
holder.title : i18n("No Pics!")
holder.body: mainGalleryList.status === GalleryList.Error ? mainGalleryList.error : i18n("Nothing here. Try something different!")
holder.body: mainGalleryList.status === GalleryList.Error ? mainGalleryList.error : i18n("Nothing here. You can add new sources or open an image.")
holder.actions:[
Action
{
text: i18n("Open")
onTriggered: openFileDialog()
},
Action
{
text: i18n("Add sources")
onTriggered: openSettingsDialog()
}
]
footerColumn: RowLayout
{
......
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