diff -ru kmms-0.8beta1.orig/kmms/kmmsdock.cpp kmms-0.8beta1/kmms/kmmsdock.cpp --- kmms/kmmsdock.cpp 2002-08-19 10:54:37.000000000 +0930 +++ kmms/kmmsdock.cpp 2002-11-04 16:32:24.000000000 +1030 @@ -188,62 +188,58 @@ { //load and paint Skin QPixmap mainPixmap; -// QPixmap cbuttonsPixmap; - bool skinloadfailed = FALSE; + + // first check if the user has a skin in their ~/.kmms/Skin directory + // to keep compatibility with official KMMS + bool userskinloadfailed = FALSE; // main.bmp if ( !mainPixmap.load( homeDir + "/.kmms/Skin/main.bmp") ) - skinloadfailed = TRUE; + userskinloadfailed = TRUE; // cbuttons.bmp if ( !cbuttonsPixmap.load( homeDir + "/.kmms/Skin/cbuttons.bmp") ) - skinloadfailed = TRUE; - // failed? - if(skinloadfailed) - { - // draw error message to skin buffer - pskin->drawText( 2, 12, "SKIN LOAD ERROR!" ); - pskin->drawText( 8, 28, "( ~/.kmms/Skin )" ); - pskin->drawText( 8, 40, "view README file" ); - } - // success? - else - { - // draw skin to buffer - /* //old version - pskin->drawPixmap( -135, 0, mainPixmap ); - pskin->drawPixmap( 0, 36, cbuttonsPixmap ); - */ - // new version - - // Top: - pskin->drawPixmap( 0, 0, mainPixmap, 120, 15, KMMSDOCK_WIDTH, 5 ); - pskin->drawPixmap( 0, 5, mainPixmap, 120, 15, KMMSDOCK_WIDTH, 8 ); - - // Top of Text field - pskin->drawPixmap( 0, 13, mainPixmap, 120, 23, KMMSDOCK_WIDTH, 6 ); - - // Text field extension - pskin->drawPixmap( 0, 19, mainPixmap, 120, 29, KMMSDOCK_WIDTH, 1 ); - pskin->drawPixmap( 0, 20, mainPixmap, 120, 29, KMMSDOCK_WIDTH, 1 ); - pskin->drawPixmap( 0, 21, mainPixmap, 120, 29, KMMSDOCK_WIDTH, 1 ); - pskin->drawPixmap( 0, 22, mainPixmap, 120, 29, KMMSDOCK_WIDTH, 1 ); - - pskin->drawPixmap( 0, 23, mainPixmap, 120, 30, KMMSDOCK_WIDTH, 1 ); - //pskin->drawPixmap( 0, 23, mainPixmap, 120, 30, KMMSDOCK_WIDTH, 1 ); - pskin->drawPixmap( 0, 24, mainPixmap, 120, 30, KMMSDOCK_WIDTH, 1 ); - pskin->drawPixmap( 0, 25, mainPixmap, 120, 30, KMMSDOCK_WIDTH, 1 ); - pskin->drawPixmap( 0, 26, mainPixmap, 120, 30, KMMSDOCK_WIDTH, 1 ); - - pskin->drawPixmap( 0, 27, mainPixmap, 120, 31, KMMSDOCK_WIDTH, 1 ); - pskin->drawPixmap( 0, 28, mainPixmap, 120, 31, KMMSDOCK_WIDTH, 1 ); - pskin->drawPixmap( 0, 29, mainPixmap, 120, 31, KMMSDOCK_WIDTH, 1 ); - pskin->drawPixmap( 0, 30, mainPixmap, 120, 31, KMMSDOCK_WIDTH, 1 ); + userskinloadfailed = TRUE; + + if(userskinloadfailed){ + // no user defined skin in ~/.kmms/Skin, use default + // define a kmms_skin resource which can be in a KDE-relative directory + KGlobal::dirs()->addResourceType("kmms_skin", "share/apps/kmms/Skin"); + + // main.bmp + mainPixmap.load(KGlobal::dirs()->findResource("kmms_skin", "main.bmp")); + + // cbuttons.bmp + cbuttonsPixmap.load(KGlobal::dirs()->findResource("kmms_skin", "cbuttons.bmp")); + } + + // draw skin to buffer + // Top: + pskin->drawPixmap( 0, 0, mainPixmap, 120, 15, KMMSDOCK_WIDTH, 5 ); + pskin->drawPixmap( 0, 5, mainPixmap, 120, 15, KMMSDOCK_WIDTH, 8 ); + + // Top of Text field + pskin->drawPixmap( 0, 13, mainPixmap, 120, 23, KMMSDOCK_WIDTH, 6 ); + + // Text field extension + pskin->drawPixmap( 0, 19, mainPixmap, 120, 29, KMMSDOCK_WIDTH, 1 ); + pskin->drawPixmap( 0, 20, mainPixmap, 120, 29, KMMSDOCK_WIDTH, 1 ); + pskin->drawPixmap( 0, 21, mainPixmap, 120, 29, KMMSDOCK_WIDTH, 1 ); + pskin->drawPixmap( 0, 22, mainPixmap, 120, 29, KMMSDOCK_WIDTH, 1 ); + + pskin->drawPixmap( 0, 23, mainPixmap, 120, 30, KMMSDOCK_WIDTH, 1 ); + pskin->drawPixmap( 0, 24, mainPixmap, 120, 30, KMMSDOCK_WIDTH, 1 ); + pskin->drawPixmap( 0, 25, mainPixmap, 120, 30, KMMSDOCK_WIDTH, 1 ); + pskin->drawPixmap( 0, 26, mainPixmap, 120, 30, KMMSDOCK_WIDTH, 1 ); + + pskin->drawPixmap( 0, 27, mainPixmap, 120, 31, KMMSDOCK_WIDTH, 1 ); + pskin->drawPixmap( 0, 28, mainPixmap, 120, 31, KMMSDOCK_WIDTH, 1 ); + pskin->drawPixmap( 0, 29, mainPixmap, 120, 31, KMMSDOCK_WIDTH, 1 ); + pskin->drawPixmap( 0, 30, mainPixmap, 120, 31, KMMSDOCK_WIDTH, 1 ); - // Bottom of Text field - pskin->drawPixmap( 0, 31, mainPixmap, 120, 32 ); + // Bottom of Text field + pskin->drawPixmap( 0, 31, mainPixmap, 120, 32 ); - // Control Buttons - pskin->drawPixmap( 0, 36, cbuttonsPixmap, 0, 0, 114, 18); //painting just the top part of the c buttons - } + // Control Buttons + pskin->drawPixmap( 0, 36, cbuttonsPixmap, 0, 0, 114, 18); //painting just the top part of the c buttons } void kmmsdock::scroll() diff -ru kmms-0.8beta1.orig/kmms/kmmsdock.h kmms-0.8beta1/kmms/kmmsdock.h --- kmms/kmmsdock.h 2002-08-19 10:54:37.000000000 +0930 +++ kmms/kmmsdock.h 2002-10-23 20:26:34.000000000 +0930 @@ -20,7 +20,8 @@ #include "kmmsprefsImpl.h" - +#include +#include #include #include #include