diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /kaddressbook/distributionlisteditor.cpp | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kaddressbook/distributionlisteditor.cpp')
-rw-r--r-- | kaddressbook/distributionlisteditor.cpp | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/kaddressbook/distributionlisteditor.cpp b/kaddressbook/distributionlisteditor.cpp index a18b5493f..1c57a134b 100644 --- a/kaddressbook/distributionlisteditor.cpp +++ b/kaddressbook/distributionlisteditor.cpp @@ -37,47 +37,47 @@ #include <klocale.h> #include <kmessagebox.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qsignalmapper.h> -#include <qtoolbutton.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqsignalmapper.h> +#include <tqtoolbutton.h> class KPIM::DistributionListEditor::EditorWidgetPrivate { public: - QScrollView* scrollView; - QSignalMapper* mapper; + TQScrollView* scrollView; + TQSignalMapper* mapper; KABC::AddressBook* addressBook; - QString distListUid; - QLabel* nameLabel; - QLabel* memberListLabel; + TQString distListUid; + TQLabel* nameLabel; + TQLabel* memberListLabel; KLineEdit* nameLineEdit; - QWidget* memberListWidget; - QVBoxLayout* addresseeLayout; - QValueList<KPIM::DistributionListEditor::Line*> addressees; + TQWidget* memberListWidget; + TQVBoxLayout* addresseeLayout; + TQValueList<KPIM::DistributionListEditor::Line*> addressees; KPIM::DistributionList distributionList; KPIM::DistributionListEditor::Line* addLineForEntry( const KPIM::DistributionList::Entry& entry ); int lastLineId; }; -KPIM::DistributionListEditor::Line::Line( KABC::AddressBook* book, QWidget* parent ) : QWidget( parent ), m_addressBook( book ) +KPIM::DistributionListEditor::Line::Line( KABC::AddressBook* book, TQWidget* parent ) : TQWidget( parent ), m_addressBook( book ) { Q_ASSERT( m_addressBook ); - QBoxLayout* layout = new QHBoxLayout( this ); + TQBoxLayout* layout = new TQHBoxLayout( this ); layout->setSpacing( KDialog::spacingHint() ); m_lineEdit = new KPIM::DistributionListEditor::LineEdit( this ); - connect( m_lineEdit, SIGNAL( textChanged( const QString& ) ), - this, SLOT( textChanged( const QString& ) ) ); + connect( m_lineEdit, TQT_SIGNAL( textChanged( const TQString& ) ), + this, TQT_SLOT( textChanged( const TQString& ) ) ); layout->addWidget( m_lineEdit ); - m_clearButton = new QToolButton( this ); + m_clearButton = new TQToolButton( this ); m_clearButton->setIconSet( KApplication::reverseLayout() ? SmallIconSet("locationbar_erase") : SmallIconSet( "clear_left" ) ); m_clearButton->setEnabled( false ); layout->addWidget( m_clearButton ); - connect( m_clearButton, SIGNAL( clicked() ), m_lineEdit, SLOT( clear() ) ); + connect( m_clearButton, TQT_SIGNAL( clicked() ), m_lineEdit, TQT_SLOT( clear() ) ); } -void KPIM::DistributionListEditor::Line::textChanged( const QString& text ) +void KPIM::DistributionListEditor::Line::textChanged( const TQString& text ) { m_clearButton->setEnabled( !text.isEmpty() ); if ( text.isEmpty() ) @@ -97,7 +97,7 @@ void KPIM::DistributionListEditor::Line::setEntry( const KPIM::DistributionList: m_lineEdit->setText( m_initialText ); } -KABC::Addressee KPIM::DistributionListEditor::Line::findAddressee( const QString& name, const QString& email ) const +KABC::Addressee KPIM::DistributionListEditor::Line::findAddressee( const TQString& name, const TQString& email ) const { if ( name.isEmpty() && email.isEmpty() ) return KABC::Addressee(); @@ -125,9 +125,9 @@ KABC::Addressee KPIM::DistributionListEditor::Line::findAddressee( const QString KPIM::DistributionList::Entry KPIM::DistributionListEditor::Line::entry() const { - const QString text = m_lineEdit->text(); - QString name; - QString email; + const TQString text = m_lineEdit->text(); + TQString name; + TQString email; KPIM::getNameAndMail(m_lineEdit->text(), name, email ); KPIM::DistributionList::Entry res; @@ -139,34 +139,34 @@ KPIM::DistributionList::Entry KPIM::DistributionListEditor::Line::entry() const } if ( res.addressee.isEmpty() ) res.addressee = findAddressee( name, email ); - res.email = res.addressee.preferredEmail() != email ? email : QString(); + res.email = res.addressee.preferredEmail() != email ? email : TQString(); return res; } -KPIM::DistributionListEditor::LineEdit::LineEdit( QWidget* parent ) : KPIM::AddresseeLineEdit( parent ) +KPIM::DistributionListEditor::LineEdit::LineEdit( TQWidget* parent ) : KPIM::AddresseeLineEdit( parent ) { } -KPIM::DistributionListEditor::EditorWidget::EditorWidget( KABC::AddressBook* book, QWidget* parent ) - : KDialogBase( parent, /*name=*/0, /*modal=*/ true, /*caption=*/QString(), KDialogBase::Ok|KDialogBase::Cancel ), d( new DistributionListEditor::EditorWidgetPrivate ) +KPIM::DistributionListEditor::EditorWidget::EditorWidget( KABC::AddressBook* book, TQWidget* parent ) + : KDialogBase( parent, /*name=*/0, /*modal=*/ true, /*caption=*/TQString(), KDialogBase::Ok|KDialogBase::Cancel ), d( new DistributionListEditor::EditorWidgetPrivate ) { d->addressBook = book; Q_ASSERT( d->addressBook ); d->lastLineId = 0; - d->mapper = new QSignalMapper( this ); - connect( d->mapper, SIGNAL( mapped( int ) ), - this, SLOT( lineTextChanged( int ) ) ); + d->mapper = new TQSignalMapper( this ); + connect( d->mapper, TQT_SIGNAL( mapped( int ) ), + this, TQT_SLOT( lineTextChanged( int ) ) ); setCaption( i18n( "Edit Distribution List" ) ); - QWidget* main = new QWidget( this ); - QVBoxLayout* mainLayout = new QVBoxLayout( main ); + TQWidget* main = new TQWidget( this ); + TQVBoxLayout* mainLayout = new TQVBoxLayout( main ); mainLayout->setMargin( KDialog::marginHint() ); mainLayout->setSpacing( KDialog::spacingHint() ); - QHBoxLayout* nameLayout = new QHBoxLayout; + TQHBoxLayout* nameLayout = new QHBoxLayout; nameLayout->setSpacing( KDialog::spacingHint() ); - d->nameLabel = new QLabel( main ); + d->nameLabel = new TQLabel( main ); d->nameLabel->setText( i18n( "Name:" ) ); nameLayout->addWidget( d->nameLabel ); @@ -176,27 +176,27 @@ KPIM::DistributionListEditor::EditorWidget::EditorWidget( KABC::AddressBook* boo mainLayout->addLayout( nameLayout ); mainLayout->addSpacing( 30 ); - d->memberListLabel = new QLabel( main ); + d->memberListLabel = new TQLabel( main ); d->memberListLabel->setText( i18n( "Distribution list members:" ) ); mainLayout->addWidget( d->memberListLabel ); - d->scrollView = new QScrollView( main ); - d->scrollView->setFrameShape( QFrame::NoFrame ); + d->scrollView = new TQScrollView( main ); + d->scrollView->setFrameShape( TQFrame::NoFrame ); mainLayout->addWidget( d->scrollView ); - d->memberListWidget = new QWidget( d->scrollView->viewport() ); - d->memberListWidget->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding ); - QVBoxLayout* memberLayout = new QVBoxLayout( d->memberListWidget ); + d->memberListWidget = new TQWidget( d->scrollView->viewport() ); + d->memberListWidget->setSizePolicy( TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding ); + TQVBoxLayout* memberLayout = new TQVBoxLayout( d->memberListWidget ); d->addresseeLayout = new QVBoxLayout; d->addresseeLayout->setSpacing( KDialog::spacingHint() ); memberLayout->addItem( d->addresseeLayout ); memberLayout->addStretch(); d->scrollView->addChild( d->memberListWidget ); - d->scrollView->setResizePolicy( QScrollView::AutoOneFit ); + d->scrollView->setResizePolicy( TQScrollView::AutoOneFit ); setMainWidget( main ); KPIM::DistributionListEditor::Line* const last = d->addLineForEntry( KPIM::DistributionList::Entry() ); - const QSize hint = sizeHint(); + const TQSize hint = sizeHint(); resize( hint.width() * 1.5, hint.height() ); } @@ -219,7 +219,7 @@ void KPIM::DistributionListEditor::EditorWidget::setDistributionList( const KPIM d->nameLineEdit->setText( list.name() ); using KPIM::DistributionListEditor::Line; - typedef QValueList<Line*>::ConstIterator ListIterator; + typedef TQValueList<Line*>::ConstIterator ListIterator; for ( ListIterator it = d->addressees.begin(), end = d->addressees.end(); it != end; ++it ) { delete *it; @@ -243,8 +243,8 @@ KPIM::DistributionListEditor::Line* KPIM::DistributionListEditor::EditorWidgetPr line->setEntry( entry ); addresseeLayout->addWidget( line ); addressees.append( line ); - QObject::connect( line, SIGNAL( textChanged() ), - mapper, SLOT( map() ) ); + TQObject::connect( line, TQT_SIGNAL( textChanged() ), + mapper, TQT_SLOT( map() ) ); mapper->setMapping( line, ++lastLineId ); line->setShown( true ); return line; @@ -252,7 +252,7 @@ KPIM::DistributionListEditor::Line* KPIM::DistributionListEditor::EditorWidgetPr void KPIM::DistributionListEditor::EditorWidget::slotOk() { - const QString name = d->nameLineEdit->text(); + const TQString name = d->nameLineEdit->text(); const KPIM::DistributionList existing = KPIM::DistributionList::findByName( d->addressBook, name ); if ( !existing.isEmpty() && existing.uid() != d->distListUid ) { @@ -263,7 +263,7 @@ void KPIM::DistributionListEditor::EditorWidget::slotOk() KPIM::DistributionList list; list.setUid( d->distListUid.isNull() ? KApplication::randomString( 10 ) :d->distListUid ); list.setName( name ); - typedef QValueList<KPIM::DistributionListEditor::Line*>::ConstIterator ListIterator; + typedef TQValueList<KPIM::DistributionListEditor::Line*>::ConstIterator ListIterator; for ( ListIterator it = d->addressees.begin(), end = d->addressees.end(); it != end; ++it ) { const KPIM::DistributionList::Entry entry = (*it)->entry(); |