diff options
Diffstat (limited to 'kdm')
35 files changed, 902 insertions, 902 deletions
diff --git a/kdm/kfrontend/kchooser.cpp b/kdm/kfrontend/kchooser.cpp index 6d0b20350..df602efea 100644 --- a/kdm/kfrontend/kchooser.cpp +++ b/kdm/kfrontend/kchooser.cpp @@ -32,20 +32,20 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include <klocale.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qpushbutton.h> -#include <qpopupmenu.h> -#include <qsocketnotifier.h> -#include <qlistview.h> -#include <qlineedit.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqpushbutton.h> +#include <tqpopupmenu.h> +#include <tqsocketnotifier.h> +#include <tqlistview.h> +#include <tqlineedit.h> #include <stdlib.h> // for free() -class ChooserListViewItem : public QListViewItem { +class ChooserListViewItem : public TQListViewItem { public: - ChooserListViewItem( QListView* parent, int _id, const QString& nam, const QString& sts ) - : QListViewItem( parent, nam, sts ) { id = _id; }; + ChooserListViewItem( TQListView* parent, int _id, const TQString& nam, const TQString& sts ) + : TQListViewItem( parent, nam, sts ) { id = _id; }; int id; }; @@ -56,49 +56,49 @@ ChooserDlg::ChooserDlg() { completeMenu( LOGIN_REMOTE_ONLY, ex_greet, i18n("&Local Login"), ALT+Key_L ); - QBoxLayout *vbox = new QVBoxLayout( this, 10, 10 ); + TQBoxLayout *vbox = new TQVBoxLayout( this, 10, 10 ); - QLabel *title = new QLabel( i18n("XDMCP Host Menu"), this ); + TQLabel *title = new TQLabel( i18n("XDMCP Host Menu"), this ); title->setAlignment( AlignCenter ); vbox->addWidget( title ); - host_view = new QListView( this, "hosts" ); + host_view = new TQListView( this, "hosts" ); host_view->addColumn( i18n("Hostname") ); host_view->setColumnWidth( 0, fontMetrics().width( "login.crap.net" ) ); host_view->addColumn( i18n("Status") ); host_view->setMinimumWidth( fontMetrics().width( "login.crap.com Display not authorized to connect this server" ) ); - host_view->setResizeMode( QListView::LastColumn ); + host_view->setResizeMode( TQListView::LastColumn ); host_view->setAllColumnsShowFocus( true ); vbox->addWidget( host_view ); - iline = new QLineEdit( this ); + iline = new TQLineEdit( this ); iline->setEnabled( TRUE ); - QLabel *itxt = new QLabel( iline, i18n("Hos&t:"), this ); - QPushButton *addButton = new QPushButton( i18n("A&dd"), this ); - connect( addButton, SIGNAL(clicked()), SLOT(addHostname()) ); - QBoxLayout *hibox = new QHBoxLayout( vbox, 10 ); + TQLabel *itxt = new TQLabel( iline, i18n("Hos&t:"), this ); + TQPushButton *addButton = new TQPushButton( i18n("A&dd"), this ); + connect( addButton, TQT_SIGNAL(clicked()), TQT_SLOT(addHostname()) ); + TQBoxLayout *hibox = new TQHBoxLayout( vbox, 10 ); hibox->addWidget( itxt ); hibox->addWidget( iline ); hibox->addWidget( addButton ); // Buttons - QPushButton *acceptButton = new QPushButton( i18n("&Accept"), this ); + TQPushButton *acceptButton = new TQPushButton( i18n("&Accept"), this ); acceptButton->setDefault( true ); - QPushButton *pingButton = new QPushButton( i18n("&Refresh"), this ); + TQPushButton *pingButton = new TQPushButton( i18n("&Refresh"), this ); - QBoxLayout *hbox = new QHBoxLayout( vbox, 20 ); + TQBoxLayout *hbox = new TQHBoxLayout( vbox, 20 ); hbox->addWidget( acceptButton ); hbox->addWidget( pingButton ); hbox->addStretch( 1 ); if (optMenu) { - QPushButton *menuButton = new QPushButton( i18n("&Menu"), this ); + TQPushButton *menuButton = new TQPushButton( i18n("&Menu"), this ); menuButton->setPopup( optMenu ); hbox->addWidget( menuButton ); hbox->addStretch( 1 ); } -// QPushButton *helpButton = new QPushButton( i18n("&Help"), this ); +// TQPushButton *helpButton = new TQPushButton( i18n("&Help"), this ); // hbox->addWidget( helpButton ); #ifdef WITH_KDM_XCONSOLE @@ -106,13 +106,13 @@ ChooserDlg::ChooserDlg() vbox->addWidget( consoleView ); #endif - sn = new QSocketNotifier( rfd, QSocketNotifier::Read, this ); - connect( sn, SIGNAL(activated( int )), SLOT(slotReadPipe()) ); + sn = new TQSocketNotifier( rfd, TQSocketNotifier::Read, this ); + connect( sn, TQT_SIGNAL(activated( int )), TQT_SLOT(slotReadPipe()) ); - connect( pingButton, SIGNAL(clicked()), SLOT(pingHosts()) ); - connect( acceptButton, SIGNAL(clicked()), SLOT(accept()) ); -// connect( helpButton, SIGNAL(clicked()), SLOT(slotHelp()) ); - connect( host_view, SIGNAL(doubleClicked(QListViewItem *)), SLOT(accept()) ); + connect( pingButton, TQT_SIGNAL(clicked()), TQT_SLOT(pingHosts()) ); + connect( acceptButton, TQT_SIGNAL(clicked()), TQT_SLOT(accept()) ); +// connect( helpButton, TQT_SIGNAL(clicked()), TQT_SLOT(slotHelp()) ); + connect( host_view, TQT_SIGNAL(doubleClicked(TQListViewItem *)), TQT_SLOT(accept()) ); adjustGeometry(); } @@ -153,7 +153,7 @@ void ChooserDlg::accept() } return; } else /*if (focusWidget() == host_view)*/ { - QListViewItem *item = host_view->currentItem(); + TQListViewItem *item = host_view->currentItem(); if (item) { GSendInt( G_Ready ); GSendInt( ((ChooserListViewItem *)item)->id ); @@ -166,21 +166,21 @@ void ChooserDlg::reject() { } -QString ChooserDlg::recvStr() +TQString ChooserDlg::recvStr() { char *arr = GRecvStr(); if (arr) { - QString str = QString::fromLatin1( arr ); + TQString str = TQString::fromLatin1( arr ); free( arr ); return str; } else return i18n("<unknown>"); } -QListViewItem *ChooserDlg::findItem( int id ) +TQListViewItem *ChooserDlg::findItem( int id ) { - QListViewItem *itm; - for (QListViewItemIterator it( host_view ); (itm = it.current()); ++it) + TQListViewItem *itm; + for (TQListViewItemIterator it( host_view ); (itm = it.current()); ++it) if (((ChooserListViewItem *)itm)->id == id) return itm; return 0; @@ -189,7 +189,7 @@ QListViewItem *ChooserDlg::findItem( int id ) void ChooserDlg::slotReadPipe() { int id; - QString nam, sts; + TQString nam, sts; int cmd = GRecvInt(); switch (cmd) { @@ -203,7 +203,7 @@ void ChooserDlg::slotReadPipe() host_view->insertItem( new ChooserListViewItem( host_view, id, nam, sts ) ); else { - QListViewItem *itm = findItem( id ); + TQListViewItem *itm = findItem( id ); itm->setText( 0, nam ); itm->setText( 1, sts ); } @@ -212,7 +212,7 @@ void ChooserDlg::slotReadPipe() delete findItem( GRecvInt() ); break; case G_Ch_BadHost: - KFMsgBox::box( this, QMessageBox::Warning, i18n("Unknown host %1").arg( recvStr() ) ); + KFMsgBox::box( this, TQMessageBox::Warning, i18n("Unknown host %1").arg( recvStr() ) ); break; case G_Ch_Exit: done( ex_exit ); diff --git a/kdm/kfrontend/kchooser.h b/kdm/kfrontend/kchooser.h index 93ede2694..354b3f1ef 100644 --- a/kdm/kfrontend/kchooser.h +++ b/kdm/kfrontend/kchooser.h @@ -48,12 +48,12 @@ class ChooserDlg : public KGDialog { void reject(); private: - QString recvStr(); - QListViewItem *findItem( int id ); + TQString recvStr(); + TQListViewItem *findItem( int id ); - QListView *host_view; - QLineEdit *iline; - QSocketNotifier *sn; + TQListView *host_view; + TQLineEdit *iline; + TQSocketNotifier *sn; }; #endif /* KCHOOSER_H */ diff --git a/kdm/kfrontend/kconsole.cpp b/kdm/kfrontend/kconsole.cpp index b101712da..6c2ab09ab 100644 --- a/kdm/kfrontend/kconsole.cpp +++ b/kdm/kfrontend/kconsole.cpp @@ -59,9 +59,9 @@ extern "C" { #include <klocale.h> #include <kpty.h> -#include <qsocketnotifier.h> +#include <tqsocketnotifier.h> -KConsole::KConsole( QWidget *_parent ) +KConsole::KConsole( TQWidget *_parent ) : inherited( _parent ) , pty( 0 ) , notifier( 0 ) @@ -128,8 +128,8 @@ KConsole::OpenConsole() fd = pty->masterFd(); gotcon: - notifier = new QSocketNotifier( fd, QSocketNotifier::Read, this ); - connect( notifier, SIGNAL(activated( int )), SLOT(slotData()) ); + notifier = new TQSocketNotifier( fd, TQSocketNotifier::Read, this ); + connect( notifier, TQT_SIGNAL(activated( int )), TQT_SLOT(slotData()) ); return 1; } @@ -161,14 +161,14 @@ KConsole::slotData() bool as = !verticalScrollBar()->isVisible() || (verticalScrollBar()->value() == verticalScrollBar()->maxValue()); - QString str( QString::fromLocal8Bit( buffer, n ).remove( '\r' ) ); + TQString str( TQString::fromLocal8Bit( buffer, n ).remove( '\r' ) ); int pos, opos; for (opos = 0; (pos = str.find( '\n', opos )) >= 0; opos = pos + 1) { if (paragraphs() == 100) removeParagraph( 0 ); if (!leftover.isEmpty()) { append( leftover + str.mid( opos, pos - opos ) ); - leftover = QString::null; + leftover = TQString::null; } else append( str.mid( opos, pos - opos ) ); } diff --git a/kdm/kfrontend/kconsole.h b/kdm/kfrontend/kconsole.h index 8a3515173..cbf025626 100644 --- a/kdm/kfrontend/kconsole.h +++ b/kdm/kfrontend/kconsole.h @@ -24,17 +24,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef KCONSOLE_H #define KCONSOLE_H -#include <qtextedit.h> +#include <tqtextedit.h> class QSocketNotifier; class KPty; -class KConsole : public QTextEdit { +class KConsole : public TQTextEdit { Q_OBJECT - typedef QTextEdit inherited; + typedef TQTextEdit inherited; public: - KConsole( QWidget *_parent = 0 ); + KConsole( TQWidget *_parent = 0 ); ~KConsole(); private slots: @@ -45,8 +45,8 @@ class KConsole : public QTextEdit { void CloseConsole(); KPty *pty; - QSocketNotifier *notifier; - QString leftover; + TQSocketNotifier *notifier; + TQString leftover; int fd; }; diff --git a/kdm/kfrontend/kdm_greet.c b/kdm/kfrontend/kdm_greet.c index 6abc2c057..53d164f45 100644 --- a/kdm/kfrontend/kdm_greet.c +++ b/kdm/kfrontend/kdm_greet.c @@ -764,7 +764,7 @@ main( int argc ATTR_UNUSED, char **argv ) init_config(); - /* for QSettings */ + /* for TQSettings */ srand( time( 0 ) ); for (i = 0; i < 10000; i++) { sprintf( qtrc, "/tmp/%010d", rand() ); diff --git a/kdm/kfrontend/kdmclock.cpp b/kdm/kfrontend/kdmclock.cpp index 88bc33aaa..88cd53970 100644 --- a/kdm/kfrontend/kdmclock.cpp +++ b/kdm/kfrontend/kdmclock.cpp @@ -27,17 +27,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //#include <kapplication.h> //#include <kconfig.h> -#include <qdatetime.h> -#include <qpixmap.h> -#include <qpainter.h> -#include <qtimer.h> +#include <tqdatetime.h> +#include <tqpixmap.h> +#include <tqpainter.h> +#include <tqtimer.h> -KdmClock::KdmClock( QWidget *parent, const char *name ) +KdmClock::KdmClock( TQWidget *parent, const char *name ) : inherited( parent, name ) { // start timer - QTimer *timer = new QTimer( this ); - connect( timer, SIGNAL(timeout()), SLOT(timeout()) ); + TQTimer *timer = new TQTimer( this ); + connect( timer, TQT_SIGNAL(timeout()), TQT_SLOT(timeout()) ); timer->start( 1000 ); // reading rc file @@ -50,7 +50,7 @@ KdmClock::KdmClock( QWidget *parent, const char *name ) mBorder = false;//config->readNumEntry( "border", FALSE ); //config->setGroup( "Font" ); - mFont.setFamily( QString::fromLatin1("Utopia")/*config->readEntry( "Family", "Utopia")*/ ); + mFont.setFamily( TQString::fromLatin1("Utopia")/*config->readEntry( "Family", "Utopia")*/ ); mFont.setPointSize( 51/*config->readNumEntry( "Point Size", 51)*/ ); mFont.setWeight( 75/*config->readNumEntry( "Weight", 75)*/ ); mFont.setItalic( TRUE/*config->readNumEntry( "Italic",TRUE )*/ ); @@ -80,7 +80,7 @@ KdmClock::KdmClock( QWidget *parent, const char *name ) } -void KdmClock::showEvent( QShowEvent * ) +void KdmClock::showEvent( TQShowEvent * ) { repaint(); } @@ -91,25 +91,25 @@ void KdmClock::timeout() repaint(); } -void KdmClock::paintEvent( QPaintEvent * ) +void KdmClock::paintEvent( TQPaintEvent * ) { if (!isVisible()) return; - QPainter p( this ); + TQPainter p( this ); drawFrame( &p ); - QPixmap pm( contentsRect().size() ); - QPainter paint; + TQPixmap pm( contentsRect().size() ); + TQPainter paint; paint.begin( &pm ); paint.fillRect( contentsRect(), mBackgroundBrush ); // get current time - QTime time = QTime::currentTime(); + TQTime time = TQTime::currentTime(); /* if (mDigital) { - QString buf; + TQString buf; if (mSecond) buf.sprintf( "%02d:%02d:%02d", time.hour(), time.minute(), time.second() ); @@ -121,13 +121,13 @@ void KdmClock::paintEvent( QPaintEvent * ) paint.drawText( contentsRect(),AlignHCenter|AlignVCenter, buf,-1,0,0 ); } else { */ - QPointArray pts; - QPoint cp = contentsRect().center() - QPoint( 2,2 ); + TQPointArray pts; + TQPoint cp = contentsRect().center() - TQPoint( 2,2 ); int d = QMIN( contentsRect().width()-15,contentsRect().height()-15 ); paint.setPen( foregroundColor() ); paint.setBrush( foregroundColor() ); - QWMatrix matrix; + TQWMatrix matrix; matrix.translate( cp.x(), cp.y() ); matrix.scale( d/1000.0F, d/1000.0F ); diff --git a/kdm/kfrontend/kdmclock.h b/kdm/kfrontend/kdmclock.h index 92ce97733..91fa181ea 100644 --- a/kdm/kfrontend/kdmclock.h +++ b/kdm/kfrontend/kdmclock.h @@ -24,25 +24,25 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef _KDM_CLOCK_H_ #define _KDM_CLOCK_H_ -#include <qframe.h> +#include <tqframe.h> -class KdmClock : public QFrame { +class KdmClock : public TQFrame { Q_OBJECT - typedef QFrame inherited; + typedef TQFrame inherited; public: - KdmClock( QWidget *parent=0, const char *name=0 ); + KdmClock( TQWidget *parent=0, const char *name=0 ); protected: - virtual void showEvent( QShowEvent * ); - virtual void paintEvent( QPaintEvent * ); + virtual void showEvent( TQShowEvent * ); + virtual void paintEvent( TQPaintEvent * ); private slots: void timeout(); private: - QBrush mBackgroundBrush; - QFont mFont; + TQBrush mBackgroundBrush; + TQFont mFont; bool mSecond; bool mDigital; bool mDate; diff --git a/kdm/kfrontend/kdmconfig.cpp b/kdm/kfrontend/kdmconfig.cpp index 5d8d24e91..6f4c14031 100644 --- a/kdm/kfrontend/kdmconfig.cpp +++ b/kdm/kfrontend/kdmconfig.cpp @@ -35,7 +35,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. CONF_GREET_DEFS -QString _stsFile; +TQString _stsFile; bool _isLocal; bool _authorized; @@ -43,7 +43,7 @@ static QString GetCfgQStr( int id ) { char *tmp = GetCfgStr( id ); - QString qs = QString::fromUtf8( tmp ); + TQString qs = TQString::fromUtf8( tmp ); free( tmp ); return qs; } @@ -53,9 +53,9 @@ GetCfgQStrList( int id ) { int i, len; char **tmp = GetCfgStrArr( id, &len ); - QStringList qsl; + TQStringList qsl; for (i = 0; i < len - 1; i++) { - qsl.append( QString::fromUtf8( tmp[i] ) ); + qsl.append( TQString::fromUtf8( tmp[i] ) ); free( tmp[i] ); } free( tmp ); @@ -64,26 +64,26 @@ GetCfgQStrList( int id ) // Based on kconfigbase.cpp static QFont -Str2Font( const QString &aValue ) +Str2Font( const TQString &aValue ) { uint nFontBits; - QFont aRetFont; - QString chStr; + TQFont aRetFont; + TQString chStr; - QStringList sl = QStringList::split( QString::fromLatin1(","), aValue ); + TQStringList sl = TQStringList::split( TQString::fromLatin1(","), aValue ); if (sl.count() == 1) { /* X11 font spec */ - aRetFont = QFont( aValue ); + aRetFont = TQFont( aValue ); aRetFont.setRawMode( true ); } else if (sl.count() == 10) { /* qt3 font spec */ aRetFont.fromString( aValue ); } else if (sl.count() == 6) { /* backward compatible kde2 font spec */ - aRetFont = QFont( sl[0], sl[1].toInt(), sl[4].toUInt() ); + aRetFont = TQFont( sl[0], sl[1].toInt(), sl[4].toUInt() ); - aRetFont.setStyleHint( (QFont::StyleHint)sl[2].toUInt() ); + aRetFont.setStyleHint( (TQFont::StyleHint)sl[2].toUInt() ); nFontBits = sl[5].toUInt(); aRetFont.setItalic( (nFontBits & 0x01) != 0 ); @@ -92,9 +92,9 @@ Str2Font( const QString &aValue ) aRetFont.setFixedPitch( (nFontBits & 0x08) != 0 ); aRetFont.setRawMode( (nFontBits & 0x20) != 0 ); } - aRetFont.setStyleStrategy( (QFont::StyleStrategy) - (QFont::PreferMatch | - (_antiAliasing ? QFont::PreferAntialias : QFont::NoAntialias)) ); + aRetFont.setStyleStrategy( (TQFont::StyleStrategy) + (TQFont::PreferMatch | + (_antiAliasing ? TQFont::PreferAntialias : TQFont::NoAntialias)) ); return aRetFont; } @@ -117,8 +117,8 @@ void init_config( void ) hostname[sizeof(hostname)-1] = '\0'; struct utsname tuname; uname( &tuname ); - QString gst = _greetString; - _greetString = QString::null; + TQString gst = _greetString; + _greetString = TQString::null; int i, j, l = gst.length(); for (i = 0; i < l; i++) { if (gst[i] == '%') { @@ -138,7 +138,7 @@ void init_config( void ) case 'm': ptr = tuname.machine; break; default: _greetString += i18n("[fix kdmrc!]"); continue; } - _greetString += QString::fromLocal8Bit( ptr ); + _greetString += TQString::fromLocal8Bit( ptr ); } else _greetString += gst[i]; } @@ -147,7 +147,7 @@ void init_config( void ) /* out-of-place utility function */ void -decodeSess( dpySpec *sess, QString &user, QString &loc ) +decodeSess( dpySpec *sess, TQString &user, TQString &loc ) { if (sess->flags & isTTY) { user = @@ -156,9 +156,9 @@ decodeSess( dpySpec *sess, QString &user, QString &loc ) loc = #ifdef HAVE_VTS sess->vt ? - QString("vt%1").arg( sess->vt ) : + TQString("vt%1").arg( sess->vt ) : #endif - QString::fromLatin1( *sess->from ? sess->from : sess->display ); + TQString::fromLatin1( *sess->from ? sess->from : sess->display ); } else { user = !sess->user ? @@ -170,8 +170,8 @@ decodeSess( dpySpec *sess, QString &user, QString &loc ) loc = #ifdef HAVE_VTS sess->vt ? - QString("%1, vt%2").arg( sess->display ).arg( sess->vt ) : + TQString("%1, vt%2").arg( sess->display ).arg( sess->vt ) : #endif - QString::fromLatin1( sess->display ); + TQString::fromLatin1( sess->display ); } } diff --git a/kdm/kfrontend/kdmconfig.h b/kdm/kfrontend/kdmconfig.h index 3077a2ce0..f5420bcc4 100644 --- a/kdm/kfrontend/kdmconfig.h +++ b/kdm/kfrontend/kdmconfig.h @@ -32,11 +32,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifdef __cplusplus -#include <qstring.h> -#include <qstringlist.h> -#include <qfont.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqfont.h> -extern QString _stsFile; +extern TQString _stsFile; extern bool _isLocal; extern bool _authorized; @@ -44,7 +44,7 @@ CONF_GREET_CPP_DECLS // this file happens to be included everywhere, so just put it here struct dpySpec; -void decodeSess( dpySpec *sess, QString &user, QString &loc ); +void decodeSess( dpySpec *sess, TQString &user, TQString &loc ); extern "C" #endif diff --git a/kdm/kfrontend/kdmshutdown.cpp b/kdm/kfrontend/kdmshutdown.cpp index 74f62550e..dcd8a4cf1 100644 --- a/kdm/kfrontend/kdmshutdown.cpp +++ b/kdm/kfrontend/kdmshutdown.cpp @@ -37,20 +37,20 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include <kconfig.h> #include <kiconloader.h> -#include <qcombobox.h> -#include <qvbuttongroup.h> -#include <qstyle.h> -#include <qlayout.h> -#include <qaccel.h> -#include <qpopupmenu.h> -#include <qcheckbox.h> -#include <qlineedit.h> -#include <qlabel.h> -#include <qdatetime.h> -#include <qlistview.h> -#include <qheader.h> -#include <qdatetime.h> -#include <qregexp.h> +#include <tqcombobox.h> +#include <tqvbuttongroup.h> +#include <tqstyle.h> +#include <tqlayout.h> +#include <tqaccel.h> +#include <tqpopupmenu.h> +#include <tqcheckbox.h> +#include <tqlineedit.h> +#include <tqlabel.h> +#include <tqdatetime.h> +#include <tqlistview.h> +#include <tqheader.h> +#include <tqdatetime.h> +#include <tqregexp.h> #define KDmh KDialog::marginHint() #define KDsh KDialog::spacingHint() @@ -60,9 +60,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. int KDMShutdownBase::curPlugin = -1; PluginList KDMShutdownBase::pluginList; -KDMShutdownBase::KDMShutdownBase( int _uid, QWidget *_parent ) +KDMShutdownBase::KDMShutdownBase( int _uid, TQWidget *_parent ) : inherited( _parent ) - , box( new QVBoxLayout( this, KDmh, KDsh ) ) + , box( new TQVBoxLayout( this, KDmh, KDsh ) ) #ifdef HAVE_VTS , willShut( true ) #endif @@ -84,15 +84,15 @@ KDMShutdownBase::~KDMShutdownBase() } void -KDMShutdownBase::complete( QWidget *prevWidget ) +KDMShutdownBase::complete( TQWidget *prevWidget ) { - QSizePolicy fp( QSizePolicy::Fixed, QSizePolicy::Fixed ); + TQSizePolicy fp( TQSizePolicy::Fixed, TQSizePolicy::Fixed ); if (uid && ((willShut && _allowShutdown == SHUT_ROOT) || (mayNuke && _allowNuke == SHUT_ROOT))) { - rootlab = new QLabel( i18n("Root authorization required."), this ); + rootlab = new TQLabel( i18n("Root authorization required."), this ); box->addWidget( rootlab ); if (curPlugin < 0) { curPlugin = 0; @@ -104,14 +104,14 @@ KDMShutdownBase::complete( QWidget *prevWidget ) KGreeterPlugin::Shutdown ); verify->selectPlugin( curPlugin ); box->addLayout( verify->getLayout() ); - QAccel *accel = new QAccel( this ); + TQAccel *accel = new TQAccel( this ); accel->insertItem( ALT+Key_A, 0 ); - connect( accel, SIGNAL(activated( int )), SLOT(slotActivatePlugMenu()) ); + connect( accel, TQT_SIGNAL(activated( int )), TQT_SLOT(slotActivatePlugMenu()) ); } box->addWidget( new KSeparator( KSeparator::HLine, this ) ); - QBoxLayout *hlay = new QHBoxLayout( box, KDsh ); + TQBoxLayout *hlay = new TQHBoxLayout( box, KDsh ); hlay->addStretch( 1 ); if (mayOk) { okButton = new KPushButton( KStdGuiItem::ok(), this ); @@ -119,7 +119,7 @@ KDMShutdownBase::complete( QWidget *prevWidget ) okButton->setDefault( true ); hlay->addWidget( okButton ); hlay->addStretch( 1 ); - connect( okButton, SIGNAL(clicked()), SLOT(accept()) ); + connect( okButton, TQT_SIGNAL(clicked()), TQT_SLOT(accept()) ); } if (maySched) { KPushButton *schedButton = @@ -127,7 +127,7 @@ KDMShutdownBase::complete( QWidget *prevWidget ) schedButton->setSizePolicy( fp ); hlay->addWidget( schedButton ); hlay->addStretch( 1 ); - connect( schedButton, SIGNAL(clicked()), SLOT(slotSched()) ); + connect( schedButton, TQT_SIGNAL(clicked()), TQT_SLOT(slotSched()) ); } cancelButton = new KPushButton( KStdGuiItem::cancel(), this ); cancelButton->setSizePolicy( fp ); @@ -135,7 +135,7 @@ KDMShutdownBase::complete( QWidget *prevWidget ) cancelButton->setDefault( true ); hlay->addWidget( cancelButton ); hlay->addStretch( 1 ); - connect( cancelButton, SIGNAL(clicked()), SLOT(reject()) ); + connect( cancelButton, TQT_SIGNAL(clicked()), TQT_SLOT(reject()) ); updateNeedRoot(); } @@ -144,11 +144,11 @@ void KDMShutdownBase::slotActivatePlugMenu() { if (needRoot) { - QPopupMenu *cmnu = verify->getPlugMenu(); + TQPopupMenu *cmnu = verify->getPlugMenu(); if (!cmnu) return; - QSize sh( cmnu->sizeHint() / 2 ); - cmnu->exec( geometry().center() - QPoint( sh.width(), sh.height() ) ); + TQSize sh( cmnu->sizeHint() / 2 ); + cmnu->exec( geometry().center() - TQPoint( sh.width(), sh.height() ) ); } } @@ -218,7 +218,7 @@ KDMShutdownBase::verifyRetry() } void -KDMShutdownBase::verifySetUser( const QString & ) +KDMShutdownBase::verifySetUser( const TQString & ) { } @@ -239,25 +239,25 @@ doShutdown( int type, const char *os ) -KDMShutdown::KDMShutdown( int _uid, QWidget *_parent ) +KDMShutdown::KDMShutdown( int _uid, TQWidget *_parent ) : inherited( _uid, _parent ) { - QSizePolicy fp( QSizePolicy::Fixed, QSizePolicy::Fixed ); + TQSizePolicy fp( TQSizePolicy::Fixed, TQSizePolicy::Fixed ); - QHBoxLayout *hlay = new QHBoxLayout( box, KDsh ); + TQHBoxLayout *hlay = new TQHBoxLayout( box, KDsh ); - howGroup = new QVButtonGroup( i18n("Shutdown Type"), this ); + howGroup = new TQVButtonGroup( i18n("Shutdown Type"), this ); hlay->addWidget( howGroup, 0, AlignTop ); - QRadioButton *rb; + TQRadioButton *rb; rb = new KDMRadioButton( i18n("&Turn off computer"), howGroup ); rb->setChecked( true ); rb->setFocus(); restart_rb = new KDMRadioButton( i18n("&Restart computer"), howGroup ); - connect( rb, SIGNAL(doubleClicked()), SLOT(accept()) ); - connect( restart_rb, SIGNAL(doubleClicked()), SLOT(accept()) ); + connect( rb, TQT_SIGNAL(doubleClicked()), TQT_SLOT(accept()) ); + connect( restart_rb, TQT_SIGNAL(doubleClicked()), TQT_SLOT(accept()) ); GSet( 1 ); GSendInt( G_ListBootOpts ); @@ -265,40 +265,40 @@ KDMShutdown::KDMShutdown( int _uid, QWidget *_parent ) char **tlist = GRecvStrArr( 0 ); int defaultTarget = GRecvInt(); oldTarget = GRecvInt(); - QWidget *hlp = new QWidget( howGroup ); - targets = new QComboBox( hlp ); + TQWidget *hlp = new TQWidget( howGroup ); + targets = new TQComboBox( hlp ); for (int i = 0; tlist[i]; i++) - targets->insertItem( QString::fromLocal8Bit( tlist[i] ) ); + targets->insertItem( TQString::fromLocal8Bit( tlist[i] ) ); freeStrArr( tlist ); targets->setCurrentItem( oldTarget == -1 ? defaultTarget : oldTarget ); - QHBoxLayout *hb = new QHBoxLayout( hlp, 0, KDsh ); - int spc = kapp->style().pixelMetric( QStyle::PM_ExclusiveIndicatorWidth ) + TQHBoxLayout *hb = new TQHBoxLayout( hlp, 0, KDsh ); + int spc = kapp->style().pixelMetric( TQStyle::PM_ExclusiveIndicatorWidth ) + howGroup->insideSpacing(); hb->addSpacing( spc ); hb->addWidget( targets ); - connect( targets, SIGNAL(activated( int )), SLOT(slotTargetChanged()) ); + connect( targets, TQT_SIGNAL(activated( int )), TQT_SLOT(slotTargetChanged()) ); } GSet( 0 ); howGroup->setSizePolicy( fp ); - schedGroup = new QGroupBox( i18n("Scheduling"), this ); + schedGroup = new TQGroupBox( i18n("Scheduling"), this ); hlay->addWidget( schedGroup, 0, AlignTop ); - le_start = new QLineEdit( schedGroup ); - QLabel *lab1 = new QLabel( le_start, i18n("&Start:"), schedGroup ); + le_start = new TQLineEdit( schedGroup ); + TQLabel *lab1 = new TQLabel( le_start, i18n("&Start:"), schedGroup ); - le_timeout = new QLineEdit( schedGroup ); - QLabel *lab2 = new QLabel( le_timeout, i18n("T&imeout:"), schedGroup ); + le_timeout = new TQLineEdit( schedGroup ); + TQLabel *lab2 = new TQLabel( le_timeout, i18n("T&imeout:"), schedGroup ); - cb_force = new QCheckBox( i18n("&Force after timeout"), schedGroup ); + cb_force = new TQCheckBox( i18n("&Force after timeout"), schedGroup ); if (_allowNuke != SHUT_NONE) { - connect( cb_force, SIGNAL(clicked()), SLOT(slotWhenChanged()) ); + connect( cb_force, TQT_SIGNAL(clicked()), TQT_SLOT(slotWhenChanged()) ); mayNuke = true; } else cb_force->setEnabled( false ); - QGridLayout *grid = new QGridLayout( schedGroup, 0, 0, KDmh, KDsh ); + TQGridLayout *grid = new TQGridLayout( schedGroup, 0, 0, KDmh, KDsh ); grid->addRowSpacing( 0, schedGroup->fontMetrics().height() - 5 ); grid->addWidget( lab1, 1, 0, AlignRight ); grid->addWidget( le_start, 1, 1 ); @@ -326,7 +326,7 @@ get_date( const char *str ) KProcIO prc; prc << "/bin/date" << "+%s" << "-d" << str; prc.start( KProcess::Block, false ); - QString dstr; + TQString dstr; if (prc.readln( dstr, false, 0 ) < 0) return -1; return dstr.toInt(); @@ -388,7 +388,7 @@ KDMShutdown::accepted() } void -KDMShutdown::scheduleShutdown( QWidget *_parent ) +KDMShutdown::scheduleShutdown( TQWidget *_parent ) { GSet( 1 ); GSendInt( G_QueryShutdown ); @@ -415,30 +415,30 @@ KDMShutdown::scheduleShutdown( QWidget *_parent ) } -KDMRadioButton::KDMRadioButton( const QString &label, QWidget *parent ) +KDMRadioButton::KDMRadioButton( const TQString &label, TQWidget *parent ) : inherited( label, parent ) { } void -KDMRadioButton::mouseDoubleClickEvent( QMouseEvent * ) +KDMRadioButton::mouseDoubleClickEvent( TQMouseEvent * ) { emit doubleClicked(); } KDMDelayedPushButton::KDMDelayedPushButton( const KGuiItem &item, - QWidget *parent, + TQWidget *parent, const char *name ) : inherited( item, parent, name ) , pop( 0 ) { - connect( this, SIGNAL(pressed()), SLOT(slotPressed()) ); - connect( this, SIGNAL(released()), SLOT(slotReleased()) ); - connect( &popt, SIGNAL(timeout()), SLOT(slotTimeout()) ); + connect( this, TQT_SIGNAL(pressed()), TQT_SLOT(slotPressed()) ); + connect( this, TQT_SIGNAL(released()), TQT_SLOT(slotReleased()) ); + connect( &popt, TQT_SIGNAL(timeout()), TQT_SLOT(slotTimeout()) ); } -void KDMDelayedPushButton::setPopup( QPopupMenu *p ) +void KDMDelayedPushButton::setPopup( TQPopupMenu *p ) { pop = p; setIsMenuButton( p != 0 ); @@ -447,7 +447,7 @@ void KDMDelayedPushButton::setPopup( QPopupMenu *p ) void KDMDelayedPushButton::slotPressed() { if (pop) - popt.start( QApplication::startDragTime() ); + popt.start( TQApplication::startDragTime() ); } void KDMDelayedPushButton::slotReleased() @@ -462,41 +462,41 @@ void KDMDelayedPushButton::slotTimeout() setDown( false ); } -KDMSlimShutdown::KDMSlimShutdown( QWidget *_parent ) +KDMSlimShutdown::KDMSlimShutdown( TQWidget *_parent ) : inherited( _parent ) , targetList( 0 ) { bool doUbuntuLogout = KConfigGroup(KGlobal::config(), "Shutdown").readBoolEntry("doUbuntuLogout", false); - QVBoxLayout* vbox = new QVBoxLayout( this ); - QHBoxLayout *hbox = new QHBoxLayout( this, KDmh, KDsh ); - QFrame* lfrm = new QFrame( this ); - QHBoxLayout* hbuttonbox; + TQVBoxLayout* vbox = new TQVBoxLayout( this ); + TQHBoxLayout *hbox = new TQHBoxLayout( this, KDmh, KDsh ); + TQFrame* lfrm = new TQFrame( this ); + TQHBoxLayout* hbuttonbox; if(doUbuntuLogout) { - lfrm->setFrameStyle( QFrame::StyledPanel | QFrame::Raised ); - lfrm->setLineWidth( style().pixelMetric( QStyle::PM_DefaultFrameWidth, lfrm ) ); + lfrm->setFrameStyle( TQFrame::StyledPanel | TQFrame::Raised ); + lfrm->setLineWidth( style().pixelMetric( TQStyle::PM_DefaultFrameWidth, lfrm ) ); // we need to set the minimum size for the logout box, since it // gets too small if there isn't all options available lfrm->setMinimumSize(300,120); vbox->addWidget( lfrm ); - vbox = new QVBoxLayout( lfrm, 2 * KDialog::marginHint(), + vbox = new TQVBoxLayout( lfrm, 2 * KDialog::marginHint(), 2 * KDialog::spacingHint() ); // first line of buttons - hbuttonbox = new QHBoxLayout( vbox, 8 * KDialog::spacingHint() ); + hbuttonbox = new TQHBoxLayout( vbox, 8 * KDialog::spacingHint() ); hbuttonbox->setAlignment( Qt::AlignHCenter ); // Reboot FlatButton* btnReboot = new FlatButton( lfrm ); btnReboot->setTextLabel( i18n("&Restart"), false ); btnReboot->setPixmap( DesktopIcon( "reload") ); - int i = btnReboot->textLabel().find( QRegExp("\\&"), 0 ); // i == 1 + int i = btnReboot->textLabel().find( TQRegExp("\\&"), 0 ); // i == 1 btnReboot->setAccel( "ALT+" + btnReboot->textLabel().lower()[i+1] ) ; hbuttonbox->addWidget ( btnReboot); - connect(btnReboot, SIGNAL(clicked()), SLOT(slotReboot())); + connect(btnReboot, TQT_SIGNAL(clicked()), TQT_SLOT(slotReboot())); // Copied completely from the standard restart/shutdown dialog GSet( 1 ); @@ -505,17 +505,17 @@ KDMSlimShutdown::KDMSlimShutdown( QWidget *_parent ) targetList = GRecvStrArr( 0 ); /*int def =*/ GRecvInt(); int cur = GRecvInt(); - QPopupMenu *targets = new QPopupMenu( this ); + TQPopupMenu *targets = new TQPopupMenu( this ); btnReboot->setPopupDelay(300); // visually add dropdown for (int i = 0; targetList[i]; i++) { - QString t( QString::fromLocal8Bit( targetList[i] ) ); + TQString t( TQString::fromLocal8Bit( targetList[i] ) ); targets->insertItem( i == cur ? i18n("current option in boot loader", "%1 (current)").arg( t ) : t, i ); } btnReboot->setPopup( targets ); - connect( targets, SIGNAL(activated(int)), SLOT(slotReboot(int)) ); + connect( targets, TQT_SIGNAL(activated(int)), TQT_SLOT(slotReboot(int)) ); } GSet( 0 ); // Copied completely from the standard restart/shutdown dialog @@ -524,46 +524,46 @@ KDMSlimShutdown::KDMSlimShutdown( QWidget *_parent ) FlatButton* btnHalt = new FlatButton( lfrm ); btnHalt->setTextLabel( i18n("&Turn Off"), false ); btnHalt->setPixmap( DesktopIcon( "exit") ); - i = btnHalt->textLabel().find( QRegExp("\\&"), 0 ); // i == 1 + i = btnHalt->textLabel().find( TQRegExp("\\&"), 0 ); // i == 1 btnHalt->setAccel( "ALT+" + btnHalt->textLabel().lower()[i+1] ) ; hbuttonbox->addWidget ( btnHalt ); - connect(btnHalt, SIGNAL(clicked()), SLOT(slotHalt())); + connect(btnHalt, TQT_SIGNAL(clicked()), TQT_SLOT(slotHalt())); // cancel buttonbox - QHBoxLayout* hbuttonbox2 = new QHBoxLayout( vbox, 8 * KDialog::spacingHint() ); + TQHBoxLayout* hbuttonbox2 = new TQHBoxLayout( vbox, 8 * KDialog::spacingHint() ); hbuttonbox2->setAlignment( Qt::AlignRight ); // Back to kdm KSMPushButton* btnBack = new KSMPushButton( KStdGuiItem::cancel(), lfrm ); hbuttonbox2->addWidget( btnBack ); - connect(btnBack, SIGNAL(clicked()), SLOT(reject())); + connect(btnBack, TQT_SIGNAL(clicked()), TQT_SLOT(reject())); } else { - lfrm->setFrameStyle( QFrame::Panel | QFrame::Sunken ); + lfrm->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); hbox->addWidget( lfrm, AlignCenter ); - QLabel *icon = new QLabel( lfrm ); - icon->setPixmap( QPixmap( locate( "data", "kdm/pics/shutdown.jpg" ) ) ); - QVBoxLayout *iconlay = new QVBoxLayout( lfrm ); + TQLabel *icon = new TQLabel( lfrm ); + icon->setPixmap( TQPixmap( locate( "data", "kdm/pics/shutdown.jpg" ) ) ); + TQVBoxLayout *iconlay = new TQVBoxLayout( lfrm ); iconlay->addWidget( icon ); - QVBoxLayout *buttonlay = new QVBoxLayout( hbox, KDsh ); + TQVBoxLayout *buttonlay = new TQVBoxLayout( hbox, KDsh ); buttonlay->addStretch( 1 ); KPushButton *btnHalt = new KPushButton( KGuiItem( i18n("&Turn Off Computer"), "exit" ), this ); buttonlay->addWidget( btnHalt ); - connect( btnHalt, SIGNAL(clicked()), SLOT(slotHalt()) ); + connect( btnHalt, TQT_SIGNAL(clicked()), TQT_SLOT(slotHalt()) ); buttonlay->addSpacing( KDialog::spacingHint() ); KDMDelayedPushButton *btnReboot = new KDMDelayedPushButton( KGuiItem( i18n("&Restart Computer"), "reload" ), this ); buttonlay->addWidget( btnReboot ); - connect( btnReboot, SIGNAL(clicked()), SLOT(slotReboot()) ); + connect( btnReboot, TQT_SIGNAL(clicked()), TQT_SLOT(slotReboot()) ); GSet( 1 ); GSendInt( G_ListBootOpts ); @@ -571,16 +571,16 @@ KDMSlimShutdown::KDMSlimShutdown( QWidget *_parent ) targetList = GRecvStrArr( 0 ); /*int def =*/ GRecvInt(); int cur = GRecvInt(); - QPopupMenu *targets = new QPopupMenu( this ); + TQPopupMenu *targets = new TQPopupMenu( this ); for (int i = 0; targetList[i]; i++) { - QString t( QString::fromLocal8Bit( targetList[i] ) ); + TQString t( TQString::fromLocal8Bit( targetList[i] ) ); targets->insertItem( i == cur ? i18n("current option in boot loader", "%1 (current)").arg( t ) : t, i ); } btnReboot->setPopup( targets ); - connect( targets, SIGNAL(activated(int)), SLOT(slotReboot(int)) ); + connect( targets, TQT_SIGNAL(activated(int)), TQT_SLOT(slotReboot(int)) ); } GSet( 0 ); @@ -590,7 +590,7 @@ KDMSlimShutdown::KDMSlimShutdown( QWidget *_parent ) KPushButton *btnSched = new KPushButton( KGuiItem( i18n("&Schedule...") ), this ); buttonlay->addWidget( btnSched ); - connect( btnSched, SIGNAL(clicked()), SLOT(slotSched()) ); + connect( btnSched, TQT_SIGNAL(clicked()), TQT_SLOT(slotSched()) ); buttonlay->addStretch( 1 ); } @@ -601,7 +601,7 @@ KDMSlimShutdown::KDMSlimShutdown( QWidget *_parent ) KPushButton *btnBack = new KPushButton( KStdGuiItem::cancel(), this ); buttonlay->addWidget( btnBack ); - connect( btnBack, SIGNAL(clicked()), SLOT(reject()) ); + connect( btnBack, TQT_SIGNAL(clicked()), TQT_SLOT(reject()) ); buttonlay->addSpacing( KDialog::spacingHint() ); @@ -673,7 +673,7 @@ KDMSlimShutdown::externShutdown( int type, const char *os, int uid ) KSMPushButton::KSMPushButton( const KGuiItem &item, - QWidget *parent, + TQWidget *parent, const char *name) : KPushButton( item, parent, name), m_pressed(false) @@ -682,7 +682,7 @@ KSMPushButton::KSMPushButton( const KGuiItem &item, setAutoDefault ( false ); } -void KSMPushButton::keyPressEvent( QKeyEvent* e ) +void KSMPushButton::keyPressEvent( TQKeyEvent* e ) { switch ( e->key() ) { @@ -700,11 +700,11 @@ void KSMPushButton::keyPressEvent( QKeyEvent* e ) e->ignore(); } - QPushButton::keyPressEvent(e); + TQPushButton::keyPressEvent(e); } -void KSMPushButton::keyReleaseEvent( QKeyEvent* e ) +void KSMPushButton::keyReleaseEvent( TQKeyEvent* e ) { switch ( e->key() ) { @@ -728,8 +728,8 @@ void KSMPushButton::keyReleaseEvent( QKeyEvent* e ) } } -FlatButton::FlatButton( QWidget *parent, const char *name ) - : QToolButton( parent, name/*, WNoAutoErase*/ ), +FlatButton::FlatButton( TQWidget *parent, const char *name ) + : TQToolButton( parent, name/*, WNoAutoErase*/ ), m_pressed(false) { init(); @@ -743,12 +743,12 @@ void FlatButton::init() setUsesTextLabel(true); setUsesBigPixmap(true); setAutoRaise(true); - setTextPosition( QToolButton::Under ); - setFocusPolicy(QWidget::StrongFocus); + setTextPosition( TQToolButton::Under ); + setFocusPolicy(TQWidget::StrongFocus); } -void FlatButton::keyPressEvent( QKeyEvent* e ) +void FlatButton::keyPressEvent( TQKeyEvent* e ) { switch ( e->key() ) { @@ -766,10 +766,10 @@ void FlatButton::keyPressEvent( QKeyEvent* e ) e->ignore(); } - QToolButton::keyPressEvent(e); + TQToolButton::keyPressEvent(e); } -void FlatButton::keyReleaseEvent( QKeyEvent* e ) +void FlatButton::keyReleaseEvent( TQKeyEvent* e ) { switch ( e->key() ) { @@ -796,14 +796,14 @@ void FlatButton::keyReleaseEvent( QKeyEvent* e ) KDMConfShutdown::KDMConfShutdown( int _uid, dpySpec *sess, int type, const char *os, - QWidget *_parent ) + TQWidget *_parent ) : inherited( _uid, _parent ) { #ifdef HAVE_VTS if (type == SHUT_CONSOLE) willShut = false; #endif - box->addWidget( new QLabel( QString( "<qt><center><b><nobr>" + box->addWidget( new TQLabel( TQString( "<qt><center><b><nobr>" "%1%2" "</nobr></b></center><br></qt>" ) .arg( (type == SHUT_HALT) ? @@ -815,8 +815,8 @@ KDMConfShutdown::KDMConfShutdown( int _uid, dpySpec *sess, int type, const char i18n("Restart Computer") ) .arg( os ? i18n("<br>(Next boot: %1)") - .arg( QString::fromLocal8Bit( os ) ) : - QString::null ), + .arg( TQString::fromLocal8Bit( os ) ) : + TQString::null ), this ) ); if (sess) { @@ -825,23 +825,23 @@ KDMConfShutdown::KDMConfShutdown( int _uid, dpySpec *sess, int type, const char mayNuke = doesNuke = true; if (_allowNuke == SHUT_NONE) mayOk = false; - QLabel *lab = new QLabel( mayOk ? + TQLabel *lab = new TQLabel( mayOk ? i18n("Abort active sessions:") : i18n("No permission to abort active sessions:"), this ); box->addWidget( lab ); - QListView *lv = new QListView( this ); - lv->setSelectionMode( QListView::NoSelection ); + TQListView *lv = new TQListView( this ); + lv->setSelectionMode( TQListView::NoSelection ); lv->setAllColumnsShowFocus( true ); lv->header()->setResizeEnabled( false ); lv->addColumn( i18n("Session") ); lv->addColumn( i18n("Location") ); - QListViewItem *itm; + TQListViewItem *itm; int ns = 0; - QString user, loc; + TQString user, loc; do { decodeSess( sess, user, loc ); - itm = new QListViewItem( lv, user, loc ); + itm = new TQListViewItem( lv, user, loc ); sess = sess->next, ns++; } while (sess); int fw = lv->frameWidth() * 2; @@ -856,7 +856,7 @@ KDMConfShutdown::KDMConfShutdown( int _uid, dpySpec *sess, int type, const char KDMCancelShutdown::KDMCancelShutdown( int how, int start, int timeout, int force, int uid, const char *os, - QWidget *_parent ) + TQWidget *_parent ) : inherited( -1, _parent ) { if (force == SHUT_FORCE) { @@ -865,13 +865,13 @@ KDMCancelShutdown::KDMCancelShutdown( int how, int start, int timeout, else if (_allowNuke == SHUT_ROOT) mayNuke = doesNuke = true; } - QLabel *lab = new QLabel( mayOk ? + TQLabel *lab = new TQLabel( mayOk ? i18n("Abort pending shutdown:") : i18n("No permission to abort pending shutdown:"), this ); box->addWidget( lab ); - QDateTime qdt; - QString strt, end; + TQDateTime qdt; + TQString strt, end; if (start < time( 0 )) strt = i18n("now"); else { @@ -884,7 +884,7 @@ KDMCancelShutdown::KDMCancelShutdown( int how, int start, int timeout, qdt.setTime_t( timeout ); end = qdt.toString( LocalDate ); } - QString trg = + TQString trg = i18n("Owner: %1" "\nType: %2%5" "\nStart: %3" @@ -899,8 +899,8 @@ KDMCancelShutdown::KDMCancelShutdown( int how, int start, int timeout, i18n("restart computer") ) .arg( strt ).arg( end ) .arg( os ? - i18n("\nNext boot: %1").arg( QString::fromLocal8Bit( os ) ) : - QString::null ); + i18n("\nNext boot: %1").arg( TQString::fromLocal8Bit( os ) ) : + TQString::null ); if (timeout != TO_INF) trg += i18n("\nAfter timeout: %1") .arg( force == SHUT_FORCE ? @@ -908,7 +908,7 @@ KDMCancelShutdown::KDMCancelShutdown( int how, int start, int timeout, force == SHUT_FORCEMY ? i18n("abort own sessions") : i18n("cancel shutdown") ); - lab = new QLabel( trg, this ); + lab = new TQLabel( trg, this ); box->addWidget( lab ); complete( 0 ); } diff --git a/kdm/kfrontend/kdmshutdown.h b/kdm/kfrontend/kdmshutdown.h index 98877fcbb..88b06128a 100644 --- a/kdm/kfrontend/kdmshutdown.h +++ b/kdm/kfrontend/kdmshutdown.h @@ -31,9 +31,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include <kpushbutton.h> -#include <qradiobutton.h> -#include <qtoolbutton.h> -#include <qpixmap.h> +#include <tqradiobutton.h> +#include <tqtoolbutton.h> +#include <tqpixmap.h> class QLabel; class KPushButton; @@ -43,14 +43,14 @@ class QComboBox; class QCheckBox; class QLineEdit; -enum { Authed = QDialog::Accepted + 1, Schedule }; +enum { Authed = TQDialog::Accepted + 1, Schedule }; class KDMShutdownBase : public FDialog, public KGVerifyHandler { Q_OBJECT typedef FDialog inherited; public: - KDMShutdownBase( int _uid, QWidget *_parent ); + KDMShutdownBase( int _uid, TQWidget *_parent ); virtual ~KDMShutdownBase(); protected slots: @@ -61,9 +61,9 @@ class KDMShutdownBase : public FDialog, public KGVerifyHandler { protected: void updateNeedRoot(); - void complete( QWidget *prevWidget ); + void complete( TQWidget *prevWidget ); - QVBoxLayout *box; + TQVBoxLayout *box; #ifdef HAVE_VTS bool willShut; #else @@ -77,7 +77,7 @@ class KDMShutdownBase : public FDialog, public KGVerifyHandler { private: KPushButton *okButton, *cancelButton; - QLabel *rootlab; + TQLabel *rootlab; KGStdVerify *verify; int needRoot, uid; @@ -89,7 +89,7 @@ class KDMShutdownBase : public FDialog, public KGVerifyHandler { virtual void verifyOk(); virtual void verifyFailed(); virtual void verifyRetry(); - virtual void verifySetUser( const QString &user ); + virtual void verifySetUser( const TQString &user ); }; @@ -98,8 +98,8 @@ class KDMShutdown : public KDMShutdownBase { typedef KDMShutdownBase inherited; public: - KDMShutdown( int _uid, QWidget *_parent = 0 ); - static void scheduleShutdown( QWidget *_parent = 0 ); + KDMShutdown( int _uid, TQWidget *_parent = 0 ); + static void scheduleShutdown( TQWidget *_parent = 0 ); protected slots: virtual void accept(); @@ -112,26 +112,26 @@ class KDMShutdown : public KDMShutdownBase { void slotWhenChanged(); private: - QButtonGroup *howGroup; - QGroupBox *schedGroup; - QRadioButton *restart_rb; - QLineEdit *le_start, *le_timeout; - QCheckBox *cb_force; - QComboBox *targets; + TQButtonGroup *howGroup; + TQGroupBox *schedGroup; + TQRadioButton *restart_rb; + TQLineEdit *le_start, *le_timeout; + TQCheckBox *cb_force; + TQComboBox *targets; int oldTarget; int sch_st, sch_to; }; -class KDMRadioButton : public QRadioButton { +class KDMRadioButton : public TQRadioButton { Q_OBJECT - typedef QRadioButton inherited; + typedef TQRadioButton inherited; public: - KDMRadioButton( const QString &label, QWidget *parent ); + KDMRadioButton( const TQString &label, TQWidget *parent ); private: - virtual void mouseDoubleClickEvent( QMouseEvent * ); + virtual void mouseDoubleClickEvent( TQMouseEvent * ); signals: void doubleClicked(); @@ -143,8 +143,8 @@ class KDMDelayedPushButton : public KPushButton { typedef KPushButton inherited; public: - KDMDelayedPushButton( const KGuiItem &item, QWidget *parent, const char *name = 0 ); - void setPopup( QPopupMenu *pop ); + KDMDelayedPushButton( const KGuiItem &item, TQWidget *parent, const char *name = 0 ); + void setPopup( TQPopupMenu *pop ); private slots: void slotTimeout(); @@ -152,8 +152,8 @@ class KDMDelayedPushButton : public KPushButton { void slotReleased(); private: - QPopupMenu *pop; - QTimer popt; + TQPopupMenu *pop; + TQTimer popt; }; class KDMSlimShutdown : public FDialog { @@ -161,7 +161,7 @@ class KDMSlimShutdown : public FDialog { typedef FDialog inherited; public: - KDMSlimShutdown( QWidget *_parent = 0 ); + KDMSlimShutdown( TQWidget *_parent = 0 ); ~KDMSlimShutdown(); static void externShutdown( int type, const char *os, int uid ); @@ -183,7 +183,7 @@ class KDMConfShutdown : public KDMShutdownBase { public: KDMConfShutdown( int _uid, struct dpySpec *sess, int type, const char *os, - QWidget *_parent = 0 ); + TQWidget *_parent = 0 ); }; class KDMCancelShutdown : public KDMShutdownBase { @@ -192,7 +192,7 @@ class KDMCancelShutdown : public KDMShutdownBase { public: KDMCancelShutdown( int how, int start, int timeout, int force, int uid, - const char *os, QWidget *_parent ); + const char *os, TQWidget *_parent ); }; class KSMPushButton : public KPushButton @@ -201,11 +201,11 @@ class KSMPushButton : public KPushButton public: - KSMPushButton( const KGuiItem &item, QWidget *parent, const char *name = 0 ); + KSMPushButton( const KGuiItem &item, TQWidget *parent, const char *name = 0 ); protected: - virtual void keyPressEvent(QKeyEvent*e); - virtual void keyReleaseEvent(QKeyEvent*e); + virtual void keyPressEvent(TQKeyEvent*e); + virtual void keyReleaseEvent(TQKeyEvent*e); private: @@ -219,12 +219,12 @@ class FlatButton : public QToolButton public: - FlatButton( QWidget *parent = 0, const char *name = 0 ); + FlatButton( TQWidget *parent = 0, const char *name = 0 ); ~FlatButton(); protected: - virtual void keyPressEvent(QKeyEvent*e); - virtual void keyReleaseEvent(QKeyEvent*e); + virtual void keyPressEvent(TQKeyEvent*e); + virtual void keyReleaseEvent(TQKeyEvent*e); private slots: @@ -232,8 +232,8 @@ class FlatButton : public QToolButton void init(); bool m_pressed; - QString m_text; - QPixmap m_pixmap; + TQString m_text; + TQPixmap m_pixmap; }; diff --git a/kdm/kfrontend/kfdialog.cpp b/kdm/kfrontend/kfdialog.cpp index e3bb9d9c8..62a4acb22 100644 --- a/kdm/kfrontend/kfdialog.cpp +++ b/kdm/kfrontend/kfdialog.cpp @@ -29,24 +29,24 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include <kpushbutton.h> #include <kstdguiitem.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qapplication.h> -#include <qcursor.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqapplication.h> +#include <tqcursor.h> -FDialog::FDialog( QWidget *parent, bool framed ) +FDialog::FDialog( TQWidget *parent, bool framed ) : inherited( parent, 0, true/*, framed ? 0 : WStyle_NoBorder*/ ) { if (framed) { - winFrame = new QFrame( this, 0, WNoAutoErase ); - winFrame->setFrameStyle( QFrame::WinPanel | QFrame::Raised ); + winFrame = new TQFrame( this, 0, WNoAutoErase ); + winFrame->setFrameStyle( TQFrame::WinPanel | TQFrame::Raised ); winFrame->setLineWidth( 2 ); } else winFrame = 0; } void -FDialog::resizeEvent( QResizeEvent *e ) +FDialog::resizeEvent( TQResizeEvent *e ) { inherited::resizeEvent( e ); if (winFrame) { @@ -58,14 +58,14 @@ FDialog::resizeEvent( QResizeEvent *e ) void FDialog::adjustGeometry() { - QDesktopWidget *dsk = qApp->desktop(); + TQDesktopWidget *dsk = qApp->desktop(); if (_greeterScreen < 0) _greeterScreen = _greeterScreen == -2 ? - dsk->screenNumber( QPoint( dsk->width() - 1, 0 ) ) : - dsk->screenNumber( QPoint( 0, 0 ) ); + dsk->screenNumber( TQPoint( dsk->width() - 1, 0 ) ) : + dsk->screenNumber( TQPoint( 0, 0 ) ); - QRect scr = dsk->screenGeometry( _greeterScreen ); + TQRect scr = dsk->screenGeometry( _greeterScreen ); if (!winFrame) setFixedSize( scr.size() ); else { @@ -76,11 +76,11 @@ FDialog::adjustGeometry() if (parentWidget()) return; - QRect grt( rect() ); + TQRect grt( rect() ); if (winFrame) { unsigned x = 50, y = 50; sscanf( _greeterPos, "%u,%u", &x, &y ); - grt.moveCenter( QPoint( scr.x() + scr.width() * x / 100, + grt.moveCenter( TQPoint( scr.x() + scr.width() * x / 100, scr.y() + scr.height() * y / 100 ) ); int di; if ((di = scr.right() - grt.right()) < 0) @@ -94,13 +94,13 @@ FDialog::adjustGeometry() setGeometry( grt ); } - if (dsk->screenNumber( QCursor::pos() ) != _greeterScreen) - QCursor::setPos( grt.center() ); + if (dsk->screenNumber( TQCursor::pos() ) != _greeterScreen) + TQCursor::setPos( grt.center() ); } struct WinList { struct WinList *next; - QWidget *win; + TQWidget *win; }; int @@ -125,24 +125,24 @@ FDialog::exec() } void -FDialog::box( QWidget *parent, QMessageBox::Icon type, const QString &text ) +FDialog::box( TQWidget *parent, TQMessageBox::Icon type, const TQString &text ) { KFMsgBox dlg( parent, type, text.stripWhiteSpace() ); dlg.exec(); } -KFMsgBox::KFMsgBox( QWidget *parent, QMessageBox::Icon type, const QString &text ) +KFMsgBox::KFMsgBox( TQWidget *parent, TQMessageBox::Icon type, const TQString &text ) : inherited( parent ) { - QLabel *label1 = new QLabel( this ); - label1->setPixmap( QMessageBox::standardIcon( type ) ); - QLabel *label2 = new QLabel( text, this ); + TQLabel *label1 = new TQLabel( this ); + label1->setPixmap( TQMessageBox::standardIcon( type ) ); + TQLabel *label2 = new TQLabel( text, this ); KPushButton *button = new KPushButton( KStdGuiItem::ok(), this ); button->setDefault( true ); - button->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); - connect( button, SIGNAL(clicked()), SLOT(accept()) ); + button->setSizePolicy( TQSizePolicy( TQSizePolicy::Preferred, TQSizePolicy::Preferred ) ); + connect( button, TQT_SIGNAL(clicked()), TQT_SLOT(accept()) ); - QGridLayout *grid = new QGridLayout( this, 2, 2, 10 ); + TQGridLayout *grid = new TQGridLayout( this, 2, 2, 10 ); grid->addWidget( label1, 0, 0, Qt::AlignCenter ); grid->addWidget( label2, 0, 1, Qt::AlignCenter ); grid->addMultiCellWidget( button, 1,1, 0,1, Qt::AlignCenter ); diff --git a/kdm/kfrontend/kfdialog.h b/kdm/kfrontend/kfdialog.h index 7ab456f22..3f0524b84 100644 --- a/kdm/kfrontend/kfdialog.h +++ b/kdm/kfrontend/kfdialog.h @@ -26,38 +26,38 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef FDIALOG_H #define FDIALOG_H -#include <qdialog.h> -#include <qmessagebox.h> +#include <tqdialog.h> +#include <tqmessagebox.h> class QFrame; -class FDialog : public QDialog { - typedef QDialog inherited; +class FDialog : public TQDialog { + typedef TQDialog inherited; public: - FDialog( QWidget *parent = 0, bool framed = true ); + FDialog( TQWidget *parent = 0, bool framed = true ); virtual int exec(); - static void box( QWidget *parent, QMessageBox::Icon type, - const QString &text ); -#define errorbox QMessageBox::Critical -#define sorrybox QMessageBox::Warning -#define infobox QMessageBox::Information - void MsgBox( QMessageBox::Icon typ, const QString &msg ) { box( this, typ, msg ); } + static void box( TQWidget *parent, TQMessageBox::Icon type, + const TQString &text ); +#define errorbox TQMessageBox::Critical +#define sorrybox TQMessageBox::Warning +#define infobox TQMessageBox::Information + void MsgBox( TQMessageBox::Icon typ, const TQString &msg ) { box( this, typ, msg ); } protected: - virtual void resizeEvent( QResizeEvent *e ); + virtual void resizeEvent( TQResizeEvent *e ); void adjustGeometry(); private: - QFrame *winFrame; + TQFrame *winFrame; }; class KFMsgBox : public FDialog { typedef FDialog inherited; public: - KFMsgBox( QWidget *parent, QMessageBox::Icon type, const QString &text ); + KFMsgBox( TQWidget *parent, TQMessageBox::Icon type, const TQString &text ); }; #endif /* FDIALOG_H */ diff --git a/kdm/kfrontend/kgapp.cpp b/kdm/kfrontend/kgapp.cpp index a5bb667ef..70b510645 100644 --- a/kdm/kfrontend/kgapp.cpp +++ b/kdm/kfrontend/kgapp.cpp @@ -37,10 +37,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include <kstandarddirs.h> #include <ksimpleconfig.h> -#include <qtimer.h> -#include <qstring.h> -#include <qcursor.h> -#include <qpalette.h> +#include <tqtimer.h> +#include <tqstring.h> +#include <tqcursor.h> +#include <tqpalette.h> #include <stdlib.h> // free(), exit() #include <unistd.h> // alarm() @@ -75,7 +75,7 @@ GreeterApp::GreeterApp() } void -GreeterApp::timerEvent( QTimerEvent * ) +GreeterApp::timerEvent( TQTimerEvent * ) { alarm( 0 ); if (!PingServer( qt_xdisplay() )) @@ -145,13 +145,13 @@ kg_main( const char *argv0 ) app.setStyle( _GUIStyle ); // Load up the systemwide ICC profile - QString iccConfigFile = QString(KDE_CONFDIR); + TQString iccConfigFile = TQString(KDE_CONFDIR); iccConfigFile += "/kicc/kiccconfigrc"; KSimpleConfig iccconfig(iccConfigFile, true); if (iccconfig.readBoolEntry("EnableICC", false) == true) { - QString iccCommand = QString("/usr/bin/xcalib "); + TQString iccCommand = TQString("/usr/bin/xcalib "); iccCommand += iccconfig.readEntry("ICCFile"); - iccCommand += QString(" &"); + iccCommand += TQString(" &"); system(iccCommand.ascii()); } @@ -170,7 +170,7 @@ kg_main( const char *argv0 ) if (!_grabServer) { if (_useBackground) { proc = new KProcess; - *proc << QCString( argv0, strrchr( argv0, '/' ) - argv0 + 2 ) + "krootimage"; + *proc << TQCString( argv0, strrchr( argv0, '/' ) - argv0 + 2 ) + "krootimage"; *proc << _backgroundCfg; proc->start(); } diff --git a/kdm/kfrontend/kgapp.h b/kdm/kfrontend/kgapp.h index 9174cd5c8..f01ba1baa 100644 --- a/kdm/kfrontend/kgapp.h +++ b/kdm/kfrontend/kgapp.h @@ -37,7 +37,7 @@ class GreeterApp : public KApplication { virtual bool x11EventFilter( XEvent * ); protected: - virtual void timerEvent( QTimerEvent * ); + virtual void timerEvent( TQTimerEvent * ); signals: void activity(); diff --git a/kdm/kfrontend/kgdialog.cpp b/kdm/kfrontend/kgdialog.cpp index 636b20dec..1981eea83 100644 --- a/kdm/kfrontend/kgdialog.cpp +++ b/kdm/kfrontend/kgdialog.cpp @@ -30,11 +30,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include <klocale.h> -#include <qaccel.h> -#include <qlayout.h> -#include <qpushbutton.h> -#include <qpopupmenu.h> -#include <qapplication.h> +#include <tqaccel.h> +#include <tqlayout.h> +#include <tqpushbutton.h> +#include <tqpopupmenu.h> +#include <tqapplication.h> #include <stdlib.h> @@ -50,50 +50,50 @@ KGDialog::KGDialog( bool themed ) : inherited( 0, !themed ) void #ifdef XDMCP -KGDialog::completeMenu( int _switchIf, int _switchCode, const QString &_switchMsg, int _switchAccel ) +KGDialog::completeMenu( int _switchIf, int _switchCode, const TQString &_switchMsg, int _switchAccel ) #else KGDialog::completeMenu() #endif { #ifdef HAVE_VTS if (_isLocal) { - dpyMenu = new QPopupMenu( this ); + dpyMenu = new TQPopupMenu( this ); int id = inserten( i18n("Sw&itch User"), ALT+Key_I, dpyMenu ); - connect( dpyMenu, SIGNAL(activated( int )), - SLOT(slotDisplaySelected( int )) ); - connect( dpyMenu, SIGNAL(aboutToShow()), - SLOT(slotPopulateDisplays()) ); - QAccel *accel = new QAccel( this ); + connect( dpyMenu, TQT_SIGNAL(activated( int )), + TQT_SLOT(slotDisplaySelected( int )) ); + connect( dpyMenu, TQT_SIGNAL(aboutToShow()), + TQT_SLOT(slotPopulateDisplays()) ); + TQAccel *accel = new TQAccel( this ); accel->insertItem( ALT+CTRL+Key_Insert, id ); - connect( accel, SIGNAL(activated( int )), SLOT(slotActivateMenu( int )) ); + connect( accel, TQT_SIGNAL(activated( int )), TQT_SLOT(slotActivateMenu( int )) ); } #endif if (_allowClose) inserten( _isLocal ? i18n("R&estart X Server") : i18n("Clos&e Connection"), - ALT+Key_E, SLOT(slotExit()) ); + ALT+Key_E, TQT_SLOT(slotExit()) ); #ifdef XDMCP if (_isLocal && _loginMode != _switchIf) { switchCode = _switchCode; - inserten( _switchMsg, _switchAccel, SLOT(slotSwitch()) ); + inserten( _switchMsg, _switchAccel, TQT_SLOT(slotSwitch()) ); } #endif if (_hasConsole) - inserten( i18n("Co&nsole Login"), ALT+Key_N, SLOT(slotConsole()) ); + inserten( i18n("Co&nsole Login"), ALT+Key_N, TQT_SLOT(slotConsole()) ); if (_allowShutdown != SHUT_NONE) { - inserten( i18n("&Shutdown..."), ALT+Key_S, SLOT(slotShutdown( int )) ); - QAccel *accel = new QAccel( this ); + inserten( i18n("&Shutdown..."), ALT+Key_S, TQT_SLOT(slotShutdown( int )) ); + TQAccel *accel = new TQAccel( this ); accel->insertItem( ALT+CTRL+Key_Delete ); - connect( accel, SIGNAL(activated( int )), SLOT(slotShutdown( int )) ); - accel = new QAccel( this ); + connect( accel, TQT_SIGNAL(activated( int )), TQT_SLOT(slotShutdown( int )) ); + accel = new TQAccel( this ); accel->insertItem( SHIFT+ALT+CTRL+Key_PageUp, SHUT_REBOOT ); - connect( accel, SIGNAL(activated( int )), SLOT(slotShutdown( int )) ); - accel = new QAccel( this ); + connect( accel, TQT_SIGNAL(activated( int )), TQT_SLOT(slotShutdown( int )) ); + accel = new TQAccel( this ); accel->insertItem( SHIFT+ALT+CTRL+Key_PageDown, SHUT_HALT ); - connect( accel, SIGNAL(activated( int )), SLOT(slotShutdown( int )) ); + connect( accel, TQT_SIGNAL(activated( int )), TQT_SLOT(slotShutdown( int )) ); } } @@ -101,7 +101,7 @@ void KGDialog::ensureMenu() { if (!optMenu) { - optMenu = new QPopupMenu( this ); + optMenu = new TQPopupMenu( this ); optMenu->setCheckable( false ); needSep = false; } else if (needSep) { @@ -111,19 +111,19 @@ KGDialog::ensureMenu() } void -KGDialog::inserten( const QString& txt, int accel, const char *member ) +KGDialog::inserten( const TQString& txt, int accel, const char *member ) { ensureMenu(); optMenu->insertItem( txt, this, member, accel ); } int -KGDialog::inserten( const QString& txt, int accel, QPopupMenu *cmnu ) +KGDialog::inserten( const TQString& txt, int accel, TQPopupMenu *cmnu ) { ensureMenu(); int id = optMenu->insertItem( txt, cmnu ); optMenu->setAccel( accel, id ); - optMenu->connectItem( id, this, SLOT(slotActivateMenu( int )) ); + optMenu->connectItem( id, this, TQT_SLOT(slotActivateMenu( int )) ); optMenu->setItemParameter( id, id ); return id; } @@ -131,9 +131,9 @@ KGDialog::inserten( const QString& txt, int accel, QPopupMenu *cmnu ) void KGDialog::slotActivateMenu( int id ) { - QPopupMenu *cmnu = optMenu->findItem( id )->popup(); - QSize sh( cmnu->sizeHint() / 2 ); - cmnu->exec( geometry().center() - QPoint( sh.width(), sh.height() ) ); + TQPopupMenu *cmnu = optMenu->findItem( id )->popup(); + TQSize sh( cmnu->sizeHint() / 2 ); + cmnu->exec( geometry().center() - TQPoint( sh.width(), sh.height() ) ); } void @@ -149,7 +149,7 @@ KGDialog::slotSwitch() { #ifdef XDMCP // workaround for Qt bug - QTimer::singleShot( 0, this, SLOT(slotReallySwitch()) ); + TQTimer::singleShot( 0, this, TQT_SLOT(slotReallySwitch()) ); #endif } @@ -220,7 +220,7 @@ KGDialog::slotPopulateDisplays() #ifdef HAVE_VTS dpyMenu->clear(); dpySpec *sessions = fetchSessions( lstPassive | lstTTY ); - QString user, loc; + TQString user, loc; for (dpySpec *sess = sessions; sess; sess = sess->next) { decodeSess( sess, user, loc ); int id = dpyMenu->insertItem( diff --git a/kdm/kfrontend/kgdialog.h b/kdm/kfrontend/kgdialog.h index 05a4be5cf..f42a506ea 100644 --- a/kdm/kfrontend/kgdialog.h +++ b/kdm/kfrontend/kgdialog.h @@ -57,15 +57,15 @@ class KGDialog : public FDialog { protected: #ifdef XDMCP - void completeMenu( int _switchIf, int _switchCode, const QString &_switchMsg, int _switchAccel ); + void completeMenu( int _switchIf, int _switchCode, const TQString &_switchMsg, int _switchAccel ); #else void completeMenu(); #endif - void inserten( const QString& txt, int accel, const char *member ); - int inserten( const QString& txt, int accel, QPopupMenu *cmnu ); + void inserten( const TQString& txt, int accel, const char *member ); + int inserten( const TQString& txt, int accel, TQPopupMenu *cmnu ); bool needSep; - QPopupMenu *optMenu; + TQPopupMenu *optMenu; KGVerify *verify; #ifdef WITH_KDM_XCONSOLE KConsole *consoleView; @@ -79,7 +79,7 @@ class KGDialog : public FDialog { void ensureMenu(); #ifdef HAVE_VTS - QPopupMenu *dpyMenu; + TQPopupMenu *dpyMenu; #endif int switchCode; }; diff --git a/kdm/kfrontend/kgreeter.cpp b/kdm/kfrontend/kgreeter.cpp index 407b3d879..aa18afc6c 100644 --- a/kdm/kfrontend/kgreeter.cpp +++ b/kdm/kfrontend/kgreeter.cpp @@ -39,24 +39,24 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include <ksimpleconfig.h> #include <kstringhandler.h> -#undef Unsorted // x headers suck - make qdir.h work with --enable-final -#include <qdir.h> -#include <qfile.h> -#include <qbuffer.h> -#include <qmemarray.h> -#include <qimage.h> -#include <qmovie.h> -#include <qpopupmenu.h> -#include <qtimer.h> -#include <qheader.h> -#include <qstyle.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qpushbutton.h> -#include <qtooltip.h> -#include <qaccel.h> -#include <qstring.h> -#include <qeventloop.h> +#undef Unsorted // x headers suck - make tqdir.h work with --enable-final +#include <tqdir.h> +#include <tqfile.h> +#include <tqbuffer.h> +#include <tqmemarray.h> +#include <tqimage.h> +#include <tqmovie.h> +#include <tqpopupmenu.h> +#include <tqtimer.h> +#include <tqheader.h> +#include <tqstyle.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqpushbutton.h> +#include <tqtooltip.h> +#include <tqaccel.h> +#include <tqstring.h> +#include <tqeventloop.h> #include <pwd.h> #include <grp.h> @@ -69,32 +69,32 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class UserListView : public KListView { public: - UserListView( QWidget *parent = 0, const char *name = 0 ) + UserListView( TQWidget *parent = 0, const char *name = 0 ) : KListView( parent, name ) , cachedSizeHint( -1, 0 ) { - setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Ignored ); + setSizePolicy( TQSizePolicy::Preferred, TQSizePolicy::Ignored ); header()->hide(); - addColumn( QString::null ); + addColumn( TQString::null ); setColumnAlignment( 0, AlignVCenter ); - setResizeMode( QListView::LastColumn ); + setResizeMode( TQListView::LastColumn ); } - mutable QSize cachedSizeHint; + mutable TQSize cachedSizeHint; protected: - virtual QSize sizeHint() const + virtual TQSize sizeHint() const { if (!cachedSizeHint.isValid()) { constPolish(); uint maxw = 0; - for (QListViewItem *itm = firstChild(); itm; itm = itm->nextSibling()) { + for (TQListViewItem *itm = firstChild(); itm; itm = itm->nextSibling()) { uint thisw = itm->width( fontMetrics(), this, 0 ); if (thisw > maxw) maxw = thisw; } cachedSizeHint.setWidth( - style().pixelMetric( QStyle::PM_ScrollBarExtent ) + + style().pixelMetric( TQStyle::PM_ScrollBarExtent ) + frameWidth() * 2 + maxw ); } return cachedSizeHint; @@ -122,19 +122,19 @@ KGreeter::KGreeter( bool framed ) if (_userList) { userView = new UserListView( this ); - connect( userView, SIGNAL(clicked( QListViewItem * )), - SLOT(slotUserClicked( QListViewItem * )) ); - connect( userView, SIGNAL(doubleClicked( QListViewItem * )), - SLOT(accept()) ); + connect( userView, TQT_SIGNAL(clicked( TQListViewItem * )), + TQT_SLOT(slotUserClicked( TQListViewItem * )) ); + connect( userView, TQT_SIGNAL(doubleClicked( TQListViewItem * )), + TQT_SLOT(accept()) ); } if (_userCompletion) userList = new QStringList; if (userView || userList) insertUsers(); - sessMenu = new QPopupMenu( this ); - connect( sessMenu, SIGNAL(activated( int )), - SLOT(slotSessionSelected( int )) ); + sessMenu = new TQPopupMenu( this ); + connect( sessMenu, TQT_SIGNAL(activated( int )), + TQT_SLOT(slotSessionSelected( int )) ); insertSessions(); if (curPlugin < 0) { @@ -153,8 +153,8 @@ KGreeter::~KGreeter() class UserListViewItem : public KListViewItem { public: - UserListViewItem( UserListView *parent, const QString &text, - const QPixmap &pixmap, const QString &username ) + UserListViewItem( UserListView *parent, const TQString &text, + const TQPixmap &pixmap, const TQString &username ) : KListViewItem( parent ) , login( username ) { @@ -164,15 +164,15 @@ class UserListViewItem : public KListViewItem { parent->cachedSizeHint.setWidth( -1 ); } - QString login; + TQString login; }; #define FILE_LIMIT_ICON 20 #define FILE_LIMIT_IMAGE 200 void -KGreeter::insertUser( const QImage &default_pix, - const QString &username, struct passwd *ps ) +KGreeter::insertUser( const TQImage &default_pix, + const TQString &username, struct passwd *ps ) { if (setegid( ps->pw_gid )) return; @@ -193,12 +193,12 @@ KGreeter::insertUser( const QImage &default_pix, if (_faceSource != FACE_USER_ONLY && _faceSource != FACE_ADMIN_ONLY) nd = 1; - QImage p; + TQImage p; do { dp ^= 1; - QCString fn = !dp ? - QCString( ps->pw_dir ) + '/' : - QFile::encodeName( _faceDir + '/' + username ); + TQCString fn = !dp ? + TQCString( ps->pw_dir ) + '/' : + TQFile::encodeName( _faceDir + '/' + username ); fn += ".face.icon"; int fd, ico; if ((fd = open( fn.data(), O_RDONLY | O_NONBLOCK )) < 0) { @@ -208,7 +208,7 @@ KGreeter::insertUser( const QImage &default_pix, ico = 0; } else ico = 1; - QFile f; + TQFile f; f.open( IO_ReadOnly, fd ); int fs = f.size(); if (fs > (ico ? FILE_LIMIT_ICON : FILE_LIMIT_IMAGE) * 1000) { @@ -216,40 +216,40 @@ KGreeter::insertUser( const QImage &default_pix, fn.data(), ico ? FILE_LIMIT_ICON : FILE_LIMIT_IMAGE ); continue; } - QByteArray fc( fs ); + TQByteArray fc( fs ); int rfs = f.readBlock( fc.data(), fs ); ::close( fd ); fc.resize( rfs > 0 ? rfs : 0 ); - QBuffer buf( fc ); + TQBuffer buf( fc ); buf.open( IO_ReadOnly ); - QImageIO ir; + TQImageIO ir; ir.setIODevice( &buf ); if (!ir.read()) { LogInfo( "%s is no valid image\n", fn.data() ); continue; } p = ir.image(); - QSize ns( 48, 48 ); + TQSize ns( 48, 48 ); if (p.size() != ns) - p = p.convertDepth( 32 ).smoothScale( ns, QImage::ScaleMin ); + p = p.convertDepth( 32 ).smoothScale( ns, TQImage::ScaleMin ); goto gotit; } while (--nd >= 0); p = default_pix; gotit: - QString realname = KStringHandler::from8Bit( ps->pw_gecos ); + TQString realname = KStringHandler::from8Bit( ps->pw_gecos ); realname.truncate( realname.find( ',' ) ); if (realname.isEmpty() || realname == username) - new UserListViewItem( userView, username, QPixmap( p ), username ); + new UserListViewItem( userView, username, TQPixmap( p ), username ); else { realname.append( "\n" ).append( username ); - new UserListViewItem( userView, realname, QPixmap( p ), username ); + new UserListViewItem( userView, realname, TQPixmap( p ), username ); } seteuid( 0 ); setegid( 0 ); } -class KCStringList : public QValueList<QCString> { +class KCStringList : public TQValueList<TQCString> { public: bool contains( const char *str ) const { @@ -270,7 +270,7 @@ class UserList { KCStringList users; private: - QValueList<gid_t> groups; + TQValueList<gid_t> groups; }; UserList::UserList( char **in ) @@ -296,19 +296,19 @@ KGreeter::insertUsers() if (!(ps = getpwnam( "nobody" ))) return; - QImage default_pix; + TQImage default_pix; if (userView) { if (!default_pix.load( _faceDir + "/.default.face.icon" )) if (!default_pix.load( _faceDir + "/.default.face" )) LogError( "Can't open default user face\n" ); - QSize ns( 48, 48 ); + TQSize ns( 48, 48 ); if (default_pix.size() != ns) default_pix = - default_pix.convertDepth( 32 ).smoothScale( ns, QImage::ScaleMin ); + default_pix.convertDepth( 32 ).smoothScale( ns, TQImage::ScaleMin ); } if (_showUsers == SHOW_ALL) { UserList noUsers( _noUsers ); - QDict<int> dupes( 1000 ); + TQDict<int> dupes( 1000 ); for (setpwent(); (ps = getpwent()) != 0;) { if (*ps->pw_dir && *ps->pw_shell && (ps->pw_uid >= (unsigned)_lowUserId || @@ -317,7 +317,7 @@ KGreeter::insertUsers() !noUsers.hasUser( ps->pw_name ) && !noUsers.hasGroup( ps->pw_gid )) { - QString username( QFile::decodeName( ps->pw_name ) ); + TQString username( TQFile::decodeName( ps->pw_name ) ); if (!dupes.find( username )) { dupes.insert( username, (int *)-1 ); insertUser( default_pix, username, ps ); @@ -327,7 +327,7 @@ KGreeter::insertUsers() } else { UserList users( _users ); if (users.hasGroups()) { - QDict<int> dupes( 1000 ); + TQDict<int> dupes( 1000 ); for (setpwent(); (ps = getpwent()) != 0;) { if (*ps->pw_dir && *ps->pw_shell && (ps->pw_uid >= (unsigned)_lowUserId || @@ -336,7 +336,7 @@ KGreeter::insertUsers() (users.hasUser( ps->pw_name ) || users.hasGroup( ps->pw_gid ))) { - QString username( QFile::decodeName( ps->pw_name ) ); + TQString username( TQFile::decodeName( ps->pw_name ) ); if (!dupes.find( username )) { dupes.insert( username, (int *)-1 ); insertUser( default_pix, username, ps ); @@ -348,7 +348,7 @@ KGreeter::insertUsers() for (; it != users.users.end(); ++it) if ((ps = getpwnam( (*it).data() )) && (ps->pw_uid || _showRoot)) - insertUser( default_pix, QFile::decodeName( *it ), ps ); + insertUser( default_pix, TQFile::decodeName( *it ), ps ); } } endpwent(); @@ -361,7 +361,7 @@ KGreeter::insertUsers() } void -KGreeter::putSession( const QString &type, const QString &name, bool hid, const char *exe ) +KGreeter::putSession( const TQString &type, const TQString &name, bool hid, const char *exe ) { int prio = exe ? (!strcmp( exe, "default" ) ? 0 : !strcmp( exe, "failsafe" ) ? 3 : 2) : 2; @@ -377,10 +377,10 @@ void KGreeter::insertSessions() { for (char **dit = _sessionsDirs; *dit; ++dit) { - QStringList ents = QDir( *dit ).entryList(); - for (QStringList::ConstIterator it = ents.begin(); it != ents.end(); ++it) + TQStringList ents = TQDir( *dit ).entryList(); + for (TQStringList::ConstIterator it = ents.begin(); it != ents.end(); ++it) if ((*it).endsWith( ".desktop" )) { - KSimpleConfig dsk( QString( *dit ).append( '/' ).append( *it ) ); + KSimpleConfig dsk( TQString( *dit ).append( '/' ).append( *it ) ); dsk.setGroup( "Desktop Entry" ); putSession( (*it).left( (*it).length() - 8 ), dsk.readEntry( "Name" ), @@ -406,7 +406,7 @@ void KGreeter::slotUserEntered() { if (userView) { - QListViewItem *item; + TQListViewItem *item; for (item = userView->firstChild(); item; item = item->nextSibling()) if (((UserListViewItem *)item)->login == curUser) { userView->setSelected( item, true ); @@ -419,11 +419,11 @@ KGreeter::slotUserEntered() if (isVisible()) slotLoadPrevWM(); else - QTimer::singleShot( 0, this, SLOT(slotLoadPrevWM()) ); + TQTimer::singleShot( 0, this, TQT_SLOT(slotLoadPrevWM()) ); } void -KGreeter::slotUserClicked( QListViewItem *item ) +KGreeter::slotUserClicked( TQListViewItem *item ) { if (item) { curUser = ((UserListViewItem *)item)->login; @@ -475,7 +475,7 @@ KGreeter::slotLoadPrevWM() { int len, i, b; unsigned long crc, by; - QCString name; + TQCString name; char *sess; if (verify->coreLock) { @@ -537,7 +537,7 @@ void // protected KGreeter::pluginSetup() { int field = 0; - QString ent, pn( verify->pluginName() ), dn( dName + '_' + pn ); + TQString ent, pn( verify->pluginName() ), dn( dName + '_' + pn ); if (_preselUser != PRESEL_PREV) stsFile->deleteEntry( verify->entitiesLocal() ? dName : dn, false ); @@ -548,9 +548,9 @@ KGreeter::pluginSetup() else ent = _preselUser == PRESEL_PREV ? stsFile->readEntry( dn ) : - verify->getConf( 0, (pn + ".DefaultEntity").latin1(), QVariant() ).toString(); + verify->getConf( 0, (pn + ".DefaultEntity").latin1(), TQVariant() ).toString(); field = verify->entitiesFielded() ? - verify->getConf( 0, (pn + ".FocusField").latin1(), QVariant( 0 ) ).toInt() : + verify->getConf( 0, (pn + ".FocusField").latin1(), TQVariant( 0 ) ).toInt() : _focusPasswd; } verify->presetEntity( ent, field ); @@ -568,7 +568,7 @@ KGreeter::verifyPluginChanged( int id ) void KGreeter::verifyClear() { - curUser = QString::null; + curUser = TQString::null; slotUserEntered(); slotSessionSelected( -1 ); } @@ -602,7 +602,7 @@ KGreeter::verifyFailed() } void -KGreeter::verifySetUser( const QString &user ) +KGreeter::verifySetUser( const TQString &user ) { curUser = user; slotUserEntered(); @@ -613,25 +613,25 @@ KStdGreeter::KStdGreeter() , clock( 0 ) , pixLabel( 0 ) { - QBoxLayout *main_box; + TQBoxLayout *main_box; #ifdef WITH_KDM_XCONSOLE if (consoleView) { - QBoxLayout *ex_box = new QVBoxLayout( this, 10, 10 ); - main_box = new QHBoxLayout( ex_box, 10 ); + TQBoxLayout *ex_box = new TQVBoxLayout( this, 10, 10 ); + main_box = new TQHBoxLayout( ex_box, 10 ); ex_box->addWidget( consoleView ); } else #endif - main_box = new QHBoxLayout( this, 10, 10 ); + main_box = new TQHBoxLayout( this, 10, 10 ); if (userView) main_box->addWidget( userView ); - QBoxLayout *inner_box = new QVBoxLayout( main_box, 10 ); + TQBoxLayout *inner_box = new TQVBoxLayout( main_box, 10 ); if (!_authorized && _authComplain) { - QLabel *complainLabel = new QLabel( + TQLabel *complainLabel = new TQLabel( i18n("Warning: this is an unsecured session"), this ); - QToolTip::add( complainLabel, + TQToolTip::add( complainLabel, i18n("This display requires no X authorization.\n" "This means that anybody can connect to it,\n" "open windows on it or intercept your input.") ); @@ -641,7 +641,7 @@ KStdGreeter::KStdGreeter() inner_box->addWidget( complainLabel ); } if (!_greetString.isEmpty()) { - QLabel *welcomeLabel = new QLabel( _greetString, this ); + TQLabel *welcomeLabel = new TQLabel( _greetString, this ); welcomeLabel->setAlignment( AlignCenter ); welcomeLabel->setFont( _greetFont ); inner_box->addWidget( welcomeLabel ); @@ -653,19 +653,19 @@ KStdGreeter::KStdGreeter() break; case LOGO_LOGO: { - QMovie movie( _logo ); - kapp->eventLoop()->processEvents( QEventLoop::ExcludeUserInput | QEventLoop::ExcludeSocketNotifiers, 100 ); - QPixmap pixmap; + TQMovie movie( _logo ); + kapp->eventLoop()->processEvents( TQEventLoop::ExcludeUserInput | TQEventLoop::ExcludeSocketNotifiers, 100 ); + TQPixmap pixmap; if (!movie.framePixmap().isNull() || pixmap.load( _logo )) { - pixLabel = new QLabel( this ); + pixLabel = new TQLabel( this ); if (!movie.framePixmap().isNull()) { pixLabel->setMovie( movie ); if (!movie.framePixmap().hasAlpha()) - pixLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken ); + pixLabel->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); } else { pixLabel->setPixmap( pixmap ); if (!pixmap.hasAlpha()) - pixLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken ); + pixLabel->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); } pixLabel->setIndent( 0 ); } @@ -685,13 +685,13 @@ KStdGreeter::KStdGreeter() main_box->addWidget( pixLabel, 0, AlignCenter ); } - goButton = new QPushButton( i18n("L&ogin"), this ); + goButton = new TQPushButton( i18n("L&ogin"), this ); goButton->setDefault( true ); - connect( goButton, SIGNAL(clicked()), SLOT(accept()) ); - menuButton = new QPushButton( i18n("&Menu"), this ); + connect( goButton, TQT_SIGNAL(clicked()), TQT_SLOT(accept()) ); + menuButton = new TQPushButton( i18n("&Menu"), this ); //helpButton - QWidget *prec; + TQWidget *prec; if (userView) prec = userView; #ifdef WITH_KDM_XCONSOLE @@ -701,17 +701,17 @@ KStdGreeter::KStdGreeter() else prec = menuButton; KGStdVerify *sverify = - new KGStdVerify( this, this, prec, QString::null, + new KGStdVerify( this, this, prec, TQString::null, pluginList, KGreeterPlugin::Authenticate, KGreeterPlugin::Login ); inner_box->addLayout( sverify->getLayout() ); - QPopupMenu *plugMenu = sverify->getPlugMenu(); + TQPopupMenu *plugMenu = sverify->getPlugMenu(); sverify->selectPlugin( curPlugin ); verify = sverify; inner_box->addWidget( new KSeparator( KSeparator::HLine, this ) ); - QBoxLayout *hbox2 = new QHBoxLayout( inner_box, 10 ); + TQBoxLayout *hbox2 = new TQHBoxLayout( inner_box, 10 ); hbox2->addWidget( goButton ); hbox2->addStretch( 1 ); hbox2->addWidget( menuButton ); @@ -796,8 +796,8 @@ KThemedGreeter::KThemedGreeter() return; } - connect( themer, SIGNAL(activated( const QString & )), - SLOT(slotThemeActivated( const QString & )) ); + connect( themer, TQT_SIGNAL(activated( const TQString & )), + TQT_SLOT(slotThemeActivated( const TQString & )) ); console_rect = themer->findNode( "xconsole" ); // kdm ext userlist_rect = themer->findNode( "userlist" ); @@ -830,7 +830,7 @@ KThemedGreeter::KThemedGreeter() // } // clock = new KdmClock( this, "clock" ); - QWidget *prec; + TQWidget *prec; if (userView) prec = userView; #ifdef WITH_KDM_XCONSOLE @@ -840,10 +840,10 @@ KThemedGreeter::KThemedGreeter() else prec = 0; KGThemedVerify *tverify = - new KGThemedVerify( this, themer, this, prec, QString::null, + new KGThemedVerify( this, themer, this, prec, TQString::null, pluginList, KGreeterPlugin::Authenticate, KGreeterPlugin::Login ); - QPopupMenu *plugMenu = tverify->getPlugMenu(); + TQPopupMenu *plugMenu = tverify->getPlugMenu(); tverify->selectPlugin( curPlugin ); verify = tverify; @@ -853,9 +853,9 @@ KThemedGreeter::KThemedGreeter() itm->hide( true ); else { session_button = itm; - QAccel *accel = new QAccel( this ); + TQAccel *accel = new TQAccel( this ); accel->insertItem( ALT+Key_T, 0 ); - connect( accel, SIGNAL(activated( int )), SLOT(slotSessMenu()) ); + connect( accel, TQT_SIGNAL(activated( int )), TQT_SLOT(slotSessMenu()) ); } } else { if (sessMenu->count() > 1) { @@ -876,9 +876,9 @@ KThemedGreeter::KThemedGreeter() #endif system_button = themer->findNode( "system_button" ); - QAccel *accel = new QAccel( this ); + TQAccel *accel = new TQAccel( this ); accel->insertItem( ALT+Key_M, 0 ); - connect( accel, SIGNAL(activated( int )), SLOT(slotActionMenu()) ); + connect( accel, TQT_SIGNAL(activated( int )), TQT_SLOT(slotActionMenu()) ); pluginSetup(); @@ -886,7 +886,7 @@ KThemedGreeter::KThemedGreeter() } bool -KThemedGreeter::event( QEvent *e ) +KThemedGreeter::event( TQEvent *e ) { if (themer) themer->widgetEvent( e ); @@ -924,7 +924,7 @@ KThemedGreeter::verifyRetry() // goButton->setEnabled( true ); } -QString KThemedGreeter::timedUser = QString::null; +TQString KThemedGreeter::timedUser = TQString::null; int KThemedGreeter::timedDelay = -1; void @@ -958,7 +958,7 @@ KThemedGreeter::updateStatus( bool fail, bool caps, int timedleft ) } void -KThemedGreeter::slotThemeActivated( const QString &id ) +KThemedGreeter::slotThemeActivated( const TQString &id ) { if (id == "login_button") accept(); @@ -984,7 +984,7 @@ KThemedGreeter::slotActionMenu() } void -KThemedGreeter::keyPressEvent( QKeyEvent *e ) +KThemedGreeter::keyPressEvent( TQKeyEvent *e ) { inherited::keyPressEvent( e ); if (!(e->state() & KeyButtonMask) && diff --git a/kdm/kfrontend/kgreeter.h b/kdm/kfrontend/kgreeter.h index 32191fafe..c81e4eaed 100644 --- a/kdm/kfrontend/kgreeter.h +++ b/kdm/kfrontend/kgreeter.h @@ -43,12 +43,12 @@ class QPopupMenu; class QListViewItem; struct SessType { - QString name, type; + TQString name, type; bool hid; int prio; SessType() {} - SessType( const QString &n, const QString &t, bool h, int p ) : + SessType( const TQString &n, const TQString &t, bool h, int p ) : name( n ), type( t ), hid( h ), prio( p ) {} bool operator<( const SessType &st ) { return hid != st.hid ? hid < st.hid : @@ -68,25 +68,25 @@ class KGreeter : public KGDialog, public KGVerifyHandler { public slots: void accept(); void reject(); - void slotUserClicked( QListViewItem * ); + void slotUserClicked( TQListViewItem * ); void slotSessionSelected( int ); void slotUserEntered(); protected: void installUserList(); - void insertUser( const QImage &, const QString &, struct passwd * ); + void insertUser( const TQImage &, const TQString &, struct passwd * ); void insertUsers(); - void putSession( const QString &, const QString &, bool, const char * ); + void putSession( const TQString &, const TQString &, bool, const char * ); void insertSessions(); virtual void pluginSetup(); void setPrevWM( int ); - QString curUser, dName; + TQString curUser, dName; KSimpleConfig *stsFile; UserListView *userView; - QStringList *userList; - QPopupMenu *sessMenu; - QValueVector<SessType> sessionTypes; + TQStringList *userList; + TQPopupMenu *sessMenu; + TQValueVector<SessType> sessionTypes; int nNormals, nSpecials; int curPrev, curSel; bool prevValid; @@ -104,7 +104,7 @@ class KGreeter : public KGDialog, public KGVerifyHandler { virtual void verifyOk(); virtual void verifyFailed(); // virtual void verifyRetry(); - virtual void verifySetUser( const QString &user ); + virtual void verifySetUser( const TQString &user ); }; class KStdGreeter : public KGreeter { @@ -119,9 +119,9 @@ class KStdGreeter : public KGreeter { private: KdmClock *clock; - QLabel *pixLabel; - QPushButton *goButton; - QPushButton *menuButton; + TQLabel *pixLabel; + TQPushButton *goButton; + TQPushButton *menuButton; public: // from KGVerifyHandler virtual void verifyFailed(); @@ -135,19 +135,19 @@ class KThemedGreeter : public KGreeter { public: KThemedGreeter(); bool isOK() { return themer != 0; } - static QString timedUser; + static TQString timedUser; static int timedDelay; public slots: - void slotThemeActivated( const QString &id ); + void slotThemeActivated( const TQString &id ); void slotSessMenu(); void slotActionMenu(); protected: virtual void updateStatus( bool fail, bool caps, int timedleft ); virtual void pluginSetup(); - virtual void keyPressEvent( QKeyEvent * ); - virtual bool event( QEvent *e ); + virtual void keyPressEvent( TQKeyEvent * ); + virtual bool event( TQEvent *e ); private: // KdmClock *clock; diff --git a/kdm/kfrontend/kgverify.cpp b/kdm/kfrontend/kgverify.cpp index f9bb77ff8..ff8804f4d 100644 --- a/kdm/kfrontend/kgverify.cpp +++ b/kdm/kfrontend/kgverify.cpp @@ -38,11 +38,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include <kstdguiitem.h> #include <kpushbutton.h> -#include <qregexp.h> -#include <qpopupmenu.h> -#include <qlayout.h> -#include <qfile.h> -#include <qlabel.h> +#include <tqregexp.h> +#include <tqpopupmenu.h> +#include <tqlayout.h> +#include <tqfile.h> +#include <tqlabel.h> #include <pwd.h> #include <sys/types.h> @@ -67,8 +67,8 @@ void KGVerifyHandler::updateStatus( bool, bool, int ) } KGVerify::KGVerify( KGVerifyHandler *_handler, KdmThemer *_themer, - QWidget *_parent, QWidget *_predecessor, - const QString &_fixedUser, + TQWidget *_parent, TQWidget *_predecessor, + const TQString &_fixedUser, const PluginList &_pluginList, KGreeterPlugin::Function _func, KGreeterPlugin::Context _ctx ) @@ -91,8 +91,8 @@ KGVerify::KGVerify( KGVerifyHandler *_handler, KdmThemer *_themer, , failed( false ) , isClear( true ) { - connect( &timer, SIGNAL(timeout()), SLOT(slotTimeout()) ); - connect( kapp, SIGNAL(activity()), SLOT(slotActivity()) ); + connect( &timer, TQT_SIGNAL(timeout()), TQT_SLOT(slotTimeout()) ); + connect( kapp, TQT_SIGNAL(activity()), TQT_SLOT(slotActivity()) ); _parent->installEventFilter( this ); } @@ -103,16 +103,16 @@ KGVerify::~KGVerify() delete greet; } -QPopupMenu * +TQPopupMenu * KGVerify::getPlugMenu() { // assert( !cont ); if (!plugMenu) { uint np = pluginList.count(); if (np > 1) { - plugMenu = new QPopupMenu( parent ); - connect( plugMenu, SIGNAL(activated( int )), - SLOT(slotPluginSelected( int )) ); + plugMenu = new TQPopupMenu( parent ); + connect( plugMenu, TQT_SIGNAL(activated( int )), + TQT_SLOT(slotPluginSelected( int )) ); for (uint i = 0; i < np; i++) plugMenu->insertItem( i18n(greetPlugins[pluginList[i]].info->name), pluginList[i] ); } @@ -144,28 +144,28 @@ KGVerify::isClassic() const return !strcmp( greetPlugins[pluginList[curPlugin]].info->method, "classic" ); } -QString // public +TQString // public KGVerify::pluginName() const { - QString name( greetPlugins[pluginList[curPlugin]].library->fileName() ); + TQString name( greetPlugins[pluginList[curPlugin]].library->fileName() ); uint st = name.findRev( '/' ) + 1; uint en = name.find( '.', st ); - if (en - st > 7 && QConstString( name.unicode() + st, 7 ).string() == "kgreet_") + if (en - st > 7 && TQConstString( name.unicode() + st, 7 ).string() == "kgreet_") st += 7; return name.mid( st, en - st ); } static void -showWidgets( QLayoutItem *li ) +showWidgets( TQLayoutItem *li ) { - QWidget *w; - QLayout *l; + TQWidget *w; + TQLayout *l; if ((w = li->widget())) w->show(); else if ((l = li->layout())) { - QLayoutIterator it = l->iterator(); - for (QLayoutItem *itm = it.current(); itm; itm = ++it) + TQLayoutIterator it = l->iterator(); + for (TQLayoutItem *itm = it.current(); itm; itm = ++it) showWidgets( itm ); } } @@ -187,14 +187,14 @@ KGVerify::selectPlugin( int id ) } void // public -KGVerify::loadUsers( const QStringList &users ) +KGVerify::loadUsers( const TQStringList &users ) { Debug( "%s->loadUsers(...)\n", pName.data() ); greet->loadUsers( users ); } void // public -KGVerify::presetEntity( const QString &entity, int field ) +KGVerify::presetEntity( const TQString &entity, int field ) { presEnt = entity; presFld = field; @@ -249,17 +249,17 @@ KGVerify::performAutoLogin() handleVerify(); } -QString // public +TQString // public KGVerify::getEntity() const { Debug( "%s->getEntity()\n", pName.data() ); - QString ent = greet->getEntity(); + TQString ent = greet->getEntity(); Debug( " entity: %s\n", ent.latin1() ); return ent; } void -KGVerify::setUser( const QString &user ) +KGVerify::setUser( const TQString &user ) { // assert( fixedEntity.isEmpty() ); curUser = user; @@ -349,7 +349,7 @@ KGVerify::doReject( bool initial ) handler->verifyClear(); Debug( "%s->clear()\n", pName.data() ); greet->clear(); - curUser = QString::null; + curUser = TQString::null; if (!scheduleAutoLogin( initial )) { isClear = !(isClear && applyPreset()); if (running) { @@ -428,8 +428,8 @@ KGVerify::slotActivity() void // private static -KGVerify::VMsgBox( QWidget *parent, const QString &user, - QMessageBox::Icon type, const QString &mesg ) +KGVerify::VMsgBox( TQWidget *parent, const TQString &user, + TQMessageBox::Icon type, const TQString &mesg ) { FDialog::box( parent, type, user.isEmpty() ? mesg : i18n("Authenticating %1...\n\n").arg( user ) + mesg ); @@ -447,10 +447,10 @@ static const char *msgs[]= { }; void // private static -KGVerify::VErrBox( QWidget *parent, const QString &user, const char *msg ) +KGVerify::VErrBox( TQWidget *parent, const TQString &user, const char *msg ) { - QMessageBox::Icon icon; - QString mesg; + TQMessageBox::Icon icon; + TQString mesg; if (!msg) { mesg = i18n("A critical error occurred.\n" @@ -458,8 +458,8 @@ KGVerify::VErrBox( QWidget *parent, const QString &user, const char *msg ) "or contact your system administrator."); icon = errorbox; } else { - mesg = QString::fromLocal8Bit( msg ); - QString mesg1 = mesg + '.'; + mesg = TQString::fromLocal8Bit( msg ); + TQString mesg1 = mesg + '.'; for (uint i = 0; i < as(msgs); i++) if (mesg1 == msgs[i]) { mesg = i18n(msgs[i]); @@ -471,10 +471,10 @@ KGVerify::VErrBox( QWidget *parent, const QString &user, const char *msg ) } void // private static -KGVerify::VInfoBox( QWidget *parent, const QString &user, const char *msg ) +KGVerify::VInfoBox( TQWidget *parent, const TQString &user, const char *msg ) { - QString mesg = QString::fromLocal8Bit( msg ); - QRegExp rx( "^Warning: your account will expire in (\\d+) day" ); + TQString mesg = TQString::fromLocal8Bit( msg ); + TQRegExp rx( "^Warning: your account will expire in (\\d+) day" ); if (rx.search( mesg ) >= 0) { int expire = rx.cap( 1 ).toInt(); mesg = expire ? @@ -495,11 +495,11 @@ KGVerify::VInfoBox( QWidget *parent, const QString &user, const char *msg ) } bool // public static -KGVerify::handleFailVerify( QWidget *parent ) +KGVerify::handleFailVerify( TQWidget *parent ) { Debug( "handleFailVerify ...\n" ); char *msg = GRecvStr(); - QString user = QString::fromLocal8Bit( msg ); + TQString user = TQString::fromLocal8Bit( msg ); free( msg ); for (;;) { @@ -513,9 +513,9 @@ KGVerify::handleFailVerify( QWidget *parent ) case V_CHTOK_AUTH: Debug( " V_CHTOK_AUTH\n" ); { - QStringList pgs( _pluginsLogin ); + TQStringList pgs( _pluginsLogin ); pgs += _pluginsShutdown; - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for (it = pgs.begin(); it != pgs.end(); ++it) if (*it == "classic" || *it == "modern") { pgs = *it; @@ -569,7 +569,7 @@ KGVerify::handleFailVerify( QWidget *parent ) void // private KGVerify::handleVerify() { - QString user; + TQString user; Debug( "handleVerify ...\n" ); for (;;) { @@ -612,7 +612,7 @@ KGVerify::handleVerify() case V_PUT_USER: Debug( " V_PUT_USER\n" ); msg = GRecvStr(); - curUser = user = QString::fromLocal8Bit( msg ); + curUser = user = TQString::fromLocal8Bit( msg ); // greet needs this to be able to return something useful from // getEntity(). but the backend is still unable to tell a domain ... Debug( " %s->setUser(%\"s)\n", pName.data(), user.latin1() ); @@ -640,7 +640,7 @@ KGVerify::handleVerify() case V_CHTOK: Debug( " V_CHTOK\n" ); nfunc = KGreeterPlugin::ChAuthTok; - user = QString::null; + user = TQString::null; dchtok: { timer.stop(); @@ -686,7 +686,7 @@ KGVerify::handleVerify() Debug( " V_OK\n" ); if (!fixedEntity.isEmpty()) { Debug( " %s->getEntity()\n", pName.data() ); - QString ent = greet->getEntity(); + TQString ent = greet->getEntity(); Debug( " entity %\"s\n", ent.latin1() ); if (ent != fixedEntity) { Debug( "%s->failed()\n", pName.data() ); @@ -725,7 +725,7 @@ KGVerify::handleVerify() greet->start(); if (!cont) return; - user = QString::null; + user = TQString::null; } } @@ -759,7 +759,7 @@ KGVerify::gplugReturnBinary( const char *data ) } void -KGVerify::gplugSetUser( const QString &user ) +KGVerify::gplugSetUser( const TQString &user ) { Debug( "%s: gplugSetUser(%\"s)\n", pName.data(), user.latin1() ); curUser = user; @@ -790,19 +790,19 @@ KGVerify::gplugActivity() } void -KGVerify::gplugMsgBox( QMessageBox::Icon type, const QString &text ) +KGVerify::gplugMsgBox( TQMessageBox::Icon type, const TQString &text ) { Debug( "%s: gplugMsgBox(%d, %\"s)\n", pName.data(), type, text.latin1() ); MsgBox( type, text ); } bool -KGVerify::eventFilter( QObject *o, QEvent *e ) +KGVerify::eventFilter( TQObject *o, TQEvent *e ) { switch (e->type()) { - case QEvent::KeyPress: + case TQEvent::KeyPress: if (timedLeft) { - QKeyEvent *ke = (QKeyEvent *)e; + TQKeyEvent *ke = (TQKeyEvent *)e; if (ke->key() == Key_Return || ke->key() == Key_Enter) { if (deadTicks <= 0) { timedLeft = 0; @@ -812,7 +812,7 @@ KGVerify::eventFilter( QObject *o, QEvent *e ) } } /* fall through */ - case QEvent::KeyRelease: + case TQEvent::KeyRelease: updateLockStatus(); /* fall through */ default: @@ -835,7 +835,7 @@ KGVerify::updateLockStatus() } void -KGVerify::MsgBox( QMessageBox::Icon typ, const QString &msg ) +KGVerify::MsgBox( TQMessageBox::Icon typ, const TQString &msg ) { timer.suspend(); FDialog::box( parent, typ, msg ); @@ -843,14 +843,14 @@ KGVerify::MsgBox( QMessageBox::Icon typ, const QString &msg ) } -QVariant // public static -KGVerify::getConf( void *, const char *key, const QVariant &dflt ) +TQVariant // public static +KGVerify::getConf( void *, const char *key, const TQVariant &dflt ) { if (!qstrcmp( key, "EchoMode" )) - return QVariant( _echoMode ); + return TQVariant( _echoMode ); else { - QString fkey = QString::fromLatin1( key ) + '='; - for (QStringList::ConstIterator it = _pluginOptions.begin(); + TQString fkey = TQString::fromLatin1( key ) + '='; + for (TQStringList::ConstIterator it = _pluginOptions.begin(); it != _pluginOptions.end(); ++it) if ((*it).startsWith( fkey )) return (*it).mid( fkey.length() ); @@ -858,16 +858,16 @@ KGVerify::getConf( void *, const char *key, const QVariant &dflt ) } } -QValueVector<GreeterPluginHandle> KGVerify::greetPlugins; +TQValueVector<GreeterPluginHandle> KGVerify::greetPlugins; PluginList -KGVerify::init( const QStringList &plugins ) +KGVerify::init( const TQStringList &plugins ) { PluginList pluginList; - for (QStringList::ConstIterator it = plugins.begin(); it != plugins.end(); ++it) { + for (TQStringList::ConstIterator it = plugins.begin(); it != plugins.end(); ++it) { GreeterPluginHandle plugin; - QString path = KLibLoader::self()->findLibrary( + TQString path = KLibLoader::self()->findLibrary( ((*it)[0] == '/' ? *it : "kgreet_" + *it ).latin1() ); if (path.isEmpty()) { LogError( "GreeterPlugin %s does not exist\n", (*it).latin1() ); @@ -888,7 +888,7 @@ KGVerify::init( const QStringList &plugins ) continue; } plugin.info = (kgreeterplugin_info*)plugin.library->symbol( "kgreeterplugin_info" ); - if (!plugin.info->init( QString::null, getConf, 0 )) { + if (!plugin.info->init( TQString::null, getConf, 0 )) { LogError( "GreeterPlugin %s (%s) refuses to serve\n", (*it).latin1(), path.latin1() ); plugin.library->unload(); @@ -913,8 +913,8 @@ KGVerify::done() } -KGStdVerify::KGStdVerify( KGVerifyHandler *_handler, QWidget *_parent, - QWidget *_predecessor, const QString &_fixedUser, +KGStdVerify::KGStdVerify( KGVerifyHandler *_handler, TQWidget *_parent, + TQWidget *_predecessor, const TQString &_fixedUser, const PluginList &_pluginList, KGreeterPlugin::Function _func, KGreeterPlugin::Context _ctx ) @@ -925,7 +925,7 @@ KGStdVerify::KGStdVerify( KGVerifyHandler *_handler, QWidget *_parent, grid = new QGridLayout; grid->setAlignment( AlignCenter ); - failedLabel = new QLabel( parent ); + failedLabel = new TQLabel( parent ); failedLabel->setFont( _failFont ); grid->addWidget( failedLabel, 1, 0, AlignCenter ); @@ -1011,8 +1011,8 @@ KGStdVerify::updateStatus() KGThemedVerify::KGThemedVerify( KGVerifyHandler *_handler, KdmThemer *_themer, - QWidget *_parent, QWidget *_predecessor, - const QString &_fixedUser, + TQWidget *_parent, TQWidget *_predecessor, + const TQString &_fixedUser, const PluginList &_pluginList, KGreeterPlugin::Function _func, KGreeterPlugin::Context _ctx ) @@ -1030,7 +1030,7 @@ void // public KGThemedVerify::selectPlugin( int id ) { inherited::selectPlugin( id ); - QLayoutItem *l; + TQLayoutItem *l; KdmItem *n; if (themer && (l = greet->getLayoutItem())) { if (!(n = themer->findNode( "talker" ))) @@ -1071,14 +1071,14 @@ KGThemedVerify::updateStatus() } -KGChTok::KGChTok( QWidget *_parent, const QString &user, +KGChTok::KGChTok( TQWidget *_parent, const TQString &user, const PluginList &pluginList, int curPlugin, KGreeterPlugin::Function func, KGreeterPlugin::Context ctx ) : inherited( _parent ) , verify( 0 ) { - QSizePolicy fp( QSizePolicy::Fixed, QSizePolicy::Fixed ); + TQSizePolicy fp( TQSizePolicy::Fixed, TQSizePolicy::Fixed ); okButton = new KPushButton( KStdGuiItem::ok(), this ); okButton->setSizePolicy( fp ); okButton->setDefault( true ); @@ -1088,25 +1088,25 @@ KGChTok::KGChTok( QWidget *_parent, const QString &user, verify = new KGStdVerify( this, this, cancelButton, user, pluginList, func, ctx ); verify->selectPlugin( curPlugin ); - QVBoxLayout *box = new QVBoxLayout( this, 10 ); + TQVBoxLayout *box = new TQVBoxLayout( this, 10 ); - box->addWidget( new QLabel( i18n("Changing authentication token"), this ), 0, AlignHCenter ); + box->addWidget( new TQLabel( i18n("Changing authentication token"), this ), 0, AlignHCenter ); box->addLayout( verify->getLayout() ); box->addWidget( new KSeparator( KSeparator::HLine, this ) ); - QHBoxLayout *hlay = new QHBoxLayout( box ); + TQHBoxLayout *hlay = new TQHBoxLayout( box ); hlay->addStretch( 1 ); hlay->addWidget( okButton ); hlay->addStretch( 1 ); hlay->addWidget( cancelButton ); hlay->addStretch( 1 ); - connect( okButton, SIGNAL(clicked()), SLOT(accept()) ); - connect( cancelButton, SIGNAL(clicked()), SLOT(reject()) ); + connect( okButton, TQT_SIGNAL(clicked()), TQT_SLOT(accept()) ); + connect( cancelButton, TQT_SIGNAL(clicked()), TQT_SLOT(reject()) ); - QTimer::singleShot( 0, verify, SLOT(start()) ); + TQTimer::singleShot( 0, verify, TQT_SLOT(start()) ); } KGChTok::~KGChTok() @@ -1148,7 +1148,7 @@ KGChTok::verifyRetry() } void -KGChTok::verifySetUser( const QString & ) +KGChTok::verifySetUser( const TQString & ) { // cannot happen } @@ -1160,7 +1160,7 @@ QXTimer::QXTimer() : inherited( 0 ) , left( -1 ) { - connect( &timer, SIGNAL(timeout()), SLOT(slotTimeout()) ); + connect( &timer, TQT_SIGNAL(timeout()), TQT_SLOT(slotTimeout()) ); } void diff --git a/kdm/kfrontend/kgverify.h b/kdm/kfrontend/kgverify.h index a0d285e3d..ef2ed2469 100644 --- a/kdm/kfrontend/kgverify.h +++ b/kdm/kfrontend/kgverify.h @@ -29,17 +29,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "kgreeterplugin.h" #include "kfdialog.h" -#include <qlayout.h> -#include <qtimer.h> -#include <qvaluevector.h> +#include <tqlayout.h> +#include <tqtimer.h> +#include <tqvaluevector.h> #include <sys/time.h> #include <time.h> // helper class, nuke when qt supports suspend()/resume() -class QXTimer : public QObject { +class QXTimer : public TQObject { Q_OBJECT - typedef QObject inherited; + typedef TQObject inherited; public: QXTimer(); @@ -55,7 +55,7 @@ class QXTimer : public QObject { void slotTimeout(); private: - QTimer timer; + TQTimer timer; struct timeval stv; long left; }; @@ -67,7 +67,7 @@ class KGVerifyHandler { virtual void verifyOk() = 0; virtual void verifyFailed() = 0; virtual void verifyRetry() = 0; - virtual void verifySetUser( const QString &user ) = 0; + virtual void verifySetUser( const TQString &user ) = 0; virtual void updateStatus( bool fail, bool caps, int left ); // for themed only }; @@ -83,29 +83,29 @@ struct GreeterPluginHandle { kgreeterplugin_info *info; }; -typedef QValueVector<int> PluginList; +typedef TQValueVector<int> PluginList; -class KGVerify : public QObject, public KGreeterPluginHandler { +class KGVerify : public TQObject, public KGreeterPluginHandler { Q_OBJECT - typedef QObject inherited; + typedef TQObject inherited; public: KGVerify( KGVerifyHandler *handler, KdmThemer *themer, - QWidget *parent, QWidget *predecessor, - const QString &fixedEntity, const PluginList &pluginList, + TQWidget *parent, TQWidget *predecessor, + const TQString &fixedEntity, const PluginList &pluginList, KGreeterPlugin::Function func, KGreeterPlugin::Context ctx ); virtual ~KGVerify(); - QPopupMenu *getPlugMenu(); - void loadUsers( const QStringList &users ); - void presetEntity( const QString &entity, int field ); - QString getEntity() const; - void setUser( const QString &user ); + TQPopupMenu *getPlugMenu(); + void loadUsers( const TQStringList &users ); + void presetEntity( const TQString &entity, int field ); + TQString getEntity() const; + void setUser( const TQString &user ); /* virtual */ void selectPlugin( int id ); bool entitiesLocal() const; bool entitiesFielded() const; bool entityPresettable() const; bool isClassic() const; - QString pluginName() const; + TQString pluginName() const; void setEnabled( bool on ); void abort(); void suspend(); @@ -115,42 +115,42 @@ class KGVerify : public QObject, public KGreeterPluginHandler { int coreLock; - static bool handleFailVerify( QWidget *parent ); - static PluginList init( const QStringList &plugins ); + static bool handleFailVerify( TQWidget *parent ); + static PluginList init( const TQStringList &plugins ); static void done(); public slots: void start(); protected: - bool eventFilter( QObject *, QEvent * ); - void MsgBox( QMessageBox::Icon typ, const QString &msg ); + bool eventFilter( TQObject *, TQEvent * ); + void MsgBox( TQMessageBox::Icon typ, const TQString &msg ); void setTimer(); void updateLockStatus(); virtual void updateStatus() = 0; void handleVerify(); QXTimer timer; - QString fixedEntity, presEnt, curUser; + TQString fixedEntity, presEnt, curUser; PluginList pluginList; KGVerifyHandler *handler; KdmThemer *themer; - QWidget *parent, *predecessor; + TQWidget *parent, *predecessor; KGreeterPlugin *greet; - QPopupMenu *plugMenu; + TQPopupMenu *plugMenu; int curPlugin, presFld, timedLeft, deadTicks; - QCString pName; + TQCString pName; KGreeterPlugin::Function func; KGreeterPlugin::Context ctx; bool capsLocked; bool enabled, running, suspended, failed, delayed, cont; bool authTok, isClear, timeable; - static void VMsgBox( QWidget *parent, const QString &user, QMessageBox::Icon type, const QString &mesg ); - static void VErrBox( QWidget *parent, const QString &user, const char *msg ); - static void VInfoBox( QWidget *parent, const QString &user, const char *msg ); + static void VMsgBox( TQWidget *parent, const TQString &user, TQMessageBox::Icon type, const TQString &mesg ); + static void VErrBox( TQWidget *parent, const TQString &user, const char *msg ); + static void VInfoBox( TQWidget *parent, const TQString &user, const char *msg ); - static QValueVector<GreeterPluginHandle> greetPlugins; + static TQValueVector<GreeterPluginHandle> greetPlugins; private: bool applyPreset(); @@ -166,12 +166,12 @@ class KGVerify : public QObject, public KGreeterPluginHandler { public: // from KGreetPluginHandler virtual void gplugReturnText( const char *text, int tag ); virtual void gplugReturnBinary( const char *data ); - virtual void gplugSetUser( const QString &user ); + virtual void gplugSetUser( const TQString &user ); virtual void gplugStart(); virtual void gplugActivity(); - virtual void gplugMsgBox( QMessageBox::Icon type, const QString &text ); + virtual void gplugMsgBox( TQMessageBox::Icon type, const TQString &text ); - static QVariant getConf( void *ctx, const char *key, const QVariant &dflt ); + static TQVariant getConf( void *ctx, const char *key, const TQVariant &dflt ); }; class KGStdVerify : public KGVerify { @@ -179,20 +179,20 @@ class KGStdVerify : public KGVerify { typedef KGVerify inherited; public: - KGStdVerify( KGVerifyHandler *handler, QWidget *parent, - QWidget *predecessor, const QString &fixedEntity, + KGStdVerify( KGVerifyHandler *handler, TQWidget *parent, + TQWidget *predecessor, const TQString &fixedEntity, const PluginList &pluginList, KGreeterPlugin::Function func, KGreeterPlugin::Context ctx ); virtual ~KGStdVerify(); - QLayout *getLayout() const { return grid; } + TQLayout *getLayout() const { return grid; } void selectPlugin( int id ); protected: void updateStatus(); private: - QGridLayout *grid; - QLabel *failedLabel; + TQGridLayout *grid; + TQLabel *failedLabel; int failedLabelState; private slots: @@ -205,8 +205,8 @@ class KGThemedVerify : public KGVerify { public: KGThemedVerify( KGVerifyHandler *handler, KdmThemer *themer, - QWidget *parent, QWidget *predecessor, - const QString &fixedEntity, + TQWidget *parent, TQWidget *predecessor, + const TQString &fixedEntity, const PluginList &pluginList, KGreeterPlugin::Function func, KGreeterPlugin::Context ctx ); @@ -225,7 +225,7 @@ class KGChTok : public FDialog, public KGVerifyHandler { typedef FDialog inherited; public: - KGChTok( QWidget *parent, const QString &user, + KGChTok( TQWidget *parent, const TQString &user, const PluginList &pluginList, int curPlugin, KGreeterPlugin::Function func, KGreeterPlugin::Context ctx ); ~KGChTok(); @@ -242,7 +242,7 @@ class KGChTok : public FDialog, public KGVerifyHandler { virtual void verifyOk(); virtual void verifyFailed(); virtual void verifyRetry(); - virtual void verifySetUser( const QString &user ); + virtual void verifySetUser( const TQString &user ); }; #endif /* KGVERIFY_H */ diff --git a/kdm/kfrontend/krootimage.cpp b/kdm/kfrontend/krootimage.cpp index c630d9fa7..67b575c5f 100644 --- a/kdm/kfrontend/krootimage.cpp +++ b/kdm/kfrontend/krootimage.cpp @@ -25,7 +25,7 @@ Boston, MA 02110-1301, USA. #include <ksimpleconfig.h> #include <klocale.h> -#include <qfile.h> +#include <tqfile.h> #include "krootimage.h" @@ -46,10 +46,10 @@ static KCmdLineOptions options[] = { MyApplication::MyApplication( const char *conf ) : KApplication(), - renderer( 0, new KSimpleConfig( QFile::decodeName( conf ) ) ) + renderer( 0, new KSimpleConfig( TQFile::decodeName( conf ) ) ) { - connect( &timer, SIGNAL(timeout()), SLOT(slotTimeout()) ); - connect( &renderer, SIGNAL(imageDone( int )), this, SLOT(renderDone()) ); + connect( &timer, TQT_SIGNAL(timeout()), TQT_SLOT(slotTimeout()) ); + connect( &renderer, TQT_SIGNAL(imageDone( int )), this, TQT_SLOT(renderDone()) ); renderer.enableTiling( true ); // optimize renderer.changeWallpaper(); // cannot do it when we're killed, so do it now timer.start( 60000 ); diff --git a/kdm/kfrontend/krootimage.h b/kdm/kfrontend/krootimage.h index 608cfa3a1..3168994ba 100644 --- a/kdm/kfrontend/krootimage.h +++ b/kdm/kfrontend/krootimage.h @@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. #include <kapplication.h> -#include <qtimer.h> +#include <tqtimer.h> #include <bgrender.h> @@ -42,7 +42,7 @@ class MyApplication : public KApplication private: KVirtualBGRenderer renderer; - QTimer timer; + TQTimer timer; }; #endif diff --git a/kdm/kfrontend/themer/kdmitem.cpp b/kdm/kfrontend/themer/kdmitem.cpp index 48c0d1faf..38af9d0aa 100644 --- a/kdm/kfrontend/themer/kdmitem.cpp +++ b/kdm/kfrontend/themer/kdmitem.cpp @@ -31,16 +31,16 @@ #include <kglobal.h> #include <kdebug.h> -#include <qframe.h> -#include <qwidget.h> -#include <qlayout.h> -#include <qimage.h> +#include <tqframe.h> +#include <tqwidget.h> +#include <tqlayout.h> +#include <tqimage.h> #ifdef DRAW_OUTLINE -# include <qpainter.h> +# include <tqpainter.h> #endif -KdmItem::KdmItem( KdmItem *parent, const QDomNode &node, const char *name ) - : QObject( parent, name ) +KdmItem::KdmItem( KdmItem *parent, const TQDomNode &node, const char *name ) + : TQObject( parent, name ) , boxManager( 0 ) , fixedManager( 0 ) , image( 0 ) @@ -68,23 +68,23 @@ KdmItem::KdmItem( KdmItem *parent, const QDomNode &node, const char *name ) } // Read the mandatory Pos tag. Other tags such as normal, prelighted, // etc.. are read under specific implementations. - QDomNodeList childList = node.childNodes(); + TQDomNodeList childList = node.childNodes(); for (uint nod = 0; nod < childList.count(); nod++) { - QDomNode child = childList.item( nod ); - QDomElement el = child.toElement(); - QString tagName = el.tagName(), attr; + TQDomNode child = childList.item( nod ); + TQDomElement el = child.toElement(); + TQString tagName = el.tagName(), attr; if (tagName == "pos") { - parseAttribute( el.attribute( "x", QString::null ), pos.x, pos.xType ); - parseAttribute( el.attribute( "y", QString::null ), pos.y, pos.yType ); - parseAttribute( el.attribute( "width", QString::null ), pos.width, pos.wType ); - parseAttribute( el.attribute( "height", QString::null ), pos.height, pos.hType ); + parseAttribute( el.attribute( "x", TQString::null ), pos.x, pos.xType ); + parseAttribute( el.attribute( "y", TQString::null ), pos.y, pos.yType ); + parseAttribute( el.attribute( "width", TQString::null ), pos.width, pos.wType ); + parseAttribute( el.attribute( "height", TQString::null ), pos.height, pos.hType ); pos.anchor = el.attribute( "anchor", "nw" ); } } - QDomNode tnode = node; - id = tnode.toElement().attribute( "id", QString::number( (ulong)this, 16 ) ); + TQDomNode tnode = node; + id = tnode.toElement().attribute( "id", TQString::number( (ulong)this, 16 ) ); // Tell 'parent' to add 'me' to its children KdmItem *parentItem = static_cast<KdmItem *>( parent ); @@ -115,7 +115,7 @@ KdmItem::show( bool force ) if (isShown != InitialHidden && !force) return; - QValueList<KdmItem *>::Iterator it; + TQValueList<KdmItem *>::Iterator it; for (it = m_children.begin(); it != m_children.end(); ++it) (*it)->show(); @@ -139,7 +139,7 @@ KdmItem::hide( bool force ) return; // no need for further action } - QValueList<KdmItem *>::Iterator it; + TQValueList<KdmItem *>::Iterator it; for (it = m_children.begin(); it != m_children.end(); ++it) (*it)->hide(); @@ -158,18 +158,18 @@ KdmItem::inheritFromButton( KdmItem *button ) if (button) buttonParent = button; - QValueList<KdmItem *>::Iterator it; + TQValueList<KdmItem *>::Iterator it; for (it = m_children.begin(); it != m_children.end(); ++it) (*it)->inheritFromButton( button ); } KdmItem * -KdmItem::findNode( const QString &_id ) const +KdmItem::findNode( const TQString &_id ) const { if (id == _id) return const_cast<KdmItem *>( this ); - QValueList<KdmItem *>::ConstIterator it; + TQValueList<KdmItem *>::ConstIterator it; for (it = m_children.begin(); it != m_children.end(); ++it) { KdmItem *t = (*it)->findNode( _id ); if (t) @@ -180,7 +180,7 @@ KdmItem::findNode( const QString &_id ) const } void -KdmItem::setWidget( QWidget *widget ) +KdmItem::setWidget( TQWidget *widget ) { // delete myWidget; -- themer->widget() owns the widgets @@ -191,13 +191,13 @@ KdmItem::setWidget( QWidget *widget ) myWidget->show(); // Remove borders so that it blends nicely with the theme background - QFrame* frame = ::qt_cast<QFrame *>( widget ); + TQFrame* frame = ::qt_cast<TQFrame *>( widget ); if (frame) - frame->setFrameStyle( QFrame::NoFrame ); + frame->setFrameStyle( TQFrame::NoFrame ); myWidget->setGeometry(area); - connect( myWidget, SIGNAL(destroyed()), SLOT(widgetGone()) ); + connect( myWidget, TQT_SIGNAL(destroyed()), TQT_SLOT(widgetGone()) ); } void @@ -207,16 +207,16 @@ KdmItem::widgetGone() } void -KdmItem::setLayoutItem( QLayoutItem *item ) +KdmItem::setLayoutItem( TQLayoutItem *item ) { myLayoutItem = item; // XXX hiding not supported - it think it's pointless here if (myLayoutItem->widget()) - connect( myLayoutItem->widget(), SIGNAL(destroyed()), - SLOT(layoutItemGone()) ); + connect( myLayoutItem->widget(), TQT_SIGNAL(destroyed()), + TQT_SLOT(layoutItemGone()) ); else if (myLayoutItem->layout()) - connect( myLayoutItem->layout(), SIGNAL(destroyed()), - SLOT(layoutItemGone()) ); + connect( myLayoutItem->layout(), TQT_SIGNAL(destroyed()), + TQT_SLOT(layoutItemGone()) ); } void @@ -227,7 +227,7 @@ KdmItem::layoutItemGone() /* This is called as a result of KdmLayout::update, and directly on the root */ void -KdmItem::setGeometry( const QRect &newGeometry, bool force ) +KdmItem::setGeometry( const TQRect &newGeometry, bool force ) { kdDebug() << " KdmItem::setGeometry " << id << newGeometry << endl; // check if already 'in place' @@ -253,7 +253,7 @@ KdmItem::setGeometry( const QRect &newGeometry, bool force ) } void -KdmItem::paint( QPainter *p, const QRect &rect ) +KdmItem::paint( TQPainter *p, const TQRect &rect ) { if (isHidden()) return; @@ -262,7 +262,7 @@ KdmItem::paint( QPainter *p, const QRect &rect ) return; if (area.intersects( rect )) { - QRect contentsRect = area.intersect( rect ); + TQRect contentsRect = area.intersect( rect ); contentsRect.moveBy( QMIN( 0, -area.x() ), QMIN( 0, -area.y() ) ); drawContents( p, contentsRect ); } @@ -277,7 +277,7 @@ KdmItem::paint( QPainter *p, const QRect &rect ) return; // Dispatch paint events to children - QValueList<KdmItem *>::Iterator it; + TQValueList<KdmItem *>::Iterator it; for (it = m_children.begin(); it != m_children.end(); ++it) (*it)->paint( p, rect ); } @@ -316,7 +316,7 @@ KdmItem::mouseEvent( int x, int y, bool pressed, bool released ) } if (!buttonParent) { - QValueList<KdmItem *>::Iterator it; + TQValueList<KdmItem *>::Iterator it; for (it = m_children.begin(); it != m_children.end(); ++it) (*it)->mouseEvent( x, y, pressed, released ); } @@ -329,7 +329,7 @@ void KdmItem::statusChanged() { if (buttonParent == this) { - QValueList<KdmItem *>::Iterator it; + TQValueList<KdmItem *>::Iterator it; for (it = m_children.begin(); it != m_children.end(); ++it) { (*it)->state = state; (*it)->statusChanged(); @@ -348,14 +348,14 @@ KdmItem::sizeHint() return myLayoutItem->sizeHint(); int w = pos.wType == DTpixel ? kAbs( pos.width ) : -1, h = pos.hType == DTpixel ? kAbs( pos.height ) : -1; - return QSize( w, h ); + return TQSize( w, h ); } QRect -KdmItem::placementHint( const QRect &parentRect ) +KdmItem::placementHint( const TQRect &parentRect ) { - QSize hintedSize = sizeHint(); - QSize boxHint; + TQSize hintedSize = sizeHint(); + TQSize boxHint; int x = parentRect.left(), y = parentRect.top(), @@ -435,7 +435,7 @@ KdmItem::placementHint( const QRect &parentRect ) x += dx; // Note: no clipping to parent because this broke many themes! - return QRect( x, y, w, h ); + return TQRect( x, y, w, h ); } // END protected inheritable @@ -457,12 +457,12 @@ KdmItem::addChildItem( KdmItem *item ) } // signal bounce from child to parent - connect( item, SIGNAL(needUpdate( int, int, int, int )), SIGNAL(needUpdate( int, int, int, int )) ); - connect( item, SIGNAL(activated( const QString & )), SIGNAL(activated( const QString & )) ); + connect( item, TQT_SIGNAL(needUpdate( int, int, int, int )), TQT_SIGNAL(needUpdate( int, int, int, int )) ); + connect( item, TQT_SIGNAL(activated( const TQString & )), TQT_SIGNAL(activated( const TQString & )) ); } void -KdmItem::parseAttribute( const QString &s, int &val, enum DataType &dType ) +KdmItem::parseAttribute( const TQString &s, int &val, enum DataType &dType ) { if (s.isEmpty()) return; @@ -473,13 +473,13 @@ KdmItem::parseAttribute( const QString &s, int &val, enum DataType &dType ) val = 0; } else if ((p = s.find( '%' )) >= 0) { // percent value dType = DTpercent; - QString sCopy = s; + TQString sCopy = s; sCopy.remove( p, 1 ); sCopy.replace( ',', '.' ); val = (int)sCopy.toDouble(); } else { // int value dType = DTpixel; - QString sCopy = s; + TQString sCopy = s; if (sCopy.at( 0 ) == '-') { sCopy.remove( 0, 1 ); dType = DTnpixel; @@ -490,7 +490,7 @@ KdmItem::parseAttribute( const QString &s, int &val, enum DataType &dType ) } void -KdmItem::parseFont( const QString &s, QFont &font ) +KdmItem::parseFont( const TQString &s, TQFont &font ) { int splitAt = s.findRev( ' ' ); if (splitAt < 1) @@ -502,19 +502,19 @@ KdmItem::parseFont( const QString &s, QFont &font ) } void -KdmItem::parseColor( const QString &s, QColor &color ) +KdmItem::parseColor( const TQString &s, TQColor &color ) { if (s.at( 0 ) != '#') return; bool ok; - QString sCopy = s; + TQString sCopy = s; int hexColor = sCopy.remove( 0, 1 ).toInt( &ok, 16 ); if (ok) color.setRgb( hexColor ); } void -KdmItem::setBoxLayout( const QDomNode &node ) +KdmItem::setBoxLayout( const TQDomNode &node ) { if (!boxManager) boxManager = new KdmLayoutBox( node ); @@ -522,7 +522,7 @@ KdmItem::setBoxLayout( const QDomNode &node ) } void -KdmItem::setFixedLayout( const QDomNode &node ) +KdmItem::setFixedLayout( const TQDomNode &node ) { if (!fixedManager) fixedManager = new KdmLayoutFixed( node ); diff --git a/kdm/kfrontend/themer/kdmitem.h b/kdm/kfrontend/themer/kdmitem.h index 66feedd02..9105f8b93 100644 --- a/kdm/kfrontend/themer/kdmitem.h +++ b/kdm/kfrontend/themer/kdmitem.h @@ -22,10 +22,10 @@ #ifndef KDMITEM_H #define KDMITEM_H -#include <qobject.h> -#include <qvaluelist.h> -#include <qrect.h> -#include <qdom.h> +#include <tqobject.h> +#include <tqvaluelist.h> +#include <tqrect.h> +#include <tqdom.h> class KdmItem; class KdmLayoutBox; @@ -80,7 +80,7 @@ class QLayoutItem; * - TODO: send a selective redraw signal also merging children's areas */ -class KdmItem : public QObject { +class KdmItem : public TQObject { Q_OBJECT friend class KdmThemer; @@ -89,7 +89,7 @@ public: /** * Item constructor and destructor */ - KdmItem( KdmItem *parent, const QDomNode &node = QDomNode(), const char *name = 0 ); + KdmItem( KdmItem *parent, const TQDomNode &node = TQDomNode(), const char *name = 0 ); virtual ~KdmItem(); /** @@ -97,14 +97,14 @@ public: * or boxed ones). Note that this will generate repaint signals * when needed. The default implementation should fit all needs. */ - virtual void setGeometry( const QRect &newGeometry, bool force ); + virtual void setGeometry( const TQRect &newGeometry, bool force ); /** * Paint the item and its children using the given painter. * This is the compositing core function. It buffers paint operations * to speed up rendering of dynamic objects. */ - void paint( QPainter *painter, const QRect &boundaries ); + void paint( TQPainter *painter, const TQRect &boundaries ); /** * Update representation of contents and repaint. @@ -124,45 +124,45 @@ public: * @param parentGeometry the geometry of the caller item or a * null rect if the geometry of the parent is not yet defined. */ - virtual QRect placementHint( const QRect &parentGeometry ); + virtual TQRect placementHint( const TQRect &parentGeometry ); /** * Create the box layout manager; next children will be * managed by the box layouter */ - void setBoxLayout( const QDomNode &node = QDomNode() ); + void setBoxLayout( const TQDomNode &node = TQDomNode() ); /** * Create the fixed layout manager; next children will be * in fixed position relative to this item */ - void setFixedLayout( const QDomNode &node = QDomNode() ); + void setFixedLayout( const TQDomNode &node = TQDomNode() ); - QString type() const { return itemType; } - void setType( const QString &t ) { itemType = t; } - void setBaseDir( const QString &bd ) { basedir = bd; } + TQString type() const { return itemType; } + void setType( const TQString &t ) { itemType = t; } + void setBaseDir( const TQString &bd ) { basedir = bd; } - QString baseDir() const + TQString baseDir() const { if (basedir.isEmpty() && parent()) return static_cast<KdmItem *>( parent()->qt_cast( "KdmItem" ) )->baseDir(); return basedir; } - KdmItem *findNode( const QString &id ) const; - virtual void setWidget( QWidget *widget ); - virtual void setLayoutItem( QLayoutItem *item ); + KdmItem *findNode( const TQString &id ) const; + virtual void setWidget( TQWidget *widget ); + virtual void setLayoutItem( TQLayoutItem *item ); virtual void hide( bool force = false ); virtual void show( bool force = false ); bool isHidden() const { return isShown != Shown; } bool isExplicitlyHidden() const { return isShown == ExplicitlyHidden; } - QRect rect() const { return area; } + TQRect rect() const { return area; } signals: void needUpdate( int x, int y, int w, int h ); - void activated( const QString &id ); + void activated( const TQString &id ); protected slots: void widgetGone(); @@ -175,7 +175,7 @@ protected: * @return (-1,-1) if no size can be determined (so it should * default to parent's size). */ - virtual QSize sizeHint(); + virtual TQSize sizeHint(); /** * Low level graphical function to paint the item. @@ -185,7 +185,7 @@ protected: * @param painter the painter to draw the item with * @param region the part of the the image to render */ - virtual void drawContents( QPainter *painter, const QRect ®ion ) = 0; + virtual void drawContents( TQPainter *painter, const TQRect ®ion ) = 0; /** * Called when item changes its 'state' variable. This must @@ -209,7 +209,7 @@ protected: } properties; // This is the placement of the item - QRect area; + TQRect area; // This struct is filled in by KdmItem base class enum DataType { DTnone, DTpixel, DTnpixel, DTpercent, DTbox }; @@ -219,7 +219,7 @@ protected: int y; int width; int height; - QString anchor; + TQString anchor; } pos; /* For internal use ONLY @@ -232,14 +232,14 @@ protected: * Parse type and value of an attribute (pos tag), a font or a * color. */ - void parseAttribute( const QString &, int &, enum DataType & ); - void parseFont( const QString &, QFont & ); - void parseColor( const QString &, QColor & ); + void parseAttribute( const TQString &, int &, enum DataType & ); + void parseFont( const TQString &, TQFont & ); + void parseColor( const TQString &, TQColor & ); void inheritFromButton( KdmItem *button ); - QString itemType, id; - QValueList<KdmItem *> m_children; + TQString itemType, id; + TQValueList<KdmItem *> m_children; // Layouting related variables enum { MNone = 0, MFixed = 1, MBox = 2 } currentManager; @@ -247,13 +247,13 @@ protected: KdmLayoutFixed *fixedManager; // Compositing related variables - QImage *image; + TQImage *image; // defines the directory the theme is in (may be present in the parent) - QString basedir; + TQString basedir; - QWidget *myWidget; - QLayoutItem *myLayoutItem; + TQWidget *myWidget; + TQLayoutItem *myLayoutItem; enum { InitialHidden, ExplicitlyHidden, Shown } isShown; diff --git a/kdm/kfrontend/themer/kdmlabel.cpp b/kdm/kfrontend/themer/kdmlabel.cpp index 41d7e4254..297b7cc48 100644 --- a/kdm/kfrontend/themer/kdmlabel.cpp +++ b/kdm/kfrontend/themer/kdmlabel.cpp @@ -27,10 +27,10 @@ #include <kmacroexpander.h> #include <kdebug.h> -#include <qdatetime.h> -#include <qpainter.h> -#include <qfontmetrics.h> -#include <qtimer.h> +#include <tqdatetime.h> +#include <tqpainter.h> +#include <tqfontmetrics.h> +#include <tqtimer.h> #include <unistd.h> #include <sys/utsname.h> @@ -38,7 +38,7 @@ # include <sys/systeminfo.h> #endif -KdmLabel::KdmLabel( KdmItem *parent, const QDomNode &node, const char *name ) +KdmLabel::KdmLabel( KdmItem *parent, const TQDomNode &node, const char *name ) : KdmItem( parent, node, name ) { itemType = "label"; @@ -49,23 +49,23 @@ KdmLabel::KdmLabel( KdmItem *parent, const QDomNode &node, const char *name ) label.prelight.present = false; label.maximumWidth = -1; - const QString locale = KGlobal::locale()->language(); + const TQString locale = KGlobal::locale()->language(); // Read LABEL ID - QDomNode n = node; - QDomElement elLab = n.toElement(); + TQDomNode n = node; + TQDomElement elLab = n.toElement(); // ID types: clock, pam-error, pam-message, pam-prompt, // pam-warning, timed-label label.id = elLab.attribute( "id", "" ); label.hasId = !(label.id).isEmpty(); // Read LABEL TAGS - QDomNodeList childList = node.childNodes(); + TQDomNodeList childList = node.childNodes(); bool stockUsed = false; for (uint nod = 0; nod < childList.count(); nod++) { - QDomNode child = childList.item( nod ); - QDomElement el = child.toElement(); - QString tagName = el.tagName(); + TQDomNode child = childList.item( nod ); + TQDomElement el = child.toElement(); + TQString tagName = el.tagName(); if (tagName == "pos") label.maximumWidth = el.attribute( "max-width", "-1" ).toInt(); @@ -83,7 +83,7 @@ KdmLabel::KdmLabel( KdmItem *parent, const QDomNode &node, const char *name ) } else if (tagName == "text" && el.attributes().count() == 0 && !stockUsed) { label.text = el.text(); } else if (tagName == "text" && !stockUsed) { - QString lang = el.attribute( "xml:lang", "" ); + TQString lang = el.attribute( "xml:lang", "" ); if (lang == locale) label.text = el.text(); } else if (tagName == "stock") { @@ -95,15 +95,15 @@ KdmLabel::KdmLabel( KdmItem *parent, const QDomNode &node, const char *name ) // Check if this is a timer label label.isTimer = label.text.find( "%c" ) >= 0; if (label.isTimer) { - timer = new QTimer( this ); + timer = new TQTimer( this ); timer->start( 1000 ); - connect( timer, SIGNAL(timeout()), SLOT(update()) ); + connect( timer, TQT_SIGNAL(timeout()), TQT_SLOT(update()) ); } cText = lookupText( label.text ); } void -KdmLabel::setText( const QString &txt ) +KdmLabel::setText( const TQString &txt ) { label.text = txt; update(); @@ -119,7 +119,7 @@ KdmLabel::sizeHint() else if (state == Sprelight && label.prelight.present) l = &label.prelight; // get the hint from font metrics - QSize hint = QFontMetrics( l->font ).size( AlignLeft | SingleLine, cText ); + TQSize hint = TQFontMetrics( l->font ).size( AlignLeft | SingleLine, cText ); // clip the result using the max-width label(pos) parameter if (label.maximumWidth > 0 && hint.width() > label.maximumWidth) hint.setWidth( label.maximumWidth ); @@ -127,7 +127,7 @@ KdmLabel::sizeHint() } void -KdmLabel::drawContents( QPainter *p, const QRect &/*r*/ ) +KdmLabel::drawContents( TQPainter *p, const TQRect &/*r*/ ) { // choose the correct label class struct LabelStruct::LabelClass *l = &label.normal; @@ -157,7 +157,7 @@ KdmLabel::statusChanged() void KdmLabel::update() { - QString text = lookupText( label.text ); + TQString text = lookupText( label.text ); if (text != cText) { cText = text; needUpdate(); @@ -186,10 +186,10 @@ static const struct { }; QString -KdmLabel::lookupStock( const QString &stock ) +KdmLabel::lookupStock( const TQString &stock ) { //FIXME add key accels! - QString type( stock.lower() ); + TQString type( stock.lower() ); for (uint i = 0; i < sizeof(stocks)/sizeof(stocks[0]); i++) if (type == stocks[i].type) @@ -200,30 +200,30 @@ KdmLabel::lookupStock( const QString &stock ) } QString -KdmLabel::lookupText( const QString &t ) +KdmLabel::lookupText( const TQString &t ) { - QString text = t; + TQString text = t; text.replace( '_', '&' ); // text.remove( '_' ); // FIXME add key accels, remove underscores for now - QMap<QChar,QString> m; + TQMap<TQChar,TQString> m; struct utsname uts; uname( &uts ); - m['n'] = QString::fromLocal8Bit( uts.nodename ); + m['n'] = TQString::fromLocal8Bit( uts.nodename ); char buf[256]; buf[sizeof(buf) - 1] = '\0'; - m['h'] = gethostname( buf, sizeof(buf) - 1 ) ? "localhost" : QString::fromLocal8Bit( buf ); + m['h'] = gethostname( buf, sizeof(buf) - 1 ) ? "localhost" : TQString::fromLocal8Bit( buf ); #ifdef HAVE_GETDOMAINNAME - m['o'] = getdomainname( buf, sizeof(buf) - 1 ) ? "localdomain" : QString::fromLocal8Bit( buf ); + m['o'] = getdomainname( buf, sizeof(buf) - 1 ) ? "localdomain" : TQString::fromLocal8Bit( buf ); #elif defined(HAVE_SYSINFO) - m['o'] = (unsigned)sysinfo( SI_SRPC_DOMAIN, buf, sizeof(buf) ) > sizeof(buf) ? "localdomain" : QString::fromLocal8Bit( buf ); + m['o'] = (unsigned)sysinfo( SI_SRPC_DOMAIN, buf, sizeof(buf) ) > sizeof(buf) ? "localdomain" : TQString::fromLocal8Bit( buf ); #endif - m['d'] = QString::number( KThemedGreeter::timedDelay ); + m['d'] = TQString::number( KThemedGreeter::timedDelay ); m['s'] = KThemedGreeter::timedUser; // xgettext:no-c-format KGlobal::locale()->setDateFormat( i18n("date format", "%a %d %B") ); - m['c'] = KGlobal::locale()->formatDateTime( QDateTime::currentDateTime(), false, false ); + m['c'] = KGlobal::locale()->formatDateTime( TQDateTime::currentDateTime(), false, false ); return KMacroExpander::expandMacros( text, m ); } diff --git a/kdm/kfrontend/themer/kdmlabel.h b/kdm/kfrontend/themer/kdmlabel.h index b80d0189a..93801d594 100644 --- a/kdm/kfrontend/themer/kdmlabel.h +++ b/kdm/kfrontend/themer/kdmlabel.h @@ -24,8 +24,8 @@ #include "kdmitem.h" -#include <qcolor.h> -#include <qfont.h> +#include <tqcolor.h> +#include <tqfont.h> class QTimer; @@ -37,45 +37,45 @@ class KdmLabel : public KdmItem { Q_OBJECT public: - KdmLabel( KdmItem *parent, const QDomNode &node, const char *name = 0 ); - void setText( const QString &txt ); + KdmLabel( KdmItem *parent, const TQDomNode &node, const char *name = 0 ); + void setText( const TQString &txt ); protected: // reimplemented; returns the minimum size of rendered text - virtual QSize sizeHint(); + virtual TQSize sizeHint(); // draw the label - virtual void drawContents( QPainter *p, const QRect &r ); + virtual void drawContents( TQPainter *p, const TQRect &r ); // handle switching between normal / active / prelight configurations virtual void statusChanged(); struct LabelStruct { - QString text; + TQString text; bool isTimer; bool hasId; - QString id; + TQString id; struct LabelClass { - QColor color; - QFont font; + TQColor color; + TQFont font; bool present; } normal, active, prelight; int maximumWidth; } label; - QTimer *timer; + TQTimer *timer; public slots: void update(); private: /* Method to lookup the caption associated with an item */ - QString lookupStock( const QString &stock ); + TQString lookupStock( const TQString &stock ); /* Lookup variables in the text */ - QString lookupText( const QString &t ); + TQString lookupText( const TQString &t ); - QString cText; + TQString cText; }; #endif diff --git a/kdm/kfrontend/themer/kdmlayout.cpp b/kdm/kfrontend/themer/kdmlayout.cpp index ed93be264..00ca693ae 100644 --- a/kdm/kfrontend/themer/kdmlayout.cpp +++ b/kdm/kfrontend/themer/kdmlayout.cpp @@ -24,16 +24,16 @@ #include <kdebug.h> -#include <qdom.h> -#include <qrect.h> +#include <tqdom.h> +#include <tqrect.h> -KdmLayoutFixed::KdmLayoutFixed( const QDomNode &/*node*/ ) +KdmLayoutFixed::KdmLayoutFixed( const TQDomNode &/*node*/ ) { //Parsing FIXED parameters on 'node' [NONE!] } void -KdmLayoutFixed::update( const QRect &parentGeometry, bool force ) +KdmLayoutFixed::update( const TQRect &parentGeometry, bool force ) { kdDebug() << "KdmLayoutFixed::update " << parentGeometry << endl; @@ -43,15 +43,15 @@ KdmLayoutFixed::update( const QRect &parentGeometry, bool force ) return; } // For each child in list I ask their hinted size and set it! - for (QValueList<KdmItem *>::ConstIterator it = m_children.begin(); it != m_children.end(); ++it) + for (TQValueList<KdmItem *>::ConstIterator it = m_children.begin(); it != m_children.end(); ++it) (*it)->setGeometry( (*it)->placementHint( parentGeometry ), force ); } -KdmLayoutBox::KdmLayoutBox( const QDomNode &node ) +KdmLayoutBox::KdmLayoutBox( const TQDomNode &node ) { //Parsing BOX parameters - QDomNode n = node; - QDomElement el = n.toElement(); + TQDomNode n = node; + TQDomElement el = n.toElement(); box.isVertical = el.attribute( "orientation", "vertical" ) != "horizontal"; box.xpadding = el.attribute( "xpadding", "0" ).toInt(); box.ypadding = el.attribute( "ypadding", "0" ).toInt(); @@ -62,7 +62,7 @@ KdmLayoutBox::KdmLayoutBox( const QDomNode &node ) } void -KdmLayoutBox::update( const QRect &parentGeometry, bool force ) +KdmLayoutBox::update( const TQRect &parentGeometry, bool force ) { kdDebug() << this << " update " << parentGeometry << endl; @@ -78,7 +78,7 @@ KdmLayoutBox::update( const QRect &parentGeometry, bool force ) // kdDebug() << this << " hintedSize " << hintedSize << endl; //XXX why was this asymmetric? it broke things big time. - QRect childrenRect = /*box.isVertical ? QRect( parentGeometry.topLeft(), hintedSize ) :*/ parentGeometry; + TQRect childrenRect = /*box.isVertical ? TQRect( parentGeometry.topLeft(), hintedSize ) :*/ parentGeometry; // Begin cutting the parent rectangle to attach children on the right place childrenRect.addCoords( box.xpadding, box.ypadding, -box.xpadding, -box.ypadding ); @@ -87,21 +87,21 @@ KdmLayoutBox::update( const QRect &parentGeometry, bool force ) // For each child in list ... if (box.homogeneous) { int ccnt = 0; - for (QValueList<KdmItem *>::ConstIterator it = m_children.begin(); it != m_children.end(); ++it) + for (TQValueList<KdmItem *>::ConstIterator it = m_children.begin(); it != m_children.end(); ++it) if (!(*it)->isExplicitlyHidden()) ccnt++; int height = (childrenRect.height() - (ccnt - 1) * box.spacing) / ccnt; int width = (childrenRect.width() - (ccnt - 1) * box.spacing) / ccnt; - for (QValueList<KdmItem *>::ConstIterator it = m_children.begin(); it != m_children.end(); ++it) { + for (TQValueList<KdmItem *>::ConstIterator it = m_children.begin(); it != m_children.end(); ++it) { if ((*it)->isExplicitlyHidden()) continue; if (box.isVertical) { - QRect temp( childrenRect.left(), childrenRect.top(), childrenRect.width(), height ); + TQRect temp( childrenRect.left(), childrenRect.top(), childrenRect.width(), height ); (*it)->setGeometry( temp, force ); childrenRect.setTop( childrenRect.top() + height + box.spacing ); } else { - QRect temp( childrenRect.left(), childrenRect.top(), width, childrenRect.height() ); + TQRect temp( childrenRect.left(), childrenRect.top(), width, childrenRect.height() ); kdDebug() << "placement " << *it << " " << temp << " " << (*it)->placementHint( temp ) << endl; temp = (*it)->placementHint( temp ); (*it)->setGeometry( temp, force ); @@ -109,11 +109,11 @@ KdmLayoutBox::update( const QRect &parentGeometry, bool force ) } } } else { - for (QValueList<KdmItem *>::ConstIterator it = m_children.begin(); it != m_children.end(); ++it) { + for (TQValueList<KdmItem *>::ConstIterator it = m_children.begin(); it != m_children.end(); ++it) { if ((*it)->isExplicitlyHidden()) continue; - QRect temp = childrenRect, itemRect; + TQRect temp = childrenRect, itemRect; if (box.isVertical) { temp.setHeight( 0 ); itemRect = (*it)->placementHint( temp ); @@ -140,8 +140,8 @@ KdmLayoutBox::sizeHint() { // Sum up area taken by children int w = 0, h = 0; - for (QValueList<KdmItem *>::ConstIterator it = m_children.begin(); it != m_children.end(); ++it) { - QSize s = (*it)->placementHint( QRect() ).size(); + for (TQValueList<KdmItem *>::ConstIterator it = m_children.begin(); it != m_children.end(); ++it) { + TQSize s = (*it)->placementHint( TQRect() ).size(); if (box.isVertical) { if (s.width() > w) w = s.width(); @@ -162,6 +162,6 @@ KdmLayoutBox::sizeHint() w += box.spacing * (m_children.count() - 1); // Make hint at least equal to minimum size (if set) - return QSize( w < box.minwidth ? box.minwidth : w, + return TQSize( w < box.minwidth ? box.minwidth : w, h < box.minheight ? box.minheight : h ); } diff --git a/kdm/kfrontend/themer/kdmlayout.h b/kdm/kfrontend/themer/kdmlayout.h index 2e00675fb..491b20393 100644 --- a/kdm/kfrontend/themer/kdmlayout.h +++ b/kdm/kfrontend/themer/kdmlayout.h @@ -27,8 +27,8 @@ * but can be treated like a usual widget */ -#include <qvaluelist.h> -#include <qsize.h> +#include <tqvaluelist.h> +#include <tqsize.h> class KdmItem; @@ -48,20 +48,20 @@ public: // Updates the layout of all items knowing that the parent // has the @p parentGeometry geometry -// virtual void update( const QRect &parentGeometry ) = 0; +// virtual void update( const TQRect &parentGeometry ) = 0; protected: - QValueList<KdmItem *> m_children; + TQValueList<KdmItem *> m_children; }; class KdmLayoutFixed : public KdmLayout { public: - KdmLayoutFixed( const QDomNode &node ); + KdmLayoutFixed( const TQDomNode &node ); // Updates the layout of all boxed items knowing that the parent // has the @p parentGeometry geometry - void update( const QRect &parentGeometry, bool force ); + void update( const TQRect &parentGeometry, bool force ); }; /** @@ -72,15 +72,15 @@ public: class KdmLayoutBox : public KdmLayout { public: - KdmLayoutBox( const QDomNode &node ); + KdmLayoutBox( const TQDomNode &node ); // Updates the layout of all boxed items knowing that they // should fit into @p parentGeometry container - void update( const QRect &parentGeometry, bool force ); + void update( const TQRect &parentGeometry, bool force ); // Computes the size hint of the box, telling which is the // smallest size inside which boxed items will fit - QSize sizeHint(); + TQSize sizeHint(); private: struct { @@ -92,7 +92,7 @@ private: int minheight; bool homogeneous; } box; -// QSize hintedSize; +// TQSize hintedSize; }; #endif diff --git a/kdm/kfrontend/themer/kdmpixmap.cpp b/kdm/kfrontend/themer/kdmpixmap.cpp index 337c19ced..07077e4a1 100644 --- a/kdm/kfrontend/themer/kdmpixmap.cpp +++ b/kdm/kfrontend/themer/kdmpixmap.cpp @@ -30,11 +30,11 @@ #include <kdebug.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qimage.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqimage.h> -KdmPixmap::KdmPixmap( KdmItem *parent, const QDomNode &node, const char *name ) +KdmPixmap::KdmPixmap( KdmItem *parent, const TQDomNode &node, const char *name ) : KdmItem( parent, node, name ) { itemType = "pixmap"; @@ -47,15 +47,15 @@ KdmPixmap::KdmPixmap( KdmItem *parent, const QDomNode &node, const char *name ) // Read PIXMAP ID // it rarely happens that a pixmap can be a button too! - QDomNode n = node; - QDomElement elPix = n.toElement(); + TQDomNode n = node; + TQDomElement elPix = n.toElement(); // Read PIXMAP TAGS - QDomNodeList childList = node.childNodes(); + TQDomNodeList childList = node.childNodes(); for (uint nod = 0; nod < childList.count(); nod++) { - QDomNode child = childList.item( nod ); - QDomElement el = child.toElement(); - QString tagName = el.tagName(); + TQDomNode child = childList.item( nod ); + TQDomElement el = child.toElement(); + TQString tagName = el.tagName(); if (tagName == "normal") { loadPixmap( el.attribute( "file", "" ), pixmap.normal.pixmap, pixmap.normal.fullpath ); @@ -91,7 +91,7 @@ KdmPixmap::sizeHint() } void -KdmPixmap::setGeometry( const QRect &newGeometry, bool force ) +KdmPixmap::setGeometry( const TQRect &newGeometry, bool force ) { KdmItem::setGeometry( newGeometry, force ); pixmap.active.readyPixmap.resize( 0, 0 ); @@ -101,7 +101,7 @@ KdmPixmap::setGeometry( const QRect &newGeometry, bool force ) void -KdmPixmap::loadPixmap( const QString &fileName, QPixmap &map, QString &fullName ) +KdmPixmap::loadPixmap( const TQString &fileName, TQPixmap &map, TQString &fullName ) { if (fileName.isEmpty()) return; @@ -112,24 +112,24 @@ KdmPixmap::loadPixmap( const QString &fileName, QPixmap &map, QString &fullName if (!fullName.endsWith( ".svg" )) // we delay it for svgs if (!map.load( fullName )) - fullName = QString::null; + fullName = TQString::null; } void -KdmPixmap::renderSvg( PixmapStruct::PixmapClass *pClass, const QRect &area ) +KdmPixmap::renderSvg( PixmapStruct::PixmapClass *pClass, const TQRect &area ) { #ifdef HAVE_LIBART // Special stuff for SVG icons KSVGIconEngine *svgEngine = new KSVGIconEngine(); if (svgEngine->load( area.width(), area.height(), pClass->fullpath )) { - QImage *t = svgEngine->image(); + TQImage *t = svgEngine->image(); pClass->pixmap = *t; pClass->readyPixmap.resize( 0, 0 ); delete t; } else { kdWarning() << "failed to load " << pClass->fullpath << endl; - pClass->fullpath = QString::null; + pClass->fullpath = TQString::null; } delete svgEngine; @@ -140,7 +140,7 @@ KdmPixmap::renderSvg( PixmapStruct::PixmapClass *pClass, const QRect &area ) } void -KdmPixmap::drawContents( QPainter *p, const QRect &r ) +KdmPixmap::drawContents( TQPainter *p, const TQRect &r ) { // choose the correct pixmap class PixmapStruct::PixmapClass *pClass = &pixmap.normal; @@ -176,7 +176,7 @@ KdmPixmap::drawContents( QPainter *p, const QRect &r ) if (pClass->readyPixmap.isNull()) { - QImage scaledImage; + TQImage scaledImage; // use the loaded pixmap or a scaled version if needed @@ -187,7 +187,7 @@ KdmPixmap::drawContents( QPainter *p, const QRect &r ) scaledImage = pClass->pixmap.convertToImage(); } else { kdDebug() << "convertFromImage\n"; - QImage tempImage = pClass->pixmap.convertToImage(); + TQImage tempImage = pClass->pixmap.convertToImage(); scaledImage = tempImage.smoothScale( area.width(), area.height() ); } } else diff --git a/kdm/kfrontend/themer/kdmpixmap.h b/kdm/kfrontend/themer/kdmpixmap.h index eb621a0a5..479ef0f8d 100644 --- a/kdm/kfrontend/themer/kdmpixmap.h +++ b/kdm/kfrontend/themer/kdmpixmap.h @@ -24,8 +24,8 @@ #include "kdmitem.h" -//#include <qrect.h> -#include <qpixmap.h> +//#include <tqrect.h> +#include <tqpixmap.h> /* * KdmPixmap. A pixmap element @@ -35,26 +35,26 @@ class KdmPixmap : public KdmItem { Q_OBJECT public: - KdmPixmap( KdmItem *parent, const QDomNode &node, const char *name = 0 ); + KdmPixmap( KdmItem *parent, const TQDomNode &node, const char *name = 0 ); protected: // reimplemented; returns the size of loaded pixmap - virtual QSize sizeHint(); + virtual TQSize sizeHint(); // draw the pixmap - virtual void drawContents( QPainter *p, const QRect &r ); + virtual void drawContents( TQPainter *p, const TQRect &r ); // handle switching between normal / active / prelight configurations virtual void statusChanged(); - virtual void setGeometry( const QRect &newGeometry, bool force ); + virtual void setGeometry( const TQRect &newGeometry, bool force ); struct PixmapStruct { struct PixmapClass { - QString fullpath; - QPixmap pixmap; - QPixmap readyPixmap; - QColor tint; + TQString fullpath; + TQPixmap pixmap; + TQPixmap readyPixmap; + TQColor tint; float alpha; //TODO added: not in greeter.dtd bool present; } normal, active, prelight; @@ -62,8 +62,8 @@ protected: private: // Method to load the pixmap given by the theme - void loadPixmap( const QString &fileName, QPixmap &p, QString &path ); - void renderSvg( PixmapStruct::PixmapClass *pClass, const QRect &area ); + void loadPixmap( const TQString &fileName, TQPixmap &p, TQString &path ); + void renderSvg( PixmapStruct::PixmapClass *pClass, const TQRect &area ); }; #endif diff --git a/kdm/kfrontend/themer/kdmrect.cpp b/kdm/kfrontend/themer/kdmrect.cpp index 478c5c8b3..961809a37 100644 --- a/kdm/kfrontend/themer/kdmrect.cpp +++ b/kdm/kfrontend/themer/kdmrect.cpp @@ -25,12 +25,12 @@ #include <kimageeffect.h> #include <kdebug.h> -#include <qimage.h> -#include <qpainter.h> -#include <qwidget.h> -#include <qlayout.h> +#include <tqimage.h> +#include <tqpainter.h> +#include <tqwidget.h> +#include <tqlayout.h> -KdmRect::KdmRect( KdmItem *parent, const QDomNode &node, const char *name ) +KdmRect::KdmRect( KdmItem *parent, const TQDomNode &node, const char *name ) : KdmItem( parent, node, name ) { itemType = "rect"; @@ -46,28 +46,28 @@ KdmRect::KdmRect( KdmItem *parent, const QDomNode &node, const char *name ) return; // Read RECT ID - QDomNode n = node; - QDomElement elRect = n.toElement(); + TQDomNode n = node; + TQDomElement elRect = n.toElement(); // Read RECT TAGS - QDomNodeList childList = node.childNodes(); + TQDomNodeList childList = node.childNodes(); for (uint nod = 0; nod < childList.count(); nod++) { - QDomNode child = childList.item( nod ); - QDomElement el = child.toElement(); - QString tagName = el.tagName(); + TQDomNode child = childList.item( nod ); + TQDomElement el = child.toElement(); + TQString tagName = el.tagName(); if (tagName == "normal") { - parseColor( el.attribute( "color", QString::null ), rect.normal.color ); + parseColor( el.attribute( "color", TQString::null ), rect.normal.color ); rect.normal.alpha = el.attribute( "alpha", "1.0" ).toFloat(); parseFont( el.attribute( "font", "Sans 14" ), rect.normal.font ); } else if (tagName == "active") { rect.active.present = true; - parseColor( el.attribute( "color", QString::null ), rect.active.color ); + parseColor( el.attribute( "color", TQString::null ), rect.active.color ); rect.active.alpha = el.attribute( "alpha", "1.0" ).toFloat(); parseFont( el.attribute( "font", "Sans 14" ), rect.active.font ); } else if (tagName == "prelight") { rect.prelight.present = true; - parseColor( el.attribute( "color", QString::null ), rect.prelight.color ); + parseColor( el.attribute( "color", TQString::null ), rect.prelight.color ); rect.prelight.alpha = el.attribute( "alpha", "1.0" ).toFloat(); parseFont( el.attribute( "font", "Sans 14" ), rect.prelight.font ); } else if (tagName == "border") @@ -76,7 +76,7 @@ KdmRect::KdmRect( KdmItem *parent, const QDomNode &node, const char *name ) } void -KdmRect::drawContents( QPainter *p, const QRect &r ) +KdmRect::drawContents( TQPainter *p, const TQRect &r ) { // choose the correct rect class RectStruct::RectClass *rClass = &rect.normal; @@ -89,13 +89,13 @@ KdmRect::drawContents( QPainter *p, const QRect &r ) return; if (rClass->alpha == 1) - p->fillRect( area, QBrush( rClass->color ) ); + p->fillRect( area, TQBrush( rClass->color ) ); else { - QRect backRect = r; + TQRect backRect = r; backRect.moveBy( area.x(), area.y() ); - QPixmap backPixmap( backRect.size() ); - bitBlt( &backPixmap, QPoint( 0, 0 ), p->device(), backRect ); - QImage backImage = backPixmap.convertToImage(); + TQPixmap backPixmap( backRect.size() ); + bitBlt( &backPixmap, TQPoint( 0, 0 ), p->device(), backRect ); + TQImage backImage = backPixmap.convertToImage(); KImageEffect::blend( rClass->color, backImage, rClass->alpha ); p->drawImage( backRect.x(), backRect.y(), backImage ); // area.moveBy(1,1); @@ -116,35 +116,35 @@ KdmRect::statusChanged() /* void -KdmRect::setAttribs( QWidget *widget ) +KdmRect::setAttribs( TQWidget *widget ) { widget->setFont( rect.normal.font ); } void -KdmRect::recursiveSetAttribs( QLayoutItem *li ) +KdmRect::recursiveSetAttribs( TQLayoutItem *li ) { - QWidget *w; - QLayout *l; + TQWidget *w; + TQLayout *l; if ((w = li->widget())) setAttribs( w ); else if ((l = li->layout())) { - QLayoutIterator it = l->iterator(); - for (QLayoutItem *itm = it.current(); itm; itm = ++it) + TQLayoutIterator it = l->iterator(); + for (TQLayoutItem *itm = it.current(); itm; itm = ++it) recursiveSetAttribs( itm ); } } void -KdmRect::setWidget( QWidget *widget ) +KdmRect::setWidget( TQWidget *widget ) { KdmItem::setWidget( widget ); setAttribs( widget ); } void -KdmRect::setLayoutItem( QLayoutItem *item ) +KdmRect::setLayoutItem( TQLayoutItem *item ) { KdmItem::setLayoutItem( item ); recursiveSetAttribs( item ); diff --git a/kdm/kfrontend/themer/kdmrect.h b/kdm/kfrontend/themer/kdmrect.h index 2e89a6a52..7e4776233 100644 --- a/kdm/kfrontend/themer/kdmrect.h +++ b/kdm/kfrontend/themer/kdmrect.h @@ -24,8 +24,8 @@ #include "kdmitem.h" -#include <qcolor.h> -#include <qfont.h> +#include <tqcolor.h> +#include <tqfont.h> /* * KdmRect: A themed rectangular element @@ -35,11 +35,11 @@ class KdmRect : public KdmItem { Q_OBJECT public: - KdmRect( KdmItem *parent, const QDomNode &node, const char *name = 0 ); + KdmRect( KdmItem *parent, const TQDomNode &node, const char *name = 0 ); protected: // draw the rect - virtual void drawContents( QPainter *p, const QRect &r ); + virtual void drawContents( TQPainter *p, const TQRect &r ); // handle switching between normal / active / prelight configurations virtual void statusChanged(); @@ -47,19 +47,19 @@ protected: struct RectStruct { struct RectClass { float alpha; - QColor color; + TQColor color; bool present; - QFont font; + TQFont font; } normal, active, prelight; bool hasBorder; } rect; -// virtual void setWidget( QWidget *widget ); -// virtual void setLayoutItem( QLayoutItem *item ); +// virtual void setWidget( TQWidget *widget ); +// virtual void setLayoutItem( TQLayoutItem *item ); private: - void setAttribs( QWidget *widget ); - void recursiveSetAttribs( QLayoutItem *item ); + void setAttribs( TQWidget *widget ); + void recursiveSetAttribs( TQLayoutItem *item ); }; #endif diff --git a/kdm/kfrontend/themer/kdmthemer.cpp b/kdm/kfrontend/themer/kdmthemer.cpp index 65eebabf4..aca43e45d 100644 --- a/kdm/kfrontend/themer/kdmthemer.cpp +++ b/kdm/kfrontend/themer/kdmthemer.cpp @@ -34,21 +34,21 @@ #include <ksimpleconfig.h> #include <kdebug.h> -#include <qfile.h> -#include <qfileinfo.h> -//#include <qtimer.h> // animation timer - TODO -#include <qobjectlist.h> -#include <qpainter.h> -#include <qwidget.h> -#include <qregion.h> +#include <tqfile.h> +#include <tqfileinfo.h> +//#include <tqtimer.h> // animation timer - TODO +#include <tqobjectlist.h> +#include <tqpainter.h> +#include <tqwidget.h> +#include <tqregion.h> #include <unistd.h> /* * KdmThemer. The main theming interface */ -KdmThemer::KdmThemer( const QString &_filename, const QString &mode, QWidget *parent ) - : QObject( parent ) +KdmThemer::KdmThemer( const TQString &_filename, const TQString &mode, TQWidget *parent ) + : TQObject( parent ) , rootItem( 0 ) , backBuffer( 0 ) { @@ -56,13 +56,13 @@ KdmThemer::KdmThemer( const QString &_filename, const QString &mode, QWidget *pa m_currentMode = mode; // read the XML file and create DOM tree - QString filename = _filename; - if (!::access( QFile::encodeName( filename + "/GdmGreeterTheme.desktop" ), R_OK )) { + TQString filename = _filename; + if (!::access( TQFile::encodeName( filename + "/GdmGreeterTheme.desktop" ), R_OK )) { KSimpleConfig cfg( filename + "/GdmGreeterTheme.desktop" ); cfg.setGroup( "GdmGreeterTheme" ); filename += '/' + cfg.readEntry( "Greeter" ); } - QFile opmlFile( filename ); + TQFile opmlFile( filename ); if (!opmlFile.open( IO_ReadOnly )) { FDialog::box( widget(), errorbox, i18n( "Cannot open theme file %1" ).arg(filename) ); return; @@ -72,22 +72,22 @@ KdmThemer::KdmThemer( const QString &_filename, const QString &mode, QWidget *pa return; } // Set the root (screen) item - rootItem = new KdmRect( 0, QDomNode(), "kdm root" ); - connect( rootItem, SIGNAL(needUpdate( int, int, int, int )), - widget(), SLOT(update( int, int, int, int )) ); + rootItem = new KdmRect( 0, TQDomNode(), "kdm root" ); + connect( rootItem, TQT_SIGNAL(needUpdate( int, int, int, int )), + widget(), TQT_SLOT(update( int, int, int, int )) ); - rootItem->setBaseDir( QFileInfo( filename ).dirPath( true ) ); + rootItem->setBaseDir( TQFileInfo( filename ).dirPath( true ) ); // generate all the items defined in the theme generateItems( rootItem ); - connect( rootItem, SIGNAL(activated( const QString & )), SIGNAL(activated( const QString & )) ); + connect( rootItem, TQT_SIGNAL(activated( const TQString & )), TQT_SIGNAL(activated( const TQString & )) ); /* *TODO* // Animation timer - QTimer *time = new QTimer( this ); + TQTimer *time = new TQTimer( this ); time->start( 500 ); - connect( time, SIGNAL(timeout()), SLOT(update()) ) + connect( time, TQT_SIGNAL(timeout()), TQT_SLOT(update()) ) */ } @@ -97,14 +97,14 @@ KdmThemer::~KdmThemer() delete backBuffer; } -inline QWidget * +inline TQWidget * KdmThemer::widget() { - return static_cast<QWidget *>(parent()); + return static_cast<TQWidget *>(parent()); } KdmItem * -KdmThemer::findNode( const QString &item ) const +KdmThemer::findNode( const TQString &item ) const { return rootItem->findNode( item ); } @@ -112,53 +112,53 @@ KdmThemer::findNode( const QString &item ) const void KdmThemer::updateGeometry( bool force ) { - rootItem->setGeometry( QRect( QPoint(), widget()->size() ), force ); + rootItem->setGeometry( TQRect( TQPoint(), widget()->size() ), force ); } // BEGIN other functions void -KdmThemer::widgetEvent( QEvent *e ) +KdmThemer::widgetEvent( TQEvent *e ) { if (!rootItem) return; switch (e->type()) { - case QEvent::MouseMove: + case TQEvent::MouseMove: { - QMouseEvent *me = static_cast<QMouseEvent *>(e); + TQMouseEvent *me = static_cast<TQMouseEvent *>(e); rootItem->mouseEvent( me->x(), me->y() ); } break; - case QEvent::MouseButtonPress: + case TQEvent::MouseButtonPress: { - QMouseEvent *me = static_cast<QMouseEvent *>(e); + TQMouseEvent *me = static_cast<TQMouseEvent *>(e); rootItem->mouseEvent( me->x(), me->y(), true ); } break; - case QEvent::MouseButtonRelease: + case TQEvent::MouseButtonRelease: { - QMouseEvent *me = static_cast<QMouseEvent *>(e); + TQMouseEvent *me = static_cast<TQMouseEvent *>(e); rootItem->mouseEvent( me->x(), me->y(), false, true ); } break; - case QEvent::Show: + case TQEvent::Show: rootItem->show(); break; - case QEvent::Resize: + case TQEvent::Resize: updateGeometry( false ); showStructure( rootItem ); break; - case QEvent::Paint: + case TQEvent::Paint: { - QRect paintRect = static_cast<QPaintEvent *>(e)->rect(); + TQRect paintRect = static_cast<TQPaintEvent *>(e)->rect(); kdDebug() << "paint on: " << paintRect << endl; if (!backBuffer) - backBuffer = new QPixmap( widget()->size() ); + backBuffer = new TQPixmap( widget()->size() ); if (backBuffer->size() != widget()->size()) backBuffer->resize( widget()->size() ); - QPainter p; + TQPainter p; p.begin( backBuffer ); rootItem->paint( &p, paintRect ); p.end(); @@ -173,25 +173,25 @@ KdmThemer::widgetEvent( QEvent *e ) /* void -KdmThemer::pixmap( const QRect &r, QPixmap *px ) +KdmThemer::pixmap( const TQRect &r, TQPixmap *px ) { - bitBlt( px, QPoint( 0, 0 ), widget(), r ); + bitBlt( px, TQPoint( 0, 0 ), widget(), r ); } */ void -KdmThemer::generateItems( KdmItem *parent, const QDomNode &node ) +KdmThemer::generateItems( KdmItem *parent, const TQDomNode &node ) { if (!parent) return; - QDomNodeList subnodeList; //List of subnodes of this node + TQDomNodeList subnodeList; //List of subnodes of this node /* * Get the child nodes */ if (node.isNull()) { // It's the first node, get its child nodes - QDomElement theme = domTree.documentElement(); + TQDomElement theme = domTree.documentElement(); // Get its tag, and check it's correct ("greeter") if (theme.tagName() != "greeter") { @@ -207,15 +207,15 @@ KdmThemer::generateItems( KdmItem *parent, const QDomNode &node ) * Go through each of the child nodes */ for (uint nod = 0; nod < subnodeList.count(); nod++) { - QDomNode subnode = subnodeList.item( nod ); - QDomElement el = subnode.toElement(); - QString tagName = el.tagName(); + TQDomNode subnode = subnodeList.item( nod ); + TQDomElement el = subnode.toElement(); + TQString tagName = el.tagName(); if (tagName == "item") { if (!willDisplay( subnode )) continue; // It's a new item. Draw it - QString type = el.attribute( "type" ); + TQString type = el.attribute( "type" ); KdmItem *newItem = 0; @@ -255,26 +255,26 @@ KdmThemer::generateItems( KdmItem *parent, const QDomNode &node ) } } -bool KdmThemer::willDisplay( const QDomNode &node ) +bool KdmThemer::willDisplay( const TQDomNode &node ) { - QDomNode showNode = node.namedItem( "show" ); + TQDomNode showNode = node.namedItem( "show" ); // No "show" node means this item can be displayed at all times if (showNode.isNull()) return true; - QDomElement el = showNode.toElement(); + TQDomElement el = showNode.toElement(); - QString modes = el.attribute( "modes" ); + TQString modes = el.attribute( "modes" ); if (!modes.isNull()) { - QStringList modeList = QStringList::split( ",", modes ); + TQStringList modeList = TQStringList::split( ",", modes ); // If current mode isn't in this list, do not display item if (modeList.find( m_currentMode ) == modeList.end()) return false; } - QString type = el.attribute( "type" ); + TQString type = el.attribute( "type" ); if (type == "config" || type == "suspend") return false; // not implemented (yet) if (type == "timed") @@ -295,21 +295,21 @@ bool KdmThemer::willDisplay( const QDomNode &node ) } void -KdmThemer::showStructure( QObject *obj ) +KdmThemer::showStructure( TQObject *obj ) { - const QObjectList *wlist = obj->children(); + const TQObjectList *wlist = obj->children(); static int counter = 0; if (counter == 0) kdDebug() << "\n\n<======= Widget tree =================" << endl; if (wlist) { counter++; - QObjectListIterator it( *wlist ); - QObject *object; + TQObjectListIterator it( *wlist ); + TQObject *object; while ((object = it.current()) != 0) { ++it; - QString node; + TQString node; for (int i = 1; i < counter; i++) node += "-"; diff --git a/kdm/kfrontend/themer/kdmthemer.h b/kdm/kfrontend/themer/kdmthemer.h index 34baffbb7..cd93c3c8c 100644 --- a/kdm/kfrontend/themer/kdmthemer.h +++ b/kdm/kfrontend/themer/kdmthemer.h @@ -22,8 +22,8 @@ #ifndef KDMTHEMER_H #define KDMTHEMER_H -#include <qobject.h> -#include <qdom.h> +#include <tqobject.h> +#include <tqdom.h> class KdmThemer; class KdmItem; @@ -47,7 +47,7 @@ class QEvent; */ -class KdmThemer : public QObject { +class KdmThemer : public TQObject { Q_OBJECT public: @@ -55,41 +55,41 @@ public: * Construct and destruct the interface */ - KdmThemer( const QString &path, const QString &mode, QWidget *parent ); + KdmThemer( const TQString &path, const TQString &mode, TQWidget *parent ); ~KdmThemer(); bool isOK() { return rootItem != 0; } /* * Gives a sizeHint to the widget (parent size) */ - //QSize sizeHint() const{ return parentWidget()->size(); } + //TQSize sizeHint() const{ return parentWidget()->size(); } /* * Takes a shot of the current widget */ -// void pixmap( const QRect &r, QPixmap *px ); +// void pixmap( const TQRect &r, TQPixmap *px ); virtual // just to put the reference in the vmt - KdmItem *findNode( const QString & ) const; + KdmItem *findNode( const TQString & ) const; void updateGeometry( bool force ); // force = true for external calls // must be called by parent widget - void widgetEvent( QEvent *e ); + void widgetEvent( TQEvent *e ); signals: - void activated( const QString &id ); + void activated( const TQString &id ); private: /* * Our display mode (e.g. console, remote, ...) */ - QString m_currentMode; + TQString m_currentMode; /* * The config file being used */ - QDomDocument domTree; + TQDomDocument domTree; /* * Stores the root of the theme @@ -99,24 +99,24 @@ private: /* * The backbuffer */ - QPixmap *backBuffer; + TQPixmap *backBuffer; // methods /* * Test whether item needs to be displayed */ - bool willDisplay( const QDomNode &node ); + bool willDisplay( const TQDomNode &node ); /* * Parses the XML file looking for the * item list and adds those to the themer */ - void generateItems( KdmItem *parent = 0, const QDomNode &node = QDomNode() ); + void generateItems( KdmItem *parent = 0, const TQDomNode &node = TQDomNode() ); - void showStructure( QObject *obj ); + void showStructure( TQObject *obj ); - QWidget *widget(); + TQWidget *widget(); }; |