Welcome to mirror list, hosted at ThFree Co, Russian Federation.

owncloudtheme.cpp « mirall « src - github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1b3f807d93ab68759020ba900e00e82b67be7712 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*
 * 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.
 */

#include "owncloudtheme.h"

#include <QString>
#include <QDebug>
#include <QPixmap>
#include <QIcon>

namespace Mirall {

ownCloudTheme::ownCloudTheme()
{
    // qDebug() << " ** running ownCloud theme!";
}

QString ownCloudTheme::appName() const
{
    return QString::fromLocal8Bit("ownCloud");
}

QString ownCloudTheme::configFileName() const
{
    return QString::fromLocal8Bit("owncloud.cfg");
}

QPixmap ownCloudTheme::splashScreen() const
{
    return QPixmap(":/mirall/resources/owncloud_splash.png");
}

QIcon ownCloudTheme::folderIcon( const QString& backend ) const
{
  QString name;
  int size = 48;

  if( backend == QString::fromLatin1("owncloud")) {
      name = QString( "owncloud-icon-framed" );
      size = 64;
  }
  if( backend == QString::fromLatin1("unison" )) {
      name  = QString( "folder-sync" );
  }
  if( backend == QString::fromLatin1("csync" )) {
      name   = QString( "folder-remote" );
  }
  if( backend.isEmpty() || backend == QString::fromLatin1("none") ) {
      name = QString("folder-grey.png");
  }

  qDebug() << "==> load folder icon " << name;
  return themeIcon( name, size );
}

QIcon ownCloudTheme::trayFolderIcon( const QString& ) const
{
    return themeIcon( "owncloud-icon", 48 );
}


QIcon ownCloudTheme::syncStateIcon( SyncResult::Status status, int size ) const
{
    // FIXME: Mind the size!
    QString statusIcon;

    switch( status ) {
    case SyncResult::Undefined:
        statusIcon = "owncloud-icon-error";
        break;
    case SyncResult::NotYetStarted:
        statusIcon = "owncloud-icon";
        break;
    case SyncResult::SyncRunning:
        statusIcon = "owncloud-icon-sync";
        break;
    case SyncResult::Success:
        statusIcon = "owncloud-icon-sync-ok";
        break;
    case SyncResult::Error:
        statusIcon = "owncloud-icon-error";
        break;
    case SyncResult::SetupError:
        statusIcon = "owncloud-icon-error";
        break;
    default:
        statusIcon = "owncloud-icon-error";
    }

    return themeIcon( statusIcon, size );
}


QIcon ownCloudTheme::folderDisabledIcon( int size ) const
{
    // Fixme: Do we really want the dialog-canel from theme here?
    return themeIcon( "owncloud-icon-error", size );
}

QIcon ownCloudTheme::applicationIcon( ) const
{
    return themeIcon( "owncloud-icon", 48 );
}


}