mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-30 17:42:06 -04:00
dock: add trash bin button (#2277)
* dock: add trash bin button - icon reflects content- filled/empty - multiple file manager support with nautilus as default, builtin as fallback - settingsspec at dock tab - context menu * fix: remove support for builtin filebrowser needs specific adaptors at FB adhering the trash freedesktop spec * fix: suppress auto-hide dock with trash context menu open * feat: allow for custom file manager command * feat: switch runner to proc.runcommand with toasts on command failures
This commit is contained in:
@@ -4,6 +4,7 @@ import qs.Common
|
||||
import qs.Modals
|
||||
import qs.Modals.Changelog
|
||||
import qs.Modals.Clipboard
|
||||
import qs.Modals.Common
|
||||
import qs.Modals.Greeter
|
||||
import qs.Modals.Settings
|
||||
import qs.Modals.DankLauncherV2
|
||||
@@ -284,11 +285,15 @@ Item {
|
||||
|
||||
sourceComponent: Dock {
|
||||
contextMenu: dockContextMenuLoader.item ? dockContextMenuLoader.item : null
|
||||
trashContextMenu: dockTrashContextMenuLoader.item ? dockTrashContextMenuLoader.item : null
|
||||
}
|
||||
|
||||
onLoaded: {
|
||||
if (item) {
|
||||
dockContextMenuLoader.active = true;
|
||||
if (SettingsData.dockShowTrash) {
|
||||
dockTrashContextMenuLoader.active = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -340,6 +345,43 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
LazyLoader {
|
||||
id: dockTrashContextMenuLoader
|
||||
|
||||
active: false
|
||||
|
||||
DockTrashContextMenu {
|
||||
id: dockTrashContextMenu
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: SettingsData
|
||||
function onDockShowTrashChanged() {
|
||||
if (SettingsData.dockShowTrash) {
|
||||
dockTrashContextMenuLoader.active = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ConfirmModal {
|
||||
id: emptyTrashConfirm
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: TrashService
|
||||
function onEmptyTrashConfirmRequested(itemCount) {
|
||||
emptyTrashConfirm.showWithOptions({
|
||||
title: I18n.tr("Empty Trash?"),
|
||||
message: I18n.tr("Permanently delete %1 item(s)? This cannot be undone.").arg(itemCount),
|
||||
confirmText: I18n.tr("Empty"),
|
||||
cancelText: I18n.tr("Cancel"),
|
||||
confirmColor: Theme.error,
|
||||
onConfirm: () => TrashService.emptyTrash()
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
LazyLoader {
|
||||
id: notificationCenterLoader
|
||||
|
||||
|
||||
Reference in New Issue
Block a user