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 /kmail/xfaceconfigurator.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 'kmail/xfaceconfigurator.cpp')
-rw-r--r-- | kmail/xfaceconfigurator.cpp | 144 |
1 files changed, 72 insertions, 72 deletions
diff --git a/kmail/xfaceconfigurator.cpp b/kmail/xfaceconfigurator.cpp index ba91efaa4..f88a3cd74 100644 --- a/kmail/xfaceconfigurator.cpp +++ b/kmail/xfaceconfigurator.cpp @@ -52,15 +52,15 @@ using namespace KPIM; #include <kabc/addressee.h> using namespace KABC; -#include <qbitmap.h> -#include <qcheckbox.h> -#include <qcombobox.h> -#include <qimage.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qpushbutton.h> -#include <qwhatsthis.h> -#include <qwidgetstack.h> +#include <tqbitmap.h> +#include <tqcheckbox.h> +#include <tqcombobox.h> +#include <tqimage.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqpushbutton.h> +#include <tqwhatsthis.h> +#include <tqwidgetstack.h> // #include <assert.h> @@ -70,122 +70,122 @@ using namespace KPIM; namespace KMail { - XFaceConfigurator::XFaceConfigurator( QWidget * parent, const char * name ) - : QWidget( parent, name ) + XFaceConfigurator::XFaceConfigurator( TQWidget * parent, const char * name ) + : TQWidget( parent, name ) { // tmp. vars: - QLabel * label; - QLabel * label1; + TQLabel * label; + TQLabel * label1; KActiveLabel * label2; - QWidget * page; - QVBoxLayout * vlay; - QHBoxLayout * hlay; - QVBoxLayout * page_vlay; - QPushButton * mFromFileBtn; - QPushButton * mFromAddrbkBtn; + TQWidget * page; + TQVBoxLayout * vlay; + TQHBoxLayout * hlay; + TQVBoxLayout * page_vlay; + TQPushButton * mFromFileBtn; + TQPushButton * mFromAddrbkBtn; - vlay = new QVBoxLayout( this, 0, KDialog::spacingHint(), "main layout" ); - hlay = new QHBoxLayout( vlay ); + vlay = new TQVBoxLayout( this, 0, KDialog::spacingHint(), "main layout" ); + hlay = new TQHBoxLayout( vlay ); // "enable X-Face" checkbox: - mEnableCheck = new QCheckBox( i18n("&Send picture with every message"), this ); - QWhatsThis::add( mEnableCheck, + mEnableCheck = new TQCheckBox( i18n("&Send picture with every message"), this ); + TQWhatsThis::add( mEnableCheck, i18n( "Check this box if you want KMail to add a so-called X-Face header to messages " "written with this identity. An X-Face is a small (48x48 pixels) black and " "white image that some mail clients are able to display." ) ); hlay->addWidget( mEnableCheck, Qt::AlignLeft | Qt::AlignVCenter ); - mXFaceLabel = new QLabel( this ); - QWhatsThis::add(mXFaceLabel, + mXFaceLabel = new TQLabel( this ); + TQWhatsThis::add(mXFaceLabel, i18n( "This is a preview of the picture selected/entered below." ) ); mXFaceLabel->setFixedSize(48, 48); - mXFaceLabel->setFrameShape( QFrame::Box ); + mXFaceLabel->setFrameShape( TQFrame::Box ); hlay->addWidget( mXFaceLabel ); -// label1 = new QLabel( "X-Face:", this ); +// label1 = new TQLabel( "X-Face:", this ); // vlay->addWidget( label1 ); // "obtain X-Face from" combo and label: - hlay = new QHBoxLayout( vlay ); // inherits spacing - mSourceCombo = new QComboBox( false, this ); - QWhatsThis::add(mSourceCombo, + hlay = new TQHBoxLayout( vlay ); // inherits spacing + mSourceCombo = new TQComboBox( false, this ); + TQWhatsThis::add(mSourceCombo, i18n("Click on the widgets below to obtain help on the input methods.")); mSourceCombo->setEnabled( false ); // since !mEnableCheck->isChecked() - mSourceCombo->insertStringList( QStringList() + mSourceCombo->insertStringList( TQStringList() << i18n( "continuation of \"obtain picture from\"", "External Source" ) << i18n( "continuation of \"obtain picture from\"", "Input Field Below" ) ); - label = new QLabel( mSourceCombo, + label = new TQLabel( mSourceCombo, i18n("Obtain pic&ture from:"), this ); label->setEnabled( false ); // since !mEnableCheck->isChecked() hlay->addWidget( label ); hlay->addWidget( mSourceCombo, 1 ); // widget stack that is controlled by the source combo: - QWidgetStack * widgetStack = new QWidgetStack( this ); + TQWidgetStack * widgetStack = new TQWidgetStack( this ); widgetStack->setEnabled( false ); // since !mEnableCheck->isChecked() vlay->addWidget( widgetStack, 1 ); - connect( mSourceCombo, SIGNAL(highlighted(int)), - widgetStack, SLOT(raiseWidget(int)) ); - connect( mEnableCheck, SIGNAL(toggled(bool)), - mSourceCombo, SLOT(setEnabled(bool)) ); - connect( mEnableCheck, SIGNAL(toggled(bool)), - widgetStack, SLOT(setEnabled(bool)) ); - connect( mEnableCheck, SIGNAL(toggled(bool)), - label, SLOT(setEnabled(bool)) ); + connect( mSourceCombo, TQT_SIGNAL(highlighted(int)), + widgetStack, TQT_SLOT(raiseWidget(int)) ); + connect( mEnableCheck, TQT_SIGNAL(toggled(bool)), + mSourceCombo, TQT_SLOT(setEnabled(bool)) ); + connect( mEnableCheck, TQT_SIGNAL(toggled(bool)), + widgetStack, TQT_SLOT(setEnabled(bool)) ); + connect( mEnableCheck, TQT_SIGNAL(toggled(bool)), + label, TQT_SLOT(setEnabled(bool)) ); // The focus might be still in the widget that is disabled - connect( mEnableCheck, SIGNAL(clicked()), - mEnableCheck, SLOT(setFocus()) ); + connect( mEnableCheck, TQT_SIGNAL(clicked()), + mEnableCheck, TQT_SLOT(setFocus()) ); int pageno = 0; // page 0: create X-Face from image file or address book entry - page = new QWidget( widgetStack ); + page = new TQWidget( widgetStack ); widgetStack->addWidget( page, pageno ); // force sequential numbers (play safe) - page_vlay = new QVBoxLayout( page, 0, KDialog::spacingHint() ); - hlay = new QHBoxLayout( page_vlay ); // inherits spacing - mFromFileBtn = new QPushButton( i18n("Select File..."), page ); - QWhatsThis::add( mFromFileBtn, + page_vlay = new TQVBoxLayout( page, 0, KDialog::spacingHint() ); + hlay = new TQHBoxLayout( page_vlay ); // inherits spacing + mFromFileBtn = new TQPushButton( i18n("Select File..."), page ); + TQWhatsThis::add( mFromFileBtn, i18n("Use this to select an image file to create the picture from. " "The image should be of high contrast and nearly quadratic shape. " "A light background helps improve the result." ) ); mFromFileBtn->setAutoDefault( false ); page_vlay->addWidget( mFromFileBtn, 1 ); - connect( mFromFileBtn, SIGNAL(released()), - this, SLOT(slotSelectFile()) ); - mFromAddrbkBtn = new QPushButton( i18n("Set From Address Book"), page ); - QWhatsThis::add( mFromAddrbkBtn, + connect( mFromFileBtn, TQT_SIGNAL(released()), + this, TQT_SLOT(slotSelectFile()) ); + mFromAddrbkBtn = new TQPushButton( i18n("Set From Address Book"), page ); + TQWhatsThis::add( mFromAddrbkBtn, i18n( "You can use a scaled-down version of the picture " "you have set in your address book entry." ) ); mFromAddrbkBtn->setAutoDefault( false ); page_vlay->addWidget( mFromAddrbkBtn, 1 ); - connect( mFromAddrbkBtn, SIGNAL(released()), - this, SLOT(slotSelectFromAddressbook()) ); - label1 = new QLabel( i18n("<qt>KMail can send a small (48x48 pixels), low-quality, " + connect( mFromAddrbkBtn, TQT_SIGNAL(released()), + this, TQT_SLOT(slotSelectFromAddressbook()) ); + label1 = new TQLabel( i18n("<qt>KMail can send a small (48x48 pixels), low-quality, " "monochrome picture with every message. " "For example, this could be a picture of you or a glyph. " "It is shown in the recipient's mail client (if supported)." ), page ); - label1->setAlignment( QLabel::WordBreak | QLabel::AlignVCenter ); + label1->setAlignment( TQLabel::WordBreak | TQLabel::AlignVCenter ); page_vlay->addWidget( label1 ); widgetStack->raiseWidget( 0 ); // since mSourceCombo->currentItem() == 0 // page 1: input field for direct entering ++pageno; - page = new QWidget( widgetStack ); + page = new TQWidget( widgetStack ); widgetStack->addWidget( page, pageno ); - page_vlay = new QVBoxLayout( page, 0, KDialog::spacingHint() ); - mTextEdit = new QTextEdit( page ); + page_vlay = new TQVBoxLayout( page, 0, KDialog::spacingHint() ); + mTextEdit = new TQTextEdit( page ); page_vlay->addWidget( mTextEdit ); - QWhatsThis::add( mTextEdit, i18n( "Use this field to enter an arbitrary X-Face string." ) ); + TQWhatsThis::add( mTextEdit, i18n( "Use this field to enter an arbitrary X-Face string." ) ); mTextEdit->setFont( KGlobalSettings::fixedFont() ); - mTextEdit->setWrapPolicy( QTextEdit::Anywhere ); + mTextEdit->setWrapPolicy( TQTextEdit::Anywhere ); mTextEdit->setTextFormat( Qt::PlainText ); label2 = new KActiveLabel( i18n("Examples are available at <a href=\"http://www.xs4all.nl/~ace/X-Faces/\">http://www.xs4all.nl/~ace/X-Faces/</a>."), page ); page_vlay->addWidget( label2 ); - connect(mTextEdit, SIGNAL(textChanged()), this, SLOT(slotUpdateXFace())); + connect(mTextEdit, TQT_SIGNAL(textChanged()), this, TQT_SLOT(slotUpdateXFace())); } XFaceConfigurator::~XFaceConfigurator() { @@ -200,21 +200,21 @@ namespace KMail { mEnableCheck->setChecked( enable ); } - QString XFaceConfigurator::xface() const { + TQString XFaceConfigurator::xface() const { return mTextEdit->text(); } - void XFaceConfigurator::setXFace( const QString & text ) { + void XFaceConfigurator::setXFace( const TQString & text ) { mTextEdit->setText( text ); } void XFaceConfigurator::setXfaceFromFile( const KURL &url ) { - QString tmpFile; + TQString tmpFile; if( KIO::NetAccess::download( url, tmpFile, this ) ) { KXFace xf; - mTextEdit->setText( xf.fromImage( QImage( tmpFile ) ) ); + mTextEdit->setText( xf.fromImage( TQImage( tmpFile ) ) ); KIO::NetAccess::removeTempFile( tmpFile ); } else { KMessageBox::error(this, KIO::NetAccess::lastErrorString() ); @@ -223,9 +223,9 @@ namespace KMail { void XFaceConfigurator::slotSelectFile() { - QStringList mimeTypes = KImageIO::mimeTypes (KImageIO::Reading); - QString filter = mimeTypes.join (" "); - KURL url = KFileDialog::getOpenURL( QString::null, filter, this, QString::null ); + TQStringList mimeTypes = KImageIO::mimeTypes (KImageIO::Reading); + TQString filter = mimeTypes.join (" "); + KURL url = KFileDialog::getOpenURL( TQString::null, filter, this, TQString::null ); if ( !url.isEmpty() ) setXfaceFromFile( url ); } @@ -238,7 +238,7 @@ namespace KMail { { if ( me.photo().isIntern() ) { - QImage photo = me.photo().data(); + TQImage photo = me.photo().data(); if ( !photo.isNull() ) { KXFace xf; @@ -263,7 +263,7 @@ namespace KMail { void XFaceConfigurator::slotUpdateXFace() { - QString str = mTextEdit->text(); + TQString str = mTextEdit->text(); if ( !str.isEmpty() ) { if ( str.startsWith("x-face:", false) ) @@ -272,7 +272,7 @@ namespace KMail { mTextEdit->setText(str); } KXFace xf; - QPixmap p( 48, 48, true ); + TQPixmap p( 48, 48, true ); p.convertFromImage( xf.toImage(str) ); mXFaceLabel->setPixmap( p ); } |