Changeset View
Changeset View
Standalone View
Standalone View
applets/clipboard/contents/ui/ClipboardPage.qml
Show First 20 Lines • Show All 96 Lines • ▼ Show 20 Line(s) | 28 | ColumnLayout { | |||
---|---|---|---|---|---|
97 | 97 | | |||
98 | Menu { | 98 | Menu { | ||
99 | id: clipboardMenu | 99 | id: clipboardMenu | ||
100 | model: PlasmaCore.SortFilterModel { | 100 | model: PlasmaCore.SortFilterModel { | ||
101 | sourceModel: clipboardSource.models.clipboard | 101 | sourceModel: clipboardSource.models.clipboard | ||
102 | filterRole: "DisplayRole" | 102 | filterRole: "DisplayRole" | ||
103 | filterRegExp: filter.text | 103 | filterRegExp: filter.text | ||
104 | } | 104 | } | ||
105 | supportsBarcodes: clipboardSource.data["clipboard"]["supportsBarcodes"] | 105 | supportsBarcodes: { | ||
106 | try { | ||||
107 | let prisonTest = Qt.createQmlObject("import QtQml 2.0; import org.kde.prison 1.0; QtObject {}", this); | ||||
108 | prisonTest.destroy(); | ||||
109 | } catch (e) { | ||||
110 | console.log("Barcodes not supported:", e); | ||||
111 | return false; | ||||
112 | } | ||||
113 | return true; | ||||
114 | } | ||||
106 | Layout.fillWidth: true | 115 | Layout.fillWidth: true | ||
107 | Layout.fillHeight: true | 116 | Layout.fillHeight: true | ||
108 | Layout.topMargin: units.smallSpacing | 117 | Layout.topMargin: units.smallSpacing | ||
109 | onItemSelected: clipboardSource.service(uuid, "select") | 118 | onItemSelected: clipboardSource.service(uuid, "select") | ||
110 | onRemove: clipboardSource.service(uuid, "remove") | 119 | onRemove: clipboardSource.service(uuid, "remove") | ||
111 | onEdit: clipboardSource.edit(uuid) | 120 | onEdit: clipboardSource.edit(uuid) | ||
112 | onBarcode: { | 121 | onBarcode: { | ||
113 | var page = stack.push(barcodePage); | 122 | stack.push(barcodePage, { | ||
114 | page.show(uuid); | 123 | text: text | ||
124 | }); | ||||
115 | } | 125 | } | ||
116 | onAction: { | 126 | onAction: { | ||
117 | clipboardSource.service(uuid, "action") | 127 | clipboardSource.service(uuid, "action") | ||
118 | clipboardMenu.view.currentIndex = 0 | 128 | clipboardMenu.view.currentIndex = 0 | ||
119 | } | 129 | } | ||
120 | } | 130 | } | ||
121 | } | 131 | } |