/usr/share/kde4/apps/plasma/plasmoids/org.kde.active.systemtray/contents/ui/main.qml is in plasma-widgets-active 2.0+git2012021101-0ubuntu4~ppa3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | /*
* Copyright 2011 Marco Martin <mart@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import Qt 4.7
import org.kde.plasma.core 0.1 as PlasmaCore
import org.kde.qtextracomponents 0.1 as QtExtra
import "plasmapackage:/code/LayoutManager.js" as LayoutManager
Item {
id: main
signal shrinkRequested
state: height>48?"active":"passive"
Component.onCompleted: {
plasmoid.drawWallpaper = false
plasmoid.containmentType = "CustomContainment"
plasmoid.movableApplets = false
plasmoid.appletAdded.connect(addApplet)
appletsOrder = plasmoid.readConfig("AppletsOrder")
//array with all the applet ids, in order
var appletIds = Array()
if (appletsOrder.length > 0) {
appletIds = appletsOrder.split(":")
}
//all applets loaded, indicized by id
var appletsForId = new Array()
//fill appletsForId
for (var i = 0; i < plasmoid.applets.length; ++i) {
var applet = plasmoid.applets[i]
appletsForId[applet.id] = applet
}
//add applets present in AppletsOrder
for (var i = 0; i < appletIds.length; ++i) {
var id = appletIds[i]
var applet = appletsForId[id]
if (applet) {
addApplet(applet, Qt.point(-1,-1));
//discard it, so will be easy to find out who wasn't in the series
appletsForId[id] = null
}
}
for (var id in appletsForId) {
var applet = appletsForId[id]
if (applet) {
addApplet(applet, Qt.point(-1,-1));
}
}
plasmoid.appletAdded.connect(addApplet)
LayoutManager.saveOrder()
}
function addApplet(applet, pos)
{
var component = Qt.createComponent("PlasmoidContainer.qml")
if (applet.pluginName == "org.kde.sharelikeconnect") {
var plasmoidContainer = component.createObject(rightPanel);
plasmoidContainer.parent = rightPanel
plasmoidContainer.anchors.top = rightPanel.top
plasmoidContainer.anchors.bottom = rightPanel.bottom
plasmoidContainer.applet = applet
return
} else if (applet.pluginName == "digital-clock") {
var plasmoidContainer = component.createObject(rightPanel);
plasmoidContainer.parent = centerPanel
plasmoidContainer.anchors.top = centerPanel.top
plasmoidContainer.anchors.bottom = centerPanel.bottom
plasmoidContainer.applet = applet
return
}
var plasmoidContainer = component.createObject(tasksRow, {"x": pos.x, "y": pos.y});
var index = tasksRow.children.length
if (pos.x >= 0) {
//FIXME: this assumes items are square
index = pos.x/main.height
}
tasksRow.insertAt(plasmoidContainer, index)
plasmoidContainer.anchors.top = tasksRow.top
plasmoidContainer.anchors.bottom = tasksRow.bottom
plasmoidContainer.applet = applet
}
PlasmaCore.DataSource {
id: statusNotifierSource
engine: "statusnotifieritem"
interval: 0
onSourceAdded: {
connectSource(source)
}
Component.onCompleted: {
connectedSources = sources
}
}
PlasmaCore.Theme {
id: theme
}
PlasmaCore.DataSource {
id: timeEngine
engine: "time"
interval: 30000
connectedSources: ["Local"]
}
Item {
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
Flickable {
id: tasksFlickable
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.left: parent.left
interactive:true
contentWidth: tasksRow.width
contentHeight: tasksRow.height
width: Math.min(parent.width, tasksRow.width)
Row {
id: tasksRow
spacing: 8
height: tasksFlickable.height
property string skipItems
function insertAt(item, index)
{
LayoutManager.insertAt(item, index)
}
function remove(item)
{
LayoutManager.remove(item)
}
function saveOrder()
{
LayoutManager.saveOrder()
}
Repeater {
id: tasksRepeater
model: PlasmaCore.SortFilterModel {
id: filteredStatusNotifiers
filterRole: "Title"
filterRegExp: tasksRow.skipItems
sourceModel: PlasmaCore.DataModel {
dataSource: statusNotifierSource
}
}
delegate: TaskWidget {
}
}
Component.onCompleted: {
items = plasmoid.readConfig("SkipItems")
if (items != "") {
skipItems = "^(?!" + items + ")"
} else {
skipItems = ""
}
}
}
}
Row {
id: centerPanel
anchors {
top: parent.top
bottom: parent.bottom
horizontalCenter: parent.horizontalCenter
}
}
Row {
id: rightPanel
anchors {
top: parent.top
bottom: parent.bottom
right: parent.right
rightMargin: 8
}
}
}
}
|