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.
|
|
|
|
*/
|
|
|
|
|
2012-05-21 18:48:49 +04:00
|
|
|
#include "owncloudtheme.h"
|
|
|
|
|
2012-02-16 13:42:44 +04:00
|
|
|
#include <QString>
|
2013-06-13 18:31:38 +04:00
|
|
|
#include <QVariant>
|
2014-04-06 21:34:56 +04:00
|
|
|
#ifndef TOKEN_AUTH_ONLY
|
2012-02-23 14:44:44 +04:00
|
|
|
#include <QPixmap>
|
2012-05-02 17:50:01 +04:00
|
|
|
#include <QIcon>
|
2012-12-20 19:31:24 +04:00
|
|
|
#include <QStyle>
|
2012-08-02 13:09:37 +04:00
|
|
|
#include <QApplication>
|
2014-04-06 21:34:56 +04:00
|
|
|
#endif
|
|
|
|
#include <QCoreApplication>
|
2013-06-13 18:31:38 +04:00
|
|
|
#include <QDebug>
|
|
|
|
|
2014-07-11 02:31:24 +04:00
|
|
|
#include "version.h"
|
2013-01-23 16:45:31 +04:00
|
|
|
#include "config.h"
|
|
|
|
|
2014-11-10 00:34:07 +03:00
|
|
|
namespace OCC {
|
2012-02-16 13:42:44 +04:00
|
|
|
|
2014-06-20 14:44:24 +04:00
|
|
|
ownCloudTheme::ownCloudTheme() :
|
|
|
|
Theme()
|
2012-02-16 13:42:44 +04:00
|
|
|
{
|
2012-02-28 18:13:59 +04:00
|
|
|
// qDebug() << " ** running ownCloud theme!";
|
2012-02-16 13:42:44 +04:00
|
|
|
}
|
|
|
|
|
2012-02-17 14:11:18 +04:00
|
|
|
QString ownCloudTheme::configFileName() const
|
|
|
|
{
|
2012-08-02 13:17:24 +04:00
|
|
|
return QLatin1String("owncloud.cfg");
|
2012-02-17 14:11:18 +04:00
|
|
|
}
|
2012-02-23 14:44:44 +04:00
|
|
|
|
2013-01-23 16:45:31 +04:00
|
|
|
QString ownCloudTheme::about() const
|
|
|
|
{
|
|
|
|
QString devString;
|
2014-08-18 14:17:13 +04:00
|
|
|
devString = trUtf8("<p>Version %2. For more information visit <a href=\"%3\">%4</a></p>"
|
|
|
|
"<p><small>By Klaas Freitag, Daniel Molkentin, Jan-Christoph Borchardt, "
|
2014-11-10 00:35:17 +03:00
|
|
|
"Olivier Goffart, Markus Götz and others.</small></p>"
|
2014-08-14 19:07:47 +04:00
|
|
|
"<p>Copyright ownCloud, Inc.</p>"
|
2014-08-30 04:18:55 +04:00
|
|
|
"<p>Licensed under the GNU General Public License (GPL) Version 2.0<br/>"
|
2014-08-17 19:38:33 +04:00
|
|
|
"ownCloud and the ownCloud Logo are registered trademarks of ownCloud, "
|
2014-10-10 17:38:56 +04:00
|
|
|
"Inc. in the United States, other countries, or both.</p>"
|
2013-01-23 16:45:31 +04:00
|
|
|
)
|
2013-12-09 19:35:30 +04:00
|
|
|
.arg(MIRALL_VERSION_STRING)
|
2013-01-23 16:45:31 +04:00
|
|
|
.arg("http://" MIRALL_STRINGIFY(APPLICATION_DOMAIN))
|
2014-08-18 13:24:03 +04:00
|
|
|
.arg(MIRALL_STRINGIFY(APPLICATION_DOMAIN));
|
|
|
|
|
|
|
|
devString += gitSHA1();
|
|
|
|
return devString;
|
2013-07-04 21:59:40 +04:00
|
|
|
|
2013-01-23 16:45:31 +04:00
|
|
|
}
|
|
|
|
|
2014-04-06 21:34:56 +04:00
|
|
|
#ifndef TOKEN_AUTH_ONLY
|
2012-05-02 17:50:01 +04:00
|
|
|
QIcon ownCloudTheme::trayFolderIcon( const QString& ) const
|
|
|
|
{
|
2012-12-20 19:31:24 +04:00
|
|
|
QPixmap fallback = qApp->style()->standardPixmap(QStyle::SP_FileDialogNewFolder);
|
|
|
|
return QIcon::fromTheme("folder", fallback);
|
2012-05-02 17:50:01 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
QIcon ownCloudTheme::applicationIcon( ) const
|
|
|
|
{
|
2013-05-28 16:42:41 +04:00
|
|
|
return themeIcon( QLatin1String("owncloud-icon") );
|
2012-05-02 17:50:01 +04:00
|
|
|
}
|
|
|
|
|
2014-04-06 21:34:56 +04:00
|
|
|
|
2013-06-13 14:56:20 +04:00
|
|
|
QVariant ownCloudTheme::customMedia(Theme::CustomMediaType type)
|
|
|
|
{
|
|
|
|
if (type == Theme::oCSetupTop) {
|
2014-08-28 20:09:15 +04:00
|
|
|
// return QCoreApplication::translate("ownCloudTheme",
|
|
|
|
// "If you don't have an ownCloud server yet, "
|
|
|
|
// "see <a href=\"https://owncloud.com\">owncloud.com</a> for more info.",
|
|
|
|
// "Top text in setup wizard. Keep short!");
|
|
|
|
return QVariant();
|
2013-06-13 14:56:20 +04:00
|
|
|
} else {
|
|
|
|
return QVariant();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-11-21 14:15:41 +03:00
|
|
|
#endif
|
|
|
|
|
2013-07-04 21:59:40 +04:00
|
|
|
QString ownCloudTheme::helpUrl() const
|
|
|
|
{
|
|
|
|
return QString::fromLatin1("http://doc.owncloud.org/desktop/%1.%2/").arg(MIRALL_VERSION_MAJOR).arg(MIRALL_VERSION_MINOR);
|
|
|
|
}
|
|
|
|
|
2014-04-06 21:34:56 +04:00
|
|
|
#ifndef TOKEN_AUTH_ONLY
|
2013-05-17 20:05:22 +04:00
|
|
|
QColor ownCloudTheme::wizardHeaderBackgroundColor() const
|
|
|
|
{
|
|
|
|
return QColor("#1d2d42");
|
|
|
|
}
|
|
|
|
|
|
|
|
QColor ownCloudTheme::wizardHeaderTitleColor() const
|
|
|
|
{
|
|
|
|
return QColor("#ffffff");
|
|
|
|
}
|
|
|
|
|
2013-06-25 16:51:39 +04:00
|
|
|
QPixmap ownCloudTheme::wizardHeaderLogo() const
|
|
|
|
{
|
2015-02-16 12:24:42 +03:00
|
|
|
return QPixmap(hidpiFileName(":/client/theme/colored/wizard_logo.png"));
|
2013-06-25 16:51:39 +04:00
|
|
|
}
|
2014-04-06 21:34:56 +04:00
|
|
|
#endif
|
2013-07-04 21:59:40 +04:00
|
|
|
|
2014-06-12 18:47:17 +04:00
|
|
|
QString ownCloudTheme::appName() const
|
|
|
|
{
|
2014-09-03 18:07:05 +04:00
|
|
|
return QLatin1String("ownCloud");
|
2014-06-12 18:47:17 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
QString ownCloudTheme::appNameGUI() const
|
|
|
|
{
|
|
|
|
return QLatin1String("ownCloud");
|
|
|
|
}
|
|
|
|
|
2013-07-04 21:59:40 +04:00
|
|
|
|
2012-02-16 13:42:44 +04:00
|
|
|
}
|
|
|
|
|