|
|
@ -36,10 +36,10 @@
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
|
|
|
|
#include <qfileinfo.h>
|
|
|
|
#include <tqfileinfo.h>
|
|
|
|
#include <qlayout.h>
|
|
|
|
#include <tqlayout.h>
|
|
|
|
#include <qlabel.h>
|
|
|
|
#include <tqlabel.h>
|
|
|
|
#include <qpushbutton.h>
|
|
|
|
#include <tqpushbutton.h>
|
|
|
|
|
|
|
|
|
|
|
|
#include <kdebug.h>
|
|
|
|
#include <kdebug.h>
|
|
|
|
#include <kapplication.h>
|
|
|
|
#include <kapplication.h>
|
|
|
@ -64,9 +64,9 @@
|
|
|
|
#include <ksvgiconengine.h>
|
|
|
|
#include <ksvgiconengine.h>
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#include <qdir.h>
|
|
|
|
#include <tqdir.h>
|
|
|
|
#include <qpainter.h>
|
|
|
|
#include <tqpainter.h>
|
|
|
|
#include <qregexp.h>
|
|
|
|
#include <tqregexp.h>
|
|
|
|
|
|
|
|
|
|
|
|
#include "themes.h"
|
|
|
|
#include "themes.h"
|
|
|
|
#include <kurlrequester.h>
|
|
|
|
#include <kurlrequester.h>
|
|
|
@ -77,7 +77,7 @@
|
|
|
|
// ----------
|
|
|
|
// ----------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
IconThemesConfig::IconThemesConfig( QWidget *parent, KListView *themesView /*, QPushButton *removethemeBtn*/ )
|
|
|
|
IconThemesConfig::IconThemesConfig( TQWidget *parent, KListView *themesView /*, TQPushButton *removethemeBtn*/ )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
parent_ = parent;
|
|
|
|
parent_ = parent;
|
|
|
|
themesView_ = themesView;
|
|
|
|
themesView_ = themesView;
|
|
|
@ -99,9 +99,9 @@ IconThemesConfig::~IconThemesConfig()
|
|
|
|
// ----------
|
|
|
|
// ----------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
QListViewItem *IconThemesConfig::iconThemeItem( const QString &name )
|
|
|
|
TQListViewItem *IconThemesConfig::iconThemeItem( const TQString &name )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QListViewItem * item;
|
|
|
|
TQListViewItem * item;
|
|
|
|
for ( item = themesView_->firstChild(); item ; item = item->nextSibling() )
|
|
|
|
for ( item = themesView_->firstChild(); item ; item = item->nextSibling() )
|
|
|
|
if ( item->text( 0 ) == name ) return item;
|
|
|
|
if ( item->text( 0 ) == name ) return item;
|
|
|
|
|
|
|
|
|
|
|
@ -118,38 +118,38 @@ void IconThemesConfig::loadThemes()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
themesView_->clear();
|
|
|
|
themesView_->clear();
|
|
|
|
m_themeNames.clear();
|
|
|
|
m_themeNames.clear();
|
|
|
|
QStringList themelist;
|
|
|
|
TQStringList themelist;
|
|
|
|
QString name;
|
|
|
|
TQString name;
|
|
|
|
QString place;
|
|
|
|
TQString place;
|
|
|
|
QStringList::Iterator it, itj;
|
|
|
|
TQStringList::Iterator it, itj;
|
|
|
|
QStringList themesDirs;
|
|
|
|
TQStringList themesDirs;
|
|
|
|
|
|
|
|
|
|
|
|
// if no local deKorator folders
|
|
|
|
// if no local deKorator folders
|
|
|
|
if ( ! QDir( QDir::homeDirPath() + "/.kde/share/apps/" ).exists( "deKorator" ) )
|
|
|
|
if ( ! TQDir( TQDir::homeDirPath() + "/.kde/share/apps/" ).exists( "deKorator" ) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
qWarning( "no dirs, will make them..." );
|
|
|
|
tqWarning( "no dirs, will make them..." );
|
|
|
|
KIO::mkdir( QDir::homeDirPath() + "/.kde/share/apps/deKorator/" );
|
|
|
|
KIO::mkdir( TQDir::homeDirPath() + "/.kde/share/apps/deKorator/" );
|
|
|
|
KIO::mkdir( QDir::homeDirPath() + "/.kde/share/apps/deKorator/themes/" );
|
|
|
|
KIO::mkdir( TQDir::homeDirPath() + "/.kde/share/apps/deKorator/themes/" );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
qWarning( "exist" );
|
|
|
|
tqWarning( "exist" );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
themesDirs = KGlobal::dirs() ->findDirs( "data", "deKorator/themes" ) ;
|
|
|
|
themesDirs = KGlobal::dirs() ->findDirs( "data", "deKorator/themes" ) ;
|
|
|
|
|
|
|
|
|
|
|
|
for ( it = themesDirs.begin(); it != themesDirs.end(); ++it )
|
|
|
|
for ( it = themesDirs.begin(); it != themesDirs.end(); ++it )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QDir dir = QDir( *it );
|
|
|
|
TQDir dir = TQDir( *it );
|
|
|
|
themelist = dir.entryList( "*-theme" );
|
|
|
|
themelist = dir.entryList( "*-theme" );
|
|
|
|
|
|
|
|
|
|
|
|
for ( itj = themelist.begin(); itj != themelist.end(); ++itj )
|
|
|
|
for ( itj = themelist.begin(); itj != themelist.end(); ++itj )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
place = *it;
|
|
|
|
place = *it;
|
|
|
|
|
|
|
|
|
|
|
|
name = ( QString ) * itj;
|
|
|
|
name = ( TQString ) * itj;
|
|
|
|
|
|
|
|
|
|
|
|
themesView_->insertItem( new QListViewItem( themesView_, name ) );
|
|
|
|
themesView_->insertItem( new TQListViewItem( themesView_, name ) );
|
|
|
|
|
|
|
|
|
|
|
|
m_themeNames.insert( name, place );
|
|
|
|
m_themeNames.insert( name, place );
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -164,7 +164,7 @@ void IconThemesConfig::loadThemes()
|
|
|
|
void IconThemesConfig::installNewTheme()
|
|
|
|
void IconThemesConfig::installNewTheme()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
KURL themeURL = KURLRequesterDlg::getURL( QString::null, parent_,
|
|
|
|
KURL themeURL = KURLRequesterDlg::getURL( TQString::null, parent_,
|
|
|
|
i18n( "Drag or Type Theme URL" ) );
|
|
|
|
i18n( "Drag or Type Theme URL" ) );
|
|
|
|
kdDebug() << themeURL.prettyURL() << endl;
|
|
|
|
kdDebug() << themeURL.prettyURL() << endl;
|
|
|
|
|
|
|
|
|
|
|
@ -172,11 +172,11 @@ void IconThemesConfig::installNewTheme()
|
|
|
|
return ;
|
|
|
|
return ;
|
|
|
|
|
|
|
|
|
|
|
|
// themeTmpFile contains the name of the downloaded file
|
|
|
|
// themeTmpFile contains the name of the downloaded file
|
|
|
|
QString themeTmpFile;
|
|
|
|
TQString themeTmpFile;
|
|
|
|
|
|
|
|
|
|
|
|
if ( !KIO::NetAccess::download( themeURL, themeTmpFile, parent_ ) )
|
|
|
|
if ( !KIO::NetAccess::download( themeURL, themeTmpFile, parent_ ) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QString sorryText;
|
|
|
|
TQString sorryText;
|
|
|
|
if ( themeURL.isLocalFile() )
|
|
|
|
if ( themeURL.isLocalFile() )
|
|
|
|
sorryText = i18n( "Unable to find the deKorator theme archive %1." );
|
|
|
|
sorryText = i18n( "Unable to find the deKorator theme archive %1." );
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -187,10 +187,10 @@ void IconThemesConfig::installNewTheme()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
|
QStringList themesNames = findThemeDirs( themeTmpFile );
|
|
|
|
TQStringList themesNames = findThemeDirs( themeTmpFile );
|
|
|
|
if ( themesNames.isEmpty() )
|
|
|
|
if ( themesNames.isEmpty() )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QString invalidArch( i18n( "The file is not a valid deKorator theme archive." ) );
|
|
|
|
TQString invalidArch( i18n( "The file is not a valid deKorator theme archive." ) );
|
|
|
|
KMessageBox::error( parent_, invalidArch );
|
|
|
|
KMessageBox::error( parent_, invalidArch );
|
|
|
|
|
|
|
|
|
|
|
|
KIO::NetAccess::removeTempFile( themeTmpFile );
|
|
|
|
KIO::NetAccess::removeTempFile( themeTmpFile );
|
|
|
@ -200,8 +200,8 @@ void IconThemesConfig::installNewTheme()
|
|
|
|
if ( !installThemes( themesNames, themeTmpFile ) )
|
|
|
|
if ( !installThemes( themesNames, themeTmpFile ) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//FIXME: make me able to know what is wrong....
|
|
|
|
//FIXME: make me able to know what is wrong....
|
|
|
|
// QStringList instead of bool?
|
|
|
|
// TQStringList instead of bool?
|
|
|
|
QString somethingWrong =
|
|
|
|
TQString somethingWrong =
|
|
|
|
i18n( "A problem occurred during the installation process; "
|
|
|
|
i18n( "A problem occurred during the installation process; "
|
|
|
|
"however, most of the themes in the archive have been installed" );
|
|
|
|
"however, most of the themes in the archive have been installed" );
|
|
|
|
KMessageBox::error( parent_, somethingWrong );
|
|
|
|
KMessageBox::error( parent_, somethingWrong );
|
|
|
@ -211,9 +211,9 @@ void IconThemesConfig::installNewTheme()
|
|
|
|
|
|
|
|
|
|
|
|
loadThemes();
|
|
|
|
loadThemes();
|
|
|
|
|
|
|
|
|
|
|
|
QStringList::Iterator cur = themesNames.at( 0 );
|
|
|
|
TQStringList::Iterator cur = themesNames.at( 0 );
|
|
|
|
|
|
|
|
|
|
|
|
QListViewItem *item = iconThemeItem( *cur );
|
|
|
|
TQListViewItem *item = iconThemeItem( *cur );
|
|
|
|
themesView_->setSelected( item, true );
|
|
|
|
themesView_->setSelected( item, true );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -222,14 +222,14 @@ void IconThemesConfig::installNewTheme()
|
|
|
|
// ----------
|
|
|
|
// ----------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
bool IconThemesConfig::installThemes( const QStringList &themes, const QString &archiveName )
|
|
|
|
bool IconThemesConfig::installThemes( const TQStringList &themes, const TQString &archiveName )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool everythingOk = true;
|
|
|
|
bool everythingOk = true;
|
|
|
|
QString localThemesDir = QDir::homeDirPath() + "/.kde/share/apps/deKorator/themes/";
|
|
|
|
TQString localThemesDir = TQDir::homeDirPath() + "/.kde/share/apps/deKorator/themes/";
|
|
|
|
//
|
|
|
|
//
|
|
|
|
KProgressDialog progressDiag( parent_, "themeinstallprogress",
|
|
|
|
KProgressDialog progressDiag( parent_, "themeinstallprogress",
|
|
|
|
i18n( "Installing icon themes" ),
|
|
|
|
i18n( "Installing icon themes" ),
|
|
|
|
QString::null,
|
|
|
|
TQString::null,
|
|
|
|
true );
|
|
|
|
true );
|
|
|
|
progressDiag.setAutoClose( true );
|
|
|
|
progressDiag.setAutoClose( true );
|
|
|
|
progressDiag.progressBar() ->setTotalSteps( themes.count() );
|
|
|
|
progressDiag.progressBar() ->setTotalSteps( themes.count() );
|
|
|
@ -242,7 +242,7 @@ bool IconThemesConfig::installThemes( const QStringList &themes, const QString &
|
|
|
|
const KArchiveDirectory* rootDir = archive.directory();
|
|
|
|
const KArchiveDirectory* rootDir = archive.directory();
|
|
|
|
|
|
|
|
|
|
|
|
KArchiveDirectory* currentTheme;
|
|
|
|
KArchiveDirectory* currentTheme;
|
|
|
|
for ( QStringList::ConstIterator it = themes.begin(); it != themes.end(); ++it )
|
|
|
|
for ( TQStringList::ConstIterator it = themes.begin(); it != themes.end(); ++it )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
progressDiag.setLabel(
|
|
|
|
progressDiag.setLabel(
|
|
|
|
i18n( "<qt>Installing <strong>%1</strong> theme</qt>" )
|
|
|
|
i18n( "<qt>Installing <strong>%1</strong> theme</qt>" )
|
|
|
@ -276,9 +276,9 @@ bool IconThemesConfig::installThemes( const QStringList &themes, const QString &
|
|
|
|
// ----------
|
|
|
|
// ----------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
QStringList IconThemesConfig::findThemeDirs( const QString &archiveName )
|
|
|
|
TQStringList IconThemesConfig::findThemeDirs( const TQString &archiveName )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QStringList foundThemes;
|
|
|
|
TQStringList foundThemes;
|
|
|
|
|
|
|
|
|
|
|
|
KTar archive( archiveName );
|
|
|
|
KTar archive( archiveName );
|
|
|
|
archive.open( IO_ReadOnly );
|
|
|
|
archive.open( IO_ReadOnly );
|
|
|
@ -288,11 +288,11 @@ QStringList IconThemesConfig::findThemeDirs( const QString &archiveName )
|
|
|
|
KArchiveDirectory* subDir = 0L;
|
|
|
|
KArchiveDirectory* subDir = 0L;
|
|
|
|
|
|
|
|
|
|
|
|
// iterate all the dirs looking for an index.theme or index.desktop file
|
|
|
|
// iterate all the dirs looking for an index.theme or index.desktop file
|
|
|
|
QStringList entries = themeDir->entries();
|
|
|
|
TQStringList entries = themeDir->entries();
|
|
|
|
for ( QStringList::Iterator it = entries.begin(); it != entries.end(); ++it )
|
|
|
|
for ( TQStringList::Iterator it = entries.begin(); it != entries.end(); ++it )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QString name = ( QString ) * it;
|
|
|
|
TQString name = ( TQString ) * it;
|
|
|
|
QRegExp rxp = QRegExp( "*-theme", TRUE, TRUE );
|
|
|
|
TQRegExp rxp = TQRegExp( "*-theme", TRUE, TRUE );
|
|
|
|
int i = name.contains( rxp );
|
|
|
|
int i = name.contains( rxp );
|
|
|
|
if ( !i )
|
|
|
|
if ( !i )
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -306,7 +306,7 @@ QStringList IconThemesConfig::findThemeDirs( const QString &archiveName )
|
|
|
|
if ( subDir && ( subDir->entry( "deco" ) != NULL && subDir->entry( "buttons" ) != NULL && subDir->entry( "masks" ) != NULL ) )
|
|
|
|
if ( subDir && ( subDir->entry( "deco" ) != NULL && subDir->entry( "buttons" ) != NULL && subDir->entry( "masks" ) != NULL ) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
foundThemes.append( subDir->name() );
|
|
|
|
foundThemes.append( subDir->name() );
|
|
|
|
//qWarning( "found" );
|
|
|
|
//tqWarning( "found" );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -323,11 +323,11 @@ QStringList IconThemesConfig::findThemeDirs( const QString &archiveName )
|
|
|
|
|
|
|
|
|
|
|
|
void IconThemesConfig::removeSelectedTheme()
|
|
|
|
void IconThemesConfig::removeSelectedTheme()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QListViewItem * selected = themesView_->selectedItem();
|
|
|
|
TQListViewItem * selected = themesView_->selectedItem();
|
|
|
|
if ( !selected )
|
|
|
|
if ( !selected )
|
|
|
|
return ;
|
|
|
|
return ;
|
|
|
|
|
|
|
|
|
|
|
|
QString question = i18n( "<qt>Are you sure you want to remove the "
|
|
|
|
TQString question = i18n( "<qt>Are you sure you want to remove the "
|
|
|
|
"<strong>%1</strong> theme?<br>"
|
|
|
|
"<strong>%1</strong> theme?<br>"
|
|
|
|
"<br>"
|
|
|
|
"<br>"
|
|
|
|
"This will delete the files installed by this theme.</qt>" ).
|
|
|
|
"This will delete the files installed by this theme.</qt>" ).
|
|
|
@ -336,9 +336,9 @@ void IconThemesConfig::removeSelectedTheme()
|
|
|
|
int r = KMessageBox::warningContinueCancel( parent_, question, i18n( "Confirmation" ), KStdGuiItem::del() );
|
|
|
|
int r = KMessageBox::warningContinueCancel( parent_, question, i18n( "Confirmation" ), KStdGuiItem::del() );
|
|
|
|
if ( r != KMessageBox::Continue ) return ;
|
|
|
|
if ( r != KMessageBox::Continue ) return ;
|
|
|
|
|
|
|
|
|
|
|
|
QString delTheme = selected->text( 0 );
|
|
|
|
TQString delTheme = selected->text( 0 );
|
|
|
|
QString deldirStr = QDir::homeDirPath() + "/.kde/share/apps/deKorator/themes/" + delTheme;
|
|
|
|
TQString deldirStr = TQDir::homeDirPath() + "/.kde/share/apps/deKorator/themes/" + delTheme;
|
|
|
|
QDir dir = QDir( deldirStr );
|
|
|
|
TQDir dir = TQDir( deldirStr );
|
|
|
|
dir.rename( deldirStr, deldirStr + "del" );
|
|
|
|
dir.rename( deldirStr, deldirStr + "del" );
|
|
|
|
|
|
|
|
|
|
|
|
KIO::del( KURL( deldirStr + "del" ) );
|
|
|
|
KIO::del( KURL( deldirStr + "del" ) );
|
|
|
@ -351,25 +351,25 @@ void IconThemesConfig::removeSelectedTheme()
|
|
|
|
// ----------
|
|
|
|
// ----------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
void IconThemesConfig::themeSelected( QListViewItem *item, QLabel *previewLabel, QPushButton *btn )
|
|
|
|
void IconThemesConfig::themeSelected( TQListViewItem *item, TQLabel *previewLabel, TQPushButton *btn )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QPixmap previewPix, topLeftCornerBg, leftButtonsBg, leftTitleBg, midTitleBg, rightTitleBg, rightButtonsBg, topRightCornerBg;
|
|
|
|
TQPixmap previewPix, topLeftCornerBg, leftButtonsBg, leftTitleBg, midTitleBg, rightTitleBg, rightButtonsBg, topRightCornerBg;
|
|
|
|
QPainter painter;
|
|
|
|
TQPainter painter;
|
|
|
|
int w, h, x;
|
|
|
|
int w, h, x;
|
|
|
|
QString dirName( m_themeNames[ item->text( 0 ) ] );
|
|
|
|
TQString dirName( m_themeNames[ item->text( 0 ) ] );
|
|
|
|
|
|
|
|
|
|
|
|
if ( dirName.contains( "home" ) )
|
|
|
|
if ( dirName.contains( "home" ) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//qWarning("true");
|
|
|
|
//tqWarning("true");
|
|
|
|
btn->setEnabled( true );
|
|
|
|
btn->setEnabled( true );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
btn->setEnabled( false );
|
|
|
|
btn->setEnabled( false );
|
|
|
|
//qWarning("false");
|
|
|
|
//tqWarning("false");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QString dirNameStr = dirName + item->text( 0 ) + "/deco/" ;
|
|
|
|
TQString dirNameStr = dirName + item->text( 0 ) + "/deco/" ;
|
|
|
|
topLeftCornerBg.load( dirNameStr + "topLeftCornerBg.png" );
|
|
|
|
topLeftCornerBg.load( dirNameStr + "topLeftCornerBg.png" );
|
|
|
|
leftButtonsBg.load( dirNameStr + "leftButtonsBg" );
|
|
|
|
leftButtonsBg.load( dirNameStr + "leftButtonsBg" );
|
|
|
|
leftTitleBg.load( dirNameStr + "leftTitleBg.png" );
|
|
|
|
leftTitleBg.load( dirNameStr + "leftTitleBg.png" );
|
|
|
@ -381,23 +381,23 @@ void IconThemesConfig::themeSelected( QListViewItem *item, QLabel *previewLabel,
|
|
|
|
w = topLeftCornerBg.width() + leftButtonsBg.width() + leftTitleBg.width() + midTitleBg.width() + rightTitleBg.width() + rightButtonsBg.width() + topRightCornerBg.width() + 8;
|
|
|
|
w = topLeftCornerBg.width() + leftButtonsBg.width() + leftTitleBg.width() + midTitleBg.width() + rightTitleBg.width() + rightButtonsBg.width() + topRightCornerBg.width() + 8;
|
|
|
|
h = midTitleBg.height() + 8;
|
|
|
|
h = midTitleBg.height() + 8;
|
|
|
|
previewPix.resize( w, h );
|
|
|
|
previewPix.resize( w, h );
|
|
|
|
//qWarning("%d",w);
|
|
|
|
//tqWarning("%d",w);
|
|
|
|
painter.begin( &previewPix );
|
|
|
|
painter.begin( &previewPix );
|
|
|
|
|
|
|
|
|
|
|
|
// paint outer rect
|
|
|
|
// paint outer rect
|
|
|
|
painter.fillRect( 0, 0, w, h, QColor( 20, 20, 20 ) );
|
|
|
|
painter.fillRect( 0, 0, w, h, TQColor( 20, 20, 20 ) );
|
|
|
|
|
|
|
|
|
|
|
|
painter.setPen( QColor( 60, 60, 60 ) );
|
|
|
|
painter.setPen( TQColor( 60, 60, 60 ) );
|
|
|
|
painter.drawRect( 0, 0, w , h );
|
|
|
|
painter.drawRect( 0, 0, w , h );
|
|
|
|
|
|
|
|
|
|
|
|
painter.setPen( QColor( 80, 80, 80 ) );
|
|
|
|
painter.setPen( TQColor( 80, 80, 80 ) );
|
|
|
|
painter.drawRect( 1, 1, w - 2 , h - 2 );
|
|
|
|
painter.drawRect( 1, 1, w - 2 , h - 2 );
|
|
|
|
|
|
|
|
|
|
|
|
painter.setPen( QColor( 180, 180, 180 ) );
|
|
|
|
painter.setPen( TQColor( 180, 180, 180 ) );
|
|
|
|
painter.drawLine( w - 1, 1, w - 1, h - 1 );
|
|
|
|
painter.drawLine( w - 1, 1, w - 1, h - 1 );
|
|
|
|
painter.drawLine( 1, h - 1, w - 2, h - 1 );
|
|
|
|
painter.drawLine( 1, h - 1, w - 2, h - 1 );
|
|
|
|
|
|
|
|
|
|
|
|
painter.setPen( QColor( 150, 150, 150 ) );
|
|
|
|
painter.setPen( TQColor( 150, 150, 150 ) );
|
|
|
|
painter.drawLine( w - 2, 2, w - 2, h - 2 );
|
|
|
|
painter.drawLine( w - 2, 2, w - 2, h - 2 );
|
|
|
|
painter.drawLine( 2, h - 2, w - 3, h - 2 );
|
|
|
|
painter.drawLine( 2, h - 2, w - 3, h - 2 );
|
|
|
|
|
|
|
|
|
|
|
@ -424,7 +424,7 @@ void IconThemesConfig::themeSelected( QListViewItem *item, QLabel *previewLabel,
|
|
|
|
x += rightButtonsBg.width();
|
|
|
|
x += rightButtonsBg.width();
|
|
|
|
painter.drawPixmap( x, 4, topRightCornerBg );
|
|
|
|
painter.drawPixmap( x, 4, topRightCornerBg );
|
|
|
|
|
|
|
|
|
|
|
|
painter.setPen( QColor( 0, 0, 0 ) );
|
|
|
|
painter.setPen( TQColor( 0, 0, 0 ) );
|
|
|
|
painter.drawLine( 4, h - 5, w - 4 , h - 5 );
|
|
|
|
painter.drawLine( 4, h - 5, w - 4 , h - 5 );
|
|
|
|
|
|
|
|
|
|
|
|
painter.end();
|
|
|
|
painter.end();
|
|
|
@ -440,14 +440,14 @@ void IconThemesConfig::themeSelected( QListViewItem *item, QLabel *previewLabel,
|
|
|
|
|
|
|
|
|
|
|
|
void IconThemesConfig::setTheme( KURLRequester *framesPath, KURLRequester *buttonsPath, KURLRequester *masksPath )
|
|
|
|
void IconThemesConfig::setTheme( KURLRequester *framesPath, KURLRequester *buttonsPath, KURLRequester *masksPath )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QListViewItem * selected = themesView_->selectedItem();
|
|
|
|
TQListViewItem * selected = themesView_->selectedItem();
|
|
|
|
if ( !selected )
|
|
|
|
if ( !selected )
|
|
|
|
return ;
|
|
|
|
return ;
|
|
|
|
|
|
|
|
|
|
|
|
QString dirName( m_themeNames[ selected->text( 0 ) ] );
|
|
|
|
TQString dirName( m_themeNames[ selected->text( 0 ) ] );
|
|
|
|
|
|
|
|
|
|
|
|
QString setTheme = selected->text( 0 );
|
|
|
|
TQString setTheme = selected->text( 0 );
|
|
|
|
QString setThemeStr = dirName + setTheme;
|
|
|
|
TQString setThemeStr = dirName + setTheme;
|
|
|
|
|
|
|
|
|
|
|
|
framesPath->setURL( setThemeStr + "/deco" );
|
|
|
|
framesPath->setURL( setThemeStr + "/deco" );
|
|
|
|
buttonsPath->setURL( setThemeStr + "/buttons" );
|
|
|
|
buttonsPath->setURL( setThemeStr + "/buttons" );
|
|
|
|