diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:33:34 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:33:34 +0000 |
commit | c663b6440964f6ac48027143ac9e63298991f9d0 (patch) | |
tree | 6d8b0c5a5f9db1ee16acf98b1397cea9126b281d /ksplashml | |
parent | a061f7191beebb0e4a3b0c0a7c534ec5f22f2dc7 (diff) | |
download | tdebase-c663b6440964f6ac48027143ac9e63298991f9d0.tar.gz tdebase-c663b6440964f6ac48027143ac9e63298991f9d0.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1157639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksplashml')
23 files changed, 537 insertions, 537 deletions
diff --git a/ksplashml/kcmksplash/installer.cpp b/ksplashml/kcmksplash/installer.cpp index a2850ecfa..335611a9f 100644 --- a/ksplashml/kcmksplash/installer.cpp +++ b/ksplashml/kcmksplash/installer.cpp @@ -12,10 +12,10 @@ #include <unistd.h> #include <stdlib.h> -#include <qdir.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qtextedit.h> +#include <tqdir.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqtextedit.h> #include "installer.h" @@ -32,20 +32,20 @@ #include <kurldrag.h> #include <kio/netaccess.h> -ThemeListBox::ThemeListBox(QWidget *parent) +ThemeListBox::ThemeListBox(TQWidget *parent) : KListBox(parent) { setAcceptDrops(true); - connect(this, SIGNAL(mouseButtonPressed(int, QListBoxItem *, const QPoint &)), - this, SLOT(slotMouseButtonPressed(int, QListBoxItem *, const QPoint &))); + connect(this, TQT_SIGNAL(mouseButtonPressed(int, TQListBoxItem *, const TQPoint &)), + this, TQT_SLOT(slotMouseButtonPressed(int, TQListBoxItem *, const TQPoint &))); } -void ThemeListBox::dragEnterEvent(QDragEnterEvent* event) +void ThemeListBox::dragEnterEvent(TQDragEnterEvent* event) { event->accept((event->source() != this) && KURLDrag::canDecode(event)); } -void ThemeListBox::dropEvent(QDropEvent* event) +void ThemeListBox::dropEvent(TQDropEvent* event) { KURL::List urls; if (KURLDrag::decode(event, urls)) @@ -54,22 +54,22 @@ void ThemeListBox::dropEvent(QDropEvent* event) } } -void ThemeListBox::slotMouseButtonPressed(int button, QListBoxItem *item, const QPoint &p) +void ThemeListBox::slotMouseButtonPressed(int button, TQListBoxItem *item, const TQPoint &p) { if ((button & LeftButton) == 0) return; mOldPos = p; - mDragFile = QString::null; + mDragFile = TQString::null; int cur = index(item); if (cur >= 0) mDragFile = text2path[text(cur)]; } -void ThemeListBox::mouseMoveEvent(QMouseEvent *e) +void ThemeListBox::mouseMoveEvent(TQMouseEvent *e) { if (((e->state() & LeftButton) != 0) && !mDragFile.isEmpty()) { int delay = KGlobalSettings::dndEventDelay(); - QPoint newPos = e->globalPos(); + TQPoint newPos = e->globalPos(); if(newPos.x() > mOldPos.x()+delay || newPos.x() < mOldPos.x()-delay || newPos.y() > mOldPos.y()+delay || newPos.y() < mOldPos.y()-delay) { @@ -85,50 +85,50 @@ void ThemeListBox::mouseMoveEvent(QMouseEvent *e) } //----------------------------------------------------------------------------- -SplashInstaller::SplashInstaller (QWidget *aParent, const char *aName, bool aInit) - : QWidget(aParent, aName), mGui(!aInit) +SplashInstaller::SplashInstaller (TQWidget *aParent, const char *aName, bool aInit) + : TQWidget(aParent, aName), mGui(!aInit) { KGlobal::dirs()->addResourceType("ksplashthemes", KStandardDirs::kde_default("data") + "ksplash/Themes"); if (!mGui) return; - QHBoxLayout* hbox = new QHBoxLayout( this, 0, KDialog::spacingHint() ); + TQHBoxLayout* hbox = new TQHBoxLayout( this, 0, KDialog::spacingHint() ); - QVBoxLayout* leftbox = new QVBoxLayout( hbox, KDialog::spacingHint() ); + TQVBoxLayout* leftbox = new TQVBoxLayout( hbox, KDialog::spacingHint() ); hbox->setStretchFactor( leftbox, 1 ); mThemesList = new ThemeListBox(this); - mThemesList->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Expanding ); - connect(mThemesList, SIGNAL(highlighted(int)), SLOT(slotSetTheme(int))); - connect(mThemesList, SIGNAL(filesDropped(const KURL::List&)), SLOT(slotFilesDropped(const KURL::List&))); + mThemesList->setSizePolicy( TQSizePolicy::Preferred, TQSizePolicy::Expanding ); + connect(mThemesList, TQT_SIGNAL(highlighted(int)), TQT_SLOT(slotSetTheme(int))); + connect(mThemesList, TQT_SIGNAL(filesDropped(const KURL::List&)), TQT_SLOT(slotFilesDropped(const KURL::List&))); leftbox->addWidget(mThemesList); mBtnAdd = new KPushButton( i18n("Add..."), this ); leftbox->addWidget( mBtnAdd ); - connect(mBtnAdd, SIGNAL(clicked()), SLOT(slotAdd())); + connect(mBtnAdd, TQT_SIGNAL(clicked()), TQT_SLOT(slotAdd())); mBtnRemove = new KPushButton( i18n("Remove"), this ); leftbox->addWidget( mBtnRemove ); - connect(mBtnRemove, SIGNAL(clicked()), SLOT(slotRemove())); + connect(mBtnRemove, TQT_SIGNAL(clicked()), TQT_SLOT(slotRemove())); mBtnTest = new KPushButton( i18n("Test"), this ); leftbox->addWidget( mBtnTest ); - connect(mBtnTest, SIGNAL(clicked()), SLOT(slotTest())); + connect(mBtnTest, TQT_SIGNAL(clicked()), TQT_SLOT(slotTest())); - QVBoxLayout* rightbox = new QVBoxLayout( hbox, KDialog::spacingHint() ); + TQVBoxLayout* rightbox = new TQVBoxLayout( hbox, KDialog::spacingHint() ); hbox->setStretchFactor( rightbox, 3 ); - mPreview = new QLabel(this); - mPreview->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); - mPreview->setFrameStyle(QFrame::Panel|QFrame::Sunken); - mPreview->setMinimumSize(QSize(320,240)); + mPreview = new TQLabel(this); + mPreview->setSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Expanding ); + mPreview->setFrameStyle(TQFrame::Panel|TQFrame::Sunken); + mPreview->setMinimumSize(TQSize(320,240)); mPreview->setAlignment(Qt::AlignHCenter|Qt::AlignVCenter); rightbox->addWidget(mPreview); rightbox->setStretchFactor( mPreview, 3 ); - mText = new QTextEdit(this); - mText->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ); + mText = new TQTextEdit(this); + mText->setSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Preferred ); mText->setMinimumSize(mText->sizeHint()); mText->setReadOnly(true); rightbox->addWidget(mText); @@ -144,10 +144,10 @@ SplashInstaller::~SplashInstaller() { } -int SplashInstaller::addTheme(const QString &path, const QString &name) +int SplashInstaller::addTheme(const TQString &path, const TQString &name) { //kdDebug() << "SplashInstaller::addTheme: " << path << " " << name << endl; - QString tmp(i18n( name.utf8() )); + TQString tmp(i18n( name.utf8() )); int i = mThemesList->count(); while((i > 0) && (mThemesList->text(i-1) > tmp)) i--; @@ -161,9 +161,9 @@ int SplashInstaller::addTheme(const QString &path, const QString &name) // Copy theme package into themes directory void SplashInstaller::addNewTheme(const KURL &srcURL) { - QString dir = KGlobal::dirs()->saveLocation("ksplashthemes"); + TQString dir = KGlobal::dirs()->saveLocation("ksplashthemes"); KURL url; - QString filename = srcURL.fileName(); + TQString filename = srcURL.fileName(); int i = filename.findRev('.'); // Convert extension to lower case. if (i >= 0) @@ -191,11 +191,11 @@ void SplashInstaller::addNewTheme(const KURL &srcURL) } KArchiveDirectory const *ad = tarFile.directory(); // Find first directory entry. - QStringList entries = ad->entries(); - QString themeName( entries.first() ); + TQStringList entries = ad->entries(); + TQString themeName( entries.first() ); #if 0 // The isDirectory() call always returns false; why? - for ( QStringList::Iterator it = entries.begin(); it != entries.end(); ++it ) + for ( TQStringList::Iterator it = entries.begin(); it != entries.end(); ++it ) { if ( ad->entry( *it )->isDirectory() ) { @@ -222,21 +222,21 @@ void SplashInstaller::readThemesList() mThemesList->clear(); // Read local themes - QStringList entryList = KGlobal::dirs()->resourceDirs("ksplashthemes"); + TQStringList entryList = KGlobal::dirs()->resourceDirs("ksplashthemes"); //kdDebug() << "readThemesList: " << entryList << endl; - QDir dir; - QStringList subdirs; - QStringList::ConstIterator name; + TQDir dir; + TQStringList subdirs; + TQStringList::ConstIterator name; for(name = entryList.begin(); name != entryList.end(); name++) { dir = *name; if (!dir.exists()) continue; - subdirs = dir.entryList( QDir::Dirs ); + subdirs = dir.entryList( TQDir::Dirs ); // kdDebug() << "readThemesList: " << subdirs << endl; // TODO: Make sure it contains a *.rc file. - for (QStringList::Iterator l = subdirs.begin(); l != subdirs.end(); l++ ) - if ( !(*l).startsWith(QString(".")) ) + for (TQStringList::Iterator l = subdirs.begin(); l != subdirs.end(); l++ ) + if ( !(*l).startsWith(TQString(".")) ) { mThemesList->blockSignals( true ); // Don't activate any theme until all themes are loaded. addTheme(dir.path(),*l); @@ -261,7 +261,7 @@ void SplashInstaller::load( bool useDefaults ) KConfig cnf("ksplashrc"); cnf.setReadDefaults( useDefaults ); cnf.setGroup("KSplash"); - QString curTheme = cnf.readEntry("Theme","Default"); + TQString curTheme = cnf.readEntry("Theme","Default"); mThemesList->setCurrentItem(findTheme(curTheme)); emit changed( useDefaults ); } @@ -274,7 +274,7 @@ void SplashInstaller::save() int cur = mThemesList->currentItem(); if (cur < 0) return; - QString path = mThemesList->text(cur); + TQString path = mThemesList->text(cur); if ( mThemesList->text2path.contains( path ) ) path = mThemesList->text2path[path]; cur = path.findRev('/'); @@ -291,8 +291,8 @@ void SplashInstaller::slotRemove() return; bool rc = false; - QString themeName = mThemesList->text(cur); - QString themeDir = mThemesList->text2path[themeName]; + TQString themeName = mThemesList->text(cur); + TQString themeDir = mThemesList->text2path[themeName]; if (!themeDir.isEmpty()) { KURL url; @@ -318,24 +318,24 @@ void SplashInstaller::slotRemove() void SplashInstaller::slotSetTheme(int id) { bool enabled; - QString path(QString::null); - QString infoTxt; + TQString path(TQString::null); + TQString infoTxt; if (id < 0) { - mPreview->setText(QString::null); - mText->setText(QString::null); + mPreview->setText(TQString::null); + mText->setText(TQString::null); enabled = false; } else { - QString error = i18n("(Could not load theme)"); + TQString error = i18n("(Could not load theme)"); path = mThemesList->text(id); if ( mThemesList->text2path.contains( path ) ) path = mThemesList->text2path[path]; enabled = false; KURL url; - QString themeName; + TQString themeName; if (!path.isEmpty()) { // Make sure the correct plugin is installed. @@ -356,7 +356,7 @@ void SplashInstaller::slotSetTheme(int id) if (KIO::NetAccess::exists(url, true, 0)) { KConfig cnf(url.path()); - cnf.setGroup( QString("KSplash Theme: %1").arg(themeName) ); + cnf.setGroup( TQString("KSplash Theme: %1").arg(themeName) ); // Get theme information. infoTxt = "<qt>"; @@ -372,8 +372,8 @@ void SplashInstaller::slotSetTheme(int id) infoTxt += i18n( "<b>Homepage:</b> %1<br>" ).arg( cnf.readEntry( "Homepage", i18n( "Unknown" ) ) ); infoTxt += "</qt>"; - QString pluginName( cnf.readEntry( "Engine", "Default" ) ); // Perhaps no default is better? - if ((KTrader::self()->query("KSplash/Plugin", QString("[X-KSplash-PluginName] == '%1'").arg(pluginName))).isEmpty()) + TQString pluginName( cnf.readEntry( "Engine", "Default" ) ); // Perhaps no default is better? + if ((KTrader::self()->query("KSplash/Plugin", TQString("[X-KSplash-PluginName] == '%1'").arg(pluginName))).isEmpty()) { enabled = false; error = i18n("This theme requires the plugin %1 which is not installed.").arg(pluginName); @@ -392,7 +392,7 @@ void SplashInstaller::slotSetTheme(int id) { url.setPath( path + "/" + "Preview.png" ); if (KIO::NetAccess::exists(url, true, 0)) - mPreview->setPixmap(QPixmap(url.path())); + mPreview->setPixmap(TQPixmap(url.path())); else mPreview->setText(i18n("(Could not load theme)")); KMessageBox::sorry(this, error); @@ -401,21 +401,21 @@ void SplashInstaller::slotSetTheme(int id) { url.setPath( path + "/" + "Preview.png" ); if (KIO::NetAccess::exists(url, true, 0)) - mPreview->setPixmap(QPixmap(url.path())); + mPreview->setPixmap(TQPixmap(url.path())); else mPreview->setText(i18n("No preview available.")); emit changed(true); } } - mBtnRemove->setEnabled( !path.isEmpty() && QFileInfo(path).isWritable()); + mBtnRemove->setEnabled( !path.isEmpty() && TQFileInfo(path).isWritable()); } //----------------------------------------------------------------------------- void SplashInstaller::slotAdd() { - static QString path; - if (path.isEmpty()) path = QDir::homeDirPath(); + static TQString path; + if (path.isEmpty()) path = TQDir::homeDirPath(); KFileDialog dlg(path, "*.tgz *.tar.gz *.tar.bz2|" + i18n( "KSplash Theme Files" ), 0, 0, true); dlg.setCaption(i18n("Add Theme")); @@ -436,10 +436,10 @@ void SplashInstaller::slotFilesDropped(const KURL::List &urls) } //----------------------------------------------------------------------------- -int SplashInstaller::findTheme( const QString &theme ) +int SplashInstaller::findTheme( const TQString &theme ) { // theme is untranslated, but the listbox contains translated items - QString tmp(i18n( theme.utf8() )); + TQString tmp(i18n( theme.utf8() )); int id = mThemesList->count()-1; while (id >= 0) @@ -458,7 +458,7 @@ void SplashInstaller::slotTest() int i = mThemesList->currentItem(); if (i < 0) return; - QString themeName = mThemesList->text2path[mThemesList->text(i)]; + TQString themeName = mThemesList->text2path[mThemesList->text(i)]; int r = themeName.findRev('/'); if (r >= 0) themeName = themeName.mid(r+1); diff --git a/ksplashml/kcmksplash/installer.h b/ksplashml/kcmksplash/installer.h index 43e37d0fc..98dc1fc39 100644 --- a/ksplashml/kcmksplash/installer.h +++ b/ksplashml/kcmksplash/installer.h @@ -11,8 +11,8 @@ #ifndef SPLASHINSTALLER_H #define SPLASHINSTALLER_H -#include <qmap.h> -#include <qpoint.h> +#include <tqmap.h> +#include <tqpoint.h> #include <klistbox.h> #include <kurl.h> @@ -26,7 +26,7 @@ class SplashInstaller : public QWidget { Q_OBJECT public: - SplashInstaller(QWidget *parent=0, const char *aName=0, bool aInit=FALSE); + SplashInstaller(TQWidget *parent=0, const char *aName=0, bool aInit=FALSE); ~SplashInstaller(); virtual void load(); @@ -48,39 +48,39 @@ protected: /** Scan Themes directory for available theme packages */ virtual void readThemesList(); /** add a theme to the list, returns the list index */ - int addTheme(const QString &path, const QString &name); + int addTheme(const TQString &path, const TQString &name); void addNewTheme(const KURL &srcURL); - int findTheme( const QString &theme ); + int findTheme( const TQString &theme ); private: bool mGui; ThemeListBox *mThemesList; - QPushButton *mBtnAdd, *mBtnRemove, *mBtnTest; - QTextEdit *mText; - QLabel *mPreview; + TQPushButton *mBtnAdd, *mBtnRemove, *mBtnTest; + TQTextEdit *mText; + TQLabel *mPreview; }; class ThemeListBox: public KListBox { Q_OBJECT public: - ThemeListBox(QWidget *parent); - QMap<QString, QString> text2path; + ThemeListBox(TQWidget *parent); + TQMap<TQString, TQString> text2path; signals: void filesDropped(const KURL::List &urls); protected: - void dragEnterEvent(QDragEnterEvent* event); - void dropEvent(QDropEvent* event); - void mouseMoveEvent(QMouseEvent *e); + void dragEnterEvent(TQDragEnterEvent* event); + void dropEvent(TQDropEvent* event); + void mouseMoveEvent(TQMouseEvent *e); protected slots: - void slotMouseButtonPressed(int button, QListBoxItem *item, const QPoint &p); + void slotMouseButtonPressed(int button, TQListBoxItem *item, const TQPoint &p); private: - QString mDragFile; - QPoint mOldPos; + TQString mDragFile; + TQPoint mOldPos; }; diff --git a/ksplashml/kcmksplash/main.cpp b/ksplashml/kcmksplash/main.cpp index d48923a28..7b4557608 100644 --- a/ksplashml/kcmksplash/main.cpp +++ b/ksplashml/kcmksplash/main.cpp @@ -12,8 +12,8 @@ #include "config.h" #endif -#include <qlayout.h> -#include <qtabwidget.h> +#include <tqlayout.h> +#include <tqtabwidget.h> #include <kaboutdata.h> #include <kcmodule.h> @@ -26,10 +26,10 @@ class KSplashThemeMgr : public KCModule { public: - KSplashThemeMgr( QWidget *parent, const char *name, const QStringList &/*unused*/); + KSplashThemeMgr( TQWidget *parent, const char *name, const TQStringList &/*unused*/); ~KSplashThemeMgr(); - QString quickHelp() const; + TQString quickHelp() const; virtual void init(); virtual void save(); @@ -40,26 +40,26 @@ private: SplashInstaller *mInstaller; }; -typedef KGenericFactory< KSplashThemeMgr, QWidget > KSplashThemeMgrFactory; +typedef KGenericFactory< KSplashThemeMgr, TQWidget > KSplashThemeMgrFactory; K_EXPORT_COMPONENT_FACTORY( kcm_ksplashthemes, KSplashThemeMgrFactory("ksplashthemes") ) // ----------------------------------------------------------------------------------------- -KSplashThemeMgr::KSplashThemeMgr( QWidget *parent, const char *name, const QStringList &) +KSplashThemeMgr::KSplashThemeMgr( TQWidget *parent, const char *name, const TQStringList &) : KCModule( KSplashThemeMgrFactory::instance(), parent, name ), mInstaller(new SplashInstaller(this)) { init(); #if 0 - QHBoxLayout *box = new QHBoxLayout(this); - QTabWidget *tab = new QTabWidget(this); // There will be more tabs in the future. + TQHBoxLayout *box = new TQHBoxLayout(this); + TQTabWidget *tab = new TQTabWidget(this); // There will be more tabs in the future. box->addWidget(tab); tab->addTab( mInstaller, i18n("&Theme Installer") ); #else - QHBoxLayout *box = new QHBoxLayout(this, 0, 0); + TQHBoxLayout *box = new TQHBoxLayout(this, 0, 0); box->addWidget(mInstaller); #endif - connect( mInstaller, SIGNAL(changed(bool)), SIGNAL(changed(bool)) ); + connect( mInstaller, TQT_SIGNAL(changed(bool)), TQT_SIGNAL(changed(bool)) ); KAboutData *about = new KAboutData( "kcmksplash" ,I18N_NOOP("KDE splash screen theme manager") ,"0.1" @@ -79,7 +79,7 @@ KSplashThemeMgr::~KSplashThemeMgr() // Do not delete the installer as it is now owned by the tab widget. } -QString KSplashThemeMgr::quickHelp() const +TQString KSplashThemeMgr::quickHelp() const { return i18n("<h1>Splash Screen Theme Manager </h1> Install and view splash screen themes."); } diff --git a/ksplashml/ksplashiface.h b/ksplashml/ksplashiface.h index 2e8e7a8fc..a3093c0a7 100644 --- a/ksplashml/ksplashiface.h +++ b/ksplashml/ksplashiface.h @@ -14,7 +14,7 @@ #include <dcopobject.h> -#include <qstring.h> +#include <tqstring.h> /** @short DCOP interface for KSplash. */ class KSplashIface : virtual public DCOPObject @@ -24,11 +24,11 @@ public: KSplashIface( const char *name = "ksplash" ) : DCOPObject(name) {} k_dcop: - virtual ASYNC upAndRunning( QString ) = 0; + virtual ASYNC upAndRunning( TQString ) = 0; virtual ASYNC setMaxProgress(int) = 0; virtual ASYNC setProgress(int) = 0; virtual ASYNC setStartupItemCount( int count ) = 0; - virtual ASYNC programStarted( QString programIcon, QString programName, QString description ) = 0; + virtual ASYNC programStarted( TQString programIcon, TQString programName, TQString description ) = 0; virtual ASYNC startupComplete() = 0; virtual ASYNC close() = 0; virtual ASYNC hide() = 0; diff --git a/ksplashml/themeengine/default/themelegacy.cpp b/ksplashml/themeengine/default/themelegacy.cpp index 35d47241b..77274da99 100644 --- a/ksplashml/themeengine/default/themelegacy.cpp +++ b/ksplashml/themeengine/default/themelegacy.cpp @@ -18,34 +18,34 @@ #include <kstandarddirs.h> #include <kprogress.h> -#include <qcheckbox.h> -#include <qdesktopwidget.h> -#include <qlabel.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qwidget.h> -#include <qtimer.h> +#include <tqcheckbox.h> +#include <tqdesktopwidget.h> +#include <tqlabel.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqwidget.h> +#include <tqtimer.h> #include "objkstheme.h" #include "themeengine.h" #include "themelegacy.h" #include "themelegacy.moc" -DefaultConfig::DefaultConfig( QWidget *parent, KConfig *config ) +DefaultConfig::DefaultConfig( TQWidget *parent, KConfig *config ) :ThemeEngineConfig( parent, config ) { - mConfig->setGroup( QString("KSplash Theme: Default") ); - QVBox *hbox = new QVBox( this ); - mFlash = new QCheckBox( i18n("Icons flash while they are starting"), hbox ); + mConfig->setGroup( TQString("KSplash Theme: Default") ); + TQVBox *hbox = new TQVBox( this ); + mFlash = new TQCheckBox( i18n("Icons flash while they are starting"), hbox ); mFlash->setChecked( mConfig->readBoolEntry("Icons Flashing",true) ); - mAlwaysShow = new QCheckBox( i18n("Always show progress bar"), hbox ); + mAlwaysShow = new TQCheckBox( i18n("Always show progress bar"), hbox ); mAlwaysShow->setChecked( mConfig->readBoolEntry("Always Show Progress",true) ); } void DefaultConfig::save() { kdDebug() << "DefaultConfig::save()" << endl; - mConfig->setGroup( QString("KSplash Theme: Default") ); + mConfig->setGroup( TQString("KSplash Theme: Default") ); mConfig->writeEntry( "Icons Flashing", mFlash->isChecked() ); mConfig->writeEntry( "Always Show Progress", mAlwaysShow->isChecked() ); mConfig->sync(); @@ -53,7 +53,7 @@ void DefaultConfig::save() #define BIDI 0 -ThemeDefault::ThemeDefault( QWidget *parent, const char *name, const QStringList &args ) +ThemeDefault::ThemeDefault( TQWidget *parent, const char *name, const TQStringList &args ) :ThemeEngine( parent, name, args ) { @@ -65,10 +65,10 @@ ThemeDefault::ThemeDefault( QWidget *parent, const char *name, const QStringList if( mIconsFlashing ) { - mFlashTimer = new QTimer( this ); - connect( mFlashTimer, SIGNAL(timeout()), this, SLOT(flash()) ); - mFlashPixmap1 = new QPixmap(); - mFlashPixmap2 = new QPixmap(); + mFlashTimer = new TQTimer( this ); + connect( mFlashTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(flash()) ); + mFlashPixmap1 = new TQPixmap(); + mFlashPixmap2 = new TQPixmap(); } else @@ -87,30 +87,30 @@ ThemeDefault::~ThemeDefault() void ThemeDefault::_initUi() { - QString resource_prefix; + TQString resource_prefix; - QVBox *vbox = new QVBox( this ); + TQVBox *vbox = new TQVBox( this ); vbox->setBackgroundMode(NoBackground); - QString activePix, inactivePix; + TQString activePix, inactivePix; #if BIDI - if ( QApplication::reverseLayout() ) + if ( TQApplication::reverseLayout() ) { - activePix = _findPicture(QString("splash_active_bar_bidi.png")); - inactivePix = _findPicture(QString("splash_inactive_bar_bidi.png")); + activePix = _findPicture(TQString("splash_active_bar_bidi.png")); + inactivePix = _findPicture(TQString("splash_inactive_bar_bidi.png")); } else #endif { - activePix = _findPicture(QString("splash_active_bar.png")); - inactivePix = _findPicture(QString("splash_inactive_bar.png")); + activePix = _findPicture(TQString("splash_active_bar.png")); + inactivePix = _findPicture(TQString("splash_inactive_bar.png")); } kdDebug() << "Inactive pixmap: " << inactivePix << endl; kdDebug() << "Active pixmap: " << activePix << endl; - mActivePixmap = new QPixmap( activePix ); - mInactivePixmap = new QPixmap( inactivePix ); + mActivePixmap = new TQPixmap( activePix ); + mInactivePixmap = new TQPixmap( inactivePix ); if (mActivePixmap->isNull()) { @@ -123,44 +123,44 @@ void ThemeDefault::_initUi() mInactivePixmap->fill(Qt::black); } - QPixmap tlimage( _findPicture(QString("splash_top.png")) ); + TQPixmap tlimage( _findPicture(TQString("splash_top.png")) ); if (tlimage.isNull()) { tlimage.resize(200,100); tlimage.fill(Qt::blue); } - QLabel *top_label = new QLabel( vbox ); + TQLabel *top_label = new TQLabel( vbox ); top_label->setPixmap( tlimage ); top_label->setFixedSize( tlimage.width(), tlimage.height() ); top_label->setBackgroundMode(NoBackground); - mBarLabel = new QLabel( vbox ); + mBarLabel = new TQLabel( vbox ); mBarLabel->setPixmap(*mInactivePixmap); mBarLabel->setBackgroundMode(NoBackground); - QPixmap blimage( _findPicture(QString("splash_bottom.png")) ); + TQPixmap blimage( _findPicture(TQString("splash_bottom.png")) ); if (blimage.isNull()) { blimage.resize(200,100); blimage.fill(Qt::black); } - QLabel *bottom_label = new QLabel( vbox ); + TQLabel *bottom_label = new TQLabel( vbox ); bottom_label->setPaletteBackgroundPixmap( blimage ); - mLabel = new QLabel( bottom_label ); - mLabel->setBackgroundOrigin( QWidget::ParentOrigin ); + mLabel = new TQLabel( bottom_label ); + mLabel->setBackgroundOrigin( TQWidget::ParentOrigin ); mLabel->setPaletteForegroundColor( mLabelForeground ); mLabel->setPaletteBackgroundPixmap( blimage ); - QFont f(mLabel->font()); + TQFont f(mLabel->font()); f.setBold(TRUE); mLabel->setFont(f); mProgressBar = new KProgress( mLabel ); int h, s, v; mLabelForeground.getHsv( &h, &s, &v ); - mProgressBar->setPalette( QPalette( v > 128 ? black : white )); - mProgressBar->setBackgroundOrigin( QWidget::ParentOrigin ); + mProgressBar->setPalette( TQPalette( v > 128 ? black : white )); + mProgressBar->setBackgroundOrigin( TQWidget::ParentOrigin ); mProgressBar->setPaletteBackgroundPixmap( blimage ); bottom_label->setFixedWidth( QMAX(blimage.width(),tlimage.width()) ); @@ -171,7 +171,7 @@ void ThemeDefault::_initUi() mProgressBar->setFixedSize( 120, mLabel->height() ); - if (QApplication::reverseLayout()){ + if (TQApplication::reverseLayout()){ mProgressBar->move( 2, 0 ); // mLabel->move( mProgressBar->width() + 4, 0); } @@ -186,7 +186,7 @@ void ThemeDefault::_initUi() setFixedHeight( mInactivePixmap->height() + top_label->height() + bottom_label->height() ); - const QRect rect = kapp->desktop()->screenGeometry( mTheme->xineramaScreen() ); + const TQRect rect = kapp->desktop()->screenGeometry( mTheme->xineramaScreen() ); // KGlobalSettings::splashScreenDesktopGeometry(); cannot be used here. // kdDebug() << "ThemeDefault::_initUi" << rect << endl; @@ -204,10 +204,10 @@ void ThemeDefault::_readSettings() if( !cfg ) return; - cfg->setGroup( QString("KSplash Theme: %1").arg(mTheme->theme()) ); + cfg->setGroup( TQString("KSplash Theme: %1").arg(mTheme->theme()) ); mIconsFlashing = cfg->readBoolEntry( "Icons Flashing", true ); - QColor df(Qt::white); + TQColor df(Qt::white); mLabelForeground = cfg->readColorEntry( "Label Foreground", &df ); } @@ -245,16 +245,16 @@ void ThemeDefault::slotUpdateState() * does NOT support our "Restoring Session..." state. We will need * to reflect that somehow. */ -QPixmap ThemeDefault::updateBarPixmap( int state ) +TQPixmap ThemeDefault::updateBarPixmap( int state ) { int offs; - QPixmap x; + TQPixmap x; if( !mActivePixmap ) return( x ); #if BIDI - if( QApplication::reverseLayout() ) + if( TQApplication::reverseLayout() ) { if ( state > 7 ) return ( x ); @@ -267,10 +267,10 @@ QPixmap ThemeDefault::updateBarPixmap( int state ) else if (state == 6) offs -= 8; - QPixmap tmp(*mActivePixmap); - QPainter p(&tmp); + TQPixmap tmp(*mActivePixmap); + TQPainter p(&tmp); #if BIDI - if ( QApplication::reverseLayout() ) + if ( TQApplication::reverseLayout() ) p.drawPixmap(0, 0, *mInactivePixmap, 0, 0, tmp.width()-offs ); else #endif @@ -282,28 +282,28 @@ void ThemeDefault::flash() { if( !mIconsFlashing ) return; - QPixmap *swap = mFlashPixmap1; + TQPixmap *swap = mFlashPixmap1; mFlashPixmap1 = mFlashPixmap2; mFlashPixmap2 = swap; mBarLabel->setPixmap(*mFlashPixmap2); } -QString ThemeDefault::_findPicture( const QString &pic ) +TQString ThemeDefault::_findPicture( const TQString &pic ) { // Don't use ObjKsTheme::locateThemeData here for compatibility reasons. - QString f = pic; + TQString f = pic; if (mTheme->loColor()) - f = QString("locolor/")+f; + f = TQString("locolor/")+f; //kdDebug() << "Searching for " << f << endl; //kdDebug() << "Theme directory: " << mTheme->themeDir() << endl; //kdDebug() << "Theme name: " << mTheme->theme() << endl; - QString p = QString::null; + TQString p = TQString::null; if ((p = locate("appdata",mTheme->themeDir()+f)).isEmpty()) if ((p = locate("appdata",mTheme->themeDir()+"pics/"+f)).isEmpty()) - if ((p = locate("appdata", QString("pics/")+mTheme->theme()+"/"+f)).isEmpty()) + if ((p = locate("appdata", TQString("pics/")+mTheme->theme()+"/"+f)).isEmpty()) if ((p = locate("appdata",f)).isEmpty()) - if ((p = locate("appdata",QString("pics/")+f)).isEmpty()) - if ((p = locate("data",QString("pics/")+f)).isEmpty()) { + if ((p = locate("appdata",TQString("pics/")+f)).isEmpty()) + if ((p = locate("data",TQString("pics/")+f)).isEmpty()) { ; // No more places to search } return p; diff --git a/ksplashml/themeengine/default/themelegacy.h b/ksplashml/themeengine/default/themelegacy.h index b0a6138a9..ed0b8025b 100644 --- a/ksplashml/themeengine/default/themelegacy.h +++ b/ksplashml/themeengine/default/themelegacy.h @@ -15,8 +15,8 @@ #include <kprogress.h> -#include <qlabel.h> -#include <qwidget.h> +#include <tqlabel.h> +#include <tqwidget.h> #include "themeengine.h" class QPixmap; @@ -28,10 +28,10 @@ class DefaultConfig: public ThemeEngineConfig { Q_OBJECT public: - DefaultConfig( QWidget *, KConfig * ); + DefaultConfig( TQWidget *, KConfig * ); void save(); protected: - QCheckBox *mFlash, *mAlwaysShow; + TQCheckBox *mFlash, *mAlwaysShow; }; /** @@ -42,17 +42,17 @@ class KDE_EXPORT ThemeDefault : public ThemeEngine { Q_OBJECT public: - ThemeDefault( QWidget *, const char *, const QStringList& ); + ThemeDefault( TQWidget *, const char *, const TQStringList& ); virtual ~ThemeDefault(); - inline const DefaultConfig *config( QWidget *p, KConfig *c ) + inline const DefaultConfig *config( TQWidget *p, KConfig *c ) { return new DefaultConfig( p, c ); }; - static QStringList names() + static TQStringList names() { - QStringList Names; + TQStringList Names; Names << "Default"; Names << "Classic"; Names << "Klassic"; @@ -60,7 +60,7 @@ public: } public slots: - inline void slotSetText( const QString& s ) + inline void slotSetText( const TQString& s ) { if( mLabel ) mLabel->setText( s ); @@ -79,25 +79,25 @@ public slots: private slots: void slotUpdateState(); - QPixmap updateBarPixmap( int ); + TQPixmap updateBarPixmap( int ); void flash(); private: void _initUi(); void _readSettings(); - QString _findPicture( const QString &pic ); + TQString _findPicture( const TQString &pic ); // Configurable Options bool mIconsFlashing; - QColor mLabelForeground; + TQColor mLabelForeground; // Internals. KProgress *mProgressBar; - QLabel *mLabel, *mBarLabel; - QPixmap *mActivePixmap, *mInactivePixmap; + TQLabel *mLabel, *mBarLabel; + TQPixmap *mActivePixmap, *mInactivePixmap; int mState; - QTimer *mFlashTimer; - QPixmap *mFlashPixmap1, *mFlashPixmap2; + TQTimer *mFlashTimer; + TQPixmap *mFlashPixmap1, *mFlashPixmap2; }; #endif diff --git a/ksplashml/themeengine/objkstheme.cpp b/ksplashml/themeengine/objkstheme.cpp index 955b5f903..8ed1cad2f 100644 --- a/ksplashml/themeengine/objkstheme.cpp +++ b/ksplashml/themeengine/objkstheme.cpp @@ -17,32 +17,32 @@ #include <klocale.h> #include <kstandarddirs.h> -#include <qcolor.h> -#include <qcursor.h> -#include <qdesktopwidget.h> -#include <qfont.h> -#include <qpixmap.h> -#include <qrect.h> -#include <qstring.h> +#include <tqcolor.h> +#include <tqcursor.h> +#include <tqdesktopwidget.h> +#include <tqfont.h> +#include <tqpixmap.h> +#include <tqrect.h> +#include <tqstring.h> #include "objkstheme.h" #include "objkstheme.moc" -ObjKsTheme::ObjKsTheme( const QString& theme ) +ObjKsTheme::ObjKsTheme( const TQString& theme ) :mActiveTheme (theme), mThemeDir("/"), mThemeConfig (0L), mThemePrefix( "Themes/" ), d(0) { // Get Xinerama config. KConfig *config = kapp->config(); config->setGroup( "Xinerama" ); - QDesktopWidget *desktop = kapp->desktop(); + TQDesktopWidget *desktop = kapp->desktop(); mXineramaScreen = config->readNumEntry("KSplashScreen", desktop->primaryScreen()); // For Xinerama, let's put the mouse on the first head. Otherwise it could appear anywhere! if (desktop->isVirtualDesktop() && mXineramaScreen != -2) { - QRect rect = desktop->screenGeometry( mXineramaScreen ); - if (!rect.contains(QCursor::pos())) - QCursor::setPos(rect.center()); + TQRect rect = desktop->screenGeometry( mXineramaScreen ); + if (!rect.contains(TQCursor::pos())) + TQCursor::setPos(rect.center()); } // Does the active theme exist? @@ -58,18 +58,18 @@ ObjKsTheme::~ObjKsTheme() { } -bool ObjKsTheme::loadThemeRc( const QString& activeTheme, bool force ) +bool ObjKsTheme::loadThemeRc( const TQString& activeTheme, bool force ) { //kdDebug() << "ObjKsTheme::loadThemeRc: " << activeTheme << endl; - QString prefix("Themes/"); - QString themeFile; + TQString prefix("Themes/"); + TQString themeFile; KConfig *cf = 0L; // Try our best to find a theme file. - themeFile = locate( "appdata", prefix + activeTheme + "/" + QString("Theme.rc") ); - themeFile = themeFile.isEmpty() ? locate("appdata",prefix+activeTheme+"/"+QString("Theme.RC")):themeFile; - themeFile = themeFile.isEmpty() ? locate("appdata",prefix+activeTheme+"/"+QString("theme.rc")):themeFile; - themeFile = themeFile.isEmpty() ? locate("appdata",prefix+activeTheme+"/"+activeTheme+QString(".rc")):themeFile; + themeFile = locate( "appdata", prefix + activeTheme + "/" + TQString("Theme.rc") ); + themeFile = themeFile.isEmpty() ? locate("appdata",prefix+activeTheme+"/"+TQString("Theme.RC")):themeFile; + themeFile = themeFile.isEmpty() ? locate("appdata",prefix+activeTheme+"/"+TQString("theme.rc")):themeFile; + themeFile = themeFile.isEmpty() ? locate("appdata",prefix+activeTheme+"/"+activeTheme+TQString(".rc")):themeFile; if( !themeFile.isEmpty() ) cf = new KConfig( themeFile ); @@ -89,7 +89,7 @@ bool ObjKsTheme::loadThemeRc( const QString& activeTheme, bool force ) return false; } -bool ObjKsTheme::loadLocalConfig( const QString& activeTheme, bool force ) +bool ObjKsTheme::loadLocalConfig( const TQString& activeTheme, bool force ) { //kdDebug() << "ObjKsTheme::loadLocalConfig" << endl; KConfig *cfg = kapp->config(); @@ -97,7 +97,7 @@ bool ObjKsTheme::loadLocalConfig( const QString& activeTheme, bool force ) } // ObjKsConfig::loadKConfig(): Load our settings from a KConfig object. -bool ObjKsTheme::loadKConfig( KConfig *cfg, const QString& activeTheme, bool force ) +bool ObjKsTheme::loadKConfig( KConfig *cfg, const TQString& activeTheme, bool force ) { //kdDebug() << "ObjKsTheme::loadKConfig" << endl; if( !cfg ) @@ -106,10 +106,10 @@ bool ObjKsTheme::loadKConfig( KConfig *cfg, const QString& activeTheme, bool for // Themes are always stored in the group [KSplash Theme: ThemeName], // and ThemeName should always be the same name as the themedir, if any. // If we can't find this theme group, then we can't load. - if( !cfg->hasGroup( QString("KSplash Theme: %1").arg(activeTheme) ) && !force ) + if( !cfg->hasGroup( TQString("KSplash Theme: %1").arg(activeTheme) ) && !force ) return false; - cfg->setGroup( QString("KSplash Theme: %1").arg(activeTheme) ); + cfg->setGroup( TQString("KSplash Theme: %1").arg(activeTheme) ); mThemeConfig = cfg; mThemeEngine = cfg->readEntry( "Engine", "Default" ); @@ -146,21 +146,21 @@ void ObjKsTheme::loadCmdLineArgs( KCmdLineArgs *args ) mManagedMode = args->isSet( "managed" ); mTesting = args->isSet("test"); - mLoColor = ( QPixmap::defaultDepth() <= 8 ); - QString theme = args->getOption( "theme" ); + mLoColor = ( TQPixmap::defaultDepth() <= 8 ); + TQString theme = args->getOption( "theme" ); if( theme != mActiveTheme && !theme.isNull() ) if( loadThemeRc( theme, false ) ) mActiveTheme = theme; //args->clear(); } -QString ObjKsTheme::locateThemeData( const QString &resource ) +TQString ObjKsTheme::locateThemeData( const TQString &resource ) { if ( !mLoColor ) return locate( "appdata", mThemePrefix+resource ); else { - QString res = locate( "appdata", mThemePrefix+"locolor/"+resource ); + TQString res = locate( "appdata", mThemePrefix+"locolor/"+resource ); if ( res.isEmpty() ) res = locate( "appdata", mThemePrefix+resource ); return res; diff --git a/ksplashml/themeengine/objkstheme.h b/ksplashml/themeengine/objkstheme.h index 9685d4529..504fe2860 100644 --- a/ksplashml/themeengine/objkstheme.h +++ b/ksplashml/themeengine/objkstheme.h @@ -14,8 +14,8 @@ #include <kcmdlineargs.h> -#include <qstring.h> -#include <qstringlist.h> +#include <tqstring.h> +#include <tqstringlist.h> class KConfig; /** @@ -30,38 +30,38 @@ class KDE_EXPORT ObjKsTheme : public QObject { Q_OBJECT public: - explicit ObjKsTheme( const QString& ); + explicit ObjKsTheme( const TQString& ); virtual ~ObjKsTheme(); void loadCmdLineArgs( KCmdLineArgs * ); - QString theme() const { return( mActiveTheme ); } - QString themeEngine() const { return( mThemeEngine ); } + TQString theme() const { return( mActiveTheme ); } + TQString themeEngine() const { return( mThemeEngine ); } KConfig *themeConfig() const { return( mThemeConfig ); } - QString themeDir() const { return( mThemeDir ); } + TQString themeDir() const { return( mThemeDir ); } bool loColor() const { return( mLoColor ); } bool testing() const { return( mTesting ); } bool managedMode() const { return( mManagedMode ); } - QString icon( int i ) { return (m_icons[i-1].isNull()?(QString::null):m_icons[i-1]); } - QString text( int i ) { return (m_text[i-1].isNull()?(QString::null):m_text[i-1]); } - QString locateThemeData( const QString &resource ); + TQString icon( int i ) { return (m_icons[i-1].isNull()?(TQString::null):m_icons[i-1]); } + TQString text( int i ) { return (m_text[i-1].isNull()?(TQString::null):m_text[i-1]); } + TQString locateThemeData( const TQString &resource ); int xineramaScreen() const { return mXineramaScreen; } protected: - bool loadThemeRc( const QString&, bool ); - bool loadLocalConfig( const QString&, bool ); - bool loadKConfig( KConfig *, const QString&, bool ); + bool loadThemeRc( const TQString&, bool ); + bool loadLocalConfig( const TQString&, bool ); + bool loadKConfig( KConfig *, const TQString&, bool ); private: - QString mActiveTheme, mThemeDir; + TQString mActiveTheme, mThemeDir; KConfig *mThemeConfig; int mXineramaScreen; bool mLoColor, mTesting, mManagedMode; - QString mThemeEngine; - QString mThemePrefix; + TQString mThemeEngine; + TQString mThemePrefix; - QStringList m_icons, m_text; + TQStringList m_icons, m_text; class ObjKsThemePrivate; ObjKsThemePrivate *d; diff --git a/ksplashml/themeengine/redmond/main.cpp b/ksplashml/themeengine/redmond/main.cpp index 2da3c5f09..3f4dc0124 100644 --- a/ksplashml/themeengine/redmond/main.cpp +++ b/ksplashml/themeengine/redmond/main.cpp @@ -12,25 +12,25 @@ #include <kstandarddirs.h> -#include <qlabel.h> -#include <qpixmap.h> -#include <qwidget.h> +#include <tqlabel.h> +#include <tqpixmap.h> +#include <tqwidget.h> #include "themeredmond.h" extern "C" { - ThemeEngineConfig *KsThemeConfig( QWidget *parent, KConfig *config ) + ThemeEngineConfig *KsThemeConfig( TQWidget *parent, KConfig *config ) { return new CfgRedmond( parent, config ); } - QStringList KsThemeSupports() + TQStringList KsThemeSupports() { return ThemeRedmond::names(); } - void* KsThemeInit( QWidget *parent, ObjKsTheme *theme ) + void* KsThemeInit( TQWidget *parent, ObjKsTheme *theme ) { return new ThemeRedmond( parent, theme ); } diff --git a/ksplashml/themeengine/redmond/previewredmond.cpp b/ksplashml/themeengine/redmond/previewredmond.cpp index 6685a6987..3bfb80203 100644 --- a/ksplashml/themeengine/redmond/previewredmond.cpp +++ b/ksplashml/themeengine/redmond/previewredmond.cpp @@ -12,9 +12,9 @@ #include <klocale.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qwidget.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqwidget.h> #include "previewredmond.h" #include "previewredmond.moc" @@ -22,16 +22,16 @@ * PreviewRedmond::PreviewRedmond(): Constructor. Set up some basic * things. */ -PreviewRedmond::PreviewRedmond( QWidget* parent ) - :QWidget( parent ), +PreviewRedmond::PreviewRedmond( TQWidget* parent ) + :TQWidget( parent ), /* Using direct constructors to prevent memory blit. */ m_welcomeString (i18n("Welcome")), m_userString (i18n("(Your Name)")), - m_welcomeFont (QFont( "Arial", 16, QFont::Bold )), - m_userFont (QFont( "Arial", 16 )), - m_statusFont (QFont( "Arial", 12, QFont::Bold )), + m_welcomeFont (TQFont( "Arial", 16, TQFont::Bold )), + m_userFont (TQFont( "Arial", 16 )), + m_statusFont (TQFont( "Arial", 12, TQFont::Bold )), m_welcomeColor (Qt::white), m_welcomeShadowColor (Qt::darkGray), @@ -48,17 +48,17 @@ PreviewRedmond::PreviewRedmond( QWidget* parent ) _updateCache(); } -void PreviewRedmond::paintEvent( QPaintEvent* pe ) +void PreviewRedmond::paintEvent( TQPaintEvent* pe ) { - QPainter p; + TQPainter p; p.begin( this ); p.drawPixmap( pe->rect(), m_cache ); p.end(); } -void PreviewRedmond::resizeEvent( QResizeEvent *re ) +void PreviewRedmond::resizeEvent( TQResizeEvent *re ) { - QWidget::resizeEvent( re ); + TQWidget::resizeEvent( re ); _updateCache(); } @@ -67,8 +67,8 @@ void PreviewRedmond::resizeEvent( QResizeEvent *re ) // from size(), just to be sure we're not missing anything. void PreviewRedmond::_updateCache() { - m_cache = QPixmap( size() ); - QPainter p; + m_cache = TQPixmap( size() ); + TQPainter p; p.begin( &m_cache ); p.fillRect( rect(), Qt::gray ); @@ -76,7 +76,7 @@ void PreviewRedmond::_updateCache() m_welcomeFont.setItalic( true ); p.setFont( m_welcomeFont ); - QPoint welcomeTextPos( rect().width()/2 - p.fontMetrics().width( m_welcomeString ), + TQPoint welcomeTextPos( rect().width()/2 - p.fontMetrics().width( m_welcomeString ), rect().height()/2 + p.fontMetrics().height()/2 ); if( m_showWelcomeString ) @@ -91,7 +91,7 @@ void PreviewRedmond::_updateCache() { p.setPen( m_userColor ); p.setFont( m_userFont ); - QPoint userTextPos( rect().width()/2 + m_icon.width() + 20, + TQPoint userTextPos( rect().width()/2 + m_icon.width() + 20, rect().height()/2 + p.fontMetrics().height()/2 ); p.drawText( userTextPos, m_userString ); } @@ -101,7 +101,7 @@ void PreviewRedmond::_updateCache() if( m_showStatusString ) { - QPoint statusTextPos( rect().width()/2 + m_icon.width() + 20, + TQPoint statusTextPos( rect().width()/2 + m_icon.width() + 20, rect().height()/2 + (int)(p.fontMetrics().height()*0.85) + 15 ); p.setPen( m_statusColor ); p.setFont( m_statusFont ); diff --git a/ksplashml/themeengine/redmond/previewredmond.h b/ksplashml/themeengine/redmond/previewredmond.h index 3b67f293b..69bef6b43 100644 --- a/ksplashml/themeengine/redmond/previewredmond.h +++ b/ksplashml/themeengine/redmond/previewredmond.h @@ -15,9 +15,9 @@ #include <kiconloader.h> -#include <qcolor.h> -#include <qfont.h> -#include <qwidget.h> +#include <tqcolor.h> +#include <tqfont.h> +#include <tqwidget.h> /* * class PreviewRedmond: Provides a sneak peek at how certain Redmond @@ -30,57 +30,57 @@ class PreviewRedmond: public QWidget Q_OBJECT public: - PreviewRedmond( QWidget* ); + PreviewRedmond( TQWidget* ); - inline void setWelcomeString( const QString& s ) + inline void setWelcomeString( const TQString& s ) { m_welcomeString = s; _updateCache(); } - inline void setUserString( const QString& s ) + inline void setUserString( const TQString& s ) { m_userString = s; _updateCache(); } - inline void setWelcomeFont( const QFont& f ) + inline void setWelcomeFont( const TQFont& f ) { m_welcomeFont = f; _updateCache(); } - inline void setUserFont( const QFont& f ) + inline void setUserFont( const TQFont& f ) { m_userFont = f; _updateCache(); } - inline void setStatusFont( const QFont& f ) + inline void setStatusFont( const TQFont& f ) { m_statusFont = f; _updateCache(); } - inline void setWelcomeColor( const QColor& c ) + inline void setWelcomeColor( const TQColor& c ) { m_welcomeColor = c; _updateCache(); } - inline void setWelcomeShadowColor( const QColor& c ) + inline void setWelcomeShadowColor( const TQColor& c ) { m_welcomeShadowColor = c; _updateCache(); } - inline void setUserColor( const QColor& c ) + inline void setUserColor( const TQColor& c ) { m_userColor = c; _updateCache(); } - inline void setStatusColor( const QColor& c ) + inline void setStatusColor( const TQColor& c ) { m_statusColor = c; _updateCache(); } - inline void setIcon( const QString& s ) + inline void setIcon( const TQString& s ) { m_icon = DesktopIcon( s ); _updateCache(); @@ -88,15 +88,15 @@ public: protected: void _updateCache(); - void paintEvent( QPaintEvent* ); - void resizeEvent( QResizeEvent* ); + void paintEvent( TQPaintEvent* ); + void resizeEvent( TQResizeEvent* ); - QPixmap m_cache; + TQPixmap m_cache; - QString m_welcomeString, m_userString; - QFont m_welcomeFont, m_userFont, m_statusFont; - QColor m_welcomeColor, m_welcomeShadowColor, m_userColor, m_statusColor; - QPixmap m_icon; + TQString m_welcomeString, m_userString; + TQFont m_welcomeFont, m_userFont, m_statusFont; + TQColor m_welcomeColor, m_welcomeShadowColor, m_userColor, m_statusColor; + TQPixmap m_icon; bool m_showWelcomeString, m_showUserString, m_showUserIcon, m_showStatusString; }; diff --git a/ksplashml/themeengine/redmond/themeredmond.cpp b/ksplashml/themeengine/redmond/themeredmond.cpp index 6181980b6..5c7118441 100644 --- a/ksplashml/themeengine/redmond/themeredmond.cpp +++ b/ksplashml/themeengine/redmond/themeredmond.cpp @@ -26,13 +26,13 @@ #include <kuser.h> #include <kemailsettings.h> -#include <qcheckbox.h> -#include <qdesktopwidget.h> -#include <qlabel.h> -#include <qpainter.h> -#include <qrect.h> -#include <qstringlist.h> -#include <qwidget.h> +#include <tqcheckbox.h> +#include <tqdesktopwidget.h> +#include <tqlabel.h> +#include <tqpainter.h> +#include <tqrect.h> +#include <tqstringlist.h> +#include <tqwidget.h> #include <objkstheme.h> #include "themeredmond.h" @@ -41,22 +41,22 @@ K_EXPORT_COMPONENT_FACTORY( ksplashredmond, KGenericFactory<ThemeRedmond>( "ksplash" ) ) -CfgRedmond::CfgRedmond( QWidget *p, KConfig *c ) +CfgRedmond::CfgRedmond( TQWidget *p, KConfig *c ) :ThemeEngineConfig( p, c ) { - QVBox *vbox = new QVBox( this ); + TQVBox *vbox = new TQVBox( this ); vbox->setSpacing( KDialog::spacingHint() ); - QFont defaultFont( "Arial", 48, QFont::Bold ); + TQFont defaultFont( "Arial", 48, TQFont::Bold ); defaultFont.setItalic( true ); - QFont defaultUsernameFont( "Arial", 16, QFont::Bold ); - QFont defaultActionFont( "Arial", 12, QFont::Bold ); - QColor defaultDarkColor( 3, 47, 156 ); - QColor defaultWhiteColor( Qt::white ); - - QHBox *hbox = new QHBox( vbox ); - hbox->setFrameStyle( QFrame::WinPanel ); - hbox->setFrameShadow( QFrame::Sunken ); + TQFont defaultUsernameFont( "Arial", 16, TQFont::Bold ); + TQFont defaultActionFont( "Arial", 12, TQFont::Bold ); + TQColor defaultDarkColor( 3, 47, 156 ); + TQColor defaultWhiteColor( Qt::white ); + + TQHBox *hbox = new TQHBox( vbox ); + hbox->setFrameStyle( TQFrame::WinPanel ); + hbox->setFrameShadow( TQFrame::Sunken ); PreviewRedmond* _preview = new PreviewRedmond( hbox ); _preview->setFixedSize( 320, 200 ); @@ -73,11 +73,11 @@ CfgRedmond::CfgRedmond( QWidget *p, KConfig *c ) _preview->setIcon( c->readEntry( "User Icon", "kmenu" ) ); - QLabel *lbl = new QLabel( vbox ); + TQLabel *lbl = new TQLabel( vbox ); lbl->setText( i18n("(Sorry, but I haven't finished writing this one yet...)") ); } -ThemeRedmond::ThemeRedmond( QWidget *parent, const char *name, const QStringList &args ) +ThemeRedmond::ThemeRedmond( TQWidget *parent, const char *name, const TQStringList &args ) :ThemeEngine( parent, name, args ) { _readSettings(); @@ -86,17 +86,17 @@ ThemeRedmond::ThemeRedmond( QWidget *parent, const char *name, const QStringList void ThemeRedmond::_initUi() { - const QRect screen = kapp->desktop()->screenGeometry( mTheme->xineramaScreen() ); - //QRect fullScreen = KGlobalSettings::desktopGeometry(0L); + const TQRect screen = kapp->desktop()->screenGeometry( mTheme->xineramaScreen() ); + //TQRect fullScreen = KGlobalSettings::desktopGeometry(0L); mImage.resize( screen.width(), screen.height() ); - QPainter p; + TQPainter p; p.begin( &mImage ); - p.fillRect( screen, QColor(3,47,156) ); + p.fillRect( screen, TQColor(3,47,156) ); p.setPen( mActionTextColor ); - QString bgimg; + TQString bgimg; // Start by seeing if the theme prefers a particular image. if( !mBackgroundImage.isEmpty() ) @@ -119,7 +119,7 @@ void ThemeRedmond::_initUi() * 1024x768 images.) */ if( bgimg.isEmpty() ) - bgimg = mTheme->locateThemeData( QString( "Background-%2x%3.png" ).arg( screen.width() ).arg( screen.height() ) ); + bgimg = mTheme->locateThemeData( TQString( "Background-%2x%3.png" ).arg( screen.width() ).arg( screen.height() ) ); // If that can't be found, look for THEMEDIR/Background.png if( bgimg.isNull() && !mTheme->themeDir().isNull() ) @@ -128,36 +128,36 @@ void ThemeRedmond::_initUi() if( mPixmap.isNull() ) mPixmap = DesktopIcon( "kmenu", 48 ); - QPixmap pix( bgimg ); + TQPixmap pix( bgimg ); if( !pix.isNull() ) { - QPixmap tmp( QSize(screen.width(), screen.height() ) ); + TQPixmap tmp( TQSize(screen.width(), screen.height() ) ); float sw = (float)screen.width() / pix.width(); float sh = (float)(screen.height()) / pix.height(); - QWMatrix matrix; + TQWMatrix matrix; matrix.scale( sw, sh ); tmp = pix.xForm( matrix ); p.drawPixmap( 0, 0, tmp ); } - QFont f = mWelcomeFont; + TQFont f = mWelcomeFont; if( mWelcomeFontItalic ) - f.setItalic( true ); // this SHOULD BE stored in the QFont entry, dang it. + f.setItalic( true ); // this SHOULD BE stored in the TQFont entry, dang it. p.setFont( f ); - QFontMetrics met( f ); - QSize fmet = met.size( 0L, mWelcomeText ); + TQFontMetrics met( f ); + TQSize fmet = met.size( 0L, mWelcomeText ); // Paint the "Welcome" message, if we are instructed to. Optionally dispense with the // shadow. if ( mShowWelcomeText ) { - if( mWelcomeTextPosition == QPoint( 0, 0 ) ) + if( mWelcomeTextPosition == TQPoint( 0, 0 ) ) { - mWelcomeTextPosition = QPoint( (screen.width()/2) - fmet.width() - 25, + mWelcomeTextPosition = TQPoint( (screen.width()/2) - fmet.width() - 25, (screen.height()/2) - (fmet.height()/2) + fmet.height() ); } } @@ -167,7 +167,7 @@ void ThemeRedmond::_initUi() if( mShowWelcomeTextShadow ) { p.setPen( mWelcomeTextShadowColor ); - p.drawText( mWelcomeTextPosition+QPoint(2,2), mWelcomeText ); + p.drawText( mWelcomeTextPosition+TQPoint(2,2), mWelcomeText ); } p.setPen( mWelcomeTextColor ); p.drawText( mWelcomeTextPosition, mWelcomeText ); @@ -176,7 +176,7 @@ void ThemeRedmond::_initUi() // The current theme wants to say something in particular, rather than display the // account's fullname. KUser user; - QString greetingString = ( !mUsernameText.isNull() ) ? mUsernameText : user.fullName(); + TQString greetingString = ( !mUsernameText.isNull() ) ? mUsernameText : user.fullName(); // when we use KUser (system account data) we should also check KEMailSettings (e-mail settings and kcm_useraccount) // people often write real names only in e-mail settings if ( greetingString.isEmpty() ) @@ -188,7 +188,7 @@ void ThemeRedmond::_initUi() // Try to load the user's KDM icon... TODO: Make this overridable by the Theme. if( mUseKdmUserIcon ) { - const QString defSys( ".default.face.icon" ); // The system-wide default image + const TQString defSys( ".default.face.icon" ); // The system-wide default image const int fAdminOnly = 1; const int fAdminFirst = fAdminOnly+1; const int fUserFirst = fAdminFirst+1; @@ -197,41 +197,41 @@ void ThemeRedmond::_initUi() int faceSource = fAdminOnly; KConfig *kdmconfig = new KConfig("kdm/kdmrc", true); kdmconfig->setGroup("X-*-Greeter"); - QString userPicsDir = kdmconfig->readEntry( "FaceDir", KGlobal::dirs()->resourceDirs("data").last() + "kdm/faces" ) + '/'; - QString fs = kdmconfig->readEntry( "FaceSource" ); - if (fs == QString::fromLatin1("UserOnly")) + TQString userPicsDir = kdmconfig->readEntry( "FaceDir", KGlobal::dirs()->resourceDirs("data").last() + "kdm/faces" ) + '/'; + TQString fs = kdmconfig->readEntry( "FaceSource" ); + if (fs == TQString::fromLatin1("UserOnly")) faceSource = fUserOnly; - else if (fs == QString::fromLatin1("PreferUser")) + else if (fs == TQString::fromLatin1("PreferUser")) faceSource = fUserFirst; - else if (fs == QString::fromLatin1("PreferAdmin")) + else if (fs == TQString::fromLatin1("PreferAdmin")) faceSource = fAdminFirst; else faceSource = fAdminOnly; // Admin Only delete kdmconfig; - QPixmap userp; + TQPixmap userp; if ( faceSource == fAdminFirst ) { // If the administrator's choice takes preference - userp = QPixmap( userPicsDir + user.loginName() + ".face.icon" ); + userp = TQPixmap( userPicsDir + user.loginName() + ".face.icon" ); if ( userp.isNull() ) faceSource = fUserOnly; } if ( faceSource >= fUserFirst) { // If the user's choice takes preference - userp = QPixmap( user.homeDir() + "/.face.icon" ); + userp = TQPixmap( user.homeDir() + "/.face.icon" ); if ( userp.isNull() && faceSource == fUserFirst ) // The user has no face, should we check for the admin's setting? - userp = QPixmap( userPicsDir + user.loginName() + ".face.icon" ); + userp = TQPixmap( userPicsDir + user.loginName() + ".face.icon" ); if ( userp.isNull() ) - userp = QPixmap( userPicsDir + defSys ); + userp = TQPixmap( userPicsDir + defSys ); } else if ( faceSource <= fAdminOnly ) { // Admin only - userp = QPixmap( userPicsDir + user.loginName() + ".face.icon" ); + userp = TQPixmap( userPicsDir + user.loginName() + ".face.icon" ); if ( userp.isNull() ) - userp = QPixmap( userPicsDir + defSys ); + userp = TQPixmap( userPicsDir + defSys ); } if( !userp.isNull() ) mPixmap = userp; @@ -239,10 +239,10 @@ void ThemeRedmond::_initUi() if( mShowIcon ) { - QPoint pos = mIconPosition; - if( pos == QPoint( 0, 0 ) ) + TQPoint pos = mIconPosition; + if( pos == TQPoint( 0, 0 ) ) { - pos = QPoint( (screen.width()/2) + 10, (screen.height()/2) ); + pos = TQPoint( (screen.width()/2) + 10, (screen.height()/2) ); } p.drawPixmap( pos, mPixmap ); } @@ -250,15 +250,15 @@ void ThemeRedmond::_initUi() // User name font. Leave this nailed-up for now. f = mUsernameFont; p.setFont( f ); - met = QFontMetrics( f ); + met = TQFontMetrics( f ); fmet = met.size( 0L, greetingString ); if( mShowUsernameText ) { - QPoint pos = mUsernameTextPosition; - if( pos == QPoint( 0, 0 ) ) + TQPoint pos = mUsernameTextPosition; + if( pos == TQPoint( 0, 0 ) ) { - pos = QPoint( + pos = TQPoint( (screen.width()/2) + mPixmap.width() + 20, (screen.height()/2) - (fmet.height()/2) + fmet.height() ); @@ -273,14 +273,14 @@ void ThemeRedmond::_initUi() move( screen.topLeft() ); } -void ThemeRedmond::paintEvent( QPaintEvent *pe ) +void ThemeRedmond::paintEvent( TQPaintEvent *pe ) { - const QRect screen = kapp->desktop()->screenGeometry( mTheme->xineramaScreen() ); + const TQRect screen = kapp->desktop()->screenGeometry( mTheme->xineramaScreen() ); - QPainter p; + TQPainter p; p.begin( this ); - QRect r = pe->rect(); + TQRect r = pe->rect(); bitBlt( this, r.x(), r.y(), &mImage, r.x(), r.y(), r.width(), r.height() ); @@ -288,15 +288,15 @@ void ThemeRedmond::paintEvent( QPaintEvent *pe ) if (mShowActionText) { p.setPen( mActionTextColor ); - QFont f = mActionFont; + TQFont f = mActionFont; p.setFont( f ); - QFontMetrics met( f ); - QSize fmet = met.size( 0L, mText ); + TQFontMetrics met( f ); + TQSize fmet = met.size( 0L, mText ); mMsgPos = mActionTextPosition; - if( mMsgPos == QPoint( 0, 0 ) ) + if( mMsgPos == TQPoint( 0, 0 ) ) { - mMsgPos = QPoint( + mMsgPos = TQPoint( (screen.width()/2) + mPixmap.width() + 20, (screen.height()/2) + (int)(fmet.height()*0.85) + 15 ); @@ -308,8 +308,8 @@ void ThemeRedmond::paintEvent( QPaintEvent *pe ) void ThemeRedmond::_readSettings() { - const QRect screen = kapp->desktop()->screenGeometry( mTheme->xineramaScreen() ); - //QRect fullScreen = KGlobalSettings::desktopGeometry(0L); + const TQRect screen = kapp->desktop()->screenGeometry( mTheme->xineramaScreen() ); + //TQRect fullScreen = KGlobalSettings::desktopGeometry(0L); if( !mTheme ) return; @@ -317,23 +317,23 @@ void ThemeRedmond::_readSettings() if( !cfg ) return; - //if( !cfg->hasGroup( QString("KSplash Theme: %1").arg(mTheme->theme()) ) ) + //if( !cfg->hasGroup( TQString("KSplash Theme: %1").arg(mTheme->theme()) ) ) // return; - cfg->setGroup( QString("KSplash Theme: %1").arg(mTheme->theme()) ); + cfg->setGroup( TQString("KSplash Theme: %1").arg(mTheme->theme()) ); // Overall appearance - mBackgroundImage = cfg->readEntry( "Background Image", QString::null ); + mBackgroundImage = cfg->readEntry( "Background Image", TQString::null ); mIcon = cfg->readEntry( "User Icon", "kmenu" ); mWelcomeText = cfg->readEntry( "Welcome Text", i18n("Welcome") ); - mUsernameText = cfg->readEntry( "Username Text", QString::null ); + mUsernameText = cfg->readEntry( "Username Text", TQString::null ); // If any of these are set to (0,0), then we will autoposition the text later (and it _will_ // be centered on the screen!). The Theme may move this text however the author desires. - QPoint absZero( 0, 0 ); - mWelcomeTextPosition = cfg->readPointEntry( QString("Welcome Text Position %1").arg(screen.width()), &absZero ); - mUsernameTextPosition = cfg->readPointEntry( QString("Username Text Position %1").arg(screen.width()), &absZero ); - mActionTextPosition = cfg->readPointEntry( QString("Action Text Position %1").arg(screen.width()), &absZero ); - mIconPosition = cfg->readPointEntry( QString("Icon Position %1").arg(screen.width()), &absZero ); + TQPoint absZero( 0, 0 ); + mWelcomeTextPosition = cfg->readPointEntry( TQString("Welcome Text Position %1").arg(screen.width()), &absZero ); + mUsernameTextPosition = cfg->readPointEntry( TQString("Username Text Position %1").arg(screen.width()), &absZero ); + mActionTextPosition = cfg->readPointEntry( TQString("Action Text Position %1").arg(screen.width()), &absZero ); + mIconPosition = cfg->readPointEntry( TQString("Icon Position %1").arg(screen.width()), &absZero ); // Allow the Theme to hide particular components. mShowWelcomeText = cfg->readBoolEntry( "Show Welcome Text", true ); @@ -345,18 +345,18 @@ void ThemeRedmond::_readSettings() // Setup our fonts. There are only 3 elements which use 'em, so this is fairly // straightforward. - QFont defaultFont( "Arial", 48, QFont::Bold ); + TQFont defaultFont( "Arial", 48, TQFont::Bold ); defaultFont.setItalic( true ); - QFont defaultUsernameFont( "Arial", 16, QFont::Bold ); - QFont defaultActionFont( "Arial", 12, QFont::Bold ); + TQFont defaultUsernameFont( "Arial", 16, TQFont::Bold ); + TQFont defaultActionFont( "Arial", 12, TQFont::Bold ); mWelcomeFont = cfg->readFontEntry( "Welcome Font", &defaultFont ); mWelcomeFontItalic = cfg->readBoolEntry( "Welcome Font Italic", true ); mUsernameFont = cfg->readFontEntry( "Username Font", &defaultUsernameFont ); mActionFont = cfg->readFontEntry( "Action Font", &defaultActionFont ); - QColor defaultDarkColor( 3, 47, 156 ); - QColor defaultWhiteColor( Qt::white ); + TQColor defaultDarkColor( 3, 47, 156 ); + TQColor defaultWhiteColor( Qt::white ); mWelcomeTextColor = cfg->readColorEntry( "Welcome Text Color", &defaultWhiteColor ); mWelcomeTextShadowColor = cfg->readColorEntry( "Welcome Shadow Color", &defaultDarkColor ); diff --git a/ksplashml/themeengine/redmond/themeredmond.h b/ksplashml/themeengine/redmond/themeredmond.h index a35662181..bbde2ddf6 100644 --- a/ksplashml/themeengine/redmond/themeredmond.h +++ b/ksplashml/themeengine/redmond/themeredmond.h @@ -25,12 +25,12 @@ class CfgRedmond: public ThemeEngineConfig { Q_OBJECT public: - CfgRedmond( QWidget *, KConfig * ); + CfgRedmond( TQWidget *, KConfig * ); protected: - QCheckBox *mShowUsername; - QCheckBox *mShowIcon; - QCheckBox *mShowWelcome; + TQCheckBox *mShowUsername; + TQCheckBox *mShowIcon; + TQCheckBox *mShowWelcome; KFontCombo *mWelcomeFont; KFontCombo *mUsernameFont; KFontCombo *mActionFont; @@ -41,18 +41,18 @@ class ThemeRedmond: public ThemeEngine { Q_OBJECT public: - ThemeRedmond( QWidget *, const char *, const QStringList& ); + ThemeRedmond( TQWidget *, const char *, const TQStringList& ); - inline const QString name() { return( QString("Redmond") ); } - static QStringList names() + inline const TQString name() { return( TQString("Redmond") ); } + static TQStringList names() { - QStringList Names; + TQStringList Names; Names << "Redmond"; return( Names ); }; public slots: - inline void slotSetText( const QString& s ) + inline void slotSetText( const TQString& s ) { if( mText != s ) { @@ -62,15 +62,15 @@ public slots: }; private: - void paintEvent( QPaintEvent * ); + void paintEvent( TQPaintEvent * ); void _initUi(); void _readSettings(); - QString mText; - QPixmap mPixmap; + TQString mText; + TQPixmap mPixmap; bool mRedrawKonqi; - QPoint mMsgPos; + TQPoint mMsgPos; KPixmap mImage; // ThemeEngine configuration. @@ -81,21 +81,21 @@ private: bool mShowActionText; bool mShowIcon; bool mUseKdmUserIcon; - QString mBackgroundImage; - QString mWelcomeText; - QString mUsernameText; // Leave this undefined to autodetect the username. - QString mIcon; - QFont mWelcomeFont; - QFont mUsernameFont; - QFont mActionFont; - QColor mWelcomeTextColor; - QColor mWelcomeTextShadowColor; - QColor mUsernameTextColor; - QColor mActionTextColor; - QPoint mWelcomeTextPosition; // Set this to (0,0) to autoposition the text. - QPoint mUsernameTextPosition; // Likewise. - QPoint mActionTextPosition; // Likewise likewise. - QPoint mIconPosition; // ... + TQString mBackgroundImage; + TQString mWelcomeText; + TQString mUsernameText; // Leave this undefined to autodetect the username. + TQString mIcon; + TQFont mWelcomeFont; + TQFont mUsernameFont; + TQFont mActionFont; + TQColor mWelcomeTextColor; + TQColor mWelcomeTextShadowColor; + TQColor mUsernameTextColor; + TQColor mActionTextColor; + TQPoint mWelcomeTextPosition; // Set this to (0,0) to autoposition the text. + TQPoint mUsernameTextPosition; // Likewise. + TQPoint mActionTextPosition; // Likewise likewise. + TQPoint mIconPosition; // ... } ; diff --git a/ksplashml/themeengine/standard/themestandard.cpp b/ksplashml/themeengine/standard/themestandard.cpp index ff7929bfe..c7e9220e2 100644 --- a/ksplashml/themeengine/standard/themestandard.cpp +++ b/ksplashml/themeengine/standard/themestandard.cpp @@ -18,11 +18,11 @@ #include <kstandarddirs.h> #include <kconfig.h> -#include <qdesktopwidget.h> -#include <qlabel.h> -#include <qpalette.h> -#include <qpixmap.h> -#include <qwidget.h> +#include <tqdesktopwidget.h> +#include <tqlabel.h> +#include <tqpalette.h> +#include <tqpixmap.h> +#include <tqwidget.h> #include <objkstheme.h> #include "themestandard.h" @@ -30,10 +30,10 @@ #include "wndicon.h" #include "wndstatus.h" -ThemeStandard::ThemeStandard( QWidget *parent, const char *name, const QStringList &args ) +ThemeStandard::ThemeStandard( TQWidget *parent, const char *name, const TQStringList &args ) :ThemeEngine( parent, name, args ), mIcon(0L), mPrevIcon(0L), mIconCount(0), mStdIconWidth(-1), mIconPos(WndIcon::HBottomLeft), mSbAtTop(false), mSbVisible(true), mSbPbVisible(true), mSbFontName("helvetica"), - mSbFontSz(16), mSbFontBold(true), mSbFontItalic(false), mSbFont(QFont()), mSbFg(QColor()), mSbBg(QColor()), + mSbFontSz(16), mSbFontBold(true), mSbFontItalic(false), mSbFont(TQFont()), mSbFg(TQColor()), mSbBg(TQColor()), mSbIcon("run"), mIconsVisible(true), mIconsJumping(true), mSplashScreen("(Default)") { _readSettings(); @@ -42,19 +42,19 @@ ThemeStandard::ThemeStandard( QWidget *parent, const char *name, const QStringLi void ThemeStandard::_initUi() { - setFrameStyle( QFrame::NoFrame ); + setFrameStyle( TQFrame::NoFrame ); - QString pixName = mTheme->locateThemeData( mSplashScreen ); + TQString pixName = mTheme->locateThemeData( mSplashScreen ); if( mSplashScreen == "(Default)" || pixName.isEmpty() ) { - QString resource_prefix = "pics/"; + TQString resource_prefix = "pics/"; if ( mTheme->loColor() ) resource_prefix += "locolor/"; pixName = locate( "appdata", resource_prefix + "splash.png"); } - QPixmap px = QPixmap( pixName ); + TQPixmap px = TQPixmap( pixName ); if( !px.isNull() ) { @@ -62,7 +62,7 @@ void ThemeStandard::_initUi() int pw = px.width(); int ph = px.height(); - QLabel *lbl = new QLabel( this ); + TQLabel *lbl = new TQLabel( this ); lbl->setBackgroundMode( NoBackground ); lbl->setFixedSize( pw, ph ); lbl->setPixmap( px ); @@ -75,16 +75,16 @@ void ThemeStandard::_initUi() resize( 0, 0 ); } - const QRect rect = kapp->desktop()->screenGeometry( mTheme->xineramaScreen() ); + const TQRect rect = kapp->desktop()->screenGeometry( mTheme->xineramaScreen() ); // KGlobalSettings::splashScreenDesktopGeometry(); cannot be used here. move( rect.x() + (rect.width() - size().width())/2, rect.y() + (rect.height() - size().height())/2 ); - mStatus = new WndStatus( QPalette(), mTheme->xineramaScreen(), mSbAtTop, mSbPbVisible, mSbFont, mSbFg, mSbBg, mSbIcon ); + mStatus = new WndStatus( TQPalette(), mTheme->xineramaScreen(), mSbAtTop, mSbPbVisible, mSbFont, mSbFg, mSbBg, mSbIcon ); } -void ThemeStandard::showEvent( QShowEvent * ) +void ThemeStandard::showEvent( TQShowEvent * ) { ThemeEngine::show(); @@ -101,9 +101,9 @@ void ThemeStandard::showEvent( QShowEvent * ) } // Adjust the visible icon. -void ThemeStandard::slotSetPixmap( const QString& pxn ) +void ThemeStandard::slotSetPixmap( const TQString& pxn ) { - QPixmap px = DesktopIcon( pxn ); + TQPixmap px = DesktopIcon( pxn ); if ( px.isNull() ) px = DesktopIcon( "go" ); @@ -119,7 +119,7 @@ void ThemeStandard::slotSetPixmap( const QString& pxn ) mStdIconWidth = DesktopIcon( "go" ).width(); mIcon = new WndIcon( ++mIconCount, mStdIconWidth, mStatusBarHeight, mTheme->xineramaScreen(), - px, QString::null, mIconPos, mSbAtTop, mIconsJumping ); + px, TQString::null, mIconPos, mSbAtTop, mIconsJumping ); mIcon->show(); if( mIconsJumping ) @@ -139,11 +139,11 @@ void ThemeStandard::_readSettings() if ( !cfg ) return; - //if ( !cfg->hasGroup( QString("KSplash Theme: %1").arg(mTheme->theme()) ) ) + //if ( !cfg->hasGroup( TQString("KSplash Theme: %1").arg(mTheme->theme()) ) ) // return; - cfg->setGroup( QString("KSplash Theme: %1").arg(mTheme->theme()) ); + cfg->setGroup( TQString("KSplash Theme: %1").arg(mTheme->theme()) ); - QString sbpos = cfg->readEntry( "Statusbar Position", "Bottom" ).upper(); + TQString sbpos = cfg->readEntry( "Statusbar Position", "Bottom" ).upper(); mSbAtTop = ( sbpos == "TOP" ); mSbVisible = cfg->readBoolEntry( "Statusbar Visible", true); mSbPbVisible = cfg->readBoolEntry( "Progress Visible", true); @@ -152,7 +152,7 @@ void ThemeStandard::_readSettings() mSbFontSz = cfg->readNumEntry( "Statusbar Font Size", 16 ); mSbFontBold = cfg->readBoolEntry( "Statusbar Font Bold", true ); mSbFontItalic = cfg->readBoolEntry( "Statusbar Font Italic", false ); - mSbFont = QFont( mSbFontName, mSbFontSz, ( mSbFontBold? QFont::Bold : QFont::Normal ) ); + mSbFont = TQFont( mSbFontName, mSbFontSz, ( mSbFontBold? TQFont::Bold : TQFont::Normal ) ); if( mSbFontItalic ) mSbFont.setItalic( true ); diff --git a/ksplashml/themeengine/standard/themestandard.h b/ksplashml/themeengine/standard/themestandard.h index a24f668db..2e5d1aeb0 100644 --- a/ksplashml/themeengine/standard/themestandard.h +++ b/ksplashml/themeengine/standard/themestandard.h @@ -44,8 +44,8 @@ class ThemeStandard: public ThemeEngine { Q_OBJECT public: - ThemeStandard( QWidget *, const char*, const QStringList& ); - //inline const ThemeEngineConfig *config( QWidget *p, KConfig *kc ) { return 0L; } + ThemeStandard( TQWidget *, const char*, const TQStringList& ); + //inline const ThemeEngineConfig *config( TQWidget *p, KConfig *kc ) { return 0L; } public slots: inline void slotUpdateProgress( int i ) @@ -56,14 +56,14 @@ public slots: { if( mStatus ) mStatus->slotUpdateSteps( i ); } - inline void slotSetText( const QString& s ) + inline void slotSetText( const TQString& s ) { if( mStatus ) mStatus->slotSetMessage( s ); } - void slotSetPixmap( const QString& ); + void slotSetPixmap( const TQString& ); private: - void showEvent( QShowEvent * ); + void showEvent( TQShowEvent * ); void _readSettings(); void _initUi(); @@ -77,17 +77,17 @@ private: bool mSbAtTop; bool mSbVisible; bool mSbPbVisible; - QString mSbFontName; + TQString mSbFontName; int mSbFontSz; bool mSbFontBold; bool mSbFontItalic; - QFont mSbFont; - QColor mSbFg; - QColor mSbBg; - QString mSbIcon; + TQFont mSbFont; + TQColor mSbFg; + TQColor mSbBg; + TQString mSbIcon; bool mIconsVisible; bool mIconsJumping; - QString mSplashScreen; + TQString mSplashScreen; }; #endif diff --git a/ksplashml/themeengine/standard/wndicon.cpp b/ksplashml/themeengine/standard/wndicon.cpp index 0440a0181..ce153e461 100644 --- a/ksplashml/themeengine/standard/wndicon.cpp +++ b/ksplashml/themeengine/standard/wndicon.cpp @@ -21,13 +21,13 @@ #include <kglobalsettings.h> #include <kwin.h> -#include <qdesktopwidget.h> -#include <qhbox.h> -#include <qlabel.h> -#include <qpixmap.h> -#include <qpoint.h> -#include <qtimer.h> -#include <qwidget.h> +#include <tqdesktopwidget.h> +#include <tqhbox.h> +#include <tqlabel.h> +#include <tqpixmap.h> +#include <tqpoint.h> +#include <tqtimer.h> +#include <tqwidget.h> #include "wndicon.h" #include "wndicon.moc" @@ -38,19 +38,19 @@ WndIcon::WndIcon( unsigned int status_height, int xineramaScreen, const KPixmap& pix, - const QString& text, + const TQString& text, Position icon_position, bool statusAtTop, bool iconsJumping ) - :QHBox( 0, "wndSplash", WStyle_Customize|WX11BypassWM ), + :TQHBox( 0, "wndSplash", WStyle_Customize|WX11BypassWM ), mStatusText(text), mIconPos(icon_position), mXineramaScreen( xineramaScreen ), mPosX(0), mPosY(0), mGroundX(0), mGroundY(0), mVelocity(8.0), mInitialVelocity(8.0), mGravity(0.8), mIconNum(icon_num), mStatusHeight(status_height), mIconSize(icon_std_width), mStatusAtTop(statusAtTop), mStopJump(false), mIconJumping(iconsJumping) { - setFrameStyle( QFrame::NoFrame ); + setFrameStyle( TQFrame::NoFrame ); - QLabel *w = new QLabel( this ); + TQLabel *w = new TQLabel( this ); w->setFixedSize( pix.width(), pix.height() ); w->setPixmap( pix ); if(pix.mask()) @@ -62,15 +62,15 @@ WndIcon::WndIcon( resize( pix.width(), pix.height() ); // Set initial position of icon, and ground. - QPoint p = determinePosition(); + TQPoint p = determinePosition(); mGroundX = mPosX = p.x(); mGroundY = mPosY = p.y(); move( p + kapp->desktop()->screenGeometry( mXineramaScreen ).topLeft() ); if( mIconJumping ) { - QTimer *t = new QTimer( this ); - connect(t, SIGNAL(timeout()), SLOT(slotJump())); + TQTimer *t = new TQTimer( this ); + connect(t, TQT_SIGNAL(timeout()), TQT_SLOT(slotJump())); t->start( 50, false ); } } @@ -78,7 +78,7 @@ WndIcon::WndIcon( void WndIcon::show() { emit setStatusText( mStatusText ); - QHBox::show(); + TQHBox::show(); } // Emit our EXTRA signal without becoming visible. @@ -93,12 +93,12 @@ void WndIcon::noshow() * screen. This is placed in its own function due to the massive * complexity required by the variables involved. */ -QPoint WndIcon::determinePosition() +TQPoint WndIcon::determinePosition() { int DW, DH, SBH, wid, X, Y, x, y, nSlot, topshift, bottomshift; bottomshift = topshift = 0; - const QRect srect = kapp->desktop()->screenGeometry( mXineramaScreen ); + const TQRect srect = kapp->desktop()->screenGeometry( mXineramaScreen ); // KGlobalSettings::splashScreenDesktopGeometry(); cannot be used here. DW = srect.width(); DH = srect.height(); @@ -220,7 +220,7 @@ QPoint WndIcon::determinePosition() return(determinePosition()); break; } - return( QPoint( X, Y ) ); + return( TQPoint( X, Y ) ); } // Make the icons jump in a macosx-like way (Thanks, Jone!:) @@ -301,7 +301,7 @@ void WndIcon::slotJump() mPosY = (int)((float)mPosY - mVelocity ); break; } - move( QPoint( mPosX, mPosY ) + kapp->desktop()->screenGeometry( mXineramaScreen ).topLeft() ); + move( TQPoint( mPosX, mPosY ) + kapp->desktop()->screenGeometry( mXineramaScreen ).topLeft() ); } void WndIcon::slotStopJumping() diff --git a/ksplashml/themeengine/standard/wndicon.h b/ksplashml/themeengine/standard/wndicon.h index a47082ae6..d488f85df 100644 --- a/ksplashml/themeengine/standard/wndicon.h +++ b/ksplashml/themeengine/standard/wndicon.h @@ -20,7 +20,7 @@ #include <kpixmap.h> -#include <qhbox.h> +#include <tqhbox.h> /** * @short Displays an icon on the screen. @@ -43,10 +43,10 @@ public: VTopRight = 13 }; - WndIcon( unsigned int, unsigned int, unsigned int, int, const KPixmap&, const QString&, Position, bool, bool ); + WndIcon( unsigned int, unsigned int, unsigned int, int, const KPixmap&, const TQString&, Position, bool, bool ); signals: - void setStatusText( const QString& ); + void setStatusText( const TQString& ); public slots: void show(); @@ -55,10 +55,10 @@ public slots: void slotJump(); private: - QPoint determinePosition(); + TQPoint determinePosition(); protected: - QString mStatusText; + TQString mStatusText; Position mIconPos; int mXineramaScreen; int mPosX, mPosY, mGroundX, mGroundY; diff --git a/ksplashml/themeengine/standard/wndstatus.cpp b/ksplashml/themeengine/standard/wndstatus.cpp index 3b8582c89..04685d9cf 100644 --- a/ksplashml/themeengine/standard/wndstatus.cpp +++ b/ksplashml/themeengine/standard/wndstatus.cpp @@ -18,11 +18,11 @@ #include <kprogress.h> #include <kwin.h> -#include <qdesktopwidget.h> -#include <qhbox.h> -#include <qlabel.h> -#include <qpoint.h> -#include <qrect.h> +#include <tqdesktopwidget.h> +#include <tqhbox.h> +#include <tqlabel.h> +#include <tqpoint.h> +#include <tqrect.h> #include "wndstatus.h" #include "wndstatus.moc" @@ -30,38 +30,38 @@ // WndStatus::WndStatus(): Display a nifty status bar at // the bottom of the screen, so the user always knows what's // happening to his system. -WndStatus::WndStatus( QPalette /*pal*/, +WndStatus::WndStatus( TQPalette /*pal*/, int xineramaScreen, bool atTop, bool pbVisible, - const QFont& font, - const QColor& fgc, const QColor & bgc, - const QString& icon + const TQFont& font, + const TQColor& fgc, const TQColor & bgc, + const TQString& icon ) - :QHBox( 0, "wndStatus", WStyle_Customize|WX11BypassWM ) + :TQHBox( 0, "wndStatus", WStyle_Customize|WX11BypassWM ) { - setFrameStyle( QFrame::NoFrame ); + setFrameStyle( TQFrame::NoFrame ); //setPalette( pal ); setPaletteBackgroundColor( bgc ); setPaletteForegroundColor( fgc ); setCursor( KCursor::blankCursor() ); setSpacing( 5 ); - const QRect rect = kapp->desktop()->screenGeometry( xineramaScreen ); + const TQRect rect = kapp->desktop()->screenGeometry( xineramaScreen ); // KGlobalSettings::splashScreenDesktopGeometry(); cannot be used here. - QLabel *pix = new QLabel( this ); - QPixmap _icon( SmallIcon(icon.isNull()||icon.isEmpty()?QString("run"):icon) ); + TQLabel *pix = new TQLabel( this ); + TQPixmap _icon( SmallIcon(icon.isNull()||icon.isEmpty()?TQString("run"):icon) ); pix->setPixmap( _icon ); setStretchFactor(pix,0); pix->setFixedWidth(16); - m_label = new QLabel( this ); + m_label = new TQLabel( this ); m_label->setFont( font ); m_label->setPaletteBackgroundColor( bgc ); m_label->setPaletteForegroundColor( fgc ); - //QFontMetrics metrics( font ); + //TQFontMetrics metrics( font ); //m_label->setFixedHeight( metrics.height() ); - m_label->setText(QString("")); + m_label->setText(TQString("")); m_label->setFixedWidth(rect.width()-105-16-10); // What's this magic number? m_label->show(); @@ -69,7 +69,7 @@ WndStatus::WndStatus( QPalette /*pal*/, setStretchFactor(m_progress,0); m_progress->setFixedWidth(100); - QWidget *widg = new QWidget( this ); + TQWidget *widg = new TQWidget( this ); setStretchFactor(widg,50); setFixedSize( rect.width(), QMAX(m_progress->height(),m_label->height()) ); @@ -83,7 +83,7 @@ WndStatus::WndStatus( QPalette /*pal*/, m_progress->hide(); } -void WndStatus::slotSetMessage( const QString& msg ) +void WndStatus::slotSetMessage( const TQString& msg ) { raise(); m_label->setText( msg ); diff --git a/ksplashml/themeengine/standard/wndstatus.h b/ksplashml/themeengine/standard/wndstatus.h index fa1d735d9..effcd458f 100644 --- a/ksplashml/themeengine/standard/wndstatus.h +++ b/ksplashml/themeengine/standard/wndstatus.h @@ -18,7 +18,7 @@ #ifndef __WNDSTATUS_H__ #define __WNDSTATUS_H__ -#include <qhbox.h> +#include <tqhbox.h> class QLabel; class KProgress; @@ -29,22 +29,22 @@ class WndStatus: { Q_OBJECT public: - WndStatus( QPalette, + WndStatus( TQPalette, int, // Xinerama screen bool, // At top? bool, // Progress indicator visible? - const QFont&, // Status bar font - const QColor&, const QColor &, // Foreground/Background color - const QString& // Icon + const TQFont&, // Status bar font + const TQColor&, const TQColor &, // Foreground/Background color + const TQString& // Icon ); public slots: - void slotSetMessage( const QString& ); + void slotSetMessage( const TQString& ); void slotUpdateProgress( int ); void slotUpdateSteps( int ); protected: - QLabel *m_label; + TQLabel *m_label; KProgress *m_progress; }; #endif diff --git a/ksplashml/themeengine/themeengine.cpp b/ksplashml/themeengine/themeengine.cpp index 0b58587f7..79e47bfe1 100644 --- a/ksplashml/themeengine/themeengine.cpp +++ b/ksplashml/themeengine/themeengine.cpp @@ -20,9 +20,9 @@ #include <kglobal.h> #include <kwin.h> -#include <qevent.h> -#include <qfile.h> -#include <qwidget.h> +#include <tqevent.h> +#include <tqfile.h> +#include <tqwidget.h> #include <X11/Xlib.h> @@ -37,11 +37,11 @@ struct ThemeEngine::ThemeEnginePrivate { - QValueList< Window > mSplashWindows; + TQValueList< Window > mSplashWindows; }; -ThemeEngine::ThemeEngine( QWidget *, const char *, const QStringList& args ) - : QVBox( 0, "wndSplash", WStyle_Customize|WX11BypassWM ), d(0) +ThemeEngine::ThemeEngine( TQWidget *, const char *, const TQStringList& args ) + : TQVBox( 0, "wndSplash", WStyle_Customize|WX11BypassWM ), d(0) { d = new ThemeEnginePrivate; kapp->installX11EventFilter( this ); @@ -71,19 +71,19 @@ ThemeEngine::~ThemeEngine() force them to be WX11BypassWM (so that ksplash can handle their stacking), and keep them on top, even above all windows handled by KWin. */ -bool ThemeEngine::eventFilter( QObject* o, QEvent* e ) +bool ThemeEngine::eventFilter( TQObject* o, TQEvent* e ) { - if( e->type() == QEvent::Show && o->isWidgetType()) - addSplashWindow( static_cast< QWidget* >( o )); + if( e->type() == TQEvent::Show && o->isWidgetType()) + addSplashWindow( static_cast< TQWidget* >( o )); return false; } namespace { -class HackWidget : public QWidget { friend class ::ThemeEngine; }; +class HackWidget : public TQWidget { friend class ::ThemeEngine; }; } -void ThemeEngine::addSplashWindow( QWidget* w ) +void ThemeEngine::addSplashWindow( TQWidget* w ) { if( !w->isTopLevel()) return; @@ -98,13 +98,13 @@ void ThemeEngine::addSplashWindow( QWidget* w ) XChangeWindowAttributes( qt_xdisplay(), w->winId(), CWOverrideRedirect, &attrs ); } d->mSplashWindows.prepend( w->winId()); - connect( w, SIGNAL( destroyed( QObject* )), SLOT( splashWindowDestroyed( QObject* ))); + connect( w, TQT_SIGNAL( destroyed( TQObject* )), TQT_SLOT( splashWindowDestroyed( TQObject* ))); w->raise(); } -void ThemeEngine::splashWindowDestroyed( QObject* obj ) +void ThemeEngine::splashWindowDestroyed( TQObject* obj ) { - d->mSplashWindows.remove( static_cast< QWidget* >( obj )->winId()); + d->mSplashWindows.remove( static_cast< TQWidget* >( obj )->winId()); } bool ThemeEngine::x11Event( XEvent* e ) @@ -126,7 +126,7 @@ bool ThemeEngine::x11Event( XEvent* e ) // and stack others below it Window* stack = new Window[ d->mSplashWindows.count() ]; int count = 0; - for( QValueList< Window >::ConstIterator it = d->mSplashWindows.begin(); + for( TQValueList< Window >::ConstIterator it = d->mSplashWindows.begin(); it != d->mSplashWindows.end(); ++it ) stack[ count++ ] = *it; diff --git a/ksplashml/themeengine/themeengine.h b/ksplashml/themeengine/themeengine.h index 62461cd4e..876eb19d6 100644 --- a/ksplashml/themeengine/themeengine.h +++ b/ksplashml/themeengine/themeengine.h @@ -12,9 +12,9 @@ #ifndef THEMEENGINE_H #define THEMEENGINE_H -#include <qstringlist.h> -#include <qvbox.h> -#include <qwidget.h> +#include <tqstringlist.h> +#include <tqvbox.h> +#include <tqwidget.h> #include <kdemacros.h> @@ -30,8 +30,8 @@ class KDE_EXPORT ThemeEngineConfig: public QVBox Q_OBJECT public: - ThemeEngineConfig( QWidget *p, KConfig *c ) - :QVBox( p ), mConfig( c ) + ThemeEngineConfig( TQWidget *p, KConfig *c ) + :TQVBox( p ), mConfig( c ) {} KConfig* config()const { return mConfig; } @@ -52,27 +52,27 @@ class KDE_EXPORT ThemeEngine: public QVBox { Q_OBJECT public: - ThemeEngine( QWidget *parent, const char *name, const QStringList &args ); + ThemeEngine( TQWidget *parent, const char *name, const TQStringList &args ); virtual ~ThemeEngine() = 0; - virtual const ThemeEngineConfig *config( QWidget *, KConfig * ) { return 0L; } + virtual const ThemeEngineConfig *config( TQWidget *, KConfig * ) { return 0L; } virtual ObjKsTheme *ksTheme() { return mTheme; } - virtual bool eventFilter( QObject* o, QEvent* e ); + virtual bool eventFilter( TQObject* o, TQEvent* e ); public slots: virtual void slotUpdateProgress( int ) {} virtual void slotUpdateSteps( int ) {} - virtual void slotSetText( const QString& ) {} - virtual void slotSetPixmap( const QString& ) {} // use DesktopIcon() to load this. + virtual void slotSetText( const TQString& ) {} + virtual void slotSetPixmap( const TQString& ) {} // use DesktopIcon() to load this. protected: - void addSplashWindow( QWidget* ); + void addSplashWindow( TQWidget* ); protected: ObjKsTheme *mTheme; virtual bool x11Event( XEvent* ); private slots: - void splashWindowDestroyed( QObject* ); + void splashWindowDestroyed( TQObject* ); private: class ThemeEnginePrivate; diff --git a/ksplashml/wndmain.cpp b/ksplashml/wndmain.cpp index b5cc45c12..091d70e9e 100644 --- a/ksplashml/wndmain.cpp +++ b/ksplashml/wndmain.cpp @@ -24,9 +24,9 @@ #include <kwin.h> #include <dcopclient.h> -#include <qdir.h> -#include <qpixmap.h> -#include <qtimer.h> +#include <tqdir.h> +#include <tqpixmap.h> +#include <tqtimer.h> #include "objkstheme.h" #include "wndmain.h" @@ -38,11 +38,11 @@ // KSplash::KSplash(): This is a hidden object. Its sole purpose // is to manage the other objects, which are presented on the screen. KSplash::KSplash(const char *name) - : DCOPObject( name ), QWidget( 0, name, WStyle_Customize|WStyle_NoBorder|WX11BypassWM ), + : DCOPObject( name ), TQWidget( 0, name, WStyle_Customize|WStyle_NoBorder|WX11BypassWM ), mState( 0 ), mMaxProgress( 0 ), mStep( 0 ) { hide(); // We never show this object. - mThemeLibName = QString::null; + mThemeLibName = TQString::null; mSessMgrCalled = false; mTimeToGo = false; @@ -58,23 +58,23 @@ KSplash::KSplash(const char *name) if ( config->readBoolEntry( "CloseOnClick", TRUE ) ) mThemeEngine->installEventFilter( this ); - connect( mThemeEngine, SIGNAL(destroyed()), this, SLOT(close()) ); - connect( this, SIGNAL(stepsChanged(int)), SLOT(slotUpdateSteps(int)) ); - connect( this, SIGNAL(progressChanged(int)), SLOT(slotUpdateProgress(int)) ); + connect( mThemeEngine, TQT_SIGNAL(destroyed()), this, TQT_SLOT(close()) ); + connect( this, TQT_SIGNAL(stepsChanged(int)), TQT_SLOT(slotUpdateSteps(int)) ); + connect( this, TQT_SIGNAL(progressChanged(int)), TQT_SLOT(slotUpdateProgress(int)) ); if( mKsTheme->testing() ) { slotUpdateSteps(7); - QTimer::singleShot( 1000, this, SLOT(slotExec())); + TQTimer::singleShot( 1000, this, TQT_SLOT(slotExec())); } else - QTimer::singleShot( 100, this, SLOT(initDcop())); + TQTimer::singleShot( 100, this, TQT_SLOT(initDcop())); // Make sure we don't stay up forever. if (!mKsTheme->managedMode()) { - close_timer = new QTimer( this ); - connect( close_timer, SIGNAL( timeout() ), this, SLOT( close() ) ); + close_timer = new TQTimer( this ); + connect( close_timer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( close() ) ); close_timer->start( 60000, TRUE ); } } @@ -122,7 +122,7 @@ void KSplash::prepareSplashScreen() mThemeEngine->show(); } -void KSplash::slotInsertAction( const QString& pix, const QString& msg ) +void KSplash::slotInsertAction( const TQString& pix, const TQString& msg ) { Action *a = new Action; a->ItemText = msg; @@ -132,14 +132,14 @@ void KSplash::slotInsertAction( const QString& pix, const QString& msg ) void KSplash::slotExec() { - QTimer::singleShot( 200, this, SLOT(nextIcon())); + TQTimer::singleShot( 200, this, TQT_SLOT(nextIcon())); } void KSplash::nextIcon() { if( !mCurrentAction || mTimeToGo ) { - QTimer::singleShot( 1000, this, SLOT(close())); + TQTimer::singleShot( 1000, this, TQT_SLOT(close())); return; } @@ -153,12 +153,12 @@ void KSplash::nextIcon() } if( mKsTheme->testing() ) - QTimer::singleShot( 1000, this, SLOT(nextIcon())); + TQTimer::singleShot( 1000, this, TQT_SLOT(nextIcon())); } void KSplash::initDcop() { - disconnect( kapp->dcopClient(), SIGNAL( attachFailed(const QString&) ), kapp, SLOT( dcopFailure(const QString&) ) ); + disconnect( kapp->dcopClient(), TQT_SIGNAL( attachFailed(const TQString&) ), kapp, TQT_SLOT( dcopFailure(const TQString&) ) ); if ( kapp->dcopClient()->isAttached() ) return; @@ -172,7 +172,7 @@ void KSplash::initDcop() } else { - QTimer::singleShot( 100, this, SLOT(initDcop()) ); + TQTimer::singleShot( 100, this, TQT_SLOT(initDcop()) ); } } @@ -191,7 +191,7 @@ void KSplash::updateState( unsigned int state ) } // For KDE startup only. -void KSplash::upAndRunning( QString s ) +void KSplash::upAndRunning( TQString s ) { // This code is written to match ksmserver. Touch it without knowing // what you are doing and prepare to bite the dust. @@ -245,7 +245,7 @@ void KSplash::upAndRunning( QString s ) //if(!mSessMgrCalled) emit nextIcon(); mTimeToGo = true; close_timer->stop(); - QTimer::singleShot( 1000, this, SLOT(close())); + TQTimer::singleShot( 1000, this, TQT_SLOT(close())); } else { @@ -279,9 +279,9 @@ void KSplash::setProgress(int step) * name of the process being started, and (c) a description of what the * process is handling. Some examples: * - * programStarted( QString("desktop"), QString("kdesktop"), QString("Preparing your desktop...")); + * programStarted( TQString("desktop"), TQString("kdesktop"), TQString("Preparing your desktop...")); */ -void KSplash::programStarted( QString icon, QString name, QString desc ) +void KSplash::programStarted( TQString icon, TQString name, TQString desc ) { if (mTimeToGo) return; @@ -305,26 +305,26 @@ void KSplash::setStartupItemCount( int count ) void KSplash::startupComplete() { mTimeToGo = true; - QTimer::singleShot( 1000, this, SLOT(close())); + TQTimer::singleShot( 1000, this, TQT_SLOT(close())); } void KSplash::close() { - QWidget::close(); + TQWidget::close(); } void KSplash::hide() { - QWidget::hide(); + TQWidget::hide(); } void KSplash::show() { - QWidget::show(); + TQWidget::show(); } // Guaranteed to return a valid theme. -void KSplash::loadTheme( const QString& theme ) +void KSplash::loadTheme( const TQString& theme ) { mKsTheme = new ObjKsTheme( theme ); // kdDebug() << "KSplash::loadTheme: " << theme << " : "<< mKsTheme->themeEngine() << endl; @@ -339,37 +339,37 @@ void KSplash::loadTheme( const QString& theme ) mKsTheme = mThemeEngine->ksTheme(); } -ThemeEngine *KSplash::_loadThemeEngine( const QString& pluginName, const QString& theme ) +ThemeEngine *KSplash::_loadThemeEngine( const TQString& pluginName, const TQString& theme ) { // Since we may be called before the DCOP server is active, we cannot use the KTrader framework for obtaining plugins. In its // place, we use the following naive heuristic to locate plugins. If we are not in managed mode, and we are not in testing mode // either, we assume that we have been called by startkde. In this case, we simply try to load the library whose name should // conform to the following specification: - // QString("ksplash") + pluginName.lower() + // TQString("ksplash") + pluginName.lower() // The object should be called as follows: - // QString("Theme") + pluginName + // TQString("Theme") + pluginName KLibFactory *factory = 0L; - QString libName; - QString objName; + TQString libName; + TQString objName; // Replace this test by a "nodcop" command line option. if ( /*!mKsTheme->managedMode() ||*/ !KCmdLineArgs::parsedArgs()->isSet( "dcop" ) ) { - libName = QString("ksplash%1").arg(pluginName.lower()); - objName = QString("Theme%1").arg(pluginName); + libName = TQString("ksplash%1").arg(pluginName.lower()); + objName = TQString("Theme%1").arg(pluginName); // kdDebug() << "*KSplash::_loadThemeEngine: Loading " << objName << " from " << libName << endl; - // libname.latin1() instead of QFile::encodeName() because these are not user-modifiable files. + // libname.latin1() instead of TQFile::encodeName() because these are not user-modifiable files. if ( (factory = KLibLoader::self()->factory ( libName.latin1() )) ) mThemeLibName = libName; } else { // Fancier way of locating plugins. - KService::List list= KTrader::self()->query("KSplash/Plugin", QString("[X-KSplash-PluginName] == '%1'").arg(pluginName)); + KService::List list= KTrader::self()->query("KSplash/Plugin", TQString("[X-KSplash-PluginName] == '%1'").arg(pluginName)); KService::Ptr ptr; if (!list.isEmpty()) { ptr = list.first(); - // libname.latin1() instead of QFile::encodeName() because these are not user-modifiable files. + // libname.latin1() instead of TQFile::encodeName() because these are not user-modifiable files. if( (factory = KLibLoader::self()->factory( ptr->library().latin1() )) ) { mThemeLibName = ptr->library(); @@ -379,7 +379,7 @@ ThemeEngine *KSplash::_loadThemeEngine( const QString& pluginName, const QString } if (factory) { - QStringList themeTitle; + TQStringList themeTitle; themeTitle << theme; return static_cast<ThemeEngine *>(factory->create(this, "theme", objName.latin1(), themeTitle)); } @@ -387,13 +387,13 @@ ThemeEngine *KSplash::_loadThemeEngine( const QString& pluginName, const QString return 0L; } -void KSplash::slotSetText( const QString& s ) +void KSplash::slotSetText( const TQString& s ) { if( mThemeEngine ) mThemeEngine->slotSetText( s ); } -void KSplash::slotSetPixmap( const QString& px ) +void KSplash::slotSetPixmap( const TQString& px ) { if( mThemeEngine ) mThemeEngine->slotSetPixmap( px ); @@ -409,16 +409,16 @@ void KSplash::slotUpdateProgress( int ) // ?? } -QPtrList<Action> KSplash::actionList() +TQPtrList<Action> KSplash::actionList() { return mActionList; } -bool KSplash::eventFilter( QObject *o, QEvent *e ) +bool KSplash::eventFilter( TQObject *o, TQEvent *e ) { - if ( ( e->type() == QEvent::MouseButtonRelease ) && ( o == mThemeEngine ) ) + if ( ( e->type() == TQEvent::MouseButtonRelease ) && ( o == mThemeEngine ) ) { - QTimer::singleShot( 0, this, SLOT(close())); + TQTimer::singleShot( 0, this, TQT_SLOT(close())); return TRUE; } else diff --git a/ksplashml/wndmain.h b/ksplashml/wndmain.h index 1bed2b734..c1fa4ae45 100644 --- a/ksplashml/wndmain.h +++ b/ksplashml/wndmain.h @@ -14,9 +14,9 @@ #include <kapplication.h> -#include <qptrlist.h> -#include <qstring.h> -#include <qobject.h> +#include <tqptrlist.h> +#include <tqstring.h> +#include <tqobject.h> #include "ksplashiface.h" @@ -27,8 +27,8 @@ // in knowing this. typedef struct { - QString ItemPixmap; - QString ItemText; + TQString ItemPixmap; + TQString ItemText; } Action; class WndStatus; @@ -36,7 +36,7 @@ class ObjKsTheme; class ThemeEngine; class KConfig; -class KSplash: public QWidget, virtual public KSplashIface +class KSplash: public TQWidget, virtual public KSplashIface { Q_OBJECT @@ -44,14 +44,14 @@ public: KSplash(const char *name = "ksplash"); ~KSplash(); - QPtrList<Action> actionList(); + TQPtrList<Action> actionList(); // DCOP interface - ASYNC upAndRunning( QString ); + ASYNC upAndRunning( TQString ); ASYNC setMaxProgress(int); ASYNC setProgress(int); ASYNC setStartupItemCount( int count ); - ASYNC programStarted( QString programIcon, QString programName, QString description ); + ASYNC programStarted( TQString programIcon, TQString programName, TQString description ); ASYNC startupComplete(); ASYNC close(); ASYNC hide(); @@ -63,7 +63,7 @@ signals: void actionListChanged(); protected: - bool eventFilter( QObject *o, QEvent *e ); + bool eventFilter( TQObject *o, TQEvent *e ); public slots: void slotUpdateSteps( int ); @@ -75,35 +75,35 @@ private slots: void prepareSplashScreen(); void slotExec(); void nextIcon(); - void slotInsertAction( const QString&, const QString& ); + void slotInsertAction( const TQString&, const TQString& ); void slotReadProperties( KConfig * ); - void slotSetText( const QString& ); - void slotSetPixmap( const QString& ); + void slotSetText( const TQString& ); + void slotSetPixmap( const TQString& ); - void loadTheme( const QString& ); + void loadTheme( const TQString& ); private: - ThemeEngine *_loadThemeEngine( const QString& pluginName, const QString& theme ); + ThemeEngine *_loadThemeEngine( const TQString& pluginName, const TQString& theme ); void updateState( unsigned int state ); protected: unsigned int mState; unsigned int mMaxProgress; unsigned int mStep; // ?? - QTimer* close_timer; + TQTimer* close_timer; bool mSessMgrCalled; bool mTimeToGo; - QString mTheme; + TQString mTheme; ObjKsTheme *mKsTheme; ThemeEngine *mThemeEngine; - QPtrList<Action> mActionList; + TQPtrList<Action> mActionList; Action *mCurrentAction, *mPreviousAction; - QString mThemeLibName; + TQString mThemeLibName; }; #endif |