Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorHannah von Reth <hannah.vonreth@owncloud.com>2021-08-10 13:18:12 +0300
committerFelix Weilbach <felix.weilbach@nextcloud.com>2021-09-03 17:08:37 +0300
commit02bb5db544cf89a10b1af3e7e06f373525dfe104 (patch)
tree33bb93c54e2286a741382ac408598b296079d590 /src/gui
parentf396c58b5f2a1e5820b808f0575f81995bf81624 (diff)
Remove wizard page that has been dead for 4 years
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/CMakeLists.txt2
-rw-r--r--src/gui/owncloudsetupwizard.cpp3
-rw-r--r--src/gui/wizard/owncloudadvancedsetuppage.cpp11
-rw-r--r--src/gui/wizard/owncloudwizard.cpp28
-rw-r--r--src/gui/wizard/owncloudwizard.h2
-rw-r--r--src/gui/wizard/owncloudwizardcommon.h1
-rw-r--r--src/gui/wizard/owncloudwizardresultpage.cpp100
-rw-r--r--src/gui/wizard/owncloudwizardresultpage.h60
-rw-r--r--src/gui/wizard/owncloudwizardresultpage.ui207
9 files changed, 13 insertions, 401 deletions
diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt
index 4d2e7292f..29de7ca98 100644
--- a/src/gui/CMakeLists.txt
+++ b/src/gui/CMakeLists.txt
@@ -45,7 +45,6 @@ set(client_UI_SRCS
wizard/owncloudhttpcredspage.ui
wizard/owncloudoauthcredspage.ui
wizard/owncloudsetupnocredspage.ui
- wizard/owncloudwizardresultpage.ui
wizard/webview.ui
wizard/welcomepage.ui
)
@@ -128,7 +127,6 @@ set(client_SRCS
wizard/owncloudsetuppage.cpp
wizard/owncloudwizardcommon.cpp
wizard/owncloudwizard.cpp
- wizard/owncloudwizardresultpage.cpp
wizard/slideshow.cpp
wizard/welcomepage.cpp
wizard/linklabel.cpp
diff --git a/src/gui/owncloudsetupwizard.cpp b/src/gui/owncloudsetupwizard.cpp
index 5720019c0..3b8680356 100644
--- a/src/gui/owncloudsetupwizard.cpp
+++ b/src/gui/owncloudsetupwizard.cpp
@@ -596,9 +596,6 @@ void OwncloudSetupWizard::slotCreateRemoteFolderFinished(QNetworkReply *reply)
void OwncloudSetupWizard::finalizeSetup(bool success)
{
- // enable/disable the finish button.
- _ocWizard->enableFinishOnResultWidget(success);
-
const QString localFolder = _ocWizard->property("localFolder").toString();
if (success) {
if (!(localFolder.isEmpty() || _remoteFolder.isEmpty())) {
diff --git a/src/gui/wizard/owncloudadvancedsetuppage.cpp b/src/gui/wizard/owncloudadvancedsetuppage.cpp
index 9a7dff87f..88b522931 100644
--- a/src/gui/wizard/owncloudadvancedsetuppage.cpp
+++ b/src/gui/wizard/owncloudadvancedsetuppage.cpp
@@ -57,7 +57,7 @@ OwncloudAdvancedSetupPage::OwncloudAdvancedSetupPage(OwncloudWizard *wizard)
setupCustomization();
connect(_ui.pbSelectLocalFolder, &QAbstractButton::clicked, this, &OwncloudAdvancedSetupPage::slotSelectFolder);
- setButtonText(QWizard::NextButton, tr("Connect"));
+ setButtonText(QWizard::FinishButton, tr("Connect"));
connect(_ui.rSyncEverything, &QAbstractButton::clicked, this, &OwncloudAdvancedSetupPage::slotSyncEverythingClicked);
connect(_ui.rSelectiveSync, &QAbstractButton::clicked, this, &OwncloudAdvancedSetupPage::slotSelectiveSyncClicked);
@@ -134,8 +134,8 @@ void OwncloudAdvancedSetupPage::initializePage()
}
_checking = false;
- _ui.lSelectiveSyncSizeLabel->setText(QString());
- _ui.lSyncEverythingSizeLabel->setText(QString());
+ _ui.lSelectiveSyncSizeLabel->clear();
+ _ui.lSyncEverythingSizeLabel->clear();
// Update the local folder - this is not guaranteed to find a good one
QString goodLocalFolder = FolderMan::instance()->findGoodPathForNewSyncFolder(localFolder(), serverUrl());
@@ -145,7 +145,7 @@ void OwncloudAdvancedSetupPage::initializePage()
updateStatus();
// ensure "next" gets the focus, not obSelectLocalFolder
- QTimer::singleShot(0, wizard()->button(QWizard::NextButton), SLOT(setFocus()));
+ QTimer::singleShot(0, wizard()->button(QWizard::FinishButton), qOverload<>(&QWidget::setFocus));
auto acc = static_cast<OwncloudWizard *>(wizard())->account();
auto quotaJob = new PropfindJob(acc, _remoteFolder, this);
@@ -327,7 +327,8 @@ QUrl OwncloudAdvancedSetupPage::serverUrl() const
int OwncloudAdvancedSetupPage::nextId() const
{
- return WizardCommon::Page_Result;
+ // tells the caller that this is the last dialog page
+ return -1;
}
QString OwncloudAdvancedSetupPage::localFolder() const
diff --git a/src/gui/wizard/owncloudwizard.cpp b/src/gui/wizard/owncloudwizard.cpp
index e60b23acb..d0070e4a6 100644
--- a/src/gui/wizard/owncloudwizard.cpp
+++ b/src/gui/wizard/owncloudwizard.cpp
@@ -25,7 +25,6 @@
#include "wizard/owncloudhttpcredspage.h"
#include "wizard/owncloudoauthcredspage.h"
#include "wizard/owncloudadvancedsetuppage.h"
-#include "wizard/owncloudwizardresultpage.h"
#include "wizard/webviewpage.h"
#include "wizard/flow2authcredspage.h"
@@ -53,7 +52,6 @@ OwncloudWizard::OwncloudWizard(QWidget *parent)
, _browserCredsPage(new OwncloudOAuthCredsPage)
, _flow2CredsPage(new Flow2AuthCredsPage)
, _advancedSetupPage(new OwncloudAdvancedSetupPage(this))
- , _resultPage(new OwncloudWizardResultPage)
#ifdef WITH_WEBENGINE
, _webViewPage(new WebViewPage(this))
#else // WITH_WEBENGINE
@@ -69,7 +67,6 @@ OwncloudWizard::OwncloudWizard(QWidget *parent)
setPage(WizardCommon::Page_OAuthCreds, _browserCredsPage);
setPage(WizardCommon::Page_Flow2AuthCreds, _flow2CredsPage);
setPage(WizardCommon::Page_AdvancedSetup, _advancedSetupPage);
- setPage(WizardCommon::Page_Result, _resultPage);
#ifdef WITH_WEBENGINE
setPage(WizardCommon::Page_WebView, _webViewPage);
#endif // WITH_WEBENGINE
@@ -209,16 +206,9 @@ void OwncloudWizard::setRegistration(bool registration)
_registration = registration;
}
-
-void OwncloudWizard::enableFinishOnResultWidget(bool enable)
-{
- _resultPage->setComplete(enable);
-}
-
void OwncloudWizard::setRemoteFolder(const QString &remoteFolder)
{
_advancedSetupPage->setRemoteFolder(remoteFolder);
- _resultPage->setRemoteFolder(remoteFolder);
}
void OwncloudWizard::successfulStep()
@@ -249,13 +239,17 @@ void OwncloudWizard::successfulStep()
break;
case WizardCommon::Page_ServerSetup:
- case WizardCommon::Page_Result:
qCWarning(lcWizard, "Should not happen at this stage.");
break;
}
ownCloudGui::raiseDialog(this);
- next();
+ if (nextId() == -1) {
+ disconnect(this, &QDialog::finished, this, &OwncloudWizard::basicSetupFinished);
+ emit basicSetupFinished(QDialog::Accepted);
+ } else {
+ next();
+ }
}
void OwncloudWizard::setAuthType(DetermineAuthTypeJob::AuthType type)
@@ -300,7 +294,7 @@ void OwncloudWizard::slotCurrentPageChanged(int id)
id == WizardCommon::Page_Flow2AuthCreds) {
setButtonLayout({ QWizard::Stretch, QWizard::BackButton });
} else if (id == WizardCommon::Page_AdvancedSetup) {
- setButtonLayout({ QWizard::Stretch, QWizard::CustomButton1, QWizard::BackButton, QWizard::NextButton });
+ setButtonLayout({ QWizard::Stretch, QWizard::CustomButton1, QWizard::BackButton, QWizard::FinishButton });
setNextButtonAsDefault();
} else {
setButtonLayout({ QWizard::Stretch, QWizard::BackButton, QWizard::NextButton });
@@ -311,14 +305,6 @@ void OwncloudWizard::slotCurrentPageChanged(int id)
emit clearPendingRequests();
}
- if (id == WizardCommon::Page_Result) {
- disconnect(this, &QDialog::finished, this, &OwncloudWizard::basicSetupFinished);
- emit basicSetupFinished(QDialog::Accepted);
- appendToConfigurationLog(QString());
- // Immediately close on show, we currently don't want this page anymore
- done(Accepted);
- }
-
if (id == WizardCommon::Page_AdvancedSetup && (_credentialsPage == _browserCredsPage || _credentialsPage == _flow2CredsPage)) {
// For OAuth, disable the back button in the Page_AdvancedSetup because we don't want
// to re-open the browser.
diff --git a/src/gui/wizard/owncloudwizard.h b/src/gui/wizard/owncloudwizard.h
index ff253587f..4e26925e1 100644
--- a/src/gui/wizard/owncloudwizard.h
+++ b/src/gui/wizard/owncloudwizard.h
@@ -68,8 +68,6 @@ public:
bool useVirtualFileSync() const;
bool isConfirmBigFolderChecked() const;
- void enableFinishOnResultWidget(bool enable);
-
void displayError(const QString &, bool retryHTTPonly);
AbstractCredentials *getCredentials() const;
diff --git a/src/gui/wizard/owncloudwizardcommon.h b/src/gui/wizard/owncloudwizardcommon.h
index 7c6eef5ab..093b81bb1 100644
--- a/src/gui/wizard/owncloudwizardcommon.h
+++ b/src/gui/wizard/owncloudwizardcommon.h
@@ -50,7 +50,6 @@ namespace WizardCommon {
Page_WebView,
#endif // WITH_WEBENGINE
Page_AdvancedSetup,
- Page_Result
};
} // ns WizardCommon
diff --git a/src/gui/wizard/owncloudwizardresultpage.cpp b/src/gui/wizard/owncloudwizardresultpage.cpp
deleted file mode 100644
index d3b1e7268..000000000
--- a/src/gui/wizard/owncloudwizardresultpage.cpp
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (C) by Klaas Freitag <freitag@owncloud.com>
- * Copyright (C) by Krzesimir Nowak <krzesimir@endocode.com>
- *
- * 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.
- */
-
-#include <QDesktopServices>
-#include <QDir>
-#include <QUrl>
-
-#include "guiutility.h"
-#include "wizard/owncloudwizardresultpage.h"
-#include "wizard/owncloudwizardcommon.h"
-#include "theme.h"
-
-namespace OCC {
-
-OwncloudWizardResultPage::OwncloudWizardResultPage()
- : QWizardPage()
-{
- _ui.setupUi(this);
- // no fields to register.
-
- setTitle(WizardCommon::subTitleTemplate().arg(tr("Everything set up!")));
- // required to show header in QWizard's modern style
- setSubTitle(QLatin1String(" "));
-
- _ui.pbOpenLocal->setText(tr("Open Local Folder"));
- // TODO: File doesn't exist anymore - unneccessary or replacement needed?
- _ui.pbOpenLocal->setIcon(QIcon(QLatin1String(":/client/theme/folder-sync.png")));
- _ui.pbOpenLocal->setIconSize(QSize(48, 48));
- _ui.pbOpenLocal->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
- connect(_ui.pbOpenLocal, &QAbstractButton::clicked, this, &OwncloudWizardResultPage::slotOpenLocal);
-
- Theme *theme = Theme::instance();
- QIcon appIcon = theme->applicationIcon();
- _ui.pbOpenServer->setText(tr("Open %1 in Browser").arg(theme->appNameGUI()));
- _ui.pbOpenServer->setIcon(appIcon.pixmap(48));
- _ui.pbOpenServer->setIconSize(QSize(48, 48));
- _ui.pbOpenServer->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
- connect(_ui.pbOpenServer, &QAbstractButton::clicked, this, &OwncloudWizardResultPage::slotOpenServer);
- setupCustomization();
-}
-
-OwncloudWizardResultPage::~OwncloudWizardResultPage() = default;
-
-void OwncloudWizardResultPage::setComplete(bool complete)
-{
- _complete = complete;
- emit completeChanged();
-}
-
-bool OwncloudWizardResultPage::isComplete() const
-{
- return _complete;
-}
-
-void OwncloudWizardResultPage::initializePage()
-{
- _ui.localFolderLabel->setText(QString());
-}
-
-void OwncloudWizardResultPage::setRemoteFolder(const QString &remoteFolder)
-{
- _remoteFolder = remoteFolder;
-}
-
-void OwncloudWizardResultPage::setupCustomization()
-{
- // set defaults for the customize labels.
- _ui.topLabel->setText(QString());
- _ui.topLabel->hide();
-
- QVariant variant = Theme::instance()->customMedia(Theme::oCSetupResultTop);
- WizardCommon::setupCustomMedia(variant, _ui.topLabel);
-}
-
-void OwncloudWizardResultPage::slotOpenLocal()
-{
- const QString localFolder = wizard()->property("localFolder").toString();
- QDesktopServices::openUrl(QUrl::fromLocalFile(localFolder));
-}
-
-void OwncloudWizardResultPage::slotOpenServer()
-{
- Theme *theme = Theme::instance();
- QUrl url = QUrl(field("OCUrl").toString() + theme->wizardUrlPostfix());
- Utility::openBrowser(url);
-}
-
-} // namespace OCC
diff --git a/src/gui/wizard/owncloudwizardresultpage.h b/src/gui/wizard/owncloudwizardresultpage.h
deleted file mode 100644
index 9ce1a3767..000000000
--- a/src/gui/wizard/owncloudwizardresultpage.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) by Klaas Freitag <freitag@owncloud.com>
- * Copyright (C) by Krzesimir Nowak <krzesimir@endocode.com>
- *
- * 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.
- */
-
-#ifndef MIRALL_OWNCLOUD_WIZARD_RESULT_PAGE_H
-#define MIRALL_OWNCLOUD_WIZARD_RESULT_PAGE_H
-
-#include <QWizardPage>
-
-#include "ui_owncloudwizardresultpage.h"
-
-namespace OCC {
-
-/**
- * @brief The OwncloudWizardResultPage class
- * @ingroup gui
- */
-class OwncloudWizardResultPage : public QWizardPage
-{
- Q_OBJECT
-public:
- OwncloudWizardResultPage();
- ~OwncloudWizardResultPage() override;
-
- bool isComplete() const override;
- void initializePage() override;
- void setRemoteFolder(const QString &remoteFolder);
-
-public slots:
- void setComplete(bool complete);
-
-protected slots:
- void slotOpenLocal();
- void slotOpenServer();
-
-protected:
- void setupCustomization();
-
-private:
- QString _localFolder;
- QString _remoteFolder;
- bool _complete = false;
-
- Ui_OwncloudWizardResultPage _ui;
-};
-
-} // namespace OCC
-
-#endif
diff --git a/src/gui/wizard/owncloudwizardresultpage.ui b/src/gui/wizard/owncloudwizardresultpage.ui
deleted file mode 100644
index 44652f295..000000000
--- a/src/gui/wizard/owncloudwizardresultpage.ui
+++ /dev/null
@@ -1,207 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>OwncloudWizardResultPage</class>
- <widget class="QWidget" name="OwncloudWizardResultPage">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>473</width>
- <height>366</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string notr="true">Form</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout_3">
- <item>
- <widget class="QLabel" name="topLabel">
- <property name="text">
- <string notr="true">TextLabel</string>
- </property>
- <property name="wordWrap">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_2">
- <item>
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>48</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <layout class="QVBoxLayout" name="verticalLayout_2">
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_12"/>
- </item>
- <item>
- <spacer name="verticalSpacer_2">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>16</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <spacer name="horizontalSpacer_3">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QToolButton" name="pbOpenServer">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>200</width>
- <height>80</height>
- </size>
- </property>
- <property name="text">
- <string notr="true">PushButton</string>
- </property>
- <property name="toolButtonStyle">
- <enum>Qt::ToolButtonTextUnderIcon</enum>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QToolButton" name="pbOpenLocal">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>200</width>
- <height>80</height>
- </size>
- </property>
- <property name="text">
- <string notr="true">PushButton</string>
- </property>
- <property name="toolButtonStyle">
- <enum>Qt::ToolButtonTextUnderIcon</enum>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <spacer name="horizontalSpacer_4">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item>
- <spacer name="verticalSpacer_3">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>16</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QLabel" name="localFolderLabel">
- <property name="text">
- <string>Your entire account is synced to the local folder </string>
- </property>
- <property name="wordWrap">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>336</width>
- <height>13</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item>
- <spacer name="horizontalSpacer_2">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>48</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>