Changeset View
Changeset View
Standalone View
Standalone View
applets/taskmanager/package/contents/ui/main.qml
Context not available. | |||||
57 | signal windowsHovered(variant winIds, bool hovered) | 57 | signal windowsHovered(variant winIds, bool hovered) | ||
---|---|---|---|---|---|
58 | signal presentWindows(variant winIds) | 58 | signal presentWindows(variant winIds) | ||
59 | 59 | | |||
60 | readonly property var placesPreferences: { | ||||
61 | var preferences = {} | ||||
62 | | ||||
63 | var preferencesConfig = plasmoid.configuration.placesPreferences | ||||
64 | if (preferencesConfig) { | ||||
65 | try { | ||||
66 | preferences = JSON.parse(preferencesConfig) | ||||
67 | } catch (e) { | ||||
68 | console.warn("Failed to parse Task Manager places preferencesConfig", e) | ||||
69 | } | ||||
70 | } | ||||
71 | | ||||
72 | return preferences | ||||
73 | } | ||||
74 | | ||||
60 | onWidthChanged: { | 75 | onWidthChanged: { | ||
61 | taskList.width = LayoutManager.layoutWidth(); | 76 | taskList.width = LayoutManager.layoutWidth(); | ||
62 | 77 | | |||
Context not available. | |||||
176 | onAddLauncher: { | 191 | onAddLauncher: { | ||
177 | tasks.addLauncher(url); | 192 | tasks.addLauncher(url); | ||
178 | } | 193 | } | ||
194 | | ||||
195 | onTrackPlaceLaunch: { | ||||
196 | var stringUrl = url.toString() | ||||
197 | if (!stringUrl) { | ||||
198 | return | ||||
199 | } | ||||
200 | | ||||
201 | var preferences = placesPreferences | ||||
202 | preferences[stringUrl] = (preferences[stringUrl] || 0) + 1 | ||||
203 | plasmoid.configuration.placesPreferences = JSON.stringify(preferences) | ||||
204 | } | ||||
179 | } | 205 | } | ||
180 | 206 | | |||
181 | PlasmaCore.DataSource { | 207 | PlasmaCore.DataSource { | ||
Context not available. | |||||
404 | dragSource = null; | 430 | dragSource = null; | ||
405 | } | 431 | } | ||
406 | 432 | | |||
407 | function createContextMenu(task) { | 433 | function createContextMenu(task, args) { | ||
408 | var menu = tasks.contextMenuComponent.createObject(task); | 434 | var initialArgs = args || {} | ||
409 | menu.visualParent = task; | 435 | initialArgs.visualParent = task; | ||
410 | menu.mpris2Source = mpris2Source; | 436 | initialArgs.mpris2Source = mpris2Source; | ||
411 | return menu; | 437 | initialArgs.placesPreferences = tasks.placesPreferences; | ||
438 | initialArgs.backend = backend | ||||
439 | return tasks.contextMenuComponent.createObject(task, initialArgs); | ||||
412 | } | 440 | } | ||
413 | 441 | | |||
414 | Component.onCompleted: { | 442 | Component.onCompleted: { | ||
Context not available. |