summaryrefslogtreecommitdiffstats
path: root/kabc/ldapconfigwidget.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:46:43 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:46:43 +0000
commitffe8a83e053396df448e9413828527613ca3bd46 (patch)
treea73d4169e02df4a50f9a12cb165fcd0ab5bac7c6 /kabc/ldapconfigwidget.cpp
parent682bf3bfdcbcbb1fca85e8a36ed03e062e0555d5 (diff)
downloadtdelibs-ffe8a83e053396df448e9413828527613ca3bd46.tar.gz
tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1157647 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kabc/ldapconfigwidget.cpp')
-rw-r--r--kabc/ldapconfigwidget.cpp198
1 files changed, 99 insertions, 99 deletions
diff --git a/kabc/ldapconfigwidget.cpp b/kabc/ldapconfigwidget.cpp
index b144b2db5..a4b7fc571 100644
--- a/kabc/ldapconfigwidget.cpp
+++ b/kabc/ldapconfigwidget.cpp
@@ -17,17 +17,17 @@
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
-#include <qapplication.h>
-
-#include <qobjectlist.h>
-#include <qcheckbox.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qpushbutton.h>
-#include <qspinbox.h>
-#include <qvgroupbox.h>
-#include <qhbuttongroup.h>
-#include <qradiobutton.h>
+#include <tqapplication.h>
+
+#include <tqobjectlist.h>
+#include <tqcheckbox.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqpushbutton.h>
+#include <tqspinbox.h>
+#include <tqvgroupbox.h>
+#include <tqhbuttongroup.h>
+#include <tqradiobutton.h>
#include <kmessagebox.h>
#include <kaccelmanager.h>
@@ -44,21 +44,21 @@
using namespace KABC;
-LdapConfigWidget::LdapConfigWidget( QWidget* parent,
- const char* name, WFlags fl ) : QWidget( parent, name, fl )
+LdapConfigWidget::LdapConfigWidget( TQWidget* parent,
+ const char* name, WFlags fl ) : TQWidget( parent, name, fl )
{
mProg = 0;
mFlags = 0;
- mainLayout = new QGridLayout( this, 12, 4, 0,
+ mainLayout = new TQGridLayout( this, 12, 4, 0,
KDialog::spacingHint() );
}
-LdapConfigWidget::LdapConfigWidget( int flags, QWidget* parent,
- const char* name, WFlags fl ) : QWidget( parent, name, fl )
+LdapConfigWidget::LdapConfigWidget( int flags, TQWidget* parent,
+ const char* name, WFlags fl ) : TQWidget( parent, name, fl )
{
mFlags = flags;
mProg = 0;
- mainLayout = new QGridLayout( this, 12, 4, 0,
+ mainLayout = new TQGridLayout( this, 12, 4, 0,
KDialog::spacingHint() );
initWidget();
}
@@ -69,7 +69,7 @@ LdapConfigWidget::~LdapConfigWidget()
void LdapConfigWidget::initWidget()
{
- QLabel *label;
+ TQLabel *label;
mUser = mPassword = mHost = mDn = mBindDN = mRealm = mFilter = 0;
mPort = mVer = mTimeLimit = mSizeLimit = 0;
@@ -80,7 +80,7 @@ void LdapConfigWidget::initWidget()
int col;
if ( mFlags & W_USER ) {
- label = new QLabel( i18n( "User:" ), this );
+ label = new TQLabel( i18n( "User:" ), this );
mUser = new KLineEdit( this, "kcfg_ldapuser" );
mainLayout->addWidget( label, row, 0 );
@@ -89,7 +89,7 @@ void LdapConfigWidget::initWidget()
}
if ( mFlags & W_BINDDN ) {
- label = new QLabel( i18n( "Bind DN:" ), this );
+ label = new TQLabel( i18n( "Bind DN:" ), this );
mBindDN = new KLineEdit( this, "kcfg_ldapbinddn" );
mainLayout->addWidget( label, row, 0 );
@@ -98,7 +98,7 @@ void LdapConfigWidget::initWidget()
}
if ( mFlags & W_REALM ) {
- label = new QLabel( i18n( "Realm:" ), this );
+ label = new TQLabel( i18n( "Realm:" ), this );
mRealm = new KLineEdit( this, "kcfg_ldaprealm" );
mainLayout->addWidget( label, row, 0 );
@@ -107,7 +107,7 @@ void LdapConfigWidget::initWidget()
}
if ( mFlags & W_PASS ) {
- label = new QLabel( i18n( "Password:" ), this );
+ label = new TQLabel( i18n( "Password:" ), this );
mPassword = new KLineEdit( this, "kcfg_ldappassword" );
mPassword->setEchoMode( KLineEdit::Password );
@@ -117,7 +117,7 @@ void LdapConfigWidget::initWidget()
}
if ( mFlags & W_HOST ) {
- label = new QLabel( i18n( "Host:" ), this );
+ label = new TQLabel( i18n( "Host:" ), this );
mHost = new KLineEdit( this, "kcfg_ldaphost" );
mainLayout->addWidget( label, row, 0 );
@@ -127,9 +127,9 @@ void LdapConfigWidget::initWidget()
col = 0;
if ( mFlags & W_PORT ) {
- label = new QLabel( i18n( "Port:" ), this );
- mPort = new QSpinBox( 0, 65535, 1, this, "kcfg_ldapport" );
- mPort->setSizePolicy( QSizePolicy( QSizePolicy::Maximum, QSizePolicy::Preferred ) );
+ label = new TQLabel( i18n( "Port:" ), this );
+ mPort = new TQSpinBox( 0, 65535, 1, this, "kcfg_ldapport" );
+ mPort->setSizePolicy( TQSizePolicy( TQSizePolicy::Maximum, TQSizePolicy::Preferred ) );
mPort->setValue( 389 );
mainLayout->addWidget( label, row, col );
@@ -138,9 +138,9 @@ void LdapConfigWidget::initWidget()
}
if ( mFlags & W_VER ) {
- label = new QLabel( i18n( "LDAP version:" ), this );
- mVer = new QSpinBox( 2, 3, 1, this, "kcfg_ldapver" );
- mVer->setSizePolicy( QSizePolicy( QSizePolicy::Maximum, QSizePolicy::Preferred ) );
+ label = new TQLabel( i18n( "LDAP version:" ), this );
+ mVer = new TQSpinBox( 2, 3, 1, this, "kcfg_ldapver" );
+ mVer->setSizePolicy( TQSizePolicy( TQSizePolicy::Maximum, TQSizePolicy::Preferred ) );
mVer->setValue( 3 );
mainLayout->addWidget( label, row, col );
mainLayout->addWidget( mVer, row, col+1 );
@@ -149,9 +149,9 @@ void LdapConfigWidget::initWidget()
col = 0;
if ( mFlags & W_SIZELIMIT ) {
- label = new QLabel( i18n( "Size limit:" ), this );
- mSizeLimit = new QSpinBox( 0, 9999999, 1, this, "kcfg_ldapsizelimit" );
- mSizeLimit->setSizePolicy( QSizePolicy( QSizePolicy::Maximum, QSizePolicy::Preferred ) );
+ label = new TQLabel( i18n( "Size limit:" ), this );
+ mSizeLimit = new TQSpinBox( 0, 9999999, 1, this, "kcfg_ldapsizelimit" );
+ mSizeLimit->setSizePolicy( TQSizePolicy( TQSizePolicy::Maximum, TQSizePolicy::Preferred ) );
mSizeLimit->setValue( 0 );
mSizeLimit->setSpecialValueText( i18n("Default") );
mainLayout->addWidget( label, row, col );
@@ -160,9 +160,9 @@ void LdapConfigWidget::initWidget()
}
if ( mFlags & W_TIMELIMIT ) {
- label = new QLabel( i18n( "Time limit:" ), this );
- mTimeLimit = new QSpinBox( 0, 9999999, 1, this, "kcfg_ldaptimelimit" );
- mTimeLimit->setSizePolicy( QSizePolicy( QSizePolicy::Maximum, QSizePolicy::Preferred ) );
+ label = new TQLabel( i18n( "Time limit:" ), this );
+ mTimeLimit = new TQSpinBox( 0, 9999999, 1, this, "kcfg_ldaptimelimit" );
+ mTimeLimit->setSizePolicy( TQSizePolicy( TQSizePolicy::Maximum, TQSizePolicy::Preferred ) );
mTimeLimit->setValue( 0 );
mTimeLimit->setSuffix( i18n(" sec") );
mTimeLimit->setSpecialValueText( i18n("Default") );
@@ -172,22 +172,22 @@ void LdapConfigWidget::initWidget()
if ( mFlags & ( W_SIZELIMIT | W_TIMELIMIT ) ) row++;
if ( mFlags & W_DN ) {
- label = new QLabel( i18n( "Distinguished Name", "DN:" ), this );
+ label = new TQLabel( i18n( "Distinguished Name", "DN:" ), this );
mDn = new KLineEdit( this, "kcfg_ldapdn" );
mainLayout->addWidget( label, row, 0 );
mainLayout->addMultiCellWidget( mDn, row, row, 1, 1 );
//without host query doesn't make sense
if ( mHost ) {
- QPushButton *dnquery = new QPushButton( i18n( "Query Server" ), this );
- connect( dnquery, SIGNAL( clicked() ), SLOT( mQueryDNClicked() ) );
+ TQPushButton *dnquery = new TQPushButton( i18n( "Query Server" ), this );
+ connect( dnquery, TQT_SIGNAL( clicked() ), TQT_SLOT( mQueryDNClicked() ) );
mainLayout->addMultiCellWidget( dnquery, row, row, 2, 3 );
}
row++;
}
if ( mFlags & W_FILTER ) {
- label = new QLabel( i18n( "Filter:" ), this );
+ label = new TQLabel( i18n( "Filter:" ), this );
mFilter = new KLineEdit( this, "kcfg_ldapfilter" );
mainLayout->addWidget( label, row, 0 );
@@ -196,15 +196,15 @@ void LdapConfigWidget::initWidget()
}
if ( mFlags & W_SECBOX ) {
- QHButtonGroup *btgroup = new QHButtonGroup( i18n( "Security" ), this );
- mSecNO = new QRadioButton( i18n( "No" ), btgroup, "kcfg_ldapnosec" );
- mSecTLS = new QRadioButton( i18n( "TLS" ), btgroup, "kcfg_ldaptls" );
- mSecSSL = new QRadioButton( i18n( "SSL" ), btgroup, "kcfg_ldapssl" );
+ TQHButtonGroup *btgroup = new TQHButtonGroup( i18n( "Security" ), this );
+ mSecNO = new TQRadioButton( i18n( "No" ), btgroup, "kcfg_ldapnosec" );
+ mSecTLS = new TQRadioButton( i18n( "TLS" ), btgroup, "kcfg_ldaptls" );
+ mSecSSL = new TQRadioButton( i18n( "SSL" ), btgroup, "kcfg_ldapssl" );
mainLayout->addMultiCellWidget( btgroup, row, row, 0, 3 );
- connect( mSecNO, SIGNAL( clicked() ), SLOT( setLDAPPort() ) );
- connect( mSecTLS, SIGNAL( clicked() ), SLOT( setLDAPPort() ) );
- connect( mSecSSL, SIGNAL( clicked() ), SLOT( setLDAPSPort( ) ) );
+ connect( mSecNO, TQT_SIGNAL( clicked() ), TQT_SLOT( setLDAPPort() ) );
+ connect( mSecTLS, TQT_SIGNAL( clicked() ), TQT_SLOT( setLDAPPort() ) );
+ connect( mSecSSL, TQT_SIGNAL( clicked() ), TQT_SLOT( setLDAPSPort( ) ) );
mSecNO->setChecked( true );
row++;
@@ -212,14 +212,14 @@ void LdapConfigWidget::initWidget()
if ( mFlags & W_AUTHBOX ) {
- QButtonGroup *authbox =
- new QButtonGroup( 3, Qt::Horizontal, i18n( "Authentication" ), this );
+ TQButtonGroup *authbox =
+ new TQButtonGroup( 3, Qt::Horizontal, i18n( "Authentication" ), this );
- mAnonymous = new QRadioButton( i18n( "Anonymous" ), authbox, "kcfg_ldapanon" );
- mSimple = new QRadioButton( i18n( "Simple" ), authbox, "kcfg_ldapsimple" );
- mSASL = new QRadioButton( i18n( "SASL" ), authbox, "kcfg_ldapsasl" );
+ mAnonymous = new TQRadioButton( i18n( "Anonymous" ), authbox, "kcfg_ldapanon" );
+ mSimple = new TQRadioButton( i18n( "Simple" ), authbox, "kcfg_ldapsimple" );
+ mSASL = new TQRadioButton( i18n( "SASL" ), authbox, "kcfg_ldapsasl" );
- label = new QLabel( i18n( "SASL mechanism:" ), authbox );
+ label = new TQLabel( i18n( "SASL mechanism:" ), authbox );
mMech = new KComboBox( false, authbox, "kcfg_ldapsaslmech" );
mMech->setEditable( true );
mMech->insertItem( "DIGEST-MD5" );
@@ -228,22 +228,22 @@ void LdapConfigWidget::initWidget()
//without host query doesn't make sense
if ( mHost ) {
- mQueryMech = new QPushButton( i18n( "Query Server" ), authbox );
- connect( mQueryMech, SIGNAL( clicked() ), SLOT( mQueryMechClicked() ) );
+ mQueryMech = new TQPushButton( i18n( "Query Server" ), authbox );
+ connect( mQueryMech, TQT_SIGNAL( clicked() ), TQT_SLOT( mQueryMechClicked() ) );
}
mainLayout->addMultiCellWidget( authbox, row, row+1, 0, 3 );
- connect( mAnonymous, SIGNAL( stateChanged(int) ), SLOT( setAnonymous(int) ) );
- connect( mSimple, SIGNAL( stateChanged(int) ), SLOT( setSimple(int) ) );
- connect( mSASL, SIGNAL( stateChanged(int) ), SLOT( setSASL(int) ) );
+ connect( mAnonymous, TQT_SIGNAL( stateChanged(int) ), TQT_SLOT( setAnonymous(int) ) );
+ connect( mSimple, TQT_SIGNAL( stateChanged(int) ), TQT_SLOT( setSimple(int) ) );
+ connect( mSASL, TQT_SIGNAL( stateChanged(int) ), TQT_SLOT( setSASL(int) ) );
mAnonymous->setChecked( true );
}
}
-void LdapConfigWidget::loadData( KIO::Job*, const QByteArray& d )
+void LdapConfigWidget::loadData( KIO::Job*, const TQByteArray& d )
{
LDIF::ParseVal ret;
@@ -256,7 +256,7 @@ void LdapConfigWidget::loadData( KIO::Job*, const QByteArray& d )
ret = mLdif.nextItem();
if ( ret == LDIF::Item && mLdif.attr().lower() == mAttr ) {
mProg->progressBar()->advance( 1 );
- mQResult.push_back( QString::fromUtf8( mLdif.val(), mLdif.val().size() ) );
+ mQResult.push_back( TQString::fromUtf8( mLdif.val(), mLdif.val().size() ) );
}
} while ( ret != LDIF::MoreData );
}
@@ -286,17 +286,17 @@ void LdapConfigWidget::sendQuery()
_url.setDn( "" );
_url.setAttributes( mAttr );
_url.setScope( LDAPUrl::Base );
- if ( mVer ) _url.setExtension( "x-ver", QString::number( mVer->value() ) );
+ if ( mVer ) _url.setExtension( "x-ver", TQString::number( mVer->value() ) );
if ( mSecTLS && mSecTLS->isChecked() ) _url.setExtension( "x-tls", "" );
kdDebug(5700) << "sendQuery url: " << _url.prettyURL() << endl;
mLdif.startParsing();
KIO::Job *job = KIO::get( _url, true, false );
job->addMetaData("no-auth-prompt","true");
- connect( job, SIGNAL( data( KIO::Job*, const QByteArray& ) ),
- this, SLOT( loadData( KIO::Job*, const QByteArray& ) ) );
- connect( job, SIGNAL( result( KIO::Job* ) ),
- this, SLOT( loadResult( KIO::Job* ) ) );
+ connect( job, TQT_SIGNAL( data( KIO::Job*, const TQByteArray& ) ),
+ this, TQT_SLOT( loadData( KIO::Job*, const TQByteArray& ) ) );
+ connect( job, TQT_SIGNAL( result( KIO::Job* ) ),
+ this, TQT_SLOT( loadResult( KIO::Job* ) ) );
if ( mProg == NULL )
mProg = new KProgressDialog( this, 0, i18n("LDAP Query"), _url.prettyURL(), true );
@@ -333,7 +333,7 @@ void LdapConfigWidget::mQueryDNClicked()
void LdapConfigWidget::setAnonymous( int state )
{
- if ( state == QButton::Off ) return;
+ if ( state == TQButton::Off ) return;
if ( mUser ) mUser->setEnabled(false);
if ( mPassword ) mPassword->setEnabled(false);
if ( mBindDN ) mBindDN->setEnabled(false);
@@ -344,7 +344,7 @@ void LdapConfigWidget::setAnonymous( int state )
void LdapConfigWidget::setSimple( int state )
{
- if ( state == QButton::Off ) return;
+ if ( state == TQButton::Off ) return;
if ( mUser ) mUser->setEnabled(true);
if ( mPassword ) mPassword->setEnabled(true);
if ( mBindDN ) mBindDN->setEnabled(false);
@@ -355,7 +355,7 @@ void LdapConfigWidget::setSimple( int state )
void LdapConfigWidget::setSASL( int state )
{
- if ( state == QButton::Off ) return;
+ if ( state == TQButton::Off ) return;
if ( mUser ) mUser->setEnabled(true);
if ( mPassword ) mPassword->setEnabled(true);
if ( mBindDN ) mBindDN->setEnabled(true);
@@ -388,11 +388,11 @@ LDAPUrl LdapConfigWidget::url() const
if ( mHost ) _url.setHost( mHost->text() );
if ( mPort ) _url.setPort( mPort->value() );
if ( mDn ) _url.setDn( mDn->text() );
- if ( mVer ) _url.setExtension( "x-ver", QString::number( mVer->value() ) );
+ if ( mVer ) _url.setExtension( "x-ver", TQString::number( mVer->value() ) );
if ( mSizeLimit && mSizeLimit->value() != 0 )
- _url.setExtension( "x-sizelimit", QString::number( mSizeLimit->value() ) );
+ _url.setExtension( "x-sizelimit", TQString::number( mSizeLimit->value() ) );
if ( mTimeLimit && mTimeLimit->value() != 0 )
- _url.setExtension( "x-timelimit", QString::number( mTimeLimit->value() ) );
+ _url.setExtension( "x-timelimit", TQString::number( mTimeLimit->value() ) );
if ( mSecTLS && mSecTLS->isChecked() ) _url.setExtension( "x-tls","" );
if ( mFilter && !mFilter->text().isEmpty() )
_url.setFilter( mFilter->text() );
@@ -407,54 +407,54 @@ LDAPUrl LdapConfigWidget::url() const
return ( _url );
}
-void LdapConfigWidget::setUser( const QString &user )
+void LdapConfigWidget::setUser( const TQString &user )
{
if ( mUser ) mUser->setText( user );
}
-QString LdapConfigWidget::user() const
+TQString LdapConfigWidget::user() const
{
- return ( mUser ? mUser->text() : QString::null );
+ return ( mUser ? mUser->text() : TQString::null );
}
-void LdapConfigWidget::setPassword( const QString &password )
+void LdapConfigWidget::setPassword( const TQString &password )
{
if ( mPassword ) mPassword->setText( password );
}
-QString LdapConfigWidget::password() const
+TQString LdapConfigWidget::password() const
{
- return ( mPassword ? mPassword->text() : QString::null );
+ return ( mPassword ? mPassword->text() : TQString::null );
}
-void LdapConfigWidget::setBindDN( const QString &binddn )
+void LdapConfigWidget::setBindDN( const TQString &binddn )
{
if ( mBindDN ) mBindDN->setText( binddn );
}
-QString LdapConfigWidget::bindDN() const
+TQString LdapConfigWidget::bindDN() const
{
- return ( mBindDN ? mBindDN->text() : QString::null );
+ return ( mBindDN ? mBindDN->text() : TQString::null );
}
-void LdapConfigWidget::setRealm( const QString &realm )
+void LdapConfigWidget::setRealm( const TQString &realm )
{
if ( mRealm ) mRealm->setText( realm );
}
-QString LdapConfigWidget::realm() const
+TQString LdapConfigWidget::realm() const
{
- return ( mRealm ? mRealm->text() : QString::null );
+ return ( mRealm ? mRealm->text() : TQString::null );
}
-void LdapConfigWidget::setHost( const QString &host )
+void LdapConfigWidget::setHost( const TQString &host )
{
if ( mHost ) mHost->setText( host );
}
-QString LdapConfigWidget::host() const
+TQString LdapConfigWidget::host() const
{
- return ( mHost ? mHost->text() : QString::null );
+ return ( mHost ? mHost->text() : TQString::null );
}
void LdapConfigWidget::setPort( int port )
@@ -477,27 +477,27 @@ int LdapConfigWidget::ver() const
return ( mVer ? mVer->value() : 3 );
}
-void LdapConfigWidget::setDn( const QString &dn )
+void LdapConfigWidget::setDn( const TQString &dn )
{
if ( mDn ) mDn->setText( dn );
}
-QString LdapConfigWidget::dn() const
+TQString LdapConfigWidget::dn() const
{
- return ( mDn ? mDn->text() : QString::null );
+ return ( mDn ? mDn->text() : TQString::null );
}
-void LdapConfigWidget::setFilter( const QString &filter )
+void LdapConfigWidget::setFilter( const TQString &filter )
{
if ( mFilter ) mFilter->setText( filter );
}
-QString LdapConfigWidget::filter() const
+TQString LdapConfigWidget::filter() const
{
- return ( mFilter ? mFilter->text() : QString::null );
+ return ( mFilter ? mFilter->text() : TQString::null );
}
-void LdapConfigWidget::setMech( const QString &mech )
+void LdapConfigWidget::setMech( const TQString &mech )
{
if ( mMech == 0 ) return;
if ( !mech.isEmpty() ) {
@@ -511,9 +511,9 @@ void LdapConfigWidget::setMech( const QString &mech )
}
}
-QString LdapConfigWidget::mech() const
+TQString LdapConfigWidget::mech() const
{
- return ( mMech ? mMech->currentText() : QString::null );
+ return ( mMech ? mMech->currentText() : TQString::null );
}
void LdapConfigWidget::setSecNO( bool b )
@@ -607,14 +607,14 @@ void LdapConfigWidget::setFlags( int flags )
// First delete all the child widgets.
// FIXME: I hope it's correct
- const QObjectList *ch = children();
- QObjectList ch2 = *ch;
- QObject *obj;
- QWidget *widget;
+ const TQObjectList *ch = children();
+ TQObjectList ch2 = *ch;
+ TQObject *obj;
+ TQWidget *widget;
obj = ch2.first();
while ( obj != 0 ) {
- widget = dynamic_cast<QWidget*> (obj);
+ widget = dynamic_cast<TQWidget*> (obj);
if ( widget && widget->parent() == this ) {
mainLayout->remove( widget );
delete ( widget );