Commit fc7f1c10 authored by Camilo higuita's avatar Camilo higuita

remove old details drawer and start using more MauiKit FMList props

parent e88c42cf
......@@ -40,6 +40,7 @@ bool Index::isApp(const QString &path)
return /*QFileInfo(path).isExecutable() ||*/ path.endsWith(".desktop");
}
/* to be called to launch index with opening different paths */
void Index::openPaths(const QStringList &paths)
{
QStringList urls;
......
......@@ -21,10 +21,13 @@ public:
Q_INVOKABLE static QVariantList getCustomPathContent(const QString &path);
Q_INVOKABLE static bool isCustom(const QString &path);
Q_INVOKABLE static bool isApp(const QString &path);
Q_INVOKABLE void openPaths(const QStringList &paths);
Q_INVOKABLE static QVariantList getCustomPaths();
/*KDE*/
Q_INVOKABLE static void runApplication(const QString &exec, const QString &url);
signals:
void openPath(QStringList paths);
......
......@@ -6,7 +6,6 @@
<file>widgets_templates/ItemMenu.qml</file>
<file>Index.js</file>
<file>widgets/views/BrowserMenu.qml</file>
<file>widgets/views/DetailsDrawer.qml</file>
<file>widgets/views/Previewer/AudioPreview.qml</file>
<file>widgets/views/Previewer/ImagePreview.qml</file>
<file>widgets/views/Previewer/TextPreview.qml</file>
......
......@@ -32,12 +32,12 @@ Maui.Page
property alias selectionBar : selectionBar
property alias model : folderModel
property alias list : modelList
property alias grid : viewLoader.item
property alias detailsDrawer: detailsDrawer
property alias browserMenu: browserMenu
property var previousPath: []
property var nextPath: []
property var pathType : ({
directory : 0,
tags : 1,
......@@ -50,13 +50,6 @@ Maui.Page
margins: 0
// Connections
// {
// target: inx
// onPathModified: browser.refresh()
// onItemReady: browser.append(item)
// }
BrowserMenu
{
id: browserMenu
......@@ -243,7 +236,6 @@ Maui.Page
Maui.Menu
{
id: sortMenu
parent: parent
Maui.MenuItem
{
......@@ -477,7 +469,6 @@ Maui.Page
function openFolder(path)
{
previousPath.push(currentPath)
populate(path)
if(!isMobile)
......@@ -539,19 +530,17 @@ Maui.Page
function goBack()
{
nextPath.push(currentPath)
populate(previousPath.pop())
populate(modelList.previousPath)
}
function goNext()
{
openFolder(nextPath.pop())
openFolder(modelList.posteriorPath)
}
function goUp()
{
openFolder(inx.parentDir(currentPath))
openFolder(modelList.parentPath)
}
function refresh()
......
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import org.kde.kirigami 2.0 as Kirigami
import org.kde.mauikit 1.0 as Maui
import "Previewer"
Maui.Dialog
{
id: detailsDrawerRoot
property string currentUrl: ""
property var iteminfo : ({})
property bool isDir : false
property string mimetype : ""
maxHeight: unit * 800
maxWidth: unit * 500
defaultButtons: false
footBar.leftContent: Maui.ToolButton
{
visible: !isDir
iconName: "document-share"
onClicked:
{
isAndroid ? Maui.Android.shareDialog(currentUrl) :
shareDialog.show(currentUrl)
close()
}
}
footBar.middleContent: [
Maui.ToolButton
{
iconName: "love"
},
Maui.ToolButton
{
iconName: "document-open"
onClicked:
{
// if(typeof(previewLoader.item.player) !== "undefined")
// previewLoader.item.player.stop()
browser.openFile(currentUrl)
}
}
]
footBar.rightContent: Maui.ToolButton
{
iconName: "archive-remove"
onClicked:
{
close()
browser.remove([currentUrl])
}
}
Component
{
id: imagePreview
ImagePreview
{
id: imagePreviewer
}
}
Component
{
id: defaultPreview
DefaultPreview
{
id: defaultPreviewer
}
}
Component
{
id: audioPreview
AudioPreview
{
id: audioPreviewer
}
}
Component
{
id: videoPreview
VideoPreview
{
id: videoPreviewer
}
}
// ScrollView
// {
// id: scrollView
// anchors.fill:parent
// contentWidth: previewLoader.width
// contentHeight: previewLoader.height
// clip: true
// Loader
// {
// id: previewLoader
// sourceComponent: switch(mimetype)
// {
// case "audio" :
// audioPreview
// break
// case "video" :
// videoPreview
// break
// case "text" :
// defaultPreview
// break
// case "image" :
// imagePreview
// break
// case "inode" :
// default:
// defaultPreview
// }
//// height : previewContent.height * 1.5
//// width: previewContent.width
// }
// }
onClosed:
{
if(previewLoader.item.player)
previewLoader.item.player.stop()
}
function show(path)
{
currentUrl = path
iteminfo = inx.getFileInfo(path)
mimetype = iteminfo.mime.slice(0, iteminfo.mime.indexOf("/"))
isDir = false
console.log("MIME TYPE FOR PREVEIWER", mimetype)
open()
}
}
......@@ -113,7 +113,7 @@ Maui.Menu
Maui.MenuItem
{
text: qsTr("Select")
onTriggered: browser.selectionBar.append(browser.model.get(browser.grid.currentIndex))
onTriggered: browser.selectionBar.append(browser.list.get(browser.grid.currentIndex))
}
Maui.MenuItem
......
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