Skip to content

Commit

Permalink
Make build optional
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr authored and rullzer committed Jul 31, 2018
1 parent 156605c commit 3159a36
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
2 changes: 2 additions & 0 deletions NEXTCLOUD.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ set( MAC_INSTALLER_BACKGROUND_FILE "${CMAKE_SOURCE_DIR}/admin/osx/installer-back
option( WITH_CRASHREPORTER "Build crashreporter" OFF )
#set( CRASHREPORTER_SUBMIT_URL "https://crash-reports.owncloud.com/submit" CACHE string "URL for crash reporter" )
#set( CRASHREPORTER_ICON ":/owncloud-icon.png" )

option( WITH_PROVIDERS "Build with providers list" OFF )
1 change: 1 addition & 0 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#cmakedefine USE_INOTIFY 1
#cmakedefine WITH_QTKEYCHAIN 1
#cmakedefine WITH_CRASHREPORTER
#cmakedefine WITH_PROVIDERS "@WITH_PROVIDERS@"
#cmakedefine CRASHREPORTER_EXECUTABLE "@CRASHREPORTER_EXECUTABLE@"
#define SOCKETAPI_TEAM_IDENTIFIER_PREFIX "@SOCKETAPI_TEAM_IDENTIFIER_PREFIX@"

Expand Down
22 changes: 18 additions & 4 deletions src/gui/wizard/owncloudsetuppage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "wizard/owncloudconnectionmethoddialog.h"
#include "theme.h"
#include "account.h"
#include "config.h"

namespace OCC {

Expand Down Expand Up @@ -71,11 +72,13 @@ OwncloudSetupPage::OwncloudSetupPage(QWidget *parent)
slotUrlChanged(QLatin1String("")); // don't jitter UI
connect(_ui.leUrl, &QLineEdit::textChanged, this, &OwncloudSetupPage::slotUrlChanged);
connect(_ui.leUrl, &QLineEdit::editingFinished, this, &OwncloudSetupPage::slotUrlEditFinished);
connect(_ui.loginButton, &QPushButton::clicked, this, &OwncloudSetupPage::slotLogin);
connect(_ui.createAccountButton, &QPushButton::clicked, this, &OwncloudSetupPage::slotGotoProviderList);

addCertDial = new AddCertificateDialog(this);

#ifdef WITH_PROVIDERS
connect(_ui.loginButton, &QPushButton::clicked, this, &OwncloudSetupPage::slotLogin);
connect(_ui.createAccountButton, &QPushButton::clicked, this, &OwncloudSetupPage::slotGotoProviderList);

_ui.login->hide();
_slideshow.append(qMakePair(QString("nextcloud"), tr("Keep your data secure and under your control")));
_slideshow.append(qMakePair(QString("files"), tr("Secure collaboration & file exchange")));
Expand All @@ -89,9 +92,18 @@ OwncloudSetupPage::OwncloudSetupPage(QWidget *parent)
QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(nextSlide()));
timer->start(2500);
#else
_ui.createAccountButton->hide();
_ui.slideImage->hide();
_ui.slideLabel->hide();
_ui.loginButton->hide();
_ui.hostButton->hide();
#endif
setStyleSheet(QString("background-color:%1; color:%2 QLabel { color:%2; } QSpacerItem { color: red; }").arg(theme->wizardHeaderBackgroundColor().name(), theme->wizardHeaderTitleColor().name()));

}

#ifdef WITH_PROVIDERS
void OwncloudSetupPage::nextSlide()
{
if (_currentSlide < _slideshow.length()-1) {
Expand All @@ -103,7 +115,7 @@ void OwncloudSetupPage::nextSlide()
_ui.slideImage->setPixmap(pixmap.scaled(QSize(_ui.slideImage->size().height(), _ui.slideImage->size().height()), Qt::KeepAspectRatio, Qt::SmoothTransformation));
_ui.slideLabel->setText(_slideshow.at(_currentSlide).second);
}

#endif

void OwncloudSetupPage::setServerUrl(const QString &newUrl)
{
Expand Down Expand Up @@ -133,8 +145,10 @@ void OwncloudSetupPage::setupCustomization()
WizardCommon::setupCustomMedia(variant, _ui.bottomLabel);
}

#ifdef WITH_PROVIDERS
void OwncloudSetupPage::slotLogin()
{
_ocWizard->setRegistration(false);
_ui.login->setMaximumHeight(0);
QPropertyAnimation *animation = new QPropertyAnimation(_ui.login, "maximumHeight");
animation->setDuration(0);
Expand All @@ -146,13 +160,13 @@ void OwncloudSetupPage::slotLogin()
}
void OwncloudSetupPage::slotGotoProviderList()
{
// todo set _ocWizard->registation so we have the url in webview.cpp
_ocWizard->setRegistration(true);
_ocWizard->setAuthType(DetermineAuthTypeJob::AuthType::WebViewFlow);
_authTypeKnown = true;
_checking = false;
emit completeChanged();
}
#endif

// slot hit from textChanged of the url entry field.
void OwncloudSetupPage::slotUrlChanged(const QString &url)
Expand Down
6 changes: 6 additions & 0 deletions src/gui/wizard/owncloudsetuppage.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

#include "ui_owncloudsetupnocredspage.h"

#include "config.h"

class QLabel;
class QVariant;
class QProgressIndicator;
Expand Down Expand Up @@ -60,13 +62,17 @@ public slots:
void startSpinner();
void stopSpinner();
void slotCertificateAccepted();
#ifdef WITH_PROVIDERS
void nextSlide();
#endif

protected slots:
void slotUrlChanged(const QString &);
void slotUrlEditFinished();
#ifdef WITH_PROVIDERS
void slotLogin();
void slotGotoProviderList();
#endif

void setupCustomization();

Expand Down

0 comments on commit 3159a36

Please sign in to comment.