diff --git a/gemini/qml/welcomepages/cloud/AddDropbox.qml b/gemini/qml/welcomepages/cloud/AddDropbox.qml index c3bf0b6df9a..292aeb59f04 100644 --- a/gemini/qml/welcomepages/cloud/AddDropbox.qml +++ b/gemini/qml/welcomepages/cloud/AddDropbox.qml @@ -1,58 +1,55 @@ /* 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 "../../components" +import QtQuick.Controls 1.4 as QtControls import "dropbox" as Dropbox Rectangle { anchors.fill: parent; anchors.margins: Settings.theme.adjustedPixel(16); property string serviceName: ""; property Component addEmpty; radius: Settings.theme.adjustedPixel(8); color: "white"; Rectangle { anchors { fill: parent; margins: -Settings.theme.adjustedPixel(16); topMargin: -(Settings.theme.adjustedPixel(8) + Constants.GridHeight * 1.5); } opacity: 0.5; color: "white"; MouseArea { anchors.fill: parent; onClicked: { /*nothing */ } } SimpleTouchArea { anchors.fill: parent; onTouched: { /*nothing */ } } } Dropbox.SetupPage { anchors.fill: parent; anchors.margins: Settings.theme.adjustedPixel(8); } - CohereButton { + QtControls.Button { anchors { bottom: parent.bottom; right: parent.right; margins: Settings.theme.adjustedPixel(8); } text: "Close"; - textColor: "#5b6573"; - textSize: Settings.theme.adjustedPixel(18); - color: "#D2D4D5"; onClicked: dlgStack.replace(addEmpty); } } diff --git a/gemini/qml/welcomepages/cloud/AddGit.qml b/gemini/qml/welcomepages/cloud/AddGit.qml index b7a890abdec..52efaca179d 100644 --- a/gemini/qml/welcomepages/cloud/AddGit.qml +++ b/gemini/qml/welcomepages/cloud/AddGit.qml @@ -1,64 +1,61 @@ /* 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 "../../components" +import QtQuick.Controls 1.4 as QtControls Rectangle { anchors.fill: parent; anchors.margins: Settings.theme.adjustedPixel(16); property string serviceName: ""; property Component addEmpty; radius: Settings.theme.adjustedPixel(8); color: "white"; Rectangle { anchors { fill: parent; margins: -Settings.theme.adjustedPixel(16); topMargin: -(Settings.theme.adjustedPixel(8) + Constants.GridHeight * 1.5); } opacity: 0.5; color: "white"; MouseArea { anchors.fill: parent; onClicked: { /*nothing */ } } SimpleTouchArea { anchors.fill: parent; onTouched: { /*nothing */ } } } Loader { anchors { top: parent.top; left: parent.left; right: parent.right; bottom: closeButton.top; margins: Settings.theme.adjustedPixel(8); } source: "git/createCheckoutContainer.qml"; } - CohereButton { + QtControls.Button { id: closeButton; anchors { bottom: parent.bottom; right: parent.right; margins: Settings.theme.adjustedPixel(8); } text: "Close"; - textColor: "#5b6573"; - textSize: Settings.theme.adjustedPixel(18); - color: "#D2D4D5"; onClicked: dlgStack.replace(addEmpty); } } diff --git a/gemini/qml/welcomepages/cloud/AddWebdav.qml b/gemini/qml/welcomepages/cloud/AddWebdav.qml index 2fd6aad3248..3433588f646 100644 --- a/gemini/qml/welcomepages/cloud/AddWebdav.qml +++ b/gemini/qml/welcomepages/cloud/AddWebdav.qml @@ -1,58 +1,56 @@ /* 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 "../../components" +import QtQuick.Controls 1.4 as QtControls +import org.kde.kirigami 1.0 as Kirigami Rectangle { anchors.fill: parent; anchors.margins: Settings.theme.adjustedPixel(16); property string serviceName: ""; property Component addEmpty; radius: Settings.theme.adjustedPixel(8); color: "white"; Rectangle { anchors { fill: parent; margins: -Settings.theme.adjustedPixel(16); topMargin: -(Settings.theme.adjustedPixel(8) + Constants.GridHeight * 1.5); } opacity: 0.5; color: "white"; MouseArea { anchors.fill: parent; onClicked: { /*nothing */ } } SimpleTouchArea { anchors.fill: parent; onTouched: { /*nothing */ } } } - Label { + Kirigami.Label { anchors.fill: parent; horizontalAlignment: Text.AlignHCenter; text: "Sorry, support for WebDav is not yet implemented."; } - CohereButton { + QtControls.Button { anchors { bottom: parent.bottom; right: parent.right; margins: Settings.theme.adjustedPixel(8); } text: "Close"; - textColor: "#5b6573"; - textSize: Settings.theme.adjustedPixel(18); - color: "#D2D4D5"; onClicked: dlgStack.replace(addEmpty); } } diff --git a/gemini/qml/welcomepages/cloud/CloudAccounts.qml b/gemini/qml/welcomepages/cloud/CloudAccounts.qml index b7579792814..f24ebe8e32f 100644 --- a/gemini/qml/welcomepages/cloud/CloudAccounts.qml +++ b/gemini/qml/welcomepages/cloud/CloudAccounts.qml @@ -1,230 +1,218 @@ /* 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 1.4 as QtControls +import org.kde.kirigami 1.0 as Kirigami 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; 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; - Label { + Kirigami.Label { anchors.fill: parent; text: model.text; horizontalAlignment: Text.AlignLeft; verticalAlignment: Text.AlignVCenter; font: Settings.theme.font("templateLabel"); - color: "#5b6573"; } Row { 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"; } - CohereButton { + QtControls.Button { anchors.verticalCenter: parent.verticalCenter; text: (model.accountType === "DropBox") ? "Sign Out" : "Edit Account"; - textColor: "#5b6573"; - textSize: Settings.theme.adjustedPixel(18); - color: "#D2D4D5"; onClicked: { dlgStack.replace(base.editComponentFromName(model.accountType)); if(dlgStack.currentPage.accountIndex !== undefined) { dlgStack.currentPage.accountIndex = index; dlgStack.currentPage.text = model.text; } } } - CohereButton { + QtControls.Button { anchors.verticalCenter: parent.verticalCenter; text: "Remove"; - textColor: "#5b6573"; - textSize: Settings.theme.adjustedPixel(18); - color: "#D2D4D5"; visible: model.accountType !== "DropBox"; onClicked: { dlgStack.replace(removeAccountDlg); if(dlgStack.currentPage.accountIndex !== undefined) { dlgStack.currentPage.accountIndex = index; dlgStack.currentPage.text = model.text; } } } } } } - Label { + Kirigami.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; - font: Settings.theme.font("templateLabel"); - color: "#5b6573"; 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); - Label { + Kirigami.Label { anchors.fill: parent; text: "Add new account:"; horizontalAlignment: Text.AlignLeft; verticalAlignment: Text.AlignVCenter; - font: Settings.theme.font("templateLabel"); - color: "#5b6573"; } 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"; } } - CohereButton { + QtControls.Button { text: model.text - textColor: "#5b6573"; - textSize: Settings.theme.adjustedPixel(18); - color: "#D2D4D5"; 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/EditDetailsBase.qml b/gemini/qml/welcomepages/cloud/EditDetailsBase.qml index 69700ab7c29..6cb8c7588ed 100644 --- a/gemini/qml/welcomepages/cloud/EditDetailsBase.qml +++ b/gemini/qml/welcomepages/cloud/EditDetailsBase.qml @@ -1,85 +1,80 @@ /* 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 QtQuick.Controls 1.4 as QtControls import "../../components" Rectangle { anchors.fill: parent; anchors.margins: Settings.theme.adjustedPixel(16); property int accountIndex: -1; property string text; onTextChanged: { nameField.text = text; } property Component addEmpty; radius: Settings.theme.adjustedPixel(8); color: "white"; Rectangle { anchors { fill: parent; margins: -Settings.theme.adjustedPixel(16); topMargin: -(Settings.theme.adjustedPixel(8) + Constants.GridHeight * 1.5); } opacity: 0.5; color: "white"; MouseArea { anchors.fill: parent; onClicked: { /*nothing */ } } SimpleTouchArea { anchors.fill: parent; onTouched: { /*nothing */ } } } TextField { id: nameField; anchors { verticalCenter: parent.verticalCenter; left: parent.left; right: parent.right; margins: Settings.theme.adjustedPixel(16); } placeholder: "Account Name"; } - CohereButton { + QtControls.Button { id: okButton; anchors { bottom: parent.bottom; right: cancelButton.left; margins: Settings.theme.adjustedPixel(8); } text: "Save"; - textColor: "#5b6573"; - textSize: Settings.theme.adjustedPixel(18); - color: "#D2D4D5"; onClicked: { cloudAccounts.renameAccount(base.accountIndex, nameField.text); dlgStack.replace(addEmpty); } } - CohereButton { + QtControls.Button { id: cancelButton; anchors { bottom: parent.bottom; right: parent.right; margins: Settings.theme.adjustedPixel(8); } text: "Cancel"; - textColor: "#5b6573"; - textSize: Settings.theme.adjustedPixel(18); - color: "#D2D4D5"; onClicked: dlgStack.replace(addEmpty); } } diff --git a/gemini/qml/welcomepages/cloud/EditGit.qml b/gemini/qml/welcomepages/cloud/EditGit.qml index 86105a46bc7..0e50067dfbd 100644 --- a/gemini/qml/welcomepages/cloud/EditGit.qml +++ b/gemini/qml/welcomepages/cloud/EditGit.qml @@ -1,121 +1,113 @@ /* 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 1.4 as QtControls import org.calligra 1.0 import "../../components" Rectangle { id: base; anchors.fill: parent; anchors.margins: Settings.theme.adjustedPixel(16); property int accountIndex: -1; onAccountIndexChanged: { accountDetails = cloudAccounts.accountDetails(accountIndex); } property string text; onTextChanged: { nameField.text = text; } property QtObject accountDetails; property Component addEmpty; radius: Settings.theme.adjustedPixel(8); color: "white"; Rectangle { anchors { fill: parent; margins: -Settings.theme.adjustedPixel(16); topMargin: -(Settings.theme.adjustedPixel(8) + Constants.GridHeight * 1.5); } opacity: 0.5; color: "white"; MouseArea { anchors.fill: parent; onClicked: { /*nothing */ } } SimpleTouchArea { anchors.fill: parent; onTouched: { /*nothing */ } } } - TextField { + QtControls.TextField { id: nameField; anchors { verticalCenter: parent.verticalCenter; left: parent.left; right: parent.right; margins: Settings.theme.adjustedPixel(16); } - placeholder: "Account Name"; + placeholderText: "Account Name"; } - CohereButton { + QtControls.Button { id: credentialsButton; anchors { top: nameField.bottom; right: parent.right; margins: Settings.theme.adjustedPixel(8); } text: "Edit User Credentials"; - textColor: "#5b6573"; - textSize: Settings.theme.adjustedPixel(18); - color: "#D2D4D5"; onClicked: { dlgStack.push(userCredentials.item); if(accountDetails.readProperty("userForRemote") !== undefined) { dlgStack.currentPage.userForRemote = accountDetails.readProperty("userForRemote"); } if(accountDetails.readProperty("privateKeyFile") !== undefined) { dlgStack.currentPage.privateKeyFile = accountDetails.readProperty("privateKeyFile"); } if(accountDetails.readProperty("publicKeyFile") !== undefined) { dlgStack.currentPage.publicKeyFile = accountDetails.readProperty("publicKeyFile"); } if(accountDetails.readProperty("needsPrivateKeyPassphrase") !== undefined) { dlgStack.currentPage.needsPrivateKeyPassphrase = accountDetails.readProperty("needsPrivateKeyPassphrase"); } } } - CohereButton { + QtControls.Button { id: okButton; anchors { bottom: parent.bottom; right: cancelButton.left; margins: Settings.theme.adjustedPixel(8); } text: "Save"; - textColor: "#5b6573"; - textSize: Settings.theme.adjustedPixel(18); - color: "#D2D4D5"; onClicked: { cloudAccounts.renameAccount(base.accountIndex, nameField.text); dlgStack.replace(addEmpty); } } - CohereButton { + QtControls.Button { id: cancelButton; anchors { bottom: parent.bottom; right: parent.right; margins: Settings.theme.adjustedPixel(8); } text: "Cancel"; - textColor: "#5b6573"; - textSize: Settings.theme.adjustedPixel(18); - color: "#D2D4D5"; onClicked: dlgStack.replace(addEmpty); } Loader { id: userCredentials; source: "git/userCredentialsContainer.qml" } } diff --git a/gemini/qml/welcomepages/cloud/RemoveAccountDlg.qml b/gemini/qml/welcomepages/cloud/RemoveAccountDlg.qml index c936f6482ad..42fdef1b78a 100644 --- a/gemini/qml/welcomepages/cloud/RemoveAccountDlg.qml +++ b/gemini/qml/welcomepages/cloud/RemoveAccountDlg.qml @@ -1,112 +1,104 @@ /* 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 1.4 as QtControls +import org.kde.kirigami 1.0 as Kirigami import org.calligra 1.0 -import "../../components" Rectangle { anchors.fill: parent; anchors.margins: Settings.theme.adjustedPixel(16); property int accountIndex: -1; property string text; onTextChanged: { nameField.text = text; } property Component addEmpty; radius: Settings.theme.adjustedPixel(8); color: "white"; Rectangle { anchors { fill: parent; margins: -Settings.theme.adjustedPixel(16); topMargin: -(Settings.theme.adjustedPixel(8) + Constants.GridHeight * 1.5); } opacity: 0.5; color: "white"; MouseArea { anchors.fill: parent; onClicked: { /*nothing */ } } SimpleTouchArea { anchors.fill: parent; onTouched: { /*nothing */ } } } - Text { + Kirigami.Label { anchors { bottom: parent.verticalCenter; left: parent.left; right: parent.right; margins: Settings.theme.adjustedPixel(16); } verticalAlignment: Text.AlignVCenter; horizontalAlignment: Text.AlignHCenter; - font: Settings.theme.font("application"); text: "Do you wish to remove this account?"; } - Text { + Kirigami.Label { id: nameField; anchors { top: parent.verticalCenter; left: parent.left; right: parent.right; margins: Settings.theme.adjustedPixel(16); } verticalAlignment: Text.AlignVCenter; horizontalAlignment: Text.AlignHCenter; - font: Settings.theme.font("application"); } - Text { + Kirigami.Label { anchors { top: nameField.bottom; left: parent.left; right: parent.right; margins: Settings.theme.adjustedPixel(16); } verticalAlignment: Text.AlignVCenter; horizontalAlignment: Text.AlignHCenter; - font: Settings.theme.font("applicationSemi"); text: "(removing the account will leave all files in place, this only removes it from Calligra Gemini's list)"; } - CohereButton { + QtControls.Button { id: okButton; anchors { bottom: parent.bottom; right: cancelButton.left; margins: Settings.theme.adjustedPixel(8); } text: "Remove Account"; - textColor: "#5b6573"; - textSize: Settings.theme.adjustedPixel(18); - color: "#D2D4D5"; onClicked: { cloudAccounts.removeAccount(base.accountIndex); dlgStack.replace(addEmpty); } } - CohereButton { + QtControls.Button { id: cancelButton; anchors { bottom: parent.bottom; right: parent.right; margins: Settings.theme.adjustedPixel(8); } text: "Cancel"; - textColor: "#5b6573"; - textSize: Settings.theme.adjustedPixel(18); - color: "#D2D4D5"; onClicked: dlgStack.replace(addEmpty); } } diff --git a/gemini/qml/welcomepages/cloud/dropbox/DropboxWebView.qml b/gemini/qml/welcomepages/cloud/dropbox/DropboxWebView.qml index 4a2b33c0730..aa07084ea8d 100644 --- a/gemini/qml/welcomepages/cloud/dropbox/DropboxWebView.qml +++ b/gemini/qml/welcomepages/cloud/dropbox/DropboxWebView.qml @@ -1,54 +1,55 @@ /* 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 QtWebKit 3.0 -import "../../../components" +import org.kde.kirigami 1.0 as Kirigami +import QtQuick.Controls 1.4 as QtControls WebView { id: webView anchors.fill: parent // experimental.userAgent: "Mozilla/5.0 (Linux; U; like Android 4.0.3; ko-kr; Jolla Build/Alpha) AppleWebkit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30" onLoadingChanged: { if(status == WebView.LoadSucceededStatus) { tryingText.visible = false; if(url.toString().length === 48) { controllerMIT.oauth_v1_access_token() } // if(url.toString().length === 140) experimental.test.touchTap(webView, 100, 150) } } - Label { + Kirigami.Label { id: tryingText anchors.centerIn: parent; text: "Trying to load login page..." color: "Grey" z: 10 - BusyIndicator { + QtControls.BusyIndicator { id: b_indicator anchors { top: parent.verticalCenter topMargin: parent.font.pixelSize; horizontalCenter: parent.horizontalCenter } running: parent.visible; } } } diff --git a/gemini/qml/welcomepages/cloud/dropbox/FileNavigator.qml b/gemini/qml/welcomepages/cloud/dropbox/FileNavigator.qml index dadfcec74cd..503944a85d3 100644 --- a/gemini/qml/welcomepages/cloud/dropbox/FileNavigator.qml +++ b/gemini/qml/welcomepages/cloud/dropbox/FileNavigator.qml @@ -1,514 +1,514 @@ /* 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 Calligra.Gemini.Dropbox 1.0 +import QtQuick.Controls 1.4 as QtControls +import org.kde.kirigami 1.0 as Kirigami import "../../../components" Item { id: page; property QtObject model: folderListModel; property string title: ""; property string errorText: ""; property bool have_checked: false; property string currentDir: "/"; property bool downloadWasRequested: false; property string fileMimetype; property string fileName; property QtObject provider; QtObject { id: fakeTheme; property int itemSizeLarge: Settings.theme.adjustedPixel(64); property int paddingLarge: Settings.theme.adjustedPixel(8); property int paddingSmall: Settings.theme.adjustedPixel(8); property int fontSizeLarge: Settings.theme.adjustedPixel(28); property int fontSizeSmall: Settings.theme.adjustedPixel(18); property color secondaryColor: "black"; property color highlightColor: "grey"; } InfoBanner { id: i_infobanner; } Component { id: itemDelegate; - Button { + MouseArea { width: folderListView.cellWidth; height: folderListView.cellHeight; enabled: model.is_dir ? true : Settings.mimeTypeToDocumentClass(model.mime_type) !== DocumentListModel.UnknownType; - opacity: enabled ? 1 : 0.3 + Rectangle { + anchors.fill: parent; + opacity: parent.enabled ? 1 : 0.3 + } Image { id: icon; anchors { top: parent.top; left: parent.left; right: parent.right; margins: Constants.DefaultMargin / 2; } height: parent.width; fillMode: Image.PreserveAspectFit; smooth: true; asynchronous: true; function iconFromDocumentClass(documentClass) { switch(documentClass) { case DocumentListModel.PresentationType: return Settings.theme.icon("SVG-Icon-NewPresentation-1"); break; case DocumentListModel.TextDocumentType: return Settings.theme.icon("SVG-Icon-NewDocument-1"); break; case DocumentListModel.SpreadsheetType: return Settings.theme.icon("SVG-Icon-NewSpreadsheet-1"); break; default: return Settings.theme.icon("SVG-Icon-Cloud-1"); break; } } source: model.is_dir ? Settings.theme.icon("layer_group-black") : iconFromDocumentClass(Settings.mimeTypeToDocumentClass(model.mime_type)); sourceSize.width: width; sourceSize.height: height; } - Label { + Kirigami.Label { id: lblName; anchors { left: parent.left; right: parent.right; bottom: parent.bottom; margins: Constants.DefaultMargin; bottomMargin: Constants.DefaultMargin * 2; } height: font.pixelSize + Constants.DefaultMargin * 2; horizontalAlignment: Text.AlignHCenter; verticalAlignment: Text.AlignVCenter; text:{ var nameof = model.path.split("/") var nameof1 = nameof[nameof.length - 1] if(model.is_dir) { return nameof1; } return "%1 (%2)".arg(nameof1).arg(model.size); } elide: Text.ElideMiddle; font: Settings.theme.font("templateLabel"); color: "#5b6573"; } onClicked: { if(model.is_dir) { controllerMIT.setFolderRoot(model.path) controllerMIT.getlistoffolder() } else { controllerMIT.setCheck(index, true); controllerMIT.downloadSelectedFiles(); var nameof = model.path.split("/"); page.downloadWasRequested = true; page.fileName = nameof[nameof.length - 1]; page.fileMimetype = model.mime_type; pageStack.push(downloadStatus); controllerMIT.start_transfer_process(); } } } } Page { id: downloadStatus; ListView { id: filestransferListView anchors { fill: parent topMargin: Settings.theme.adjustedPixel(64); } model: filesTransferModel delegate: Item { width: downloadStatus.width height: is_finished ? 0 : childrenRect.height; clip: true; Column { id:rec_main spacing: Constants.DefaultMargin; height: childrenRect.height; width: parent.width; Image { id: i_fstatus anchors.horizontalCenter: parent.horizontalCenter; source: Settings.theme.icon("SVG-Icon-Cloud-1"); //is_download ? Settings.theme.image("SVG-Icon-Cloud-1") : "image://theme/icon-s-cloud-upload" } Item { width: parent.width; height: Constants.DefaultMargin; } - Label { + Kirigami.Label { id: l_name anchors.horizontalCenter: parent.horizontalCenter; height: font.pixelSize; text: { var filename1 = model.filename.split("/"); var filename2 = filename1[filename1.length-1]; return filename2; } - color: "black" } - ProgressBar { + QtControls.ProgressBar { id: pb_updown anchors.horizontalCenter: parent.horizontalCenter; visible: !is_finished && !in_queue width: parent.width - 120 height: 18 - progress: progressing + value: progressing } - Label { + Kirigami.Label { id: lb_updown_total anchors.horizontalCenter: parent.horizontalCenter; height: visible ? font.pixelSize : 0; visible: !is_finished && !in_queue - font: Settings.theme.font("templateLabel"); - color: "#5b6573"; text:"" } Connections { target: controllerMIT onProgressBarChanged : { pb_updown.progress = percent if (sent_received || speed){ lb_updown_total.text = (is_download?"Received: ":"Sent: ")+__sent_received_calculate(sent_received) + " | Speed: " +__speed_calculate(speed) }else { console.debug(lb_updown_total.text); } } } } } //end filestransferDeligate onCountChanged: { filestransferListView.visible = (filestransferListView.model.count !== 0) //no_transfers.visible = !filestransferListView.model.count } } //end ListView } GridView { id: folderListView visible:false clip: true; contentWidth: width; anchors.fill: parent; cellWidth: width / 4 - Constants.DefaultMargin; cellHeight: cellWidth + Settings.theme.font("templateLabel").pixelSize + Constants.DefaultMargin * 4; model: folderListModel; delegate: itemDelegate; //section.property: "section" cacheBuffer: 1000 header: Item { id: pageHeader; height: currentDir !== "/" ? backToRootButton.height : 0; width: page.width; - Button { + QtControls.Button { id: backToRootButton; anchors { top: parent.top; margins: fakeTheme.paddingSmall } width: page.width; height: Settings.theme.adjustedPixel(64); opacity: currentDir !== "/" ? 1 : 0; Behavior on opacity{ PropertyAnimation{ duration: Constants.AnimationDuration; } } - image: Settings.theme.icon("SVG-Icon-MenuBack-1"); - imageMargin: Settings.theme.adjustedPixel(8); + iconSource: Settings.theme.icon("SVG-Icon-MenuBack-1"); text: "Back to parent folder" - textColor: "#5B6573"; onClicked: { controllerMIT.backtoRootDir() controllerMIT.getlistoffolder() } } } ScrollDecorator { flickableItem: folderListView; } } Item { id:this_folder_is_empty visible: false anchors.fill: parent - Label { + Kirigami.Label { anchors.centerIn: parent text:"This Folder is Empty" color: "grey" } } Item { id:r_networkerror visible: false anchors.centerIn: parent width: parent.width - fakeTheme.paddingLarge height: r_label_x.height + r_button_x.height; - Label { + Kirigami.Label { id: r_label_x anchors { bottom: r_button_x.top; left: parent.left; right: parent.right; margins: fakeTheme.paddingLarge; } height: paintedHeight; text: "There was a problem loading your Dropbox. It could be lost connection or a slow network. Check your connection or try again later. The reported error was: " + errorText; wrapMode: Text.Wrap; } - Button { + QtControls.Button { id:r_button_x text:"Retry" anchors { horizontalCenter: parent.horizontalCenter; bottom: parent.bottom; } onClicked: { r_networkerror.visible = false b_indicator.visible = true b_indicator_wrap.visible=true controllerMIT.refresh_current_folder() } } } BusyIndicator { id: b_indicator anchors.centerIn: parent running: b_indicator.visible; } MouseArea { id: b_indicator_wrap anchors.fill: parent visible: true } Connections { target: controllerMIT onFolderfinished : { r_networkerror.visible = false folderListView.visible = true b_indicator.visible = false; b_indicator_wrap.visible=false; //tb_back.enabled = !controllerMIT.isRootDir() //f_fastscroll.test() //top_banner.havemenu = true currentDir = controllerMIT.getcurrentdir() changeCurrentDir() this_folder_is_empty.visible = folderListModel.count ? false : true //folderListView.visible = folderListModel.count ? true : false folderListView.visible = folderListModel.count ? true : true folderListView.positionViewAtBeginning(); } onNetwork_error : { //error //top_banner.havemenu = false b_indicator.visible = false; b_indicator_wrap.visible=false; folderListView.visible = false errorText = error; r_networkerror.visible = true } onNotification : { i_infobanner.show(notification); console.log("notification:"+ notification) } onDelete_selected_items_finished: { b_indicator.visible = false; b_indicator_wrap.visible=false; i_infobanner.show(result); console.log("onDelete_selected_items_finished:" + result); } onEnable_download_and_delete_button: { console.log("onEnable_download_and_delete_button") //top_banner.deleteVisible = have_checked //top_banner.addDownloadVisible = have_checked //top_banner.moveVisible = have_checked page.have_checked = have_checked } onStopTransfer: { if (!controllerMIT.is_push_notification()){ i_infobanner.show("Files transfer completed"); } if(page.downloadWasRequested) { page.downloadWasRequested = false; var filePath = controllerMIT.dropboxFolder() + "/" + page.fileName; var docClass = Settings.mimeTypeToDocumentClass(page.fileMimetype); if(docClass !== DocumentListModel.UnknownType) { pageStack.pop(); openFile(filePath, controllerMIT.uploadMostRecentAction()); } else { console.log("Unknown file format " + docClass + " for file " + filePath + " with stated mimetype " + page.fileMimetype); } } refreshDir(); // switch(docClass) { // case DocumentListModel.TextDocument: // pageStack.push(pages.textDocument, { title: page.fileName, path: filePath, mimeType: page.fileMimetype }); // break; // case DocumentListModel.SpreadSheetDocument: // pageStack.push(pages.spreadsheet, { title: page.fileName, path: filePath, mimeType: page.fileMimetype }); // break; // case DocumentListModel.PresentationDocument: // pageStack.push(pages.presentation, { title: page.fileName, path: filePath, mimeType: page.fileMimetype }); // break; // case DocumentListModel.PDFDocument: // pageStack.push(pages.pdf, { title: page.fileName, path: filePath, mimeType: page.fileMimetype }); // break; // default: // console.log("Unknown file format " + docClass + " for file " + filePath + " with stated mimetype " + page.fileMimetype); // break; // } } onCreate_folder_finished: { b_indicator.visible = false; b_indicator_wrap.visible=false; i_infobanner.show(result); console.log("onCreate_folder_finished:" + result) } onRename_folder_finished: { b_indicator.visible = false; b_indicator_wrap.visible=false; i_infobanner.show(result); } onMove_files_folders_finished: { b_indicator.visible = false; b_indicator_wrap.visible=false; m_is_move = false m_is_copy = false toolicon_show(true); i_infobanner.show(result); } onShares_finished:{ //result b_indicator.visible = false; b_indicator_wrap.visible=false; if (!result){ i_infobanner.show("Could not create share link, try again later."); } } onShares_metadata:{ //url, expire sharemetadatadlg.url = url pageStack.push(sharemetadatadlg) } onAccountinfo_finished: { //result b_indicator.visible = false; b_indicator_wrap.visible=false; } onAccountinfo_metadata: { //result var val=[] for(var i=0; i<6;i++){ if (i==0) val.push(result['display_name']) else if(i==1) val.push(result['email']) else if(i==2) val.push(result['uid']) else if(i==3) val.push(__convertToMB(result['quota_info']['shared'])) else if(i==4) val.push(__convertToMB(result['quota_info']['quota'])) else val.push(__convertToMB(result['quota_info']['normal'])) } accountinfodlg.m_data = val pageStack.push(accountinfodlg) } } Component.onCompleted: { controllerMIT.need_authenticate() controllerMIT.getlistoffolder() } // CohereButton { // id:tb_back // anchors { // bottom: page.bottom; // right: page.right; // } // enabled: !controllerMIT.isRootDir() // onClicked: { // controllerMIT.backtoRootDir() // controllerMIT.getlistoffolder() // } // text: "Back"; // textColor: "#5b6573"; // textSize: Settings.theme.adjustedPixel(18); // color: "#D2D4D5"; // } function changeCurrentDir(){ var maxlength = 30 if (page.width > page.height) maxlength = 70 if (!currentDir.length) currentDir = "/" if (currentDir.length >= maxlength) currentDir = currentDir.substring(0,maxlength-10) + " ... " + currentDir.substring(currentDir.length-10,currentDir.length) } function refreshDir(){ b_indicator.visible = true; b_indicator_wrap.visible=true; controllerMIT.refresh_current_folder() } function toFixed(value, precision) { var power = Math.pow(10, precision || 0); return String(Math.round(value * power) / power); } function __sent_received_calculate(bytes){ if (bytes < 1024) return toFixed(bytes,2)+ " bytes" else if (bytes < 1024*1024) return toFixed((bytes/1024),2)+ " KB" else return toFixed(((bytes/1024)/1024),2) + " MB" } function __speed_calculate(bytes){ if (bytes < 1024) return toFixed(bytes,2) + " bps" else if(bytes < 1024*1024) return toFixed((bytes/1024),2) + " Kbps" else return toFixed(((bytes/1024)/1024),2) + " Mbps" } } diff --git a/gemini/qml/welcomepages/cloud/dropbox/SetupPage.qml b/gemini/qml/welcomepages/cloud/dropbox/SetupPage.qml index d3fc4732425..a576ad34967 100644 --- a/gemini/qml/welcomepages/cloud/dropbox/SetupPage.qml +++ b/gemini/qml/welcomepages/cloud/dropbox/SetupPage.qml @@ -1,139 +1,132 @@ /* 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 Calligra.Gemini.Dropbox 1.0 +import QtQuick.Controls 1.4 as QtControls +import org.kde.kirigami 1.0 as Kirigami import "../../../components" Item { anchors.fill: parent; clip: true; Rectangle { anchors.fill: parent; opacity: 0.6; } Item { id: header; anchors { top: parent.top; left: parent.left; right: parent.right; } height: Settings.theme.adjustedPixel(64); } Item { anchors { left: parent.left; right: parent.right; top: header.bottom; } height: Constants.GridHeight; CohereButton { anchors.centerIn: parent; textColor: "#5b6573"; textSize: Settings.theme.adjustedPixel(18); color: "#D2D4D5"; text: controllerMIT.needAuthenticate ? "Log in to DropBox" : "Log out of DropBox"; onClicked: { if(controllerMIT.needAuthenticate) { pageStack.push( loginPage ); } else { signOutNow(); } } - Text { + Kirigami.Label { anchors { top: parent.bottom; topMargin: Settings.theme.adjustedPixel(16); horizontalCenter: parent.horizontalCenter; } visible: !controllerMIT.needAuthenticate; - font: Settings.theme.font("application"); width: parent.parent.width / 2; height: font.pixelSize * 6; horizontalAlignment: Text.AlignHCenter; verticalAlignment: Text.AlignTop; wrapMode: Text.Wrap; text: "You are already signed into DropBox, and we only support one DropBox account. To sign in as another user, please click on the button above to sign out of your current account first."; } } } Component { id: loginPage; LoginPage { } } Page { id: signoutconfirmationDlg //PageHeader { title: "Log Out" } Rectangle { anchors.fill: parent; anchors.margins: Settings.theme.adjustedPixel(16); radius: Settings.theme.adjustedPixel(8); color: "white"; - Text { + Kirigami.Label { anchors { bottom: signoutButtonsRow.top; left: parent.left; right: parent.right; margins: Constants.DefaultMargin; } - color: "black" - font: Settings.theme.font("application"); wrapMode: Text.Wrap horizontalAlignment: Text.AlignHCenter text: "Do you really want to log out of DropBox?" } Row { id: signoutButtonsRow; anchors.centerIn: parent; width: childrenRect.width; spacing: Settings.theme.adjustedPixel(8); - CohereButton { - textColor: "#5b6573"; - textSize: Settings.theme.adjustedPixel(18); - color: "#D2D4D5"; + QtControls.Button { text: "Yes" onClicked: { controllerMIT.logout() pageStack.pop() } } - CohereButton { - textColor: "#5b6573"; - textSize: Settings.theme.adjustedPixel(18); - color: "#D2D4D5"; + QtControls.Button { text: "No" onClicked: { pageStack.pop() } } } } } InfoBanner { id: i_infobanner; } function signOutNow(){ if (!controllerMIT.is_transfer()){ pageStack.push(signoutconfirmationDlg) }else{ i_infobanner.show("Please complete the upload/download tasks in Files Transfer before Sign out."); } } } diff --git a/gemini/qml/welcomepages/cloud/git/CreateCheckout.qml b/gemini/qml/welcomepages/cloud/git/CreateCheckout.qml index df9fafecd7f..8c4cf901878 100644 --- a/gemini/qml/welcomepages/cloud/git/CreateCheckout.qml +++ b/gemini/qml/welcomepages/cloud/git/CreateCheckout.qml @@ -1,215 +1,209 @@ /* 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 Calligra.Gemini.Git 1.0 import QtQuick.Controls 1.4 as QtControls import org.kde.kirigami 1.0 as Kirigami import "../../../components" Item { id: base; property string userForRemote; property string privateKeyFile; property string publicKeyFile; property bool needsPrivateKeyPassphrase; Component { id: accountComp; QtObject { property string localrepo: checkoutDir.text; property string userForRemote: base.userForRemote; property string privateKeyFile: base.privateKeyFile; property string publicKeyFile: base.publicKeyFile; property bool needsPrivateKeyPassphrase: base.needsPrivateKeyPassphrase; } } Column { width: parent.width; height: childrenRect.height; Kirigami.Heading { text: "Add Git Account" width: parent.width; } Text { id: typeChooser; anchors.right: parent.right; width: parent.width - (height / 2); height: existingCheckoutSelector.height + Settings.theme.adjustedPixel(16); verticalAlignment: Text.AlignVCenter font: Settings.theme.font("application"); text: "Type of repository:"; CohereButton { id: existingCheckoutSelector; anchors { right: newCheckoutSelector.left; verticalCenter: parent.verticalCenter; } text: "Existing Clone"; textColor: "#5b6573"; textSize: Settings.theme.adjustedPixel(18); checkedColor: "#D2D4D5"; checked: true; onClicked: { if(!checked) { checked = true; newCheckoutSelector.checked = false; } } } CohereButton { id: newCheckoutSelector; anchors{ right: parent.right; verticalCenter: parent.verticalCenter; } text: "New Clone"; textColor: "#5b6573"; textSize: Settings.theme.adjustedPixel(18); checkedColor: "#D2D4D5"; onClicked: { if(!checked) { checked = true; existingCheckoutSelector.checked = false; } } } } QtControls.TextField { id: checkoutName; width: parent.width; placeholderText: "Short name for this account"; } Item { width: parent.width; height: checkoutDir.height; QtControls.TextField { id: checkoutDir; anchors { left: parent.left; right: checkoutBrowse.left; } placeholderText: "Local clone location"; } QtControls.Button { id: checkoutBrowse; anchors { top: checkoutDir.top; right: parent.right; bottom: checkoutDir.bottom; } text: "Browse..."; onClicked: { var newDir = GitCheckoutCreator.getDir(); if(newDir !== "") { checkoutDir.text = newDir; } } } } QtControls.TextField { id: newCheckoutServer; width: parent.width; height: newCheckoutSelector.checked ? Constants.GridHeight : 0; Behavior on height { PropertyAnimation { duration: Constants.AnimationDuration; } } opacity: height === 0 ? 0 : 1; Behavior on opacity { PropertyAnimation { duration: Constants.AnimationDuration; } } placeholderText: "Clone URL (https or git)"; } - CohereButton { + QtControls.Button { anchors.right: parent.right; onClicked: dlgStack.push(userCredentials); text: "Set User Credentials"; - textColor: "#5b6573"; - textSize: Settings.theme.adjustedPixel(18); - color: "#D2D4D5"; } Kirigami.Label { id: errorLabel; width: parent.width; height: cloneAdd.height + Settings.theme.adjustedPixel(16); verticalAlignment: Text.AlignVCenter color: "red"; - CohereButton { + QtControls.Button { id: cloneAdd; anchors { verticalCenter: parent.verticalCenter; right: parent.right; } text: "Add Now"; - textColor: "#5b6573"; - textSize: Settings.theme.adjustedPixel(18); - color: "#D2D4D5"; onClicked: { if(checkoutName.text.length < 1) { errorLabel.text = "You need to enter a name for the account." return; } if(checkoutDir.text.length < 1) { errorLabel.text = "You must select a location." return; } if(base.userForRemote.length < 1 || base.privateKeyFile.length < 1 || base.publicKeyFile.length < 1) { errorLabel.text = "You need to enter your credentials."; return; } var createAccount = true; if(newCheckoutSelector.checked) { if(newCheckoutServer.text.length < 1) { errorLabel.text = "You have to enter a remote server location for the clone."; return; } var repoDir = GitCheckoutCreator.createClone(checkoutName.text, newCheckoutServer.text, checkoutDir.text, accountComp.createObject(cloudAccounts)); if(repoDir.length > 0) { checkoutDir.text = repoDir; } else { createAccount = false; } } else { if(!GitCheckoutCreator.isGitDir(checkoutDir.text)) { errorLabel.text = "You must select a location which is actually a git repository." return; } } if(createAccount) { cloudAccounts.addAccount(checkoutName.text, "Git", "accountsPageGit", accountComp.createObject(cloudAccounts)); dlgStack.replace(addEmpty); } } } } } Component { id: userCredentials; GetUserCredentials { onAccepted: { base.userForRemote = userForRemote; base.privateKeyFile = privateKeyFile; base.publicKeyFile = publicKeyFile; base.needsPrivateKeyPassphrase = needsPrivateKeyPassphrase; dlgStack.pop(); } onCancelled: { dlgStack.pop(); } } } } diff --git a/gemini/qml/welcomepages/cloud/git/GetUserCredentials.qml b/gemini/qml/welcomepages/cloud/git/GetUserCredentials.qml index 48e02fcfe1c..cfe076e63fe 100644 --- a/gemini/qml/welcomepages/cloud/git/GetUserCredentials.qml +++ b/gemini/qml/welcomepages/cloud/git/GetUserCredentials.qml @@ -1,187 +1,176 @@ /* 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 Calligra.Gemini.Git 1.0 +import QtQuick.Controls 1.4 as QtControls import "../../../components" Item { id: base; signal accepted(); signal cancelled(); property alias userForRemote: userName.text; property alias privateKeyFile: privateKey.text; property alias needsPrivateKeyPassphrase: needsPassphrase.checked; property alias publicKeyFile: publicKey.text; anchors.margins: Settings.theme.adjustedPixel(32); Rectangle { anchors { fill: parent; margins: -Settings.theme.adjustedPixel(48); } opacity: 0.7; color: "white"; MouseArea { anchors.fill: parent; onClicked: { /*nothing */ } } SimpleTouchArea { anchors.fill: parent; onTouched: { /*nothing */ } } } Text { id: pageTitle; anchors { left: parent.left; right: parent.right bottom: pageContent.top; bottomMargin: Settings.theme.adjustedPixel(8); } height: font.pixelHeight + Settings.theme.adjustedPixel(16); font: Settings.theme.font("pageHeader"); verticalAlignment: Text.AlignVCenter; horizontalAlignment: Text.AlignHCenter; text: "User Credentials"; Rectangle { anchors { left: parent.left; right: parent.right; bottom: parent.bottom; } height: 1; color: "black"; opacity: 0.1; } } Item { id: pageContent; anchors { left: parent.left; right: parent.right; verticalCenter: parent.verticalCenter; } height: contentColumn.height; Column { id: contentColumn; anchors { verticalCenter: parent.verticalCenter; left: parent.left; right: parent.right; } height: childrenRect.height; - TextField { + QtControls.TextField { id: userName; width: parent.width; - placeholder: "Username"; + placeholderText: "Username"; } Item { height: privateKey.height; width: parent.width; - TextField { + QtControls.TextField { id: privateKey; width: parent.width - privateKeyBrowse.width; anchors.right: privateKeyBrowse.left; - placeholder: "Private Key File"; + placeholderText: "Private Key File"; } - CohereButton { + QtControls.Button { id: privateKeyBrowse; anchors { verticalCenter: privateKey.verticalCenter; right: parent.right; } text: "Browse..."; - textColor: "#5b6573"; - textSize: Settings.theme.adjustedPixel(18); - color: "#D2D4D5"; onClicked: { var newFile = GitCheckoutCreator.getFile("Private Key File", "*", ".ssh"); if(newFile !== "") { privateKey.text = newFile; } } } } Item { height: publicKey.height; width: parent.width; - TextField { + QtControls.TextField { id: publicKey; width: parent.width - privateKeyBrowse.width; anchors.right: publicKeyBrowse.left; - placeholder: "Public Key File"; + placeholderText: "Public Key File"; } - CohereButton { + QtControls.Button { id: publicKeyBrowse; anchors { verticalCenter: publicKey.verticalCenter; right: parent.right; } text: "Browse..."; - textColor: "#5b6573"; - textSize: Settings.theme.adjustedPixel(18); - color: "#D2D4D5"; onClicked: { var newFile = GitCheckoutCreator.getFile("Public Key File", "*.pub", ".ssh"); if(newFile !== "") { publicKey.text = newFile; } } } } CheckBox { id: needsPassphrase; width: parent.width; text: "Does the private key require a password to unlock it?"; } } Rectangle { anchors { left: parent.left; right: parent.right; bottom: parent.bottom; } height: 1; color: "black"; opacity: 0.1; } } - CohereButton { + QtControls.Button { id: acceptButton; anchors { top: pageContent.bottom; right: cancelButton.left; margins: Settings.theme.adjustedPixel(8); } text: "Accept"; - textColor: "#5b6573"; - textSize: Settings.theme.adjustedPixel(18); - color: "#D2D4D5"; onClicked: base.accepted(); } - CohereButton { + QtControls.Button { id: cancelButton; anchors { top: pageContent.bottom; right: parent.right; margins: Settings.theme.adjustedPixel(8); } text: "Cancel"; - textColor: "#5b6573"; - textSize: Settings.theme.adjustedPixel(18); - color: "#D2D4D5"; onClicked: base.cancelled(); } }