diff options
Diffstat (limited to 'kopete/kopete/chatwindow/krichtexteditpart.cpp')
-rw-r--r-- | kopete/kopete/chatwindow/krichtexteditpart.cpp | 128 |
1 files changed, 64 insertions, 64 deletions
diff --git a/kopete/kopete/chatwindow/krichtexteditpart.cpp b/kopete/kopete/chatwindow/krichtexteditpart.cpp index 001096b9..a08fa7e3 100644 --- a/kopete/kopete/chatwindow/krichtexteditpart.cpp +++ b/kopete/kopete/chatwindow/krichtexteditpart.cpp @@ -6,9 +6,9 @@ #include <kdebug.h> #include <kconfig.h> #include <kdeversion.h> -#include <qapplication.h> -#include <qclipboard.h> -#include <qevent.h> +#include <tqapplication.h> +#include <tqclipboard.h> +#include <tqevent.h> #include <kparts/genericfactory.h> #include <private/qrichtext_p.h> @@ -23,25 +23,25 @@ K_EXPORT_COMPONENT_FACTORY( libkopeterichtexteditpart, KopeteRichTextEditPartFac class KopeteTextEdit : public KTextEdit { public: - KopeteTextEdit( QWidget *parent ) : KTextEdit( parent ) {} + KopeteTextEdit( TQWidget *parent ) : KTextEdit( parent ) {} const QTextCursor * cursor() { return textCursor(); } - bool event(QEvent *event) + bool event(TQEvent *event) { - // don't allow QTextEdit to override accels - if ( event->type() == QEvent::AccelOverride ) - return QWidget::event(event); + // don't allow TQTextEdit to override accels + if ( event->type() == TQEvent::AccelOverride ) + return TQWidget::event(event); else return KTextEdit::event(event); } }; -KopeteRichTextEditPart::KopeteRichTextEditPart( QWidget *wparent, const char *wname, QObject*, const char*, const QStringList& ) +KopeteRichTextEditPart::KopeteRichTextEditPart( TQWidget *wparent, const char *wname, TQObject*, const char*, const TQStringList& ) : KParts::ReadOnlyPart( wparent, wname ? wname : "rich_text_part" ) { KopeteRichTextEditPart::KopeteRichTextEditPart( wparent, wname, false ); } -KopeteRichTextEditPart::KopeteRichTextEditPart( QWidget *parent, const char *name, int capabilities ) +KopeteRichTextEditPart::KopeteRichTextEditPart( TQWidget *parent, const char *name, int capabilities ) : KParts::ReadOnlyPart( parent, name ? name : "rich_text_part" ), m_capabilities( capabilities ), m_richTextEnabled( true ) @@ -127,86 +127,86 @@ void KopeteRichTextEditPart::createActions( KActionCollection *ac ) enableRichText = new KToggleAction(i18n("Enable &Rich Text"), "pencil", 0, ac, "enableRichText" ); enableRichText->setCheckedState(i18n("Disable &Rich Text")); - connect( enableRichText, SIGNAL( toggled(bool) ), - this, SLOT( slotSetRichTextEnabled(bool) ) ); + connect( enableRichText, TQT_SIGNAL( toggled(bool) ), + this, TQT_SLOT( slotSetRichTextEnabled(bool) ) ); checkSpelling = new KAction( i18n("Check &Spelling"), "spellcheck", 0, - editor, SLOT( checkSpelling() ), ac, "check_spelling" ); + editor, TQT_SLOT( checkSpelling() ), ac, "check_spelling" ); //Fg Color actionFgColor = new KAction( i18n("Text &Color..."), "color_line", 0, - this, SLOT( setFgColor() ), + this, TQT_SLOT( setFgColor() ), ac, "format_color" ); //BG Color actionBgColor = new KAction( i18n("Background Co&lor..."), "color_fill", 0, - this, SLOT( setBgColor() ), + this, TQT_SLOT( setBgColor() ), ac, "format_bgcolor" ); //Font Family action_font = new KFontAction( i18n("&Font"), 0, ac, "format_font" ); - connect( action_font, SIGNAL( activated( const QString & ) ), - this, SLOT( setFont( const QString & ) ) ); + connect( action_font, TQT_SIGNAL( activated( const TQString & ) ), + this, TQT_SLOT( setFont( const TQString & ) ) ); //Font Size action_font_size = new KFontSizeAction( i18n("Font &Size"), 0, ac, "format_font_size" ); - connect( action_font_size, SIGNAL( fontSizeChanged(int) ), - this, SLOT( setFontSize(int) ) ); + connect( action_font_size, TQT_SIGNAL( fontSizeChanged(int) ), + this, TQT_SLOT( setFontSize(int) ) ); //Formatting action_bold = new KToggleAction( i18n("&Bold"), "text_bold", CTRL+Key_B, ac, "format_bold" ); - connect( action_bold, SIGNAL( toggled(bool) ), - this, SLOT( setBold(bool) ) ); + connect( action_bold, TQT_SIGNAL( toggled(bool) ), + this, TQT_SLOT( setBold(bool) ) ); action_italic = new KToggleAction( i18n("&Italic"), "text_italic", CTRL+Key_I, ac, "format_italic" ); - connect( action_italic, SIGNAL( toggled(bool) ), - this, SLOT( setItalic(bool) ) ); + connect( action_italic, TQT_SIGNAL( toggled(bool) ), + this, TQT_SLOT( setItalic(bool) ) ); action_underline = new KToggleAction( i18n("&Underline"), "text_under", CTRL+Key_U, ac, "format_underline" ); - connect( action_underline, SIGNAL( toggled(bool) ), - this, SLOT( setUnderline(bool) ) ); + connect( action_underline, TQT_SIGNAL( toggled(bool) ), + this, TQT_SLOT( setUnderline(bool) ) ); - connect( editor, SIGNAL( currentFontChanged( const QFont & ) ), - this, SLOT( updateCharFmt() ) ); + connect( editor, TQT_SIGNAL( currentFontChanged( const TQFont & ) ), + this, TQT_SLOT( updateCharFmt() ) ); updateCharFmt(); - connect( editor, SIGNAL( currentFontChanged( const QFont & ) ), - this, SLOT( updateFont() ) ); + connect( editor, TQT_SIGNAL( currentFontChanged( const TQFont & ) ), + this, TQT_SLOT( updateFont() ) ); updateFont(); //Alignment action_align_left = new KToggleAction( i18n("Align &Left"), "text_left", 0, ac, "format_align_left" ); - connect( action_align_left, SIGNAL( toggled(bool) ), - this, SLOT( setAlignLeft(bool) ) ); + connect( action_align_left, TQT_SIGNAL( toggled(bool) ), + this, TQT_SLOT( setAlignLeft(bool) ) ); action_align_center = new KToggleAction( i18n("Align &Center"), "text_center", 0, ac, "format_align_center" ); - connect( action_align_center, SIGNAL( toggled(bool) ), - this, SLOT( setAlignCenter(bool) ) ); + connect( action_align_center, TQT_SIGNAL( toggled(bool) ), + this, TQT_SLOT( setAlignCenter(bool) ) ); action_align_right = new KToggleAction( i18n("Align &Right"), "text_right", 0, ac, "format_align_right" ); - connect( action_align_right, SIGNAL( toggled(bool) ), - this, SLOT( setAlignRight(bool) ) ); + connect( action_align_right, TQT_SIGNAL( toggled(bool) ), + this, TQT_SLOT( setAlignRight(bool) ) ); action_align_justify = new KToggleAction( i18n("&Justify"), "text_block", 0, ac, "format_align_justify" ); - connect( action_align_justify, SIGNAL( toggled(bool) ), - this, SLOT( setAlignJustify(bool) ) ); + connect( action_align_justify, TQT_SIGNAL( toggled(bool) ), + this, TQT_SLOT( setAlignJustify(bool) ) ); action_align_left->setExclusiveGroup( "alignment" ); action_align_center->setExclusiveGroup( "alignment" ); action_align_right->setExclusiveGroup( "alignment" ); action_align_justify->setExclusiveGroup( "alignment" ); - connect( editor, SIGNAL( cursorPositionChanged( int,int ) ), - this, SLOT( updateAligment() ) ); + connect( editor, TQT_SIGNAL( cursorPositionChanged( int,int ) ), + this, TQT_SLOT( updateAligment() ) ); updateAligment(); } @@ -248,7 +248,7 @@ void KopeteRichTextEditPart::updateCharFmt() void KopeteRichTextEditPart::clear() { - editor->setText( QString::null ); + editor->setText( TQString::null ); setFont( mFont ); setFgColor( mFgColor ); @@ -303,13 +303,13 @@ void KopeteRichTextEditPart::readConfig() KConfig *config = KGlobal::config(); config->setGroup("RichTextEditor"); - QColor tmpColor = KGlobalSettings::textColor(); + TQColor tmpColor = KGlobalSettings::textColor(); setFgColor( config->readColorEntry("FgColor", &tmpColor ) ); tmpColor = KGlobalSettings::baseColor(); setBgColor( config->readColorEntry("BgColor", &tmpColor ) ); - QFont tmpFont = KopetePrefs::prefs()->fontFace(); + TQFont tmpFont = KopetePrefs::prefs()->fontFace(); setFont( config->readFontEntry("Font", &tmpFont ) ); int tmp = KGlobalSettings::generalFont().pixelSize(); @@ -357,12 +357,12 @@ void KopeteRichTextEditPart::writeConfig() void KopeteRichTextEditPart::setFgColor() { - QColor col=editor->color(); + TQColor col=editor->color(); int s = KColorDialog::getColor( col, KGlobalSettings::textColor() , editor ); if(!col.isValid()) col= KGlobalSettings::textColor() ; - if ( s != QDialog::Accepted ) + if ( s != TQDialog::Accepted ) return; setFgColor( col ); @@ -370,17 +370,17 @@ void KopeteRichTextEditPart::setFgColor() writeConfig(); } -void KopeteRichTextEditPart::setFgColor( const QColor &newColor ) +void KopeteRichTextEditPart::setFgColor( const TQColor &newColor ) { mFgColor = newColor; if( !(m_capabilities & Kopete::Protocol::RichColor) ) { - QPalette pal = editor->palette(); - pal.setColor(QPalette::Active, QColorGroup::Text, mFgColor ); - pal.setColor(QPalette::Inactive, QColorGroup::Text, mFgColor ); + TQPalette pal = editor->palette(); + pal.setColor(TQPalette::Active, TQColorGroup::Text, mFgColor ); + pal.setColor(TQPalette::Inactive, TQColorGroup::Text, mFgColor ); - if ( pal == QApplication::palette( editor ) ) + if ( pal == TQApplication::palette( editor ) ) editor->unsetPalette(); else editor->setPalette(pal); @@ -389,16 +389,16 @@ void KopeteRichTextEditPart::setFgColor( const QColor &newColor ) editor->setColor( mFgColor ); } -QColor KopeteRichTextEditPart::fgColor() +TQColor KopeteRichTextEditPart::fgColor() { if( mFgColor == KGlobalSettings::textColor()) - return QColor(); + return TQColor(); return mFgColor; } void KopeteRichTextEditPart::setBgColor() { - QColor col=mBgColor; + TQColor col=mBgColor; int s = KColorDialog::getColor( col, KGlobalSettings::baseColor(), editor ); if(!col.isValid()) @@ -406,7 +406,7 @@ void KopeteRichTextEditPart::setBgColor() col=KGlobalSettings::baseColor(); } - if ( s != QDialog::Accepted ) + if ( s != TQDialog::Accepted ) return; setBgColor( col ); @@ -414,25 +414,25 @@ void KopeteRichTextEditPart::setBgColor() writeConfig(); } -void KopeteRichTextEditPart::setBgColor( const QColor &newColor ) +void KopeteRichTextEditPart::setBgColor( const TQColor &newColor ) { mBgColor = newColor; - QPalette pal = editor->palette(); - pal.setColor(QPalette::Active, QColorGroup::Base, mBgColor ); - pal.setColor(QPalette::Inactive, QColorGroup::Base, mBgColor ); - pal.setColor(QPalette::Disabled, QColorGroup::Base, mBgColor ); + TQPalette pal = editor->palette(); + pal.setColor(TQPalette::Active, TQColorGroup::Base, mBgColor ); + pal.setColor(TQPalette::Inactive, TQColorGroup::Base, mBgColor ); + pal.setColor(TQPalette::Disabled, TQColorGroup::Base, mBgColor ); - if ( pal == QApplication::palette( editor ) ) + if ( pal == TQApplication::palette( editor ) ) editor->unsetPalette(); else editor->setPalette(pal); } -QColor KopeteRichTextEditPart::bgColor() +TQColor KopeteRichTextEditPart::bgColor() { if( mBgColor == KGlobalSettings::baseColor()) - return QColor(); + return TQColor(); return mBgColor; } @@ -453,14 +453,14 @@ void KopeteRichTextEditPart::setFont() writeConfig(); } -void KopeteRichTextEditPart::setFont( const QFont &newFont ) +void KopeteRichTextEditPart::setFont( const TQFont &newFont ) { mFont = newFont; editor->setFont(mFont); updateFont(); } -void KopeteRichTextEditPart::setFont( const QString &newFont ) +void KopeteRichTextEditPart::setFont( const TQString &newFont ) { mFont.setFamily( newFont ); if( m_capabilities & Kopete::Protocol::RichFont) @@ -540,7 +540,7 @@ void KopeteRichTextEditPart::setAlignJustify( bool yes ) writeConfig(); } -QString KopeteRichTextEditPart::text( Qt::TextFormat fmt ) const +TQString KopeteRichTextEditPart::text( Qt::TextFormat fmt ) const { if( fmt == editor->textFormat() || fmt != Qt::PlainText ) return editor->text(); |