diff --git a/gemini/qml/welcomepages/WelcomePageCloud.qml b/gemini/qml/welcomepages/WelcomePageCloud.qml index 3d1eafcb587..4ba4b5ab7af 100644 --- a/gemini/qml/welcomepages/WelcomePageCloud.qml +++ b/gemini/qml/welcomepages/WelcomePageCloud.qml @@ -1,129 +1,254 @@ /* This file is part of the KDE project * Copyright (C) 2014 Dan Leinir Turthra Jensen * * 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.0 +import QtQuick.Layouts 1.11 as QtLayouts +import QtQuick.Controls 2.2 as QtControls +import org.kde.kirigami 2.7 as Kirigami +import Calligra.Gemini.Dropbox 1.0 import org.calligra 1.0 import "../components" import "cloud" -Page { +Kirigami.ScrollablePage { id: base; objectName: "WelcomePageCloud"; + title: "Open from the Cloud"; /* ListModel { id: cloudAccounts; ListElement { text: "Dropbox"; selected: false; accountType: "DropBox"; stackComponent: "accountsPageDropbox"; accountDetails: [ ListElement { userkey: "asfdoijfdshaloiuhs" } ] } ListElement { text: "ownCloud"; selected: false; accountType: "WebDav"; stackComponent: "accountsPageWebdav"; accountDetails: [ ListElement { username: "lala" } ] } ListElement { text: "bitbucket"; selected: false; accountType: "Git"; stackComponent: "accountsPageGit"; accountDetails: [ ListElement { localrepo: "C:\\Users\\danjensen\\Documents\\nohnas" } ] } ListElement { text: "github"; selected: false; accountType: "Git"; stackComponent: "accountsPageGit"; accountDetails: [ ListElement { localrepo: "C:\\dev\\documentation" } ] } }*/ + function showAccount(index, stackComponent, accountDetails) { + cloudAccounts.selectIndex(index); + pageStack.push(elementFromName(stackComponent)); + pageStack.currentItem.accountDetails = accountDetails; + } + CloudAccountsModel { id: cloudAccounts; } - Label { - id: docTypeSelectorRow; - anchors { - top: parent.top; - left: parent.left; - right: parent.right; + actions { + main: Kirigami.Action { } - height: Constants.GridHeight * 1.5; - verticalAlignment: Text.AlignVCenter; - horizontalAlignment: Text.AlignHCenter; - font: Settings.theme.font("pageHeader"); - text: "Open from The Cloud"; - color: "#22282f"; - CohereButton { - id: accountsButton; - anchors { - left: parent.left; - leftMargin: 20; - verticalCenter: parent.verticalCenter; + } + Connections { + target: controllerMIT; + onNeedAuthenticateChanged: { + if(controllerMIT.needAuthenticate) { + cloudAccounts.removeAccountByName("Dropbox"); } - text: "Accounts"; - textColor: "#5b6573"; - textSize: Settings.theme.adjustedPixel(18); - checkedColor: "#D2D4D5"; - onClicked: { - cloudAccounts.selectIndex(-1); - cloudStack.replace(accountsPage); + else { + cloudAccounts.addAccount("Dropbox", "DropBox", "accountsPageDropbox", 0, true); } - checked: cloudStack.currentPage.pageName === "accountsPage"; } - Row { - id: accountsRow; + } + Component.onCompleted: { + if(!controllerMIT.needAuthenticate) { + cloudAccounts.addAccount("Dropbox", "DropBox", "accountsPageDropbox", 0, true); + } + } + ListView { + id: accountsView; + model: cloudAccounts; + footer: Item { anchors { + left: parent.left; right: parent.right; - rightMargin: 20; - verticalCenter: parent.verticalCenter; + margins: Kirigami.Units.largeSpacing; } - height: accountsButton.height; // yeah, i know... cleaner than hacking in and finding the first child button, though ;) - spacing: 4; - function elementFromName(name) { - var elements = { - "accountsPageDropbox": accountsPageDropbox, - "accountsPageWebdav": accountsPageWebdav, - "accountsPageGit": accountsPageGit - }; - return elements[name]; + height: bottomButtonRow.height + Kirigami.Units.largeSpacing * 2; + QtControls.Label { + anchors.fill: parent; + text: "Add new account:"; + horizontalAlignment: Text.AlignLeft; + verticalAlignment: Text.AlignVCenter; } - Repeater { - model: cloudAccounts; - delegate: CohereButton { - text: model.text - textColor: "#5b6573"; - textSize: Settings.theme.adjustedPixel(18); - checkedColor: "#D2D4D5"; - onClicked: { - if(model.selected) { - return; + Row { + id: bottomButtonRow; + anchors { + verticalCenter: parent.verticalCenter; + right: parent.right; + } + height: childrenRect.height; + spacing: Kirigami.Units.largeSpacing; + Repeater { + model: ListModel { + ListElement { text: "Dropbox"; accountType: "DropBox"; serviceName: "dropbox"; } + ListElement { text: "WebDav"; accountType: "WebDav"; serviceName: ""; } + //ListElement { text: "ownCloud"; accountType: "WebDav"; serviceName: "ownCloud"; } + ListElement { text: "Git"; accountType: "Git"; serviceName: ""; } + //ListElement { text: "GitHub"; accountType: "Git"; serviceName: "github"; } + //ListElement { text: "bitbucket (git)"; accountType: "Git"; serviceName: "bitbucket"; } + } + QtControls.Button { + text: model.text + onClicked: { + dlgStack.replace(base.addComponentFromName(model.accountType)); + dlgStack.currentPage.serviceName = model.serviceName; } - cloudAccounts.selectIndex(index); - cloudStack.replace(accountsRow.elementFromName(model.stackComponent)); - cloudStack.currentPage.accountDetails = model.accountDetails; } - checked: model.selected; } } } - } - PageStack { - id: cloudStack; - initialPage: accountsPage; - anchors { - margins: Settings.theme.adjustedPixel(8); - top: docTypeSelectorRow.bottom; - left: parent.left; - right: parent.right; - bottom: parent.bottom; - bottomMargin: 0; + delegate: Kirigami.SwipeListItem { + QtLayouts.RowLayout { + Item { + QtLayouts.Layout.preferredHeight: Kirigami.Units.iconSizes.huge - Kirigami.Units.smallSpacing * 2; + QtLayouts.Layout.minimumWidth: Kirigami.Units.iconSizes.huge; + QtLayouts.Layout.maximumWidth: Kirigami.Units.iconSizes.huge; + Kirigami.Icon { + anchors { + fill: parent; + margins: Kirigami.Units.smallSpacing; + } + source: "document"; + } + } + QtLayouts.ColumnLayout { + QtLayouts.Layout.fillWidth: true + QtLayouts.Layout.fillHeight: true + Kirigami.Heading { + id: nameText + QtLayouts.Layout.fillWidth: true + level: 3 + text: model.text + } + QtControls.Label { + id: descriptionText + QtLayouts.Layout.fillWidth: true + text: model.accountType === "DropBox" ? "" : model.accountType + elide: Text.ElideRight + maximumLineCount: 2 + wrapMode: Text.Wrap + } + Item { + QtLayouts.Layout.fillWidth: true + QtLayouts.Layout.fillHeight: true + } + } + } + onClicked: base.showAccount(model.index, model.stackComponent, model.accountDetails); + actions: [ + Kirigami.Action { + text: (model.accountType === "DropBox") ? "Sign Out" : "Edit Account"; + icon.name: (model.accountType === "DropBox") ? "leave" : "document-edit" + onTriggered: { + dlgStack.replace(base.editComponentFromName(model.accountType)); + if(dlgStack.currentPage.accountIndex !== undefined) { + dlgStack.currentPage.accountIndex = index; + dlgStack.currentPage.text = model.text; + } + } + }, + Kirigami.Action { + text: "Remove"; + icon.name: "remove" + visible: model.accountType !== "DropBox"; + onTriggered: { + dlgStack.replace(removeAccountDlg); + if(dlgStack.currentPage.accountIndex !== undefined) { + dlgStack.currentPage.accountIndex = index; + dlgStack.currentPage.text = model.text; + } + } + } + ] } - } - Component { id: accountsPage; - CloudAccounts { - accountsList: cloudAccounts; - onShowAccount: { - cloudAccounts.selectIndex(index); - cloudStack.replace(accountsRow.elementFromName(stackComponent)); - cloudStack.currentPage.accountDetails = accountDetails; + QtControls.Label { + anchors.fill: accountsView; + text: "You have no cloud accounts defined. Please add one by clicking on your service of choice below."; + horizontalAlignment: Text.AlignHCenter; + verticalAlignment: Text.AlignVCenter; + opacity: cloudAccounts.count === 0 ? 1 : 0; + Behavior on opacity { PropertyAnimation { duration: Constants.AnimationDuration; } } + } + PageStack { + id: dlgStack; + anchors { + fill: parent; + margins: -Settings.theme.adjustedPixel(8); } + initialPage: addEmptyComp; } } + + function addComponentFromName(name) { + var elements = { + "DropBox": addDropBox, + "WebDav": addWebDav, + "Git": addGit + }; + return elements[name]; + } + Component { + id: addEmptyComp; + Item {} + } + Component { + id: addDropBox; + AddDropbox { addEmpty: addEmptyComp; } + } + Component { + id: addWebDav; + AddWebdav { addEmpty: addEmptyComp; } + } + Component { + id: addGit; + AddGit { addEmpty: addEmptyComp; } + } + function editComponentFromName(name) { + var elements = { + "DropBox": editDropBox, + "WebDav": editWebDav, + "Git": editGit + }; + return elements[name]; + } + Component { + id: editDropBox; + AddDropbox { addEmpty: addEmptyComp; } + } + Component { + id: editWebDav; + EditDetailsBase { addEmpty: addEmptyComp; } + } + Component { + id: editGit; + EditGit { addEmpty: addEmptyComp; } + } + + Component { + id: removeAccountDlg; + RemoveAccountDlg { addEmpty: addEmptyComp; } + } + + function elementFromName(name) { + var elements = { + "accountsPageDropbox": accountsPageDropbox, + "accountsPageWebdav": accountsPageWebdav, + "accountsPageGit": accountsPageGit + }; + return elements[name]; + } Component { id: accountsPageDropbox; Dropbox { } } Component { id: accountsPageWebdav; Webdav { } } Component { id: accountsPageGit; Git { } } } diff --git a/gemini/qml/welcomepages/cloud/CloudAccounts.qml b/gemini/qml/welcomepages/cloud/CloudAccounts.qml index de0ab908e10..be178a3801e 100644 --- a/gemini/qml/welcomepages/cloud/CloudAccounts.qml +++ b/gemini/qml/welcomepages/cloud/CloudAccounts.qml @@ -1,228 +1,227 @@ /* This file is part of the KDE project * Copyright (C) 2014 Dan Leinir Turthra Jensen * * 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.0 import QtQuick.Controls 2.2 as QtControls import org.calligra 1.0 -import Calligra.Gemini.Dropbox 1.0 import "../../components" import "dropbox" as Dropbox import "git" as Git Page { id: base; property string pageName: "accountsPage"; property QtObject accountsList; signal showAccount(var index, var stackComponent, var accountDetails); Connections { target: controllerMIT; onNeedAuthenticateChanged: { if(controllerMIT.needAuthenticate) { cloudAccounts.removeAccountByName("Dropbox"); } else { cloudAccounts.addAccount("Dropbox", "DropBox", "accountsPageDropbox", 0, true); } } } Component.onCompleted: { if(!controllerMIT.needAuthenticate) { cloudAccounts.addAccount("Dropbox", "DropBox", "accountsPageDropbox", 0, true); } } ListView { id: accountsView; anchors { top: parent.top; left: parent.left; right: parent.right; bottom: bottomButtons.top; } clip: true; model: accountsList; delegate: Item { height: Settings.theme.adjustedPixel(64); width: ListView.view.width; QtControls.Label { anchors { top: parent.top; left: parent.left; right: accountControls.left; bottom: parent.bottom; } text: model.text; horizontalAlignment: Text.AlignLeft; verticalAlignment: Text.AlignVCenter; font: Settings.theme.font("templateLabel"); MouseArea { anchors.fill: parent; onClicked: base.showAccount(model.index, model.stackComponent, model.accountDetails); } } Row { id: accountControls; anchors { verticalCenter: parent.verticalCenter; right: parent.right; } width: childrenRect.width; spacing: Settings.theme.adjustedPixel(8); Text { text: model.accountType; width: Settings.theme.adjustedPixel(100); height: parent.height; horizontalAlignment: Text.AlignRight; verticalAlignment: Text.AlignVCenter; font: Settings.theme.font("templateLabel"); color: "#5b6573"; visible: model.accountType !== "DropBox"; } QtControls.Button { anchors.verticalCenter: parent.verticalCenter; text: (model.accountType === "DropBox") ? "Sign Out" : "Edit Account"; onClicked: { dlgStack.replace(base.editComponentFromName(model.accountType)); if(dlgStack.currentPage.accountIndex !== undefined) { dlgStack.currentPage.accountIndex = index; dlgStack.currentPage.text = model.text; } } } QtControls.Button { anchors.verticalCenter: parent.verticalCenter; text: "Remove"; visible: model.accountType !== "DropBox"; onClicked: { dlgStack.replace(removeAccountDlg); if(dlgStack.currentPage.accountIndex !== undefined) { dlgStack.currentPage.accountIndex = index; dlgStack.currentPage.text = model.text; } } } } } } QtControls.Label { anchors.fill: accountsView; text: "You have no cloud accounts defined. Please add one by clicking on your service of choice below."; horizontalAlignment: Text.AlignHCenter; verticalAlignment: Text.AlignVCenter; opacity: accountsList.count === 0 ? 1 : 0; Behavior on opacity { PropertyAnimation { duration: Constants.AnimationDuration; } } } Item { id: bottomButtons; anchors { left: parent.left; right: parent.right; bottom: parent.bottom; } height: bottomButtonRow.height + Settings.theme.adjustedPixel(8); QtControls.Label { anchors.fill: parent; text: "Add new account:"; horizontalAlignment: Text.AlignLeft; verticalAlignment: Text.AlignVCenter; } Row { id: bottomButtonRow; anchors { verticalCenter: parent.verticalCenter; right: parent.right; } height: childrenRect.height; spacing: Settings.theme.adjustedPixel(8); Repeater { model: ListModel { ListElement { text: "Dropbox"; accountType: "DropBox"; serviceName: "dropbox"; } ListElement { text: "WebDav"; accountType: "WebDav"; serviceName: ""; } //ListElement { text: "ownCloud"; accountType: "WebDav"; serviceName: "ownCloud"; } ListElement { text: "Git"; accountType: "Git"; serviceName: ""; } //ListElement { text: "GitHub"; accountType: "Git"; serviceName: "github"; } //ListElement { text: "bitbucket (git)"; accountType: "Git"; serviceName: "bitbucket"; } } QtControls.Button { text: model.text onClicked: { dlgStack.replace(base.addComponentFromName(model.accountType)); dlgStack.currentPage.serviceName = model.serviceName; } } } } } PageStack { id: dlgStack; anchors { fill: base; margins: -Settings.theme.adjustedPixel(8); } initialPage: addEmptyComp; } function addComponentFromName(name) { var elements = { "DropBox": addDropBox, "WebDav": addWebDav, "Git": addGit }; return elements[name]; } Component { id: addEmptyComp; Item {} } Component { id: addDropBox; AddDropbox { addEmpty: addEmptyComp; } } Component { id: addWebDav; AddWebdav { addEmpty: addEmptyComp; } } Component { id: addGit; AddGit { addEmpty: addEmptyComp; } } function editComponentFromName(name) { var elements = { "DropBox": editDropBox, "WebDav": editWebDav, "Git": editGit }; return elements[name]; } Component { id: editDropBox; AddDropbox { addEmpty: addEmptyComp; } } Component { id: editWebDav; EditDetailsBase { addEmpty: addEmptyComp; } } Component { id: editGit; EditGit { addEmpty: addEmptyComp; } } Component { id: removeAccountDlg; RemoveAccountDlg { addEmpty: addEmptyComp; } } } diff --git a/gemini/qml/welcomepages/cloud/Dropbox.qml b/gemini/qml/welcomepages/cloud/Dropbox.qml index a0d6c5cdc55..b51d3496337 100644 --- a/gemini/qml/welcomepages/cloud/Dropbox.qml +++ b/gemini/qml/welcomepages/cloud/Dropbox.qml @@ -1,31 +1,33 @@ /* This file is part of the KDE project * Copyright (C) 2014 Dan Leinir Turthra Jensen * * 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.0 import org.calligra 1.0 +import org.kde.kirigami 2.7 as Kirigami import "dropbox" as Dropbox import "../../components" -Page { +Kirigami.Page { id: base; property string pageName: "accountsPageDropbox"; property QtObject accountDetails; + title: "DropBox"; Dropbox.FileNavigator { anchors.fill: parent; } } diff --git a/gemini/qml/welcomepages/cloud/Git.qml b/gemini/qml/welcomepages/cloud/Git.qml index 757bf6ca589..aa3a64dba1a 100644 --- a/gemini/qml/welcomepages/cloud/Git.qml +++ b/gemini/qml/welcomepages/cloud/Git.qml @@ -1,31 +1,33 @@ /* This file is part of the KDE project * Copyright (C) 2014 Dan Leinir Turthra Jensen * * 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.0 import org.calligra 1.0 +import org.kde.kirigami 2.7 as Kirigami import "../../components" -Page { +Kirigami.Page { id: base; property string pageName: "accountsPageGit"; + title: accountDetails.readProperty("text"); property QtObject accountDetails: null; Loader { anchors.fill: parent; source: "git/repositoryContentContainer.qml" } } diff --git a/gemini/qml/welcomepages/cloud/git/RepositoryContent.qml b/gemini/qml/welcomepages/cloud/git/RepositoryContent.qml index 0b5fd427cf3..2c072a3c697 100644 --- a/gemini/qml/welcomepages/cloud/git/RepositoryContent.qml +++ b/gemini/qml/welcomepages/cloud/git/RepositoryContent.qml @@ -1,216 +1,216 @@ /* This file is part of the KDE project * Copyright (C) 2014 Dan Leinir Turthra Jensen * * 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.0 import QtQuick.Controls 2.2 as QtControls import org.kde.kirigami 2.1 as Kirigami import org.calligra 1.0 import Calligra.Gemini.Git 1.0 import "../../../components" Item { property alias localrepo: gitController.cloneDir; property alias privateKeyFile: gitController.privateKeyFile; property alias needsPrivateKeyPassphrase: gitController.needsPrivateKeyPassphrase; property alias publicKeyFile: gitController.publicKeyFile; property alias userForRemote: gitController.userForRemote; GitController { id: gitController; currentFile: Settings.currentFile; onPullCompleted: { logModel.refreshLog(); updatedLabel.opacity = 1; if(DocumentManager.doc()) { DocumentManager.doc().clearStatusBarMessage(); } } onTransferProgress: { if(DocumentManager.doc()) { DocumentManager.doc().sigProgress(progress); } console.log("Transfer progress: " + progress); } onOperationBegun: { console.log(message); if(DocumentManager.doc()) { DocumentManager.doc().statusBarMessage(message); } } onPushCompleted: { if(DocumentManager.doc()) { DocumentManager.doc().clearStatusBarMessage(); } } } GitLogModel { id: logModel; repoDir: gitController.cloneDir; } Item { id: logSidebar; anchors { margins: Constants.DefaultMargin; top: parent.top; right: parent.right; bottom: parent.bottom; bottomMargin: 0; } width: (parent.width / 4) - Constants.DefaultMargin; QtControls.Button { id: pullButton; anchors { top: parent.top; horizontalCenter: parent.horizontalCenter; margins: Settings.theme.adjustedPixel(8); } text: "Pull from upstream"; onClicked: { enabled = false; pullInProgress.opacity = 1; gitController.pull(); } QtControls.BusyIndicator { id: pullInProgress; opacity: 0; running: true; height: parent.height; width: height; anchors.centerIn: parent; Behavior on opacity { PropertyAnimation { duration: Constants.AnimationDuration; } } anchors { top: pullButton.bottom; left: parent.left; right: parent.right; } } } QtControls.Label { id: updatedLabel; opacity: 0; Behavior on opacity { SequentialAnimation { ScriptAction { script: pullInProgress.opacity = 0; } PropertyAnimation { duration: Constants.AnimationDuration; } ScriptAction { script: hideUpdate.start(); } } } height: opacity * Constants.GridHeight / 2; anchors { top: pullButton.bottom; left: parent.left; right: parent.right; } text: "Update Completed!"; verticalAlignment: Text.AlignVCenter; horizontalAlignment: Text.AlignHCenter; Timer { id: hideUpdate; running: false; repeat: false; interval: 1000; onTriggered: { updatedLabel.opacity = 0; pullButton.enabled = true; } } } ListView { id: logListView; model: logModel; clip: true; anchors { margins: Constants.DefaultMargin; top: updatedLabel.bottom; left: parent.left; right: parent.right; bottom: parent.bottom; } header: QtControls.Label { width: logListView.width; height: Constants.GridHeight / 2; text: "Recent Changes"; verticalAlignment: Text.AlignVCenter; horizontalAlignment: Text.AlignHCenter; } delegate: Column { width: logListView.width; height: childrenRect.height; QtControls.Label { id: messageText; width: parent.width; height: paintedHeight; text: model.shortMessage; wrapMode: Text.Wrap; } QtControls.Label { id: timeText; width: parent.width; height: paintedHeight; opacity: 0.7; text: "on " + model.time; } QtControls.Label { id: nameText; width: parent.width; height: paintedHeight; opacity: 0.7 text: "by " + model.authorName; } Item { width: parent.width; height: nameText.height; Rectangle { width: parent.width - (Constants.DefaultMargin * 2); height: 1; anchors.centerIn: parent; opacity: 0.3; color: "black"; } } } } ScrollDecorator { flickableItem: logListView; anchors.fill: logListView; } } GridView { id: docList; clip: true; contentWidth: width; anchors { margins: Constants.DefaultMargin; top: parent.top; topMargin: Constants.DefaultMargin * 2; left: parent.left; right: logSidebar.left; bottom: parent.bottom; bottomMargin: 0; } cellWidth: width / 3 - Constants.DefaultMargin; cellHeight: cellWidth + Settings.theme.font("templateLabel").pixelSize + Constants.DefaultMargin * 4; model: gitController.documents; delegate: documentTile; ScrollDecorator { flickableItem: docList; } } QtControls.Label { anchors.fill: parent; text: "No Documents\n\nPlease add some documents to your reporitory.\n(%1)".arg(docList.model.documentsFolder); horizontalAlignment: Text.AlignHCenter; verticalAlignment: Text.AlignVCenter; visible: docList.count === 0; } Component { id: documentTile; DocumentTile { width: docList.cellWidth; height: docList.cellHeight; filePath: model.filePath; - title: model.fileName != "" ? model.filename : ""; + title: model.fileName != "" ? model.fileName : ""; onClicked: openFile(model.filePath, gitController.commitAndPushCurrentFileAction()); } } }