Warning, /frameworks/knewstuff/src/qtquick/qml/DialogContent.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2019 Dan Leinir Turthra Jensen <admin@leinir.dk>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 /**
0008  * @brief The contents of the NewStuff.Dialog component
0009  *
0010  * This component is equivalent to the old DownloadWidget, but you should consider
0011  * using NewStuff.Page instead for a more modern style of integration into your
0012  * application's flow.
0013  * @see KNewStuff::DownloadWidget
0014  * @since 5.63
0015  */
0016 
0017 import QtQuick 2.11
0018 import QtQuick.Layouts 1.11 as QtLayouts
0019 
0020 import org.kde.kirigami 2.7 as Kirigami
0021 
0022 import org.kde.newstuff 1.62 as NewStuff
0023 
0024 Kirigami.ApplicationItem {
0025     id: component
0026 
0027     property alias downloadNewWhat: newStuffPage.title
0028     /**
0029      * The configuration file to use for this button
0030      */
0031     property alias configFile: newStuffPage.configFile
0032 
0033     /**
0034      * The engine which handles the content in this dialog
0035      */
0036     property alias engine: newStuffPage.engine
0037 
0038     /**
0039      * The default view mode of the dialog spawned by this button. This should be
0040      * set using the NewStuff.Page.ViewMode enum
0041      * @see NewStuff.Page.ViewMode
0042      */
0043     property alias viewMode: newStuffPage.viewMode
0044 
0045     /**
0046      * Show the details page for a specific entry.
0047      * If you call this function before the engine initialisation has been completed,
0048      * the action itself will be postponed until that has happened.
0049      * @param providerId The provider ID for the entry you wish to show details for
0050      * @param entryId The unique ID for the entry you wish to show details for
0051      * @since 5.79
0052      */
0053     function showEntryDetails(providerId, entryId) {
0054         newStuffPage.showEntryDetails(providerId, entryId);
0055     }
0056 
0057     QtLayouts.Layout.preferredWidth: Kirigami.Units.gridUnit * 50
0058     QtLayouts.Layout.preferredHeight: Kirigami.Units.gridUnit * 40
0059     pageStack.defaultColumnWidth: pageStack.width
0060     pageStack.globalToolBar.style: Kirigami.ApplicationHeaderStyle.Auto
0061     pageStack.globalToolBar.canContainHandles: true
0062     pageStack.initialPage: NewStuff.Page {
0063         id: newStuffPage
0064         showUploadAction: false
0065         function showMessage(message) {
0066             // As the Page shows something nice and friendly while loading,
0067             // there's no reason to do the passive notification thing for those.
0068             if (!engine.isLoading) {
0069                 component.showPassiveNotification(message);
0070             }
0071         }
0072         onMessage: component.showPassiveNotification(message);
0073         onIdleMessage: component.showPassiveNotification(message);
0074     }
0075     contextDrawer: Kirigami.ContextDrawer {
0076         id: contextDrawer
0077     }
0078 }