summaryrefslogtreecommitdiffstats
path: root/src/modules/list
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-28 18:31:12 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-28 18:31:12 +0000
commit0a80cfd57d271dd44221467efb426675fa470356 (patch)
tree6f503a31aa078eaf8fa015cf1749808529d49fc9 /src/modules/list
parent3329e5a804e28ef3f5eb51d1e7affdd5a508e8f2 (diff)
downloadkvirc-0a80cfd57d271dd44221467efb426675fa470356.tar.gz
kvirc-0a80cfd57d271dd44221467efb426675fa470356.zip
TQt4 port kvirc
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kvirc@1238719 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/modules/list')
-rw-r--r--src/modules/list/libkvilist.cpp2
-rw-r--r--src/modules/list/listwindow.cpp126
-rw-r--r--src/modules/list/listwindow.h47
3 files changed, 88 insertions, 87 deletions
diff --git a/src/modules/list/libkvilist.cpp b/src/modules/list/libkvilist.cpp
index 7920934d..744d079b 100644
--- a/src/modules/list/libkvilist.cpp
+++ b/src/modules/list/libkvilist.cpp
@@ -29,7 +29,7 @@
#include "kvi_window.h"
#include "kvi_locale.h"
-#include <qsplitter.h>
+#include <tqsplitter.h>
KviPointerList<KviListWindow> * g_pListWindowList = 0;
diff --git a/src/modules/list/listwindow.cpp b/src/modules/list/listwindow.cpp
index 2e1c5401..57fb170f 100644
--- a/src/modules/list/listwindow.cpp
+++ b/src/modules/list/listwindow.cpp
@@ -44,12 +44,12 @@
#include "kvi_filedialog.h"
#include "kvi_styled_controls.h"
-#include <qtimer.h>
-#include <qpainter.h>
-#include <qfontmetrics.h>
-#include <qsplitter.h>
-#include <qtooltip.h>
-#include <qdatetime.h>
+#include <tqtimer.h>
+#include <tqpainter.h>
+#include <tqfontmetrics.h>
+#include <tqsplitter.h>
+#include <tqtooltip.h>
+#include <tqdatetime.h>
#include "kvi_tal_hbox.h"
#include "kvi_msgbox.h"
@@ -59,7 +59,7 @@ extern KviPointerList<KviListWindow> * g_pListWindowList;
//extern KVIRC_API const char * getColorBytes(const char *data_ptr,unsigned char *byte_1,unsigned char *byte_2);
-KviChannelListViewItemData::KviChannelListViewItemData(const QString &szChan,const QString &szUsers,const QString &szTopic)
+KviChannelListViewItemData::KviChannelListViewItemData(const TQString &szChan,const TQString &szUsers,const TQString &szTopic)
{
m_szChan = szChan;
m_szUsers = szUsers;
@@ -87,13 +87,13 @@ KviChannelListViewItem::~KviChannelListViewItem()
delete m_pData;
}
#ifdef COMPILE_USE_QT4
-int KviChannelListViewItem::width ( const QFontMetrics & fm, const KviTalListView * lv, int column ) const
+int KviChannelListViewItem::width ( const TQFontMetrics & fm, const KviTalListView * lv, int column ) const
#else
-int KviChannelListViewItem::width ( const QFontMetrics & fm, const QListView * lv, int column ) const
+int KviChannelListViewItem::width ( const TQFontMetrics & fm, const TQListView * lv, int column ) const
#endif
{
debug("width request");
- QString szText;
+ TQString szText;
switch(column)
{
@@ -108,9 +108,9 @@ int KviChannelListViewItem::width ( const QFontMetrics & fm, const QListView * l
#define KVI_LABEL_DEF_BACK 100
#define KVI_LABEL_DEF_FORE 101
-void KviChannelListViewItem::paintCell(QPainter * p,const QColorGroup &cg,int column,int width,int align)
+void KviChannelListViewItem::paintCell(TQPainter * p,const TQColorGroup &cg,int column,int width,int align)
{
- QString szText;
+ TQString szText;
switch(column)
{
@@ -127,7 +127,7 @@ void KviChannelListViewItem::paintCell(QPainter * p,const QColorGroup &cg,int co
p->fillRect( 0, 0, width, height(), cg.brush(lv->viewport()->backgroundRole()) );
#else
- const QColorGroup::ColorRole crole = QPalette::backgroundRoleFromMode(lv->viewport()->backgroundMode());
+ const TQColorGroup::ColorRole crole = TQPalette::backgroundRoleFromMode(lv->viewport()->backgroundMode());
p->fillRect( 0, 0, width, height(), cg.brush( crole ) );
#endif
@@ -135,23 +135,23 @@ void KviChannelListViewItem::paintCell(QPainter * p,const QColorGroup &cg,int co
if ( isSelected() &&
(column == 0 || lv->allColumnsShowFocus()) ) {
p->fillRect( r - marg, 0, width - r + marg, height(),
- cg.brush( QColorGroup::Highlight ) );
+ cg.brush( TQColorGroup::Highlight ) );
if ( isEnabled() || !lv )
p->setPen( cg.highlightedText() );
else if ( !isEnabled() && lv)
- p->setPen( lv->palette().disabled().highlightedText() );
+ p->setPen( lv->tqpalette().disabled().highlightedText() );
} else {
if ( isEnabled() || !lv )
p->setPen( cg.text() );
else if ( !isEnabled() && lv)
- p->setPen( lv->palette().disabled().text() );
+ p->setPen( lv->tqpalette().disabled().text() );
}
KviTopicWidget::paintColoredText(p,szText,cg,height(),width);
}
-QString KviChannelListViewItem::key(int col,bool) const
+TQString KviChannelListViewItem::key(int col,bool) const
{
switch(col)
{
@@ -165,7 +165,7 @@ QString KviChannelListViewItem::key(int col,bool) const
return m_pData->m_szTopic;
break;
}
- QString ret;
+ TQString ret;
return ret;
}
@@ -181,36 +181,36 @@ KviListWindow::KviListWindow(KviFrame * lpFrm,KviConsole * lpConsole)
m_pItemList = new KviPointerList<KviChannelListViewItemData>;
m_pItemList->setAutoDelete(false);
- m_pSplitter = new QSplitter(Qt::Horizontal,this,"splitter");
- m_pTopSplitter = new QSplitter(Qt::Horizontal,this,"top_splitter");
- m_pVertSplitter = new QSplitter(Qt::Vertical,m_pSplitter,"vsplitter");
+ m_pSplitter = new TQSplitter(Qt::Horizontal,this,"splitter");
+ m_pTopSplitter = new TQSplitter(Qt::Horizontal,this,"top_splitter");
+ m_pVertSplitter = new TQSplitter(Qt::Vertical,m_pSplitter,"vsplitter");
KviTalHBox * box = new KviTalHBox(m_pTopSplitter);
m_pOpenButton = new KviStyledToolButton(box);
m_pOpenButton->setPixmap(*(g_pIconManager->getBigIcon(KVI_BIGICON_OPEN)));
- connect(m_pOpenButton,SIGNAL(clicked()),this,SLOT(importList()));
+ connect(m_pOpenButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(importList()));
m_pSaveButton = new KviStyledToolButton(box);
m_pSaveButton->setPixmap(*(g_pIconManager->getBigIcon(KVI_BIGICON_SAVE)));
- connect(m_pSaveButton,SIGNAL(clicked()),this,SLOT(exportList()));
+ connect(m_pSaveButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(exportList()));
m_pRequestButton = new KviStyledToolButton(box,"request_button");
m_pRequestButton->setUsesBigPixmap(false);
m_pRequestButton->setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_LIST)));
- connect(m_pRequestButton,SIGNAL(clicked()),this,SLOT(requestList()));
- QToolTip::add(m_pRequestButton,__tr2qs("Request List"));
+ connect(m_pRequestButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(requestList()));
+ TQToolTip::add(m_pRequestButton,__tr2qs("Request List"));
m_pStopListDownloadButton = new KviStyledToolButton(box,"stoplistdownload_button");
m_pStopListDownloadButton->setUsesBigPixmap(false);
m_pStopListDownloadButton->setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_NICKNAMEPROBLEM)));
- connect(m_pStopListDownloadButton,SIGNAL(clicked()),this,SLOT(stoplistdownload()));
- QToolTip::add(m_pStopListDownloadButton,__tr2qs("Stop list download"));
+ connect(m_pStopListDownloadButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(stoplistdownload()));
+ TQToolTip::add(m_pStopListDownloadButton,__tr2qs("Stop list download"));
- m_pParamsEdit = new QLineEdit(box);
+ m_pParamsEdit = new TQLineEdit(box);
box->setStretchFactor(m_pParamsEdit,1);
- QToolTip::add(m_pParamsEdit,__tr2qs("<center><b>/LIST command parameters:</b><br>Many servers accept special parameters that " \
+ TQToolTip::add(m_pParamsEdit,__tr2qs("<center><b>/LIST command parameters:</b><br>Many servers accept special parameters that " \
"allow you to filter the returned entries.<br>" \
- "Commonly, masked channel names (*kvirc*) are accepted as parameters, as well as strings " \
+ "Commonly, tqmasked channel names (*kvirc*) are accepted as parameters, as well as strings " \
"like <b>c&lt;n</b> or <b>c&gt;n</b> where <b>n</b> is the minimum or maximum of users on the channel.</center>"));
m_pInfoLabel = new KviThemedLabel(m_pTopSplitter,"info_label");
@@ -224,14 +224,14 @@ KviListWindow::KviListWindow(KviFrame * lpFrm,KviConsole * lpConsole)
m_pListView->setColumnWidthMode(3,KviTalListView::Maximum);
m_pListView->setSorting(100);
- connect(m_pListView,SIGNAL(doubleClicked(KviTalListViewItem *)),this,SLOT(itemDoubleClicked(KviTalListViewItem *)));
+ connect(m_pListView,TQT_SIGNAL(doubleClicked(KviTalListViewItem *)),this,TQT_SLOT(itemDoubleClicked(KviTalListViewItem *)));
m_pIrcView = new KviIrcView(m_pVertSplitter,lpFrm,this);
m_pConsole->ircContext()->setListWindowPointer(this);
- connect(m_pConsole->context(),SIGNAL(stateChanged()),
- this,SLOT(connectionStateChange()));
+ connect(m_pConsole->context(),TQT_SIGNAL(stateChanged()),
+ this,TQT_SLOT(connectionStateChange()));
connectionStateChange();
@@ -283,8 +283,8 @@ void KviListWindow::connectionStateChange()
m_pRequestButton->setEnabled(st == KviIrcContext::Connected);
if(st == KviIrcContext::Connected)
{
- QString tmp;
- KviQString::sprintf(tmp,
+ TQString tmp;
+ KviTQString::sprintf(tmp,
__tr2qs("Connected to %s (%s)"),
m_pConsole->connection()->currentServerName().utf8().data(),
m_pConsole->currentNetworkName().utf8().data());
@@ -294,39 +294,39 @@ void KviListWindow::connectionStateChange()
}
}
-QPixmap * KviListWindow::myIconPtr()
+TQPixmap * KviListWindow::myIconPtr()
{
return g_pIconManager->getSmallIcon(KVI_SMALLICON_LIST);
}
-void KviListWindow::resizeEvent(QResizeEvent *e)
+void KviListWindow::resizeEvent(TQResizeEvent *e)
{
- int hght = m_pTopSplitter->sizeHint().height();
+ int hght = m_pTopSplitter->tqsizeHint().height();
m_pTopSplitter->setGeometry(0,0,width(),hght);
m_pSplitter->setGeometry(0,hght,width(),height() - hght);
}
-QSize KviListWindow::sizeHint() const
+TQSize KviListWindow::tqsizeHint() const
{
- return m_pSplitter->sizeHint();
+ return m_pSplitter->tqsizeHint();
}
void KviListWindow::fillCaptionBuffers()
{
- KviQString::sprintf(m_szPlainTextCaption,__tr2qs("Channel List [IRC Context %u]"),m_pConsole->ircContextId());
+ KviTQString::sprintf(m_szPlainTextCaption,__tr2qs("Channel List [IRC Context %u]"),m_pConsole->ircContextId());
- KviQString::sprintf(m_szHtmlActiveCaption,
+ KviTQString::sprintf(m_szHtmlActiveCaption,
__tr2qs("<nobr><font color=\"%s\"><b>Channel List</b></font> " \
"<font color=\"%s\">[IRC Context %u]</font></nobr>"),
- KVI_OPTION_COLOR(KviOption_colorCaptionTextActive).name().ascii(),
- KVI_OPTION_COLOR(KviOption_colorCaptionTextActive2).name().ascii(),
+ TQString(KVI_OPTION_COLOR(KviOption_colorCaptionTextActive).name()).ascii(),
+ TQString(KVI_OPTION_COLOR(KviOption_colorCaptionTextActive2).name()).ascii(),
m_pConsole->ircContextId());
- KviQString::sprintf(m_szHtmlInactiveCaption,
+ KviTQString::sprintf(m_szHtmlInactiveCaption,
__tr2qs("<nobr><font color=\"%s\"><b>Channel list</b></font> " \
"<font color=\"%s\">[IRC Context %u]</font></nobr>"),
- KVI_OPTION_COLOR(KviOption_colorCaptionTextInactive).name().ascii(),
- KVI_OPTION_COLOR(KviOption_colorCaptionTextInactive2).name().ascii(),
+ TQString(KVI_OPTION_COLOR(KviOption_colorCaptionTextInactive).name()).ascii(),
+ TQString(KVI_OPTION_COLOR(KviOption_colorCaptionTextInactive2).name()).ascii(),
m_pConsole->ircContextId());
}
@@ -343,11 +343,11 @@ void KviListWindow::exportList()
return;
}
- QString szFile;
+ TQString szFile;
if(connection())
{
- QString szDate = QDateTime::currentDateTime().toString("d MMM yyyy hh-mm");
- KviQString::sprintf(szFile,__tr2qs("Channel list for %Q - %Q"),
+ TQString szDate = TQDateTime::tqcurrentDateTime().toString("d MMM yyyy hh-mm");
+ KviTQString::sprintf(szFile,__tr2qs("Channel list for %Q - %Q"),
&(connection()->networkName()),&(szDate));
} else {
szFile = __tr2qs("Channel list");
@@ -356,7 +356,7 @@ void KviListWindow::exportList()
__tr2qs("Configuration files (*.kvc)"),false,
false,true,this))
{
- if(QFileInfo(szFile).extension()!="kvc")
+ if(TQFileInfo(szFile).extension()!="kvc")
szFile.append(".kvc");
KviConfig cfg(szFile,KviConfig::Write);
cfg.clear();
@@ -378,8 +378,8 @@ void KviListWindow::exportList()
void KviListWindow::importList()
{
- QString szFile;
- if(KviFileDialog::askForOpenFileName(szFile,__tr2qs("Choose filename"),QString::null,
+ TQString szFile;
+ if(KviFileDialog::askForOpenFileName(szFile,__tr2qs("Choose filename"),TQString(),
__tr2qs("Configuration files (*.kvc)"),false,
false,this))
{
@@ -399,8 +399,8 @@ void KviListWindow::importList()
m_pItemList->append(
new KviChannelListViewItemData(
it.currentKey(),
- cfg.readQStringEntry("users","0"),
- cfg.readQStringEntry("topic","")
+ cfg.readTQStringEntry("users","0"),
+ cfg.readTQStringEntry("topic","")
)
);
++it;
@@ -451,13 +451,13 @@ void KviListWindow::processData(KviIrcMessage *msg)
{
if(!m_pFlushTimer)
{
- m_pFlushTimer = new QTimer(this);
- connect(m_pFlushTimer,SIGNAL(timeout()),this,SLOT(flush()));
+ m_pFlushTimer = new TQTimer(this);
+ connect(m_pFlushTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(flush()));
m_pFlushTimer->start(1000);
m_pRequestButton->setEnabled(false);
}
- QString sz2 = msg->connection()->decodeText(msg->safeParam(2));
+ TQString sz2 = msg->connection()->decodeText(msg->safeParam(2));
m_pItemList->append(
new KviChannelListViewItemData(
@@ -468,7 +468,7 @@ void KviListWindow::processData(KviIrcMessage *msg)
if(_OUTPUT_VERBOSE)
{
- QString zzz = msg->connection()->decodeText(msg->allParams());
+ TQString zzz = msg->connection()->decodeText(msg->allParams());
output(KVI_OUT_LIST,__tr2qs("Processing list: %Q"),&zzz);
}
}
@@ -487,10 +487,10 @@ void KviListWindow::flush()
void KviListWindow::itemDoubleClicked(KviTalListViewItem *it)
{
- QString sz = ((KviChannelListViewItem *)it)->channel();
+ TQString sz = ((KviChannelListViewItem *)it)->channel();
if(sz.isEmpty())return;
if(!connection())return;
- KviQCString dat = connection()->encodeText(sz);
+ KviTQCString dat = connection()->encodeText(sz);
if(!dat.data())return;
m_pConsole->connection()->sendFmtData("join %s",dat.data());
}
@@ -504,7 +504,7 @@ void KviListWindow::itemDoubleClicked(KviTalListViewItem *it)
// KviWindowProperty p;
// p.rect = externalGeometry();
// p.isDocked = isAttacched();
-// QValueList<int> l(m_pSplitter->sizes());
+// TQValueList<int> l(m_pSplitter->sizes());
// if(l.count() >= 1)p.splitWidth1 = *(l.at(0));
// if(l.count() >= 2)p.splitWidth2 = *(l.at(1));
// p.timestamp = m_pView->timestamp();
@@ -518,7 +518,7 @@ void KviListWindow::itemDoubleClicked(KviTalListViewItem *it)
//
//void KviListWindow::setProperties(KviWindowProperty *p)
//{
-// QValueList<int> l;
+// TQValueList<int> l;
// l.append(p->splitWidth1);
// l.append(p->splitWidth2);
// m_pVertSplitter->setSizes(l);
diff --git a/src/modules/list/listwindow.h b/src/modules/list/listwindow.h
index 8e7d510e..c0103519 100644
--- a/src/modules/list/listwindow.h
+++ b/src/modules/list/listwindow.h
@@ -34,8 +34,8 @@
#include "kvi_tal_listview.h"
#include "kvi_tal_popupmenu.h"
-#include <qtoolbutton.h>
-#include <qlineedit.h>
+#include <tqtoolbutton.h>
+#include <tqlineedit.h>
class KviThemedLabel;
@@ -44,13 +44,13 @@ class KviChannelListViewItemData
friend class KviChannelListViewItem;
friend class KviListWindow;
public:
- KviChannelListViewItemData(const QString &szChan,const QString &szUsers,const QString &szTopic);
+ KviChannelListViewItemData(const TQString &szChan,const TQString &szUsers,const TQString &szTopic);
~KviChannelListViewItemData();
protected:
- QString m_szChan;
- QString m_szUsers;
- QString m_szTopic;
- QString m_szUsersKey;
+ TQString m_szChan;
+ TQString m_szUsers;
+ TQString m_szTopic;
+ TQString m_szUsersKey;
};
class KviChannelListViewItem : public KviTalListViewItem
@@ -62,15 +62,15 @@ public:
protected:
KviChannelListViewItemData * m_pData;
public:
- const QString & channel(){ return m_pData->m_szChan; };
+ const TQString & channel(){ return m_pData->m_szChan; };
#ifdef COMPILE_USE_QT4
- int width ( const QFontMetrics & fm, const KviTalListView * lv, int column ) const;
+ int width ( const TQFontMetrics & fm, const KviTalListView * lv, int column ) const;
#else
- int width ( const QFontMetrics & fm, const QListView * lv, int column ) const;
+ int width ( const TQFontMetrics & fm, const TQListView * lv, int column ) const;
#endif
protected:
- virtual void paintCell(QPainter * p,const QColorGroup &cg,int col,int wdth,int align);
- virtual QString key(int col,bool) const;
+ virtual void paintCell(TQPainter * p,const TQColorGroup &cg,int col,int wdth,int align);
+ virtual TQString key(int col,bool) const;
};
@@ -78,30 +78,31 @@ protected:
class KviListWindow : public KviWindow, public KviExternalServerDataParser
{
Q_OBJECT
+ TQ_OBJECT
public:
KviListWindow(KviFrame * lpFrm,KviConsole * lpConsole);
~KviListWindow();
protected:
- QSplitter * m_pVertSplitter;
- QSplitter * m_pTopSplitter;
+ TQSplitter * m_pVertSplitter;
+ TQSplitter * m_pTopSplitter;
KviTalListView * m_pListView;
- QLineEdit * m_pParamsEdit;
- QToolButton * m_pRequestButton;
- QToolButton * m_pStopListDownloadButton;
- QToolButton * m_pOpenButton;
- QToolButton * m_pSaveButton;
+ TQLineEdit * m_pParamsEdit;
+ TQToolButton * m_pRequestButton;
+ TQToolButton * m_pStopListDownloadButton;
+ TQToolButton * m_pOpenButton;
+ TQToolButton * m_pSaveButton;
KviThemedLabel * m_pInfoLabel;
- QTimer * m_pFlushTimer;
+ TQTimer * m_pFlushTimer;
KviPointerList<KviChannelListViewItemData> * m_pItemList;
public: // Methods
virtual void control(int msg);
virtual void processData(KviIrcMessage * msg);
virtual void die();
protected:
- virtual QPixmap * myIconPtr();
+ virtual TQPixmap * myIconPtr();
virtual void fillCaptionBuffers();
virtual void applyOptions();
- virtual void resizeEvent(QResizeEvent *e);
+ virtual void resizeEvent(TQResizeEvent *e);
virtual void getBaseLogFileName(KviStr &buffer);
protected slots:
void flush();
@@ -112,7 +113,7 @@ protected slots:
void exportList();
void importList();
public:
- virtual QSize sizeHint() const;
+ virtual TQSize tqsizeHint() const;
private:
void reset();
void endOfList();