|
|
|
@ -67,13 +67,18 @@ KDMThemeWidget::KDMThemeWidget( TQWidget *parent, const char *name, const TQStri
|
|
|
|
|
ml->setSpacing( KDialog::spacingHint() );
|
|
|
|
|
ml->setMargin( KDialog::marginHint() );
|
|
|
|
|
|
|
|
|
|
sakWarning = new TQLabel( this );
|
|
|
|
|
sakWarning->setText( i18n( "Theming is not available due to enabled Secure Attention Key (SAK) support" ) );
|
|
|
|
|
ml->addMultiCellWidget( sakWarning, 0, 0, 0, 2 );
|
|
|
|
|
sakWarning->hide();
|
|
|
|
|
|
|
|
|
|
cUseTheme = new TQCheckBox( this );
|
|
|
|
|
cUseTheme->setText( i18n( "En&able KDM Themes" ) );
|
|
|
|
|
ml->addMultiCellWidget( cUseTheme, 0, 0, 0, 2 );
|
|
|
|
|
|
|
|
|
|
themeWidget = new TQListView( this );
|
|
|
|
|
themeWidget->addColumn( i18n( "Theme" ) );
|
|
|
|
|
themeWidget->addColumn( i18n( "Author" ) );
|
|
|
|
|
themeWidget->addColumn( i18n( "Theme" ) );
|
|
|
|
|
themeWidget->addColumn( i18n( "Author" ) );
|
|
|
|
|
themeWidget->setAllColumnsShowFocus( true );
|
|
|
|
|
themeWidget->setShowSortIndicator( true );
|
|
|
|
|
themeWidget->setRootIsDecorated( false );
|
|
|
|
@ -91,7 +96,7 @@ KDMThemeWidget::KDMThemeWidget( TQWidget *parent, const char *name, const TQStri
|
|
|
|
|
|
|
|
|
|
info = new TQLabel( this );
|
|
|
|
|
info->setMaximumWidth( 200 );
|
|
|
|
|
info->tqsetAlignment( int( TQLabel::AlignTop | TQLabel::WordBreak) );
|
|
|
|
|
info->setAlignment( int( TQLabel::AlignTop | TQLabel::WordBreak) );
|
|
|
|
|
TQWhatsThis::add(info, i18n("This contains information about the selected theme.") );
|
|
|
|
|
|
|
|
|
|
ml->addMultiCellWidget( info, 3, 4, 2, 2 );
|
|
|
|
@ -147,7 +152,10 @@ void KDMThemeWidget::selectTheme( const TQString &path )
|
|
|
|
|
|
|
|
|
|
void KDMThemeWidget::load()
|
|
|
|
|
{
|
|
|
|
|
TQString kdmrc = KGlobal::dirs()->findResource("config", "kdm/kdmrc");
|
|
|
|
|
TQString kdmrc = KGlobal::dirs()->findResource("config", "kdm/kdmdistrc");
|
|
|
|
|
if ( kdmrc.isEmpty() ) {
|
|
|
|
|
kdmrc = KGlobal::dirs()->findResource("config", "kdm/kdmrc");
|
|
|
|
|
}
|
|
|
|
|
if ( kdmrc.isEmpty() ) {
|
|
|
|
|
kdError() << "Failed to find kdm resource file kdmrc!" << endl;
|
|
|
|
|
|
|
|
|
@ -161,6 +169,30 @@ void KDMThemeWidget::load()
|
|
|
|
|
|
|
|
|
|
delete config;
|
|
|
|
|
config = new KConfig( kdmrc );
|
|
|
|
|
|
|
|
|
|
config->setGroup( "X-*-Greeter" );
|
|
|
|
|
bool sakEnabled = config->readBoolEntry( "UseSAK", true );
|
|
|
|
|
if (sakEnabled) {
|
|
|
|
|
// FIXME
|
|
|
|
|
// Integrate KDE_BINDIR with Autotools and use this line instead of the one below it...
|
|
|
|
|
// if (system(KDE_BINDIR "/tsak checkdeps") != 0) {
|
|
|
|
|
if (system("tsak checkdeps") != 0) {
|
|
|
|
|
sakEnabled = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (sakEnabled) {
|
|
|
|
|
cUseTheme->hide();
|
|
|
|
|
sakWarning->show();
|
|
|
|
|
cUseTheme->setEnabled(false);
|
|
|
|
|
setReadOnly(true);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
sakWarning->hide();
|
|
|
|
|
cUseTheme->show();
|
|
|
|
|
cUseTheme->setEnabled(true);
|
|
|
|
|
setReadOnly(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
config->setGroup( "X-*-Greeter" );
|
|
|
|
|
cUseTheme->setChecked( config->readBoolEntry( "UseTheme", false ) );
|
|
|
|
|
|
|
|
|
@ -190,6 +222,9 @@ void KDMThemeWidget::toggleUseTheme(bool useTheme) {
|
|
|
|
|
|
|
|
|
|
void KDMThemeWidget::setReadOnly(bool ro)
|
|
|
|
|
{
|
|
|
|
|
if (!cUseTheme->isEnabled()) {
|
|
|
|
|
ro = true;
|
|
|
|
|
}
|
|
|
|
|
themeWidget->setEnabled( ro );
|
|
|
|
|
bInstallTheme->setEnabled( ro );
|
|
|
|
|
bRemoveTheme->setEnabled( ro );
|
|
|
|
@ -233,16 +268,22 @@ void KDMThemeWidget::insertTheme( const TQString &_theme )
|
|
|
|
|
|
|
|
|
|
void KDMThemeWidget::updateInfoView( ThemeData *theme )
|
|
|
|
|
{
|
|
|
|
|
info->setText(
|
|
|
|
|
((theme->copyright.length() > 0) ?
|
|
|
|
|
i18n("<qt><strong>Copyright:</strong> %1<br/></qt>",
|
|
|
|
|
theme->copyright) : "") +
|
|
|
|
|
((theme->description.length() > 0) ?
|
|
|
|
|
i18n("<qt><strong>Description:</strong> %1</qt>",
|
|
|
|
|
theme->description) : "") );
|
|
|
|
|
preview->setPixmap( theme->path + '/' + theme->screenShot );
|
|
|
|
|
preview->setText( theme->screenShot.isEmpty() ?
|
|
|
|
|
"Screenshot not available" : TQString() );
|
|
|
|
|
if(theme) {
|
|
|
|
|
info->setText(
|
|
|
|
|
((theme->copyright.length() > 0) ?
|
|
|
|
|
i18n("<qt><strong>Copyright:</strong> %1<br/></qt>",
|
|
|
|
|
theme->copyright) : "") +
|
|
|
|
|
((theme->description.length() > 0) ?
|
|
|
|
|
i18n("<qt><strong>Description:</strong> %1</qt>",
|
|
|
|
|
theme->description) : "") );
|
|
|
|
|
preview->setPixmap( theme->path + '/' + theme->screenShot );
|
|
|
|
|
preview->setText( theme->screenShot.isEmpty() ?
|
|
|
|
|
i18n("Screenshot not available") : TQString() );
|
|
|
|
|
} else {
|
|
|
|
|
info->setText(i18n("No theme selected."));
|
|
|
|
|
preview->setPixmap(NULL);
|
|
|
|
|
preview->setText(i18n("Screenshot not available"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KDMThemeWidget::installNewTheme()
|
|
|
|
|