Warning, /kdevelop/kdevelop/plugins/welcomepage/qml/Develop.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2011 Aleix Pol <aleixpol@kde.org>
0003     SPDX-FileCopyrightText: 2016 Kevin Funk <kfunk@kde.org>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 import QtQuick 2.7
0009 import QtQuick.Layouts 1.2
0010 import QtQuick.Controls 2.0
0011 import QtQuick.Controls 1.4 as QQC1
0012 
0013 import org.kdevelop.welcomepage 4.3
0014 
0015 StandardPage
0016 {
0017     id: root
0018 
0019     ColumnLayout {
0020         anchors.fill: parent
0021         anchors.margins: 20
0022 
0023         spacing: 20
0024 
0025         RowLayout {
0026             id: toolBar
0027 
0028             width: parent.width
0029 
0030             QQC1.Button {
0031                 iconName: "project-development-new-template"
0032                 text: i18n("New Project")
0033                 onClicked: kdev.retrieveMenuAction("project/project_new").trigger()
0034             }
0035 
0036             QQC1.Button {
0037                 text: i18n("Open Project")
0038                 iconName: "project-open"
0039                 onClicked: ICore.projectController.openProject()
0040             }
0041 
0042             QQC1.Button {
0043                 text: i18n("Fetch Project")
0044                 iconName: "edit-download"
0045                 onClicked: kdev.retrieveMenuAction("project/project_fetch").trigger()
0046             }
0047 
0048             QQC1.Button {
0049                 iconName: "document-open-recent"
0050                 text: i18n("Recent Projects")
0051                 onClicked: kdev.showMenu("project/project_open_recent")
0052             }
0053             Item {
0054                 Layout.fillWidth: true
0055             }
0056         }
0057 
0058         Label {
0059             id: greetingLabel
0060 
0061             visible: !sessionsView.visible
0062             Layout.fillWidth: true
0063             Layout.fillHeight: true
0064 
0065             text: i18n("<h3>Welcome to KDevelop!</h3>\n" +
0066                 "<p>You can start working on a project by opening an existing or creating a new one via the above buttons.</p>\n" +
0067                 "<p>If you need help, please check out the <a href=\"https://userbase.kde.org/KDevelop\">User Manual.</a></p>") +
0068 
0069                 (Qt.platform.os === "windows" ?
0070                     i18n("<br/>\n" +
0071                         "<h3>Note for Windows users</h3>\n" +
0072                         "<p>Note that KDevelop does NOT ship a C/C++ compiler on Windows!</p>\n" +
0073                         "<p>You need to install either GCC via MinGW or install a recent version of the Microsoft Visual Studio IDE and make sure the environment is setup correctly <i>before</i> starting KDevelop.</p>\n" +
0074                         "<p>If you need further assistance, please check out the <a href=\"https://userbase.kde.org/KDevelop4/Manual/WindowsSetup\">KDevelop under Windows instructions.</a></p>") :
0075                     "")
0076             wrapMode: Text.WordWrap
0077             onLinkActivated: Qt.openUrlExternally(link)
0078 
0079             MouseArea {
0080                 anchors.fill: parent
0081 
0082                 acceptedButtons: Qt.NoButton // we don't want to eat clicks on the Text
0083                 cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
0084             }
0085         }
0086 
0087         ListView {
0088             id: sessionsView
0089 
0090             Layout.fillHeight: true
0091             Layout.fillWidth: true
0092 
0093             visible: sessionsView.count > 1 // we always have at least one active session
0094             clip: true
0095             boundsBehavior: Flickable.StopAtBounds
0096 
0097             ScrollBar.vertical: ScrollBar { id: verticalScrollBar }
0098 
0099             delegate: Label {
0100                 readonly property string projectNamesString: projectNames.join(", ").replace(/.kdev4/g, "")
0101 
0102                 width: sessionsView.width - verticalScrollBar.width
0103                 height: visible ? 30 : 0
0104 
0105                 visible: projects.length > 0
0106 
0107                 text: display == "" ? projectNamesString : i18n("%1: %2", display, projectNamesString)
0108                 elide: Text.ElideRight
0109                 opacity: labelMouseArea.containsMouse ? 0.8 : 1
0110 
0111                 MouseArea {
0112                     id: labelMouseArea
0113 
0114                     anchors.fill: parent
0115 
0116                     hoverEnabled: true
0117                     cursorShape: Qt.PointingHandCursor
0118 
0119                     onClicked: sessionsModel.loadSession(uuid)
0120                 }
0121             }
0122 
0123             model: SessionsModel { id: sessionsModel }
0124 
0125             header: Heading {
0126                 text: i18n("Sessions")
0127             }
0128         }
0129     }
0130 }