Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/gui/wizard/owncloudconnectionmethoddialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/

#include "wizard/owncloudconnectionmethoddialog.h"

Check failure on line 6 in src/gui/wizard/owncloudconnectionmethoddialog.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/wizard/owncloudconnectionmethoddialog.cpp:6:10 [clang-diagnostic-error]

'wizard/owncloudconnectionmethoddialog.h' file not found
#include <QUrl>

namespace OCC {
Expand All @@ -24,6 +24,10 @@
ui->label->setText(tr("<html><head/><body><p>Failed to connect to the secure server address <em>%1</em>. How do you wish to proceed?</p></body></html>").arg(url.toDisplayString().toHtmlEscaped()));
}

void OwncloudConnectionMethodDialog::setHTTPOnly(const bool retryHTTPonly)
{
ui->btnNoTLS->setEnabled(retryHTTPonly);
}

void OwncloudConnectionMethodDialog::returnNoTLS()
{
Expand Down
1 change: 1 addition & 0 deletions src/gui/wizard/owncloudconnectionmethoddialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#ifndef OWNCLOUDCONNECTIONMETHODDIALOG_H
#define OWNCLOUDCONNECTIONMETHODDIALOG_H

#include <QDialog>

Check failure on line 10 in src/gui/wizard/owncloudconnectionmethoddialog.h

View workflow job for this annotation

GitHub Actions / build

src/gui/wizard/owncloudconnectionmethoddialog.h:10:10 [clang-diagnostic-error]

'QDialog' file not found

#include "ui_owncloudconnectionmethoddialog.h"

Expand Down Expand Up @@ -37,6 +37,7 @@

// The URL that was tried
void setUrl(const QUrl &);
void setHTTPOnly(bool);

public slots:
void returnNoTLS();
Expand Down
57 changes: 28 additions & 29 deletions src/gui/wizard/owncloudsetuppage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/

#include <QDir>

Check failure on line 7 in src/gui/wizard/owncloudsetuppage.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/wizard/owncloudsetuppage.cpp:7:10 [clang-diagnostic-error]

'QDir' file not found
#include <QFileDialog>
#include <QUrl>
#include <QTimer>
Expand Down Expand Up @@ -349,35 +349,34 @@
if (err.isEmpty()) {
_ui.errorLabel->setVisible(false);
} else {
if (retryHTTPonly) {
const auto urlString = url();
auto url = QUrl::fromUserInput(urlString);
if (url.scheme() == "https") {
// Ask the user how to proceed when connecting to a https:// URL fails.
// It is possible that the server is secured with client-side TLS certificates,
// but that it has no way of informing the owncloud client that this is the case.

OwncloudConnectionMethodDialog dialog;
dialog.setUrl(url);
// FIXME: Synchronous dialogs are not so nice because of event loop recursion
int retVal = dialog.exec();

switch (retVal) {
case OwncloudConnectionMethodDialog::No_TLS: {
url.setScheme("http");
_ui.leUrl->setFullText(url.toString());
// skip ahead to next page, since the user would expect us to retry automatically
wizard()->next();
} break;
case OwncloudConnectionMethodDialog::Client_Side_TLS:
addCertDial->show();
break;
case OwncloudConnectionMethodDialog::Closed:
case OwncloudConnectionMethodDialog::Back:
default:
// No-op.
break;
}
const auto urlString = url();
auto url = QUrl::fromUserInput(urlString);
if (url.scheme() == "https") {
// Ask the user how to proceed when connecting to a https:// URL fails.
// It is possible that the server is secured with client-side TLS certificates,
// but that it has no way of informing the owncloud client that this is the case.

OwncloudConnectionMethodDialog dialog;
dialog.setUrl(url);
dialog.setHTTPOnly(retryHTTPonly);
// FIXME: Synchronous dialogs are not so nice because of event loop recursion
int retVal = dialog.exec();

switch (retVal) {
case OwncloudConnectionMethodDialog::No_TLS: {
url.setScheme("http");
_ui.leUrl->setFullText(url.toString());
// skip ahead to next page, since the user would expect us to retry automatically
wizard()->next();
} break;
case OwncloudConnectionMethodDialog::Client_Side_TLS:
addCertDial->show();
break;
case OwncloudConnectionMethodDialog::Closed:
case OwncloudConnectionMethodDialog::Back:
default:
// No-op.
break;
}
}

Expand Down
Loading