/*SPDX-FileCopyrightText: 2020 Tobias Fella <fella@posteo.de>SPDX-License-Identifier: GPL-2.0-or-later*/import QtQuickimport QtQuick.Layoutsimport QtQuick.Controls as QQC2import org.kde.kirigami as Kirigamiimport org.kde.kcmutils as KCMKCM.SimpleKCM {id: rootfunction unsupportedMimeText(kcm_component) {return i18n("β%1β seems to not support the following mimetypes associated with this kind of application: %2", kcm_component.applications[kcm_component.index]["name"], kcm_component.unsupportedMimeTypes.join(", "))}topPadding: 0bottomPadding: Kirigami.Units.gridUnitComponentOverlay {id: overlayparent: root.QQC2.Overlay.overlaywidth: Math.min(root.width, Kirigami.Units.gridUnit * 25)}component MimeMessage: Kirigami.InlineMessage {property var componentChooserLayout.fillWidth: truevisible: componentChooser.unsupportedMimeTypes.length > 0 || componentChooser.mimeTypesNotAssociated.length > 0type: Kirigami.MessageType.Warningtext: i18nc("@info:status", "This application may not be able to open all file types.");actions: Kirigami.Action {text: i18nc("@action:button", "View Details")onTriggered: {overlay.componentChooser = componentChooseroverlay.open()}}}Kirigami.FormLayout {id: formreadonly property int longestComboBox: Math.max(browserCombo.implicitWidth,fileManagerCombo.implicitWidth,textEditorCombo.implicitWidth,pdfViewerCombo.implicitWidth,imageViewerCombo.implicitWidth,musicPlayerCombo.implicitWidth,videoPlayerCombo.implicitWidth,emailCombo.implicitWidth,archiveCombo.implicitWidth,terminalCombo.implicitWidth,mapCombo.implicitWidth,dialerCombo.implicitWidth)Item {Kirigami.FormData.label: i18nc("Internet related applicationβs categoryβs name", "Internet")Kirigami.FormData.isSection: true}ComponentComboBox {id: browserComboKirigami.FormData.label: i18n("Web browser:")component: kcm.browsersLayout.preferredWidth: form.longestComboBoxKCM.SettingHighlighter {highlight: !kcm.browsers.isDefaults}}MimeMessage {componentChooser: kcm.browsers}ComponentComboBox {id: emailComboKirigami.FormData.label: i18n("Email client:")Layout.preferredWidth: form.longestComboBoxcomponent: kcm.emailClientsKCM.SettingHighlighter {highlight: !kcm.emailClients.isDefaults}}MimeMessage {componentChooser: kcm.emailClients}ComponentComboBox {id: dialerComboKirigami.FormData.label: i18nc("Default phone app", "Phone Numbers:")Layout.preferredWidth: form.longestComboBoxcomponent: kcm.telUriHandlersKCM.SettingHighlighter {highlight: !kcm.telUriHandlers.isDefaults}}MimeMessage {componentChooser: kcm.telUriHandlers}Item {Kirigami.FormData.label: i18nc("Multimedia related applicationβs categoryβs name", "Multimedia")Kirigami.FormData.isSection: true}ComponentComboBox {id: imageViewerComboKirigami.FormData.label: i18n("Image viewer:")Layout.preferredWidth: form.longestComboBoxcomponent: kcm.imageViewersKCM.SettingHighlighter {highlight: !kcm.imageViewers.isDefaults}}MimeMessage {componentChooser: kcm.imageViewers}ComponentComboBox {id: musicPlayerComboKirigami.FormData.label: i18n("Music player:")Layout.preferredWidth: form.longestComboBoxcomponent: kcm.musicPlayersKCM.SettingHighlighter {highlight: !kcm.musicPlayers.isDefaults}}MimeMessage {componentChooser: kcm.musicPlayers}ComponentComboBox {id: videoPlayerComboKirigami.FormData.label: i18n("Video player:")Layout.preferredWidth: form.longestComboBoxcomponent: kcm.videoPlayersKCM.SettingHighlighter {highlight: !kcm.videoPlayers.isDefaults}}MimeMessage {componentChooser: kcm.videoPlayers}Item {Kirigami.FormData.label: i18nc("Documents related applicationβs categoryβs name", "Documents")Kirigami.FormData.isSection: true}ComponentComboBox {id: textEditorComboKirigami.FormData.label: i18n("Text editor:")Layout.preferredWidth: form.longestComboBoxcomponent: kcm.textEditorsKCM.SettingHighlighter {highlight: !kcm.textEditors.isDefaults}}MimeMessage {componentChooser: kcm.textEditors}ComponentComboBox {id: pdfViewerComboKirigami.FormData.label: i18n("PDF viewer:")Layout.preferredWidth: form.longestComboBoxcomponent: kcm.pdfViewersKCM.SettingHighlighter {highlight: !kcm.pdfViewers.isDefaults}}MimeMessage {componentChooser: kcm.pdfViewers}Item {Kirigami.FormData.label: i18nc("Utilities related applicationβs categoryβs name", "Utilities")Kirigami.FormData.isSection: true}ComponentComboBox {id: fileManagerComboKirigami.FormData.label: i18n("File manager:")Layout.preferredWidth: form.longestComboBoxcomponent: kcm.fileManagersKCM.SettingHighlighter {highlight: !kcm.fileManagers.isDefaults}}MimeMessage {componentChooser: kcm.fileManagers}ComponentComboBox {id: terminalComboKirigami.FormData.label: i18n("Terminal emulator:")Layout.preferredWidth: form.longestComboBoxcomponent: kcm.terminalEmulatorsKCM.SettingHighlighter {highlight: !kcm.terminalEmulators.isDefaults}}MimeMessage {componentChooser: kcm.terminalEmulators}ComponentComboBox {id: archiveComboKirigami.FormData.label: i18n("Archive manager:")Layout.preferredWidth: form.longestComboBoxcomponent: kcm.archiveManagersKCM.SettingHighlighter {highlight: !kcm.archiveManagers.isDefaults}}MimeMessage {componentChooser: kcm.archiveManagers}ComponentComboBox {id: mapComboKirigami.FormData.label: i18nc("Map related applicationβs categoryβs name", "Map:")Layout.preferredWidth: form.longestComboBoxcomponent: kcm.geoUriHandlersKCM.SettingHighlighter {highlight: !kcm.geoUriHandlers.isDefaults}}MimeMessage {componentChooser: kcm.geoUriHandlers}}}