KWinRules KCM Redesign
Summary:
Replacement KCM to configure kwin rules, using a QML-based UI.
After some work on the task T12729, it is almost feature-par with the previous module, and adapted to the recent move to KConfigXT.
Test Plan:
{F8208046}
{F8208047}
Reviewers: #plasma, #kwin, #vdg, ngraham, davidedmundson, zzag
Reviewed By: #plasma, #kwin, #vdg, ngraham, davidedmundson, zzag
Subscribers: ngraham, davidedmundson, hchain, broulik, zzag, kwin
Tags: #kwin, #vdg
Differential Revision: https://phabricator.kde.org/D28152
2020-04-20 20:01:55 +00:00
|
|
|
/*
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-FileCopyrightText: 2020 Ismael Asensio <isma.af@gmail.com>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
|
|
|
*/
|
KWinRules KCM Redesign
Summary:
Replacement KCM to configure kwin rules, using a QML-based UI.
After some work on the task T12729, it is almost feature-par with the previous module, and adapted to the recent move to KConfigXT.
Test Plan:
{F8208046}
{F8208047}
Reviewers: #plasma, #kwin, #vdg, ngraham, davidedmundson, zzag
Reviewed By: #plasma, #kwin, #vdg, ngraham, davidedmundson, zzag
Subscribers: ngraham, davidedmundson, hchain, broulik, zzag, kwin
Tags: #kwin, #vdg
Differential Revision: https://phabricator.kde.org/D28152
2020-04-20 20:01:55 +00:00
|
|
|
|
|
|
|
import QtQuick 2.14
|
|
|
|
import QtQuick.Dialogs 1.0 as QtDialogs
|
|
|
|
|
|
|
|
Loader {
|
|
|
|
id: root
|
|
|
|
active: false
|
|
|
|
|
|
|
|
property string title : i18n("Select File");
|
|
|
|
property string lastFolder : ""
|
|
|
|
property bool isSaveDialog : false
|
|
|
|
|
|
|
|
signal fileSelected(string path)
|
|
|
|
|
|
|
|
sourceComponent: QtDialogs.FileDialog {
|
|
|
|
id: fileDialog
|
|
|
|
|
|
|
|
title: root.title
|
|
|
|
selectExisting: !root.isSaveDialog
|
2020-05-15 09:00:09 +00:00
|
|
|
folder: root.lastFolder || shortcuts.home
|
KWinRules KCM Redesign
Summary:
Replacement KCM to configure kwin rules, using a QML-based UI.
After some work on the task T12729, it is almost feature-par with the previous module, and adapted to the recent move to KConfigXT.
Test Plan:
{F8208046}
{F8208047}
Reviewers: #plasma, #kwin, #vdg, ngraham, davidedmundson, zzag
Reviewed By: #plasma, #kwin, #vdg, ngraham, davidedmundson, zzag
Subscribers: ngraham, davidedmundson, hchain, broulik, zzag, kwin
Tags: #kwin, #vdg
Differential Revision: https://phabricator.kde.org/D28152
2020-04-20 20:01:55 +00:00
|
|
|
nameFilters: [ i18n("KWin Rules (*.kwinrule)") ]
|
|
|
|
defaultSuffix: "*.kwinrule"
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
open();
|
|
|
|
}
|
|
|
|
|
|
|
|
onAccepted: {
|
|
|
|
root.lastFolder = folder;
|
|
|
|
if (fileUrl != "") {
|
|
|
|
root.fileSelected(fileUrl);
|
|
|
|
}
|
|
|
|
root.active = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
onRejected: {
|
|
|
|
root.active = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|