@ -18,28 +18,28 @@
* 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA . *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
# include < qdesktopwidget.h>
# include < qlayout.h>
# include < qpushbutton.h>
# include < qcombobox.h>
# include < qcheckbox.h>
# include < qdir.h>
# include < qfile.h>
# include < qfileinfo.h>
# include < qgroupbox.h>
# include < t qdesktopwidget.h>
# include < t qlayout.h>
# include < t qpushbutton.h>
# include < t qcombobox.h>
# include < t qcheckbox.h>
# include < t qdir.h>
# include < t qfile.h>
# include < t qfileinfo.h>
# include < t qgroupbox.h>
# include <kfiledialog.h>
# include < qpainter.h>
//#include < qpalette.h>
// #include < qsettings.h>
# include < qslider.h>
# include < qspinbox.h>
# include < qstringlist.h>
# include < qlabel.h>
# include < qlineedit.h>
# include < qpixmap.h>
# include < t qpainter.h>
//#include < t qpalette.h>
// #include < t qsettings.h>
# include < t qslider.h>
# include < t qspinbox.h>
# include < t qstringlist.h>
# include < t qlabel.h>
# include < t qlineedit.h>
# include < t qpixmap.h>
# include <klistview.h>
# include < qtabwidget.h>
# include < qtimer.h>
# include < t qtabwidget.h>
# include < t qtimer.h>
# include <dcopclient.h>
# include <kapplication.h>
# include <kcolorbutton.h>
@ -69,8 +69,8 @@
# ifndef KDE_VERSION_STRING
# define KDE_VERSION_STRING "error"
# endif
# ifndef QT_BUILD_KEY
# define QT_BUILD_KEY "error error error error"
# ifndef T QT_BUILD_KEY
# define T QT_BUILD_KEY "error error error error"
# endif
# define CLAMP(x,l,u) x < l ? l :\
@ -103,14 +103,14 @@
void kstyle_baghira_config : : openHtml1 ( )
{
QStringList args ;
T QStringList args ;
args < < " exec " < < " http://baghira.sf.net/ " ;
kapp - > kdeinitExec ( " kfmclient " , args ) ;
}
void kstyle_baghira_config : : openHtml2 ( )
{
QStringList args ;
T QStringList args ;
args < < " exec " < < " http://www.sf.net/projects/baghira/files/ " ;
kapp - > kdeinitExec ( " kfmclient " , args ) ;
}
@ -125,9 +125,9 @@ void kstyle_baghira_config::startKRuler()
kapp - > kdeinitExec ( " kruler " ) ;
}
QImage* kstyle_baghira_config : : tintButton ( QImage & src , QColor c )
T QImage* kstyle_baghira_config : : tintButton ( T QImage & src , T QColor c )
{
QImage * dest = new QImage( src . width ( ) , src . height ( ) , 32 , 0 ) ;
T QImage * dest = new T QImage( src . width ( ) , src . height ( ) , 32 , 0 ) ;
dest - > setAlphaBuffer ( true ) ;
unsigned int * data = ( unsigned int * ) src . bits ( ) ;
unsigned int * destData = ( unsigned int * ) dest - > bits ( ) ;
@ -142,21 +142,21 @@ QImage* kstyle_baghira_config::tintButton(QImage &src, QColor c)
int sq = CLAMP ( ( int ) ( ( 45.0 / 128.0 ) * s + 55 ) , 0 , 100 ) ;
// float srcPercent, destPercent;
for ( int current = 0 ; current < total ; + + current ) {
alpha = qAlpha( data [ current ] ) ;
blue = qBlue( data [ current ] ) ;
red = qRed( data [ current ] ) ;
green = qGreen( data [ current ] ) ;
alpha = t qAlpha( data [ current ] ) ;
blue = t qBlue( data [ current ] ) ;
red = t qRed( data [ current ] ) ;
green = t qGreen( data [ current ] ) ;
SATURATION_COLOR2 ( sq , red , green , blue ) ;
// force back to valid colorspace !
COLOR_SPACE ( destR , destG , destB ) ;
destData [ current ] = qRgba( destR , destG , destB , alpha ) ;
destData [ current ] = t qRgba( destR , destG , destB , alpha ) ;
}
return ( dest ) ;
}
QImage* kstyle_baghira_config : : tintBrush ( QImage & img , QColor c )
T QImage* kstyle_baghira_config : : tintBrush ( T QImage & img , T QColor c )
{
QImage * dest = new QImage( img . width ( ) , img . height ( ) , 32 , 0 ) ;
T QImage * dest = new T QImage( img . width ( ) , img . height ( ) , 32 , 0 ) ;
unsigned int * data = ( unsigned int * ) img . bits ( ) ;
unsigned int * destData = ( unsigned int * ) dest - > bits ( ) ;
int total = img . width ( ) * img . height ( ) ;
@ -172,14 +172,14 @@ QImage* kstyle_baghira_config::tintBrush( QImage &img, QColor c)
// float srcPercent, destPercent;
for ( current = 0 ; current < total ; + + current ) {
alpha = qAlpha( data [ current ] ) ;
blue = qBlue( data [ current ] ) ;
red = qRed( data [ current ] ) ;
green = qGreen( data [ current ] ) ;
alpha = t qAlpha( data [ current ] ) ;
blue = t qBlue( data [ current ] ) ;
red = t qRed( data [ current ] ) ;
green = t qGreen( data [ current ] ) ;
SATURATION_COLOR ( red , green , blue ) ;
// force back to valid colorspace !
COLOR_SPACE ( destR , destG , destB ) ;
destData [ current ] = qRgba( destR , destG , destB , alpha ) ;
destData [ current ] = t qRgba( destR , destG , destB , alpha ) ;
}
return ( dest ) ;
}
@ -188,7 +188,7 @@ void kstyle_baghira_config::sliderButtonRedChanged(int value)
{
sliderButtonRedValue = value ;
dialog_ - > valueButtonRed - > setNum ( value ) ;
dialog_ - > pixmapButtonPreview - > setPixmap ( * tintButton ( baseImage , QColor( sliderButtonRedValue , sliderButtonGreenValue , sliderButtonBlueValue ) ) ) ;
dialog_ - > pixmapButtonPreview - > setPixmap ( * tintButton ( baseImage , T QColor( sliderButtonRedValue , sliderButtonGreenValue , sliderButtonBlueValue ) ) ) ;
dialog_ - > pixmapButtonPreview - > repaint ( false ) ;
configChanged ( ) ;
}
@ -197,7 +197,7 @@ void kstyle_baghira_config::sliderButtonGreenChanged(int value)
{
sliderButtonGreenValue = value ;
dialog_ - > valueButtonGreen - > setNum ( value ) ;
dialog_ - > pixmapButtonPreview - > setPixmap ( * tintButton ( baseImage , QColor( sliderButtonRedValue , sliderButtonGreenValue , sliderButtonBlueValue ) ) ) ;
dialog_ - > pixmapButtonPreview - > setPixmap ( * tintButton ( baseImage , T QColor( sliderButtonRedValue , sliderButtonGreenValue , sliderButtonBlueValue ) ) ) ;
dialog_ - > pixmapButtonPreview - > repaint ( false ) ;
configChanged ( ) ;
}
@ -206,7 +206,7 @@ void kstyle_baghira_config::sliderButtonBlueChanged(int value)
{
sliderButtonBlueValue = value ;
dialog_ - > valueButtonBlue - > setNum ( value ) ;
dialog_ - > pixmapButtonPreview - > setPixmap ( * tintButton ( baseImage , QColor( sliderButtonRedValue , sliderButtonGreenValue , sliderButtonBlueValue ) ) ) ;
dialog_ - > pixmapButtonPreview - > setPixmap ( * tintButton ( baseImage , T QColor( sliderButtonRedValue , sliderButtonGreenValue , sliderButtonBlueValue ) ) ) ;
dialog_ - > pixmapButtonPreview - > repaint ( false ) ;
configChanged ( ) ;
}
@ -214,7 +214,7 @@ void kstyle_baghira_config::sliderButtonBlueChanged(int value)
void kstyle_baghira_config : : sliderBrushRedChanged ( int value )
{
sliderBrushRedValue = value ;
dialog_ - > pixmapBrushPreview - > setPixmap ( * tintBrush ( baseImage2 , QColor( sliderBrushRedValue , sliderBrushGreenValue , sliderBrushBlueValue ) ) ) ;
dialog_ - > pixmapBrushPreview - > setPixmap ( * tintBrush ( baseImage2 , T QColor( sliderBrushRedValue , sliderBrushGreenValue , sliderBrushBlueValue ) ) ) ;
dialog_ - > pixmapBrushPreview - > repaint ( false ) ;
configChanged ( ) ;
}
@ -222,7 +222,7 @@ void kstyle_baghira_config::sliderBrushRedChanged(int value)
void kstyle_baghira_config : : sliderBrushGreenChanged ( int value )
{
sliderBrushGreenValue = value ;
dialog_ - > pixmapBrushPreview - > setPixmap ( * tintBrush ( baseImage2 , QColor( sliderBrushRedValue , sliderBrushGreenValue , sliderBrushBlueValue ) ) ) ;
dialog_ - > pixmapBrushPreview - > setPixmap ( * tintBrush ( baseImage2 , T QColor( sliderBrushRedValue , sliderBrushGreenValue , sliderBrushBlueValue ) ) ) ;
dialog_ - > pixmapBrushPreview - > repaint ( false ) ;
configChanged ( ) ;
}
@ -230,7 +230,7 @@ void kstyle_baghira_config::sliderBrushGreenChanged(int value)
void kstyle_baghira_config : : sliderBrushBlueChanged ( int value )
{
sliderBrushBlueValue = value ;
dialog_ - > pixmapBrushPreview - > setPixmap ( * tintBrush ( baseImage2 , QColor( sliderBrushRedValue , sliderBrushGreenValue , sliderBrushBlueValue ) ) ) ;
dialog_ - > pixmapBrushPreview - > setPixmap ( * tintBrush ( baseImage2 , T QColor( sliderBrushRedValue , sliderBrushGreenValue , sliderBrushBlueValue ) ) ) ;
dialog_ - > pixmapBrushPreview - > repaint ( false ) ;
configChanged ( ) ;
}
@ -238,7 +238,7 @@ void kstyle_baghira_config::sliderBrushBlueChanged(int value)
// void kstyle_baghira_config::sliderBrushSaturationChanged(int value)
// {
// sliderBrushSaturationValue = value;
// dialog_->pixmapBrushPreview->setPixmap(*tintBrush(baseImage2, QColor(sliderBrushRedValue, sliderBrushGreenValue, sliderBrushBlueValue), sliderBrushSaturationValue));
// dialog_->pixmapBrushPreview->setPixmap(*tintBrush(baseImage2, T QColor(sliderBrushRedValue, sliderBrushGreenValue, sliderBrushBlueValue), sliderBrushSaturationValue));
// dialog_->pixmapBrushPreview->repaint(false);
// emit changed(true);
// }
@ -255,10 +255,10 @@ int presetColor[NUMBEROFCOLORS][3] = {{84,144,218},{130,170,190},{103,118,134},{
// --------------------------------
typedef KGenericFactory < kstyle_baghira_config , QWidget> kstyle_baghira_configFactory ;
typedef KGenericFactory < kstyle_baghira_config , T QWidget> kstyle_baghira_configFactory ;
K_EXPORT_COMPONENT_FACTORY ( kcm_kstyle_baghira_config , kstyle_baghira_configFactory ( " kcmkstyle_baghira_config " ) )
//extern QImage uic_findImage(const QString& name);
//extern T QImage uic_findImage(const T QString& name);
//extern void qInitImages_baghira();
//extern void qCleanupImages_baghira();
@ -284,35 +284,35 @@ void kstyle_baghira_config::showAbout()
about_ - > exec ( ) ;
}
kstyle_baghira_config : : kstyle_baghira_config ( QWidget * parent , const char * name , const QStringList& ) : QWidget( parent , name ) //, myAboutData(0)
kstyle_baghira_config : : kstyle_baghira_config ( T QWidget * parent , const char * name , const T QStringList& ) : T QWidget( parent , name ) //, myAboutData(0)
{
loadDone = false ;
if ( parent ) parent - > setCaption ( " Configure Your Cat " ) ;
QVBoxLayout * layout = new QVBoxLayout( this ) ;
T QVBoxLayout * layout = new T QVBoxLayout( this ) ;
dialog_ = new Config ( this ) ;
for ( int i = 0 ; i < NUMBEROFCOLORS ; i + + )
dialog_ - > colorPresets - > insertItem ( presetColorName [ i ] , i ) ;
QWidget * rulesWidget = new QWidget( dialog_ - > tabWidget ) ;
QHBoxLayout * rwlh = new QHBoxLayout( rulesWidget ) ;
T QWidget * rulesWidget = new T QWidget( dialog_ - > tabWidget ) ;
T QHBoxLayout * rwlh = new T QHBoxLayout( rulesWidget ) ;
applist = new KListView ( rulesWidget ) ;
applist - > setFullWidth ( true ) ;
# if KDE_IS_VERSION(3,3,91)
applist - > setShadeSortColumn ( false ) ;
# endif
applist - > setAllColumnsShowFocus ( true ) ;
applist - > setSelectionMode ( QListView: : Single ) ;
applist - > setSelectionMode ( T QListView: : Single ) ;
applist - > addColumn ( i18n ( " Name " ) ) ;
applist - > addColumn ( i18n ( " Links to " ) ) ;
QDir d ( QDir: : homeDirPath ( ) + " /.baghira " , 0L , QDir: : Name | QDir: : IgnoreCase , QDir: : Files | QDir: : Readable | QDir: : Writable ) ;
T QDir d ( T QDir: : homeDirPath ( ) + " /.baghira " , 0L , T QDir: : Name | T QDir: : IgnoreCase , T QDir: : Files | T QDir: : Readable | T QDir: : Writable ) ;
if ( ! d . exists ( ) )
d . mkdir ( QDir: : homeDirPath ( ) + " /.baghira " ) ;
d . mkdir ( T QDir: : homeDirPath ( ) + " /.baghira " ) ;
else
{
for ( uint i = 0 ; i < d . count ( ) ; i + + )
{
QFileInfo FI = QFileInfo( d , d [ i ] ) ;
T QFileInfo FI = T QFileInfo( d , d [ i ] ) ;
if ( FI . isSymLink ( ) )
applist - > insertItem ( new KListViewItem ( applist , d [ i ] , FI . readLink ( ) . section ( ' / ' , - 1 , - 1 ) ) ) ;
else
@ -321,27 +321,27 @@ kstyle_baghira_config::kstyle_baghira_config(QWidget *parent, const char *name,
}
rwlh - > addWidget ( applist ) ;
// rwlh->addLayout(rwlv);
QVBoxLayout * rwlv = new QVBoxLayout( rwlh ) ;
T QVBoxLayout * rwlv = new T QVBoxLayout( rwlh ) ;
rwlv - > addStretch ( ) ;
QPushButton * btnNew = new QPushButton( " New... " , rulesWidget ) ;
QPushButton * btnEdit = new QPushButton( " Edit... " , rulesWidget ) ;
QPushButton * btnDel = new QPushButton( " Remove " , rulesWidget ) ;
QPushButton * btnDet = new QPushButton( " Detect " , rulesWidget ) ;
T QPushButton * btnNew = new T QPushButton( " New... " , rulesWidget ) ;
T QPushButton * btnEdit = new T QPushButton( " Edit... " , rulesWidget ) ;
T QPushButton * btnDel = new T QPushButton( " Remove " , rulesWidget ) ;
T QPushButton * btnDet = new T QPushButton( " Detect " , rulesWidget ) ;
rwlv - > addWidget ( btnNew ) ;
rwlv - > addWidget ( btnEdit ) ;
rwlv - > addWidget ( btnDel ) ;
rwlv - > addSpacing ( 5 ) ;
rwlv - > addWidget ( btnDet ) ;
rwlv - > addStretch ( ) ;
dialog_ - > tabWidget - > addTab ( rulesWidget , QString( " Rules " ) ) ;
dialog_ - > tabWidget - > addTab ( rulesWidget , T QString( " Rules " ) ) ;
appsetter = new AppSetter ( this ) ;
connect ( btnNew , SIGNAL ( clicked ( ) ) , appsetter , SLOT ( show ( ) ) ) ;
connect ( btnEdit , SIGNAL ( clicked ( ) ) , this , SLOT ( editApp ( ) ) ) ;
connect ( this , SIGNAL ( editApp ( QString, QString) ) , appsetter , SLOT ( show ( QString, QString) ) ) ;
connect ( this , SIGNAL ( editApp ( T QString, T QString) ) , appsetter , SLOT ( show ( T QString, T QString) ) ) ;
connect ( btnDel , SIGNAL ( clicked ( ) ) , this , SLOT ( removeApp ( ) ) ) ;
connect ( btnDet , SIGNAL ( clicked ( ) ) , this , SLOT ( selectWindow ( ) ) ) ;
connect ( appsetter , SIGNAL ( addApp ( QString, QString) ) , this , SLOT ( addApp ( QString, QString) ) ) ;
connect ( appsetter , SIGNAL ( removeApp ( QString) ) , this , SLOT ( removeApp ( QString) ) ) ;
connect ( appsetter , SIGNAL ( addApp ( T QString, T QString) ) , this , SLOT ( addApp ( T QString, T QString) ) ) ;
connect ( appsetter , SIGNAL ( removeApp ( T QString) ) , this , SLOT ( removeApp ( T QString) ) ) ;
// preview stuff
baseImage = uic_findImage ( " button-base " ) ;
@ -356,9 +356,9 @@ kstyle_baghira_config::kstyle_baghira_config(QWidget *parent, const char *name,
crNotes [ 0 ] = " <qt>© 2003-2005 by Thomas Lübking<br>http://baghira.SourceForge.net</qt> " ;
crNotes [ 1 ] = " <qt>© \" Design \" 2001-2005 by Apple inc.<br>http://www.apple.com " ;
crNotes [ 2 ] = " <qt>© \" Milk \" 2002-2005 by Max Rudberg<br>http://www.maxthemes.com</qt> " ;
timer = new QTimer( ) ;
timer = new T QTimer( ) ;
connect ( timer , SIGNAL ( timeout ( ) ) , this , SLOT ( updateCR ( ) ) ) ;
QString tmpString ( QT_BUILD_KEY) ;
T QString tmpString ( T QT_BUILD_KEY) ;
about_ - > systemLabel - > setText ( tmpString . section ( ' ' , 1 , 1 ) ) ;
about_ - > cpuLabel - > setText ( tmpString . section ( ' ' , 0 , 0 ) ) ;
about_ - > setFixedSize ( 380 , 430 ) ;
@ -413,25 +413,25 @@ kstyle_baghira_config::kstyle_baghira_config(QWidget *parent, const char *name,
connect ( dialog_ - > drawMenuStripe , SIGNAL ( stateChanged ( int ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > glossyMenus , SIGNAL ( stateChanged ( int ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > customInactiveColor , SIGNAL ( changed ( const QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > toolbuttonHighColor , SIGNAL ( changed ( const QColor & ) ) , this , SLOT ( changeTooluttonHighlightColor ( const QColor & ) ) ) ;
connect ( dialog_ - > treeLineColor , SIGNAL ( changed ( const QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > customExpanderColor , SIGNAL ( changed ( const QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > menuTextColor , SIGNAL ( changed ( const QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > menuTextColorHigh , SIGNAL ( changed ( const QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > menuColor , SIGNAL ( changed ( const QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > menuColorHigh , SIGNAL ( changed ( const QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > menuColor2 , SIGNAL ( changed ( const QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > radioOffColor , SIGNAL ( changed ( const QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > radioOnColor , SIGNAL ( changed ( const QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > checkOffColor , SIGNAL ( changed ( const QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > checkOnColor , SIGNAL ( changed ( const QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > sliderColor , SIGNAL ( changed ( const QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > hoverSliderColorColor , SIGNAL ( changed ( const QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > pressedSliderColor , SIGNAL ( changed ( const QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > inactiveTabColor , SIGNAL ( changed ( const QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > activeTabColor , SIGNAL ( changed ( const QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > menuStripeColor , SIGNAL ( changed ( const QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > customInactiveColor , SIGNAL ( changed ( const T QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > toolbuttonHighColor , SIGNAL ( changed ( const T QColor & ) ) , this , SLOT ( changeTooluttonHighlightColor ( const T QColor & ) ) ) ;
connect ( dialog_ - > treeLineColor , SIGNAL ( changed ( const T QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > customExpanderColor , SIGNAL ( changed ( const T QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > menuTextColor , SIGNAL ( changed ( const T QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > menuTextColorHigh , SIGNAL ( changed ( const T QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > menuColor , SIGNAL ( changed ( const T QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > menuColorHigh , SIGNAL ( changed ( const T QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > menuColor2 , SIGNAL ( changed ( const T QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > radioOffColor , SIGNAL ( changed ( const T QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > radioOnColor , SIGNAL ( changed ( const T QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > checkOffColor , SIGNAL ( changed ( const T QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > checkOnColor , SIGNAL ( changed ( const T QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > sliderColor , SIGNAL ( changed ( const T QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > hoverSliderColorColor , SIGNAL ( changed ( const T QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > pressedSliderColor , SIGNAL ( changed ( const T QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > inactiveTabColor , SIGNAL ( changed ( const T QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > activeTabColor , SIGNAL ( changed ( const T QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > menuStripeColor , SIGNAL ( changed ( const T QColor & ) ) , this , SLOT ( configChanged ( ) ) ) ;
connect ( dialog_ - > sliderButtonRed , SIGNAL ( valueChanged ( int ) ) , this , SLOT ( sliderButtonRedChanged ( int ) ) ) ;
connect ( dialog_ - > sliderButtonGreen , SIGNAL ( valueChanged ( int ) ) , this , SLOT ( sliderButtonGreenChanged ( int ) ) ) ;
@ -457,7 +457,7 @@ connect(dialog_->toolbuttonHighColor, SIGNAL(changed(const QColor &)), this, SLO
load ( ) ;
loadDone = true ;
dialog_ - > pixmapButtonPreview - > setPixmap ( * tintButton ( baseImage , QColor( sliderButtonRedValue , sliderButtonGreenValue , sliderButtonBlueValue ) ) ) ;
dialog_ - > pixmapButtonPreview - > setPixmap ( * tintButton ( baseImage , T QColor( sliderButtonRedValue , sliderButtonGreenValue , sliderButtonBlueValue ) ) ) ;
} ;
@ -475,14 +475,14 @@ void kstyle_baghira_config::setPresetColor(int i)
void kstyle_baghira_config : : load ( )
{
QString tmpString = QDir: : homeDirPath ( ) + " /.qt/baghirarc " ;
T QString tmpString = T QDir: : homeDirPath ( ) + " /.qt/baghirarc " ;
load ( tmpString ) ;
}
void kstyle_baghira_config : : load ( QString & fileName )
void kstyle_baghira_config : : load ( T QString & fileName )
{
KConfig * config = new KConfig ( fileName ) ;
// QSettings config;
// T QSettings config;
config - > setGroup ( " BAB " ) ;
// general Design
dialog_ - > defaultStyle - > setCurrentItem ( config - > readNumEntry ( " defaultState " , 0 ) ) ;
@ -498,10 +498,10 @@ void kstyle_baghira_config::load(QString &fileName)
dialog_ - > bevelHighlights - > setChecked ( config - > readBoolEntry ( " Design_BevelAsHighlight " , true ) ) ;
dialog_ - > colorMode - > setCurrentItem ( config - > readNumEntry ( " Design_ButtonStyle " , 0 ) ) ;
dialog_ - > inactiveColorType - > setCurrentItem ( config - > readNumEntry ( " Design_InactiveButtonStyle " , 1 ) ) ;
dialog_ - > customInactiveColor - > setColor ( QColor( config - > readNumEntry ( " Design_InactiveButtonColor " , ( int ) colorGroup ( ) . background ( ) . rgb ( ) ) ) ) ;
dialog_ - > customInactiveColor - > setColor ( T QColor( config - > readNumEntry ( " Design_InactiveButtonColor " , ( int ) colorGroup ( ) . background ( ) . rgb ( ) ) ) ) ;
dialog_ - > centerTabs - > setChecked ( config - > readBoolEntry ( " Design_CenterTabs " , true ) ) ;
// button color stuff
QColor tmpColor = QColor( config - > readNumEntry ( " Design_ButtonColor " , ( int ) colorGroup ( ) . button ( ) . rgb ( ) ) ) ;
T QColor tmpColor = T QColor( config - > readNumEntry ( " Design_ButtonColor " , ( int ) colorGroup ( ) . button ( ) . rgb ( ) ) ) ;
dialog_ - > sliderButtonRed - > setValue ( sliderButtonRedValue = tmpColor . red ( ) ) ;
dialog_ - > sliderButtonGreen - > setValue ( sliderButtonGreenValue = tmpColor . green ( ) ) ;
dialog_ - > sliderButtonBlue - > setValue ( sliderButtonBlueValue = tmpColor . blue ( ) ) ;
@ -514,14 +514,14 @@ void kstyle_baghira_config::load(QString &fileName)
dialog_ - > useRectLVH - > setChecked ( config - > readBoolEntry ( " Special_UseFlatLVH " , false ) ) ;
dialog_ - > drawTreeLines - > setChecked ( config - > readBoolEntry ( " Special_DrawTreeLines " , false ) ) ;
dialog_ - > treeLineMode - > setCurrentItem ( config - > readNumEntry ( " Special_TreelineStyle " , 0 ) ) ;
dialog_ - > treeLineColor - > setColor ( QColor( config - > readNumEntry ( " Special_TreelineColor " , ( int ) colorGroup ( ) . mid ( ) . rgb ( ) ) ) ) ;
dialog_ - > treeLineColor - > setColor ( T QColor( config - > readNumEntry ( " Special_TreelineColor " , ( int ) colorGroup ( ) . mid ( ) . rgb ( ) ) ) ) ;
dialog_ - > expanderMode - > setCurrentItem ( config - > readNumEntry ( " Special_ExpanderStyle " , 0 ) ) ;
dialog_ - > useCustomExpanderColor - > setChecked ( config - > readBoolEntry ( " Special_CustomExpanderColor " , false ) ) ;
dialog_ - > customExpanderColor - > setColor ( QColor( config - > readNumEntry ( " Special_ExpanderColor " , ( int ) colorGroup ( ) . text ( ) . rgb ( ) ) ) ) ;
dialog_ - > customExpanderColor - > setColor ( T QColor( config - > readNumEntry ( " Special_ExpanderColor " , ( int ) colorGroup ( ) . text ( ) . rgb ( ) ) ) ) ;
//Kicker
dialog_ - > removeKickerBevel - > setChecked ( config - > readBoolEntry ( " Special_RemoveKickerBevel " , true ) ) ;
dialog_ - > roundTasks - > setChecked ( config - > readBoolEntry ( " Special_RoundTaskbuttons " , false ) ) ;
QFile file ( QDir: : homeDirPath ( ) + " /.kde/share/apps/kicker/applets/menuapplet.desktop " ) ;
T QFile file ( T QDir: : homeDirPath ( ) + " /.kde/share/apps/kicker/applets/menuapplet.desktop " ) ;
dialog_ - > replaceMenubar - > setChecked ( menuReplaced = file . exists ( ) ) ;
//Scrollbars
dialog_ - > animateSlider - > setChecked ( config - > readBoolEntry ( " Special_AnimateSlider " , true ) ) ;
@ -542,29 +542,29 @@ void kstyle_baghira_config::load(QString &fileName)
//Look
dialog_ - > shadowMenuText - > setChecked ( config - > readBoolEntry ( " Menu_ShadowText " , true ) ) ;
dialog_ - > menuColorMode - > setCurrentItem ( config - > readNumEntry ( " Menu_ColorStyle " ) ) ;
dialog_ - > menuTextColor - > setColor ( QColor( config - > readNumEntry ( " Menu_TextColor " , ( int ) colorGroup ( ) . text ( ) . rgb ( ) ) ) ) ;
dialog_ - > menuTextColorHigh - > setColor ( QColor( config - > readNumEntry ( " Menu_TextColorHighlight " , ( int ) colorGroup ( ) . highlightedText ( ) . rgb ( ) ) ) ) ;
dialog_ - > menuColor - > setColor ( QColor( config - > readNumEntry ( " Menu_Color1 " , ( int ) colorGroup ( ) . background ( ) . rgb ( ) ) ) ) ;
dialog_ - > menuColor2 - > setColor ( QColor( config - > readNumEntry ( " Menu_Color2 " , ( int ) colorGroup ( ) . background ( ) . dark ( 130 ) . rgb ( ) ) ) ) ;
dialog_ - > menuColorHigh - > setColor ( QColor( config - > readNumEntry ( " Menu_ColorHighlight " , ( int ) colorGroup ( ) . highlight ( ) . rgb ( ) ) ) ) ;
dialog_ - > menuTextColor - > setColor ( T QColor( config - > readNumEntry ( " Menu_TextColor " , ( int ) colorGroup ( ) . text ( ) . rgb ( ) ) ) ) ;
dialog_ - > menuTextColorHigh - > setColor ( T QColor( config - > readNumEntry ( " Menu_TextColorHighlight " , ( int ) colorGroup ( ) . highlightedText ( ) . rgb ( ) ) ) ) ;
dialog_ - > menuColor - > setColor ( T QColor( config - > readNumEntry ( " Menu_Color1 " , ( int ) colorGroup ( ) . background ( ) . rgb ( ) ) ) ) ;
dialog_ - > menuColor2 - > setColor ( T QColor( config - > readNumEntry ( " Menu_Color2 " , ( int ) colorGroup ( ) . background ( ) . dark ( 130 ) . rgb ( ) ) ) ) ;
dialog_ - > menuColorHigh - > setColor ( T QColor( config - > readNumEntry ( " Menu_ColorHighlight " , ( int ) colorGroup ( ) . highlight ( ) . rgb ( ) ) ) ) ;
dialog_ - > drawMenuStripe - > setChecked ( config - > readBoolEntry ( " Menu_DrawMenuStripe " , false ) ) ;
dialog_ - > glossyMenus - > setChecked ( config - > readBoolEntry ( " Menu_Glossy " , true ) ) ;
dialog_ - > menuStripeColor - > setColor ( QColor( config - > readNumEntry ( " Menu_StripeColor " , ( int ) Qt: : white . rgb ( ) ) ) ) ;
dialog_ - > menuStripeColor - > setColor ( T QColor( config - > readNumEntry ( " Menu_StripeColor " , ( int ) T Qt: : white . rgb ( ) ) ) ) ;
// custom colors
dialog_ - > useCustomColors - > setChecked ( config - > readBoolEntry ( " Colors_UseCustomColors " , false ) ) ;
dialog_ - > radioOffColor - > setColor ( QColor( config - > readNumEntry ( " Colors_RadioOff " , ( int ) colorGroup ( ) . background ( ) . rgb ( ) ) ) ) ;
dialog_ - > radioOnColor - > setColor ( QColor( config - > readNumEntry ( " Colors_RadioOn " , ( int ) colorGroup ( ) . button ( ) . rgb ( ) ) ) ) ;
dialog_ - > checkOffColor - > setColor ( QColor( config - > readNumEntry ( " Colors_CheckOff " , ( int ) colorGroup ( ) . background ( ) . rgb ( ) ) ) ) ;
dialog_ - > checkOnColor - > setColor ( QColor( config - > readNumEntry ( " Colors_CheckOn " , ( int ) colorGroup ( ) . button ( ) . rgb ( ) ) ) ) ;
dialog_ - > sliderColor - > setColor ( QColor( config - > readNumEntry ( " Colors_Slider " , ( int ) colorGroup ( ) . button ( ) . rgb ( ) ) ) ) ;
dialog_ - > hoverSliderColorColor - > setColor ( QColor( config - > readNumEntry ( " Colors_SliderHovered " , ( int ) colorGroup ( ) . button ( ) . rgb ( ) ) ) ) ;
dialog_ - > pressedSliderColor - > setColor ( QColor( config - > readNumEntry ( " Colors_SliderPressed " , ( int ) colorGroup ( ) . button ( ) . dark ( 110 ) . rgb ( ) ) ) ) ;
dialog_ - > sliderGrooveColor - > setColor ( QColor( config - > readNumEntry ( " Colors_SliderGroove " , ( int ) colorGroup ( ) . background ( ) . rgb ( ) ) ) ) ;
dialog_ - > inactiveTabColor - > setColor ( QColor( config - > readNumEntry ( " Colors_TabInactive " , ( int ) colorGroup ( ) . background ( ) . rgb ( ) ) ) ) ;
dialog_ - > activeTabColor - > setColor ( QColor( config - > readNumEntry ( " Colors_TabActive " , ( int ) colorGroup ( ) . button ( ) . rgb ( ) ) ) ) ;
dialog_ - > radioOffColor - > setColor ( T QColor( config - > readNumEntry ( " Colors_RadioOff " , ( int ) colorGroup ( ) . background ( ) . rgb ( ) ) ) ) ;
dialog_ - > radioOnColor - > setColor ( T QColor( config - > readNumEntry ( " Colors_RadioOn " , ( int ) colorGroup ( ) . button ( ) . rgb ( ) ) ) ) ;
dialog_ - > checkOffColor - > setColor ( T QColor( config - > readNumEntry ( " Colors_CheckOff " , ( int ) colorGroup ( ) . background ( ) . rgb ( ) ) ) ) ;
dialog_ - > checkOnColor - > setColor ( T QColor( config - > readNumEntry ( " Colors_CheckOn " , ( int ) colorGroup ( ) . button ( ) . rgb ( ) ) ) ) ;
dialog_ - > sliderColor - > setColor ( T QColor( config - > readNumEntry ( " Colors_Slider " , ( int ) colorGroup ( ) . button ( ) . rgb ( ) ) ) ) ;
dialog_ - > hoverSliderColorColor - > setColor ( T QColor( config - > readNumEntry ( " Colors_SliderHovered " , ( int ) colorGroup ( ) . button ( ) . rgb ( ) ) ) ) ;
dialog_ - > pressedSliderColor - > setColor ( T QColor( config - > readNumEntry ( " Colors_SliderPressed " , ( int ) colorGroup ( ) . button ( ) . dark ( 110 ) . rgb ( ) ) ) ) ;
dialog_ - > sliderGrooveColor - > setColor ( T QColor( config - > readNumEntry ( " Colors_SliderGroove " , ( int ) colorGroup ( ) . background ( ) . rgb ( ) ) ) ) ;
dialog_ - > inactiveTabColor - > setColor ( T QColor( config - > readNumEntry ( " Colors_TabInactive " , ( int ) colorGroup ( ) . background ( ) . rgb ( ) ) ) ) ;
dialog_ - > activeTabColor - > setColor ( T QColor( config - > readNumEntry ( " Colors_TabActive " , ( int ) colorGroup ( ) . button ( ) . rgb ( ) ) ) ) ;
dialog_ - > tintBrush - > setChecked ( config - > readBoolEntry ( " Colors_TintBrushedMetal " , false ) ) ;
brushTint = QColor( config - > readNumEntry ( " Colors_BrushTint " , ( int ) colorGroup ( ) . background ( ) . rgb ( ) ) ) ;
brushTint = T QColor( config - > readNumEntry ( " Colors_BrushTint " , ( int ) colorGroup ( ) . background ( ) . rgb ( ) ) ) ;
// dialog_->brushTintSaturaion->setValue(settings.readNumEntry( "/qt/Baghira/brushTintSaturation", 3));
baseImage2 = uic_findImage ( " brush-me " ) ;
dialog_ - > pixmapBrushPreview - > setPixmap ( * tintBrush ( baseImage2 , brushTint ) ) ;
@ -572,13 +572,13 @@ void kstyle_baghira_config::load(QString &fileName)
dialog_ - > sliderBrushGreen - > setValue ( sliderBrushGreenValue = brushTint . green ( ) ) ;
dialog_ - > sliderBrushBlue - > setValue ( sliderBrushBlueValue = brushTint . blue ( ) ) ;
config - > setGroup ( " Menubar " ) ;
dialog_ - > menuMaxWidth - > setValue ( config - > readNumEntry ( " Width " , QDesktopWidget( ) . availableGeometry ( ) . width ( ) ) ) ;
dialog_ - > menuMaxWidth - > setValue ( config - > readNumEntry ( " Width " , T QDesktopWidget( ) . availableGeometry ( ) . width ( ) ) ) ;
config - > setGroup ( " Sidebar " ) ;
delete config ;
config = new KConfig ( " kdeglobals " ) ;
config - > setGroup ( " Toolbar style " ) ;
dialog_ - > toolbuttonHighColor - > setColor ( config - > readColorEntry ( " HighlightColor " , new QColor( 103 , 141 , 178 ) ) ) ;
dialog_ - > toolbuttonHighColor - > setColor ( config - > readColorEntry ( " HighlightColor " , new T QColor( 103 , 141 , 178 ) ) ) ;
delete config ;
}
@ -611,7 +611,7 @@ void kstyle_baghira_config::defaults()
dialog_ - > shadowSlider - > setChecked ( false ) ;
dialog_ - > squeezeSlider - > setChecked ( false ) ;
dialog_ - > unhoveredToolButtons - > setCurrentItem ( 2 ) ;
dialog_ - > toolbuttonHighColor - > setColor ( QColor( 103 , 141 , 178 ) ) ;
dialog_ - > toolbuttonHighColor - > setColor ( T QColor( 103 , 141 , 178 ) ) ;
dialog_ - > drawTreeLines - > setChecked ( false ) ;
dialog_ - > useCustomExpanderColor - > setChecked ( false ) ;
dialog_ - > treeLineMode - > setCurrentItem ( 0 ) ;
@ -639,7 +639,7 @@ void kstyle_baghira_config::defaults()
dialog_ - > menuColorHigh - > setColor ( colorGroup ( ) . highlight ( ) . rgb ( ) ) ;
dialog_ - > drawMenuStripe - > setChecked ( false ) ;
dialog_ - > glossyMenus - > setChecked ( true ) ;
dialog_ - > menuStripeColor - > setColor ( Qt: : white . rgb ( ) ) ;
dialog_ - > menuStripeColor - > setColor ( T Qt: : white . rgb ( ) ) ;
// custom colors
dialog_ - > useCustomColors - > setChecked ( false ) ;
@ -659,12 +659,12 @@ void kstyle_baghira_config::defaults()
void kstyle_baghira_config : : save ( )
{
QString tmpString = QDir: : homeDirPath ( ) + " /.qt/baghirarc " ;
T QString tmpString = T QDir: : homeDirPath ( ) + " /.qt/baghirarc " ;
save ( tmpString ) ;
// emit changed(true);
}
void kstyle_baghira_config : : changeTooluttonHighlightColor ( const QColor & color )
void kstyle_baghira_config : : changeTooluttonHighlightColor ( const T QColor & color )
{
KConfig * config = new KConfig ( " kdeglobals " ) ;
config - > setGroup ( " Toolbar style " ) ;
@ -681,9 +681,9 @@ void kstyle_baghira_config::handleButtonStyles(int i)
configChanged ( ) ;
}
void kstyle_baghira_config : : save ( QString & fileName )
void kstyle_baghira_config : : save ( T QString & fileName )
{
// QSettings *config = new QSettings;
// T QSettings *config = new T QSettings;
KConfig * config = new KConfig ( fileName ) ;
config - > setGroup ( " BAB " ) ;
//General Design
@ -704,7 +704,7 @@ void kstyle_baghira_config::save(QString &fileName)
config - > writeEntry ( " Design_InactiveButtonColor " , ( int ) dialog_ - > customInactiveColor - > color ( ) . rgb ( ) ) ;
config - > writeEntry ( " Design_CenterTabs " , dialog_ - > centerTabs - > isOn ( ) ) ;
//button color stuff
config - > writeEntry ( " Design_ButtonColor " , ( int ) ( QColor( sliderButtonRedValue , sliderButtonGreenValue , sliderButtonBlueValue ) . rgb ( ) ) ) ;
config - > writeEntry ( " Design_ButtonColor " , ( int ) ( T QColor( sliderButtonRedValue , sliderButtonGreenValue , sliderButtonBlueValue ) . rgb ( ) ) ) ;
// special Widgets
//listviews
@ -719,17 +719,17 @@ void kstyle_baghira_config::save(QString &fileName)
//Kicker
config - > writeEntry ( " Special_RemoveKickerBevel " , dialog_ - > removeKickerBevel - > isOn ( ) ) ;
config - > writeEntry ( " Special_RoundTaskbuttons " , dialog_ - > roundTasks - > isOn ( ) ) ;
QDir tmpDir ( QDir: : homeDirPath ( ) + " /.kde " ) ;
if ( ! tmpDir . exists ( ) ) tmpDir . mkdir ( QDir: : homeDirPath ( ) + " /.kde " ) ;
tmpDir . setPath ( QDir: : homeDirPath ( ) + " /.kde/share " ) ;
if ( ! tmpDir . exists ( ) ) tmpDir . mkdir ( QDir: : homeDirPath ( ) + " /.kde/share " ) ;
tmpDir . setPath ( QDir: : homeDirPath ( ) + " /.kde/share/apps " ) ;
if ( ! tmpDir . exists ( ) ) tmpDir . mkdir ( QDir: : homeDirPath ( ) + " /.kde/share/apps " ) ;
tmpDir . setPath ( QDir: : homeDirPath ( ) + " /.kde/share/apps/kicker " ) ;
if ( ! tmpDir . exists ( ) ) tmpDir . mkdir ( QDir: : homeDirPath ( ) + " /.kde/share/apps/kicker " ) ;
tmpDir . setPath ( QDir: : homeDirPath ( ) + " /.kde/share/apps/kicker/applets " ) ;
if ( ! tmpDir . exists ( ) ) tmpDir . mkdir ( QDir: : homeDirPath ( ) + " /.kde/share/apps/kicker/applets " ) ;
QFile file ( QDir: : homeDirPath ( ) + " /.kde/share/apps/kicker/applets/menuapplet.desktop " ) ;
T QDir tmpDir ( T QDir: : homeDirPath ( ) + " /.kde " ) ;
if ( ! tmpDir . exists ( ) ) tmpDir . mkdir ( T QDir: : homeDirPath ( ) + " /.kde " ) ;
tmpDir . setPath ( T QDir: : homeDirPath ( ) + " /.kde/share " ) ;
if ( ! tmpDir . exists ( ) ) tmpDir . mkdir ( T QDir: : homeDirPath ( ) + " /.kde/share " ) ;
tmpDir . setPath ( T QDir: : homeDirPath ( ) + " /.kde/share/apps " ) ;
if ( ! tmpDir . exists ( ) ) tmpDir . mkdir ( T QDir: : homeDirPath ( ) + " /.kde/share/apps " ) ;
tmpDir . setPath ( T QDir: : homeDirPath ( ) + " /.kde/share/apps/kicker " ) ;
if ( ! tmpDir . exists ( ) ) tmpDir . mkdir ( T QDir: : homeDirPath ( ) + " /.kde/share/apps/kicker " ) ;
tmpDir . setPath ( T QDir: : homeDirPath ( ) + " /.kde/share/apps/kicker/applets " ) ;
if ( ! tmpDir . exists ( ) ) tmpDir . mkdir ( T QDir: : homeDirPath ( ) + " /.kde/share/apps/kicker/applets " ) ;
T QFile file ( T QDir: : homeDirPath ( ) + " /.kde/share/apps/kicker/applets/menuapplet.desktop " ) ;
if ( dialog_ - > replaceMenubar - > isOn ( ) )
{
file . open ( IO_WriteOnly ) ;
@ -741,7 +741,7 @@ Encoding=UTF-8\n\
Name = BaghiraMenu \ n \
X - KDE - Library = b_menu_panelapplet \ n \
X - KDE - UniqueApplet = true \ n " ;
file . writeBlock ( msg , qstrlen( msg ) ) ;
file . writeBlock ( msg , t qstrlen( msg ) ) ;
file . close ( ) ;
}
else
@ -788,7 +788,7 @@ X-KDE-UniqueApplet=true\n";
config - > writeEntry ( " Colors_TabInactive " , ( int ) dialog_ - > inactiveTabColor - > color ( ) . rgb ( ) ) ;
config - > writeEntry ( " Colors_TabActive " , ( int ) dialog_ - > activeTabColor - > color ( ) . rgb ( ) ) ;
config - > writeEntry ( " Colors_TintBrushedMetal " , dialog_ - > tintBrush - > isOn ( ) ) ;
config - > writeEntry ( " Colors_BrushTint " , ( int ) qRgb( sliderBrushRedValue , sliderBrushGreenValue , sliderBrushBlueValue ) ) ;
config - > writeEntry ( " Colors_BrushTint " , ( int ) t qRgb( sliderBrushRedValue , sliderBrushGreenValue , sliderBrushBlueValue ) ) ;
config - > setGroup ( " Menubar " ) ;
config - > writeEntry ( " Width " , dialog_ - > menuMaxWidth - > value ( ) ) ;
config - > sync ( ) ;
@ -807,7 +807,7 @@ void kstyle_baghira_config::configChanged()
}
QString kstyle_baghira_config : : quickHelp ( ) const
T QString kstyle_baghira_config : : quickHelp ( ) const
{
return i18n ( " Configure Your Cat " ) ;
}
@ -836,14 +836,14 @@ void kstyle_baghira_config::enableMenuColorStuff(int d)
void kstyle_baghira_config : : buttonLoadAction ( )
{
QString tmpString = KFileDialog : : getOpenFileName ( QDir: : homeDirPath ( ) , " * " , this , " Select a Baghira config file " ) ;
T QString tmpString = KFileDialog : : getOpenFileName ( T QDir: : homeDirPath ( ) , " * " , this , " Select a Baghira config file " ) ;
if ( ! tmpString . isEmpty ( ) )
load ( tmpString ) ;
}
void kstyle_baghira_config : : buttonSaveAsAction ( )
{
QString tmpString = KFileDialog : : getSaveFileName ( QDir: : homeDirPath ( ) , " * " , this , " Save current Baghira configuration as " ) ;
T QString tmpString = KFileDialog : : getSaveFileName ( T QDir: : homeDirPath ( ) , " * " , this , " Save current Baghira configuration as " ) ;
save ( tmpString ) ;
}
@ -854,19 +854,19 @@ void kstyle_baghira_config::editApp()
void kstyle_baghira_config : : removeApp ( )
{
QString string = QDir: : homeDirPath ( ) + " /.baghira/ " + applist - > currentItem ( ) - > text ( 0 ) ;
QFile: : remove ( string ) ;
T QString string = T QDir: : homeDirPath ( ) + " /.baghira/ " + applist - > currentItem ( ) - > text ( 0 ) ;
T QFile: : remove ( string ) ;
applist - > takeItem ( applist - > currentItem ( ) ) ;
}
void kstyle_baghira_config : : removeApp ( QString name )
void kstyle_baghira_config : : removeApp ( T QString name )
{
QString string = QDir: : homeDirPath ( ) + " /.baghira/ " + name ;
QFile: : remove ( string ) ;
applist - > takeItem ( applist - > findItem ( name , 0 , Qt: : ExactMatch ) ) ;
T QString string = T QDir: : homeDirPath ( ) + " /.baghira/ " + name ;
T QFile: : remove ( string ) ;
applist - > takeItem ( applist - > findItem ( name , 0 , T Qt: : ExactMatch ) ) ;
}
void kstyle_baghira_config : : addApp ( QString string , QString linkString )
void kstyle_baghira_config : : addApp ( T QString string , T QString linkString )
{
applist - > insertItem ( new KListViewItem ( applist , string , linkString ) ) ;
applist - > sort ( ) ;
@ -878,34 +878,34 @@ void kstyle_baghira_config::selectWindow()
// use a dialog, so that all user input is blocked
// use WX11BypassWM and moving away so that it's not actually visible
// grab only mouse, so that keyboard can be used e.g. for switching windows
grabber = new QDialog( NULL , NULL , true , WX11BypassWM ) ;
grabber = new T QDialog( NULL , NULL , true , WX11BypassWM ) ;
grabber - > move ( - 1000 , - 1000 ) ;
grabber - > show ( ) ;
grabber - > grabMouse ( crossCursor ) ;
grabber - > installEventFilter ( this ) ;
}
Atom wm_state = XInternAtom ( qt_xdisplay( ) , " WM_STATE " , False ) ;
// Atom wm_state = XInternAtom( qt_xdisplay(), "WM_COMMAND", False );
Atom wm_state = XInternAtom ( t qt_xdisplay( ) , " WM_STATE " , False ) ;
// Atom wm_state = XInternAtom( t qt_xdisplay(), "WM_COMMAND", False );
bool kstyle_baghira_config : : eventFilter ( QObject* o , QEvent* e )
bool kstyle_baghira_config : : eventFilter ( T QObject* o , T QEvent* e )
// adapted from kcmkwin... again ;)
{
if ( o ! = grabber )
return false ;
if ( e - > type ( ) ! = QEvent: : MouseButtonRelease )
if ( e - > type ( ) ! = T QEvent: : MouseButtonRelease )
return false ;
delete grabber ;
grabber = NULL ;
if ( static_cast < QMouseEvent* > ( e ) - > button ( ) ! = LeftButton )
if ( static_cast < T QMouseEvent* > ( e ) - > button ( ) ! = LeftButton )
return true ;
WId winId = findWindow ( ) ;
XClassHint classHint ;
if ( XGetClassHint ( qt_xdisplay( ) , winId , & classHint ) )
if ( XGetClassHint ( t qt_xdisplay( ) , winId , & classHint ) )
{
QString tmpString = QString( classHint . res_class ) . lower ( ) + " (uncertain) " ;
appsetter - > show ( tmpString , QString( ) ) ;
// qWarning("class: %s",QString( classHint.res_class ).lower().ascii());
T QString tmpString = T QString( classHint . res_class ) . lower ( ) + " (uncertain) " ;
appsetter - > show ( tmpString , T QString( ) ) ;
// t qWarning("class: %s",T QString( classHint.res_class ).lower().ascii());
XFree ( classHint . res_name ) ;
XFree ( classHint . res_class ) ;
}
@ -919,13 +919,13 @@ WId kstyle_baghira_config::findWindow()
Window child ;
uint mask ;
int rootX , rootY , x , y ;
Window parent = qt_xrootwin( ) ;
// Atom wm_state = XInternAtom( qt_xdisplay(), "WM_STATE", False );
Window parent = t qt_xrootwin( ) ;
// Atom wm_state = XInternAtom( t qt_xdisplay(), "WM_STATE", False );
for ( int i = 0 ;
i < 10 ;
+ + i )
{
XQueryPointer ( qt_xdisplay( ) , parent , & root , & child ,
XQueryPointer ( t qt_xdisplay( ) , parent , & root , & child ,
& rootX , & rootY , & x , & y , & mask ) ;
if ( child = = None )
return 0 ;
@ -933,7 +933,7 @@ WId kstyle_baghira_config::findWindow()
int format ;
unsigned long nitems , after ;
unsigned char * prop ;
if ( XGetWindowProperty ( qt_xdisplay( ) , child , wm_state , 0 , 0 , False , AnyPropertyType , & type , & format , & nitems , & after , & prop ) = = Success )
if ( XGetWindowProperty ( t qt_xdisplay( ) , child , wm_state , 0 , 0 , False , AnyPropertyType , & type , & format , & nitems , & after , & prop ) = = Success )
{
if ( prop ! = NULL )
XFree ( prop ) ;
@ -968,28 +968,28 @@ void kstyle_baghira_config::menuToggled(bool active)
extern " C "
{
QWidget* allocate_kstyle_config ( QWidget* parent ) {
T QWidget* allocate_kstyle_config ( T QWidget* parent ) {
return ( new kstyle_baghira_config ( parent , " BaghiraConfig " ) ) ;
}
}
AppSetter : : AppSetter ( QWidget * parent , const char * name ) : QWidget( parent , name , Qt: : WType_Dialog | Qt: : WShowModal )
AppSetter : : AppSetter ( T QWidget * parent , const char * name ) : T QWidget( parent , name , T Qt: : WType_Dialog | T Qt: : WShowModal )
{
isEdit = FALSE ;
QLabel * label1 = new QLabel( i18n ( " <qt><b>Application Name</b></qt> " ) , this ) ;
command = new QLineEdit( this ) ;
T QLabel * label1 = new T QLabel( i18n ( " <qt><b>Application Name</b></qt> " ) , this ) ;
command = new T QLineEdit( this ) ;
QLabel * linkTo = new QLabel( i18n ( " <qt><b>Just like</b></qt> " ) , this ) ;
link = new QComboBox( this ) ;
T QLabel * linkTo = new T QLabel( i18n ( " <qt><b>Just like</b></qt> " ) , this ) ;
link = new T QComboBox( this ) ;
box = new QGroupBox( 2 , Qt: : Horizontal , i18n ( " Custom Settings " ) , this ) ;
box = new T QGroupBox( 2 , T Qt: : Horizontal , i18n ( " Custom Settings " ) , this ) ;
box - > setCheckable ( true ) ;
new QLabel( i18n ( " <qt><b>Style</b></qt> " ) , box ) ;
new QLabel( " <qt><b>Deco</b></qt> " , box ) ;
new T QLabel( i18n ( " <qt><b>Style</b></qt> " ) , box ) ;
new T QLabel( " <qt><b>Deco</b></qt> " , box ) ;
style = new QComboBox( box ) ;
style = new T QComboBox( box ) ;
style - > insertItem ( i18n ( " Don't set " ) ) ;
style - > insertItem ( " Jaguar " ) ;
style - > insertItem ( " Panther " ) ;
@ -997,7 +997,7 @@ AppSetter::AppSetter(QWidget *parent, const char *name) : QWidget(parent, name,
style - > insertItem ( " Tiger " ) ;
style - > insertItem ( " Milk " ) ;
deco = new QComboBox( box ) ;
deco = new T QComboBox( box ) ;
deco - > insertItem ( i18n ( " Don't set " ) ) ;
deco - > insertItem ( " Jaguar " ) ;
deco - > insertItem ( " Panther " ) ;
@ -1005,10 +1005,10 @@ AppSetter::AppSetter(QWidget *parent, const char *name) : QWidget(parent, name,
deco - > insertItem ( " Tiger " ) ;
deco - > insertItem ( " Milk " ) ;
new QLabel( i18n ( " <qt><b>Buttons</b></qt> " ) , box ) ;
new QLabel( i18n ( " <qt><b>Toolbuttons</b></qt> " ) , box ) ;
new T QLabel( i18n ( " <qt><b>Buttons</b></qt> " ) , box ) ;
new T QLabel( i18n ( " <qt><b>Toolbuttons</b></qt> " ) , box ) ;
buttons = new QComboBox( box ) ;
buttons = new T QComboBox( box ) ;
buttons - > insertItem ( " Jaguar " ) ;
buttons - > insertItem ( " Panther " ) ;
buttons - > insertItem ( " iTunes " ) ;
@ -1016,48 +1016,48 @@ AppSetter::AppSetter(QWidget *parent, const char *name) : QWidget(parent, name,
buttons - > insertItem ( " Milk " ) ;
toolButtons = new QComboBox( box ) ;
toolButtons = new T QComboBox( box ) ;
toolButtons - > insertItem ( " Jaguar " ) ;
toolButtons - > insertItem ( " Panther " ) ;
toolButtons - > insertItem ( " iTunes " ) ;
toolButtons - > insertItem ( " Tiger " ) ;
toolButtons - > insertItem ( " Milk " ) ;
new QLabel( i18n ( " <qt><b>Tab vs. Chooser</b></qt> " ) , box ) ;
new QLabel( i18n ( " <qt>Inactive Button</qt> " ) , box ) ;
new T QLabel( i18n ( " <qt><b>Tab vs. Chooser</b></qt> " ) , box ) ;
new T QLabel( i18n ( " <qt>Inactive Button</qt> " ) , box ) ;
tabs = new QComboBox( box ) ;
tabs = new T QComboBox( box ) ;
tabs - > insertItem ( i18n ( " Don't set " ) ) ;
tabs - > insertItem ( " Tabs " ) ;
tabs - > insertItem ( " Adaptive " ) ;
tabs - > insertItem ( " Choosers " ) ;
inbutton = new QComboBox( box ) ;
inbutton = new T QComboBox( box ) ;
inbutton - > insertItem ( " Fixed " ) ;
inbutton - > insertItem ( " Background " ) ;
inbutton - > insertItem ( " Active Button " ) ;
scanlines = new QCheckBox( " Show scanlines " , box ) ;
scanlines = new T QCheckBox( " Show scanlines " , box ) ;
QWidget * dumb = new QWidget( box ) ;
customColors = new QCheckBox( dumb ) ;
buttonColors = new QPushButton( " Custom Colors " , dumb ) ;
QHBoxLayout * clh = new QHBoxLayout( dumb ) ;
T QWidget * dumb = new T QWidget( box ) ;
customColors = new T QCheckBox( dumb ) ;
buttonColors = new T QPushButton( " Custom Colors " , dumb ) ;
T QHBoxLayout * clh = new T QHBoxLayout( dumb ) ;
clh - > addWidget ( customColors ) ;
clh - > addWidget ( buttonColors ) ;
QVBoxLayout * lv = new QVBoxLayout( this , 11 , 6 ) ;
T QVBoxLayout * lv = new T QVBoxLayout( this , 11 , 6 ) ;
lv - > addWidget ( label1 ) ;
lv - > addWidget ( command ) ;
QHBoxLayout * lh0 = new QHBoxLayout( lv ) ;
T QHBoxLayout * lh0 = new T QHBoxLayout( lv ) ;
lh0 - > addWidget ( linkTo ) ;
lh0 - > addWidget ( link ) ;
lv - > addWidget ( box ) ;
QHBoxLayout * lh = new QHBoxLayout( lv ) ;
QPushButton * cancel = new QPushButton( " Cancel " , this ) ;
T QHBoxLayout * lh = new T QHBoxLayout( lv ) ;
T QPushButton * cancel = new T QPushButton( " Cancel " , this ) ;
lh - > addWidget ( cancel ) ;
QPushButton * ok = new QPushButton( " Ok " , this ) ;
T QPushButton * ok = new T QPushButton( " Ok " , this ) ;
lh - > addWidget ( ok ) ;
colorDialog = new ColorDialog ( this ) ;
@ -1102,20 +1102,20 @@ void AppSetter::updateColors()
void AppSetter : : show ( )
{
link - > clear ( ) ;
QDir d ( QDir: : homeDirPath ( ) + " /.baghira " , 0L , QDir: : Name | QDir: : IgnoreCase , QDir: : Files | QDir: : NoSymLinks | QDir: : Readable | QDir: : Writable ) ;
T QDir d ( T QDir: : homeDirPath ( ) + " /.baghira " , 0L , T QDir: : Name | T QDir: : IgnoreCase , T QDir: : Files | T QDir: : NoSymLinks | T QDir: : Readable | T QDir: : Writable ) ;
for ( uint i = 0 ; i < d . count ( ) ; i + + )
link - > insertItem ( d [ i ] ) ;
QWidget: : show ( ) ;
T QWidget: : show ( ) ;
}
void AppSetter : : show ( QString appName , QString linkString )
void AppSetter : : show ( T QString appName , T QString linkString )
{
isEdit = true ;
oldName = appName ;
oldLink = linkString ;
command - > setText ( appName ) ;
FILE * file = NULL ;
QString tmpString = QDir: : homeDirPath ( ) + " /.baghira/ " + appName ;
T QString tmpString = T QDir: : homeDirPath ( ) + " /.baghira/ " + appName ;
if ( ( file = fopen ( tmpString . latin1 ( ) , " r " ) ) ! = NULL )
{
uint s , d , b , t , tc , sc , ib ;
@ -1163,10 +1163,10 @@ void AppSetter::resetColorPicker()
for ( int i = 0 ; i < 8 ; i + + )
{
colorDialog - > picker [ i ] - > blockSignals ( true ) ;
colorDialog - > picker [ i ] - > setColor ( QColor( colors [ i ] ) ) ;
colorDialog - > picker [ i ] - > setColor ( T QColor( colors [ i ] ) ) ;
colorDialog - > picker [ i ] - > blockSignals ( false ) ;
}
( ( QWidget* ) colorDialog - > demo ) - > repaint ( false ) ;
( ( T QWidget* ) colorDialog - > demo ) - > repaint ( false ) ;
}
else
{
@ -1182,7 +1182,7 @@ void AppSetter::resetColorPicker()
colorDialog - > picker [ Alternate ] - > setColor ( KGlobalSettings : : alternateBackgroundColor ( ) ) ;
for ( int i = 0 ; i < 8 ; i + + )
colorDialog - > picker [ i ] - > blockSignals ( false ) ;
( ( QWidget* ) colorDialog - > demo ) - > repaint ( false ) ;
( ( T QWidget* ) colorDialog - > demo ) - > repaint ( false ) ;
}
}
@ -1191,11 +1191,11 @@ void AppSetter::save()
if ( command - > text ( ) ! = " " & & ( ! box - > isChecked ( ) | | ( style - > currentItem ( ) ! = 0 & & deco - > currentItem ( ) ! = 0 ) ) )
{
if ( ! isEdit )
emit addApp ( command - > text ( ) , box - > isChecked ( ) ? QString( ) : link - > currentText ( ) ) ;
emit addApp ( command - > text ( ) , box - > isChecked ( ) ? T QString( ) : link - > currentText ( ) ) ;
else if ( command - > text ( ) ! = oldName | | link - > currentText ( ) ! = oldLink )
{
emit removeApp ( oldName ) ;
emit addApp ( command - > text ( ) , box - > isChecked ( ) ? QString( ) : link - > currentText ( ) ) ;
emit addApp ( command - > text ( ) , box - > isChecked ( ) ? T QString( ) : link - > currentText ( ) ) ;
}
if ( ! customColors - > isChecked ( ) )
{
@ -1203,7 +1203,7 @@ void AppSetter::save()
colors [ i ] = - 1 ;
}
FILE * file = NULL ;
QString tmpString = QDir: : homeDirPath ( ) + " /.baghira/ " + command - > text ( ) ;
T QString tmpString = T QDir: : homeDirPath ( ) + " /.baghira/ " + command - > text ( ) ;
if ( box - > isChecked ( ) ) // custom settings
{
if ( ( file = fopen ( tmpString . latin1 ( ) , " w " ) ) ! = NULL )
@ -1214,8 +1214,8 @@ void AppSetter::save()
}
else // just link
{
QString tmpString2 = QDir: : homeDirPath ( ) + " /.baghira/ " + link - > currentText ( ) ;
QFile: : remove ( tmpString ) ; // just to be sure ;)
T QString tmpString2 = T QDir: : homeDirPath ( ) + " /.baghira/ " + link - > currentText ( ) ;
T QFile: : remove ( tmpString ) ; // just to be sure ;)
symlink ( tmpString2 . latin1 ( ) , tmpString . latin1 ( ) ) ;
}
}