Add config pages: ConfigHosts + ConfigGeneral
Host manager (add/edit/remove Synology/SMB hosts) that stores non-secret fields as JSON and writes passwords to KWallet via kwallet-query; general page for default mount folder, SMB version, mount options and permissions. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls as QQC2
|
||||
import QtQuick.Layouts
|
||||
import org.kde.kcmutils as KCM
|
||||
import org.kde.kirigami as Kirigami
|
||||
|
||||
KCM.SimpleKCM {
|
||||
id: page
|
||||
|
||||
// Bound automatically by the Plasma config framework (main.xml keys).
|
||||
property alias cfg_defaultMountRoot: mountRootField.text
|
||||
property alias cfg_smbVersion: smbVersionField.editText
|
||||
property alias cfg_mountOptions: mountOptionsField.text
|
||||
property alias cfg_fileMode: fileModeField.text
|
||||
property alias cfg_dirMode: dirModeField.text
|
||||
|
||||
Kirigami.FormLayout {
|
||||
|
||||
QQC2.TextField {
|
||||
id: mountRootField
|
||||
Kirigami.FormData.label: i18n("Default mount folder:")
|
||||
placeholderText: i18n("Leave empty for ~/NAS")
|
||||
Layout.minimumWidth: Kirigami.Units.gridUnit * 16
|
||||
}
|
||||
QQC2.Label {
|
||||
Kirigami.FormData.isSection: false
|
||||
text: i18n("Shares mount under <mount folder>/<host>/<share>.")
|
||||
font: Kirigami.Theme.smallFont
|
||||
opacity: 0.7
|
||||
}
|
||||
|
||||
Item { Kirigami.FormData.isSection: true }
|
||||
|
||||
QQC2.ComboBox {
|
||||
id: smbVersionField
|
||||
Kirigami.FormData.label: i18n("SMB protocol version:")
|
||||
editable: true
|
||||
model: ["default", "3.1.1", "3.0", "2.1", "1.0"]
|
||||
}
|
||||
QQC2.Label {
|
||||
text: i18n("Passed to mount.cifs as vers=. Use 3.1.1 or 3.0 for modern Synology DSM.")
|
||||
font: Kirigami.Theme.smallFont
|
||||
opacity: 0.7
|
||||
wrapMode: Text.WordWrap
|
||||
Layout.maximumWidth: Kirigami.Units.gridUnit * 20
|
||||
}
|
||||
|
||||
Item { Kirigami.FormData.isSection: true }
|
||||
|
||||
QQC2.TextField {
|
||||
id: mountOptionsField
|
||||
Kirigami.FormData.label: i18n("Extra mount options:")
|
||||
placeholderText: "iocharset=utf8"
|
||||
Layout.minimumWidth: Kirigami.Units.gridUnit * 16
|
||||
}
|
||||
QQC2.TextField {
|
||||
id: fileModeField
|
||||
Kirigami.FormData.label: i18n("File permission mode:")
|
||||
inputMask: "0999"
|
||||
Layout.maximumWidth: Kirigami.Units.gridUnit * 6
|
||||
}
|
||||
QQC2.TextField {
|
||||
id: dirModeField
|
||||
Kirigami.FormData.label: i18n("Folder permission mode:")
|
||||
inputMask: "0999"
|
||||
Layout.maximumWidth: Kirigami.Units.gridUnit * 6
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user