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,65 @@ checked: kcm.fileContents onCheckStateChanged: kcm.fileContents = checked } + Item { Layout.preferredHeight: Kirigami.Units.gridUnit } + + // Current status + suspend/resume button + RowLayout { + Layout.fillWidth: true + + visible: fileSearchEnabled.checked + + QQC2.Label { + text: i18n("Indexer State: %1", monitor.stateString) + } + + QQC2.Button { + id: toggleButton + text: monitor.state == Baloo.Suspended ? i18n("Resume") : i18n("Suspend") + onClicked: monitor.toggleSuspendState() + } + } + + // Current status, if indexing + ColumnLayout { + Layout.fillWidth: true + Layout.leftMargin: Kirigami.Units.largeSpacing * 2 + Layout.rightMargin: Kirigami.Units.largeSpacing * 2 + + visible: fileSearchEnabled.checked && monitor.state != Baloo.Idle && monitor.state != Baloo.LowPowerIdle + + QQC2.ProgressBar { + id: progress + Layout.fillWidth: true + + to: monitor.totalFiles + value: monitor.filesIndexed + } + + QQC2.Label { + id: filePath + + Layout.fillWidth: true + + elide: Text.ElideMiddle + text: { + if (monitor.state == Baloo.ContentIndexing) { + return i18n("Currently indexing: %1", monitor.filePath) + } else { + return "" + } + } + } + } + + Item { + Layout.preferredHeight: Kirigami.Units.gridUnit + visible: fileSearchEnabled.checked + } + QQC2.Label { text: i18n("Do not search in these locations:") }