1 /*---------------------------------------------------------------------\
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
11 \----------------------------------------------------------------------/
15 Author: Stefan Hundhammer <sh@suse.de>
19 #define y2log_component "qt-ui"
20 #include <ycp/y2log.h>
22 #include "YQIconPool.h"
25 #include "icons/autodel.xpm"
26 #include "icons/autodel_disabled.xpm"
27 #include "icons/autoinstall.xpm"
28 #include "icons/autoinstall_disabled.xpm"
29 #include "icons/autoupdate.xpm"
30 #include "icons/autoupdate_disabled.xpm"
31 #include "icons/del.xpm"
32 #include "icons/del_disabled.xpm"
33 #include "icons/install.xpm"
34 #include "icons/install_disabled.xpm"
35 #include "icons/keepinstalled.xpm"
36 #include "icons/keepinstalled_disabled.xpm"
37 #include "icons/noinst.xpm"
38 #include "icons/noinst_disabled.xpm"
39 #include "icons/protected.xpm"
40 #include "icons/protected_disabled.xpm"
41 #include "icons/sel_autodel.xpm"
42 #include "icons/sel_autodel_disabled.xpm"
43 #include "icons/sel_autoinstall.xpm"
44 #include "icons/sel_autoinstall_disabled.xpm"
45 #include "icons/sel_autoupdate.xpm"
46 #include "icons/sel_autoupdate_disabled.xpm"
47 #include "icons/taboo.xpm"
48 #include "icons/taboo_disabled.xpm"
49 #include "icons/update.xpm"
50 #include "icons/update_disabled.xpm"
51 #include "icons/tree_plus.xpm"
52 #include "icons/tree_minus.xpm"
53 #include "icons/warning_sign.xpm"
54 #include "icons/satisfied.xpm"
56 #include "icons/normal_conflict.xpm"
57 #include "icons/select_conflict.xpm"
58 #include "icons/delete_conflict.xpm"
59 #include "icons/unresolvable_conflict.xpm"
61 #include "icons/checklist_off.xpm"
62 #include "icons/checklist_on.xpm"
64 #include "icons/step_current.xpm"
65 #include "icons/step_todo.xpm"
66 #include "icons/step_done.xpm"
71 YQIconPool * YQIconPool::_iconPool = 0;
73 QPixmap YQIconPool::pkgTaboo() { return iconPool()->cachedIcon( taboo_xpm ); }
74 QPixmap YQIconPool::pkgDel() { return iconPool()->cachedIcon( del_xpm ); }
75 QPixmap YQIconPool::pkgUpdate() { return iconPool()->cachedIcon( update_xpm ); }
76 QPixmap YQIconPool::pkgInstall() { return iconPool()->cachedIcon( install_xpm ); }
77 QPixmap YQIconPool::pkgAutoInstall() { return iconPool()->cachedIcon( autoinstall_xpm ); }
78 QPixmap YQIconPool::pkgAutoUpdate() { return iconPool()->cachedIcon( autoupdate_xpm ); }
79 QPixmap YQIconPool::pkgAutoDel() { return iconPool()->cachedIcon( autodel_xpm ); }
80 QPixmap YQIconPool::pkgSelAutoInstall() { return iconPool()->cachedIcon( sel_autoinstall_xpm ); }
81 QPixmap YQIconPool::pkgSelAutoUpdate() { return iconPool()->cachedIcon( sel_autoupdate_xpm ); }
82 QPixmap YQIconPool::pkgSelAutoDel() { return iconPool()->cachedIcon( sel_autodel_xpm ); }
83 QPixmap YQIconPool::pkgKeepInstalled() { return iconPool()->cachedIcon( keepinstalled_xpm ); }
84 QPixmap YQIconPool::pkgNoInst() { return iconPool()->cachedIcon( noinst_xpm ); }
85 QPixmap YQIconPool::pkgProtected() { return iconPool()->cachedIcon( protected_xpm ); }
87 QPixmap YQIconPool::disabledPkgTaboo() { return iconPool()->cachedIcon( taboo_disabled_xpm ); }
88 QPixmap YQIconPool::disabledPkgDel() { return iconPool()->cachedIcon( del_disabled_xpm ); }
89 QPixmap YQIconPool::disabledPkgUpdate() { return iconPool()->cachedIcon( update_disabled_xpm ); }
90 QPixmap YQIconPool::disabledPkgInstall() { return iconPool()->cachedIcon( install_disabled_xpm ); }
91 QPixmap YQIconPool::disabledPkgAutoInstall() { return iconPool()->cachedIcon( autoinstall_disabled_xpm ); }
92 QPixmap YQIconPool::disabledPkgAutoUpdate() { return iconPool()->cachedIcon( autoupdate_disabled_xpm ); }
93 QPixmap YQIconPool::disabledPkgAutoDel() { return iconPool()->cachedIcon( autodel_disabled_xpm ); }
94 QPixmap YQIconPool::disabledPkgSelAutoInstall() { return iconPool()->cachedIcon( sel_autoinstall_disabled_xpm );}
95 QPixmap YQIconPool::disabledPkgSelAutoUpdate() { return iconPool()->cachedIcon( sel_autoupdate_disabled_xpm ); }
96 QPixmap YQIconPool::disabledPkgSelAutoDel() { return iconPool()->cachedIcon( sel_autodel_disabled_xpm ); }
97 QPixmap YQIconPool::disabledPkgKeepInstalled() { return iconPool()->cachedIcon( keepinstalled_disabled_xpm ); }
98 QPixmap YQIconPool::disabledPkgNoInst() { return iconPool()->cachedIcon( noinst_disabled_xpm ); }
99 QPixmap YQIconPool::disabledPkgProtected() { return iconPool()->cachedIcon( protected_disabled_xpm ); }
101 QPixmap YQIconPool::checkMarkOn() { return iconPool()->cachedIcon( checklist_on_xpm ); }
102 QPixmap YQIconPool::checkMarkOff() { return iconPool()->cachedIcon( checklist_off_xpm ); }
104 QPixmap YQIconPool::normalPkgConflict() { return iconPool()->cachedIcon( normal_conflict_xpm ); }
105 QPixmap YQIconPool::severePkgConflict() { return iconPool()->cachedIcon( normal_conflict_xpm ); }
106 QPixmap YQIconPool::unresolvablePkgConflict() { return iconPool()->cachedIcon( unresolvable_conflict_xpm ); }
107 QPixmap YQIconPool::deletePkgConflict() { return iconPool()->cachedIcon( delete_conflict_xpm ); }
108 QPixmap YQIconPool::tabooPkgConflict() { return iconPool()->cachedIcon( normal_conflict_xpm ); }
109 QPixmap YQIconPool::selectPkgConflict() { return iconPool()->cachedIcon( select_conflict_xpm ); }
111 QPixmap YQIconPool::treePlus() { return iconPool()->cachedIcon( tree_plus_xpm ); }
112 QPixmap YQIconPool::treeMinus() { return iconPool()->cachedIcon( tree_minus_xpm ); }
114 QPixmap YQIconPool::warningSign() { return iconPool()->cachedIcon( warning_sign_xpm ); }
115 QPixmap YQIconPool::pkgSatisfied() { return iconPool()->cachedIcon( satisfied_xpm ); }
117 QPixmap YQIconPool::stepCurrent() { return iconPool()->cachedIcon( step_current_xpm ); }
118 QPixmap YQIconPool::stepToDo() { return iconPool()->cachedIcon( step_todo_xpm ); }
119 QPixmap YQIconPool::stepDone() { return iconPool()->cachedIcon( step_done_xpm ); }
122 YQIconPool * YQIconPool::iconPool()
125 _iconPool = new YQIconPool();
131 YQIconPool::YQIconPool()
133 _iconCache.setAutoDelete( true );
137 YQIconPool::~YQIconPool()
145 YQIconPool::cachedIcon( const char ** xpm_data )
147 QPixmap * iconPtr = _iconCache[ xpm_data ];
151 iconPtr = new QPixmap( xpm_data );
152 _iconCache.insert( xpm_data, iconPtr );