Commit 49340251 authored by Matthieu Gallien's avatar Matthieu Gallien 🎵

remove FileBrowserView: no longer needed

parent 5b445bef
......@@ -405,7 +405,6 @@ if (Qt5Quick_FOUND AND Qt5Widgets_FOUND)
qml/GridBrowserDelegate.qml
qml/ListBrowserView.qml
qml/ListBrowserDelegate.qml
qml/FileBrowserView.qml
qml/ScrollHelper.qml
qml/FlatButtonWithToolTip.qml
qml/HeaderFooterToolbar.qml
......
......@@ -317,15 +317,6 @@ RowLayout {
}
}
Component {
id: filesBrowserView
FileBrowserView {
StackView.onActivated: viewManager.viewIsLoaded()
expandedFilterView: showExpandedFilterView
}
}
Component {
id: albumContext
......
/*
SPDX-FileCopyrightText: 2016 (c) Matthieu Gallien <matthieu_gallien@yahoo.fr>
SPDX-FileCopyrightText: 2018 (c) Alexander Stippich <a.stippich@gmx.net>
SPDX-License-Identifier: LGPL-3.0-or-later
*/
import QtQuick 2.7
import QtQuick.Controls 2.2
import QtQml.Models 2.2
import QtQuick.Layouts 1.2
import org.kde.kirigami 2.5 as Kirigami
import org.kde.elisa 1.0
FocusScope {
id: fileView
property bool isSubPage: false
property alias expandedFilterView: navigationBar.expandedFilterView
function goBack() {
proxyModel.openParentFolder()
}
function loadFolderAndClear(data) {
proxyModel.openFolder(data)
navigationBar.filterText = ""
}
FileBrowserModel {
id: realModel
}
FileBrowserProxyModel {
id: proxyModel
sourceModel: realModel
playList: elisa.mediaPlayListProxyModel
}
MouseArea {
anchors.fill: parent
hoverEnabled: false
acceptedButtons: Qt.BackButton
onClicked: proxyModel.openParentFolder()
}
ColumnLayout {
anchors.fill: parent
spacing: 0
NavigationActionBar {
id: navigationBar
mainTitle: i18nc("Title of the file browser view", "Files")
image: elisaTheme.folderIcon
secondaryTitle: proxyModel.url
enableGoBack: proxyModel.canGoBack
sortOrder: proxyModel.sortedAscending
showRating: false
Layout.fillWidth: true
Binding {
target: proxyModel
property: 'filterText'
value: navigationBar.filterText
}
onEnqueue: proxyModel.enqueueToPlayList()
onReplaceAndPlay: proxyModel.replaceAndPlayOfPlayList()
onGoBack: proxyModel.openParentFolder()
onSort: proxyModel.sortModel(order)
}
Rectangle {
color: myPalette.base
Layout.fillHeight: true
Layout.fillWidth: true
clip: true
GridView {
id: contentDirectoryView
anchors.fill: parent
activeFocusOnTab: true
keyNavigationEnabled: true
ScrollBar.vertical: ScrollBar {
id: scrollBar
}
boundsBehavior: Flickable.StopAtBounds
currentIndex: -1
Accessible.role: Accessible.List
Accessible.name: proxyModel.url
model: proxyModel
ScrollHelper {
id: scrollHelper
flickable: contentDirectoryView
anchors.fill: contentDirectoryView
}
add: Transition {
PropertyAnimation {
property: "opacity"
from: 0
to: 1
duration: Kirigami.Units.shortDuration
}
}
remove: Transition {
PropertyAnimation {
property: "opacity"
from: 0
to: 1
duration: Kirigami.Units.shortDuration
}
}
cellWidth: Math.floor(availableWidth / Math.max(Math.floor(availableWidth / elisaTheme.gridDelegateSize), 2))
cellHeight: elisaTheme.gridDelegateSize + Kirigami.Units.gridUnit * 2 + Kirigami.Units.largeSpacing
delegate: GridBrowserDelegate {
width: elisaTheme.gridDelegateSize
height: contentDirectoryView.cellHeight
focus: true
isSelected: contentDirectoryView.currentIndex === index
mainText: model.name
delegateDisplaySecondaryText: false
fileUrl: model.fileUrl
entryType: ElisaUtils.FileName
imageUrl: model.imageUrl
showDetailsButton: !model.isDirectory && !model.isPlaylist
showEnqueueButton: !model.isPlaylist
showPlayButton: true
onEnqueue: {
if (model.isDirectory) {
elisa.mediaPlayListProxyModel.enqueueDirectory(model.fileUrl, ElisaUtils.FileName, ElisaUtils.AppendPlayList, ElisaUtils.DoNotTriggerPlay, 10)
} else if (model.isPlaylist) {
elisa.mediaPlayListProxyModel.loadPlayList(model.fileUrl)
} else {
elisa.mediaPlayListProxyModel.enqueue(model.fileUrl, ElisaUtils.AppendPlayList, ElisaUtils.DoNotTriggerPlay)
}
}
onReplaceAndPlay: {
if (model.isDirectory) {
elisa.mediaPlayListProxyModel.enqueueDirectory(model.fileUrl, ElisaUtils.FileName, ElisaUtils.ReplacePlayList, ElisaUtils.TriggerPlay, 10)
} else if (model.isPlaylist) {
elisa.mediaPlayListProxyModel.loadPlayList(model.fileUrl)
} else {
elisa.mediaPlayListProxyModel.enqueue(model.fileUrl, ElisaUtils.ReplacePlayList, ElisaUtils.TriggerPlay)
}
}
onSelected: {
forceActiveFocus()
contentDirectoryView.currentIndex = model.index
}
onActiveFocusChanged: {
if (activeFocus && contentDirectoryView.currentIndex !== model.index) {
contentDirectoryView.currentIndex = model.index
}
}
onOpen: isDirectory ? loadFolderAndClear(model.fileUrl) : elisa.mediaPlayListProxyModel.enqueue(model.fileUrl, ElisaUtils.AppendPlayList, ElisaUtils.DoNotTriggerPlay)
}
}
}
}
}
......@@ -20,7 +20,6 @@
<file>qml/GridBrowserDelegate.qml</file>
<file>qml/ListBrowserView.qml</file>
<file>qml/ListBrowserDelegate.qml</file>
<file>qml/FileBrowserView.qml</file>
<file>qtquickcontrols2.conf</file>
<file>background.png</file>
<file>qml/BaseTheme.qml</file>
......
......@@ -262,12 +262,6 @@ void ViewManager::openViewFromData(const ViewParameters &viewParamaters)
viewParamaters.mAlbumCardinality, viewParamaters.mAlbumViewStyle, viewParamaters.mRadioSpecificStyle,
viewParamaters.mIsTreeModel, viewParamaters.mPathFilter);
break;
case ViewPresentationType::FileBrowserView:
qCDebug(orgKdeElisaViews()) << "ViewManager::openViewFromData" << viewParamaters.mViewPresentationType
<< viewParamaters.mDepth << viewParamaters.mMainTitle
<< viewParamaters.mMainImage;
Q_EMIT switchFilesBrowserView(viewParamaters.mDepth, viewParamaters.mMainTitle, viewParamaters.mMainImage);
break;
case ContextView:
qCDebug(orgKdeElisaViews()) << "ViewManager::openViewFromData" << viewParamaters.mViewPresentationType
<< viewParamaters.mDepth << viewParamaters.mMainTitle
......
......@@ -74,7 +74,6 @@ public:
ContextView,
GridView,
ListView,
FileBrowserView,
UnknownViewPresentation,
};
......
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