diff options
Diffstat (limited to 'konversation/src/topiclabel.cpp')
-rw-r--r-- | konversation/src/topiclabel.cpp | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/konversation/src/topiclabel.cpp b/konversation/src/topiclabel.cpp index b9fdd87..caa8eed 100644 --- a/konversation/src/topiclabel.cpp +++ b/konversation/src/topiclabel.cpp @@ -17,9 +17,9 @@ #include "common.h" #include "channel.h" -#include <qsimplerichtext.h> -#include <qtooltip.h> -#include <qclipboard.h> +#include <tqsimplerichtext.h> +#include <tqtooltip.h> +#include <tqclipboard.h> #include <krun.h> #include <kprocess.h> @@ -37,39 +37,39 @@ namespace Konversation { - TopicLabel::TopicLabel(QWidget *parent, const char *name) + TopicLabel::TopicLabel(TQWidget *parent, const char *name) : KActiveLabel(parent, name) { - setWrapPolicy(QTextEdit::AtWordOrDocumentBoundary); - setFocusPolicy(QWidget::ClickFocus); + setWrapPolicy(TQTextEdit::AtWordOrDocumentBoundary); + setFocusPolicy(TQWidget::ClickFocus); m_isOnChannel = false; m_copyUrlMenu = false; mousePressed=false; - m_popup = new QPopupMenu(this,"topiclabel_context_menu"); + m_popup = new TQPopupMenu(this,"topiclabel_context_menu"); m_popup->insertItem(SmallIconSet("editcopy"),i18n("&Copy"),Copy); m_popup->insertItem(i18n("Select All"),SelectAll); setupChannelPopupMenu(); - connect(this, SIGNAL(highlighted(const QString&)), this, SLOT(highlightedSlot(const QString&))); + connect(this, TQT_SIGNAL(highlighted(const TQString&)), this, TQT_SLOT(highlightedSlot(const TQString&))); } TopicLabel::~TopicLabel() { } - QSize TopicLabel::minimumSizeHint() const + TQSize TopicLabel::minimumSizeHint() const { int minHeight = fontMetrics().lineSpacing() + fontMetrics().descent(); - return QSize(0, minHeight); + return TQSize(0, minHeight); } - QSize TopicLabel::sizeHint() const + TQSize TopicLabel::sizeHint() const { int minHeight = fontMetrics().lineSpacing() + fontMetrics().descent(); - return QSize(0, minHeight); + return TQSize(0, minHeight); } void TopicLabel::setServer(Server* server) @@ -77,9 +77,9 @@ namespace Konversation m_server = server; } - void TopicLabel::contentsMousePressEvent(QMouseEvent *e) + void TopicLabel::contentsMousePressEvent(TQMouseEvent *e) { - if (e->button()==QMouseEvent::LeftButton) + if (e->button()==TQMouseEvent::LeftButton) { pressPosition=e->pos(); urlToDrag = anchorAt(pressPosition); @@ -96,9 +96,9 @@ namespace Konversation KActiveLabel::contentsMousePressEvent(e); } - void TopicLabel::contentsMouseReleaseEvent(QMouseEvent *e) + void TopicLabel::contentsMouseReleaseEvent(TQMouseEvent *e) { - if (e->button()==QMouseEvent::LeftButton) + if (e->button()==TQMouseEvent::LeftButton) { if (mousePressed) openLink(urlToDrag); mousePressed=false; @@ -106,15 +106,15 @@ namespace Konversation KActiveLabel::contentsMouseReleaseEvent(e); } - void TopicLabel::contentsMouseMoveEvent(QMouseEvent *e) + void TopicLabel::contentsMouseMoveEvent(TQMouseEvent *e) { - if (mousePressed && (pressPosition-e->pos()).manhattanLength() > QApplication::startDragDistance()) + if (mousePressed && (pressPosition-e->pos()).manhattanLength() > TQApplication::startDragDistance()) { mousePressed=false; removeSelection(); KURL ux = KURL::fromPathOrURL(urlToDrag); //FIXME consistent IRC URL serialization - if (urlToDrag.startsWith("##")) ux=QString("irc://%1:%2/%3").arg(m_server->getServerName()). + if (urlToDrag.startsWith("##")) ux=TQString("irc://%1:%2/%3").arg(m_server->getServerName()). arg(m_server->getPort()).arg(urlToDrag.mid(2)); KURLDrag* u=new KURLDrag(ux,viewport()); u->drag(); @@ -122,13 +122,13 @@ namespace Konversation KActiveLabel::contentsMouseMoveEvent(e); } - void TopicLabel::leaveEvent(QEvent*) + void TopicLabel::leaveEvent(TQEvent*) { emit clearStatusBarTempText(); - m_lastStatusText = QString(); + m_lastStatusText = TQString(); } - void TopicLabel::openLink(const QString& link) + void TopicLabel::openLink(const TQString& link) { if (!link.isEmpty()) { @@ -139,7 +139,7 @@ namespace Konversation } else if (link.startsWith("#") && m_server && m_server->isConnected()) { - QString channel(link); + TQString channel(link); channel.replace("##","#"); m_server->sendJoinCommand(channel); } @@ -150,10 +150,10 @@ namespace Konversation } else { - QString cmd = Preferences::webBrowserCmd(); + TQString cmd = Preferences::webBrowserCmd(); cmd.replace("%u",KURL::fromPathOrURL(link).url()); KProcess *proc = new KProcess; - QStringList cmdAndArgs = KShell::splitArgs(cmd); + TQStringList cmdAndArgs = KShell::splitArgs(cmd); *proc << cmdAndArgs; // This code will also work, but starts an extra shell process. // kdDebug() << "IRCView::linkClickSlot(): cmd = " << cmd << endl; @@ -165,7 +165,7 @@ namespace Konversation } } - void TopicLabel::contentsContextMenuEvent(QContextMenuEvent* ev) + void TopicLabel::contentsContextMenuEvent(TQContextMenuEvent* ev) { bool block = contextMenu(ev); @@ -175,7 +175,7 @@ namespace Konversation } } - bool TopicLabel::contextMenu(QContextMenuEvent* ce) + bool TopicLabel::contextMenu(TQContextMenuEvent* ce) { if (m_isOnChannel) { @@ -210,7 +210,7 @@ namespace Konversation case Bookmark: { KBookmarkManager* bm = KBookmarkManager::userBookmarksManager(); - KBookmarkGroup bg = bm->addBookmarkDialog(m_urlToCopy, QString()); + KBookmarkGroup bg = bm->addBookmarkDialog(m_urlToCopy, TQString()); bm->save(); bm->emitChanged(bg); break; @@ -230,10 +230,10 @@ namespace Konversation m_channelPopup->insertItem(i18n("Get &user list"),Konversation::Names); m_channelPopup->insertItem(i18n("Get &topic"),Konversation::Topic); - connect(m_channelPopup, SIGNAL(activated(int)), this, SIGNAL(popupCommand(int))); + connect(m_channelPopup, TQT_SIGNAL(activated(int)), this, TQT_SIGNAL(popupCommand(int))); } - void TopicLabel::setText(const QString& text) + void TopicLabel::setText(const TQString& text) { m_fullText = text; updateSqueezedText(); @@ -241,17 +241,17 @@ namespace Konversation void TopicLabel::updateSqueezedText() { - QToolTip::remove(this); + TQToolTip::remove(this); if (m_fullText.isEmpty()) { - KActiveLabel::setText(QString::null); + KActiveLabel::setText(TQString::null); return; } - QFontMetrics fm(currentFont()); - QString text = m_fullText; + TQFontMetrics fm(currentFont()); + TQString text = m_fullText; // text.replace("&", "&"). Not needed as we do it in tagURLs text.replace("<", "\x0blt;"). // tagUrls will replace \x0b with & replace(">", "\x0bgt;"); @@ -261,7 +261,7 @@ namespace Konversation { text = rPixelSqueeze(text, visibleWidth() - 10); setWordWrap(NoWrap); - QToolTip::add(this, "<qt>" + QStyleSheet::escape(m_fullText) + "</qt>"); + TQToolTip::add(this, "<qt>" + TQStyleSheet::escape(m_fullText) + "</qt>"); } else { @@ -269,27 +269,27 @@ namespace Konversation if(height() < contentsHeight()) { - QToolTip::add(this, "<qt>" + QStyleSheet::escape(m_fullText) + "</qt>"); + TQToolTip::add(this, "<qt>" + TQStyleSheet::escape(m_fullText) + "</qt>"); } } KActiveLabel::setText("<qt>" + text + "</qt>"); } - void TopicLabel::resizeEvent(QResizeEvent* ev) + void TopicLabel::resizeEvent(TQResizeEvent* ev) { KActiveLabel::resizeEvent(ev); updateSqueezedText(); } - QString TopicLabel::rPixelSqueeze(const QString& text, uint maxPixels) + TQString TopicLabel::rPixelSqueeze(const TQString& text, uint maxPixels) { - QFontMetrics fm(currentFont()); + TQFontMetrics fm(currentFont()); uint tw = textWidth(text, fm); if(tw > maxPixels) { - QString tmp = text; + TQString tmp = text; const uint em = fm.maxWidth(); maxPixels -= fm.width("..."); int len, delta; @@ -310,17 +310,17 @@ namespace Konversation return text; } - uint TopicLabel::textWidth(const QString& text, const QFontMetrics& fm) + uint TopicLabel::textWidth(const TQString& text, const TQFontMetrics& fm) { - QSimpleRichText richText("<qt>" + text + "</qt>", currentFont()); + TQSimpleRichText richText("<qt>" + text + "</qt>", currentFont()); richText.setWidth(fm.width(text)); return richText.widthUsed(); } - void TopicLabel::highlightedSlot(const QString& _link) + void TopicLabel::highlightedSlot(const TQString& _link) { - QString link = KURL::fromPathOrURL(_link).url(); + TQString link = KURL::fromPathOrURL(_link).url(); //we just saw this a second ago. no need to reemit. if (link == m_lastStatusText && !link.isEmpty()) return; @@ -333,7 +333,7 @@ namespace Konversation if (!m_lastStatusText.isEmpty()) { emit clearStatusBarTempText(); - m_lastStatusText = QString(); + m_lastStatusText = TQString(); } } else { m_lastStatusText = link; @@ -367,7 +367,7 @@ namespace Konversation emit currentChannelChanged(m_currentChannel); - QString prettyId = m_currentChannel; + TQString prettyId = m_currentChannel; if (prettyId.length()>15) { |