summaryrefslogtreecommitdiffstats
path: root/src/modules/popupeditor/popupeditor.cpp
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/popupeditor/popupeditor.cpp
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/popupeditor/popupeditor.cpp')
-rw-r--r--src/modules/popupeditor/popupeditor.cpp310
1 files changed, 155 insertions, 155 deletions
diff --git a/src/modules/popupeditor/popupeditor.cpp b/src/modules/popupeditor/popupeditor.cpp
index 942b5b2f..99beab90 100644
--- a/src/modules/popupeditor/popupeditor.cpp
+++ b/src/modules/popupeditor/popupeditor.cpp
@@ -40,14 +40,14 @@
#include "kvi_kvs_variantlist.h"
//#include "kvi_parameterlist.h"
-#include <qmessagebox.h>
-#include <qdir.h>
-#include <qsplitter.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qtooltip.h>
+#include <tqmessagebox.h>
+#include <tqdir.h>
+#include <tqsplitter.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqtooltip.h>
#include "kvi_pointerhashtable.h"
-#include <qpushbutton.h>
+#include <tqpushbutton.h>
#include "kvi_tal_vbox.h"
extern KviPopupEditorWindow * g_pPopupEditorWindow;
@@ -62,8 +62,8 @@ KviPopupListViewItem::KviPopupListViewItem(KviTalListView * pListView,KviPopupLi
init();
}
-KviPopupListViewItem::KviPopupListViewItem(KviPopupListViewItem * parent,KviPopupListViewItem * after,Type t)
-: KviTalListViewItem(parent,after)
+KviPopupListViewItem::KviPopupListViewItem(KviPopupListViewItem * tqparent,KviPopupListViewItem * after,Type t)
+: KviTalListViewItem(tqparent,after)
{
m_type = t;
init();
@@ -102,7 +102,7 @@ void KviPopupListViewItem::init()
}
}
-void KviPopupListViewItem::setItemText(const QString & szText)
+void KviPopupListViewItem::setItemText(const TQString & szText)
{
switch(m_type)
{
@@ -118,7 +118,7 @@ void KviPopupListViewItem::setItemText(const QString & szText)
}
}
-void KviPopupListViewItem::setCondition(const QString & szCondition)
+void KviPopupListViewItem::setCondition(const TQString & szCondition)
{
switch(m_type)
{
@@ -133,7 +133,7 @@ void KviPopupListViewItem::setCondition(const QString & szCondition)
}
}
-void KviPopupListViewItem::setCode(const QString & szCode)
+void KviPopupListViewItem::setCode(const TQString & szCode)
{
switch(m_type)
{
@@ -148,12 +148,12 @@ void KviPopupListViewItem::setCode(const QString & szCode)
}
}
-void KviPopupListViewItem::setId(const QString & szId)
+void KviPopupListViewItem::setId(const TQString & szId)
{
m_szId = szId;
}
-void KviPopupListViewItem::setIcon(const QString & szIcon)
+void KviPopupListViewItem::setIcon(const TQString & szIcon)
{
switch(m_type)
{
@@ -163,9 +163,9 @@ void KviPopupListViewItem::setIcon(const QString & szIcon)
case ExtMenu:
m_szIcon = szIcon;
{
- QPixmap * pix = g_pIconManager->getImage(szIcon);
+ TQPixmap * pix = g_pIconManager->getImage(szIcon);
if(pix)setPixmap(0,*pix);
- else setPixmap(0,QPixmap());
+ else setPixmap(0,TQPixmap());
}
break;
default:
@@ -184,29 +184,29 @@ void KviPopupListViewItem::setIcon(const QString & szIcon)
-KviSinglePopupEditor::KviSinglePopupEditor(QWidget * par)
-: QWidget(par)
+KviSinglePopupEditor::KviSinglePopupEditor(TQWidget * par)
+: TQWidget(par)
{
m_pLastSelectedItem = 0;
m_pContextPopup = new KviTalPopupMenu(this);
m_pClipboard = 0;
m_pTestPopup = 0;
- QGridLayout * g = new QGridLayout(this,7,3,2,2);
+ TQGridLayout * g = new TQGridLayout(this,7,3,2,2);
- m_pNameEditor = new QLineEdit(this);
- QToolTip::add(m_pNameEditor,__tr2qs("Popup name"));
+ m_pNameEditor = new TQLineEdit(this);
+ TQToolTip::add(m_pNameEditor,__tr2qs("Popup name"));
g->addMultiCellWidget(m_pNameEditor,0,0,0,1);
- m_pMenuButton = new QPushButton(__tr2qs("Test"),this);
+ m_pMenuButton = new TQPushButton(__tr2qs("Test"),this);
g->addWidget(m_pMenuButton,0,2);
- connect(m_pMenuButton,SIGNAL(clicked()),this,SLOT(testPopup()));
+ connect(m_pMenuButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(testPopup()));
#ifdef COMPILE_USE_QT4
- QSplitter * spl = new QSplitter(Qt::Vertical,this,"popupeditor");
+ TQSplitter * spl = new TQSplitter(Qt::Vertical,this,"popupeditor");
spl->setOpaqueResize(false);
#else
- QSplitter * spl = new QSplitter(QSplitter::Vertical,this);
+ TQSplitter * spl = new TQSplitter(Qt::Vertical,this);
#endif
m_pListView = new KviTalListView(spl);
@@ -219,57 +219,57 @@ KviSinglePopupEditor::KviSinglePopupEditor(QWidget * par)
m_pListView->setSorting(-1);
- connect(m_pListView,SIGNAL(selectionChanged(KviTalListViewItem *)),this,SLOT(selectionChanged(KviTalListViewItem *)));
- connect(m_pListView,SIGNAL(rightButtonPressed(KviTalListViewItem *,const QPoint &,int)),
- this,SLOT(itemPressed(KviTalListViewItem *,const QPoint &,int)));
+ connect(m_pListView,TQT_SIGNAL(selectionChanged(KviTalListViewItem *)),this,TQT_SLOT(selectionChanged(KviTalListViewItem *)));
+ connect(m_pListView,TQT_SIGNAL(rightButtonPressed(KviTalListViewItem *,const TQPoint &,int)),
+ this,TQT_SLOT(itemPressed(KviTalListViewItem *,const TQPoint &,int)));
m_pEditor = KviScriptEditor::createInstance(spl);
g->addMultiCellWidget(spl,1,1,0,2);
- QLabel * l = new QLabel(__tr2qs("Text:"),this);
+ TQLabel * l = new TQLabel(__tr2qs("Text:"),this);
l->setMargin(2);
g->addWidget(l,2,0);
- m_pTextEditor = new QLineEdit(this);
- QToolTip::add(m_pTextEditor,
+ m_pTextEditor = new TQLineEdit(this);
+ TQToolTip::add(m_pTextEditor,
__tr2qs("<center><b>Visible text</b><br>May contain identifiers that will be evaluated at popup call time.<br>For labels, this text can contain also limited HTML tags.</center>"));
g->addMultiCellWidget(m_pTextEditor,2,2,1,2);
- l = new QLabel(__tr2qs("Condition:"),this);
+ l = new TQLabel(__tr2qs("Condition:"),this);
l->setMargin(2);
g->addWidget(l,3,0);
- m_pConditionEditor = new QLineEdit(this);
- QToolTip::add(m_pConditionEditor,
+ m_pConditionEditor = new TQLineEdit(this);
+ TQToolTip::add(m_pConditionEditor,
__tr2qs("<center><b>Boolean condition</b><br>Will be evaluated at popup call time in order to decide if this entry has to be shown.<br>An empty condition evaluates to true.</center>"));
g->addMultiCellWidget(m_pConditionEditor,3,3,1,2);
- l = new QLabel(__tr2qs("Icon:"),this);
+ l = new TQLabel(__tr2qs("Icon:"),this);
l->setMargin(2);
g->addWidget(l,4,0);
- m_pIconEditor = new QLineEdit(this);
- QToolTip::add(m_pIconEditor,
+ m_pIconEditor = new TQLineEdit(this);
+ TQToolTip::add(m_pIconEditor,
__tr2qs("<center><b>Icon identifier</b><br>May be an internal icon ID, an absolute path or a relative path.<br>Portable scripts should never use absolute paths.</center>"));
g->addMultiCellWidget(m_pIconEditor,4,4,1,2);
- l = new QLabel(__tr2qs("External menu:"),this);
+ l = new TQLabel(__tr2qs("External menu:"),this);
l->setMargin(2);
g->addWidget(l,5,0);
- m_pExtNameEditor = new QLineEdit(this);
- QToolTip::add(m_pExtNameEditor,
+ m_pExtNameEditor = new TQLineEdit(this);
+ TQToolTip::add(m_pExtNameEditor,
__tr2qs("<center><b>External menu name</b><br>This allows to nest externally defined popup menus. The popup menu with the specified name will be looked up at menu setup time.</center>"));
g->addMultiCellWidget(m_pExtNameEditor,5,5,1,2);
- l = new QLabel(__tr2qs("Item Id:"),this);
+ l = new TQLabel(__tr2qs("Item Id:"),this);
l->setMargin(2);
g->addWidget(l,6,0);
- m_pIdEditor = new QLineEdit(this);
- QToolTip::add(m_pIdEditor,
+ m_pIdEditor = new TQLineEdit(this);
+ TQToolTip::add(m_pIdEditor,
__tr2qs("<center><b>Item id</b><br>This will allow you to use delpopupitem later.</center>"));
g->addMultiCellWidget(m_pIdEditor,6,6,1,2);
@@ -292,13 +292,13 @@ void KviSinglePopupEditor::testPopup()
if(m_pTestPopup)delete m_pTestPopup;
m_pTestPopup = getMenu();
if(!m_pTestPopup)return;
- connect(m_pTestPopup,SIGNAL(testModeItemClicked(KviKvsPopupMenuItem *)),this,SLOT(testModeMenuItemClicked(KviKvsPopupMenuItem *)));
- QPoint pnt = m_pMenuButton->mapToGlobal(QPoint(0,m_pMenuButton->height()));
+ connect(m_pTestPopup,TQT_SIGNAL(testModeItemClicked(KviKvsPopupMenuItem *)),this,TQT_SLOT(testModeMenuItemClicked(KviKvsPopupMenuItem *)));
+ TQPoint pnt = m_pMenuButton->mapToGlobal(TQPoint(0,m_pMenuButton->height()));
KviKvsVariantList * parms = new KviKvsVariantList();
- parms->append(new KviKvsVariant(QString("test1")));
- parms->append(new KviKvsVariant(QString("test2")));
- parms->append(new KviKvsVariant(QString("test3")));
- parms->append(new KviKvsVariant(QString("test4")));
+ parms->append(new KviKvsVariant(TQString("test1")));
+ parms->append(new KviKvsVariant(TQString("test2")));
+ parms->append(new KviKvsVariant(TQString("test3")));
+ parms->append(new KviKvsVariant(TQString("test4")));
m_pTestPopup->doPopup(pnt,g_pActiveWindow,parms,true);
}
@@ -370,65 +370,65 @@ void KviSinglePopupEditor::testModeMenuItemClicked(KviKvsPopupMenuItem * it)
}
-void KviSinglePopupEditor::itemPressed(KviTalListViewItem *it,const QPoint &pnt,int col)
+void KviSinglePopupEditor::itemPressed(KviTalListViewItem *it,const TQPoint &pnt,int col)
{
m_pContextPopup->clear();
- KviPopupListViewItem * parentMenu = 0;
+ KviPopupListViewItem * tqparentMenu = 0;
bool bIsMenu = false;
if(it)
{
- parentMenu = (KviPopupListViewItem *) (((KviPopupListViewItem *)it)->parent());
+ tqparentMenu = (KviPopupListViewItem *) (((KviPopupListViewItem *)it)->tqparent());
bIsMenu = ((KviPopupListViewItem *)it)->m_type == KviPopupListViewItem::Menu;
}
- m_pContextPopup->insertItem(__tr2qs("New Separator Below"),this,SLOT(contextNewSeparatorBelow()));
+ m_pContextPopup->insertItem(__tr2qs("New Separator Below"),this,TQT_SLOT(contextNewSeparatorBelow()));
m_pContextPopup->setItemEnabled(
- m_pContextPopup->insertItem(__tr2qs("New Separator Above"),this,SLOT(contextNewSeparatorAbove())),
+ m_pContextPopup->insertItem(__tr2qs("New Separator Above"),this,TQT_SLOT(contextNewSeparatorAbove())),
it);
m_pContextPopup->setItemEnabled(
- m_pContextPopup->insertItem(__tr2qs("New Separator Inside"),this,SLOT(contextNewSeparatorInside())),
+ m_pContextPopup->insertItem(__tr2qs("New Separator Inside"),this,TQT_SLOT(contextNewSeparatorInside())),
it && bIsMenu);
m_pContextPopup->insertSeparator();
- m_pContextPopup->insertItem(__tr2qs("New Label Below"),this,SLOT(contextNewLabelBelow()));
+ m_pContextPopup->insertItem(__tr2qs("New Label Below"),this,TQT_SLOT(contextNewLabelBelow()));
m_pContextPopup->setItemEnabled(
- m_pContextPopup->insertItem(__tr2qs("New Label Above"),this,SLOT(contextNewLabelAbove())),
+ m_pContextPopup->insertItem(__tr2qs("New Label Above"),this,TQT_SLOT(contextNewLabelAbove())),
it);
m_pContextPopup->setItemEnabled(
- m_pContextPopup->insertItem(__tr2qs("New Label Inside"),this,SLOT(contextNewLabelInside())),
+ m_pContextPopup->insertItem(__tr2qs("New Label Inside"),this,TQT_SLOT(contextNewLabelInside())),
it && bIsMenu);
m_pContextPopup->insertSeparator();
- m_pContextPopup->insertItem(__tr2qs("New Item Below"),this,SLOT(contextNewItemBelow()));
+ m_pContextPopup->insertItem(__tr2qs("New Item Below"),this,TQT_SLOT(contextNewItemBelow()));
m_pContextPopup->setItemEnabled(
- m_pContextPopup->insertItem(__tr2qs("New Item Above"),this,SLOT(contextNewItemAbove())),
+ m_pContextPopup->insertItem(__tr2qs("New Item Above"),this,TQT_SLOT(contextNewItemAbove())),
it);
m_pContextPopup->setItemEnabled(
- m_pContextPopup->insertItem(__tr2qs("New Item Inside"),this,SLOT(contextNewItemInside())),
+ m_pContextPopup->insertItem(__tr2qs("New Item Inside"),this,TQT_SLOT(contextNewItemInside())),
it && bIsMenu);
m_pContextPopup->insertSeparator();
- m_pContextPopup->insertItem(__tr2qs("New Menu Below"),this,SLOT(contextNewMenuBelow()));
+ m_pContextPopup->insertItem(__tr2qs("New Menu Below"),this,TQT_SLOT(contextNewMenuBelow()));
m_pContextPopup->setItemEnabled(
- m_pContextPopup->insertItem(__tr2qs("New Menu Above"),this,SLOT(contextNewMenuAbove())),
+ m_pContextPopup->insertItem(__tr2qs("New Menu Above"),this,TQT_SLOT(contextNewMenuAbove())),
it);
m_pContextPopup->setItemEnabled(
- m_pContextPopup->insertItem(__tr2qs("New Menu Inside"),this,SLOT(contextNewMenuInside())),
+ m_pContextPopup->insertItem(__tr2qs("New Menu Inside"),this,TQT_SLOT(contextNewMenuInside())),
it && bIsMenu);
m_pContextPopup->insertSeparator();
- m_pContextPopup->insertItem(__tr2qs("New External Menu Below"),this,SLOT(contextNewExtMenuBelow()));
+ m_pContextPopup->insertItem(__tr2qs("New External Menu Below"),this,TQT_SLOT(contextNewExtMenuBelow()));
m_pContextPopup->setItemEnabled(
- m_pContextPopup->insertItem(__tr2qs("New External Menu Above"),this,SLOT(contextNewExtMenuAbove())),
+ m_pContextPopup->insertItem(__tr2qs("New External Menu Above"),this,TQT_SLOT(contextNewExtMenuAbove())),
it);
m_pContextPopup->setItemEnabled(
- m_pContextPopup->insertItem(__tr2qs("New External Menu Inside"),this,SLOT(contextNewExtMenuInside())),
+ m_pContextPopup->insertItem(__tr2qs("New External Menu Inside"),this,TQT_SLOT(contextNewExtMenuInside())),
it && bIsMenu);
m_pContextPopup->insertSeparator();
@@ -437,48 +437,48 @@ void KviSinglePopupEditor::itemPressed(KviTalListViewItem *it,const QPoint &pnt,
m_pContextPopup->insertItem(
*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CUT)),
__tr2qs("Cu&t"),
- this,SLOT(contextCut())),
+ this,TQT_SLOT(contextCut())),
it);
m_pContextPopup->setItemEnabled(
m_pContextPopup->insertItem(
*(g_pIconManager->getSmallIcon(KVI_SMALLICON_COPY)),
__tr2qs("&Copy"),
- this,SLOT(contextCopy())),
+ this,TQT_SLOT(contextCopy())),
it);
m_pContextPopup->setItemEnabled(
m_pContextPopup->insertItem(
*(g_pIconManager->getSmallIcon(KVI_SMALLICON_PASTE)),
- __tr2qs("&Paste Below"),this,SLOT(contextPasteBelow())),
+ __tr2qs("&Paste Below"),this,TQT_SLOT(contextPasteBelow())),
m_pClipboard);
m_pContextPopup->setItemEnabled(
m_pContextPopup->insertItem(
*(g_pIconManager->getSmallIcon(KVI_SMALLICON_PASTE)),
- __tr2qs("Paste Above"),this,SLOT(contextPasteAbove())),
+ __tr2qs("Paste Above"),this,TQT_SLOT(contextPasteAbove())),
it && m_pClipboard);
m_pContextPopup->setItemEnabled(
m_pContextPopup->insertItem(
*(g_pIconManager->getSmallIcon(KVI_SMALLICON_PASTE)),
- __tr2qs("Paste Inside"),this,SLOT(contextPasteInside())),
+ __tr2qs("Paste Inside"),this,TQT_SLOT(contextPasteInside())),
it && bIsMenu && m_pClipboard);
bool bSeparatorInserted = false;
-// if(!findPrologue(parentMenu))
+// if(!findPrologue(tqparentMenu))
// {
m_pContextPopup->insertSeparator();
bSeparatorInserted = true;
m_pContextPopup->insertItem(
*(g_pIconManager->getSmallIcon(KVI_SMALLICON_PROLOGUE)),
- __tr2qs("New Menu Prologue"),this,SLOT(contextNewPrologue()));
+ __tr2qs("New Menu Prologue"),this,TQT_SLOT(contextNewPrologue()));
// }
-// if(!findEpilogue(parentMenu))
+// if(!findEpilogue(tqparentMenu))
// {
if(!bSeparatorInserted)m_pContextPopup->insertSeparator();
m_pContextPopup->insertItem(
*(g_pIconManager->getSmallIcon(KVI_SMALLICON_EPILOGUE)),
- __tr2qs("New Menu Epilogue"),this,SLOT(contextNewEpilogue()));
+ __tr2qs("New Menu Epilogue"),this,TQT_SLOT(contextNewEpilogue()));
// }
m_pContextPopup->popup(pnt);
@@ -584,13 +584,13 @@ KviPopupListViewItem * KviSinglePopupEditor::newItem(KviPopupListViewItem * par,
KviPopupListViewItem * KviSinglePopupEditor::newItemBelow(KviPopupListViewItem * it,KviPopupListViewItem::Type t)
{
if(!it)return newItem(0,0,t);
- return newItem((KviPopupListViewItem *)it->parent(),it,t);
+ return newItem((KviPopupListViewItem *)it->tqparent(),it,t);
}
KviPopupListViewItem * KviSinglePopupEditor::newItemAbove(KviPopupListViewItem * it,KviPopupListViewItem::Type t)
{
if(!it)return newItem(0,0,t);
- return newItem((KviPopupListViewItem *)it->parent(),(KviPopupListViewItem *)it->itemAbove(),t);
+ return newItem((KviPopupListViewItem *)it->tqparent(),(KviPopupListViewItem *)it->itemAbove(),t);
}
KviPopupListViewItem * KviSinglePopupEditor::newItemInside(KviPopupListViewItem * it,KviPopupListViewItem::Type t)
@@ -607,7 +607,7 @@ KviPopupListViewItem * KviSinglePopupEditor::newItemInside(KviPopupListViewItem
void KviSinglePopupEditor::contextNewPrologue()
{
- KviPopupListViewItem * it = m_pLastSelectedItem ? (KviPopupListViewItem *)m_pLastSelectedItem->parent() : 0;
+ KviPopupListViewItem * it = m_pLastSelectedItem ? (KviPopupListViewItem *)m_pLastSelectedItem->tqparent() : 0;
// if(!findPrologue(it))
// {
m_pListView->setCurrentItem(newItem(it,it,KviPopupListViewItem::Prologue));
@@ -616,7 +616,7 @@ void KviSinglePopupEditor::contextNewPrologue()
void KviSinglePopupEditor::contextNewEpilogue()
{
- KviPopupListViewItem * it = m_pLastSelectedItem ? (KviPopupListViewItem *)m_pLastSelectedItem->parent() : 0;
+ KviPopupListViewItem * it = m_pLastSelectedItem ? (KviPopupListViewItem *)m_pLastSelectedItem->tqparent() : 0;
// if(!findEpilogue(it))
// {
KviPopupListViewItem * after = it ? (KviPopupListViewItem *)it->firstChild() : (KviPopupListViewItem *)m_pListView->firstChild();
@@ -653,14 +653,14 @@ void KviSinglePopupEditor::contextCut()
void KviSinglePopupEditor::contextPasteBelow()
{
if(!m_pClipboard)return;
- KviPopupListViewItem * par = m_pLastSelectedItem ? (KviPopupListViewItem *)m_pLastSelectedItem->parent() : 0;
+ KviPopupListViewItem * par = m_pLastSelectedItem ? (KviPopupListViewItem *)m_pLastSelectedItem->tqparent() : 0;
populateMenu(m_pClipboard,par,m_pLastSelectedItem);
}
void KviSinglePopupEditor::contextPasteAbove()
{
if(!m_pClipboard)return;
- KviPopupListViewItem * par = m_pLastSelectedItem ? (KviPopupListViewItem *)m_pLastSelectedItem->parent() : 0;
+ KviPopupListViewItem * par = m_pLastSelectedItem ? (KviPopupListViewItem *)m_pLastSelectedItem->tqparent() : 0;
KviPopupListViewItem * above = m_pLastSelectedItem ? (KviPopupListViewItem *)m_pLastSelectedItem->itemAbove() : 0;
populateMenu(m_pClipboard,par,above);
@@ -685,7 +685,7 @@ void KviSinglePopupEditor::saveLastSelectedItem()
{
if(!m_pLastSelectedItem)return;
- QString tmp;
+ TQString tmp;
switch(m_pLastSelectedItem->m_type)
{
@@ -693,7 +693,7 @@ void KviSinglePopupEditor::saveLastSelectedItem()
case KviPopupListViewItem::Epilogue:
case KviPopupListViewItem::Item:
{
- QString tmpx;
+ TQString tmpx;
m_pEditor->getText(tmpx);
m_pLastSelectedItem->setCode(tmpx);
}
@@ -792,7 +792,7 @@ KviKvsPopupMenu * KviSinglePopupEditor::getMenu()
{
saveLastSelectedItem();
- QString tmp = m_pNameEditor->text();
+ TQString tmp = m_pNameEditor->text();
tmp.stripWhiteSpace();
KviKvsPopupMenu * p = new KviKvsPopupMenu(tmp);
@@ -898,27 +898,27 @@ void KviSinglePopupEditor::populateMenu(KviKvsPopupMenu * pop,KviPopupListViewIt
case KviKvsPopupMenuItem::Item:
if(par)theItem = new KviPopupListViewItem(par,theItem,KviPopupListViewItem::Item);
else theItem = new KviPopupListViewItem(m_pListView,theItem,KviPopupListViewItem::Item);
- theItem->setIcon(item->kvsIcon() ? item->kvsIcon()->code() : QString::null);
- theItem->setItemText(item->kvsText() ? item->kvsText()->code() : QString::null);
- theItem->setCondition(item->kvsCondition() ? item->kvsCondition()->code() : QString::null);
- theItem->setCode(item->kvsCode() ? item->kvsCode()->code() : QString::null);
+ theItem->setIcon(item->kvsIcon() ? item->kvsIcon()->code() : TQString());
+ theItem->setItemText(item->kvsText() ? item->kvsText()->code() : TQString());
+ theItem->setCondition(item->kvsCondition() ? item->kvsCondition()->code() : TQString());
+ theItem->setCode(item->kvsCode() ? item->kvsCode()->code() : TQString());
theItem->setId(item->name());
break;
case KviKvsPopupMenuItem::ExtMenu:
if(par)theItem = new KviPopupListViewItem(par,theItem,KviPopupListViewItem::ExtMenu);
else theItem = new KviPopupListViewItem(m_pListView,theItem,KviPopupListViewItem::ExtMenu);
- theItem->setIcon(item->kvsIcon() ? item->kvsIcon()->code() : QString::null);
- theItem->setItemText(item->kvsText() ? item->kvsText()->code() : QString::null);
- theItem->setCondition(item->kvsCondition() ? item->kvsCondition()->code() : QString::null);
+ theItem->setIcon(item->kvsIcon() ? item->kvsIcon()->code() : TQString());
+ theItem->setItemText(item->kvsText() ? item->kvsText()->code() : TQString());
+ theItem->setCondition(item->kvsCondition() ? item->kvsCondition()->code() : TQString());
theItem->setCode(((KviKvsPopupMenuItemExtMenu *)item)->extName());
theItem->setId(item->name());
break;
case KviKvsPopupMenuItem::Label:
if(par)theItem = new KviPopupListViewItem(par,theItem,KviPopupListViewItem::Label);
else theItem = new KviPopupListViewItem(m_pListView,theItem,KviPopupListViewItem::Label);
- theItem->setIcon(item->kvsIcon() ? item->kvsIcon()->code() : QString::null);
- theItem->setItemText(item->kvsText() ? item->kvsText()->code() : QString::null);
- theItem->setCondition(item->kvsCondition() ? item->kvsCondition()->code() : QString::null);
+ theItem->setIcon(item->kvsIcon() ? item->kvsIcon()->code() : TQString());
+ theItem->setItemText(item->kvsText() ? item->kvsText()->code() : TQString());
+ theItem->setCondition(item->kvsCondition() ? item->kvsCondition()->code() : TQString());
theItem->setId(item->name());
break;
case KviKvsPopupMenuItem::Separator:
@@ -929,9 +929,9 @@ void KviSinglePopupEditor::populateMenu(KviKvsPopupMenu * pop,KviPopupListViewIt
case KviKvsPopupMenuItem::Menu:
if(par)theItem = new KviPopupListViewItem(par,theItem,KviPopupListViewItem::Menu);
else theItem = new KviPopupListViewItem(m_pListView,theItem,KviPopupListViewItem::Menu);
- theItem->setIcon(item->kvsIcon() ? item->kvsIcon()->code() : QString::null);
- theItem->setItemText(item->kvsText() ? item->kvsText()->code() : QString::null);
- theItem->setCondition(item->kvsCondition() ? item->kvsCondition()->code() : QString::null);
+ theItem->setIcon(item->kvsIcon() ? item->kvsIcon()->code() : TQString());
+ theItem->setItemText(item->kvsText() ? item->kvsText()->code() : TQString());
+ theItem->setCondition(item->kvsCondition() ? item->kvsCondition()->code() : TQString());
theItem->setId(item->name());
populateMenu(((KviKvsPopupMenuItemMenu *)item)->menu(),theItem,0);
break;
@@ -1024,15 +1024,15 @@ void KviMenuListViewItem::replacePopup(KviKvsPopupMenu * popup)
}
-KviPopupEditor::KviPopupEditor(QWidget * par)
-: QWidget(par)
+KviPopupEditor::KviPopupEditor(TQWidget * par)
+: TQWidget(par)
{
- QGridLayout * l = new QGridLayout(this,1,1,0,2);
+ TQGridLayout * l = new TQGridLayout(this,1,1,0,2);
#ifdef COMPILE_USE_QT4
- QSplitter * spl = new QSplitter(Qt::Horizontal,this,"popupeditor");
+ TQSplitter * spl = new TQSplitter(Qt::Horizontal,this,"popupeditor");
spl->setOpaqueResize(false);
#else
- QSplitter * spl = new QSplitter(QSplitter::Horizontal,this);
+ TQSplitter * spl = new TQSplitter(Qt::Horizontal,this);
#endif
l->addWidget(spl,0,0);
@@ -1043,10 +1043,10 @@ KviPopupEditor::KviPopupEditor(QWidget * par)
m_pListView->setSelectionMode(KviTalListView::Extended);
m_pListView->setShowSortIndicator(true);
- QPushButton * pb = new QPushButton(__tr2qs("&Export All To..."),box);
- connect(pb,SIGNAL(clicked()),this,SLOT(exportAll()));
- QPushButton * gn = new QPushButton(__tr2qs("&Export selected To..."),box);
- connect(gn,SIGNAL(clicked()),this,SLOT(exportSelected()));
+ TQPushButton * pb = new TQPushButton(__tr2qs("&Export All To..."),box);
+ connect(pb,TQT_SIGNAL(clicked()),this,TQT_SLOT(exportAll()));
+ TQPushButton * gn = new TQPushButton(__tr2qs("&Export selected To..."),box);
+ connect(gn,TQT_SIGNAL(clicked()),this,TQT_SLOT(exportSelected()));
m_pEditor = new KviSinglePopupEditor(spl);
@@ -1067,10 +1067,10 @@ void KviPopupEditor::oneTimeSetup()
if(m_bOneTimeSetupDone)return;
m_bOneTimeSetupDone = true;
- const KviPointerHashTable<QString,KviKvsPopupMenu> * a = KviKvsPopupManager::instance()->popupDict();
+ const KviPointerHashTable<TQString,KviKvsPopupMenu> * a = KviKvsPopupManager::instance()->popupDict();
if(!a)return;
- KviPointerHashTableIterator<QString,KviKvsPopupMenu> it(*a);
+ KviPointerHashTableIterator<TQString,KviKvsPopupMenu> it(*a);
KviMenuListViewItem * item;
@@ -1083,13 +1083,13 @@ void KviPopupEditor::oneTimeSetup()
++it;
}
- connect(m_pListView,SIGNAL(currentChanged(KviTalListViewItem *)),this,SLOT(currentItemChanged(KviTalListViewItem *)));
- connect(m_pListView,SIGNAL(rightButtonPressed(KviTalListViewItem *,const QPoint &,int)),
- this,SLOT(itemPressed(KviTalListViewItem *,const QPoint &,int)));
+ connect(m_pListView,TQT_SIGNAL(currentChanged(KviTalListViewItem *)),this,TQT_SLOT(currentItemChanged(KviTalListViewItem *)));
+ connect(m_pListView,TQT_SIGNAL(rightButtonPressed(KviTalListViewItem *,const TQPoint &,int)),
+ this,TQT_SLOT(itemPressed(KviTalListViewItem *,const TQPoint &,int)));
}
-void KviPopupEditor::itemPressed(KviTalListViewItem *it,const QPoint &pnt,int col)
+void KviPopupEditor::itemPressed(KviTalListViewItem *it,const TQPoint &pnt,int col)
{
__range_valid(m_bOneTimeSetupDone);
m_pContextPopup->clear();
@@ -1097,20 +1097,20 @@ void KviPopupEditor::itemPressed(KviTalListViewItem *it,const QPoint &pnt,int co
m_pContextPopup->insertItem(
*(g_pIconManager->getSmallIcon(KVI_SMALLICON_POPUP)),
__tr2qs("&New Popup"),
- this,SLOT(newPopup()));
+ this,TQT_SLOT(newPopup()));
m_pContextPopup->setItemEnabled(
m_pContextPopup->insertItem(
- *(g_pIconManager->getSmallIcon(KVI_SMALLICON_QUIT)),
+ *(g_pIconManager->getSmallIcon(KVI_SMALLICON_TQUIT)),
__tr2qs("Re&move Popup"),
- this,SLOT(removeCurrentPopup())),
+ this,TQT_SLOT(removeCurrentPopup())),
it);
m_pContextPopup->setItemEnabled(
m_pContextPopup->insertItem(
*(g_pIconManager->getSmallIcon(KVI_SMALLICON_FOLDER)),
__tr2qs("&Export Popup To..."),
- this,SLOT(exportCurrentPopup())),
+ this,TQT_SLOT(exportCurrentPopup())),
it);
m_pContextPopup->popup(pnt);
@@ -1123,21 +1123,21 @@ void KviPopupEditor::exportCurrentPopup()
saveLastEditedItem();
if(!m_pLastEditedItem)return;
- QString szName = QDir::homeDirPath();
- if(!szName.endsWith(QString(KVI_PATH_SEPARATOR)))szName += KVI_PATH_SEPARATOR;
+ TQString szName = TQDir::homeDirPath();
+ if(!szName.endsWith(TQString(KVI_PATH_SEPARATOR)))szName += KVI_PATH_SEPARATOR;
szName += m_pLastEditedItem->popup()->name();
szName += ".kvs";
- QString szFile;
+ TQString szFile;
if(!KviFileDialog::askForSaveFileName(szFile,__tr2qs("Choose a Filename - KVIrc"),szName,"*.kvs",true,true,true))return;
- QString szOut;
+ TQString szOut;
m_pLastEditedItem->popup()->generateDefPopup(szOut);
if(!KviFileUtils::writeFile(szFile,szOut))
{
- QMessageBox::warning(this,__tr2qs("Write Failed - KVIrc"),__tr2qs("Unable to write to the popup file."),__tr2qs("Ok"));
+ TQMessageBox::warning(this,__tr2qs("Write Failed - KVIrc"),__tr2qs("Unable to write to the popup file."),__tr2qs("Ok"));
}
}
@@ -1159,7 +1159,7 @@ void KviPopupEditor::exportPopups(bool bSelectedOnly)
KviMenuListViewItem * it = (KviMenuListViewItem *)m_pListView->firstChild();
- QString out;
+ TQString out;
int count=0;
KviTalListViewItemIterator itv( m_pListView );
@@ -1168,7 +1168,7 @@ void KviPopupEditor::exportPopups(bool bSelectedOnly)
if ( (itv.current()->isSelected()) || (bSelectedOnly == true) )
{
count ++;
- QString tmp;
+ TQString tmp;
it->popup()->generateDefPopup(tmp);
out += tmp;
out += "\n";
@@ -1178,17 +1178,17 @@ void KviPopupEditor::exportPopups(bool bSelectedOnly)
}
if (!count && bSelectedOnly==false) return;
- QString szName = QDir::homeDirPath();
- if(!szName.endsWith(QString(KVI_PATH_SEPARATOR)))szName += KVI_PATH_SEPARATOR;
+ TQString szName = TQDir::homeDirPath();
+ if(!szName.endsWith(TQString(KVI_PATH_SEPARATOR)))szName += KVI_PATH_SEPARATOR;
szName += "popups.kvs";
- QString szFile;
+ TQString szFile;
if(!KviFileDialog::askForSaveFileName(szFile,__tr2qs("Choose a Filename - KVIrc"),szName,"*.kvs",true,true,true))return;
if(!KviFileUtils::writeFile(szFile,out))
{
- QMessageBox::warning(this,__tr2qs("Write Failed - KVIrc"),__tr2qs("Unable to write to the alias file."),__tr2qs("Ok"));
+ TQMessageBox::warning(this,__tr2qs("Write Failed - KVIrc"),__tr2qs("Unable to write to the alias file."),__tr2qs("Ok"));
}
}
@@ -1206,7 +1206,7 @@ void KviPopupEditor::removeCurrentPopup()
void KviPopupEditor::newPopup()
{
- QString newName;
+ TQString newName;
getUniquePopupName(0,newName);
KviMenuListViewItem * it = new KviMenuListViewItem(m_pListView,new KviKvsPopupMenu(newName));
m_pListView->setCurrentItem(it);
@@ -1217,9 +1217,9 @@ void KviPopupEditor::saveLastEditedItem()
if(m_pLastEditedItem == 0)return;
KviKvsPopupMenu * m = m_pEditor->getMenu();
- QString tmp = m->popupName();
- QString old = m_pLastEditedItem->m_pPopup->popupName();
- if(!KviQString::equalCI(tmp,old))
+ TQString tmp = m->popupName();
+ TQString old = m_pLastEditedItem->m_pPopup->popupName();
+ if(!KviTQString::equalCI(tmp,old))
{
getUniquePopupName(m_pLastEditedItem,tmp);
m->setPopupName(tmp);
@@ -1238,10 +1238,10 @@ void KviPopupEditor::currentItemChanged(KviTalListViewItem *it)
m_pEditor->edit(m_pLastEditedItem);
}
-void KviPopupEditor::showEvent(QShowEvent *e)
+void KviPopupEditor::showEvent(TQShowEvent *e)
{
oneTimeSetup();
- QWidget::showEvent(e);
+ TQWidget::showEvent(e);
}
void KviPopupEditor::commit()
@@ -1255,7 +1255,7 @@ void KviPopupEditor::commit()
KviMenuListViewItem * it = (KviMenuListViewItem *)m_pListView->firstChild();
// Copy the original popup dict
- KviPointerHashTable<QString,KviKvsPopupMenu> copy(*(KviKvsPopupManager::instance()->popupDict()));
+ KviPointerHashTable<TQString,KviKvsPopupMenu> copy(*(KviKvsPopupManager::instance()->popupDict()));
copy.setAutoDelete(false);
while(it)
@@ -1270,7 +1270,7 @@ void KviPopupEditor::commit()
// the remaining elements in the copy need to be removed from
// the "new" dictionary (they are no longer used)
- KviPointerHashTableIterator<QString,KviKvsPopupMenu> iter(copy);
+ KviPointerHashTableIterator<TQString,KviKvsPopupMenu> iter(copy);
while(iter.current())
{
@@ -1283,12 +1283,12 @@ void KviPopupEditor::commit()
}
-void KviPopupEditor::getUniquePopupName(KviMenuListViewItem *item,QString &buffer)
+void KviPopupEditor::getUniquePopupName(KviMenuListViewItem *item,TQString &buffer)
{
__range_valid(m_bOneTimeSetupDone);
if(buffer.isEmpty())buffer = __tr2qs("unnamed");
- QString newName = buffer;
+ TQString newName = buffer;
bool bFound = true;
int idx = 1;
@@ -1299,10 +1299,10 @@ void KviPopupEditor::getUniquePopupName(KviMenuListViewItem *item,QString &buffe
for(KviMenuListViewItem * ch = (KviMenuListViewItem *)(m_pListView->firstChild());ch;ch = (KviMenuListViewItem *)ch->nextSibling())
{
- if(KviQString::equalCI(newName,ch->m_pPopup->popupName()) && (ch != item))
+ if(KviTQString::equalCI(newName,ch->m_pPopup->popupName()) && (ch != item))
{
bFound = true;
- KviQString::sprintf(newName,"%Q.%d",&buffer,idx);
+ KviTQString::sprintf(newName,"%Q.%d",&buffer,idx);
idx++;
break;
}
@@ -1322,21 +1322,21 @@ KviPopupEditorWindow::KviPopupEditorWindow(KviFrame * lpFrm)
m_pEditor = new KviPopupEditor(this);
- m_pBase = new QWidget(this);
- QGridLayout * g = new QGridLayout(m_pBase,1,4,4,4);
+ m_pBase = new TQWidget(this);
+ TQGridLayout * g = new TQGridLayout(m_pBase,1,4,4,4);
- QPushButton * btn = new QPushButton(__tr2qs("&OK"),m_pBase);
- connect(btn,SIGNAL(clicked()),this,SLOT(okClicked()));
+ TQPushButton * btn = new TQPushButton(__tr2qs("&OK"),m_pBase);
+ connect(btn,TQT_SIGNAL(clicked()),this,TQT_SLOT(okClicked()));
btn->setIconSet(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_ACCEPT)));
g->addWidget(btn,0,1);
- btn = new QPushButton(__tr2qs("&Apply"),m_pBase);
- connect(btn,SIGNAL(clicked()),this,SLOT(applyClicked()));
+ btn = new TQPushButton(__tr2qs("&Apply"),m_pBase);
+ connect(btn,TQT_SIGNAL(clicked()),this,TQT_SLOT(applyClicked()));
btn->setIconSet(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_ACCEPT)));
g->addWidget(btn,0,2);
- btn = new QPushButton(__tr2qs("Cancel"),m_pBase);
- connect(btn,SIGNAL(clicked()),this,SLOT(cancelClicked()));
+ btn = new TQPushButton(__tr2qs("Cancel"),m_pBase);
+ connect(btn,TQT_SIGNAL(clicked()),this,TQT_SLOT(cancelClicked()));
btn->setIconSet(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_DISCARD)));
g->addWidget(btn,0,3);
@@ -1365,14 +1365,14 @@ void KviPopupEditorWindow::cancelClicked()
}
-QPixmap * KviPopupEditorWindow::myIconPtr()
+TQPixmap * KviPopupEditorWindow::myIconPtr()
{
return g_pIconManager->getSmallIcon(KVI_SMALLICON_POPUP);
}
-void KviPopupEditorWindow::resizeEvent(QResizeEvent *e)
+void KviPopupEditorWindow::resizeEvent(TQResizeEvent *e)
{
- int hght = m_pBase->sizeHint().height();
+ int hght = m_pBase->tqsizeHint().height();
m_pEditor->setGeometry(0,0,width(),height()- hght);
m_pBase->setGeometry(0,height() - hght,width(),hght);
}
@@ -1381,9 +1381,9 @@ void KviPopupEditorWindow::fillCaptionBuffers()
{
m_szPlainTextCaption = __tr2qs("Popup Editor");
- static QString p1("<nobr><font color=\"");
- static QString p2("\"><b>");
- static QString p3("</b></font></nobr>");
+ static TQString p1("<nobr><font color=\"");
+ static TQString p2("\"><b>");
+ static TQString p3("</b></font></nobr>");
m_szHtmlActiveCaption = p1;
m_szHtmlActiveCaption += KVI_OPTION_COLOR(KviOption_colorCaptionTextActive).name();
@@ -1421,7 +1421,7 @@ void KviPopupEditorWindow::loadProperties(KviConfig *cfg)
{
/*
#ifdef COMPILE_SCRIPTTOOLBAR
- QValueList<int> def;
+ TQValueList<int> def;
def.append(20);
def.append(80);
m_pEditor->setSizes(cfg->readIntListEntry("Sizes",def));