From 7be55ffa061c026e35e2d6a0effe1161ddb0d41f Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:53:50 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kmail/customtemplates.cpp | 106 +++++++++++++++++++++++----------------------- 1 file changed, 53 insertions(+), 53 deletions(-) (limited to 'kmail/customtemplates.cpp') diff --git a/kmail/customtemplates.cpp b/kmail/customtemplates.cpp index 4030862c8..93b24e8f7 100644 --- a/kmail/customtemplates.cpp +++ b/kmail/customtemplates.cpp @@ -22,18 +22,18 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include -#include +#include #include #include #include #include -#include +#include #include #include #include @@ -47,10 +47,10 @@ #include "customtemplates.h" -CustomTemplates::CustomTemplates( QWidget *parent, const char *name ) +CustomTemplates::CustomTemplates( TQWidget *parent, const char *name ) :CustomTemplatesBase( parent, name ), mCurrentItem( 0 ) { - QFont f = KGlobalSettings::fixedFont(); + TQFont f = KGlobalSettings::fixedFont(); mEdit->setFont( f ); mAdd->setIconSet( BarIconSet( "add", KIcon::SizeSmall ) ); @@ -61,35 +61,35 @@ CustomTemplates::CustomTemplates( QWidget *parent, const char *name ) mEditFrame->setEnabled( false ); - connect( mEdit, SIGNAL( textChanged() ), - this, SLOT( slotTextChanged( void ) ) ); + connect( mEdit, TQT_SIGNAL( textChanged() ), + this, TQT_SLOT( slotTextChanged( void ) ) ); - connect( mInsertCommand, SIGNAL( insertCommand(QString, int) ), - this, SLOT( slotInsertCommand(QString, int) ) ); + connect( mInsertCommand, TQT_SIGNAL( insertCommand(TQString, int) ), + this, TQT_SLOT( slotInsertCommand(TQString, int) ) ); - connect( mAdd, SIGNAL( clicked() ), - this, SLOT( slotAddClicked() ) ); - connect( mRemove, SIGNAL( clicked() ), - this, SLOT( slotRemoveClicked() ) ); - connect( mList, SIGNAL( selectionChanged() ), - this, SLOT( slotListSelectionChanged() ) ); - connect( mType, SIGNAL( activated( int ) ), - this, SLOT( slotTypeActivated( int ) ) ); + connect( mAdd, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( slotAddClicked() ) ); + connect( mRemove, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( slotRemoveClicked() ) ); + connect( mList, TQT_SIGNAL( selectionChanged() ), + this, TQT_SLOT( slotListSelectionChanged() ) ); + connect( mType, TQT_SIGNAL( activated( int ) ), + this, TQT_SLOT( slotTypeActivated( int ) ) ); - connect( mKeyButton, SIGNAL( capturedShortcut( const KShortcut& ) ), - this, SLOT( slotShortcutCaptured( const KShortcut& ) ) ); + connect( mKeyButton, TQT_SIGNAL( capturedShortcut( const KShortcut& ) ), + this, TQT_SLOT( slotShortcutCaptured( const KShortcut& ) ) ); mReplyPix = KIconLoader().loadIcon( "mail_reply", KIcon::Small ); mReplyAllPix = KIconLoader().loadIcon( "mail_replyall", KIcon::Small ); mForwardPix = KIconLoader().loadIcon( "mail_forward", KIcon::Small ); mType->clear(); - mType->insertItem( QPixmap(), i18n( "Message->", "Universal" ), TUniversal ); + mType->insertItem( TQPixmap(), i18n( "Message->", "Universal" ), TUniversal ); mType->insertItem( mReplyPix, i18n( "Message->", "Reply" ), TReply ); mType->insertItem( mReplyAllPix, i18n( "Message->", "Reply to All" ), TReplyAll ); mType->insertItem( mForwardPix, i18n( "Message->", "Forward" ), TForward ); - QString help = + TQString help = i18n( "" "

Here you can add, edit, and delete custom message " "templates to use when you compose a reply or forwarding message. " @@ -109,7 +109,7 @@ CustomTemplates::CustomTemplates( QWidget *parent, const char *name ) CustomTemplates::~CustomTemplates() { - QDictIterator it(mItemList); + TQDictIterator it(mItemList); for ( ; it.current() ; ++it ) { CustomTemplateItem *vitem = mItemList.take( it.currentKey() ); if ( vitem ) { @@ -118,9 +118,9 @@ CustomTemplates::~CustomTemplates() } } -QString CustomTemplates::indexToType( int index ) +TQString CustomTemplates::indexToType( int index ) { - QString typeStr; + TQString typeStr; switch ( index ) { case TUniversal: // typeStr = i18n( "Any" ); break; @@ -146,18 +146,18 @@ void CustomTemplates::slotTextChanged() void CustomTemplates::load() { - QStringList list = GlobalSettings::self()->customTemplates(); - for ( QStringList::iterator it = list.begin(); it != list.end(); ++it ) { + TQStringList list = GlobalSettings::self()->customTemplates(); + for ( TQStringList::iterator it = list.begin(); it != list.end(); ++it ) { CTemplates t(*it); - // QString typeStr = indexToType( t.type() ); - QString typeStr; + // TQString typeStr = indexToType( t.type() ); + TQString typeStr; KShortcut shortcut( t.shortcut() ); CustomTemplateItem *vitem = new CustomTemplateItem( *it, t.content(), shortcut, static_cast( t.type() ) ); mItemList.insert( *it, vitem ); - QListViewItem *item = new QListViewItem( mList, typeStr, *it, t.content() ); + TQListViewItem *item = new TQListViewItem( mList, typeStr, *it, t.content() ); switch ( t.type() ) { case TReply: item->setPixmap( 0, mReplyPix ); @@ -169,7 +169,7 @@ void CustomTemplates::load() item->setPixmap( 0, mForwardPix ); break; default: - item->setPixmap( 0, QPixmap() ); + item->setPixmap( 0, TQPixmap() ); item->setText( 0, indexToType( t.type() ) ); break; }; @@ -185,17 +185,17 @@ void CustomTemplates::save() vitem->mShortcut = mKeyButton->shortcut(); } } - QStringList list; - QListViewItemIterator lit( mList ); + TQStringList list; + TQListViewItemIterator lit( mList ); while ( lit.current() ) { list.append( (*lit)->text( 1 ) ); ++lit; } - QDictIterator it( mItemList ); + TQDictIterator it( mItemList ); for ( ; it.current() ; ++it ) { // list.append( (*it)->mName ); CTemplates t( (*it)->mName ); - QString &content = (*it)->mContent; + TQString &content = (*it)->mContent; if ( content.stripWhiteSpace().isEmpty() ) { content = "%BLANK"; } @@ -212,7 +212,7 @@ void CustomTemplates::save() kmkernel->getKMMainWidget()->updateCustomTemplateMenus(); } -void CustomTemplates::slotInsertCommand( QString cmd, int adjustCursor ) +void CustomTemplates::slotInsertCommand( TQString cmd, int adjustCursor ) { int para, index; mEdit->getCursorPosition( ¶, &index ); @@ -225,14 +225,14 @@ void CustomTemplates::slotInsertCommand( QString cmd, int adjustCursor ) void CustomTemplates::slotAddClicked() { - QString str = mName->text(); + TQString str = mName->text(); if ( !str.isEmpty() ) { CustomTemplateItem *vitem = mItemList[ str ]; if ( !vitem ) { vitem = new CustomTemplateItem( str, "", KShortcut::null(), TUniversal ); mItemList.insert( str, vitem ); - QListViewItem *item = - new QListViewItem( mList, indexToType( TUniversal ), str, "" ); + TQListViewItem *item = + new TQListViewItem( mList, indexToType( TUniversal ), str, "" ); mList->setSelected( item, true ); mKeyButton->setEnabled( false ); emit changed(); @@ -262,22 +262,22 @@ void CustomTemplates::slotListSelectionChanged() vitem->mShortcut = mKeyButton->shortcut(); } } - QListViewItem *item = mList->selectedItem(); + TQListViewItem *item = mList->selectedItem(); if ( item ) { mEditFrame->setEnabled( true ); mCurrentItem = item; CustomTemplateItem *vitem = mItemList[ mCurrentItem->text( 1 ) ]; if ( vitem ) { // avoid emit changed() - disconnect( mEdit, SIGNAL( textChanged() ), - this, SLOT( slotTextChanged( void ) ) ); + disconnect( mEdit, TQT_SIGNAL( textChanged() ), + this, TQT_SLOT( slotTextChanged( void ) ) ); mEdit->setText( vitem->mContent ); mKeyButton->setShortcut( vitem->mShortcut, false ); mType->setCurrentItem( vitem->mType ); - connect( mEdit, SIGNAL( textChanged() ), - this, SLOT( slotTextChanged( void ) ) ); + connect( mEdit, TQT_SIGNAL( textChanged() ), + this, TQT_SLOT( slotTextChanged( void ) ) ); if ( vitem->mType == TUniversal ) { @@ -315,7 +315,7 @@ void CustomTemplates::slotTypeActivated( int index ) mCurrentItem->setPixmap( 0, mForwardPix ); break; default: - mCurrentItem->setPixmap( 0, QPixmap() ); + mCurrentItem->setPixmap( 0, TQPixmap() ); break; }; if ( index == TUniversal ) @@ -338,14 +338,14 @@ void CustomTemplates::slotShortcutCaptured( const KShortcut &shortcut ) bool assign = true; bool customused = false; // check if shortcut is already used for custom templates - QDictIterator it(mItemList); + TQDictIterator it(mItemList); for ( ; it.current() ; ++it ) { if ( !mCurrentItem || (*it)->mName != mCurrentItem->text( 1 ) ) { if ( (*it)->mShortcut == sc ) { - QString title( I18N_NOOP("Key Conflict") ); - QString msg( I18N_NOOP("The selected shortcut is already used " + TQString title( I18N_NOOP("Key Conflict") ); + TQString msg( I18N_NOOP("The selected shortcut is already used " "for another custom template, " "would you still like to continue with the assignment?" ) ); assign = ( KMessageBox::warningYesNo( this, msg, title ) @@ -361,8 +361,8 @@ void CustomTemplates::slotShortcutCaptured( const KShortcut &shortcut ) // check if shortcut is used somewhere else if ( !customused && !sc.isNull() && !( kmkernel->getKMMainWidget()->shortcutIsValid( sc ) ) ) { - QString title( I18N_NOOP("Key Conflict") ); - QString msg( I18N_NOOP("The selected shortcut is already used, " + TQString title( I18N_NOOP("Key Conflict") ); + TQString msg( I18N_NOOP("The selected shortcut is already used, " "would you still like to continue with the assignment?" ) ); assign = ( KMessageBox::warningYesNo( this, msg, title ) == KMessageBox::Yes ); -- cgit v1.2.1