Warning, /frameworks/knewstuff/src/qtquick/qml/private/EntryCommentsPage.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 A Kirigami.Page component used for displaying a NewStuff entry's comments
0009 */
0010
0011 import QtQuick 2.11
0012 import QtQuick.Controls 2.11 as QtControls
0013 import QtQuick.Layouts 1.11 as QtLayouts
0014
0015 import org.kde.kirigami 2.7 as Kirigami
0016
0017 import org.kde.newstuff 1.62 as NewStuff
0018
0019 Kirigami.ScrollablePage {
0020 id: component
0021 property string entryName
0022 property string entryAuthorId
0023 property string entryProviderId
0024 property alias entry: commentsModel.entry
0025 property alias itemsModel: commentsModel.itemsModel
0026 title: i18ndc("knewstuff6", "Title for the page containing a view of the comments for the entry", "Comments and Reviews for %1", component.entryName)
0027 actions: [
0028 Kirigami.Action {
0029 text: i18ndc("knewstuff6", "Title for the item which is checked when all comments should be shown", "Show All Comments")
0030 checked: commentsModel.includedComments == NewStuff.CommentsModel.IncludeAllComments
0031 checkable: true
0032 onTriggered: commentsModel.includedComments = NewStuff.CommentsModel.IncludeAllComments
0033 },
0034 Kirigami.Action {
0035 text: i18ndc("knewstuff6", "Title for the item which is checked when only comments which are reviews should be shown", "Show Reviews Only")
0036 checked: commentsModel.includedComments == NewStuff.CommentsModel.IncludeOnlyReviews
0037 checkable: true
0038 onTriggered: commentsModel.includedComments = NewStuff.CommentsModel.IncludeOnlyReviews
0039 },
0040 Kirigami.Action {
0041 text: i18ndc("knewstuff6", "Title for the item which is checked when comments which are reviews, and their children should be shown", "Show Reviews and Replies")
0042 checked: commentsModel.includedComments == NewStuff.CommentsModel.IncludeReviewsAndReplies
0043 checkable: true
0044 onTriggered: commentsModel.includedComments = NewStuff.CommentsModel.IncludeReviewsAndReplies
0045 }
0046 ]
0047 ErrorDisplayer { engine: component.itemsModel.engine; active: component.isCurrentPage; }
0048 ListView {
0049 id: commentsView
0050 model: NewStuff.CommentsModel {
0051 id: commentsModel
0052 }
0053 QtLayouts.Layout.fillWidth: true
0054 header: Item {
0055 anchors {
0056 left: parent.left
0057 right: parent.right
0058 }
0059 height: Kirigami.Units.largeSpacing
0060 }
0061 delegate: EntryCommentDelegate {
0062 engine: component.itemsModel.engine
0063 entryAuthorId: component.entryAuthorId
0064 entryProviderId: component.entryProviderId
0065 author: model.username
0066 score: model.score
0067 title: model.subject
0068 reviewText: model.text
0069 depth: model.depth
0070 }
0071 }
0072 }