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 "miralltheme.h"
|
|
|
|
|
2012-02-16 13:42:44 +04:00
|
|
|
#include <QString>
|
|
|
|
#include <QDebug>
|
2012-02-23 14:44:44 +04:00
|
|
|
#include <QPixmap>
|
2012-05-02 17:50:01 +04:00
|
|
|
#include <QIcon>
|
2012-02-16 13:42:44 +04:00
|
|
|
|
|
|
|
namespace Mirall {
|
|
|
|
|
|
|
|
mirallTheme::mirallTheme()
|
|
|
|
{
|
|
|
|
qDebug() << " ** running mirall theme!";
|
|
|
|
}
|
|
|
|
|
|
|
|
QString mirallTheme::appName() const
|
|
|
|
{
|
2012-08-17 19:13:17 +04:00
|
|
|
return QLatin1String("Mirall");
|
2012-02-17 14:11:18 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
QString mirallTheme::configFileName() const
|
|
|
|
{
|
2012-08-17 19:13:17 +04:00
|
|
|
return QLatin1String("mirall.cfg");
|
2012-02-16 13:42:44 +04:00
|
|
|
}
|
|
|
|
|
2012-02-23 14:44:44 +04:00
|
|
|
QPixmap mirallTheme::splashScreen() const
|
|
|
|
{
|
2012-08-17 19:13:17 +04:00
|
|
|
return QPixmap(QLatin1String(":/mirall/resources/owncloud_splash.png")); // FIXME: mirall splash!
|
2012-02-23 14:44:44 +04:00
|
|
|
}
|
|
|
|
|
2012-05-02 17:50:01 +04:00
|
|
|
QIcon mirallTheme::folderIcon( const QString& backend ) const
|
|
|
|
{
|
|
|
|
QString name;
|
|
|
|
|
|
|
|
if( backend == QString::fromLatin1("owncloud")) {
|
2012-08-17 19:13:17 +04:00
|
|
|
name = QLatin1String( "mirall" );
|
2012-05-02 17:50:01 +04:00
|
|
|
}
|
|
|
|
if( backend == QString::fromLatin1("unison" )) {
|
2012-08-17 19:13:17 +04:00
|
|
|
name = QLatin1String( "folder-sync" );
|
2012-05-02 17:50:01 +04:00
|
|
|
}
|
|
|
|
if( backend == QString::fromLatin1("csync" )) {
|
2012-08-17 19:13:17 +04:00
|
|
|
name = QLatin1String( "folder-remote" );
|
2012-05-02 17:50:01 +04:00
|
|
|
}
|
|
|
|
if( backend.isEmpty() || backend == QString::fromLatin1("none") ) {
|
2012-08-17 19:13:17 +04:00
|
|
|
name = QLatin1String("folder-grey.png");
|
2012-05-02 17:50:01 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
qDebug() << "==> load folder icon " << name;
|
2012-07-18 19:29:06 +04:00
|
|
|
return themeIcon( name );
|
2012-05-02 17:50:01 +04:00
|
|
|
}
|
|
|
|
|
2012-07-18 19:29:06 +04:00
|
|
|
QIcon mirallTheme::syncStateIcon( SyncResult::Status status ) const
|
2012-05-02 17:50:01 +04:00
|
|
|
{
|
|
|
|
QString statusIcon;
|
|
|
|
|
|
|
|
switch( status ) {
|
|
|
|
case SyncResult::Undefined:
|
2012-08-17 19:13:17 +04:00
|
|
|
statusIcon = QLatin1String("dialog-close");
|
2012-05-02 17:50:01 +04:00
|
|
|
break;
|
|
|
|
case SyncResult::NotYetStarted:
|
2012-08-17 19:13:17 +04:00
|
|
|
statusIcon = QLatin1String("task-ongoing");
|
2012-05-02 17:50:01 +04:00
|
|
|
break;
|
|
|
|
case SyncResult::SyncRunning:
|
2012-08-17 19:13:17 +04:00
|
|
|
statusIcon = QLatin1String("view-refresh");
|
2012-05-02 17:50:01 +04:00
|
|
|
break;
|
|
|
|
case SyncResult::Success:
|
2012-08-17 19:13:17 +04:00
|
|
|
statusIcon = QLatin1String("dialog-ok");
|
2012-05-02 17:50:01 +04:00
|
|
|
break;
|
|
|
|
case SyncResult::Error:
|
2012-08-17 19:13:17 +04:00
|
|
|
statusIcon = QLatin1String("dialog-close");
|
2012-05-02 17:50:01 +04:00
|
|
|
break;
|
|
|
|
case SyncResult::SetupError:
|
2012-08-17 19:13:17 +04:00
|
|
|
statusIcon = QLatin1String("dialog-cancel");
|
2012-05-02 17:50:01 +04:00
|
|
|
break;
|
|
|
|
default:
|
2012-08-17 19:13:17 +04:00
|
|
|
statusIcon = QLatin1String("dialog-close");
|
2012-05-02 17:50:01 +04:00
|
|
|
}
|
2012-07-18 19:29:06 +04:00
|
|
|
return themeIcon( statusIcon );
|
2012-05-02 17:50:01 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-07-18 19:29:06 +04:00
|
|
|
QIcon mirallTheme::folderDisabledIcon() const
|
2012-05-02 17:50:01 +04:00
|
|
|
{
|
|
|
|
// Fixme: Do we really want the dialog-canel from theme here?
|
2012-08-17 19:13:17 +04:00
|
|
|
return themeIcon( QLatin1String("dialog-cancel") );
|
2012-05-02 17:50:01 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
QIcon mirallTheme::applicationIcon( ) const
|
|
|
|
{
|
2012-08-17 19:13:17 +04:00
|
|
|
return themeIcon( QLatin1String("mirall"));
|
2012-05-02 17:50:01 +04:00
|
|
|
}
|
|
|
|
|
2012-02-16 13:42:44 +04:00
|
|
|
}
|
|
|
|
|