diff --git a/kcms/baloo/package/contents/ui/main.qml b/kcms/baloo/package/contents/ui/main.qml --- a/kcms/baloo/package/contents/ui/main.qml +++ b/kcms/baloo/package/contents/ui/main.qml @@ -22,6 +22,7 @@ import QtQuick.Layouts 1.1 import QtQuick.Controls 2.11 as QQC2 import QtQuick.Dialogs 1.2 as QtDialogs +import org.kde.baloo.experimental 0.1 as Baloo import org.kde.kirigami 2.4 as Kirigami import org.kde.kcm 1.1 as KCM @@ -31,6 +32,11 @@ implicitHeight: Kirigami.Units.gridUnit * 22 KCM.ConfigModule.quickHelp: i18n("This module lets you configure the file indexer and search functionality.") + + Baloo.Monitor { + id: monitor + } + ColumnLayout { anchors.fill: parent anchors.margins: Kirigami.Units.largeSpacing @@ -55,9 +61,70 @@ checked: kcm.fileContents onCheckStateChanged: kcm.fileContents = checked } + + Item { + Layout.preferredHeight: Kirigami.Units.gridUnit + } + + // Current status, if indexing + ColumnLayout { + Layout.fillWidth: true + + visible: fileSearchEnabled.checked + + + RowLayout { + Layout.alignment: Qt.AlignHCenter + QQC2.Label { + text: i18n("Status: %1, %2\% complete", monitor.stateString, Math.floor(monitor.filesIndexed / monitor.totalFiles * 100)) + } + + QQC2.Button { + text: monitor.state == Baloo.Baloo.Suspended ? i18n("Resume Indexer") : i18n("Pause Indexer") + onClicked: monitor.toggleSuspendState() + } + } + + QQC2.ProgressBar { + id: progressBar + Layout.fillWidth: true + + visible: switch(monitor.state) { + case Baloo.Baloo.FirstRun: + case Baloo.Baloo.NewFiles: + case Baloo.Baloo.ModifiedFiles: + case Baloo.Baloo.XAttrFiles: + case Baloo.Baloo.ContentIndexing: + case Baloo.Baloo.UnindexedFileCheck: + case Baloo.Baloo.StaleIndexEntriesClean: + return true; + break; + default: + return false; + break; + } + + to: monitor.totalFiles + value: monitor.filesIndexed + } + + QQC2.Label { + id: filePath + + Layout.fillWidth: true + + visible: text.length > 0 + + elide: Text.ElideMiddle + text: progressBar.visible ? i18n("Currently indexing: %1", monitor.filePath) : "" + } + } + Item { Layout.preferredHeight: Kirigami.Units.gridUnit + visible: fileSearchEnabled.checked } + QQC2.Label { text: i18n("Do not search in these locations:") }