diff options
Diffstat (limited to 'kcontrol/kthememanager')
-rw-r--r-- | kcontrol/kthememanager/knewthemedlg.cpp | 30 | ||||
-rw-r--r-- | kcontrol/kthememanager/knewthemedlg.h | 28 | ||||
-rw-r--r-- | kcontrol/kthememanager/ktheme.cpp | 294 | ||||
-rw-r--r-- | kcontrol/kthememanager/ktheme.h | 86 | ||||
-rw-r--r-- | kcontrol/kthememanager/kthemedlg.ui.h | 2 | ||||
-rw-r--r-- | kcontrol/kthememanager/kthememanager.cpp | 120 | ||||
-rw-r--r-- | kcontrol/kthememanager/kthememanager.h | 18 |
7 files changed, 289 insertions, 289 deletions
diff --git a/kcontrol/kthememanager/knewthemedlg.cpp b/kcontrol/kthememanager/knewthemedlg.cpp index 1514ed453..8ba59b680 100644 --- a/kcontrol/kthememanager/knewthemedlg.cpp +++ b/kcontrol/kthememanager/knewthemedlg.cpp @@ -19,17 +19,17 @@ #include "knewthemedlg.h" #include "newthemewidget.h" -#include <qlineedit.h> -#include <qtextedit.h> +#include <tqlineedit.h> +#include <tqtextedit.h> #include <klocale.h> -KNewThemeDlg::KNewThemeDlg( QWidget * parent, const char * name ) +KNewThemeDlg::KNewThemeDlg( TQWidget * parent, const char * name ) : KDialogBase(parent, name, true, i18n("New Theme"), Ok|Cancel, Ok) { m_base = new NewThemeWidget( this, "new_theme_base" ); setMainWidget( m_base ); - connect( m_base->leName, SIGNAL( textChanged ( const QString & ) ), this, SLOT( slotThemeNameChanged( const QString & ) ) ); + connect( m_base->leName, TQT_SIGNAL( textChanged ( const TQString & ) ), this, TQT_SLOT( slotThemeNameChanged( const TQString & ) ) ); slotThemeNameChanged( m_base->leName->text() ); } @@ -38,57 +38,57 @@ KNewThemeDlg::~KNewThemeDlg() delete m_base; } -void KNewThemeDlg::slotThemeNameChanged( const QString &_text ) +void KNewThemeDlg::slotThemeNameChanged( const TQString &_text ) { enableButtonOK( !_text.isEmpty() ); } -QString KNewThemeDlg::getName() const +TQString KNewThemeDlg::getName() const { return m_base->leName->text(); } -QString KNewThemeDlg::getAuthor() const +TQString KNewThemeDlg::getAuthor() const { return m_base->leAuthor->text(); } -QString KNewThemeDlg::getEmail() const +TQString KNewThemeDlg::getEmail() const { return m_base->leEmail->text(); } -QString KNewThemeDlg::getHomepage() const +TQString KNewThemeDlg::getHomepage() const { return m_base->leHomepage->text(); } -QString KNewThemeDlg::getComment() const +TQString KNewThemeDlg::getComment() const { return m_base->teComment->text(); } -QString KNewThemeDlg::getVersion() const +TQString KNewThemeDlg::getVersion() const { return m_base->leVersion->text(); } -void KNewThemeDlg::setAuthor( const QString & author ) +void KNewThemeDlg::setAuthor( const TQString & author ) { m_base->leAuthor->setText( author ); } -void KNewThemeDlg::setEmail( const QString & email ) +void KNewThemeDlg::setEmail( const TQString & email ) { m_base->leEmail->setText( email ); } -void KNewThemeDlg::setVersion( const QString & version ) +void KNewThemeDlg::setVersion( const TQString & version ) { m_base->leVersion->setText( version ); } -void KNewThemeDlg::setName( const QString & name ) +void KNewThemeDlg::setName( const TQString & name ) { m_base->leName->setText( name ); } diff --git a/kcontrol/kthememanager/knewthemedlg.h b/kcontrol/kthememanager/knewthemedlg.h index 52fd0816f..5a0df045a 100644 --- a/kcontrol/kthememanager/knewthemedlg.h +++ b/kcontrol/kthememanager/knewthemedlg.h @@ -19,7 +19,7 @@ #ifndef KNEWTHEMEDLG_H #define KNEWTHEMEDLG_H -#include <qstring.h> +#include <tqstring.h> #include <kdialogbase.h> @@ -34,25 +34,25 @@ class KNewThemeDlg: public KDialogBase { Q_OBJECT public: - KNewThemeDlg( QWidget * parent = 0, const char * name = 0); + KNewThemeDlg( TQWidget * parent = 0, const char * name = 0); ~KNewThemeDlg(); - QString getName() const; - QString getAuthor() const; - QString getEmail() const; - QString getHomepage() const; - QString getComment() const; - QString getVersion() const; - - void setName( const QString & name ); - void setAuthor( const QString & author ); - void setEmail( const QString & email ); - void setVersion( const QString & version ); + TQString getName() const; + TQString getAuthor() const; + TQString getEmail() const; + TQString getHomepage() const; + TQString getComment() const; + TQString getVersion() const; + + void setName( const TQString & name ); + void setAuthor( const TQString & author ); + void setEmail( const TQString & email ); + void setVersion( const TQString & version ); private: NewThemeWidget * m_base; private slots: - void slotThemeNameChanged( const QString &_text ); + void slotThemeNameChanged( const TQString &_text ); }; #endif diff --git a/kcontrol/kthememanager/ktheme.cpp b/kcontrol/kthememanager/ktheme.cpp index 241aac132..b78a354be 100644 --- a/kcontrol/kthememanager/ktheme.cpp +++ b/kcontrol/kthememanager/ktheme.cpp @@ -18,13 +18,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #include "ktheme.h" -#include <qfile.h> -#include <qfileinfo.h> -#include <qimage.h> -#include <qpixmap.h> -#include <qregexp.h> -#include <qtextstream.h> -#include <qdir.h> +#include <tqfile.h> +#include <tqfileinfo.h> +#include <tqimage.h> +#include <tqpixmap.h> +#include <tqregexp.h> +#include <tqtextstream.h> +#include <tqdir.h> #include <dcopclient.h> #include <kapplication.h> @@ -43,26 +43,26 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #include <ktar.h> #include <kstyle.h> -KTheme::KTheme( QWidget *parent, const QString & xmlFile ) +KTheme::KTheme( TQWidget *parent, const TQString & xmlFile ) : m_parent(parent) { - QFile file( xmlFile ); + TQFile file( xmlFile ); file.open( IO_ReadOnly ); m_dom.setContent( file.readAll() ); file.close(); //kdDebug() << m_dom.toString( 2 ) << endl; - setName( QFileInfo( file ).baseName() ); + setName( TQFileInfo( file ).baseName() ); m_kgd = KGlobal::dirs(); } -KTheme::KTheme( QWidget *parent, bool create ) +KTheme::KTheme( TQWidget *parent, bool create ) : m_parent(parent) { if ( create ) { - m_dom = QDomDocument( "ktheme" ); + m_dom = TQDomDocument( "ktheme" ); m_root = m_dom.createElement( "ktheme" ); m_root.setAttribute( "version", SYNTAX_VERSION ); @@ -79,7 +79,7 @@ KTheme::~KTheme() { } -void KTheme::setName( const QString & name ) +void KTheme::setName( const TQString & name ) { m_name = name; } @@ -88,24 +88,24 @@ bool KTheme::load( const KURL & url ) { kdDebug() << "Loading theme from URL: " << url << endl; - QString tmpFile; + TQString tmpFile; if ( !KIO::NetAccess::download( url, tmpFile, 0L ) ) return false; kdDebug() << "Theme is in temp file: " << tmpFile << endl; // set theme's name - setName( QFileInfo( url.fileName() ).baseName() ); + setName( TQFileInfo( url.fileName() ).baseName() ); // unpack the tarball - QString location = m_kgd->saveLocation( "themes", m_name + "/" ); + TQString location = m_kgd->saveLocation( "themes", m_name + "/" ); KTar tar( tmpFile ); tar.open( IO_ReadOnly ); tar.directory()->copyTo( location ); tar.close(); // create the DOM - QFile file( location + m_name + ".xml" ); + TQFile file( location + m_name + ".xml" ); file.open( IO_ReadOnly ); m_dom.setContent( file.readAll() ); file.close(); @@ -116,7 +116,7 @@ bool KTheme::load( const KURL & url ) return true; } -QString KTheme::createYourself( bool pack ) +TQString KTheme::createYourself( bool pack ) { // start with empty dir for orig theme if ( !pack ) @@ -137,35 +137,35 @@ QString KTheme::createYourself( bool pack ) for ( uint i=0; i < numDesktops-1; i++ ) { - QDomElement desktopElem = m_dom.createElement( "desktop" ); + TQDomElement desktopElem = m_dom.createElement( "desktop" ); desktopElem.setAttribute( "number", i ); desktopElem.setAttribute( "common", common ); - desktopConf.setGroup( "Desktop" + QString::number( i ) ); + desktopConf.setGroup( "Desktop" + TQString::number( i ) ); - QDomElement modeElem = m_dom.createElement( "mode" ); + TQDomElement modeElem = m_dom.createElement( "mode" ); modeElem.setAttribute( "id", desktopConf.readEntry( "BackgroundMode", "Flat" ) ); desktopElem.appendChild( modeElem ); - QDomElement c1Elem = m_dom.createElement( "color1" ); + TQDomElement c1Elem = m_dom.createElement( "color1" ); c1Elem.setAttribute( "rgb", desktopConf.readColorEntry( "Color1" ).name() ); desktopElem.appendChild( c1Elem ); - QDomElement c2Elem = m_dom.createElement( "color2" ); + TQDomElement c2Elem = m_dom.createElement( "color2" ); c2Elem.setAttribute( "rgb", desktopConf.readColorEntry( "Color2" ).name() ); desktopElem.appendChild( c2Elem ); - QDomElement blendElem = m_dom.createElement( "blending" ); - blendElem.setAttribute( "mode", desktopConf.readEntry( "BlendMode", QString( "NoBlending" ) ) ); - blendElem.setAttribute( "balance", desktopConf.readEntry( "BlendBalance", QString::number( 100 ) ) ); + TQDomElement blendElem = m_dom.createElement( "blending" ); + blendElem.setAttribute( "mode", desktopConf.readEntry( "BlendMode", TQString( "NoBlending" ) ) ); + blendElem.setAttribute( "balance", desktopConf.readEntry( "BlendBalance", TQString::number( 100 ) ) ); blendElem.setAttribute( "reverse", desktopConf.readBoolEntry( "ReverseBlending", false ) ); desktopElem.appendChild( blendElem ); - QDomElement patElem = m_dom.createElement( "pattern" ); + TQDomElement patElem = m_dom.createElement( "pattern" ); patElem.setAttribute( "name", desktopConf.readEntry( "Pattern" ) ); desktopElem.appendChild( patElem ); - QDomElement wallElem = m_dom.createElement( "wallpaper" ); + TQDomElement wallElem = m_dom.createElement( "wallpaper" ); wallElem.setAttribute( "url", processFilePath( "desktop", desktopConf.readPathEntry( "Wallpaper" ) ) ); wallElem.setAttribute( "mode", desktopConf.readEntry( "WallpaperMode" ) ); desktopElem.appendChild( wallElem ); @@ -180,13 +180,13 @@ QString KTheme::createYourself( bool pack ) // 11. Screensaver desktopConf.setGroup( "ScreenSaver" ); - QDomElement saverElem = m_dom.createElement( "screensaver" ); + TQDomElement saverElem = m_dom.createElement( "screensaver" ); saverElem.setAttribute( "name", desktopConf.readEntry( "Saver" ) ); m_root.appendChild( saverElem ); // 3. Icons globalConf->setGroup( "Icons" ); - QDomElement iconElem = m_dom.createElement( "icons" ); + TQDomElement iconElem = m_dom.createElement( "icons" ); iconElem.setAttribute( "name", globalConf->readEntry( "Theme",KIconTheme::current() ) ); createIconElems( "DesktopIcons", "desktop", iconElem, globalConf ); createIconElems( "MainToolbarIcons", "mainToolbar", iconElem, globalConf ); @@ -198,7 +198,7 @@ QString KTheme::createYourself( bool pack ) // 4. Sounds // 4.1 Global sounds KConfig * soundConf = new KConfig( "knotify.eventsrc", true ); - QStringList stdEvents; + TQStringList stdEvents; stdEvents << "cannotopenfile" << "catastrophe" << "exitkde" << "fatalerror" << "notification" << "printerror" << "startkde" << "warning" << "messageCritical" << "messageInformation" << "messageWarning" @@ -206,7 +206,7 @@ QString KTheme::createYourself( bool pack ) // 4.2 KWin sounds KConfig * kwinSoundConf = new KConfig( "kwin.eventsrc", true ); - QStringList kwinEvents; + TQStringList kwinEvents; kwinEvents << "activate" << "close" << "delete" << "desktop1" << "desktop2" << "desktop3" << "desktop4" << "desktop5" << "desktop6" << "desktop7" << "desktop8" << @@ -215,7 +215,7 @@ QString KTheme::createYourself( bool pack ) "resizeend" << "resizestart" << "shadedown" << "shadeup" << "transdelete" << "transnew" << "unmaximize" << "unminimize"; - QDomElement soundsElem = m_dom.createElement( "sounds" ); + TQDomElement soundsElem = m_dom.createElement( "sounds" ); createSoundList( stdEvents, "global", soundsElem, soundConf ); createSoundList( kwinEvents, "kwin", soundsElem, kwinSoundConf ); m_root.appendChild( soundsElem ); @@ -224,24 +224,24 @@ QString KTheme::createYourself( bool pack ) // 5. Colors - QDomElement colorsElem = m_dom.createElement( "colors" ); + TQDomElement colorsElem = m_dom.createElement( "colors" ); globalConf->setGroup( "KDE" ); colorsElem.setAttribute( "contrast", globalConf->readNumEntry( "contrast", 7 ) ); - QStringList stdColors; + TQStringList stdColors; stdColors << "background" << "selectBackground" << "foreground" << "windowForeground" << "windowBackground" << "selectForeground" << "buttonBackground" << "buttonForeground" << "linkColor" << "visitedLinkColor" << "alternateBackground"; globalConf->setGroup( "General" ); - for ( QStringList::Iterator it = stdColors.begin(); it != stdColors.end(); ++it ) + for ( TQStringList::Iterator it = stdColors.begin(); it != stdColors.end(); ++it ) createColorElem( ( *it ), "global", colorsElem, globalConf ); - QStringList kwinColors; + TQStringList kwinColors; kwinColors << "activeForeground" << "inactiveBackground" << "inactiveBlend" << "activeBackground" << "activeBlend" << "inactiveForeground" << "activeTitleBtnBg" << "inactiveTitleBtnBg" << "frame" << "inactiveFrame" << "handle" << "inactiveHandle"; globalConf->setGroup( "WM" ); - for ( QStringList::Iterator it = kwinColors.begin(); it != kwinColors.end(); ++it ) + for ( TQStringList::Iterator it = kwinColors.begin(); it != kwinColors.end(); ++it ) createColorElem( ( *it ), "kwin", colorsElem, globalConf ); m_root.appendChild( colorsElem ); @@ -249,7 +249,7 @@ QString KTheme::createYourself( bool pack ) // 6. Cursors KConfig* mouseConf = new KConfig( "kcminputrc", true ); mouseConf->setGroup( "Mouse" ); - QDomElement cursorsElem = m_dom.createElement( "cursors" ); + TQDomElement cursorsElem = m_dom.createElement( "cursors" ); cursorsElem.setAttribute( "name", mouseConf->readEntry( "cursorTheme" ) ); m_root.appendChild( cursorsElem ); delete mouseConf; @@ -257,17 +257,17 @@ QString KTheme::createYourself( bool pack ) // 7. KWin kwinConf.setGroup( "Style" ); - QDomElement wmElem = m_dom.createElement( "wm" ); + TQDomElement wmElem = m_dom.createElement( "wm" ); wmElem.setAttribute( "name", kwinConf.readEntry( "PluginLib" ) ); wmElem.setAttribute( "type", "builtin" ); // TODO support pixmap themes when the kwin client gets ported if ( kwinConf.readBoolEntry( "CustomButtonPositions" ) ) { - QDomElement buttonsElem = m_dom.createElement( "buttons" ); + TQDomElement buttonsElem = m_dom.createElement( "buttons" ); buttonsElem.setAttribute( "left", kwinConf.readEntry( "ButtonsOnLeft" ) ); buttonsElem.setAttribute( "right", kwinConf.readEntry( "ButtonsOnRight" ) ); wmElem.appendChild( buttonsElem ); } - QDomElement borderElem = m_dom.createElement( "border" ); + TQDomElement borderElem = m_dom.createElement( "border" ); borderElem.setAttribute( "size", kwinConf.readNumEntry( "BorderSize", 1 ) ); wmElem.appendChild( borderElem ); m_root.appendChild( wmElem ); @@ -275,12 +275,12 @@ QString KTheme::createYourself( bool pack ) // 8. Konqueror KConfig konqConf( "konquerorrc", true ); konqConf.setGroup( "Settings" ); - QDomElement konqElem = m_dom.createElement( "konqueror" ); - QDomElement konqWallElem = m_dom.createElement( "wallpaper" ); - QString bgImagePath = konqConf.readPathEntry( "BgImage" ); + TQDomElement konqElem = m_dom.createElement( "konqueror" ); + TQDomElement konqWallElem = m_dom.createElement( "wallpaper" ); + TQString bgImagePath = konqConf.readPathEntry( "BgImage" ); konqWallElem.setAttribute( "url", processFilePath( "konqueror", bgImagePath ) ); konqElem.appendChild( konqWallElem ); - QDomElement konqBgColorElem = m_dom.createElement( "bgcolor" ); + TQDomElement konqBgColorElem = m_dom.createElement( "bgcolor" ); konqBgColorElem.setAttribute( "rgb", konqConf.readColorEntry( "BgColor" ).name() ); konqElem.appendChild( konqBgColorElem ); m_root.appendChild( konqElem ); @@ -289,31 +289,31 @@ QString KTheme::createYourself( bool pack ) KConfig kickerConf( "kickerrc", true ); kickerConf.setGroup( "General" ); - QDomElement panelElem = m_dom.createElement( "panel" ); + TQDomElement panelElem = m_dom.createElement( "panel" ); if ( kickerConf.readBoolEntry( "UseBackgroundTheme" ) ) { - QDomElement backElem = m_dom.createElement( "background" ); - QString kbgPath = kickerConf.readPathEntry( "BackgroundTheme" ); + TQDomElement backElem = m_dom.createElement( "background" ); + TQString kbgPath = kickerConf.readPathEntry( "BackgroundTheme" ); backElem.setAttribute( "url", processFilePath( "panel", kbgPath ) ); backElem.setAttribute( "colorize", kickerConf.readBoolEntry( "ColorizeBackground" ) ); panelElem.appendChild( backElem ); } - QDomElement transElem = m_dom.createElement( "transparent" ); + TQDomElement transElem = m_dom.createElement( "transparent" ); transElem.setAttribute( "value", kickerConf.readBoolEntry( "Transparent" ) ); panelElem.appendChild( transElem ); - QDomElement posElem = m_dom.createElement( "position" ); + TQDomElement posElem = m_dom.createElement( "position" ); posElem.setAttribute( "value", kickerConf.readEntry( "Position" ) ); panelElem.appendChild( posElem ); - QDomElement showLeftHideButtonElem = m_dom.createElement( "showlefthidebutton" ); + TQDomElement showLeftHideButtonElem = m_dom.createElement( "showlefthidebutton" ); showLeftHideButtonElem.setAttribute( "value", kickerConf.readBoolEntry( "ShowLeftHideButton" ) ); panelElem.appendChild( showLeftHideButtonElem ); - QDomElement showRightHideButtonElem = m_dom.createElement( "showrighthidebutton" ); + TQDomElement showRightHideButtonElem = m_dom.createElement( "showrighthidebutton" ); showRightHideButtonElem.setAttribute( "value", kickerConf.readBoolEntry( "ShowRightHideButton" ) ); panelElem.appendChild( showRightHideButtonElem ); @@ -323,13 +323,13 @@ QString KTheme::createYourself( bool pack ) // 10. Widget style globalConf->setGroup( "General" ); - QDomElement widgetsElem = m_dom.createElement( "widgets" ); + TQDomElement widgetsElem = m_dom.createElement( "widgets" ); widgetsElem.setAttribute( "name", globalConf->readEntry( "widgetStyle",KStyle::defaultStyle() ) ); m_root.appendChild( widgetsElem ); // 12. - QDomElement fontsElem = m_dom.createElement( "fonts" ); - QStringList fonts; + TQDomElement fontsElem = m_dom.createElement( "fonts" ); + TQStringList fonts; fonts << "General" << "font" << "General" << "fixed" << "General" << "toolBarFont" @@ -338,10 +338,10 @@ QString KTheme::createYourself( bool pack ) << "General" << "taskbarFont" << "FMSettings" << "StandardFont"; - for ( QStringList::Iterator it = fonts.begin(); it != fonts.end(); ++it ) { - QString group = *it; ++it; - QString key = *it; - QString value; + for ( TQStringList::Iterator it = fonts.begin(); it != fonts.end(); ++it ) { + TQString group = *it; ++it; + TQString key = *it; + TQString value; if ( group == "FMSettings" ) { desktopConf.setGroup( group ); @@ -351,7 +351,7 @@ QString KTheme::createYourself( bool pack ) globalConf->setGroup( group ); value = globalConf->readEntry( key ); } - QDomElement fontElem = m_dom.createElement( key ); + TQDomElement fontElem = m_dom.createElement( key ); fontElem.setAttribute( "object", group ); fontElem.setAttribute( "value", value ); fontsElem.appendChild( fontElem ); @@ -359,14 +359,14 @@ QString KTheme::createYourself( bool pack ) m_root.appendChild( fontsElem ); // Save the XML - QFile file( m_kgd->saveLocation( "themes", m_name + "/" ) + m_name + ".xml" ); + TQFile file( m_kgd->saveLocation( "themes", m_name + "/" ) + m_name + ".xml" ); if ( file.open( IO_WriteOnly ) ) { - QTextStream stream( &file ); + TQTextStream stream( &file ); m_dom.save( stream, 2 ); file.close(); } - QString result; + TQString result; if ( pack ) { // Pack the whole theme @@ -375,7 +375,7 @@ QString KTheme::createYourself( bool pack ) kdDebug() << "Packing everything under: " << m_kgd->saveLocation( "themes", m_name + "/" ) << endl; - if ( tar.addLocalDirectory( m_kgd->saveLocation( "themes", m_name + "/" ), QString::null ) ) + if ( tar.addLocalDirectory( m_kgd->saveLocation( "themes", m_name + "/" ), TQString::null ) ) result = tar.fileName(); tar.close(); @@ -390,18 +390,18 @@ void KTheme::apply() { kdDebug() << "Going to apply theme: " << m_name << endl; - QString themeDir = m_kgd->findResourceDir( "themes", m_name + "/" + m_name + ".xml") + m_name + "/"; + TQString themeDir = m_kgd->findResourceDir( "themes", m_name + "/" + m_name + ".xml") + m_name + "/"; kdDebug() << "Theme dir: " << themeDir << endl; // 2. Background theme - QDomNodeList desktopList = m_dom.elementsByTagName( "desktop" ); + TQDomNodeList desktopList = m_dom.elementsByTagName( "desktop" ); KConfig desktopConf( "kdesktoprc" ); desktopConf.setGroup( "Background Common" ); for ( uint i = 0; i <= desktopList.count(); i++ ) { - QDomElement desktopElem = desktopList.item( i ).toElement(); + TQDomElement desktopElem = desktopList.item( i ).toElement(); if ( !desktopElem.isNull() ) { // TODO optimize, don't write several times the common section @@ -409,10 +409,10 @@ void KTheme::apply() desktopConf.writeEntry( "CommonDesktop", common ); desktopConf.writeEntry( "DeskNum", desktopElem.attribute( "number", "0" ).toUInt() ); - desktopConf.setGroup( QString( "Desktop%1" ).arg( i ) ); + desktopConf.setGroup( TQString( "Desktop%1" ).arg( i ) ); desktopConf.writeEntry( "BackgroundMode", getProperty( desktopElem, "mode", "id" ) ); - desktopConf.writeEntry( "Color1", QColor( getProperty( desktopElem, "color1", "rgb" ) ) ); - desktopConf.writeEntry( "Color2", QColor( getProperty( desktopElem, "color2", "rgb" ) ) ); + desktopConf.writeEntry( "Color1", TQColor( getProperty( desktopElem, "color1", "rgb" ) ) ); + desktopConf.writeEntry( "Color2", TQColor( getProperty( desktopElem, "color2", "rgb" ) ) ); desktopConf.writeEntry( "BlendMode", getProperty( desktopElem, "blending", "mode" ) ); desktopConf.writeEntry( "BlendBalance", getProperty( desktopElem, "blending", "balance" ) ); desktopConf.writeEntry( "ReverseBlending", @@ -428,7 +428,7 @@ void KTheme::apply() } // 11. Screensaver - QDomElement saverElem = m_dom.elementsByTagName( "screensaver" ).item( 0 ).toElement(); + TQDomElement saverElem = m_dom.elementsByTagName( "screensaver" ).item( 0 ).toElement(); if ( !saverElem.isNull() ) { @@ -445,18 +445,18 @@ void KTheme::apply() // FIXME Xinerama // 3. Icons - QDomElement iconElem = m_dom.elementsByTagName( "icons" ).item( 0 ).toElement(); + TQDomElement iconElem = m_dom.elementsByTagName( "icons" ).item( 0 ).toElement(); if ( !iconElem.isNull() ) { KConfig * iconConf = KGlobal::config(); iconConf->setGroup( "Icons" ); iconConf->writeEntry( "Theme", iconElem.attribute( "name", "crystalsvg" ), true, true ); - QDomNodeList iconList = iconElem.childNodes(); + TQDomNodeList iconList = iconElem.childNodes(); for ( uint i = 0; i < iconList.count(); i++ ) { - QDomElement iconSubElem = iconList.item( i ).toElement(); - QString object = iconSubElem.attribute( "object" ); + TQDomElement iconSubElem = iconList.item( i ).toElement(); + TQString object = iconSubElem.attribute( "object" ); if ( object == "desktop" ) iconConf->setGroup( "DesktopIcons" ); else if ( object == "mainToolbar" ) @@ -468,10 +468,10 @@ void KTheme::apply() else if ( object == "toolbar" ) iconConf->setGroup( "ToolbarIcons" ); - QString iconName = iconSubElem.tagName(); + TQString iconName = iconSubElem.tagName(); if ( iconName.contains( "Color" ) ) { - QColor iconColor = QColor( iconSubElem.attribute( "rgb" ) ); + TQColor iconColor = TQColor( iconSubElem.attribute( "rgb" ) ); iconConf->writeEntry( iconName, iconColor, true, true ); } else if ( iconName.contains( "Value" ) || iconName == "Size" ) @@ -489,16 +489,16 @@ void KTheme::apply() } // 4. Sounds - QDomElement soundsElem = m_dom.elementsByTagName( "sounds" ).item( 0 ).toElement(); + TQDomElement soundsElem = m_dom.elementsByTagName( "sounds" ).item( 0 ).toElement(); if ( !soundsElem.isNull() ) { KConfig soundConf( "knotify.eventsrc" ); KConfig kwinSoundConf( "kwin.eventsrc" ); - QDomNodeList eventList = soundsElem.elementsByTagName( "event" ); + TQDomNodeList eventList = soundsElem.elementsByTagName( "event" ); for ( uint i = 0; i < eventList.count(); i++ ) { - QDomElement eventElem = eventList.item( i ).toElement(); - QString object = eventElem.attribute( "object" ); + TQDomElement eventElem = eventList.item( i ).toElement(); + TQString object = eventElem.attribute( "object" ); if ( object == "global" ) { @@ -521,28 +521,28 @@ void KTheme::apply() } // 5. Colors - QDomElement colorsElem = m_dom.elementsByTagName( "colors" ).item( 0 ).toElement(); + TQDomElement colorsElem = m_dom.elementsByTagName( "colors" ).item( 0 ).toElement(); if ( !colorsElem.isNull() ) { - QDomNodeList colorList = colorsElem.childNodes(); + TQDomNodeList colorList = colorsElem.childNodes(); KConfig * colorConf = KGlobal::config(); - QString sCurrentScheme = locateLocal("data", "kdisplay/color-schemes/thememgr.kcsrc"); + TQString sCurrentScheme = locateLocal("data", "kdisplay/color-schemes/thememgr.kcsrc"); KSimpleConfig *colorScheme = new KSimpleConfig( sCurrentScheme ); colorScheme->setGroup("Color Scheme" ); for ( uint i = 0; i < colorList.count(); i++ ) { - QDomElement colorElem = colorList.item( i ).toElement(); - QString object = colorElem.attribute( "object" ); + TQDomElement colorElem = colorList.item( i ).toElement(); + TQString object = colorElem.attribute( "object" ); if ( object == "global" ) colorConf->setGroup( "General" ); else if ( object == "kwin" ) colorConf->setGroup( "WM" ); - QString colName = colorElem.tagName(); - QColor curColor = QColor( colorElem.attribute( "rgb" ) ); + TQString colName = colorElem.tagName(); + TQColor curColor = TQColor( colorElem.attribute( "rgb" ) ); colorConf->writeEntry( colName, curColor, true, true ); // kdeglobals colorScheme->writeEntry( colName, curColor ); // thememgr.kcsrc } @@ -558,7 +558,7 @@ void KTheme::apply() } // 6.Cursors - QDomElement cursorsElem = m_dom.elementsByTagName( "cursors" ).item( 0 ).toElement(); + TQDomElement cursorsElem = m_dom.elementsByTagName( "cursors" ).item( 0 ).toElement(); if ( !cursorsElem.isNull() ) { @@ -569,17 +569,17 @@ void KTheme::apply() } // 7. KWin - QDomElement wmElem = m_dom.elementsByTagName( "wm" ).item( 0 ).toElement(); + TQDomElement wmElem = m_dom.elementsByTagName( "wm" ).item( 0 ).toElement(); if ( !wmElem.isNull() ) { KConfig kwinConf( "kwinrc" ); kwinConf.setGroup( "Style" ); - QString type = wmElem.attribute( "type" ); + TQString type = wmElem.attribute( "type" ); if ( type == "builtin" ) kwinConf.writeEntry( "PluginLib", wmElem.attribute( "name" ) ); //else // TODO support custom themes - QDomNodeList buttons = wmElem.elementsByTagName ("buttons"); + TQDomNodeList buttons = wmElem.elementsByTagName ("buttons"); if ( buttons.count() > 0 ) { kwinConf.writeEntry( "CustomButtonPositions", true ); @@ -597,27 +597,27 @@ void KTheme::apply() } // 8. Konqueror - QDomElement konqElem = m_dom.elementsByTagName( "konqueror" ).item( 0 ).toElement(); + TQDomElement konqElem = m_dom.elementsByTagName( "konqueror" ).item( 0 ).toElement(); if ( !konqElem.isNull() ) { KConfig konqConf( "konquerorrc" ); konqConf.setGroup( "Settings" ); konqConf.writeEntry( "BgImage", unprocessFilePath( "konqueror", getProperty( konqElem, "wallpaper", "url" ) ) ); - konqConf.writeEntry( "BgColor", QColor( getProperty( konqElem, "bgcolor", "rgb" ) ) ); + konqConf.writeEntry( "BgColor", TQColor( getProperty( konqElem, "bgcolor", "rgb" ) ) ); konqConf.sync(); client->send("konqueror*", "KonquerorIface", "reparseConfiguration()", ""); // FIXME seems not to work :( } // 9. Kicker - QDomElement panelElem = m_dom.elementsByTagName( "panel" ).item( 0 ).toElement(); + TQDomElement panelElem = m_dom.elementsByTagName( "panel" ).item( 0 ).toElement(); if ( !panelElem.isNull() ) { KConfig kickerConf( "kickerrc" ); kickerConf.setGroup( "General" ); - QString kickerBgUrl = getProperty( panelElem, "background", "url" ); + TQString kickerBgUrl = getProperty( panelElem, "background", "url" ); if ( !kickerBgUrl.isEmpty() ) { kickerConf.writeEntry( "UseBackgroundTheme", true ); @@ -639,7 +639,7 @@ void KTheme::apply() } // 10. Widget style - QDomElement widgetsElem = m_dom.elementsByTagName( "widgets" ).item( 0 ).toElement(); + TQDomElement widgetsElem = m_dom.elementsByTagName( "widgets" ).item( 0 ).toElement(); if ( !widgetsElem.isNull() ) { @@ -651,20 +651,20 @@ void KTheme::apply() } // 12. Fonts - QDomElement fontsElem = m_dom.elementsByTagName( "fonts" ).item( 0 ).toElement(); + TQDomElement fontsElem = m_dom.elementsByTagName( "fonts" ).item( 0 ).toElement(); if ( !fontsElem.isNull() ) { KConfig * fontsConf = KGlobal::config(); - KConfig * kde1xConf = new KSimpleConfig( QDir::homeDirPath() + "/.kderc" ); + KConfig * kde1xConf = new KSimpleConfig( TQDir::homeDirPath() + "/.kderc" ); kde1xConf->setGroup( "General" ); - QDomNodeList fontList = fontsElem.childNodes(); + TQDomNodeList fontList = fontsElem.childNodes(); for ( uint i = 0; i < fontList.count(); i++ ) { - QDomElement fontElem = fontList.item( i ).toElement(); - QString fontName = fontElem.tagName(); - QString fontValue = fontElem.attribute( "value" ); - QString fontObject = fontElem.attribute( "object" ); + TQDomElement fontElem = fontList.item( i ).toElement(); + TQString fontName = fontElem.tagName(); + TQString fontValue = fontElem.attribute( "value" ); + TQString fontObject = fontElem.attribute( "object" ); if ( fontObject == "FMSettings" ) { desktopConf.setGroup( fontObject ); @@ -685,51 +685,51 @@ void KTheme::apply() } -bool KTheme::remove( const QString & name ) +bool KTheme::remove( const TQString & name ) { kdDebug() << "Going to remove theme: " << name << endl; return KIO::NetAccess::del( KGlobal::dirs()->saveLocation( "themes", name + "/" ), 0L ); } -void KTheme::setProperty( const QString & name, const QString & value, QDomElement parent ) +void KTheme::setProperty( const TQString & name, const TQString & value, TQDomElement parent ) { - QDomElement tmp = m_dom.createElement( name ); + TQDomElement tmp = m_dom.createElement( name ); tmp.setAttribute( "value", value ); parent.appendChild( tmp ); } -QString KTheme::getProperty( const QString & name ) const +TQString KTheme::getProperty( const TQString & name ) const { - QDomNodeList _list = m_dom.elementsByTagName( name ); + TQDomNodeList _list = m_dom.elementsByTagName( name ); if ( _list.count() != 0 ) return _list.item( 0 ).toElement().attribute( "value" ); else { kdWarning() << "Found no such property: " << name << endl; - return QString::null; + return TQString::null; } } -QString KTheme::getProperty( QDomElement parent, const QString & tag, - const QString & attr ) const +TQString KTheme::getProperty( TQDomElement parent, const TQString & tag, + const TQString & attr ) const { - QDomNodeList _list = parent.elementsByTagName( tag ); + TQDomNodeList _list = parent.elementsByTagName( tag ); if ( _list.count() != 0 ) return _list.item( 0 ).toElement().attribute( attr ); else { - kdWarning() << QString( "No such property found: %1->%2->%3" ) + kdWarning() << TQString( "No such property found: %1->%2->%3" ) .arg( parent.tagName() ).arg( tag ).arg( attr ) << endl; - return QString::null; + return TQString::null; } } -void KTheme::createIconElems( const QString & group, const QString & object, - QDomElement parent, KConfig * cfg ) +void KTheme::createIconElems( const TQString & group, const TQString & object, + TQDomElement parent, KConfig * cfg ) { cfg->setGroup( group ); - QStringList elemNames; + TQStringList elemNames; elemNames << "Animated" << "DoublePixels" << "Size" << "ActiveColor" << "ActiveColor2" << "ActiveEffect" << "ActiveSemiTransparent" << "ActiveValue" @@ -737,12 +737,12 @@ void KTheme::createIconElems( const QString & group, const QString & object, << "DefaultSemiTransparent" << "DefaultValue" << "DisabledColor" << "DisabledColor2" << "DisabledEffect" << "DisabledSemiTransparent" << "DisabledValue"; - for ( QStringList::ConstIterator it = elemNames.begin(); it != elemNames.end(); ++it ) { + for ( TQStringList::ConstIterator it = elemNames.begin(); it != elemNames.end(); ++it ) { if ( (*it).contains( "Color" ) ) createColorElem( *it, object, parent, cfg ); else { - QDomElement tmpCol = m_dom.createElement( *it ); + TQDomElement tmpCol = m_dom.createElement( *it ); tmpCol.setAttribute( "object", object ); if ( (*it).contains( "Value" ) || *it == "Size" ) @@ -758,33 +758,33 @@ void KTheme::createIconElems( const QString & group, const QString & object, } } -void KTheme::createColorElem( const QString & name, const QString & object, - QDomElement parent, KConfig * cfg ) +void KTheme::createColorElem( const TQString & name, const TQString & object, + TQDomElement parent, KConfig * cfg ) { - QColor color = cfg->readColorEntry( name ); + TQColor color = cfg->readColorEntry( name ); if ( color.isValid() ) { - QDomElement tmpCol = m_dom.createElement( name ); + TQDomElement tmpCol = m_dom.createElement( name ); tmpCol.setAttribute( "rgb", color.name() ); tmpCol.setAttribute( "object", object ); parent.appendChild( tmpCol ); } } -void KTheme::createSoundList( const QStringList & events, const QString & object, - QDomElement parent, KConfig * cfg ) +void KTheme::createSoundList( const TQStringList & events, const TQString & object, + TQDomElement parent, KConfig * cfg ) { - for ( QStringList::ConstIterator it = events.begin(); it != events.end(); ++it ) + for ( TQStringList::ConstIterator it = events.begin(); it != events.end(); ++it ) { - QString group = ( *it ); + TQString group = ( *it ); if ( cfg->hasGroup( group ) ) { cfg->setGroup( group ); - QString soundURL = cfg->readPathEntry( "soundfile" ); + TQString soundURL = cfg->readPathEntry( "soundfile" ); int pres = cfg->readNumEntry( "presentation", 0 ); if ( !soundURL.isEmpty() && ( ( pres & 1 ) == 1 ) ) { - QDomElement eventElem = m_dom.createElement( "event" ); + TQDomElement eventElem = m_dom.createElement( "event" ); eventElem.setAttribute( "object", object ); eventElem.setAttribute( "name", group ); eventElem.setAttribute( "url", processFilePath( "sounds", soundURL ) ); @@ -794,9 +794,9 @@ void KTheme::createSoundList( const QStringList & events, const QString & object } } -QString KTheme::processFilePath( const QString & section, const QString & path ) +TQString KTheme::processFilePath( const TQString & section, const TQString & path ) { - QFileInfo fi( path ); + TQFileInfo fi( path ); if ( fi.isRelative() ) fi.setFile( findResource( section, path ) ); @@ -826,60 +826,60 @@ QString KTheme::processFilePath( const QString & section, const QString & path ) else kdWarning() << "Unsupported theme resource type" << endl; - return QString::null; // an error occured or the resource doesn't exist + return TQString::null; // an error occured or the resource doesn't exist } -QString KTheme::unprocessFilePath( const QString & section, QString path ) +TQString KTheme::unprocessFilePath( const TQString & section, TQString path ) { if ( path.startsWith( "theme:/" ) ) - return path.replace( QRegExp( "^theme:/" ), m_kgd->findResourceDir( "themes", m_name + "/" + m_name + ".xml") + m_name + "/" ); + return path.replace( TQRegExp( "^theme:/" ), m_kgd->findResourceDir( "themes", m_name + "/" + m_name + ".xml") + m_name + "/" ); - if ( QFile::exists( path ) ) + if ( TQFile::exists( path ) ) return path; else // try to find it in the system return findResource( section, path ); } -void KTheme::setAuthor( const QString & author ) +void KTheme::setAuthor( const TQString & author ) { setProperty( "author", author, m_general ); } -void KTheme::setEmail( const QString & email ) +void KTheme::setEmail( const TQString & email ) { setProperty( "email", email, m_general ); } -void KTheme::setHomepage( const QString & homepage ) +void KTheme::setHomepage( const TQString & homepage ) { setProperty( "homepage", homepage, m_general ); } -void KTheme::setComment( const QString & comment ) +void KTheme::setComment( const TQString & comment ) { setProperty( "comment", comment, m_general ); } -void KTheme::setVersion( const QString & version ) +void KTheme::setVersion( const TQString & version ) { setProperty( "version", version, m_general ); } void KTheme::addPreview() { - QString file = m_kgd->saveLocation( "themes", m_name + "/" ) + m_name + ".preview.png"; + TQString file = m_kgd->saveLocation( "themes", m_name + "/" ) + m_name + ".preview.png"; kdDebug() << "Adding preview: " << file << endl; - QPixmap snapshot = QPixmap::grabWindow( qt_xrootwin() ); + TQPixmap snapshot = TQPixmap::grabWindow( qt_xrootwin() ); snapshot.save( file, "PNG" ); } -bool KTheme::copyFile( const QString & from, const QString & to ) +bool KTheme::copyFile( const TQString & from, const TQString & to ) { // we overwrite b/c of restoring the "original" theme return KIO::NetAccess::file_copy( from, to, -1, true /*overwrite*/ ); } -QString KTheme::findResource( const QString & section, const QString & path ) +TQString KTheme::findResource( const TQString & section, const TQString & path ) { if ( section == "desktop" ) return m_kgd->findResource( "wallpaper", path ); @@ -892,6 +892,6 @@ QString KTheme::findResource( const QString & section, const QString & path ) else { kdWarning() << "Requested unknown resource: " << section << endl; - return QString::null; + return TQString::null; } } diff --git a/kcontrol/kthememanager/ktheme.h b/kcontrol/kthememanager/ktheme.h index 1401b49e7..0ec3c94cf 100644 --- a/kcontrol/kthememanager/ktheme.h +++ b/kcontrol/kthememanager/ktheme.h @@ -19,11 +19,11 @@ #ifndef KTHEME_H #define KTHEME_H -#include <qdom.h> -#include <qguardedptr.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qwidget.h> +#include <tqdom.h> +#include <tqguardedptr.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqwidget.h> #include <kurl.h> @@ -47,14 +47,14 @@ public: * Constructs KTheme using an installed theme * @param xmlFile The theme's XML file */ - KTheme( QWidget *parent, const QString & xmlFile ); + KTheme( TQWidget *parent, const TQString & xmlFile ); /** * Constructs an empty theme, to be used with * #createYourself() * @param create Whether to start the DOM tree */ - KTheme( QWidget *parent, bool create = false ); + KTheme( TQWidget *parent, bool create = false ); /** * Destructor @@ -74,7 +74,7 @@ public: * @param pack Whether to also pack the theme in tar.gz format * @return The path to the newly created tarball with theme (if @p pack == true) */ - QString createYourself( bool pack = false ); + TQString createYourself( bool pack = false ); /** * Apply the theme to the system, ie. set the config variables and @@ -87,41 +87,41 @@ public: * @param name The name of the theme * @return true on success */ - static bool remove( const QString & name ); + static bool remove( const TQString & name ); /** * @return the theme name */ - QString name() const { return m_name; } + TQString name() const { return m_name; } /** * Set the theme name */ - void setName( const QString & name ); + void setName( const TQString & name ); - QString author() const { + TQString author() const { return getProperty( "author" ); } - void setAuthor( const QString & author ); + void setAuthor( const TQString & author ); - QString email() const { + TQString email() const { return getProperty( "email" ); } - void setEmail( const QString & email ); + void setEmail( const TQString & email ); - QString homepage() const { + TQString homepage() const { return getProperty( "homepage" ); } - void setHomepage( const QString & homepage ); + void setHomepage( const TQString & homepage ); - QString comment() const { + TQString comment() const { return getProperty( "comment" ); } - void setComment ( const QString & comment ); + void setComment ( const TQString & comment ); - QString version() const { + TQString version() const { return getProperty( "version" ); } - void setVersion ( const QString & version ); + void setVersion ( const TQString & version ); /** * Creates a preview file called theme_name.preview.png @@ -134,13 +134,13 @@ private: * Create a property with @p name, value @p value * and append it to @p parent element */ - void setProperty( const QString & name, - const QString & value, - QDomElement parent ); + void setProperty( const TQString & name, + const TQString & value, + TQDomElement parent ); /** * Get a simple property from the "general" section of the DOM tree */ - QString getProperty( const QString & name ) const; + TQString getProperty( const TQString & name ) const; /** * Get a property from the DOM tree, based on: @@ -148,8 +148,8 @@ private: * @param tag From the this tag * @param attr From this attribute */ - QString getProperty( QDomElement parent, const QString & tag, - const QString & attr ) const; + TQString getProperty( TQDomElement parent, const TQString & tag, + const TQString & attr ) const; /** * Creates a list of "icon" elements based on: @@ -158,16 +158,16 @@ private: * @param parent Parent element to append to * @param cfg The KConfig object to work with */ - void createIconElems( const QString & group, const QString & object, - QDomElement parent, KConfig * cfg ); + void createIconElems( const TQString & group, const TQString & object, + TQDomElement parent, KConfig * cfg ); /** * Creates a color DOM element @p name, with a specifier @p object, * appends it to @p parent; used when creating themes * @param cfg The KConfig object to work with */ - void createColorElem( const QString & name, const QString & object, - QDomElement parent, KConfig * cfg ); + void createColorElem( const TQString & name, const TQString & object, + TQDomElement parent, KConfig * cfg ); /** * Creates a list of "event" elements based on: * @param events The list of events to work on @@ -175,50 +175,50 @@ private: * @param parent Parent element to append to * @param cfg The KConfig object to work with */ - void createSoundList( const QStringList & events, const QString & object, - QDomElement parent, KConfig * cfg ); + void createSoundList( const TQStringList & events, const TQString & object, + TQDomElement parent, KConfig * cfg ); /** * Tries to find out absolute path to a resource and copy it to the theme's temp dir; * used when creating themes * @param section The theme section to work on, corresponds to toplevel XML tags * @param path The original path, relative or absolute - * @return an internal path suitable for writing into the XML file or QString::null + * @return an internal path suitable for writing into the XML file or TQString::null * in case the resource couldn't be found */ - QString processFilePath( const QString & section, const QString & path ); + TQString processFilePath( const TQString & section, const TQString & path ); /** * Converts an internal theme:/ representation of a resource * to a real path */ - QString unprocessFilePath( const QString & section, QString path ); + TQString unprocessFilePath( const TQString & section, TQString path ); /** * Wrapper around KIO::NetAccess::file_copy */ - bool copyFile( const QString & from, const QString & to ); + bool copyFile( const TQString & from, const TQString & to ); /** * Wrapper around KGlobal::dirs()->findResource() * @param section Section to work on (desktop, sounds, panel etc) * @param path The file to find */ - QString findResource( const QString & section, const QString & path ); + TQString findResource( const TQString & section, const TQString & path ); /// name of the theme - QString m_name; + TQString m_name; /// DOM holding the theme - QDomDocument m_dom; + TQDomDocument m_dom; /// the DOM root element - QDomElement m_root; + TQDomElement m_root; /// "general" section - QDomElement m_general; + TQDomElement m_general; KStandardDirs * m_kgd; - QGuardedPtr<QWidget> m_parent; + TQGuardedPtr<TQWidget> m_parent; }; #endif diff --git a/kcontrol/kthememanager/kthemedlg.ui.h b/kcontrol/kthememanager/kthemedlg.ui.h index 53f296a1c..85d22cb9d 100644 --- a/kcontrol/kthememanager/kthemedlg.ui.h +++ b/kcontrol/kthememanager/kthemedlg.ui.h @@ -8,7 +8,7 @@ *****************************************************************************/ #include <krun.h> -void KThemeDlg::startKonqui( const QString & url ) +void KThemeDlg::startKonqui( const TQString & url ) { (void) new KRun(url); } diff --git a/kcontrol/kthememanager/kthememanager.cpp b/kcontrol/kthememanager/kthememanager.cpp index d5efc65cd..2668bd87c 100644 --- a/kcontrol/kthememanager/kthememanager.cpp +++ b/kcontrol/kthememanager/kthememanager.cpp @@ -16,12 +16,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include <qlabel.h> -#include <qlayout.h> -#include <qpixmap.h> -#include <qpushbutton.h> -#include <qtoolbutton.h> -#include <qtooltip.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqpixmap.h> +#include <tqpushbutton.h> +#include <tqtoolbutton.h> +#include <tqtooltip.h> #include <kaboutdata.h> #include <kapplication.h> @@ -42,7 +42,7 @@ #include "knewthemedlg.h" #include "config.h" -kthememanager::kthememanager( QWidget *parent, const char *name ) +kthememanager::kthememanager( TQWidget *parent, const char *name ) : KCModule( parent, name ), m_theme( 0 ), m_origTheme( 0 ) { @@ -61,33 +61,33 @@ kthememanager::kthememanager( QWidget *parent, const char *name ) setAcceptDrops( true ); init(); - QBoxLayout *top = new QVBoxLayout(this, 0, KDialog::spacingHint()); + TQBoxLayout *top = new TQVBoxLayout(this, 0, KDialog::spacingHint()); dlg = new KThemeDlg(this); top->addWidget( dlg ); - dlg->lvThemes->setColumnWidthMode( 0, QListView::Maximum ); + dlg->lvThemes->setColumnWidthMode( 0, TQListView::Maximum ); - connect( ( QObject * )dlg->btnInstall, SIGNAL( clicked() ), - this, SLOT( slotInstallTheme() ) ); + connect( ( TQObject * )dlg->btnInstall, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( slotInstallTheme() ) ); - connect( ( QObject * )dlg->btnRemove, SIGNAL( clicked() ), - this, SLOT( slotRemoveTheme() ) ); + connect( ( TQObject * )dlg->btnRemove, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( slotRemoveTheme() ) ); - connect( ( QObject * )dlg->btnCreate, SIGNAL( clicked() ), - this, SLOT( slotCreateTheme() ) ); + connect( ( TQObject * )dlg->btnCreate, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( slotCreateTheme() ) ); - connect( ( QObject * )dlg->lvThemes, SIGNAL( clicked( QListViewItem * ) ), - this, SLOT( slotThemeChanged( QListViewItem * ) ) ); + connect( ( TQObject * )dlg->lvThemes, TQT_SIGNAL( clicked( TQListViewItem * ) ), + this, TQT_SLOT( slotThemeChanged( TQListViewItem * ) ) ); - connect( ( QObject * )dlg->lvThemes, SIGNAL( currentChanged( QListViewItem * ) ), - this, SLOT( slotThemeChanged( QListViewItem * ) ) ); + connect( ( TQObject * )dlg->lvThemes, TQT_SIGNAL( currentChanged( TQListViewItem * ) ), + this, TQT_SLOT( slotThemeChanged( TQListViewItem * ) ) ); - connect( this, SIGNAL( filesDropped( const KURL::List& ) ), - this, SLOT( updateButton() ) ); + connect( this, TQT_SIGNAL( filesDropped( const KURL::List& ) ), + this, TQT_SLOT( updateButton() ) ); - connect( ( QObject * )dlg->lvThemes, SIGNAL( clicked( QListViewItem * ) ), - this, SLOT( updateButton() ) ); + connect( ( TQObject * )dlg->lvThemes, TQT_SIGNAL( clicked( TQListViewItem * ) ), + this, TQT_SLOT( updateButton() ) ); m_origTheme = new KTheme( this, true ); // stores the defaults to get back to m_origTheme->setName( ORIGINAL_THEME ); @@ -112,10 +112,10 @@ void kthememanager::init() void kthememanager::updateButton() { - QListViewItem * cur = dlg->lvThemes->currentItem(); + TQListViewItem * cur = dlg->lvThemes->currentItem(); bool enable = (cur != 0); if (enable) { - enable = QFile(KGlobal::dirs()->saveLocation( "themes", cur->text( 0 ) + "/"+ cur->text( 0 )+ ".xml" ,false)).exists() ; + enable = TQFile(KGlobal::dirs()->saveLocation( "themes", cur->text( 0 ) + "/"+ cur->text( 0 )+ ".xml" ,false)).exists() ; } dlg->btnRemove->setEnabled(enable); } @@ -135,8 +135,8 @@ void kthememanager::load(bool useDefaults) conf.setReadDefaults( useDefaults ); conf.setGroup( "General" ); - QString themeName = conf.readEntry( "CurrentTheme" ); - QListViewItem * cur = dlg->lvThemes->findItem( themeName, 0 ); + TQString themeName = conf.readEntry( "CurrentTheme" ); + TQListViewItem * cur = dlg->lvThemes->findItem( themeName, 0 ); if ( cur ) { dlg->lvThemes->setSelected( cur, true ); @@ -154,11 +154,11 @@ void kthememanager::defaults() void kthememanager::save() { - QListViewItem * cur = dlg->lvThemes->currentItem(); + TQListViewItem * cur = dlg->lvThemes->currentItem(); if ( cur ) { - QString themeName = cur->text( 0 ); + TQString themeName = cur->text( 0 ); m_theme = new KTheme( this, KGlobal::dirs()->findResource( "themes", themeName + "/" + themeName + ".xml") ); m_theme->apply(); @@ -178,33 +178,33 @@ void kthememanager::save() void kthememanager::listThemes() { dlg->lvThemes->clear(); - dlg->lbPreview->setPixmap( QPixmap() ); + dlg->lbPreview->setPixmap( TQPixmap() ); - QStringList themes = KGlobal::dirs()->findAllResources( "themes", "*.xml", true /*recursive*/ ); + TQStringList themes = KGlobal::dirs()->findAllResources( "themes", "*.xml", true /*recursive*/ ); - QStringList::const_iterator it; + TQStringList::const_iterator it; for ( it = themes.begin(); it != themes.end(); ++it ) { KTheme theme( this, ( *it ) ); - QString name = theme.name(); + TQString name = theme.name(); if ( name != ORIGINAL_THEME ) // skip the "original" theme - ( void ) new QListViewItem( dlg->lvThemes, name, theme.comment() ); + ( void ) new TQListViewItem( dlg->lvThemes, name, theme.comment() ); } kdDebug() << "Available themes: " << themes << endl; } -float kthememanager::getThemeVersion( const QString & themeName ) +float kthememanager::getThemeVersion( const TQString & themeName ) { - QStringList themes = KGlobal::dirs()->findAllResources( "themes", "*.xml", true /*recursive*/ ); + TQStringList themes = KGlobal::dirs()->findAllResources( "themes", "*.xml", true /*recursive*/ ); - QStringList::const_iterator it; + TQStringList::const_iterator it; for ( it = themes.begin(); it != themes.end(); ++it ) { KTheme theme( 0L, ( *it ) ); - QString name = theme.name(); + TQString name = theme.name(); bool ok = false; float version = theme.version().toFloat( &ok ); if ( name == themeName && ok ) @@ -224,7 +224,7 @@ void kthememanager::addNewTheme( const KURL & url ) { if ( url.isValid() ) { - QString themeName = QFileInfo( url.fileName() ).baseName(); + TQString themeName = TQFileInfo( url.fileName() ).baseName(); if ( getThemeVersion( themeName ) != -1 ) // theme exists already { KTheme::remove( themeName ); // remove first @@ -246,11 +246,11 @@ void kthememanager::addNewTheme( const KURL & url ) void kthememanager::slotRemoveTheme() { // get the selected item from the listview - QListViewItem * cur = dlg->lvThemes->currentItem(); + TQListViewItem * cur = dlg->lvThemes->currentItem(); // ask and remove it if ( cur ) { - QString themeName = cur->text( 0 ); + TQString themeName = cur->text( 0 ); if ( KMessageBox::warningContinueCancel( this, "<qt>" + i18n( "Do you really want to remove the theme <b>%1</b>?" ).arg( themeName ), i18n( "Remove Theme" ), KGuiItem( i18n( "&Remove" ), "editdelete" ) ) == KMessageBox::Continue ) @@ -262,7 +262,7 @@ void kthememanager::slotRemoveTheme() } } -bool kthememanager::themeExist(const QString &_themeName) +bool kthememanager::themeExist(const TQString &_themeName) { return ( dlg->lvThemes->findItem( _themeName, 0 )!=0 ); } @@ -279,10 +279,10 @@ void kthememanager::slotCreateTheme() dlg.setEmail( es.getSetting( KEMailSettings::EmailAddress ) ); dlg.setVersion( "0.1" ); - if ( dlg.exec() == QDialog::Accepted ) + if ( dlg.exec() == TQDialog::Accepted ) { - QString themeName = dlg.getName(); + TQString themeName = dlg.getName(); if ( themeExist(themeName) ) { KMessageBox::information( this, i18n( "Theme %1 already exists." ).arg( themeName ) ); @@ -301,7 +301,7 @@ void kthememanager::slotCreateTheme() m_theme->setComment( dlg.getComment().replace( "\n", "" ) ); m_theme->setVersion( dlg.getVersion() ); - QString result = m_theme->createYourself( true ); + TQString result = m_theme->createYourself( true ); m_theme->addPreview(); if ( !result.isEmpty() ) @@ -318,30 +318,30 @@ void kthememanager::slotCreateTheme() } } -void kthememanager::slotThemeChanged( QListViewItem * item ) +void kthememanager::slotThemeChanged( TQListViewItem * item ) { if ( item ) { - QString themeName = item->text(0); + TQString themeName = item->text(0); kdDebug() << "Activated theme: " << themeName << endl; - QString themeDir = KGlobal::dirs()->findResourceDir( "themes", themeName + "/" + themeName + ".xml") + themeName + "/"; + TQString themeDir = KGlobal::dirs()->findResourceDir( "themes", themeName + "/" + themeName + ".xml") + themeName + "/"; - QString pixFile = themeDir + themeName + ".preview.png"; + TQString pixFile = themeDir + themeName + ".preview.png"; - if ( QFile::exists( pixFile ) ) + if ( TQFile::exists( pixFile ) ) { updatePreview( pixFile ); } else { - dlg->lbPreview->setPixmap( QPixmap() ); + dlg->lbPreview->setPixmap( TQPixmap() ); dlg->lbPreview->setText( i18n( "This theme does not contain a preview." ) ); } KTheme theme( this, themeDir + themeName + ".xml" ); - QToolTip::remove( dlg->lbPreview ); - QToolTip::add( dlg->lbPreview, "<qt>" + i18n( "Author: %1<br>Email: %2<br>Version: %3<br>Homepage: %4" ) + TQToolTip::remove( dlg->lbPreview ); + TQToolTip::add( dlg->lbPreview, "<qt>" + i18n( "Author: %1<br>Email: %2<br>Version: %3<br>Homepage: %4" ) .arg( theme.author() ).arg( theme.email() ) .arg( theme.version() ).arg( theme.homepage() ) + "</qt>"); @@ -349,12 +349,12 @@ void kthememanager::slotThemeChanged( QListViewItem * item ) } } -void kthememanager::dragEnterEvent( QDragEnterEvent * ev ) +void kthememanager::dragEnterEvent( TQDragEnterEvent * ev ) { ev->accept( KURLDrag::canDecode( ev ) ); } -void kthememanager::dropEvent( QDropEvent * ev ) +void kthememanager::dropEvent( TQDropEvent * ev ) { KURL::List urls; if ( KURLDrag::decode( ev, urls ) ) @@ -401,21 +401,21 @@ void kthememanager::queryLNFModules() dlg->btnSaver->setIconSet( il->loadIconSet( "kscreensaver", KIcon::Desktop, 32 ) ); } -void kthememanager::updatePreview( const QString & pixFile ) +void kthememanager::updatePreview( const TQString & pixFile ) { kdDebug() << "Preview is in file: " << pixFile << endl; - QImage preview( pixFile, "PNG" ); + TQImage preview( pixFile, "PNG" ); if (preview.width()>dlg->lbPreview->contentsRect().width() || preview.height()>dlg->lbPreview->contentsRect().height() ) - preview = preview.smoothScale( dlg->lbPreview->contentsRect().size(), QImage::ScaleMin ); - QPixmap pix; + preview = preview.smoothScale( dlg->lbPreview->contentsRect().size(), TQImage::ScaleMin ); + TQPixmap pix; pix.convertFromImage( preview ); dlg->lbPreview->setPixmap( pix ); } extern "C" { - KDE_EXPORT KCModule *create_kthememanager(QWidget *parent, const char *) + KDE_EXPORT KCModule *create_kthememanager(TQWidget *parent, const char *) { KGlobal::locale()->insertCatalogue( "kthememanager" ); return new kthememanager( parent, "kthememanager" ); diff --git a/kcontrol/kthememanager/kthememanager.h b/kcontrol/kthememanager/kthememanager.h index 972251f6a..cbb0a1db5 100644 --- a/kcontrol/kthememanager/kthememanager.h +++ b/kcontrol/kthememanager/kthememanager.h @@ -39,7 +39,7 @@ class KIconViewItem; class KThemeDetailsItem: public KIconViewItem { public: - KThemeDetailsItem( KIconView * parent, const QString & text, const QPixmap & icon, const QString & execString ) + KThemeDetailsItem( KIconView * parent, const TQString & text, const TQPixmap & icon, const TQString & execString ) : KIconViewItem( parent, text, icon ) { m_exec = execString; } virtual ~KThemeDetailsItem() { }; @@ -47,7 +47,7 @@ public: ( void ) new KRun( m_exec ); } private: - QString m_exec; + TQString m_exec; }; */ @@ -63,7 +63,7 @@ class kthememanager: public KCModule { Q_OBJECT public: - kthememanager( QWidget *parent=0, const char *name=0 ); + kthememanager( TQWidget *parent=0, const char *name=0 ); virtual ~kthememanager(); /** @@ -81,8 +81,8 @@ public: virtual void defaults(); protected: - void dragEnterEvent ( QDragEnterEvent * ev ); - void dropEvent ( QDropEvent * ev ); + void dragEnterEvent ( TQDragEnterEvent * ev ); + void dropEvent ( TQDropEvent * ev ); signals: /** @@ -109,7 +109,7 @@ private slots: /** * Update the theme's info and preview */ - void slotThemeChanged( QListViewItem * item ); + void slotThemeChanged( TQListViewItem * item ); /** * Invoked when one drag and drops @p urls onto the kcm @@ -139,15 +139,15 @@ private: * @param themeName The theme name * @return The theme's version number or -1 if not installed */ - static float getThemeVersion( const QString & themeName ); + static float getThemeVersion( const TQString & themeName ); void queryLNFModules(); /** * Updates the preview widget */ - void updatePreview( const QString & pixFile ); - bool themeExist(const QString &_themeName); + void updatePreview( const TQString & pixFile ); + bool themeExist(const TQString &_themeName); KThemeDlg * dlg; KTheme * m_theme; |