2012-02-16 13:42:44 +04:00
|
|
|
/*
|
|
|
|
* Copyright (C) by Klaas Freitag <freitag@owncloud.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.
|
|
|
|
*/
|
|
|
|
|
2015-02-13 01:23:27 +03:00
|
|
|
#include <openssl/crypto.h>
|
|
|
|
|
2012-02-16 13:42:44 +04:00
|
|
|
#include "theme.h"
|
2012-02-21 13:48:18 +04:00
|
|
|
#include "version.h"
|
2013-01-09 19:29:50 +04:00
|
|
|
#include "config.h"
|
2014-10-24 23:52:41 +04:00
|
|
|
#include "utility.h"
|
2012-02-16 13:42:44 +04:00
|
|
|
|
2012-02-20 19:45:27 +04:00
|
|
|
#include <QtCore>
|
2014-04-06 21:34:56 +04:00
|
|
|
#ifndef TOKEN_AUTH_ONLY
|
2012-02-20 19:45:27 +04:00
|
|
|
#include <QtGui>
|
2014-04-06 21:34:56 +04:00
|
|
|
#endif
|
2012-02-20 19:45:27 +04:00
|
|
|
|
2014-07-11 02:31:24 +04:00
|
|
|
#include "owncloudtheme.h"
|
2012-09-24 19:55:10 +04:00
|
|
|
|
2013-01-09 19:29:50 +04:00
|
|
|
#ifdef THEME_INCLUDE
|
2015-01-08 16:21:58 +03:00
|
|
|
# define Mirall OCC // namespace hack to make old themes work
|
2013-01-09 19:29:50 +04:00
|
|
|
# define QUOTEME(M) #M
|
|
|
|
# define INCLUDE_FILE(M) QUOTEME(M)
|
|
|
|
# include INCLUDE_FILE(THEME_INCLUDE)
|
2015-01-08 16:21:58 +03:00
|
|
|
# undef Mirall
|
2013-01-09 19:29:50 +04:00
|
|
|
#endif
|
|
|
|
|
2014-11-10 00:34:07 +03:00
|
|
|
namespace OCC {
|
2012-02-16 13:42:44 +04:00
|
|
|
|
2012-09-24 19:55:10 +04:00
|
|
|
Theme* Theme::_instance = 0;
|
2012-02-20 19:45:27 +04:00
|
|
|
|
2012-09-24 19:55:10 +04:00
|
|
|
Theme* Theme::instance() {
|
2012-12-20 19:31:24 +04:00
|
|
|
if (!_instance) {
|
2012-09-24 19:55:10 +04:00
|
|
|
_instance = new THEME_CLASS;
|
2014-06-20 14:44:24 +04:00
|
|
|
// some themes may not call the base ctor
|
2012-12-20 19:31:24 +04:00
|
|
|
_instance->_mono = false;
|
|
|
|
}
|
2012-09-24 19:55:10 +04:00
|
|
|
return _instance;
|
2012-02-20 19:45:27 +04:00
|
|
|
}
|
|
|
|
|
2015-06-24 11:14:55 +03:00
|
|
|
Theme::~Theme() {}
|
|
|
|
|
2012-02-20 19:45:27 +04:00
|
|
|
QString Theme::statusHeaderText( SyncResult::Status status ) const
|
2012-02-16 13:42:44 +04:00
|
|
|
{
|
2012-02-20 19:45:27 +04:00
|
|
|
QString resultStr;
|
2012-02-16 13:42:44 +04:00
|
|
|
|
2012-04-30 10:56:56 +04:00
|
|
|
switch( status ) {
|
|
|
|
case SyncResult::Undefined:
|
2013-08-18 21:20:25 +04:00
|
|
|
resultStr = QCoreApplication::translate("theme", "Status undefined");
|
2012-04-30 10:56:56 +04:00
|
|
|
break;
|
|
|
|
case SyncResult::NotYetStarted:
|
2013-08-18 21:20:25 +04:00
|
|
|
resultStr = QCoreApplication::translate("theme", "Waiting to start sync");
|
2012-04-30 10:56:56 +04:00
|
|
|
break;
|
|
|
|
case SyncResult::SyncRunning:
|
2013-08-18 21:20:25 +04:00
|
|
|
resultStr = QCoreApplication::translate("theme", "Sync is running");
|
2012-04-30 10:56:56 +04:00
|
|
|
break;
|
|
|
|
case SyncResult::Success:
|
2013-08-18 21:20:25 +04:00
|
|
|
resultStr = QCoreApplication::translate("theme", "Sync Success");
|
2012-04-30 10:56:56 +04:00
|
|
|
break;
|
2013-08-02 16:22:01 +04:00
|
|
|
case SyncResult::Problem:
|
2013-12-03 15:31:28 +04:00
|
|
|
resultStr = QCoreApplication::translate("theme", "Sync Success, some files were ignored.");
|
2013-08-02 16:22:01 +04:00
|
|
|
break;
|
2012-04-30 10:56:56 +04:00
|
|
|
case SyncResult::Error:
|
2013-11-26 17:15:37 +04:00
|
|
|
resultStr = QCoreApplication::translate("theme", "Sync Error");
|
2012-04-30 10:56:56 +04:00
|
|
|
break;
|
|
|
|
case SyncResult::SetupError:
|
2013-08-18 21:20:25 +04:00
|
|
|
resultStr = QCoreApplication::translate("theme", "Setup Error" );
|
2012-04-30 10:56:56 +04:00
|
|
|
break;
|
2013-08-18 21:20:25 +04:00
|
|
|
case SyncResult::SyncPrepare:
|
|
|
|
resultStr = QCoreApplication::translate("theme", "Preparing to sync" );
|
|
|
|
break;
|
2013-10-03 15:41:15 +04:00
|
|
|
case SyncResult::SyncAbortRequested:
|
|
|
|
resultStr = QCoreApplication::translate("theme", "Aborting..." );
|
|
|
|
break;
|
2013-12-20 18:13:33 +04:00
|
|
|
case SyncResult::Paused:
|
|
|
|
resultStr = QCoreApplication::translate("theme", "Sync is paused");
|
|
|
|
break;
|
2012-02-20 19:45:27 +04:00
|
|
|
}
|
|
|
|
return resultStr;
|
2012-02-16 13:42:44 +04:00
|
|
|
}
|
|
|
|
|
2013-02-21 15:21:42 +04:00
|
|
|
QString Theme::appNameGUI() const
|
|
|
|
{
|
2013-08-22 11:40:15 +04:00
|
|
|
return QLatin1String(APPLICATION_NAME);
|
|
|
|
}
|
|
|
|
|
|
|
|
QString Theme::appName() const
|
|
|
|
{
|
|
|
|
return QLatin1String(APPLICATION_SHORTNAME);
|
2013-02-21 15:21:42 +04:00
|
|
|
}
|
|
|
|
|
2012-05-02 17:50:01 +04:00
|
|
|
QString Theme::version() const
|
2012-03-03 13:51:06 +04:00
|
|
|
{
|
2015-03-05 19:09:54 +03:00
|
|
|
return QString::fromLocal8Bit(MIRALL_VERSION_STRING);
|
2012-03-03 13:51:06 +04:00
|
|
|
}
|
|
|
|
|
2014-04-06 21:34:56 +04:00
|
|
|
#ifndef TOKEN_AUTH_ONLY
|
|
|
|
|
2012-05-02 17:50:01 +04:00
|
|
|
QIcon Theme::trayFolderIcon( const QString& backend ) const
|
2012-02-21 13:48:18 +04:00
|
|
|
{
|
2013-06-13 14:56:20 +04:00
|
|
|
Q_UNUSED(backend)
|
|
|
|
return applicationIcon();
|
2012-02-21 13:48:18 +04:00
|
|
|
}
|
|
|
|
|
2012-05-02 17:50:01 +04:00
|
|
|
/*
|
|
|
|
* helper to load a icon from either the icon theme the desktop provides or from
|
|
|
|
* the apps Qt resources.
|
|
|
|
*/
|
2016-10-06 18:18:51 +03:00
|
|
|
QIcon Theme::themeIcon( const QString& name, bool sysTray, bool sysTrayMenuVisible ) const
|
2012-05-02 17:50:01 +04:00
|
|
|
{
|
2012-12-20 19:31:24 +04:00
|
|
|
QString flavor;
|
2013-08-14 18:35:36 +04:00
|
|
|
if (sysTray) {
|
2016-10-06 18:18:51 +03:00
|
|
|
flavor = systrayIconFlavor(_mono, sysTrayMenuVisible);
|
2012-12-20 19:31:24 +04:00
|
|
|
} else {
|
|
|
|
flavor = QLatin1String("colored");
|
|
|
|
}
|
|
|
|
|
2015-03-25 16:57:23 +03:00
|
|
|
QString key = name + "," + flavor;
|
|
|
|
QIcon & cached = _iconCache[key];
|
|
|
|
if (cached.isNull()) {
|
2015-10-20 14:24:11 +03:00
|
|
|
if(QIcon::hasThemeIcon(name)) {
|
|
|
|
// use from theme
|
|
|
|
return cached = QIcon::fromTheme(name);
|
|
|
|
}
|
|
|
|
|
2012-07-18 19:29:06 +04:00
|
|
|
QList<int> sizes;
|
2015-02-12 21:44:30 +03:00
|
|
|
sizes <<16 << 22 << 32 << 48 << 64 << 128 << 256;
|
2012-07-18 19:29:06 +04:00
|
|
|
foreach (int size, sizes) {
|
2014-12-08 20:00:29 +03:00
|
|
|
QString pixmapName = QString::fromLatin1(":/client/theme/%1/%2-%3.png").arg(flavor).arg(name).arg(size);
|
2014-05-21 15:00:20 +04:00
|
|
|
if (QFile::exists(pixmapName)) {
|
2013-07-04 21:59:40 +04:00
|
|
|
QPixmap px(pixmapName);
|
|
|
|
// HACK, get rid of it by supporting FDO icon themes, this is really just emulating ubuntu-mono
|
|
|
|
if (qgetenv("DESKTOP_SESSION") == "ubuntu") {
|
|
|
|
QBitmap mask = px.createMaskFromColor(Qt::white, Qt::MaskOutColor);
|
|
|
|
QPainter p(&px);
|
|
|
|
p.setPen(QColor("#dfdbd2"));
|
|
|
|
p.drawPixmap(px.rect(), mask, mask.rect());
|
|
|
|
}
|
2015-03-25 16:57:23 +03:00
|
|
|
cached.addPixmap(px);
|
2012-07-18 19:29:06 +04:00
|
|
|
}
|
|
|
|
}
|
2015-03-25 16:57:23 +03:00
|
|
|
if (cached.isNull()) {
|
2012-12-20 19:31:24 +04:00
|
|
|
foreach (int size, sizes) {
|
2014-12-08 20:00:29 +03:00
|
|
|
QString pixmapName = QString::fromLatin1(":/client/resources/%1-%2.png").arg(name).arg(size);
|
2012-12-20 19:31:24 +04:00
|
|
|
if (QFile::exists(pixmapName)) {
|
2015-03-25 16:57:23 +03:00
|
|
|
cached.addFile(pixmapName);
|
2012-12-20 19:31:24 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2012-05-02 17:50:01 +04:00
|
|
|
}
|
2015-03-25 16:57:23 +03:00
|
|
|
|
2016-10-06 18:18:51 +03:00
|
|
|
#ifdef Q_OS_MAC
|
|
|
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
|
|
|
|
// This defines the icon as a template and enables automatic macOS color handling
|
|
|
|
// See https://bugreports.qt.io/browse/QTBUG-42109
|
|
|
|
cached.setIsMask(_mono && sysTray && !sysTrayMenuVisible);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2015-03-25 16:57:23 +03:00
|
|
|
return cached;
|
2012-02-16 13:42:44 +04:00
|
|
|
}
|
2014-06-20 14:44:24 +04:00
|
|
|
|
2015-02-16 12:24:42 +03:00
|
|
|
QString Theme::hidpiFileName(const QString &fileName, QPaintDevice *dev)
|
|
|
|
{
|
|
|
|
#if QT_VERSION > QT_VERSION_CHECK(5, 0, 0)
|
|
|
|
qreal devicePixelRatio = dev ? dev->devicePixelRatio() :
|
|
|
|
qApp->primaryScreen()->devicePixelRatio();
|
|
|
|
if (devicePixelRatio <= 1.0) {
|
|
|
|
return fileName;
|
|
|
|
}
|
|
|
|
// try to find a 2x version
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const int dotIndex = fileName.lastIndexOf(QLatin1Char('.'));
|
|
|
|
if (dotIndex != -1) {
|
|
|
|
QString at2xfileName = fileName;
|
|
|
|
at2xfileName.insert(dotIndex, QStringLiteral("@2x"));
|
|
|
|
if (QFile::exists(at2xfileName)) {
|
|
|
|
return at2xfileName;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
return fileName;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-07-10 17:26:55 +04:00
|
|
|
#endif
|
|
|
|
|
2014-06-20 14:44:24 +04:00
|
|
|
Theme::Theme() :
|
|
|
|
QObject(0)
|
|
|
|
,_mono(false)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
2012-02-16 13:42:44 +04:00
|
|
|
|
2015-10-05 06:20:09 +03:00
|
|
|
// If this option returns true, the client only supports one folder to sync.
|
|
|
|
// The Add-Button is removed accordingly.
|
2012-09-19 13:58:02 +04:00
|
|
|
bool Theme::singleSyncFolder() const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-10-19 13:26:42 +03:00
|
|
|
bool Theme::multiAccount() const
|
2015-08-13 10:38:53 +03:00
|
|
|
{
|
2015-10-19 13:26:42 +03:00
|
|
|
return true;
|
2015-08-13 10:38:53 +03:00
|
|
|
}
|
|
|
|
|
2012-09-28 15:42:22 +04:00
|
|
|
QString Theme::defaultServerFolder() const
|
|
|
|
{
|
2013-04-30 15:53:13 +04:00
|
|
|
return QLatin1String("/");
|
2012-09-28 15:42:22 +04:00
|
|
|
}
|
|
|
|
|
2013-01-09 19:29:50 +04:00
|
|
|
QString Theme::overrideServerUrl() const
|
|
|
|
{
|
|
|
|
return QString::null;
|
|
|
|
}
|
|
|
|
|
2016-04-15 14:16:49 +03:00
|
|
|
QString Theme::forceConfigAuthType() const
|
|
|
|
{
|
|
|
|
return QString();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-09-28 15:42:22 +04:00
|
|
|
QString Theme::defaultClientFolder() const
|
|
|
|
{
|
|
|
|
return appName();
|
|
|
|
}
|
|
|
|
|
2016-10-06 18:18:51 +03:00
|
|
|
QString Theme::systrayIconFlavor(bool mono, bool sysTrayMenuVisible ) const
|
2013-08-14 18:35:36 +04:00
|
|
|
{
|
2016-10-11 11:29:24 +03:00
|
|
|
Q_UNUSED(sysTrayMenuVisible)
|
2013-08-14 18:35:36 +04:00
|
|
|
QString flavor;
|
|
|
|
if (mono) {
|
2014-10-24 23:52:41 +04:00
|
|
|
flavor = Utility::hasDarkSystray() ? QLatin1String("white") : QLatin1String("black");
|
2016-10-06 18:18:51 +03:00
|
|
|
|
|
|
|
#ifdef Q_OS_MAC
|
|
|
|
if (sysTrayMenuVisible) {
|
|
|
|
flavor = QLatin1String("white");
|
|
|
|
}
|
|
|
|
#endif
|
2013-08-14 18:35:36 +04:00
|
|
|
} else {
|
|
|
|
flavor = QLatin1String("colored");
|
|
|
|
}
|
|
|
|
return flavor;
|
|
|
|
}
|
|
|
|
|
2012-12-20 19:31:24 +04:00
|
|
|
void Theme::setSystrayUseMonoIcons(bool mono)
|
|
|
|
{
|
|
|
|
_mono = mono;
|
2013-07-04 21:59:40 +04:00
|
|
|
emit systrayUseMonoIconsChanged(mono);
|
2012-12-20 19:31:24 +04:00
|
|
|
}
|
2012-09-28 15:42:22 +04:00
|
|
|
|
2012-12-20 19:31:24 +04:00
|
|
|
bool Theme::systrayUseMonoIcons() const
|
|
|
|
{
|
|
|
|
return _mono;
|
|
|
|
}
|
2012-09-28 15:42:22 +04:00
|
|
|
|
2013-12-09 19:35:30 +04:00
|
|
|
QString Theme::updateCheckUrl() const
|
|
|
|
{
|
|
|
|
return QLatin1String("https://updates.owncloud.com/client/");
|
|
|
|
}
|
|
|
|
|
2015-08-05 16:33:38 +03:00
|
|
|
qint64 Theme::newBigFolderSizeLimit() const
|
|
|
|
{
|
|
|
|
// Default to 500MB
|
|
|
|
return 500;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-08-18 13:24:03 +04:00
|
|
|
QString Theme::gitSHA1() const
|
|
|
|
{
|
|
|
|
QString devString;
|
|
|
|
#ifdef GIT_SHA1
|
|
|
|
const QString githubPrefix(QLatin1String(
|
2015-05-12 15:03:21 +03:00
|
|
|
"https://github.com/owncloud/client/commit/"));
|
2014-08-18 13:24:03 +04:00
|
|
|
const QString gitSha1(QLatin1String(GIT_SHA1));
|
|
|
|
devString = QCoreApplication::translate("ownCloudTheme::about()",
|
|
|
|
"<p><small>Built from Git revision <a href=\"%1\">%2</a>"
|
2015-02-13 01:23:27 +03:00
|
|
|
" on %3, %4 using Qt %5, %6</small></p>")
|
2014-08-18 13:24:03 +04:00
|
|
|
.arg(githubPrefix+gitSha1).arg(gitSha1.left(6))
|
|
|
|
.arg(__DATE__).arg(__TIME__)
|
2015-02-13 01:23:27 +03:00
|
|
|
.arg(QT_VERSION_STR)
|
|
|
|
.arg(QString::fromAscii(OPENSSL_VERSION_TEXT));
|
2014-08-18 13:24:03 +04:00
|
|
|
#endif
|
|
|
|
return devString;
|
|
|
|
}
|
|
|
|
|
2013-01-23 16:45:31 +04:00
|
|
|
QString Theme::about() const
|
|
|
|
{
|
2014-12-12 15:33:38 +03:00
|
|
|
QString re;
|
2014-12-12 15:37:02 +03:00
|
|
|
re = tr("<p>Version %1. For more information please visit <a href='%2'>%3</a>.</p>")
|
2014-06-10 15:48:27 +04:00
|
|
|
.arg(MIRALL_VERSION_STRING).arg("http://" MIRALL_STRINGIFY(APPLICATION_DOMAIN))
|
2014-12-12 15:33:38 +03:00
|
|
|
.arg(MIRALL_STRINGIFY(APPLICATION_DOMAIN));
|
|
|
|
|
2016-07-26 17:47:44 +03:00
|
|
|
re += tr("<p>Copyright ownCloud GmbH</p>");
|
2014-12-12 15:33:38 +03:00
|
|
|
re += tr("<p>Distributed by %1 and licensed under the GNU General Public License (GPL) Version 2.0.<br/>"
|
|
|
|
"%2 and the %2 logo are registered trademarks of %1 in the "
|
|
|
|
"United States, other countries, or both.</p>")
|
|
|
|
.arg(APPLICATION_VENDOR).arg(APPLICATION_NAME);
|
|
|
|
|
|
|
|
re += gitSHA1();
|
|
|
|
return re;
|
2013-01-23 16:45:31 +04:00
|
|
|
}
|
|
|
|
|
2014-04-06 21:34:56 +04:00
|
|
|
#ifndef TOKEN_AUTH_ONLY
|
2013-01-09 19:29:50 +04:00
|
|
|
QVariant Theme::customMedia( CustomMediaType type )
|
|
|
|
{
|
|
|
|
QVariant re;
|
|
|
|
QString key;
|
|
|
|
|
|
|
|
switch ( type )
|
|
|
|
{
|
|
|
|
case oCSetupTop:
|
|
|
|
key = QLatin1String("oCSetupTop");
|
|
|
|
break;
|
|
|
|
case oCSetupSide:
|
|
|
|
key = QLatin1String("oCSetupSide");
|
|
|
|
break;
|
|
|
|
case oCSetupBottom:
|
|
|
|
key = QLatin1String("oCSetupBottom");
|
|
|
|
break;
|
|
|
|
case oCSetupResultTop:
|
|
|
|
key = QLatin1String("oCSetupResultTop");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2014-12-08 20:00:29 +03:00
|
|
|
QString imgPath = QString::fromLatin1(":/client/theme/colored/%1.png").arg(key);
|
2013-01-09 19:29:50 +04:00
|
|
|
if ( QFile::exists( imgPath ) ) {
|
|
|
|
QPixmap pix( imgPath );
|
|
|
|
if( pix.isNull() ) {
|
|
|
|
// pixmap loading hasn't succeeded. We take the text instead.
|
|
|
|
re.setValue( key );
|
|
|
|
} else {
|
|
|
|
re.setValue( pix );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return re;
|
|
|
|
}
|
|
|
|
|
2016-10-06 18:18:51 +03:00
|
|
|
QIcon Theme::syncStateIcon( SyncResult::Status status, bool sysTray, bool sysTrayMenuVisible ) const
|
2013-05-17 22:56:17 +04:00
|
|
|
{
|
|
|
|
// FIXME: Mind the size!
|
|
|
|
QString statusIcon;
|
|
|
|
|
|
|
|
switch( status ) {
|
|
|
|
case SyncResult::Undefined:
|
2014-08-19 19:46:47 +04:00
|
|
|
// this can happen if no sync connections are configured.
|
|
|
|
statusIcon = QLatin1String("state-information");
|
2013-05-17 22:56:17 +04:00
|
|
|
break;
|
|
|
|
case SyncResult::NotYetStarted:
|
|
|
|
case SyncResult::SyncRunning:
|
|
|
|
statusIcon = QLatin1String("state-sync");
|
|
|
|
break;
|
2013-12-20 18:13:33 +04:00
|
|
|
case SyncResult::SyncAbortRequested:
|
|
|
|
case SyncResult::Paused:
|
|
|
|
statusIcon = QLatin1String("state-pause");
|
|
|
|
break;
|
2013-05-17 22:56:17 +04:00
|
|
|
case SyncResult::SyncPrepare:
|
|
|
|
case SyncResult::Success:
|
|
|
|
statusIcon = QLatin1String("state-ok");
|
|
|
|
break;
|
2013-08-15 10:14:05 +04:00
|
|
|
case SyncResult::Problem:
|
|
|
|
statusIcon = QLatin1String("state-information");
|
|
|
|
break;
|
2013-05-17 22:56:17 +04:00
|
|
|
case SyncResult::Error:
|
|
|
|
case SyncResult::SetupError:
|
2014-08-15 17:01:01 +04:00
|
|
|
// FIXME: Use state-problem once we have an icon.
|
2013-05-17 22:56:17 +04:00
|
|
|
default:
|
|
|
|
statusIcon = QLatin1String("state-error");
|
|
|
|
}
|
|
|
|
|
2016-10-06 18:18:51 +03:00
|
|
|
return themeIcon( statusIcon, sysTray, sysTrayMenuVisible );
|
2013-05-17 22:56:17 +04:00
|
|
|
}
|
|
|
|
|
2014-08-15 17:01:01 +04:00
|
|
|
QIcon Theme::folderDisabledIcon( ) const
|
|
|
|
{
|
|
|
|
return themeIcon( QLatin1String("state-pause") );
|
|
|
|
}
|
|
|
|
|
2016-10-06 18:18:51 +03:00
|
|
|
QIcon Theme::folderOfflineIcon(bool sysTray, bool sysTrayMenuVisible ) const
|
2014-08-15 17:01:01 +04:00
|
|
|
{
|
2016-10-06 18:18:51 +03:00
|
|
|
return themeIcon( QLatin1String("state-offline"), sysTray, sysTrayMenuVisible );
|
2014-08-15 17:01:01 +04:00
|
|
|
}
|
|
|
|
|
2013-05-17 20:05:22 +04:00
|
|
|
QColor Theme::wizardHeaderTitleColor() const
|
|
|
|
{
|
2013-05-17 22:56:17 +04:00
|
|
|
return qApp->palette().text().color();
|
2013-05-17 20:05:22 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
QColor Theme::wizardHeaderBackgroundColor() const
|
|
|
|
{
|
|
|
|
return QColor();
|
|
|
|
}
|
|
|
|
|
|
|
|
QPixmap Theme::wizardHeaderLogo() const
|
|
|
|
{
|
2013-06-25 16:51:39 +04:00
|
|
|
return applicationIcon().pixmap(64);
|
2013-05-17 20:05:22 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
QPixmap Theme::wizardHeaderBanner() const
|
|
|
|
{
|
2013-05-17 22:56:17 +04:00
|
|
|
QColor c = wizardHeaderBackgroundColor();
|
|
|
|
if (!c.isValid())
|
|
|
|
return QPixmap();
|
|
|
|
|
2013-05-17 20:05:22 +04:00
|
|
|
QPixmap pix(QSize(600, 78));
|
|
|
|
pix.fill(wizardHeaderBackgroundColor());
|
|
|
|
return pix;
|
|
|
|
}
|
2014-04-06 21:34:56 +04:00
|
|
|
#endif
|
2013-05-17 20:05:22 +04:00
|
|
|
|
2015-01-22 17:53:33 +03:00
|
|
|
bool Theme::wizardSelectiveSyncDefaultNothing() const
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-02-18 19:49:07 +03:00
|
|
|
QString Theme::webDavPath() const
|
|
|
|
{
|
|
|
|
return QLatin1String("remote.php/webdav/");
|
|
|
|
}
|
2015-01-22 17:53:33 +03:00
|
|
|
|
2015-11-03 00:57:17 +03:00
|
|
|
QString Theme::webDavPathNonShib() const
|
|
|
|
{
|
|
|
|
return QLatin1String("remote.php/nonshib-webdav/");
|
|
|
|
}
|
|
|
|
|
2016-02-22 15:53:45 +03:00
|
|
|
bool Theme::linkSharing() const
|
|
|
|
{
|
2016-03-30 14:31:33 +03:00
|
|
|
return true;
|
2016-02-22 15:53:45 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool Theme::userGroupSharing() const
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-03-11 18:21:40 +03:00
|
|
|
bool Theme::forceSystemNetworkProxy() const
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-03-17 18:47:27 +03:00
|
|
|
Theme::UserIDType Theme::userIDType() const
|
|
|
|
{
|
|
|
|
return UserIDType::UserIDUserName;
|
|
|
|
}
|
|
|
|
|
|
|
|
QString Theme::customUserID() const
|
|
|
|
{
|
|
|
|
return QString();
|
|
|
|
}
|
|
|
|
|
|
|
|
QString Theme::userIDHint() const
|
|
|
|
{
|
|
|
|
return QString();
|
|
|
|
}
|
|
|
|
|
2016-03-11 18:21:40 +03:00
|
|
|
|
2016-03-22 12:20:20 +03:00
|
|
|
QString Theme::wizardUrlPostfix() const
|
|
|
|
{
|
|
|
|
return QString();
|
|
|
|
}
|
|
|
|
|
2016-04-12 17:24:06 +03:00
|
|
|
QString Theme::wizardUrlHint() const
|
|
|
|
{
|
|
|
|
return QString();
|
|
|
|
}
|
|
|
|
|
2016-04-22 11:05:50 +03:00
|
|
|
QString Theme::quotaBaseFolder() const
|
|
|
|
{
|
|
|
|
return QLatin1String("/");
|
|
|
|
}
|
2016-11-29 12:36:37 +03:00
|
|
|
|
|
|
|
bool Theme::dontSyncMountedStorageByDefault() const
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-05-12 15:03:21 +03:00
|
|
|
} // end namespace client
|