File: Develop.qml

package info (click to toggle)
kdevelop 4%3A5.6.2-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 57,892 kB
  • sloc: cpp: 278,773; javascript: 3,558; python: 3,385; sh: 1,317; ansic: 689; xml: 273; php: 95; makefile: 40; lisp: 13; sed: 12
file content (144 lines) | stat: -rw-r--r-- 4,956 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/* KDevelop
 *
 * Copyright 2011 Aleix Pol <aleixpol@kde.org>
 * Copyright 2016 Kevin Funk <kfunk@kde.org>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301, USA.
 */

import QtQuick 2.7
import QtQuick.Layouts 1.2
import QtQuick.Controls 2.0
import QtQuick.Controls 1.4 as QQC1

import org.kdevelop.welcomepage 4.3

StandardPage
{
    id: root

    ColumnLayout {
        anchors.fill: parent
        anchors.margins: 20

        spacing: 20

        RowLayout {
            id: toolBar

            width: parent.width

            QQC1.Button {
                iconName: "project-development-new-template"
                text: i18n("New Project")
                onClicked: kdev.retrieveMenuAction("project/project_new").trigger()
            }

            QQC1.Button {
                text: i18n("Open Project")
                iconName: "project-open"
                onClicked: ICore.projectController.openProject()
            }

            QQC1.Button {
                text: i18n("Fetch Project")
                iconName: "edit-download"
                onClicked: kdev.retrieveMenuAction("project/project_fetch").trigger()
            }

            QQC1.Button {
                iconName: "document-open-recent"
                text: i18n("Recent Projects")
                onClicked: kdev.showMenu("project/project_open_recent")
            }
            Item {
                Layout.fillWidth: true
            }
        }

        Label {
            id: greetingLabel

            visible: !sessionsView.visible
            Layout.fillWidth: true
            Layout.fillHeight: true

            text: i18n("<h3>Welcome to KDevelop!</h3>\n" +
                "<p>You can start working on a project by opening an existing or creating a new one via the above buttons.</p>\n" +
                "<p>If you need help, please check out the <a href=\"https://userbase.kde.org/KDevelop\">User Manual.</a></p>") +

                (Qt.platform.os === "windows" ?
                    i18n("<br/>\n" +
                        "<h3>Note for Windows users</h3>\n" +
                        "<p>Note that KDevelop does NOT ship a C/C++ compiler on Windows!</p>\n" +
                        "<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" +
                        "<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>") :
                    "")
            wrapMode: Text.WordWrap
            onLinkActivated: Qt.openUrlExternally(link)

            MouseArea {
                anchors.fill: parent

                acceptedButtons: Qt.NoButton // we don't want to eat clicks on the Text
                cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
            }
        }

        ListView {
            id: sessionsView

            Layout.fillHeight: true
            Layout.fillWidth: true

            visible: sessionsView.count > 1 // we always have at least one active session
            clip: true
            boundsBehavior: Flickable.StopAtBounds

            ScrollBar.vertical: ScrollBar { id: verticalScrollBar }

            delegate: Label {
                readonly property string projectNamesString: projectNames.join(", ").replace(/.kdev4/g, "")

                width: sessionsView.width - verticalScrollBar.width
                height: visible ? 30 : 0

                visible: projects.length > 0

                text: display == "" ? projectNamesString : i18n("%1: %2", display, projectNamesString)
                elide: Text.ElideRight
                opacity: labelMouseArea.containsMouse ? 0.8 : 1

                MouseArea {
                    id: labelMouseArea

                    anchors.fill: parent

                    hoverEnabled: true
                    cursorShape: Qt.PointingHandCursor

                    onClicked: sessionsModel.loadSession(uuid)
                }
            }

            model: SessionsModel { id: sessionsModel }

            header: Heading {
                text: i18n("Sessions")
            }
        }
    }
}