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 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190
|
/*
Data.cpp
This file is part of Charm, a task-based time tracking application.
Copyright (C) 2007-2018 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
Author: Mirko Boehm <mirko.boehm@kdab.com>
Author: Frank Osterfeld <frank.osterfeld@kdab.com>
Author: Mike McQuaid <mike.mcquaid@kdab.com>
Author: David Faure <david.faure@kdab.com>
Author: Mike Arthur <mike.mcquaid@kdab.com>
Author: Allen Winter <allen.winter@kdab.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.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "Data.h"
#include <QIcon>
#include <QPixmap>
const QIcon &Data::charmIcon()
{
static QIcon icon(QStringLiteral(":/Charm/charmicon.png"));
Q_ASSERT_X(!icon.isNull(), Q_FUNC_INFO,
"Required resource not available");
return icon;
}
const QIcon &Data::charmTrayIcon()
{
// Mac and Windows: the system tray uses 16x16.
// TODO: different icons though: white background on Windows
// On X11: pure-Qt apps get 22x22 from QSystemTrayIcon.
// KDE apps seem to get 24x24 in KSystemTrayIcon via KIconLoader, which is actually better.
#ifdef Q_OS_OSX
static const QString iconPath = QStringLiteral(":/Charm/charmtray_mac.png");
#else
static const QString iconPath = QStringLiteral(":/Charm/charmtray22.png");
#endif
Q_ASSERT_X(!QPixmap(iconPath).isNull(), Q_FUNC_INFO,
"Required resource not available");
static QIcon icon = QPixmap(iconPath);
return icon;
}
const QIcon &Data::charmTrayActiveIcon()
{
// Mac and Windows: the system tray uses 16x16.
// TODO: different icons though: white background on Windows
// On X11: pure-Qt apps get 22x22 from QSystemTrayIcon.
// KDE apps seem to get 24x24 in KSystemTrayIcon via KIconLoader, which is actually better.
#ifdef Q_OS_OSX
static const QString iconPath = QStringLiteral(":/Charm/charmtrayactive_mac.png");
#else
static const QString iconPath = QStringLiteral(":/Charm/charmtrayactive22.png");
#endif
Q_ASSERT_X(!QPixmap(iconPath).isNull(), Q_FUNC_INFO,
"Required resource not available");
static QIcon icon = QPixmap(iconPath);
return icon;
}
const QIcon &Data::goIcon()
{
static QIcon icon(QStringLiteral(":/Charm/go.png"));
Q_ASSERT_X(!icon.isNull(), Q_FUNC_INFO,
"Required resource not available");
return icon;
}
const QIcon &Data::stopIcon()
{
static QIcon icon(QStringLiteral(":/Charm/stop.png"));
Q_ASSERT_X(!icon.isNull(), Q_FUNC_INFO,
"Required resource not available");
return icon;
}
const QIcon &Data::newTaskIcon()
{
static QIcon icon(QStringLiteral(":/Charm/newtask.png"));
Q_ASSERT_X(!icon.isNull(), Q_FUNC_INFO,
"Required resource not available");
return icon;
}
const QIcon &Data::newSubtaskIcon()
{
static QIcon icon(QStringLiteral(":/Charm/newsubtask.png"));
Q_ASSERT_X(!icon.isNull(), Q_FUNC_INFO,
"Required resource not available");
return icon;
}
const QIcon &Data::editTaskIcon()
{ // FIXME same as edit-event icon
static QIcon icon(QStringLiteral(":/Charm/edit.png"));
Q_ASSERT_X(!icon.isNull(), Q_FUNC_INFO,
"Required resource not available");
return icon;
}
const QIcon &Data::deleteTaskIcon()
{
static QIcon icon(QStringLiteral(":/Charm/deletetask.png"));
Q_ASSERT_X(!icon.isNull(),
Q_FUNC_INFO, "Required resource not available");
return icon;
}
const QIcon &Data::searchIcon()
{
static QIcon icon(QStringLiteral(":/Charm/search.png"));
Q_ASSERT_X(!icon.isNull(),
Q_FUNC_INFO, "Required resource not available");
return icon;
}
const QIcon &Data::editEventIcon()
{
static QIcon icon(QStringLiteral(":/Charm/edit.png"));
Q_ASSERT_X(!icon.isNull(), Q_FUNC_INFO,
"Required resource not available");
return icon;
}
const QIcon &Data::createReportIcon()
{
static QIcon icon(QStringLiteral(":/Charm/createreport.png"));
Q_ASSERT_X(!icon.isNull(), Q_FUNC_INFO,
"Required resource not available");
return icon;
}
const QPixmap &Data::activePixmap()
{
static QPixmap pixmap(QStringLiteral(":/Charm/active.png"));
Q_ASSERT_X(!pixmap.isNull(), Q_FUNC_INFO,
"Required resource not available");
return pixmap;
}
const QIcon &Data::quitCharmIcon()
{
static QIcon icon(QStringLiteral(":/Charm/quitcharm.png"));
Q_ASSERT_X(!icon.isNull(),
Q_FUNC_INFO, "Required resource not available");
return icon;
}
const QIcon &Data::configureIcon()
{
static QIcon icon(QStringLiteral(":/Charm/configure.png"));
Q_ASSERT_X(!icon.isNull(),
Q_FUNC_INFO, "Required resource not available");
return icon;
}
const QPixmap &Data::editorLockedPixmap()
{
static QPixmap pixmap(QStringLiteral(":/Charm/editor_locked.png"));
Q_ASSERT_X(!pixmap.isNull(), Q_FUNC_INFO,
"Required resource not available");
return pixmap;
}
const QPixmap &Data::editorDirtyPixmap()
{
static QPixmap pixmap(QStringLiteral(":/Charm/editor_dirty.png"));
Q_ASSERT_X(!pixmap.isNull(), Q_FUNC_INFO,
"Required resource not available");
return pixmap;
}
|