Merge branch 'master' into fix_urlscheme_warning

This commit is contained in:
Dominique Fuchs 2019-09-15 19:12:22 +02:00 committed by GitHub
commit a2a753a34b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 280 additions and 150 deletions

View file

@ -25,67 +25,24 @@
<property name="styleSheet">
<string notr="true"/>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="16" column="0">
<widget class="QLabel" name="bottomLabel">
<property name="minimumSize">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="text">
<string notr="true">TextLabel</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
</widget>
</spacer>
</item>
<item row="14" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<spacer name="horizontalSpacer_6">
<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>
<widget class="QLabel" name="installLink">
<property name="text">
<string>&lt;a href=&quot;https://docs.nextcloud.com/server/15/admin_manual/installation/index.html#installation&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;Host your own server&lt;/span&gt;&lt;/a&gt;</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<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 row="3" column="0">
<item>
<widget class="QLabel" name="topLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@ -107,117 +64,66 @@
</property>
</widget>
</item>
<item row="11" column="0" rowspan="2">
<layout class="QHBoxLayout" name="buttons" stretch="0,0,0,0">
<property name="spacing">
<number>6</number>
</property>
<property name="topMargin">
<number>20</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<widget class="QPushButton" name="prevButton">
<property name="minimumSize">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="createAccountButton">
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="text">
<string>Register with a provider</string>
</property>
<property name="default">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="loginButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<property name="maximumSize">
<size>
<width>150</width>
<height>0</height>
<width>40</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Log in</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="default">
<bool>true</bool>
<string/>
</property>
<property name="flat">
<bool>false</bool>
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<widget class="OCC::SlideShow" name="slideShow" native="true">
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="sizeHint" stdset="0">
</widget>
</item>
<item>
<widget class="QPushButton" name="nextButton">
<property name="minimumSize">
<size>
<width>40</width>
<height>20</height>
<height>0</height>
</size>
</property>
</spacer>
<property name="maximumSize">
<size>
<width>40</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="6" column="0">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0">
<widget class="OCC::SlideShow" name="slideShow">
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
</widget>
</item>
<item row="4" column="0">
<item>
<widget class="QWidget" name="login" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
@ -385,8 +291,8 @@
</layout>
</widget>
</item>
<item row="0" column="0">
<spacer name="verticalSpacer_5">
<item>
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
@ -401,6 +307,157 @@
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="buttons" stretch="0,0,0,0">
<property name="spacing">
<number>6</number>
</property>
<property name="topMargin">
<number>20</number>
</property>
<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>
<widget class="QPushButton" name="createAccountButton">
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="text">
<string>Register with a provider</string>
</property>
<property name="default">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="loginButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Log in</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="default">
<bool>true</bool>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</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>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<spacer name="horizontalSpacer_6">
<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>
<widget class="QWidget" name="widget" native="true">
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QLabel" name="installLink">
<property name="text">
<string>&lt;a href=&quot;https://docs.nextcloud.com/server/15/admin_manual/installation/index.html#installation&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#7a7a7a;&quot;&gt;Host your own server&lt;/span&gt;&lt;/a&gt;</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<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>
<widget class="QLabel" name="bottomLabel">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string notr="true">TextLabel</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>

View file

@ -84,7 +84,23 @@ OwncloudSetupPage::OwncloudSetupPage(QWidget *parent)
_ui.slideShow->addSlide(Theme::hidpiFileName(":/client/theme/colored/wizard-files.png"), tr("Secure collaboration & file exchange"));
_ui.slideShow->addSlide(Theme::hidpiFileName(":/client/theme/colored/wizard-groupware.png"), tr("Easy-to-use web mail, calendaring & contacts"));
_ui.slideShow->addSlide(Theme::hidpiFileName(":/client/theme/colored/wizard-talk.png"), tr("Screensharing, online meetings & web conferences"));
connect(_ui.slideShow, &SlideShow::clicked, _ui.slideShow, &SlideShow::nextSlide);
connect(_ui.slideShow, &SlideShow::clicked, _ui.slideShow, &SlideShow::stopShow);
connect(_ui.nextButton, &QPushButton::clicked, _ui.slideShow, &SlideShow::nextSlide);
connect(_ui.prevButton, &QPushButton::clicked, _ui.slideShow, &SlideShow::prevSlide);
auto widgetBgLightness = OwncloudSetupPage::palette().color(OwncloudSetupPage::backgroundRole()).lightness();
bool widgetHasDarkBg =
(widgetBgLightness >= 125)
? false
: true;
_ui.nextButton->setIcon(theme->uiThemeIcon(QString("control-next.svg"), widgetHasDarkBg));
_ui.prevButton->setIcon(theme->uiThemeIcon(QString("control-prev.svg"), widgetHasDarkBg));
// QPushButtons are a mess when it comes to consistent background coloring without stylesheets,
// so we do it here even though this is an exceptional styling method here
_ui.createAccountButton->setStyleSheet("QPushButton {background-color: #0082C9; color: white}");
_ui.slideShow->startShow();
QPalette pal = _ui.slideShow->palette();

View file

@ -116,7 +116,7 @@ void SlideShow::nextSlide()
_reverse = false;
}
void SlideShow::previousSlide()
void SlideShow::prevSlide()
{
setCurrentSlide((_currentIndex > 0 ? _currentIndex : _labels.count()) - 1);
_reverse = true;

View file

@ -51,7 +51,7 @@ public slots:
void startShow(int interval = 0);
void stopShow();
void nextSlide();
void previousSlide();
void prevSlide();
void reset();
signals:

View file

@ -432,6 +432,7 @@ void SignPublicKeyApiJob::start()
{
QNetworkRequest req;
req.setRawHeader("OCS-APIREQUEST", "true");
req.setHeader(QNetworkRequest::ContentTypeHeader, QByteArrayLiteral("application/x-www-form-urlencoded"));
QUrlQuery query;
query.addQueryItem(QLatin1String("format"), QLatin1String("json"));
QUrl url = Utility::concatUrlPath(account()->url(), path());

View file

@ -177,6 +177,14 @@ QIcon Theme::themeIcon(const QString &name, bool sysTray, bool sysTrayMenuVisibl
return cached;
}
QIcon Theme::uiThemeIcon(const QString &iconName, bool uiHasDarkBg) const
{
QString themeResBasePath = ":/client/theme/";
QString iconPath = themeResBasePath + (uiHasDarkBg?"white/":"black/") + iconName;
std::string icnPath = iconPath.toUtf8().constData();
return QIcon(QPixmap(iconPath));
}
QString Theme::hidpiFileName(const QString &fileName, QPaintDevice *dev)
{
qreal devicePixelRatio = dev ? dev->devicePixelRatio() : qApp->primaryScreen()->devicePixelRatio();

View file

@ -347,6 +347,14 @@ public:
* important dependency versions.
*/
virtual QString versionSwitchOutput() const;
/**
* @brief Request suitable QIcon resource depending on the background colour of the parent widget.
*
* This should be replaced (TODO) by a real theming implementation for the client UI
* (actually 2019/09/13 only systray theming).
*/
virtual QIcon uiThemeIcon(const QString &iconName, bool uiHasDarkBg) const;
protected:
#ifndef TOKEN_AUTH_ONLY

View file

@ -43,7 +43,7 @@
<file>theme/white/state-sync-64.png</file>
<file>theme/white/state-sync-128.png</file>
<file>theme/white/state-sync-256.png</file>
<file>theme/black/state-error-32.png</file>
<file>theme/black/state-error-32.png</file>
<file>theme/black/state-error-64.png</file>
<file>theme/black/state-error-128.png</file>
<file>theme/black/state-error-256.png</file>
@ -79,6 +79,8 @@
<file>theme/colored/state-warning-64.png</file>
<file>theme/colored/state-warning-128.png</file>
<file>theme/colored/state-warning-256.png</file>
<file>theme/black/control-next.svg</file>
<file>theme/black/control-prev.svg</file>
<file>theme/black/state-error.svg</file>
<file>theme/black/state-error-16.png</file>
<file>theme/black/state-offline.svg</file>
@ -99,6 +101,8 @@
<file>theme/black/state-warning-64.png</file>
<file>theme/black/state-warning-128.png</file>
<file>theme/black/state-warning-256.png</file>
<file>theme/white/control-next.svg</file>
<file>theme/white/control-prev.svg</file>
<file>theme/white/state-error.svg</file>
<file>theme/white/state-error-16.png</file>
<file>theme/white/state-offline.svg</file>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 18 29" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<g transform="matrix(1,0,0,1,-7.28829,-1.57657)">
<g transform="matrix(1,0,0,1,-5.71171,-3.55271e-15)">
<path d="M13.424,5.001C13.19,4.767 13.19,4.387 13.424,4.152C13.995,3.581 15.005,2.572 15.576,2.001C15.81,1.767 16.19,1.767 16.424,2.001C18.491,4.068 27.501,13.078 29.858,15.434C30.008,15.584 30.092,15.788 30.092,16C30.092,16.212 30.008,16.416 29.858,16.566C27.501,18.922 18.491,27.932 16.424,29.999C16.19,30.233 15.81,30.233 15.576,29.999C15.005,29.428 13.995,28.419 13.424,27.848C13.19,27.613 13.19,27.233 13.424,26.999C15.493,24.93 24.423,16 24.423,16C24.423,16 15.493,7.07 13.424,5.001Z" style="fill-opacity:0.6;"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 18 29" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<g transform="matrix(1,0,0,1,-7.28829,-1.57657)">
<g transform="matrix(-1,0,0,1,37.7117,-3.55271e-15)">
<path d="M13.424,5.001C13.19,4.767 13.19,4.387 13.424,4.152C13.995,3.581 15.005,2.572 15.576,2.001C15.81,1.767 16.19,1.767 16.424,2.001C18.491,4.068 27.501,13.078 29.858,15.434C30.008,15.584 30.092,15.788 30.092,16C30.092,16.212 30.008,16.416 29.858,16.566C27.501,18.922 18.491,27.932 16.424,29.999C16.19,30.233 15.81,30.233 15.576,29.999C15.005,29.428 13.995,28.419 13.424,27.848C13.19,27.613 13.19,27.233 13.424,26.999C15.493,24.93 24.423,16 24.423,16C24.423,16 15.493,7.07 13.424,5.001Z" style="fill-opacity:0.6;"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 18 29" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<g transform="matrix(1,0,0,1,-7.28829,-1.57657)">
<g transform="matrix(1,0,0,1,-5.71171,-3.55271e-15)">
<path d="M13.424,5.001C13.19,4.767 13.19,4.387 13.424,4.152C13.995,3.581 15.005,2.572 15.576,2.001C15.81,1.767 16.19,1.767 16.424,2.001C18.491,4.068 27.501,13.078 29.858,15.434C30.008,15.584 30.092,15.788 30.092,16C30.092,16.212 30.008,16.416 29.858,16.566C27.501,18.922 18.491,27.932 16.424,29.999C16.19,30.233 15.81,30.233 15.576,29.999C15.005,29.428 13.995,28.419 13.424,27.848C13.19,27.613 13.19,27.233 13.424,26.999C15.493,24.93 24.423,16 24.423,16C24.423,16 15.493,7.07 13.424,5.001Z" style="fill:white;fill-opacity:0.6;"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 18 29" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<g transform="matrix(1,0,0,1,-7.28829,-1.57657)">
<g transform="matrix(-1,0,0,1,37.7117,-3.55271e-15)">
<path d="M13.424,5.001C13.19,4.767 13.19,4.387 13.424,4.152C13.995,3.581 15.005,2.572 15.576,2.001C15.81,1.767 16.19,1.767 16.424,2.001C18.491,4.068 27.501,13.078 29.858,15.434C30.008,15.584 30.092,15.788 30.092,16C30.092,16.212 30.008,16.416 29.858,16.566C27.501,18.922 18.491,27.932 16.424,29.999C16.19,30.233 15.81,30.233 15.576,29.999C15.005,29.428 13.995,28.419 13.424,27.848C13.19,27.613 13.19,27.233 13.424,26.999C15.493,24.93 24.423,16 24.423,16C24.423,16 15.493,7.07 13.424,5.001Z" style="fill:white;fill-opacity:0.6;"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB