From c663b6440964f6ac48027143ac9e63298991f9d0 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:33:34 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1157639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kdm/kfrontend/kchooser.cpp | 78 +++++++++++++++++++++++----------------------- 1 file changed, 39 insertions(+), 39 deletions(-) (limited to 'kdm/kfrontend/kchooser.cpp') 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 -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include // 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(""); } -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 ); -- cgit v1.2.1