From 7f6b093e5ff47a1b0c5a6747ef94f4f96c39184d Mon Sep 17 00:00:00 2001 From: Peter Petrik Date: Fri, 1 Dec 2023 12:50:15 +0100 Subject: [PATCH] initial cut --- app/projectsmodel.cpp | 16 -- app/projectsmodel.h | 8 +- app/qml/AccountPage.qml | 394 -------------------------- app/qml/CMakeLists.txt | 2 - app/qml/LoginForm.qml | 5 + app/qml/ProjectPanel.qml | 427 +---------------------------- app/qml/RegistrationFinishPage.qml | 83 ------ 7 files changed, 12 insertions(+), 923 deletions(-) delete mode 100644 app/qml/AccountPage.qml delete mode 100644 app/qml/RegistrationFinishPage.qml diff --git a/app/projectsmodel.cpp b/app/projectsmodel.cpp index c53c18cafd..88f1cc4030 100644 --- a/app/projectsmodel.cpp +++ b/app/projectsmodel.cpp @@ -34,7 +34,6 @@ void ProjectsModel::initializeProjectsModel() QObject::connect( mBackend, &MerginApi::projectDetached, this, &ProjectsModel::onProjectDetachedFromMergin ); QObject::connect( mBackend, &MerginApi::projectAttachedToMergin, this, &ProjectsModel::onProjectAttachedToMergin ); - QObject::connect( mBackend, &MerginApi::authChanged, this, &ProjectsModel::onAuthChanged ); if ( mModelType == ProjectModelTypes::LocalProjectsModel ) { @@ -544,17 +543,6 @@ void ProjectsModel::onProjectAttachedToMergin( const QString & ) listProjectsByName(); } -void ProjectsModel::onAuthChanged() -{ - if ( !mBackend->userAuth() || !mBackend->userAuth()->hasAuthData() ) // user logged out, clear created and shared lists - { - if ( mModelType == CreatedProjectsModel || mModelType == SharedProjectsModel ) - { - clearProjects(); - } - } -} - void ProjectsModel::setMerginApi( MerginApi *merginApi ) { if ( !merginApi || mBackend == merginApi ) @@ -586,10 +574,6 @@ QString ProjectsModel::modelTypeToFlag() const { switch ( mModelType ) { - case CreatedProjectsModel: - return QStringLiteral( "created" ); - case SharedProjectsModel: - return QStringLiteral( "shared" ); case WorkspaceProjectsModel: return QStringLiteral( "workspace" ); case PublicProjectsModel: diff --git a/app/projectsmodel.h b/app/projectsmodel.h index 27cba6f6cf..60bcc49345 100644 --- a/app/projectsmodel.h +++ b/app/projectsmodel.h @@ -29,7 +29,7 @@ class LocalProjectsManager; * * Model can have different types that affect handling of the projects. * - LocalProjectsModel always keeps all local projects and seek their mergin part when listProjectsByNameFinished - * - Created-, Shared-, and PublicProjectsModel does the opposite, keeps all mergin projects and seeks their local part in projects from LocalProjectsManager + * - Workspace-, and PublicProjectsModel does the opposite, keeps all mergin projects and seeks their local part in projects from LocalProjectsManager * - EmptyProjectsModel is default state * * To avoid overriding of requests, model remembers last sent request ID and upon receiving signal from MerginAPI about listProjectsFinished, it firsts compares @@ -68,15 +68,13 @@ class ProjectsModel : public QAbstractListModel /** * \brief The ProjectModelTypes enum: * - LocalProjectsModel always keeps all local projects and seek their mergin part when listProjectsByNameFinished - * - Created-, Shared-, and PublicProjectsModel does the opposite, keeps all mergin projects and seeks their local part in projects from LocalProjectsManager + * - Workspace-, and PublicProjectsModel does the opposite, keeps all mergin projects and seeks their local part in projects from LocalProjectsManager * - EmptyProjectsModel is default state */ enum ProjectModelTypes { EmptyProjectsModel = 0, // default, holding no projects ~ invalid model LocalProjectsModel, - CreatedProjectsModel, - SharedProjectsModel, PublicProjectsModel, WorkspaceProjectsModel, RecentProjectsModel @@ -165,8 +163,6 @@ class ProjectsModel : public QAbstractListModel void onAboutToRemoveProject( const LocalProject &project ); void onProjectDataChanged( const LocalProject &project ); - void onAuthChanged(); - void setMerginApi( MerginApi *merginApi ); void setModelType( ProjectModelTypes modelType ); void setSyncManager( SynchronizationManager *newSyncManager ); diff --git a/app/qml/AccountPage.qml b/app/qml/AccountPage.qml deleted file mode 100644 index 23c8b98e8c..0000000000 --- a/app/qml/AccountPage.qml +++ /dev/null @@ -1,394 +0,0 @@ -/*************************************************************************** - * * - * 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. * - * * - ***************************************************************************/ - -import QtQuick -import QtQuick.Controls -import Qt5Compat.GraphicalEffects -import QtQuick.Layouts -import QtQuick.Dialogs -import lc 1.0 -import "." // import InputStyle singleton -import "./components" - -Page { - signal back - signal managePlansClicked - signal signOutClicked - signal accountDeleted - property color bgColor: "white" - property real fieldHeight: InputStyle.rowHeight - - property string username: __merginApi.userAuth.username - property string email: __merginApi.userInfo.email - property int diskUsage: __merginApi.workspaceInfo.diskUsage - property int storageLimit: __merginApi.workspaceInfo.storageLimit - property string planAlias: __merginApi.subscriptionInfo.planAlias - property int subscriptionStatus: __merginApi.subscriptionInfo.subscriptionStatus - property string subscriptionsTimestamp: __merginApi.subscriptionInfo.subscriptionTimestamp - property string nextBillPrice: __merginApi.subscriptionInfo.nextBillPrice - property bool ownsActiveSubscription: __merginApi.subscriptionInfo.ownsActiveSubscription - property bool apiSupportsSubscriptions: __merginApi.apiSupportsSubscriptions - - id: root - visible: true - - - // ///////////////// - // header - PanelHeader { - id: header - height: InputStyle.rowHeightHeader - width: parent.width - color: InputStyle.clrPanelMain - rowHeight: InputStyle.rowHeightHeader - titleText: qsTr("My Account") - onBack: root.back() - withBackButton: true - } - - - ScrollView { - id: scrollView - anchors.top: header.bottom - width: root.width - height: root.height - header.height - contentHeight: accountBodyContainer.height + footer.height - clip: true - - // ///////////////// - // Body - Column { - id: accountBodyContainer - width: root.width - height: Math.max(accountBodyContainer.childrenRect.height, scrollView.height - footer.height) - - // avatar - Row { - id: avatarContainer - height: InputStyle.rowHeightHeader * 2 - anchors.horizontalCenter: parent.horizontalCenter - - Item { - id: avatar - width: avatarContainer.height - height: width - - Rectangle { - id: avatarImage - anchors.centerIn: parent - width: avatar.width * 0.8 - height: width - color: InputStyle.fontColor - radius: width*0.5 - antialiasing: true - - Image { - id: userIcon - anchors.centerIn: parent - source: InputStyle.accountIcon - height: parent.height * 0.8 - width: height - sourceSize.width: width - sourceSize.height: height - fillMode: Image.PreserveAspectFit - } - - ColorOverlay { - anchors.fill: userIcon - source: userIcon - color: "#FFFFFF" - } - } - } - } - - TextWithIcon { - width: parent.width - height: InputStyle.rowHeight - source: InputStyle.accountIcon - text: root.username - } - - TextWithIcon { - width: parent.width - height: InputStyle.rowHeight - source: InputStyle.envelopeIcon - text: root.email - } - - TextWithIcon { - width: parent.width - height: InputStyle.rowHeight - visible: root.apiSupportsSubscriptions - source: InputStyle.editIcon - text: root.planAlias - } - - TextWithIcon { - width: parent.width - height: InputStyle.rowHeight - visible: root.subscriptionStatus === MerginSubscriptionStatus.SubscriptionUnsubscribed - source: InputStyle.infoIcon - text: qsTr("Your subscription will not auto-renew after %1") - .arg(root.subscriptionsTimestamp) - } - - TextWithIcon { - width: parent.width - height: InputStyle.rowHeight - visible: root.subscriptionStatus === MerginSubscriptionStatus.SubscriptionInGracePeriod - source: InputStyle.exclamationTriangleIcon - onLinkActivated: function( link ) { - Qt.openUrlExternally(link) - } - text: qsTr("Please update your %1billing details%2 as soon as possible") - .arg("") - .arg("") - iconColor: InputStyle.highlightColor - } - - TextWithIcon { - width: parent.width - height: InputStyle.rowHeight - visible: root.subscriptionStatus === MerginSubscriptionStatus.ValidSubscription - source: InputStyle.todayIcon - text: qsTr("Your next bill will be for %1 on %2") - .arg(root.nextBillPrice) - .arg(root.subscriptionsTimestamp) - } - - TextWithIcon { - width: parent.width - height: InputStyle.rowHeight - visible: root.subscriptionStatus === MerginSubscriptionStatus.CanceledSubscription - source: InputStyle.todayIcon - text: qsTr("Your subscription was cancelled on %1") - .arg(root.subscriptionsTimestamp) - } - - Row { - width: parent.width - Item { - width: root.fieldHeight - height: root.fieldHeight - - CircularProgressBar { - id: storageIcon - width: parent.width*0.6 - anchors.centerIn: parent - height: width - value: root.diskUsage/root.storageLimit - } - } - - Text { - id: textItem - height: root.fieldHeight - verticalAlignment: Text.AlignVCenter - font.pixelSize: InputStyle.fontPixelSizeNormal - color: InputStyle.fontColor - text: qsTr("Using %1 / %2").arg(__inputUtils.bytesToHumanSize(root.diskUsage)).arg(__inputUtils.bytesToHumanSize(root.storageLimit)) - } - } - - Item { - //spacer - height: 10 * InputStyle.dp - width: parent.width - } - - Button { - id: subscribeButton - width: root.width - 2 * InputStyle.rowHeightHeader - anchors.horizontalCenter: parent.horizontalCenter - visible: __merginApi.apiSupportsSubscriptions - - height: InputStyle.rowHeightHeader - text: root.ownsActiveSubscription ? qsTr("Manage Subscription") : qsTr("Subscription plans") - font.pixelSize: InputStyle.fontPixelSizeBig - - background: Rectangle { - color: InputStyle.highlightColor - } - - onClicked: managePlansClicked() - - contentItem: Text { - text: subscribeButton.text - font: subscribeButton.font - opacity: enabled ? 1.0 : 0.3 - color: "white" - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - elide: Text.ElideRight - } - } - } - - // ///////////////// - // Footer - Item { - id: footer - height: InputStyle.rowHeight * 2 - width: parent.width - anchors.bottom: parent.bottom - anchors.horizontalCenter: parent.horizontalCenter - - Column { - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - spacing: 5 - - Button { - id: signOutButton - height: InputStyle.rowHeightHeader - text: qsTr("Sign out") - font.pixelSize: InputStyle.fontPixelSizeNormal - font.bold: true - anchors.horizontalCenter: parent.horizontalCenter - background: Rectangle { - color: root.bgColor - } - - onClicked: signOutClicked() - - contentItem: Text { - text: signOutButton.text - font: signOutButton.font - color: InputStyle.highlightColor - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - elide: Text.ElideRight - } - } - - Button { - id: deleteAccountButton - height: InputStyle.rowHeightHeader - text: qsTr("Delete account") - font.pixelSize: InputStyle.fontPixelSizeNormal - font.bold: true - anchors.horizontalCenter: parent.horizontalCenter - background: Rectangle { - color: root.bgColor - } - - onClicked: accountDeleteDialog.open() - - contentItem: Text { - text: deleteAccountButton.text - font: deleteAccountButton.font - color: InputStyle.invalidButtonColor - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - elide: Text.ElideRight - } - } - - } - } - - Dialog { - id: accountDeleteDialog - visible: false - modal: true - spacing: InputStyle.panelSpacing - anchors.centerIn: parent - leftMargin: InputStyle.panelMargin - rightMargin: InputStyle.panelMargin - title: qsTr( "Delete account?" ) - - contentItem: ColumnLayout { - id: column - Label { - id: label - text: qsTr("This action will delete your Mergin Maps account with all your projects, " + - "both on the device and on the server. This action cannot be undone. " + - "If you have an Apple subscription you need to cancel it manually.\n\n" + - "In order to delete your account, enter your username in the field below and click Yes.") - Layout.fillWidth: true - wrapMode: Text.WordWrap - } - TextField { - id: usernameField - placeholderText: qsTr("Enter username") - Layout.fillWidth: true - onTextEdited: function() { - buttons.standardButton(Dialog.Yes).enabled = (text === username) - } - } - } - - footer: DialogButtonBox { - id: buttons - standardButtons: Dialog.Yes | Dialog.No - } - - onAboutToShow: { - buttons.standardButton(Dialog.Yes).enabled = false; - } - - onAboutToHide: { - usernameField.clear() - } - - onAccepted: { - close() - accountDeleteIndicator.running = true - __merginApi.deleteAccount() - } - onRejected: { - close() - } - } - - MessageDialog { - id: accountDeletionFailedDialog - - visible: false - title: qsTr( "Failed to remove account" ) - text: qsTr( "An error occured while removing your account" ) - buttons: MessageDialog.Close - - onButtonClicked: function( clickedButton ) { - close() - } - } - - BusyIndicator { - id: accountDeleteIndicator - width: root.width/8 - height: width - running: false - visible: running - anchors.centerIn: parent - z: root.z + 1 - } - - Connections { - target: __merginApi - - function onUserIsAnOrgOwnerError() { - accountDeleteIndicator.running = false - accountDeletionFailedDialog.text = qsTr("Can not close account because user is the only owner of an organisation.\n\n" + - "Please go to the Mergin Maps website to remove it manually.") - accountDeletionFailedDialog.open() - } - function onAccountDeleted( result ) { - accountDeleteIndicator.running = false - if ( result ) { - accountDeleted() - } - else { - accountDeletionFailedDialog.open() - } - } - } - } -} diff --git a/app/qml/CMakeLists.txt b/app/qml/CMakeLists.txt index adfdf6ac83..21d1ba9fe5 100644 --- a/app/qml/CMakeLists.txt +++ b/app/qml/CMakeLists.txt @@ -89,7 +89,6 @@ set(MM_QML misc/NoWorkspaceBanner.qml misc/PositionProviderPage.qml AboutPanel.qml - AccountPage.qml AuthPanel.qml Banner.qml ChangelogPanel.qml @@ -121,7 +120,6 @@ set(MM_QML ProjectStatusPanel.qml ProjectWizardPage.qml RegistrationForm.qml - RegistrationFinishPage.qml RoundIndicator.qml SearchBar.qml SettingsComboBoxItem.qml diff --git a/app/qml/LoginForm.qml b/app/qml/LoginForm.qml index fa04ddfec7..76fe9b15cf 100644 --- a/app/qml/LoginForm.qml +++ b/app/qml/LoginForm.qml @@ -230,9 +230,14 @@ Rectangle { } visible: { + if ( __merginApi.serverType !== MerginServerType.OLD ) { + return false; + } + if ( __merginApi.serverType === MerginServerType.CE ) { return false; } + return true; } } diff --git a/app/qml/ProjectPanel.qml b/app/qml/ProjectPanel.qml index 87146f58f2..8498175944 100644 --- a/app/qml/ProjectPanel.qml +++ b/app/qml/ProjectPanel.qml @@ -107,7 +107,7 @@ Item { return false; } // do not show the banner in case of accepting invitation or creating a workspace - if (stackView.currentItem && (stackView.currentItem.objectName === "registrationFinishPanel" || stackView.currentItem.objectName === "createWorkspacePanel")) { + if (stackView.currentItem && stackView.currentItem.objectName === "createWorkspacePanel") { return false; } return !__merginApi.userInfo.hasWorkspaces @@ -127,7 +127,7 @@ Item { StackView { id: stackView - initialItem: __merginApi.serverType === MerginServerType.OLD ? projectsPanelComp : workspaceProjectsPanelComp + initialItem: workspaceProjectsPanelComp anchors { top: noWorkspaceBanner.visible ? noWorkspaceBanner.bottom : parent.top @@ -177,17 +177,6 @@ Item { return false; } - function switchUI() { - stackView.clear( StackView.Immediate ) - - if ( __merginApi.serverType === MerginServerType.OLD ) { - stackView.push( projectsPanelComp ) - } - else { - stackView.push( workspaceProjectsPanelComp ) - } - } - Keys.onReleased: function( event ) { if (event.key === Qt.Key_Back || event.key === Qt.Key_Escape) { event.accepted = true; @@ -217,363 +206,6 @@ Item { z: parent.z + 1 } - Component { - id: projectsPanelComp - - Page { - id: projectsPage - - function refreshProjectList( keepSearchFilter = false ) { - stackView.pending = true - switch( pageContent.state ) { - case "local": - localProjectsPage.refreshProjectsList( keepSearchFilter ) - break - case "created": - createdProjectsPage.refreshProjectsList( keepSearchFilter ) - break - case "shared": - sharedProjectsPage.refreshProjectsList( keepSearchFilter ) - break - case "public": - publicProjectsPage.refreshProjectsList( keepSearchFilter ) - break - } - } - - header: PanelHeader { - id: pageHeader - - titleText: qsTr("Projects") - color: InputStyle.clrPanelMain - height: InputStyle.rowHeightHeader - rowHeight: InputStyle.rowHeightHeader - - onBack: { - if ( root.activeProjectId ) { - root.hidePanel() - } - } - withBackButton: root.activeProjectId - - Item { - id: avatar - - width: InputStyle.rowHeightHeader * 0.8 - height: InputStyle.rowHeightHeader - anchors.right: parent.right - anchors.rightMargin: InputStyle.panelMargin - - Rectangle { - id: avatarImage - - anchors.centerIn: parent - width: avatar.width - height: avatar.width - color: InputStyle.fontColor - radius: width*0.5 - antialiasing: true - - MouseArea { - anchors.fill: parent - onClicked: { - if ( __merginApi.userAuth.hasAuthData() && __merginApi.apiVersionStatus === MerginApiStatus.OK ) { - __merginApi.getUserInfo() - - if ( __merginApi.apiSupportsSubscriptions ) { - __merginApi.getServiceInfo() - } - - if ( __merginApi.serverType === MerginServerType.OLD ) { - stackView.push( accountPanelComp ) - } - else { - stackView.push( workspaceAccountPageComp ) - } - - } - else { - root.openAuthPanel() - } - } - } - - Image { - id: userIcon - - anchors.centerIn: avatarImage - source: InputStyle.accountIcon - height: avatarImage.height * 0.8 - width: height - sourceSize.width: width - sourceSize.height: height - fillMode: Image.PreserveAspectFit - } - - ColorOverlay { - anchors.fill: userIcon - source: userIcon - color: "#FFFFFF" - } - } - } - } - - background: Rectangle { - anchors.fill: parent - color: InputStyle.clrPanelMain - } - - Item { - id: pageContent - - anchors.fill: parent - - states: [ - State { - name: "local" - }, - State { - name: "created" - }, - State { - name: "shared" - }, - State { - name: "public" - } - ] - - state: root.visible ? "local" : "" - - onStateChanged: { - __merginApi.pingMergin() - projectsPage.refreshProjectList() - pageFooter.setActiveButton( pageContent.state ) - } - - Connections { - target: root - function onVisibleChanged() { - if ( root.visible ) { - pageContent.state = "local" - } - else { - pageContent.state = "" - } - } - - function onResetView() { - if ( pageContent.state === "created" || pageContent.state === "shared" ) - pageContent.state = "local" - } - - function onRefreshProjects() { - projectsPage.refreshProjectList() - } - } - - StackLayout { - id: projectListLayout - - anchors.fill: parent - currentIndex: pageFooter.currentIndex - - ProjectListPage { - id: localProjectsPage - - projectModelType: ProjectsModel.LocalProjectsModel - activeProjectId: root.activeProjectId - list.visible: !stackView.pending - - onOpenProjectRequested: function( projectFilePath ) { - setupProjectOpen( projectFilePath ) - } - onShowLocalChangesRequested: function( projectId ) { - showChanges( projectId ) - } - list.onActiveProjectDeleted: setupProjectOpen( "" ) - } - - ProjectListPage { - id: createdProjectsPage - - projectModelType: ProjectsModel.CreatedProjectsModel - activeProjectId: root.activeProjectId - list.visible: !stackView.pending - - onOpenProjectRequested: function( projectFilePath ) { - setupProjectOpen( projectFilePath ) - } - onShowLocalChangesRequested: function( projectId ) { - showChanges( projectId ) - } - list.onActiveProjectDeleted: setupProjectOpen( "" ) - } - - ProjectListPage { - id: sharedProjectsPage - - projectModelType: ProjectsModel.SharedProjectsModel - activeProjectId: root.activeProjectId - list.visible: !stackView.pending - - onOpenProjectRequested: function( projectFilePath ) { - setupProjectOpen( projectFilePath ) - } - onShowLocalChangesRequested: function( projectId ) { - showChanges( projectId ) - } - list.onActiveProjectDeleted: setupProjectOpen( "" ) - } - - ProjectListPage { - id: publicProjectsPage - - projectModelType: ProjectsModel.PublicProjectsModel - activeProjectId: root.activeProjectId - list.visible: !stackView.pending - - onOpenProjectRequested: function( projectFilePath ) { - setupProjectOpen( projectFilePath ) - } - onShowLocalChangesRequested: function( projectId ) { - showChanges( projectId ) - } - list.onActiveProjectDeleted: function() { - setupProjectOpen( "" ) - } - } - } - } - - footer: TabBar { - id: pageFooter - - property int itemSize: pageFooter.height * 0.8 - - function setActiveButton( state ) { - switch( state ) { - case "local": pageFooter.setCurrentIndex( 0 ); break - case "created": pageFooter.setCurrentIndex( 1 ); break - case "shared": pageFooter.setCurrentIndex( 2 ); break - case "public": pageFooter.setCurrentIndex( 3 ); break - } - } - - spacing: 0 - contentHeight: InputStyle.rowHeightHeader - - TabButton { - id: localProjectsBtn - - background: Rectangle { - anchors.fill: parent - color: InputStyle.fontColor - } - - MainPanelButton { - id: localProjectsInnerBtn - - text: qsTr("Home") - imageSource: InputStyle.homeIcon - width: pageFooter.itemSize - - handleClicks: false - faded: pageFooter.currentIndex !== localProjectsBtn.TabBar.index - } - - onClicked: pageContent.state = "local" - } - - TabButton { - id: createdProjectsBtn - - background: Rectangle { - anchors.fill: parent - color: InputStyle.fontColor - } - - MainPanelButton { - id: createdProjectsInnerBtn - - text: qsTr("My projects") - imageSource: InputStyle.accountIcon - width: pageFooter.itemSize - - handleClicks: false - faded: pageFooter.currentIndex !== createdProjectsBtn.TabBar.index - } - - onClicked: pageContent.state = "created" - } - - TabButton { - id: sharedProjectsBtn - - background: Rectangle { - anchors.fill: parent - color: InputStyle.fontColor - } - - MainPanelButton { - id: sharedProjectsInnerBtn - - imageSource: InputStyle.accountMultiIcon - width: pageFooter.itemSize - text: parent.width > sharedProjectsInnerBtn.width * 2 ? qsTr("Shared with me") : qsTr("Shared") - - handleClicks: false - faded: pageFooter.currentIndex !== sharedProjectsBtn.TabBar.index - } - - onClicked: pageContent.state = "shared" - } - - TabButton { - id: publicProjectsBtn - - background: Rectangle { - anchors.fill: parent - color: InputStyle.fontColor - } - - MainPanelButton { - id: publicProjectsInnerBtn - - text: qsTr("Explore") - imageSource: InputStyle.exploreIcon - width: pageFooter.itemSize - - handleClicks: false - faded: pageFooter.currentIndex !== publicProjectsBtn.TabBar.index - } - - onClicked: pageContent.state = "public" - } - } - - // Other components - - Connections { - target: __projectWizard - function onProjectCreationFailed(message) { - __inputUtils.showNotification(message) - stackView.pending = false - } - function onProjectCreated( projectDir, projectName ) { - if (stackView.currentItem.objectName === "projectWizard") { - __inputUtils.log( - "Create project", - "Local project " + projectName + " created at path: " + projectDir + " by " - + ( __merginApi.userAuth ? __merginApi.userAuth.username : "unknown" ) ) - stackView.popOnePageOrClose() - } - } - } - } - } - Component { id: workspaceProjectsPanelComp @@ -622,7 +254,7 @@ Item { __merginApi.refreshUserData() if ( __merginApi.serverType === MerginServerType.OLD ) { - stackView.push( accountPanelComp ) + __inputUtils.showNotification( qsTr( "Unsupported server, please contact your server administrator." ) ) } else { stackView.push( workspaceAccountPageComp ) @@ -731,7 +363,7 @@ Item { projectModelType: ProjectsModel.WorkspaceProjectsModel activeProjectId: root.activeProjectId - list.visible: !stackView.pending + list.visible: !stackView.pending && __merginApi.serverType !== MerginServerType.OLD onOpenProjectRequested: function( projectFilePath ) { setupProjectOpen( projectFilePath ) @@ -747,7 +379,7 @@ Item { projectModelType: ProjectsModel.PublicProjectsModel activeProjectId: root.activeProjectId - list.visible: !stackView.pending + list.visible: !stackView.pending && __merginApi.serverType !== MerginServerType.OLD onOpenProjectRequested: function( projectFilePath ) { setupProjectOpen( projectFilePath ) @@ -898,30 +530,6 @@ Item { } } - Component { - id: accountPanelComp - - AccountPage { - id: accountPanel - height: root.height - width: root.width - visible: true - onBack: { - stackView.popOnePageOrClose() - } - onManagePlansClicked: manageSubscriptionPlans() - onSignOutClicked: { - __merginApi.signOut() - stackView.pop( null ) - root.resetView() - } - onAccountDeleted: { - stackView.popOnePageOrClose() - root.resetView() - } - } - } - Component { id: workspaceAccountPageComp @@ -1019,18 +627,6 @@ Item { } } - Component { - id: registrationFinishComponent - - RegistrationFinishPage { - - objectName: "registrationFinishPanel" - onFinished: { - stackView.pop( null ) - } - } - } - Connections { target: __merginApi enabled: root.visible @@ -1087,14 +683,6 @@ Item { function onRegistrationSucceeded() { stackView.pending = false - - if ( __merginApi.serverType !== MerginServerType.OLD ) { - stackView.push( registrationFinishComponent ) - } - } - - function onServerTypeChanged( serverType ) { - stackView.switchUI() } function onActiveWorkspaceChanged() { @@ -1119,11 +707,6 @@ Item { function onUserInfoReplyFinished() { openInvitationsListener.showInvitationsList = false; - // let's not show invitations when registration finish page is opened - if ( stackView.containsPage("registrationFinishPanel") ) { - return; - } - if ( !__merginApi.userAuth.hasAuthData() ) { return; } diff --git a/app/qml/RegistrationFinishPage.qml b/app/qml/RegistrationFinishPage.qml deleted file mode 100644 index dc32220f29..0000000000 --- a/app/qml/RegistrationFinishPage.qml +++ /dev/null @@ -1,83 +0,0 @@ -/*************************************************************************** - * * - * 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. * - * * - ***************************************************************************/ - -import QtQuick -import QtQuick.Controls - -import "./components" as MMComponents - -Page { - id: root - - signal finished - - StackView { - id: stackView - - anchors.fill: parent - } - - MMComponents.LoadingSpinner { - id: spinner - - running: true - anchors.centerIn: parent - } - - Component { - id: createWorkspaceComponent - - CreateWorkspacePage { - id: createWorkspacePanel - - haveBackButton: false - - onBack: { - stackView.pop( StackView.Immediate ) - } - } - } - - Component { - id: manageInvitationsComponent - - ManageInvitationsPage { - id: manageInvitationsPanel - - onCreateWorkspaceRequested: { - stackView.push(createWorkspaceComponent, { haveBackButton: true }) - } - } - } - - Connections { - target: __merginApi - - function onUserInfoReplyFinished() { - spinner.running = false - - if (__merginApi.userInfo.hasInvitations) { - stackView.push(manageInvitationsComponent) - } - else { - stackView.push(createWorkspaceComponent) - } - } - - function onWorkspaceCreated(workspace, result) { - if (result) { - root.finished() - } - } - - function onProcessInvitationFinished() { - root.finished() - } - } -}