diff options
Diffstat (limited to 'knode/kncomposer.cpp')
-rw-r--r-- | knode/kncomposer.cpp | 130 |
1 files changed, 65 insertions, 65 deletions
diff --git a/knode/kncomposer.cpp b/knode/kncomposer.cpp index aabb8e669..4e928a495 100644 --- a/knode/kncomposer.cpp +++ b/knode/kncomposer.cpp @@ -63,8 +63,8 @@ using KRecentAddress::RecentAddresses; #include <kstdguiitem.h> KNLineEdit::KNLineEdit(KNComposer::ComposerView *_composerView, bool useCompletion, - TQWidget *parent, const char *name) - : KNLineEditInherited(parent,useCompletion,name) , composerView(_composerView) + TQWidget *tqparent, const char *name) + : KNLineEditInherited(tqparent,useCompletion,name) , composerView(_composerView) { } @@ -131,8 +131,8 @@ void KNLineEdit::keyPressEvent(TQKeyEvent *e) KNLineEditInherited::keyPressEvent(e); } -KNLineEditSpell::KNLineEditSpell( KNComposer::ComposerView *_composerView, bool useCompletion,TQWidget * parent, const char * name) - :KNLineEdit( _composerView, useCompletion, parent,name ) +KNLineEditSpell::KNLineEditSpell( KNComposer::ComposerView *_composerView, bool useCompletion,TQWidget * tqparent, const char * name) + :KNLineEdit( _composerView, useCompletion, tqparent,name ) { } @@ -189,15 +189,15 @@ KNComposer::KNComposer(KNLocalArticle *a, const TQString &text, const TQString & //statusbar KStatusBar *sb=statusBar(); - sb->insertItem(TQString::null, 1,1); // type + sb->insertItem(TQString(), 1,1); // type sb->setItemAlignment (1,AlignLeft | AlignVCenter); - sb->insertItem(TQString::null, 2,1); // charset + sb->insertItem(TQString(), 2,1); // charset sb->setItemAlignment (2,AlignLeft | AlignVCenter); - sb->insertItem(TQString::null, 3,0); // column + sb->insertItem(TQString(), 3,0); // column sb->setItemAlignment (3,AlignCenter | AlignVCenter); - sb->insertItem(TQString::null, 4,0); // column + sb->insertItem(TQString(), 4,0); // column sb->setItemAlignment (4,AlignCenter | AlignVCenter); - sb->insertItem(TQString::null, 5,0); // line + sb->insertItem(TQString(), 5,0); // line sb->setItemAlignment (5,AlignCenter | AlignVCenter); connect(v_iew->e_dit, TQT_SIGNAL(CursorPositionChanged()), TQT_SLOT(slotUpdateCursorPos())); connect(v_iew->e_dit, TQT_SIGNAL(toggle_overwrite_signal()), TQT_SLOT(slotUpdateStatusBar())); @@ -235,8 +235,8 @@ KNComposer::KNComposer(KNLocalArticle *a, const TQString &text, const TQString & KStdAction::selectAll(this, TQT_SLOT(slotSelectAll()), actionCollection()); - KStdAction::find(v_iew->e_dit, TQT_SLOT(slotFind()), actionCollection()); - KStdAction::tqfindNext(v_iew->e_dit, TQT_SLOT(slotSearchAgain()), actionCollection()); + KStdAction::tqfind(v_iew->e_dit, TQT_SLOT(slotFind()), actionCollection()); + KStdAction::findNext(v_iew->e_dit, TQT_SLOT(slotSearchAgain()), actionCollection()); KStdAction::tqreplace(v_iew->e_dit, TQT_SLOT(slotReplace()), actionCollection()); @@ -579,7 +579,7 @@ bool KNComposer::hasValidData() if (groupCount>5) if (!(KMessageBox::warningYesNo( this, i18n("You are crossposting to more than five newsgroups.\nPlease reconsider whether this is really useful\nand remove groups in which your article is off-topic.\nDo you want to re-edit the article or send it anyway?"), - TQString::null, i18n("&Send"),i18n("edit article","&Edit")) == KMessageBox::Yes)) + TQString(), i18n("&Send"),i18n("edit article","&Edit")) == KMessageBox::Yes)) return false; if ( !followUp && groupCount > 2 ) { @@ -588,7 +588,7 @@ bool KNComposer::hasValidData() "Please use the \"Followup-To\" header to direct the replies " "to your article into one group.\n" "Do you want to re-edit the article or send it anyway?"), - TQString::null, i18n("&Send"), i18n("edit article","&Edit"), "missingFollowUpTo" ) + TQString(), i18n("&Send"), i18n("edit article","&Edit"), "missingFollowUpTo" ) != KMessageBox::Yes ) return false; } @@ -600,7 +600,7 @@ bool KNComposer::hasValidData() if (fupCount>5) if (!(KMessageBox::warningYesNo( this, i18n("You are directing replies to more than five newsgroups.\nPlease reconsider whether this is really useful.\nDo you want to re-edit the article or send it anyway?"), - TQString::null, i18n("&Send"),i18n("edit article","&Edit")) == KMessageBox::Yes)) + TQString(), i18n("&Send"),i18n("edit article","&Edit")) == KMessageBox::Yes)) return false; } @@ -658,7 +658,7 @@ bool KNComposer::hasValidData() } if (n_eeds8Bit && (c_harset.lower()=="us-ascii")) { - KMessageBox::sorry(this, i18n("Your message tqcontains characters which are not included\nin the \"us-ascii\" character set; please choose\na suitable character set from the \"Options\" menu.")); + KMessageBox::sorry(this, i18n("Your message contains characters which are not included\nin the \"us-ascii\" character set; please choose\na suitable character set from the \"Options\" menu.")); return false; } @@ -670,7 +670,7 @@ bool KNComposer::hasValidData() if ((textLines>1)&&(notQuoted==1)) { if (hasAttributionLine) if (!(KMessageBox::warningYesNo( this, i18n("Your article seems to consist entirely of quoted text;\ndo you want to re-edit the article or send it anyway?"), - TQString::null, i18n("&Send"),i18n("edit article","&Edit")) == KMessageBox::Yes)) + TQString(), i18n("&Send"),i18n("edit article","&Edit")) == KMessageBox::Yes)) return false; } else { if (notQuoted==0) { @@ -682,20 +682,20 @@ bool KNComposer::hasValidData() if (longLine) if (!(KMessageBox::warningYesNo( this, - i18n("Your article tqcontains lines longer than 80 characters.\n" + i18n("Your article contains lines longer than 80 characters.\n" "Do you want to re-edit the article or send it anyway?"), - TQString::null, i18n("&Send"), + TQString(), i18n("&Send"), i18n("edit article","&Edit")) == KMessageBox::Yes)) return false; if (sigLength>8) { if (!(KMessageBox::warningYesNo( this, i18n("Your signature is more than 8 lines long.\nYou should shorten it to match the widely accepted limit of 4 lines.\nDo you want to re-edit the article or send it anyway?"), - TQString::null, i18n("&Send"),i18n("edit article","&Edit")) == KMessageBox::Yes)) + TQString(), i18n("&Send"),i18n("edit article","&Edit")) == KMessageBox::Yes)) return false; } else if (sigLength>4) KMessageBox::information(this, i18n("Your signature exceeds the widely-accepted limit of 4 lines:\nplease consider shortening your signature;\notherwise, you will probably annoy your readers."), - TQString::null,"longSignatureWarning"); + TQString(),"longSignatureWarning"); // check if article can be signed if ( a_ctPGPsign->isChecked() ) { @@ -721,7 +721,7 @@ bool KNComposer::hasValidData() "in the account properties or in the " "group properties.\n" "The article will be sent unsigned." ), - TQString::null, i18n( "Send Unsigned" ), + TQString(), i18n( "Send Unsigned" ), "sendUnsignedDialog" ) == KMessageBox::Cancel ) return false; @@ -876,7 +876,7 @@ void KNComposer::closeEvent(TQCloseEvent *e) } else { switch ( KMessageBox::warningYesNoCancel( this, i18n("Do you want to save this article in the draft folder?"), - TQString::null, KStdGuiItem::save(), KStdGuiItem::discard())) { + TQString(), KStdGuiItem::save(), KStdGuiItem::discard())) { case KMessageBox::Yes : r_esult=CRsave; break; @@ -900,7 +900,7 @@ void KNComposer::initData(const TQString &text) { //Subject if(a_rticle->subject()->isEmpty()) - slotSubjectChanged(TQString::null); + slotSubjectChanged(TQString()); else v_iew->s_ubject->setText(a_rticle->subject()->asUnicodeString()); @@ -957,7 +957,7 @@ void KNComposer::initData(const TQString &text) } -// inserts at cursor position if clear is false, tqreplaces content otherwise +// inserts at cursor position if clear is false, replaces content otherwise // puts the file content into a box if box==true // "file" is already open for reading void KNComposer::insertFile(TQFile *file, bool clear, bool box, TQString boxTitle) @@ -1165,7 +1165,7 @@ void KNComposer::slotToggleDoMail() if (a_ctDoMail->isChecked()) { if (a_uthorDislikesMailCopies) { if (!(KMessageBox::warningContinueCancel(this, i18n("The poster does not want a mail copy of your reply (Mail-Copies-To: nobody);\nplease respect their request."), - TQString::null, i18n("&Send Copy")) == KMessageBox::Continue)) { + TQString(), i18n("&Send Copy")) == KMessageBox::Continue)) { a_ctDoMail->setChecked(false); //revert return; } @@ -1231,7 +1231,7 @@ void KNComposer::slotToggleWordWrap() void KNComposer::slotUndoRewrap() { - if (KMessageBox::warningContinueCancel( this, i18n("This will tqreplace all text you have written.")) == KMessageBox::Continue) { + if (KMessageBox::warningContinueCancel( this, i18n("This will replace all text you have written.")) == KMessageBox::Continue) { v_iew->e_dit->setText(u_nwraped); slotAppendSig(); } @@ -1422,7 +1422,7 @@ void KNComposer::slotNewToolbarConfig() void KNComposer::slotSubjectChanged(const TQString &t) { - // tqreplace newlines + // replace newlines TQString subject = t; subject.tqreplace( '\n', ' ' ); subject.tqreplace( '\r', ' ' ); @@ -1438,7 +1438,7 @@ void KNComposer::slotSubjectChanged(const TQString &t) void KNComposer::slotGroupsChanged(const TQString &t) { - KQCStringSplitter split; + KTQCStringSplitter split; bool splitOk; TQString currText=v_iew->f_up2->currentText(); @@ -1744,7 +1744,7 @@ KNComposer::ComposerView::ComposerView(KNComposer *composer, const char *n) hdrL->addWidget(l_to, 0,0); hdrL->addWidget(t_o, 0,1); hdrL->addWidget(t_oBtn, 0,2); - connect(t_oBtn, TQT_SIGNAL(clicked()), parent(), TQT_SLOT(slotToBtnClicked())); + connect(t_oBtn, TQT_SIGNAL(clicked()), tqparent(), TQT_SLOT(slotToBtnClicked())); //Newsgroups g_roups=new KNLineEdit(this, false, hdrFrame); @@ -1756,8 +1756,8 @@ KNComposer::ComposerView::ComposerView(KNComposer *composer, const char *n) hdrL->addWidget(g_roups, 1,1); hdrL->addWidget(g_roupsBtn, 1,2); connect(g_roups, TQT_SIGNAL(textChanged(const TQString&)), - parent(), TQT_SLOT(slotGroupsChanged(const TQString&))); - connect(g_roupsBtn, TQT_SIGNAL(clicked()), parent(), TQT_SLOT(slotGroupsBtnClicked())); + tqparent(), TQT_SLOT(slotGroupsChanged(const TQString&))); + connect(g_roupsBtn, TQT_SIGNAL(clicked()), tqparent(), TQT_SLOT(slotGroupsBtnClicked())); //Followup-To f_up2=new KComboBox(true, hdrFrame); @@ -1773,7 +1773,7 @@ KNComposer::ComposerView::ComposerView(KNComposer *composer, const char *n) hdrL->addWidget(l, 3,0); hdrL->addMultiCellWidget(s_ubject, 3,3, 1,2); connect(s_ubject, TQT_SIGNAL(textChanged(const TQString&)), - parent(), TQT_SLOT(slotSubjectChanged(const TQString&))); + tqparent(), TQT_SLOT(slotSubjectChanged(const TQString&))); //Editor e_dit=new Editor(this, composer, main); @@ -1798,13 +1798,13 @@ KNComposer::ComposerView::ComposerView(KNComposer *composer, const char *n) TQVBoxLayout *notL=new TQVBoxLayout(e_dit); notL->addStretch(1); - n_otification=new TQGroupBox(2, Qt::Horizontal, e_dit); + n_otification=new TQGroupBox(2, TQt::Horizontal, e_dit); l=new TQLabel(i18n("You are currently editing the article body\nin an external editor. To continue, you have\nto close the external editor."), n_otification); c_ancelEditorBtn=new TQPushButton(i18n("&Kill External Editor"), n_otification); n_otification->setFrameStyle(TQFrame::Panel | TQFrame::Raised); n_otification->setLineWidth(2); n_otification->hide(); - notL->addWidget(n_otification, 0, Qt::AlignHCenter); + notL->addWidget(n_otification, 0, TQt::AlignHCenter); notL->addStretch(1); //finish GUI @@ -1907,33 +1907,33 @@ void KNComposer::ComposerView::showAttachmentView() //connections connect(a_ttView, TQT_SIGNAL(currentChanged(TQListViewItem*)), - parent(), TQT_SLOT(slotAttachmentSelected(TQListViewItem*))); + tqparent(), TQT_SLOT(slotAttachmentSelected(TQListViewItem*))); connect(a_ttView, TQT_SIGNAL(clicked ( TQListViewItem * )), - parent(), TQT_SLOT(slotAttachmentSelected(TQListViewItem*))); + tqparent(), TQT_SLOT(slotAttachmentSelected(TQListViewItem*))); connect(a_ttView, TQT_SIGNAL(contextMenu(KListView*, TQListViewItem*, const TQPoint&)), - parent(), TQT_SLOT(slotAttachmentPopup(KListView*, TQListViewItem*, const TQPoint&))); + tqparent(), TQT_SLOT(slotAttachmentPopup(KListView*, TQListViewItem*, const TQPoint&))); connect(a_ttView, TQT_SIGNAL(delPressed(TQListViewItem*)), - parent(), TQT_SLOT(slotAttachmentRemove(TQListViewItem*))); + tqparent(), TQT_SLOT(slotAttachmentRemove(TQListViewItem*))); connect(a_ttView, TQT_SIGNAL(doubleClicked(TQListViewItem*)), - parent(), TQT_SLOT(slotAttachmentEdit(TQListViewItem*))); + tqparent(), TQT_SLOT(slotAttachmentEdit(TQListViewItem*))); connect(a_ttView, TQT_SIGNAL(returnPressed(TQListViewItem*)), - parent(), TQT_SLOT(slotAttachmentEdit(TQListViewItem*))); + tqparent(), TQT_SLOT(slotAttachmentEdit(TQListViewItem*))); //buttons a_ttAddBtn=new TQPushButton(i18n("A&dd..."),a_ttWidget); - connect(a_ttAddBtn, TQT_SIGNAL(clicked()), parent(), TQT_SLOT(slotAttachFile())); + connect(a_ttAddBtn, TQT_SIGNAL(clicked()), tqparent(), TQT_SLOT(slotAttachFile())); topL->addWidget(a_ttAddBtn, 0,1); a_ttRemoveBtn=new TQPushButton(i18n("&Remove"), a_ttWidget); a_ttRemoveBtn->setEnabled(false); - connect(a_ttRemoveBtn, TQT_SIGNAL(clicked()), parent(), TQT_SLOT(slotRemoveAttachment())); + connect(a_ttRemoveBtn, TQT_SIGNAL(clicked()), tqparent(), TQT_SLOT(slotRemoveAttachment())); topL->addWidget(a_ttRemoveBtn, 1,1); a_ttEditBtn=new TQPushButton(i18n("&Properties"), a_ttWidget); a_ttEditBtn->setEnabled(false); - connect(a_ttEditBtn, TQT_SIGNAL(clicked()), parent(), TQT_SLOT(slotAttachmentProperties())); - topL->addWidget(a_ttEditBtn, 2,1, Qt::AlignTop); + connect(a_ttEditBtn, TQT_SIGNAL(clicked()), tqparent(), TQT_SLOT(slotAttachmentProperties())); + topL->addWidget(a_ttEditBtn, 2,1, TQt::AlignTop); topL->setRowStretch(2,1); topL->setColStretch(0,1); @@ -1991,8 +1991,8 @@ void KNComposer::ComposerView::hideExternalNotification() //===================================================================================== #include <kcursor.h> -KNComposer::Editor::Editor(KNComposer::ComposerView *_composerView, KNComposer *_composer, TQWidget *parent, char *name) - : KEdit(parent, name), m_composer( _composer ), m_composerView(_composerView) +KNComposer::Editor::Editor(KNComposer::ComposerView *_composerView, KNComposer *_composer, TQWidget *tqparent, char *name) + : KEdit(tqparent, name), m_composer( _composer ), m_composerView(_composerView) { setOverwriteEnabled(true); spell = 0L; @@ -2047,18 +2047,18 @@ bool KNComposer::Editor::eventFilter(TQObject*o, TQEvent* e) { //Get word right clicked on firstSpace = paraText.findRev( m_bound, charPos ) + 1; - lastSpace = paraText.find( m_bound, charPos ); + lastSpace = paraText.tqfind( m_bound, charPos ); if( lastSpace == -1 ) lastSpace = paraText.length(); TQString word = paraText.mid( firstSpace, lastSpace - firstSpace ); //Continue if this word was misspelled - if( !word.isEmpty() && m_tqreplacements.tqcontains( word ) ) + if( !word.isEmpty() && m_replacements.tqcontains( word ) ) { KPopupMenu p; p.insertTitle( i18n("Suggestions") ); //Add the suggestions to the popup menu - TQStringList reps = m_tqreplacements[word]; + TQStringList reps = m_replacements[word]; if( reps.count() > 0 ) { int listPos = 0; @@ -2081,11 +2081,11 @@ bool KNComposer::Editor::eventFilter(TQObject*o, TQEvent* e) int parIdx = 1, txtIdx = 1; getCursorPosition(&parIdx, &txtIdx); setSelection(para, firstSpace, para, lastSpace); - insert(m_tqreplacements[word][id]); + insert(m_replacements[word][id]); // Restore the cursor position; if the cursor was behind the // misspelled word then adjust the cursor position if ( para == parIdx && txtIdx >= lastSpace ) - txtIdx += m_tqreplacements[word][id].length() - word.length(); + txtIdx += m_replacements[word][id].length() - word.length(); setCursorPosition(parIdx, txtIdx); } //Cancel original event @@ -2099,7 +2099,7 @@ bool KNComposer::Editor::eventFilter(TQObject*o, TQEvent* e) void KNComposer::Editor::slotAddSuggestion( const TQString &text, const TQStringList &lst, unsigned int ) { - m_tqreplacements[text] = lst; + m_replacements[text] = lst; } // expand tabs to avoid the "tab-damage", @@ -2137,12 +2137,12 @@ TQStringList KNComposer::Editor::processedText() } } - TQString tqreplacement; + TQString replacement; int tabPos; for (TQStringList::Iterator it = ret.begin(); it != ret.end(); ++it ) { - while ((tabPos=(*it).find('\t'))!=-1) { - tqreplacement.fill(TQChar(' '), 8-(tabPos%8)); - (*it).tqreplace(tabPos, 1, tqreplacement); + while ((tabPos=(*it).tqfind('\t'))!=-1) { + replacement.fill(TQChar(' '), 8-(tabPos%8)); + (*it).tqreplace(tabPos, 1, replacement); } } @@ -2261,7 +2261,7 @@ void KNComposer::Editor::slotRemoveBox() setAutoUpdate(false); - // find & remove box begin + // tqfind & remove box begin int x = l; while ((x>=0)&&(textLine(x).left(5)!=",----")) x--; @@ -2278,7 +2278,7 @@ void KNComposer::Editor::slotRemoveBox() } } - // find & remove box end + // tqfind & remove box end x = l; while ((x<numLines())&&(textLine(x).left(5)!="`----")) x++; @@ -2332,7 +2332,7 @@ void KNComposer::Editor::keyPressEvent ( TQKeyEvent *e) int line, col; getCursorPosition( &line, &col ); TQString lineText = text( line ); - // returns line with additional trailing space (bug in Qt?), cut it off + // returns line with additional trailing space (bug in TQt?), cut it off lineText.truncate( lineText.length() - 1 ); // special treatment of quoted lines only if the cursor is neither at // the begin nor at the end of the line @@ -2490,8 +2490,8 @@ void KNComposer::Editor::slotCorrectWord() //===================================================================================== -KNComposer::AttachmentView::AttachmentView(TQWidget *parent, char *name) - : KListView(parent, name) +KNComposer::AttachmentView::AttachmentView(TQWidget *tqparent, char *name) + : KListView(tqparent, name) { setFrameStyle(TQFrame::WinPanel | TQFrame::Sunken); // match the TQMultiLineEdit style addColumn(i18n("File"), 115); @@ -2560,9 +2560,9 @@ KNComposer::AttachmentPropertiesDlg::AttachmentPropertiesDlg(KNAttachment *a, TQ fileL->addRowSpacing(0, fontMetrics().lineSpacing()-9); fileL->addWidget(new TQLabel(i18n("Name:"), fileGB) ,1,0); - fileL->addWidget(new TQLabel(TQString("<b>%1</b>").arg(a->name()), fileGB), 1,1, Qt::AlignLeft); + fileL->addWidget(new TQLabel(TQString("<b>%1</b>").arg(a->name()), fileGB), 1,1, TQt::AlignLeft); fileL->addWidget(new TQLabel(i18n("Size:"), fileGB), 2,0); - fileL->addWidget(new TQLabel(a->contentSize(), fileGB), 2,1, Qt::AlignLeft); + fileL->addWidget(new TQLabel(a->contentSize(), fileGB), 2,1, TQt::AlignLeft); fileL->setColStretch(1,1); topL->addWidget(fileGB); @@ -2626,11 +2626,11 @@ void KNComposer::AttachmentPropertiesDlg::apply() void KNComposer::AttachmentPropertiesDlg::accept() { - if(m_imeType->text().find('/')==-1) { + if(m_imeType->text().tqfind('/')==-1) { KMessageBox::sorry(this, i18n("You have set an invalid mime-type.\nPlease change it.")); return; } - else if(n_onTextAsText && m_imeType->text().find("text/", 0, false)!=-1 && + else if(n_onTextAsText && m_imeType->text().tqfind("text/", 0, false)!=-1 && KMessageBox::warningContinueCancel(this, i18n("You have changed the mime-type of this non-textual attachment\nto text. This might cause an error while loading or encoding the file.\nProceed?") ) == KMessageBox::Cancel) return; |