/*************************************************************************** * Copyright (C) 2005 by Tavarez Arnaud Bakoula * * tbakoula@yahoo.fr * * * * 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, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "utilities.h" QPixmap colorToPixmap( int color ) { return theIconLoader->loadIcon( colorToString( (Color)color), KIcon::Toolbar, icon_res, KIcon::DefaultState, 0, TRUE ); } QPixmap stateToPixmap( int state ) { return theIconLoader->loadIcon( stateToString( (State)state), KIcon::Toolbar, icon_res, KIcon::DefaultState, 0, TRUE ); } QString colorToString( Color c ) { switch ( c ) { case Red: return "red"; case Green: return "green"; case Blue: return "blue"; case Black: return "black"; case Grey: return "grey"; case Yellow: return "yellow"; case Violet: return "violet"; case Orange: return "orange"; case Pink: return "pink"; case Shade: return "shadow"; default: return ""; } } QString stateToString( State s ) { switch ( s ) { case ABSENT: return "absent"; case PLACED: return "placed"; case MISPLACED: return "misplaced"; default: return ""; } } QString levelToString( Level l ) { switch ( l ) { case NOVICE: return "novice"; case MEDIUM: return "medium"; case EXPERT: return "expert"; default: return ""; } }