43 #define YUILogComponent "qt-ui" 47 #include "YQIconPool.h" 55 QPixmap YQIconPool::pkgTaboo() {
return iconPool()->
cachedIcon(
"package-available-locked",
true ); }
56 QPixmap YQIconPool::pkgDel() {
return iconPool()->
cachedIcon(
"package-remove",
true ); }
57 QPixmap YQIconPool::pkgUpdate() {
return iconPool()->
cachedIcon(
"package-upgrade",
true ); }
58 QPixmap YQIconPool::pkgInstall() {
return iconPool()->
cachedIcon(
"package-install",
true ); }
59 QPixmap YQIconPool::pkgAutoInstall() {
return iconPool()->
cachedIcon(
"package-install-auto",
true ); }
60 QPixmap YQIconPool::pkgAutoUpdate() {
return iconPool()->
cachedIcon(
"package-upgrade-auto",
true ); }
61 QPixmap YQIconPool::pkgAutoDel() {
return iconPool()->
cachedIcon(
"package-remove-auto",
true ); }
62 QPixmap YQIconPool::pkgKeepInstalled() {
return iconPool()->
cachedIcon(
"package-installed-updated",
true ); }
63 QPixmap YQIconPool::pkgNoInst() {
return iconPool()->
cachedIcon(
"package-available",
true ); }
64 QPixmap YQIconPool::pkgProtected() {
return iconPool()->
cachedIcon(
"package-installed-locked",
true ); }
66 QPixmap YQIconPool::disabledPkgTaboo() {
return iconPool()->
cachedIcon(
"package-available-locked",
false ); }
67 QPixmap YQIconPool::disabledPkgDel() {
return iconPool()->
cachedIcon(
"package-remove",
false ); }
68 QPixmap YQIconPool::disabledPkgUpdate() {
return iconPool()->
cachedIcon(
"package-upgrade",
false ); }
69 QPixmap YQIconPool::disabledPkgInstall() {
return iconPool()->
cachedIcon(
"package-install",
false ); }
70 QPixmap YQIconPool::disabledPkgAutoInstall() {
return iconPool()->
cachedIcon(
"package-install-auto",
false ); }
71 QPixmap YQIconPool::disabledPkgAutoUpdate() {
return iconPool()->
cachedIcon(
"package-upgrade-auto",
false ); }
72 QPixmap YQIconPool::disabledPkgAutoDel() {
return iconPool()->
cachedIcon(
"package-remove-auto",
false ); }
73 QPixmap YQIconPool::disabledPkgKeepInstalled() {
return iconPool()->
cachedIcon(
"package-installed-updated",
false ); }
74 QPixmap YQIconPool::disabledPkgNoInst() {
return iconPool()->
cachedIcon(
"package-available",
false ); }
75 QPixmap YQIconPool::disabledPkgProtected() {
return iconPool()->
cachedIcon(
"package-installed-locked",
false ); }
77 QPixmap YQIconPool::normalPkgConflict() {
return iconPool()->
cachedIcon(
"emblem-warning",
true ); }
80 QPixmap YQIconPool::treeMinus() {
return iconPool()->
cachedIcon(
"list-remove",
true ); }
82 QPixmap YQIconPool::warningSign() {
return iconPool()->
cachedIcon(
"emblem-warning",
true ); }
83 QPixmap YQIconPool::pkgSatisfied() {
return iconPool()->
cachedIcon(
"package-supported",
true ); }
85 QPixmap YQIconPool::tabRemove() {
return iconPool()->
cachedIcon(
"tab-close",
true ); }
86 QPixmap YQIconPool::arrowLeft() {
return iconPool()->
cachedIcon(
"arrow-left",
true ); }
87 QPixmap YQIconPool::arrowRight() {
return iconPool()->
cachedIcon(
"arrow-right",
true ); }
88 QPixmap YQIconPool::arrowDown() {
return iconPool()->
cachedIcon(
"arrow-down",
true ); }
99 YQIconPool::YQIconPool()
104 YQIconPool::~YQIconPool()
114 Q_INIT_RESOURCE(qt_pkg_icons);
115 QPixmap iconPixmap = _iconCache[ icon_name + enabled ];
119 iconPixmap =
loadIcon( icon_name, enabled );
125 iconPixmap = QPixmap( 8, 8 );
126 iconPixmap.fill( Qt::red );
130 _iconCache.insert( icon_name + enabled, iconPixmap );
139 QPixmap iconPixmap = _iconCache[ icon_name + enabled ];
141 if ( QIcon::hasThemeIcon( icon_name ) )
143 yuiDebug() <<
"Loading theme icon " << icon_name << endl;
145 QIcon icon = QIcon::fromTheme( icon_name, QIcon(
":/" + icon_name ) );
146 iconPixmap = icon.pixmap( QSize( 16, 16 ), enabled ? QIcon::Normal : QIcon::Disabled );
150 yuiDebug() <<
"Loading built-in icon " << icon_name << endl;
152 QIcon icon = QIcon(
":/" + icon_name );
153 iconPixmap = icon.pixmap( QSize( 16, 16 ), enabled ? QIcon::Normal : QIcon::Disabled );
157 yuiError() <<
"Could not load icon " << icon_name << endl;
static YQIconPool * iconPool()
Return the global icon pool.
QPixmap cachedIcon(const QString icon_name, const bool enabled)
Return the cached icon for 'icon_name'.
QPixmap loadIcon(const QString icon_name, const bool enabled)
Load the icon for 'icon_name' from the icon theme or, if that fails, from the compiled-in icons (usin...