/usr/share/kde4/apps/plasma/plasmoids/konsoleprofiles/contents/ui/konsoleprofiles.qml is in plasma-widgets-addons 4:4.13.0-0ubuntu1.
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 | /*****************************************************************************
* Copyright (C) 2011, 2012 by Shaun Reich <shaun.reich@kdemail.net> *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation; either version 2 of *
* the License, 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 General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
import QtQuick 1.1
import org.kde.qtextracomponents 0.1
import org.kde.plasma.core 0.1 as PlasmaCore
import org.kde.plasma.components 0.1 as PlasmaComponents
Item {
id: konsoleProfiles
property int minimumWidth: 200
property int minimumHeight: 300
function popupEventSlot(shown) {
if(shown)
view.forceActiveFocus();
}
PlasmaCore.DataSource {
id: profilesSource
engine: "org.kde.konsoleprofiles"
onSourceAdded: connectSource(source)
onSourceRemoved: disconnectSource(source)
Component.onCompleted: connectedSources = sources
}
PlasmaCore.SortFilterModel {
id: profilesModel
sortRole: "prettyName"
sortOrder: "AscendingOrder"
sourceModel: PlasmaCore.DataModel {
dataSource: profilesSource
}
}
Component.onCompleted: {
plasmoid.popupIcon = "utilities-terminal";
plasmoid.aspectRatioMode = IgnoreAspectRatio;
plasmoid.popupEvent.connect('popupEvent', popupEventSlot);
}
PlasmaCore.Svg {
id: lineSvg
imagePath: "widgets/line"
}
Row {
id: headerRow
anchors { left: parent.left; right: parent.right }
QIconItem {
id: appIcon
icon: QIcon("utilities-terminal")
width: 32
height: 32
}
PlasmaComponents.Label {
id: header
text: i18n("Konsole Profiles")
horizontalAlignment: Text.AlignHCenter | Text.AlignVCenter
width: parent.width - appIcon.width * 2
height: parent.height
}
}
PlasmaCore.SvgItem {
id: separator
anchors { left: headerRow.left; right: headerRow.right; top: headerRow.bottom }
svg: lineSvg
elementId: "horizontal-line"
height: lineSvg.elementSize("horizontal-line").height
}
Text {
id: textMetric
visible: false
// translated but not used, we just need length/height
text: i18n("Arbitrary String Which Says Something")
}
ListView {
id: view
anchors { left: parent.left; right: scrollBar.left; bottom: parent.bottom; top: separator.bottom; topMargin: 5 }
model: profilesModel
clip: true
focus: true
delegate: Item {
id: listdelegate
height: textMetric.paintedHeight * 2
anchors {
left: parent.left
right: parent.right
}
function openProfile() {
var service = profilesSource.serviceForSource(model["DataEngineSource"])
var operation = service.operationDescription("open")
var job = service.startOperationCall(operation)
}
PlasmaComponents.Label {
id: profileText
anchors {
verticalCenter: parent.verticalCenter
left: parent.left
right: parent.right
leftMargin: 10
rightMargin: 10
}
verticalAlignment: Text.AlignVCenter
text: model.prettyName
elide: Text.ElideRight
}
MouseArea {
height: parent.height + 15
anchors { left: parent.left; right: parent.right;}
hoverEnabled: true
onClicked: {
openProfile();
}
onEntered: {
view.currentIndex = index
view.highlightItem.opacity = 1
}
onExited: {
view.highlightItem.opacity = 0
}
}
Keys.onPressed: {
if (event.key == Qt.Key_Enter || event.key == Qt.Key_Return)
openProfile();
}
}
highlight: PlasmaComponents.Highlight {
hover: true
}
highlightMoveDuration: 250
highlightMoveSpeed: 1
}
PlasmaComponents.ScrollBar {
id: scrollBar
anchors { bottom: parent.bottom; top: separator.top; right: parent.right }
orientation: Qt.Vertical
stepSize: view.count / 4
scrollButtonInterval: view.count / 4
flickableItem: view
}
}
|