Changeset View
Changeset View
Standalone View
Standalone View
Modules/fileindexermonitor/package/contents/ui/main.qml
Show All 16 Lines | |||||
17 | * | 17 | * | ||
18 | * You should have received a copy of the GNU Lesser General Public | 18 | * You should have received a copy of the GNU Lesser General Public | ||
19 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | 19 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
20 | * | 20 | * | ||
21 | */ | 21 | */ | ||
22 | 22 | | |||
23 | import QtQuick 2.4 | 23 | import QtQuick 2.4 | ||
24 | import QtQuick.Controls 1.3 | 24 | import QtQuick.Controls 1.3 | ||
25 | import QtQuick.Controls 2.0 as QQC2 | ||||
25 | import QtQuick.Layouts 1.1 | 26 | import QtQuick.Layouts 1.1 | ||
26 | 27 | | |||
27 | import org.kde.baloo.experimental 0.1 as Baloo | 28 | import org.kde.baloo.experimental 0.1 as Baloo | ||
28 | import "constants.js" as Constants | 29 | import "constants.js" as Constants | ||
29 | 30 | | |||
30 | Item { | 31 | Item { | ||
31 | id: mainWindow | 32 | id: mainWindow | ||
32 | 33 | | |||
33 | Baloo.Monitor { | 34 | Baloo.Monitor { | ||
34 | id: monitor | 35 | id: monitor | ||
35 | } | 36 | } | ||
36 | 37 | | |||
37 | ColumnLayout { | 38 | ColumnLayout { | ||
38 | anchors.top: parent.top | 39 | anchors.top: parent.top | ||
39 | anchors.left: parent.left | 40 | anchors.left: parent.left | ||
40 | anchors.right: parent.right | 41 | anchors.right: parent.right | ||
41 | anchors.margins: 20 | 42 | anchors.margins: 20 | ||
42 | spacing: 20 | 43 | spacing: 20 | ||
43 | visible: monitor.balooRunning | 44 | visible: monitor.balooRunning | ||
44 | 45 | | |||
45 | Label { | 46 | QQC2.Label { | ||
46 | id: indexerState | 47 | id: indexerState | ||
47 | text: i18n("Indexer State: %1", monitor.stateString) | 48 | text: i18n("Indexer State: %1", monitor.stateString) | ||
48 | } | 49 | } | ||
49 | 50 | | |||
50 | Label { | 51 | QQC2.Label { | ||
51 | id: filePath | 52 | id: filePath | ||
52 | 53 | | |||
53 | // Required so that text elides instead of expanding the entire layout | 54 | // Required so that text elides instead of expanding the entire layout | ||
54 | Layout.maximumWidth: parent.width | 55 | Layout.maximumWidth: parent.width | ||
55 | 56 | | |||
56 | width: parent.width | 57 | width: parent.width | ||
57 | elide: Text.ElideMiddle | 58 | elide: Text.ElideMiddle | ||
58 | 59 | | |||
Show All 22 Lines | 72 | RowLayout { | |||
81 | 82 | | |||
82 | Button { | 83 | Button { | ||
83 | id: toggleButton | 84 | id: toggleButton | ||
84 | text: monitor.state == Constants.State.Suspended ? i18n("Resume") : i18n("Suspend") | 85 | text: monitor.state == Constants.State.Suspended ? i18n("Resume") : i18n("Suspend") | ||
85 | onClicked: monitor.toggleSuspendState() | 86 | onClicked: monitor.toggleSuspendState() | ||
86 | } | 87 | } | ||
87 | } | 88 | } | ||
88 | 89 | | |||
89 | Label { | 90 | QQC2.Label { | ||
90 | visible: monitor.state == Constants.State.ContentIndexing | 91 | visible: monitor.state == Constants.State.ContentIndexing | ||
91 | id: remainingTime | 92 | id: remainingTime | ||
92 | text: i18n("Remaining Time: %1", monitor.remainingTime) | 93 | text: i18n("Remaining Time: %1", monitor.remainingTime) | ||
93 | } | 94 | } | ||
94 | } | 95 | } | ||
95 | 96 | | |||
96 | ColumnLayout { | 97 | ColumnLayout { | ||
97 | visible: !monitor.balooRunning | 98 | visible: !monitor.balooRunning | ||
98 | anchors.centerIn: parent | 99 | anchors.centerIn: parent | ||
99 | anchors.margins: 20 | 100 | anchors.margins: 20 | ||
100 | 101 | | |||
101 | spacing: 20 | 102 | spacing: 20 | ||
102 | 103 | | |||
103 | Label { | 104 | QQC2.Label { | ||
104 | Layout.fillWidth: true | 105 | Layout.fillWidth: true | ||
105 | horizontalAlignment: Text.AlignHCenter | 106 | horizontalAlignment: Text.AlignHCenter | ||
106 | text: i18n("File Indexer not running") | 107 | text: i18n("File Indexer not running") | ||
107 | } | 108 | } | ||
108 | 109 | | |||
109 | Button { | 110 | Button { | ||
110 | Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter | 111 | Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter | ||
111 | id: startBaloo | 112 | id: startBaloo | ||
112 | text: i18n("Start File Indexer") | 113 | text: i18n("Start File Indexer") | ||
113 | onClicked: monitor.startBaloo() | 114 | onClicked: monitor.startBaloo() | ||
114 | } | 115 | } | ||
115 | } | 116 | } | ||
116 | } | 117 | } |