Warning, /maui/mauikit-filebrowsing/src/controls.6/OpenWithDialog.qml is written in an unsupported language. File is not indexed.
0001 /*
0002 * <one line to give the program's name and a brief idea of what it does.>
0003 * Copyright (C) 2020 camilo <chiguitar@unal.edu.co>
0004 *
0005 * This program is free software: you can redistribute it and/or modify
0006 * it under the terms of the GNU General Public License as published by
0007 * the Free Software Foundation, either version 3 of the License, or
0008 * (at your option) any later version.
0009 *
0010 * This program is distributed in the hope that it will be useful,
0011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0013 * GNU General Public License for more details.
0014 *
0015 * You should have received a copy of the GNU General Public License
0016 * along with this program. If not, see <http://www.gnu.org/licenses/>.
0017 */
0018
0019 import QtQuick
0020 import QtQuick.Layouts
0021
0022 import org.mauikit.controls 1.3 as Maui
0023 import org.mauikit.filebrowsing 1.3 as FB
0024
0025
0026 /**
0027 * @inherit org::mauikit::control::PopupPage
0028 * A dialog with a list of services -that can handled the associated list of URLs.
0029 * @see urls
0030 *
0031 * This control inherits from MauiKit PopupPage, to checkout its inherited properties refer to docs.
0032 *
0033 * The services listed can open the file type of the file URLs.
0034 *
0035 * @image html openwithdialog.png "Example"
0036 *
0037 * @code
0038 * Maui.Page
0039 * {
0040 * Maui.Controls.showCSD: true
0041 * anchors.fill: parent
0042 *
0043 * Button
0044 * {
0045 * anchors.centerIn: parent
0046 * text: "Open"
0047 * onClicked: _dialog.open()
0048 * }
0049 *
0050 * FB.OpenWithDialog
0051 * {
0052 * id: _dialog
0053 * urls: ["/home/camiloh/Pictures/blend_by_rashadisrazzi_d8ttd59/2K.png"]
0054 * }
0055 * }
0056 * @endcode
0057 *
0058 * <a href="https://invent.kde.org/maui/mauikit-filebrowser/examples/OpenWithDialog.qml">You can find a more complete example at this link.</a>
0059 */
0060 Maui.PopupPage
0061 {
0062 id: control
0063
0064 /**
0065 * @brief List of file URLs to look for associated services.
0066 * @property var OpenWithDialog::urls
0067 */
0068 property alias urls : _openWithList.urls
0069
0070 widthHint: 0.9
0071 maxWidth: 350
0072 persistent: false
0073
0074 page.title: i18nd("mauikitfilebrowsing", "Open with")
0075 headBar.visible: true
0076
0077 stack: Maui.ListBrowser
0078 {
0079 id: _list
0080 Layout.fillWidth: true
0081 Layout.fillHeight: true
0082
0083 model: Maui.BaseModel
0084 {
0085 list: FB.OpenWithModel
0086 {
0087 id: _openWithList
0088 }
0089 }
0090
0091 delegate: Maui.ListBrowserDelegate
0092 {
0093 width: ListView.view.width
0094 hoverEnabled: true
0095
0096 label1.text: model.label
0097 label2.text: model.comment
0098
0099 iconSource: model.icon
0100 iconSizeHint: Maui.Style.iconSizes.big
0101
0102 onClicked:
0103 {
0104 _list.currentIndex = index
0105 _openWithList.openWith(index)
0106 close()
0107 }
0108 }
0109 }
0110 }