Warning, /office/kbibtex/mobile/sailfishos/qml/pages/EntryView.qml is written in an unsupported language. File is not indexed.

0001 /***************************************************************************
0002  *   SPDX-License-Identifier: GPL-2.0-or-later
0003  *                                                                         *
0004  *   SPDX-FileCopyrightText: 2016-2017 Thomas Fischer <fischer@unix-ag.uni-kl.de>
0005  *                                                                         *
0006  *   This program is free software; you can redistribute it and/or modify  *
0007  *   it under the terms of the GNU General Public License as published by  *
0008  *   the Free Software Foundation; either version 2 of the License, or     *
0009  *   (at your option) any later version.                                   *
0010  *                                                                         *
0011  *   This program is distributed in the hope that it will be useful,       *
0012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
0013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
0014  *   GNU General Public License for more details.                          *
0015  *                                                                         *
0016  *   You should have received a copy of the GNU General Public License     *
0017  *   along with this program; if not, see <https://www.gnu.org/licenses/>. *
0018  ***************************************************************************/
0019 
0020 import QtQuick 2.0
0021 import Sailfish.Silica 1.0
0022 
0023 Page {
0024     id: entryView
0025     allowedOrientations: Orientation.All
0026 
0027     property string author: ""
0028     property string title: ""
0029     property string wherePublished: ""
0030     property string year: ""
0031     property string url: ""
0032     property string doi: ""
0033     property string foundVia: ""
0034 
0035     SilicaFlickable {
0036         anchors.fill: parent
0037         contentHeight: content.height
0038 
0039         Column {
0040             id: content
0041             x: Theme.horizontalPageMargin
0042             width: parent.width - x
0043 
0044             PageHeader {
0045                 title: entryView.title
0046             }
0047 
0048             Label {
0049                 text: qsTr("Author")
0050                 color: Theme.highlightColor
0051                 font.pointSize: Theme.fontSizeExtraSmall
0052             }
0053             Label {
0054                 id: author
0055                 text: entryView.author
0056                 wrapMode: Text.WordWrap
0057                 width: parent.width - Theme.horizontalPageMargin
0058                 color: Theme.secondaryHighlightColor
0059                 font.pointSize: Theme.fontSizeMedium
0060             }
0061 
0062             Label {
0063                 text: qsTr("Title")
0064                 color: Theme.highlightColor
0065                 font.pointSize: Theme.fontSizeExtraSmall
0066             }
0067             Label {
0068                 id: title
0069                 text: entryView.title
0070                 wrapMode: Text.WordWrap
0071                 width: parent.width - Theme.horizontalPageMargin
0072                 color: Theme.secondaryHighlightColor
0073                 font.pointSize: Theme.fontSizeMedium
0074             }
0075             Label {
0076                 visible: entryView.wherePublished.length > 0
0077                 text: qsTr("Publication")
0078                 color: Theme.highlightColor
0079                 font.pointSize: Theme.fontSizeExtraSmall
0080             }
0081             Label {
0082                 id: wherePublished
0083                 text: entryView.wherePublished
0084                 visible: entryView.wherePublished.length > 0
0085                 wrapMode: Text.Wrap
0086                 width: parent.width - Theme.horizontalPageMargin
0087                 color: Theme.secondaryHighlightColor
0088                 font.pointSize: Theme.fontSizeMedium
0089             }
0090             Label {
0091                 text: qsTr("Year")
0092                 color: Theme.highlightColor
0093                 font.pointSize: Theme.fontSizeExtraSmall
0094             }
0095             Label {
0096                 id: year
0097                 text: entryView.year
0098                 wrapMode: Text.WordWrap
0099                 width: parent.width - Theme.horizontalPageMargin
0100                 color: Theme.secondaryHighlightColor
0101                 font.pointSize: Theme.fontSizeMedium
0102             }
0103             Label {
0104                 visible: entryView.doi.length > 0 || entryView.url.length > 0
0105                 text: entryView.doi.length > 0
0106                       ? qsTr("DOI")
0107                       : qsTr("URL")
0108                 color: Theme.highlightColor
0109                 font.pointSize: Theme.fontSizeExtraSmall
0110             }
0111             Label {
0112                 id: urlOrDoi
0113                 visible: entryView.doi.length > 0 || entryView.url.length > 0
0114                 text: entryView.doi.length > 0 ? entryView.doi : entryView.url
0115                 wrapMode: Text.WordWrap
0116                 width: parent.width - Theme.horizontalPageMargin
0117                 color: Theme.secondaryHighlightColor
0118                 font.pointSize: Theme.fontSizeMedium
0119             }
0120             Label {
0121                 visible: entryView.foundVia.length > 0
0122                 text: qsTr("Found via")
0123                 color: Theme.highlightColor
0124                 font.pointSize: Theme.fontSizeExtraSmall
0125             }
0126             Label {
0127                 id: foundVia
0128                 text: entryView.foundVia
0129                 visible: entryView.foundVia.length > 0
0130                 wrapMode: Text.Wrap
0131                 width: parent.width - Theme.horizontalPageMargin
0132                 color: Theme.secondaryHighlightColor
0133                 font.pointSize: Theme.fontSizeMedium
0134             }
0135         }
0136 
0137         PullDownMenu {
0138             MenuItem {
0139                 id: menuItemViewOnline
0140                 text: qsTr("View Online")
0141                 enabled: entryView.url.length > 0
0142                 onClicked: {
0143                     Qt.openUrlExternally(url)
0144                 }
0145             }
0146 
0147             visible: menuItemViewOnline.enabled
0148         }
0149     }
0150 }