summaryrefslogtreecommitdiffstats
path: root/src/modules/addon
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/addon
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/addon')
-rw-r--r--src/modules/addon/libkviaddon.cpp78
-rw-r--r--src/modules/addon/managementdialog.cpp136
-rw-r--r--src/modules/addon/managementdialog.h54
3 files changed, 135 insertions, 133 deletions
diff --git a/src/modules/addon/libkviaddon.cpp b/src/modules/addon/libkviaddon.cpp
index a7cd4b88..6e984779 100644
--- a/src/modules/addon/libkviaddon.cpp
+++ b/src/modules/addon/libkviaddon.cpp
@@ -41,7 +41,7 @@
-QRect g_rectManagementDialogGeometry(0,0,0,0);
+TQRect g_rectManagementDialogGeometry(0,0,0,0);
/*
@doc: addon.exists
@@ -62,8 +62,8 @@ QRect g_rectManagementDialogGeometry(0,0,0,0);
static bool addon_kvs_fnc_exists(KviKvsModuleFunctionCall * c)
{
- QString szId;
- QString szVersion;
+ TQString szId;
+ TQString szVersion;
KVSM_PARAMETERS_BEGIN(c)
KVSM_PARAMETER("id",KVS_PT_NONEMPTYSTRING,0,szId)
KVSM_PARAMETER("version",KVS_PT_STRING,KVS_PF_OPTIONAL,szVersion)
@@ -102,7 +102,7 @@ static bool addon_kvs_fnc_exists(KviKvsModuleFunctionCall * c)
static bool addon_kvs_fnc_version(KviKvsModuleFunctionCall * c)
{
- QString szId;
+ TQString szId;
KVSM_PARAMETERS_BEGIN(c)
KVSM_PARAMETER("id",KVS_PT_NONEMPTYSTRING,0,szId)
KVSM_PARAMETERS_END(c)
@@ -135,10 +135,10 @@ static bool addon_kvs_fnc_version(KviKvsModuleFunctionCall * c)
static bool addon_kvs_cmd_list(KviKvsModuleCommandCall * c)
{
- KviPointerHashTable<QString,KviKvsScriptAddon> * da = KviKvsScriptAddonManager::instance()->addonDict();
+ KviPointerHashTable<TQString,KviKvsScriptAddon> * da = KviKvsScriptAddonManager::instance()->addonDict();
int cnt = 0;
- KviPointerHashTableIterator<QString,KviKvsScriptAddon> it(*da);
+ KviPointerHashTableIterator<TQString,KviKvsScriptAddon> it(*da);
while(KviKvsScriptAddon * a = it.current())
{
c->window()->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("%cAddon id %Q, version %Q%c"),KVI_TEXT_BOLD,&(a->name()),&(a->version()),KVI_TEXT_BOLD);
@@ -180,7 +180,7 @@ static bool addon_kvs_cmd_list(KviKvsModuleCommandCall * c)
static bool addon_kvs_cmd_uninstall(KviKvsModuleCommandCall * c)
{
- QString szName;
+ TQString szName;
KVSM_PARAMETERS_BEGIN(c)
KVSM_PARAMETER("name",KVS_PT_NONEMPTYSTRING,0,szName)
KVSM_PARAMETERS_END(c)
@@ -188,14 +188,14 @@ static bool addon_kvs_cmd_uninstall(KviKvsModuleCommandCall * c)
KviKvsScriptAddon * a = KviKvsScriptAddonManager::instance()->findAddon(szName);
if(a)
{
- if(!c->switches()->find('q',"quiet"))
+ if(!c->switches()->tqfind('q',"quiet"))
c->window()->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Uninstalling existing addon version %Q"),&(a->version()));
// uninstall the existing version
- KviKvsScriptAddonManager::instance()->unregisterAddon(szName,c->window(),!c->switches()->find('n',"no-callback"));
+ KviKvsScriptAddonManager::instance()->unregisterAddon(szName,c->window(),!c->switches()->tqfind('n',"no-callback"));
} else {
- if(!c->switches()->find('q',"quiet"))
- c->warning(__tr2qs("The addon \"%1\" does not exist").arg(szName));
+ if(!c->switches()->tqfind('q',"quiet"))
+ c->warning(__tr2qs("The addon \"%1\" does not exist").tqarg(szName));
}
return true;
@@ -223,7 +223,7 @@ static bool addon_kvs_cmd_uninstall(KviKvsModuleCommandCall * c)
static bool addon_kvs_cmd_configure(KviKvsModuleCommandCall * c)
{
- QString szName;
+ TQString szName;
KVSM_PARAMETERS_BEGIN(c)
KVSM_PARAMETER("name",KVS_PT_NONEMPTYSTRING,0,szName)
KVSM_PARAMETERS_END(c)
@@ -231,17 +231,17 @@ static bool addon_kvs_cmd_configure(KviKvsModuleCommandCall * c)
KviKvsScriptAddon * a = KviKvsScriptAddonManager::instance()->findAddon(szName);
if(a)
{
- QString ss = a->configureCallbackCode();
+ TQString ss = a->configureCallbackCode();
if(ss.isEmpty())
{
- if(!c->switches()->find('q',"quiet"))
- c->warning(__tr2qs("The addon \"%1\" has no configure callback set").arg(szName));
+ if(!c->switches()->tqfind('q',"quiet"))
+ c->warning(__tr2qs("The addon \"%1\" has no configure callback set").tqarg(szName));
} else {
a->executeConfigureCallback(c->window());
}
} else {
- if(!c->switches()->find('q',"quiet"))
- c->warning(__tr2qs("The addon \"%1\" does not exist").arg(szName));
+ if(!c->switches()->tqfind('q',"quiet"))
+ c->warning(__tr2qs("The addon \"%1\" does not exist").tqarg(szName));
}
return true;
@@ -270,7 +270,7 @@ static bool addon_kvs_cmd_configure(KviKvsModuleCommandCall * c)
static bool addon_kvs_cmd_help(KviKvsModuleCommandCall * c)
{
- QString szName;
+ TQString szName;
KVSM_PARAMETERS_BEGIN(c)
KVSM_PARAMETER("name",KVS_PT_NONEMPTYSTRING,0,szName)
KVSM_PARAMETERS_END(c)
@@ -278,17 +278,17 @@ static bool addon_kvs_cmd_help(KviKvsModuleCommandCall * c)
KviKvsScriptAddon * a = KviKvsScriptAddonManager::instance()->findAddon(szName);
if(a)
{
- QString ss = a->helpCallbackCode();
+ TQString ss = a->helpCallbackCode();
if(ss.isEmpty())
{
- if(!c->switches()->find('q',"quiet"))
- c->warning(__tr2qs("The addon \"%1\" has no help callback set").arg(szName));
+ if(!c->switches()->tqfind('q',"quiet"))
+ c->warning(__tr2qs("The addon \"%1\" has no help callback set").tqarg(szName));
} else {
a->executeHelpCallback(c->window());
}
} else {
- if(!c->switches()->find('q',"quiet"))
- c->warning(__tr2qs("The addon \"%1\" does not exist").arg(szName));
+ if(!c->switches()->tqfind('q',"quiet"))
+ c->warning(__tr2qs("The addon \"%1\" does not exist").tqarg(szName));
}
return true;
@@ -322,7 +322,7 @@ static bool addon_kvs_cmd_help(KviKvsModuleCommandCall * c)
static bool addon_kvs_cmd_setconfigurecallback(KviKvsModuleCallbackCommandCall * c)
{
- QString szName;
+ TQString szName;
KVSM_PARAMETERS_BEGIN(c)
KVSM_PARAMETER("name",KVS_PT_NONEMPTYSTRING,0,szName)
@@ -333,8 +333,8 @@ static bool addon_kvs_cmd_setconfigurecallback(KviKvsModuleCallbackCommandCall *
{
a->setConfigureCallback(c->callback()->code());
} else {
- if(!c->switches()->find('q',"quiet"))
- c->warning(__tr2qs("The addon \"%1\" does not exist").arg(szName));
+ if(!c->switches()->tqfind('q',"quiet"))
+ c->warning(__tr2qs("The addon \"%1\" does not exist").tqarg(szName));
}
return true;
@@ -369,7 +369,7 @@ static bool addon_kvs_cmd_setconfigurecallback(KviKvsModuleCallbackCommandCall *
static bool addon_kvs_cmd_sethelpcallback(KviKvsModuleCallbackCommandCall * c)
{
- QString szName;
+ TQString szName;
KVSM_PARAMETERS_BEGIN(c)
KVSM_PARAMETER("name",KVS_PT_NONEMPTYSTRING,0,szName)
@@ -380,8 +380,8 @@ static bool addon_kvs_cmd_sethelpcallback(KviKvsModuleCallbackCommandCall * c)
{
a->setHelpCallback(c->callback()->code());
} else {
- if(!c->switches()->find('q',"quiet"))
- c->warning(__tr2qs("The addon \"%1\" does not exist").arg(szName));
+ if(!c->switches()->tqfind('q',"quiet"))
+ c->warning(__tr2qs("The addon \"%1\" does not exist").tqarg(szName));
}
return true;
@@ -429,7 +429,7 @@ static bool addon_kvs_cmd_sethelpcallback(KviKvsModuleCallbackCommandCall * c)
we will adhere to that naming in certain parts of the documentation too.
[/p]
[p]
- Each script-based addon (a set of scripts) is identified by an UNIQUE
+ Each script-based addon (a set of scripts) is identified by an UNITQUE
<id>. Two addons with the same <id> can't co-exist in the same
KVIrc installation (so be sure to choose a token characteristic enough
to avoid collisions with others). The <id> itself is used only for
@@ -510,7 +510,7 @@ static bool addon_kvs_cmd_sethelpcallback(KviKvsModuleCallbackCommandCall * c)
static bool addon_kvs_cmd_register(KviKvsModuleCallbackCommandCall * c)
{
KviKvsScriptAddonRegistrationData rd;
- QString szMinKVIrcVersion;
+ TQString szMinKVIrcVersion;
KVSM_PARAMETERS_BEGIN(c)
KVSM_PARAMETER("name",KVS_PT_NONEMPTYSTRING,0,(rd.szName))
@@ -549,7 +549,7 @@ static bool addon_kvs_cmd_register(KviKvsModuleCallbackCommandCall * c)
return false;
}
- if(!c->switches()->find('q',"quiet"))
+ if(!c->switches()->tqfind('q',"quiet"))
c->window()->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Attempting to register addon \"%Q\" with version %Q"),&(rd.szName),&(rd.szVersion));
KviKvsScriptAddon * a = KviKvsScriptAddonManager::instance()->findAddon(rd.szName);
@@ -560,18 +560,18 @@ static bool addon_kvs_cmd_register(KviKvsModuleCallbackCommandCall * c)
{
// and it has a higher version...
// complain unless -f is used
- if(!c->switches()->find('f',"force"))
+ if(!c->switches()->tqfind('f',"force"))
{
c->error(__tr2qs("The script addon \"%Q\" already exists with version %Q which is higher than %Q"),&(rd.szName),&(a->version()),&(rd.szVersion));
return false;
}
}
- if(!c->switches()->find('q',"quiet"))
+ if(!c->switches()->tqfind('q',"quiet"))
c->window()->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Uninstalling existing addon version %Q"),&(a->version()));
// uninstall the existing version
- KviKvsScriptAddonManager::instance()->unregisterAddon(rd.szName,c->window(),!c->switches()->find('n',"no-uninstall"));
+ KviKvsScriptAddonManager::instance()->unregisterAddon(rd.szName,c->window(),!c->switches()->tqfind('n',"no-uninstall"));
}
if(!KviKvsScriptAddonManager::instance()->registerAddon(&rd))
@@ -580,7 +580,7 @@ static bool addon_kvs_cmd_register(KviKvsModuleCallbackCommandCall * c)
return false;
}
- if(!c->switches()->find('q',"quiet"))
+ if(!c->switches()->tqfind('q',"quiet"))
c->window()->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Script succesfully registered"));
return true;
@@ -621,10 +621,10 @@ static bool addon_module_init(KviModule *m)
KVSM_REGISTER_CALLBACK_COMMAND(m,"sethelpcallback",addon_kvs_cmd_sethelpcallback);
KVSM_REGISTER_CALLBACK_COMMAND(m,"register",addon_kvs_cmd_register);
- QString szBuf;
+ TQString szBuf;
m->getDefaultConfigFileName(szBuf);
KviConfig cfg(szBuf,KviConfig::Read);
- g_rectManagementDialogGeometry = cfg.readRectEntry("EditorGeometry",QRect(10,10,390,440));
+ g_rectManagementDialogGeometry = cfg.readRectEntry("EditorGeometry",TQRect(10,10,390,440));
return true;
}
@@ -633,7 +633,7 @@ static bool addon_module_cleanup(KviModule *m)
{
KviScriptManagementDialog::cleanup();
- QString szBuf;
+ TQString szBuf;
m->getDefaultConfigFileName(szBuf);
KviConfig cfg(szBuf,KviConfig::Write);
cfg.writeEntry("EditorGeometry",g_rectManagementDialogGeometry);
diff --git a/src/modules/addon/managementdialog.cpp b/src/modules/addon/managementdialog.cpp
index a6765587..adbbae71 100644
--- a/src/modules/addon/managementdialog.cpp
+++ b/src/modules/addon/managementdialog.cpp
@@ -36,29 +36,29 @@
#include "kvi_kvs_script.h"
#include "kvi_sourcesdate.h"
-#include <qpushbutton.h>
-#include <qlayout.h>
-#include <qapplication.h>
-#include <qtooltip.h>
-#include <qlineedit.h>
-#include <qlabel.h>
-#include <qmessagebox.h>
-#include <qframe.h>
+#include <tqpushbutton.h>
+#include <tqlayout.h>
+#include <tqapplication.h>
+#include <tqtooltip.h>
+#include <tqlineedit.h>
+#include <tqlabel.h>
+#include <tqmessagebox.h>
+#include <tqframe.h>
#include "kvi_tal_scrollview.h"
#ifdef COMPILE_USE_QT4
- #include <q3header.h>
+ #include <tq3header.h>
#else
- #include <qheader.h>
+ #include <tqheader.h>
#endif
#include "kvi_draganddrop.h"
-#include <qpainter.h>
-#include <qpixmap.h>
-#include <qmessagebox.h>
-#include <qevent.h>
+#include <tqpainter.h>
+#include <tqpixmap.h>
+#include <tqmessagebox.h>
+#include <tqevent.h>
KviScriptManagementDialog * KviScriptManagementDialog::m_pInstance = 0;
-extern QRect g_rectManagementDialogGeometry;
+extern TQRect g_rectManagementDialogGeometry;
#define LVI_ICON_SIZE 32
@@ -72,7 +72,7 @@ KviScriptAddonListViewItem::KviScriptAddonListViewItem(KviTalListView * v,KviKvs
{
m_pAddon = new KviKvsScriptAddon(*a);
m_pListView = v;
- QString t = "<nobr><b>";
+ TQString t = "<nobr><b>";
t += a->visibleName();
t += "</b> [";
t += a->version();
@@ -85,15 +85,15 @@ KviScriptAddonListViewItem::KviScriptAddonListViewItem(KviTalListView * v,KviKvs
t += "</font></nobr>";
m_szKey = a->visibleName().upper();
#ifdef COMPILE_USE_QT4
- m_pText = new QTextDocument();
+ m_pText = new TQTextDocument();
m_pText->setHtml(t);
m_pText->setDefaultFont(v->font());
#else
- m_pText = new QSimpleRichText(t,v->font());
+ m_pText = new TQSimpleRichText(t,v->font());
#endif
- QPixmap * p = a->icon();
- m_pIcon = p ? new QPixmap(*p) : new QPixmap(LVI_ICON_SIZE,LVI_ICON_SIZE);
+ TQPixmap * p = a->icon();
+ m_pIcon = p ? new TQPixmap(*p) : new TQPixmap(LVI_ICON_SIZE,LVI_ICON_SIZE);
}
KviScriptAddonListViewItem::~KviScriptAddonListViewItem()
@@ -103,7 +103,7 @@ KviScriptAddonListViewItem::~KviScriptAddonListViewItem()
delete m_pAddon;
}
-QString KviScriptAddonListViewItem::key(int,bool) const
+TQString KviScriptAddonListViewItem::key(int,bool) const
{
return m_szKey;
}
@@ -125,12 +125,12 @@ void KviScriptAddonListViewItem::setup()
setHeight(iHeight+2);
}
-void KviScriptAddonListViewItem::paintCell(QPainter * p,const QColorGroup & cg,int column,int width,int align)
+void KviScriptAddonListViewItem::paintCell(TQPainter * p,const TQColorGroup & cg,int column,int width,int align)
{
#ifdef COMPILE_USE_QT4
if (isSelected())
{
- QColor col(m_pListView->palette().highlight());
+ TQColor col(m_pListView->palette().highlight());
col.setAlpha(127);
p->setBrush(col);
p->drawRect(0, 0, m_pListView->visibleWidth(), height());
@@ -139,7 +139,7 @@ void KviScriptAddonListViewItem::paintCell(QPainter * p,const QColorGroup & cg,i
int afterIcon = LVI_BORDER + LVI_ICON_SIZE + LVI_SPACING;
int www = m_pListView->visibleWidth() - (afterIcon + LVI_BORDER);
p->translate(afterIcon,LVI_BORDER);
- m_pText->setPageSize(QSizeF(www,height() - (LVI_BORDER * 2)));
+ m_pText->setPageSize(TQSizeF(www,height() - (LVI_BORDER * 2)));
m_pText->drawContents(p);
#else
p->drawPixmap(LVI_BORDER,LVI_BORDER,*m_pIcon);
@@ -148,12 +148,12 @@ void KviScriptAddonListViewItem::paintCell(QPainter * p,const QColorGroup & cg,i
m_pText->setWidth(www);
if(isSelected())
{
- QColorGroup cg2(cg);
- cg2.setColor(QColorGroup::HighlightedText,cg.text());
+ TQColorGroup cg2(cg);
+ cg2.setColor(TQColorGroup::HighlightedText,cg.text());
- m_pText->draw(p,afterIcon,LVI_BORDER,QRect(afterIcon,LVI_BORDER,www,height() - (LVI_BORDER * 2)),cg2);
+ m_pText->draw(p,afterIcon,LVI_BORDER,TQRect(afterIcon,LVI_BORDER,www,height() - (LVI_BORDER * 2)),cg2);
} else {
- m_pText->draw(p,afterIcon,LVI_BORDER,QRect(afterIcon,LVI_BORDER,www,height() - (LVI_BORDER * 2)),cg);
+ m_pText->draw(p,afterIcon,LVI_BORDER,TQRect(afterIcon,LVI_BORDER,www,height() - (LVI_BORDER * 2)),cg);
}
#endif
}
@@ -164,11 +164,11 @@ void KviScriptAddonListViewItem::paintCell(QPainter * p,const QColorGroup & cg,i
-KviScriptAddonListView::KviScriptAddonListView(QWidget * pParent)
+KviScriptAddonListView::KviScriptAddonListView(TQWidget * pParent)
: KviListView(pParent)
{
- QPixmap * p = g_pIconManager->getImage("kvi_dialog_addons.png");
- if(p)setBackgroundOverlayPixmap(p,Qt::AlignRight | Qt::AlignBottom);
+ TQPixmap * p = g_pIconManager->getImage("kvi_dialog_addons.png");
+ if(p)setBackgroundOverlayPixmap(p,TQt::AlignRight | TQt::AlignBottom);
setSelectionMode(Single);
header()->hide();
@@ -182,7 +182,7 @@ KviScriptAddonListView::~KviScriptAddonListView()
{
}
-void KviScriptAddonListView::resizeEvent(QResizeEvent * e)
+void KviScriptAddonListView::resizeEvent(TQResizeEvent * e)
{
KviListView::resizeEvent(e);
int iWidth = visibleWidth();
@@ -191,8 +191,8 @@ void KviScriptAddonListView::resizeEvent(QResizeEvent * e)
}
-KviScriptManagementDialog::KviScriptManagementDialog(QWidget * p)
-: QDialog(p,"" /*,WType_TopLevel | WStyle_Customize | WStyle_Title | WStyle_StaysOnTop | WStyle_DialogBorder*/)
+KviScriptManagementDialog::KviScriptManagementDialog(TQWidget * p)
+: TQDialog(p,"" /*,WType_TopLevel | WStyle_Customize | WStyle_Title | WStyle_StaysOnTop | WStyle_DialogBorder*/)
{
setCaption(__tr2qs("Manage Script-Based Addons"));
setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_ADDONS)));
@@ -200,56 +200,56 @@ KviScriptManagementDialog::KviScriptManagementDialog(QWidget * p)
m_pInstance = this;
- QGridLayout * g = new QGridLayout(this,11,3,4,5);
+ TQGridLayout * g = new TQGridLayout(this,11,3,4,5);
- /*QLabel * lb = new QLabel(this);
- lb->setFrameStyle(QFrame::WinPanel | QFrame::Sunken);
+ /*TQLabel * lb = new TQLabel(this);
+ lb->setFrameStyle(TQFrame::WinPanel | TQFrame::Sunken);
g->addMultiCellWidget(lb,0,10,0,0);
- QPixmap * pix = g_pIconManager->getImage("kvi_dialog_addons.png");
+ TQPixmap * pix = g_pIconManager->getImage("kvi_dialog_addons.png");
if(pix)
{
lb->setPixmap(*pix);
lb->setFixedWidth(pix->width());
}
- lb->setBackgroundColor(Qt::black);
- lb->setAlignment(Qt::AlignBottom | Qt::AlignRight);
+ lb->setBackgroundColor(TQt::black);
+ lb->tqsetAlignment(TQt::AlignBottom | TQt::AlignRight);
*/
m_pListView = new KviScriptAddonListView(this);
g->addMultiCellWidget(m_pListView,0,10,1,1);
- m_pConfigureButton = new QPushButton(__tr2qs("Configure"),this);
- connect(m_pConfigureButton,SIGNAL(clicked()),this,SLOT(configureScript()));
+ m_pConfigureButton = new TQPushButton(__tr2qs("Configure"),this);
+ connect(m_pConfigureButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(configureScript()));
g->addWidget(m_pConfigureButton,0,2);
- m_pHelpButton = new QPushButton(__tr2qs("Show Help"),this);
- connect(m_pHelpButton,SIGNAL(clicked()),this,SLOT(showScriptHelp()));
+ m_pHelpButton = new TQPushButton(__tr2qs("Show Help"),this);
+ connect(m_pHelpButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(showScriptHelp()));
g->addWidget(m_pHelpButton,1,2);
g->addRowSpacing(2,40);
- m_pUninstallButton = new QPushButton(__tr2qs("Uninstall"),this);
- connect(m_pUninstallButton,SIGNAL(clicked()),this,SLOT(uninstallScript()));
+ m_pUninstallButton = new TQPushButton(__tr2qs("Uninstall"),this);
+ connect(m_pUninstallButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(uninstallScript()));
g->addWidget(m_pUninstallButton,3,2);
g->addRowSpacing(4,15);
- QFrame *f = new QFrame(this);
- f->setFrameStyle(QFrame::HLine | QFrame::Sunken);
+ TQFrame *f = new TQFrame(this);
+ f->setFrameStyle(TQFrame::HLine | TQFrame::Sunken);
g->addWidget(f,5,2);
g->addRowSpacing(6,15);
- m_pInstallButton = new QPushButton(__tr2qs("Install Addon..."),this);
- connect(m_pInstallButton,SIGNAL(clicked()),this,SLOT(installScript()));
+ m_pInstallButton = new TQPushButton(__tr2qs("Install Addon..."),this);
+ connect(m_pInstallButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(installScript()));
g->addWidget(m_pInstallButton,7,2);
- m_pGetScriptsButton = new QPushButton(__tr2qs("More Addons..."),this);
- connect(m_pGetScriptsButton,SIGNAL(clicked()),this,SLOT(getMoreScripts()));
+ m_pGetScriptsButton = new TQPushButton(__tr2qs("More Addons..."),this);
+ connect(m_pGetScriptsButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(getMoreScripts()));
g->addWidget(m_pGetScriptsButton,8,2);
- QPushButton * b = new QPushButton(__tr2qs("Close"),this);
- connect(b,SIGNAL(clicked()),this,SLOT(closeClicked()));
+ TQPushButton * b = new TQPushButton(__tr2qs("Close"),this);
+ connect(b,TQT_SIGNAL(clicked()),this,TQT_SLOT(closeClicked()));
g->addWidget(b,10,2);
g->setRowStretch(9,1);
@@ -258,7 +258,7 @@ KviScriptManagementDialog::KviScriptManagementDialog(QWidget * p)
fillListView();
currentChanged(0);
- connect(m_pListView,SIGNAL(currentChanged(KviTalListViewItem *)),this,SLOT(currentChanged(KviTalListViewItem *)));
+ connect(m_pListView,TQT_SIGNAL(currentChanged(KviTalListViewItem *)),this,TQT_SLOT(currentChanged(KviTalListViewItem *)));
//currentToolBarChanged();
if(g_rectManagementDialogGeometry.y() < 5)
@@ -273,7 +273,7 @@ KviScriptManagementDialog::KviScriptManagementDialog(QWidget * p)
KviScriptManagementDialog::~KviScriptManagementDialog()
{
- g_rectManagementDialogGeometry = QRect(pos().x(),pos().y(),size().width(),size().height());
+ g_rectManagementDialogGeometry = TQRect(pos().x(),pos().y(),size().width(),size().height());
//KviActionManager::instance()->customizeToolBarsDialogDestroyed();
m_pInstance = 0;
@@ -282,9 +282,9 @@ KviScriptManagementDialog::~KviScriptManagementDialog()
void KviScriptManagementDialog::fillListView()
{
m_pListView->clear();
- KviPointerHashTable<QString,KviKvsScriptAddon> * d = KviKvsScriptAddonManager::instance()->addonDict();
+ KviPointerHashTable<TQString,KviKvsScriptAddon> * d = KviKvsScriptAddonManager::instance()->addonDict();
if(!d)return;
- KviPointerHashTableIterator<QString,KviKvsScriptAddon> it(*d);
+ KviPointerHashTableIterator<TQString,KviKvsScriptAddon> it(*d);
KviScriptAddonListViewItem * item;
while(KviKvsScriptAddon * a = it.current())
{
@@ -329,11 +329,11 @@ void KviScriptManagementDialog::uninstallScript()
KviScriptAddonListViewItem * it = (KviScriptAddonListViewItem *)m_pListView->currentItem();
if(!it)return;
- QString txt = "<p>";
- txt += __tr2qs("Do you really want to uninstall the addon \"%1\" ?").arg(it->addon()->visibleName());
+ TQString txt = "<p>";
+ txt += __tr2qs("Do you really want to uninstall the addon \"%1\" ?").tqarg(it->addon()->visibleName());
txt += "</p>";
- if(QMessageBox::question(this,
+ if(TQMessageBox::question(this,
__tr2qs("Confirm addon uninstallation"),txt,__tr2qs("&Yes"),__tr2qs("&No"),0,1) != 0)return;
KviKvsScriptAddonManager::instance()->unregisterAddon(it->addon()->name(),g_pActiveWindow);
@@ -349,13 +349,13 @@ void KviScriptManagementDialog::getMoreScripts()
void KviScriptManagementDialog::installScript()
{
- QString buffer;
+ TQString buffer;
- if(!KviFileDialog::askForOpenFileName(buffer,__tr2qs("Please select the addon installation file"),QString::null,"install.kvs",false,true))return;
+ if(!KviFileDialog::askForOpenFileName(buffer,__tr2qs("Please select the addon installation file"),TQString(),"install.kvs",false,true))return;
- buffer.replace("\\","\\\\");
+ buffer.tqreplace("\\","\\\\");
- QString szCmd = "parse \"";
+ TQString szCmd = "parse \"";
szCmd += buffer;
szCmd += "\"";
@@ -368,9 +368,9 @@ void KviScriptManagementDialog::installScript()
//m_pListView->triggerUpdate();
}
-void KviScriptManagementDialog::showEvent(QShowEvent * e)
+void KviScriptManagementDialog::showEvent(TQShowEvent * e)
{
-// QRect r = parentWidget() ? parentWidget()->rect() : QApplication::desktop()->rect();
+// TQRect r = tqparentWidget() ? tqparentWidget()->rect() : TQApplication::desktop()->rect();
// int x = (r.width() - width()) / 2;
// int y = (r.height() - height()) / 2;
// move(x,y);
@@ -395,7 +395,7 @@ void KviScriptManagementDialog::display()
m_pInstance->show();
}
-void KviScriptManagementDialog::closeEvent(QCloseEvent * e)
+void KviScriptManagementDialog::closeEvent(TQCloseEvent * e)
{
e->ignore();
delete this;
diff --git a/src/modules/addon/managementdialog.h b/src/modules/addon/managementdialog.h
index 0abbb4f9..a0ed1ad4 100644
--- a/src/modules/addon/managementdialog.h
+++ b/src/modules/addon/managementdialog.h
@@ -24,24 +24,24 @@
//
//=============================================================================
-#include <qdialog.h>
+#include <tqdialog.h>
#include "kvi_listview.h"
#include "kvi_settings.h"
-#include <qwidget.h>
-#include <qlabel.h>
-#include <qdialog.h>
-#include <qcolor.h>
+#include <tqwidget.h>
+#include <tqlabel.h>
+#include <tqdialog.h>
+#include <tqcolor.h>
#include "kvi_tal_listview.h"
-class QPushButton;
-class QPixmap;
+class TQPushButton;
+class TQPixmap;
class KviKvsScriptAddon;
#ifdef COMPILE_USE_QT4
- #include <QTextDocument>
+ #include <TQTextDocument>
#else
- #include <qsimplerichtext.h>
+ #include <tqsimplerichtext.h>
#endif
class KviScriptAddonListViewItem : public KviTalListViewItem
@@ -52,54 +52,56 @@ public:
protected:
KviKvsScriptAddon * m_pAddon;
#ifdef COMPILE_USE_QT4
- QTextDocument * m_pText;
+ TQTextDocument * m_pText;
#else
- QSimpleRichText * m_pText;
+ TQSimpleRichText * m_pText;
#endif
- QPixmap * m_pIcon;
+ TQPixmap * m_pIcon;
KviTalListView * m_pListView;
- QString m_szKey;
+ TQString m_szKey;
public:
KviKvsScriptAddon * addon(){ return m_pAddon; };
protected:
- virtual QString key(int,bool) const;
- virtual void paintCell(QPainter * p,const QColorGroup & cg,int column,int width,int align);
+ virtual TQString key(int,bool) const;
+ virtual void paintCell(TQPainter * p,const TQColorGroup & cg,int column,int width,int align);
virtual void setup();
};
class KviScriptAddonListView : public KviListView
{
Q_OBJECT
+ TQ_OBJECT
public:
- KviScriptAddonListView(QWidget * pParent);
+ KviScriptAddonListView(TQWidget * pParent);
~KviScriptAddonListView();
protected:
- virtual void resizeEvent(QResizeEvent * e);
+ virtual void resizeEvent(TQResizeEvent * e);
};
-class KviScriptManagementDialog : public QDialog
+class KviScriptManagementDialog : public TQDialog
{
Q_OBJECT
+ TQ_OBJECT
protected:
- KviScriptManagementDialog(QWidget * p);
+ KviScriptManagementDialog(TQWidget * p);
public:
~KviScriptManagementDialog();
protected:
KviScriptAddonListView * m_pListView;
static KviScriptManagementDialog * m_pInstance;
- QPushButton * m_pUninstallButton;
- QPushButton * m_pConfigureButton;
- QPushButton * m_pHelpButton;
- QPushButton * m_pInstallButton;
- QPushButton * m_pGetScriptsButton;
+ TQPushButton * m_pUninstallButton;
+ TQPushButton * m_pConfigureButton;
+ TQPushButton * m_pHelpButton;
+ TQPushButton * m_pInstallButton;
+ TQPushButton * m_pGetScriptsButton;
public:
static KviScriptManagementDialog * instance(){ return m_pInstance; };
static void display();
static void cleanup();
protected:
void fillListView();
- virtual void showEvent(QShowEvent * e);
- virtual void closeEvent(QCloseEvent *e);
+ virtual void showEvent(TQShowEvent * e);
+ virtual void closeEvent(TQCloseEvent *e);
protected slots:
void currentChanged(KviTalListViewItem *i);
void closeClicked();