Remove wizard page that has been dead for 4 years

This commit is contained in:
Hannah von Reth 2021-08-10 12:18:12 +02:00 committed by Felix Weilbach
parent f396c58b5f
commit 02bb5db544
9 changed files with 13 additions and 401 deletions

View file

@ -45,7 +45,6 @@ set(client_UI_SRCS
wizard/owncloudhttpcredspage.ui wizard/owncloudhttpcredspage.ui
wizard/owncloudoauthcredspage.ui wizard/owncloudoauthcredspage.ui
wizard/owncloudsetupnocredspage.ui wizard/owncloudsetupnocredspage.ui
wizard/owncloudwizardresultpage.ui
wizard/webview.ui wizard/webview.ui
wizard/welcomepage.ui wizard/welcomepage.ui
) )
@ -128,7 +127,6 @@ set(client_SRCS
wizard/owncloudsetuppage.cpp wizard/owncloudsetuppage.cpp
wizard/owncloudwizardcommon.cpp wizard/owncloudwizardcommon.cpp
wizard/owncloudwizard.cpp wizard/owncloudwizard.cpp
wizard/owncloudwizardresultpage.cpp
wizard/slideshow.cpp wizard/slideshow.cpp
wizard/welcomepage.cpp wizard/welcomepage.cpp
wizard/linklabel.cpp wizard/linklabel.cpp

View file

@ -596,9 +596,6 @@ void OwncloudSetupWizard::slotCreateRemoteFolderFinished(QNetworkReply *reply)
void OwncloudSetupWizard::finalizeSetup(bool success) void OwncloudSetupWizard::finalizeSetup(bool success)
{ {
// enable/disable the finish button.
_ocWizard->enableFinishOnResultWidget(success);
const QString localFolder = _ocWizard->property("localFolder").toString(); const QString localFolder = _ocWizard->property("localFolder").toString();
if (success) { if (success) {
if (!(localFolder.isEmpty() || _remoteFolder.isEmpty())) { if (!(localFolder.isEmpty() || _remoteFolder.isEmpty())) {

View file

@ -57,7 +57,7 @@ OwncloudAdvancedSetupPage::OwncloudAdvancedSetupPage(OwncloudWizard *wizard)
setupCustomization(); setupCustomization();
connect(_ui.pbSelectLocalFolder, &QAbstractButton::clicked, this, &OwncloudAdvancedSetupPage::slotSelectFolder); 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.rSyncEverything, &QAbstractButton::clicked, this, &OwncloudAdvancedSetupPage::slotSyncEverythingClicked);
connect(_ui.rSelectiveSync, &QAbstractButton::clicked, this, &OwncloudAdvancedSetupPage::slotSelectiveSyncClicked); connect(_ui.rSelectiveSync, &QAbstractButton::clicked, this, &OwncloudAdvancedSetupPage::slotSelectiveSyncClicked);
@ -134,8 +134,8 @@ void OwncloudAdvancedSetupPage::initializePage()
} }
_checking = false; _checking = false;
_ui.lSelectiveSyncSizeLabel->setText(QString()); _ui.lSelectiveSyncSizeLabel->clear();
_ui.lSyncEverythingSizeLabel->setText(QString()); _ui.lSyncEverythingSizeLabel->clear();
// Update the local folder - this is not guaranteed to find a good one // Update the local folder - this is not guaranteed to find a good one
QString goodLocalFolder = FolderMan::instance()->findGoodPathForNewSyncFolder(localFolder(), serverUrl()); QString goodLocalFolder = FolderMan::instance()->findGoodPathForNewSyncFolder(localFolder(), serverUrl());
@ -145,7 +145,7 @@ void OwncloudAdvancedSetupPage::initializePage()
updateStatus(); updateStatus();
// ensure "next" gets the focus, not obSelectLocalFolder // 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 acc = static_cast<OwncloudWizard *>(wizard())->account();
auto quotaJob = new PropfindJob(acc, _remoteFolder, this); auto quotaJob = new PropfindJob(acc, _remoteFolder, this);
@ -327,7 +327,8 @@ QUrl OwncloudAdvancedSetupPage::serverUrl() const
int OwncloudAdvancedSetupPage::nextId() 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 QString OwncloudAdvancedSetupPage::localFolder() const

View file

@ -25,7 +25,6 @@
#include "wizard/owncloudhttpcredspage.h" #include "wizard/owncloudhttpcredspage.h"
#include "wizard/owncloudoauthcredspage.h" #include "wizard/owncloudoauthcredspage.h"
#include "wizard/owncloudadvancedsetuppage.h" #include "wizard/owncloudadvancedsetuppage.h"
#include "wizard/owncloudwizardresultpage.h"
#include "wizard/webviewpage.h" #include "wizard/webviewpage.h"
#include "wizard/flow2authcredspage.h" #include "wizard/flow2authcredspage.h"
@ -53,7 +52,6 @@ OwncloudWizard::OwncloudWizard(QWidget *parent)
, _browserCredsPage(new OwncloudOAuthCredsPage) , _browserCredsPage(new OwncloudOAuthCredsPage)
, _flow2CredsPage(new Flow2AuthCredsPage) , _flow2CredsPage(new Flow2AuthCredsPage)
, _advancedSetupPage(new OwncloudAdvancedSetupPage(this)) , _advancedSetupPage(new OwncloudAdvancedSetupPage(this))
, _resultPage(new OwncloudWizardResultPage)
#ifdef WITH_WEBENGINE #ifdef WITH_WEBENGINE
, _webViewPage(new WebViewPage(this)) , _webViewPage(new WebViewPage(this))
#else // WITH_WEBENGINE #else // WITH_WEBENGINE
@ -69,7 +67,6 @@ OwncloudWizard::OwncloudWizard(QWidget *parent)
setPage(WizardCommon::Page_OAuthCreds, _browserCredsPage); setPage(WizardCommon::Page_OAuthCreds, _browserCredsPage);
setPage(WizardCommon::Page_Flow2AuthCreds, _flow2CredsPage); setPage(WizardCommon::Page_Flow2AuthCreds, _flow2CredsPage);
setPage(WizardCommon::Page_AdvancedSetup, _advancedSetupPage); setPage(WizardCommon::Page_AdvancedSetup, _advancedSetupPage);
setPage(WizardCommon::Page_Result, _resultPage);
#ifdef WITH_WEBENGINE #ifdef WITH_WEBENGINE
setPage(WizardCommon::Page_WebView, _webViewPage); setPage(WizardCommon::Page_WebView, _webViewPage);
#endif // WITH_WEBENGINE #endif // WITH_WEBENGINE
@ -209,16 +206,9 @@ void OwncloudWizard::setRegistration(bool registration)
_registration = registration; _registration = registration;
} }
void OwncloudWizard::enableFinishOnResultWidget(bool enable)
{
_resultPage->setComplete(enable);
}
void OwncloudWizard::setRemoteFolder(const QString &remoteFolder) void OwncloudWizard::setRemoteFolder(const QString &remoteFolder)
{ {
_advancedSetupPage->setRemoteFolder(remoteFolder); _advancedSetupPage->setRemoteFolder(remoteFolder);
_resultPage->setRemoteFolder(remoteFolder);
} }
void OwncloudWizard::successfulStep() void OwncloudWizard::successfulStep()
@ -249,13 +239,17 @@ void OwncloudWizard::successfulStep()
break; break;
case WizardCommon::Page_ServerSetup: case WizardCommon::Page_ServerSetup:
case WizardCommon::Page_Result:
qCWarning(lcWizard, "Should not happen at this stage."); qCWarning(lcWizard, "Should not happen at this stage.");
break; break;
} }
ownCloudGui::raiseDialog(this); 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) void OwncloudWizard::setAuthType(DetermineAuthTypeJob::AuthType type)
@ -300,7 +294,7 @@ void OwncloudWizard::slotCurrentPageChanged(int id)
id == WizardCommon::Page_Flow2AuthCreds) { id == WizardCommon::Page_Flow2AuthCreds) {
setButtonLayout({ QWizard::Stretch, QWizard::BackButton }); setButtonLayout({ QWizard::Stretch, QWizard::BackButton });
} else if (id == WizardCommon::Page_AdvancedSetup) { } 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(); setNextButtonAsDefault();
} else { } else {
setButtonLayout({ QWizard::Stretch, QWizard::BackButton, QWizard::NextButton }); setButtonLayout({ QWizard::Stretch, QWizard::BackButton, QWizard::NextButton });
@ -311,14 +305,6 @@ void OwncloudWizard::slotCurrentPageChanged(int id)
emit clearPendingRequests(); 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)) { if (id == WizardCommon::Page_AdvancedSetup && (_credentialsPage == _browserCredsPage || _credentialsPage == _flow2CredsPage)) {
// For OAuth, disable the back button in the Page_AdvancedSetup because we don't want // For OAuth, disable the back button in the Page_AdvancedSetup because we don't want
// to re-open the browser. // to re-open the browser.

View file

@ -68,8 +68,6 @@ public:
bool useVirtualFileSync() const; bool useVirtualFileSync() const;
bool isConfirmBigFolderChecked() const; bool isConfirmBigFolderChecked() const;
void enableFinishOnResultWidget(bool enable);
void displayError(const QString &, bool retryHTTPonly); void displayError(const QString &, bool retryHTTPonly);
AbstractCredentials *getCredentials() const; AbstractCredentials *getCredentials() const;

View file

@ -50,7 +50,6 @@ namespace WizardCommon {
Page_WebView, Page_WebView,
#endif // WITH_WEBENGINE #endif // WITH_WEBENGINE
Page_AdvancedSetup, Page_AdvancedSetup,
Page_Result
}; };
} // ns WizardCommon } // ns WizardCommon

View file

@ -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

View file

@ -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

View file

@ -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>