summaryrefslogtreecommitdiffstats
path: root/kaddressbook/addresseditwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kaddressbook/addresseditwidget.cpp')
-rw-r--r--kaddressbook/addresseditwidget.cpp162
1 files changed, 81 insertions, 81 deletions
diff --git a/kaddressbook/addresseditwidget.cpp b/kaddressbook/addresseditwidget.cpp
index 54171c34e..26924ef8f 100644
--- a/kaddressbook/addresseditwidget.cpp
+++ b/kaddressbook/addresseditwidget.cpp
@@ -22,19 +22,19 @@
without including the source code for Qt in the source distribution.
*/
-#include <qbuttongroup.h>
-#include <qcheckbox.h>
-#include <qhbox.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qlistbox.h>
-#include <qlistview.h>
-#include <qpushbutton.h>
-#include <qsignal.h>
-#include <qstring.h>
-#include <qtextedit.h>
-#include <qtoolbutton.h>
-#include <qtooltip.h>
+#include <tqbuttongroup.h>
+#include <tqcheckbox.h>
+#include <tqhbox.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqlistbox.h>
+#include <tqlistview.h>
+#include <tqpushbutton.h>
+#include <tqsignal.h>
+#include <tqstring.h>
+#include <tqtextedit.h>
+#include <tqtoolbutton.h>
+#include <tqtooltip.h>
#include <kaccelmanager.h>
#include <kactivelabel.h>
@@ -57,18 +57,18 @@
class TabPressEater : public QObject
{
public:
- TabPressEater( QObject *parent )
- : QObject( parent, "TabPressEater" )
+ TabPressEater( TQObject *parent )
+ : TQObject( parent, "TabPressEater" )
{
}
protected:
- bool eventFilter( QObject*, QEvent *event )
+ bool eventFilter( TQObject*, TQEvent *event )
{
- if ( event->type() == QEvent::KeyPress ) {
- QKeyEvent *keyEvent = (QKeyEvent*)event;
+ if ( event->type() == TQEvent::KeyPress ) {
+ TQKeyEvent *keyEvent = (TQKeyEvent*)event;
if ( keyEvent->key() == Qt::Key_Tab ) {
- QApplication::sendEvent( parent(), event );
+ TQApplication::sendEvent( parent(), event );
return true;
} else
return false;
@@ -79,26 +79,26 @@ class TabPressEater : public QObject
};
-AddressEditWidget::AddressEditWidget( QWidget *parent, const char *name )
- : QWidget( parent, name )
+AddressEditWidget::AddressEditWidget( TQWidget *parent, const char *name )
+ : TQWidget( parent, name )
{
- QBoxLayout *layout = new QVBoxLayout( this, 4, 2 );
+ TQBoxLayout *layout = new TQVBoxLayout( this, 4, 2 );
layout->setSpacing( KDialog::spacingHint() );
mTypeCombo = new AddressTypeCombo( mAddressList, this );
- connect( mTypeCombo, SIGNAL( activated( int ) ),
- SLOT( updateAddressEdit() ) );
+ connect( mTypeCombo, TQT_SIGNAL( activated( int ) ),
+ TQT_SLOT( updateAddressEdit() ) );
layout->addWidget( mTypeCombo );
mAddressField = new KActiveLabel( this );
- mAddressField->setFrameStyle( QFrame::Panel | QFrame::Sunken );
+ mAddressField->setFrameStyle( TQFrame::Panel | TQFrame::Sunken );
mAddressField->setMinimumHeight( 20 );
mAddressField->setAlignment( Qt::AlignTop );
mAddressField->setTextFormat( Qt::PlainText );
layout->addWidget( mAddressField );
- mEditButton = new QPushButton( i18n( "street/postal", "&Edit Addresses..." ), this );
- connect( mEditButton, SIGNAL( clicked() ), this, SLOT( edit() ) );
+ mEditButton = new TQPushButton( i18n( "street/postal", "&Edit Addresses..." ), this );
+ connect( mEditButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( edit() ) );
layout->addWidget( mEditButton );
}
@@ -134,13 +134,13 @@ void AddressEditWidget::setAddresses( const KABC::Addressee &addr,
// Insert types for existing numbers.
mTypeCombo->insertTypeList( list );
- QValueList<int> defaultTypes;
+ TQValueList<int> defaultTypes;
defaultTypes << KABC::Address::Home;
defaultTypes << KABC::Address::Work;
AddresseeConfig config( mAddressee );
- const QValueList<int> configList = config.noDefaultAddrTypes();
- QValueList<int>::ConstIterator it;
+ const TQValueList<int> configList = config.noDefaultAddrTypes();
+ TQValueList<int>::ConstIterator it;
for ( it = configList.begin(); it != configList.end(); ++it )
defaultTypes.remove( *it );
@@ -195,7 +195,7 @@ void AddressEditWidget::edit()
}
AddresseeConfig config( mAddressee );
- QValueList<int> configList;
+ TQValueList<int> configList;
if ( !hasHome )
configList << KABC::Address::Home;
if ( !hasWork )
@@ -229,17 +229,17 @@ void AddressEditWidget::updateAddressEdit()
mAddressField->setText( a.formattedAddress( mAddressee.realName() ) );
}
#else
- QString text;
+ TQString text;
if ( !a.street().isEmpty() )
text += a.street() + "\n";
if ( !a.postOfficeBox().isEmpty() )
text += a.postOfficeBox() + "\n";
- text += a.locality() + QString(" ") + a.region();
+ text += a.locality() + TQString(" ") + a.region();
if ( !a.postalCode().isEmpty() )
- text += QString(", ") + a.postalCode();
+ text += TQString(", ") + a.postalCode();
text += "\n";
@@ -257,7 +257,7 @@ void AddressEditWidget::updateAddressEdit()
}
AddressEditDialog::AddressEditDialog( const KABC::Address::List &list,
- int selected, QWidget *parent,
+ int selected, TQWidget *parent,
const char *name )
: KDialogBase( Plain, i18n( "street/postal", "Edit Address" ), Ok | Cancel, Ok,
parent, name, true, true ),
@@ -265,18 +265,18 @@ AddressEditDialog::AddressEditDialog( const KABC::Address::List &list,
{
mAddressList = list;
- QWidget *page = plainPage();
+ TQWidget *page = plainPage();
- QGridLayout *topLayout = new QGridLayout( page, 8, 2 );
+ TQGridLayout *topLayout = new TQGridLayout( page, 8, 2 );
topLayout->setSpacing( spacingHint() );
mTypeCombo = new AddressTypeCombo( mAddressList, page );
topLayout->addMultiCellWidget( mTypeCombo, 0, 0, 0, 1 );
- QLabel *label = new QLabel( i18n( "<streetLabel>:", "%1:" ).arg( KABC::Address::streetLabel() ), page );
+ TQLabel *label = new TQLabel( i18n( "<streetLabel>:", "%1:" ).arg( KABC::Address::streetLabel() ), page );
label->setAlignment( Qt::AlignTop | Qt::AlignLeft );
topLayout->addWidget( label, 1, 0 );
- mStreetTextEdit = new QTextEdit( page );
+ mStreetTextEdit = new TQTextEdit( page );
mStreetTextEdit->setTextFormat( Qt::PlainText );
label->setBuddy( mStreetTextEdit );
topLayout->addWidget( mStreetTextEdit, 1, 1 );
@@ -284,79 +284,79 @@ AddressEditDialog::AddressEditDialog( const KABC::Address::List &list,
TabPressEater *eater = new TabPressEater( this );
mStreetTextEdit->installEventFilter( eater );
- label = new QLabel( i18n( "<postOfficeBoxLabel>:", "%1:" ).arg( KABC::Address::postOfficeBoxLabel() ), page );
+ label = new TQLabel( i18n( "<postOfficeBoxLabel>:", "%1:" ).arg( KABC::Address::postOfficeBoxLabel() ), page );
topLayout->addWidget( label, 2 , 0 );
mPOBoxEdit = new KLineEdit( page );
label->setBuddy( mPOBoxEdit );
topLayout->addWidget( mPOBoxEdit, 2, 1 );
- label = new QLabel( i18n( "<localityLabel>:", "%1:" ).arg( KABC::Address::localityLabel() ), page );
+ label = new TQLabel( i18n( "<localityLabel>:", "%1:" ).arg( KABC::Address::localityLabel() ), page );
topLayout->addWidget( label, 3, 0 );
mLocalityEdit = new KLineEdit( page );
label->setBuddy( mLocalityEdit );
topLayout->addWidget( mLocalityEdit, 3, 1 );
- label = new QLabel( i18n( "<regionLabel>:", "%1:" ).arg( KABC::Address::regionLabel() ), page );
+ label = new TQLabel( i18n( "<regionLabel>:", "%1:" ).arg( KABC::Address::regionLabel() ), page );
topLayout->addWidget( label, 4, 0 );
mRegionEdit = new KLineEdit( page );
label->setBuddy( mRegionEdit );
topLayout->addWidget( mRegionEdit, 4, 1 );
- label = new QLabel( i18n( "<postalCodeLabel>:", "%1:" ).arg( KABC::Address::postalCodeLabel() ), page );
+ label = new TQLabel( i18n( "<postalCodeLabel>:", "%1:" ).arg( KABC::Address::postalCodeLabel() ), page );
topLayout->addWidget( label, 5, 0 );
mPostalCodeEdit = new KLineEdit( page );
label->setBuddy( mPostalCodeEdit );
topLayout->addWidget( mPostalCodeEdit, 5, 1 );
- label = new QLabel( i18n( "<countryLabel>:", "%1:" ).arg( KABC::Address::countryLabel() ), page );
+ label = new TQLabel( i18n( "<countryLabel>:", "%1:" ).arg( KABC::Address::countryLabel() ), page );
topLayout->addWidget( label, 6, 0 );
mCountryCombo = new KComboBox( page );
mCountryCombo->setEditable( true );
mCountryCombo->setDuplicatesEnabled( false );
#if KDE_IS_VERSION(3,3,0)
- QPushButton *labelButton = new QPushButton( i18n( "Edit Label..." ), page );
+ TQPushButton *labelButton = new TQPushButton( i18n( "Edit Label..." ), page );
topLayout->addMultiCellWidget( labelButton, 7, 7, 0, 1 );
- connect( labelButton, SIGNAL( clicked() ), SLOT( editLabel() ) );
+ connect( labelButton, TQT_SIGNAL( clicked() ), TQT_SLOT( editLabel() ) );
#endif
fillCountryCombo();
label->setBuddy( mCountryCombo );
topLayout->addWidget( mCountryCombo, 6, 1 );
- mPreferredCheckBox = new QCheckBox( i18n( "street/postal", "This is the preferred address" ), page );
+ mPreferredCheckBox = new TQCheckBox( i18n( "street/postal", "This is the preferred address" ), page );
topLayout->addMultiCellWidget( mPreferredCheckBox, 8, 8, 0, 1 );
KSeparator *sep = new KSeparator( KSeparator::HLine, page );
topLayout->addMultiCellWidget( sep, 9, 9, 0, 1 );
- QHBox *buttonBox = new QHBox( page );
+ TQHBox *buttonBox = new TQHBox( page );
buttonBox->setSpacing( spacingHint() );
topLayout->addMultiCellWidget( buttonBox, 10, 10, 0, 1 );
- QPushButton *addButton = new QPushButton( i18n( "New..." ), buttonBox );
- connect( addButton, SIGNAL( clicked() ), SLOT( addAddress() ) );
+ TQPushButton *addButton = new TQPushButton( i18n( "New..." ), buttonBox );
+ connect( addButton, TQT_SIGNAL( clicked() ), TQT_SLOT( addAddress() ) );
- mRemoveButton = new QPushButton( i18n( "Remove" ), buttonBox );
- connect( mRemoveButton, SIGNAL( clicked() ), SLOT( removeAddress() ) );
+ mRemoveButton = new TQPushButton( i18n( "Remove" ), buttonBox );
+ connect( mRemoveButton, TQT_SIGNAL( clicked() ), TQT_SLOT( removeAddress() ) );
- mChangeTypeButton = new QPushButton( i18n( "Change Type..." ), buttonBox );
- connect( mChangeTypeButton, SIGNAL( clicked() ), SLOT( changeType() ) );
+ mChangeTypeButton = new TQPushButton( i18n( "Change Type..." ), buttonBox );
+ connect( mChangeTypeButton, TQT_SIGNAL( clicked() ), TQT_SLOT( changeType() ) );
mTypeCombo->updateTypes();
mTypeCombo->setCurrentItem( selected );
updateAddressEdits();
- connect( mTypeCombo, SIGNAL( activated( int ) ),
- SLOT( updateAddressEdits() ) );
- connect( mStreetTextEdit, SIGNAL( textChanged() ), SLOT( modified() ) );
- connect( mPOBoxEdit, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) );
- connect( mLocalityEdit, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) );
- connect( mRegionEdit, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) );
- connect( mPostalCodeEdit, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) );
- connect( mCountryCombo, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) );
- connect( mPreferredCheckBox, SIGNAL( toggled( bool ) ), SLOT( modified() ) );
+ connect( mTypeCombo, TQT_SIGNAL( activated( int ) ),
+ TQT_SLOT( updateAddressEdits() ) );
+ connect( mStreetTextEdit, TQT_SIGNAL( textChanged() ), TQT_SLOT( modified() ) );
+ connect( mPOBoxEdit, TQT_SIGNAL( textChanged( const TQString& ) ), TQT_SLOT( modified() ) );
+ connect( mLocalityEdit, TQT_SIGNAL( textChanged( const TQString& ) ), TQT_SLOT( modified() ) );
+ connect( mRegionEdit, TQT_SIGNAL( textChanged( const TQString& ) ), TQT_SLOT( modified() ) );
+ connect( mPostalCodeEdit, TQT_SIGNAL( textChanged( const TQString& ) ), TQT_SLOT( modified() ) );
+ connect( mCountryCombo, TQT_SIGNAL( textChanged( const TQString& ) ), TQT_SLOT( modified() ) );
+ connect( mPreferredCheckBox, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( modified() ) );
KAcceleratorManager::manage( this );
@@ -437,7 +437,7 @@ void AddressEditDialog::editLabel()
{
#if KDE_IS_VERSION(3,3,0)
bool ok = false;
- QString result = KInputDialog::getMultiLineText( KABC::Address::labelLabel(),
+ TQString result = KInputDialog::getMultiLineText( KABC::Address::labelLabel(),
KABC::Address::labelLabel(),
mLabel, &ok, this );
if ( ok ) {
@@ -504,7 +504,7 @@ void AddressEditDialog::saveAddress( KABC::Address &addr )
void AddressEditDialog::fillCountryCombo()
{
- QString country[] = {
+ TQString country[] = {
i18n( "Afghanistan" ), i18n( "Albania" ), i18n( "Algeria" ),
i18n( "American Samoa" ), i18n( "Andorra" ), i18n( "Angola" ),
i18n( "Anguilla" ), i18n( "Antarctica" ), i18n( "Antigua and Barbuda" ),
@@ -587,7 +587,7 @@ void AddressEditDialog::fillCountryCombo()
""
};
- QStringList countries;
+ TQStringList countries;
for ( int i = 0; !country[ i ].isEmpty(); ++i )
countries.append( country[ i ] );
@@ -599,14 +599,14 @@ void AddressEditDialog::fillCountryCombo()
}
-AddressTypeDialog::AddressTypeDialog( int type, QWidget *parent )
+AddressTypeDialog::AddressTypeDialog( int type, TQWidget *parent )
: KDialogBase( Plain, i18n( "street/postal", "Edit Address Type" ), Ok | Cancel, Ok,
parent, "AddressTypeDialog" )
{
- QWidget *page = plainPage();
- QVBoxLayout *layout = new QVBoxLayout( page );
+ TQWidget *page = plainPage();
+ TQVBoxLayout *layout = new TQVBoxLayout( page );
- mGroup = new QButtonGroup( 2, Horizontal, i18n( "street/postal", "Address Types" ), page );
+ mGroup = new TQButtonGroup( 2, Horizontal, i18n( "street/postal", "Address Types" ), page );
layout->addWidget( mGroup );
mTypeList = KABC::Address::typeList();
@@ -614,10 +614,10 @@ AddressTypeDialog::AddressTypeDialog( int type, QWidget *parent )
KABC::Address::TypeList::ConstIterator it;
for ( it = mTypeList.begin(); it != mTypeList.end(); ++it )
- new QCheckBox( KABC::Address::typeLabel( *it ), mGroup );
+ new TQCheckBox( KABC::Address::typeLabel( *it ), mGroup );
for ( int i = 0; i < mGroup->count(); ++i ) {
- QCheckBox *box = (QCheckBox*)mGroup->find( i );
+ TQCheckBox *box = (TQCheckBox*)mGroup->find( i );
box->setChecked( type & mTypeList[ i ] );
}
}
@@ -630,7 +630,7 @@ int AddressTypeDialog::type() const
{
int type = 0;
for ( int i = 0; i < mGroup->count(); ++i ) {
- QCheckBox *box = (QCheckBox*)mGroup->find( i );
+ TQCheckBox *box = (TQCheckBox*)mGroup->find( i );
if ( box->isChecked() )
type += mTypeList[ i ];
}
@@ -645,30 +645,30 @@ int AddressTypeDialog::type() const
class LocaleAwareString : public QString
{
public:
- LocaleAwareString() : QString()
+ LocaleAwareString() : TQString()
{}
- LocaleAwareString( const QString &str ) : QString( str )
+ LocaleAwareString( const TQString &str ) : TQString( str )
{}
};
static bool operator<( const LocaleAwareString &s1, const LocaleAwareString &s2 )
{
- return ( QString::localeAwareCompare( s1, s2 ) < 0 );
+ return ( TQString::localeAwareCompare( s1, s2 ) < 0 );
}
-QStringList AddressEditDialog::sortLocaleAware( const QStringList &list )
+TQStringList AddressEditDialog::sortLocaleAware( const TQStringList &list )
{
- QValueList<LocaleAwareString> sortedList;
+ TQValueList<LocaleAwareString> sortedList;
- QStringList::ConstIterator it;
+ TQStringList::ConstIterator it;
for ( it = list.begin(); it != list.end(); ++it )
sortedList.append( LocaleAwareString( *it ) );
qHeapSort( sortedList );
- QStringList retval;
- QValueList<LocaleAwareString>::ConstIterator retIt;
+ TQStringList retval;
+ TQValueList<LocaleAwareString>::ConstIterator retIt;
for ( retIt = sortedList.begin(); retIt != sortedList.end(); ++retIt )
retval.append( *retIt );