diff --git a/plasmoid/contents/ui/main-kf5.qml b/plasmoid/contents/ui/main-kf5.qml index e016a65..8f374fe 100644 --- a/plasmoid/contents/ui/main-kf5.qml +++ b/plasmoid/contents/ui/main-kf5.qml @@ -25,6 +25,17 @@ Item { } } + FileDialog { + id: newSessionFolderDialog + title: "Choose working directory for new session" + selectFolder: true + folder: dbus.activeCwd ? "file://" + dbus.activeCwd : shortcuts.home + onAccepted: { + var path = fileUrl.toString().replace("file://", "") + dbus.createSession(path) + } + } + Plasmoid.status: dbus.sessions.length > 0 ? PlasmaCore.Types.ActiveStatus : PlasmaCore.Types.PassiveStatus @@ -115,7 +126,7 @@ Item { PlasmaComponents.ToolButton { icon.name: "list-add" - onClicked: dbus.createSession("") + onClicked: newSessionFolderDialog.open() PlasmaComponents.ToolTip { text: "New session" } } }