summaryrefslogtreecommitdiffstats
path: root/src/modules/raweditor
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/raweditor')
-rw-r--r--src/modules/raweditor/raweditor.cpp156
-rw-r--r--src/modules/raweditor/raweditor.h42
2 files changed, 100 insertions, 98 deletions
diff --git a/src/modules/raweditor/raweditor.cpp b/src/modules/raweditor/raweditor.cpp
index 72b3888b..662dc371 100644
--- a/src/modules/raweditor/raweditor.cpp
+++ b/src/modules/raweditor/raweditor.cpp
@@ -36,14 +36,14 @@
#include "kvi_kvs_eventmanager.h"
#include "kvi_kvs_eventhandler.h"
-#include <qmessagebox.h>
-#include <qsplitter.h>
-#include <qlayout.h>
+#include <tqmessagebox.h>
+#include <tqsplitter.h>
+#include <tqlayout.h>
#include "kvi_tal_vbox.h"
#include "kvi_tal_popupmenu.h"
-#include <qtooltip.h>
-#include <qinputdialog.h>
-#include <qpushbutton.h>
+#include <tqtooltip.h>
+#include <tqinputdialog.h>
+#include <tqpushbutton.h>
extern KviRawEditorWindow * g_pRawEditorWindow;
@@ -58,27 +58,27 @@ KviRawListViewItem::KviRawListViewItem(KviTalListView *par,int idx)
if(idx < 10)m_szName.prepend('0');
};
-const QPixmap * KviRawListViewItem::pixmap(int col) const
+const TQPixmap * KviRawListViewItem::pixmap(int col) const
{
return g_pIconManager->getSmallIcon(firstChild() ? KVI_SMALLICON_RAWEVENT : KVI_SMALLICON_RAWEVENTNOHANDLERS);
}
-const QPixmap * KviRawHandlerListViewItem::pixmap(int col) const
+const TQPixmap * KviRawHandlerListViewItem::pixmap(int col) const
{
return g_pIconManager->getSmallIcon(m_bEnabled ? KVI_SMALLICON_HANDLER : KVI_SMALLICON_HANDLERDISABLED);
}
-KviRawEditor::KviRawEditor(QWidget * par)
-: QWidget(par,"raw_event_editor")
+KviRawEditor::KviRawEditor(TQWidget * par)
+: TQWidget(par,"raw_event_editor")
{
- QGridLayout * l = new QGridLayout(this,1,1,2,2);
+ TQGridLayout * l = new TQGridLayout(this,1,1,2,2);
#ifdef COMPILE_USE_QT4
- QSplitter * spl = new QSplitter(Qt::Horizontal,this,"raweditorv");
+ TQSplitter * spl = new TQSplitter(Qt::Horizontal,this,"raweditorv");
spl->setOpaqueResize(false);
#else
- QSplitter * spl = new QSplitter(QSplitter::Horizontal,this);
+ TQSplitter * spl = new TQSplitter(Qt::Horizontal,this);
#endif
l->addWidget(spl,0,0);
@@ -89,12 +89,12 @@ KviRawEditor::KviRawEditor(QWidget * par)
m_pListView->setShowSortIndicator(true);
m_pListView->setRootIsDecorated(true);
- QPushButton * pb = new QPushButton(__tr2qs("&Export All To..."),boxi);
- connect(pb,SIGNAL(clicked()),this,SLOT(exportAllEvents()));
+ TQPushButton * pb = new TQPushButton(__tr2qs("&Export All To..."),boxi);
+ connect(pb,TQT_SIGNAL(clicked()),this,TQT_SLOT(exportAllEvents()));
KviTalVBox * box = new KviTalVBox(spl);
- m_pNameEditor = new QLineEdit(box);
- QToolTip::add(m_pNameEditor,__tr2qs("Edit the raw event handler name."));
+ m_pNameEditor = new TQLineEdit(box);
+ TQToolTip::add(m_pNameEditor,__tr2qs("Edit the raw event handler name."));
m_pEditor = KviScriptEditor::createInstance(box);
m_bOneTimeSetupDone = false;
@@ -135,41 +135,41 @@ void KviRawEditor::oneTimeSetup()
m_pContextPopup = new KviTalPopupMenu(this);
- 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)));
}
-void KviRawEditor::itemPressed(KviTalListViewItem *it,const QPoint &pnt,int col)
+void KviRawEditor::itemPressed(KviTalListViewItem *it,const TQPoint &pnt,int col)
{
__range_valid(m_bOneTimeSetupDone);
m_pContextPopup->clear();
if(it)
{
- if(it->parent())
+ if(it->tqparent())
{
if(!(((KviRawHandlerListViewItem *)it)->m_bEnabled))
m_pContextPopup->insertItem(
*(g_pIconManager->getSmallIcon(KVI_SMALLICON_HANDLER)),
- __tr2qs("&Enable Handler"),this,SLOT(toggleCurrentHandlerEnabled()));
+ __tr2qs("&Enable Handler"),this,TQT_SLOT(toggleCurrentHandlerEnabled()));
else
m_pContextPopup->insertItem(
*(g_pIconManager->getSmallIcon(KVI_SMALLICON_HANDLERDISABLED)),
- __tr2qs("&Disable Handler"),this,SLOT(toggleCurrentHandlerEnabled()));
+ __tr2qs("&Disable Handler"),this,TQT_SLOT(toggleCurrentHandlerEnabled()));
m_pContextPopup->insertItem(
- *(g_pIconManager->getSmallIcon(KVI_SMALLICON_QUIT)),
+ *(g_pIconManager->getSmallIcon(KVI_SMALLICON_TQUIT)),
__tr2qs("Re&move Handler"),
- this,SLOT(removeCurrentHandler()));
+ this,TQT_SLOT(removeCurrentHandler()));
m_pContextPopup->insertItem(
*(g_pIconManager->getSmallIcon(KVI_SMALLICON_FOLDER)),
__tr2qs("&Export Handler To..."),
- this,SLOT(exportCurrentHandler()));
+ this,TQT_SLOT(exportCurrentHandler()));
} else {
m_pContextPopup->insertItem(
*(g_pIconManager->getSmallIcon(KVI_SMALLICON_HANDLER)),
__tr2qs("&New Handler"),
- this,SLOT(addHandlerForCurrentRaw()));
+ this,TQT_SLOT(addHandlerForCurrentRaw()));
}
}
@@ -177,16 +177,16 @@ void KviRawEditor::itemPressed(KviTalListViewItem *it,const QPoint &pnt,int col)
m_pContextPopup->insertItem(
*(g_pIconManager->getSmallIcon(KVI_SMALLICON_RAWEVENT)),
__tr2qs("&Add Raw Event..."),
- this,SLOT(addRaw()));
+ this,TQT_SLOT(addRaw()));
m_pContextPopup->popup(pnt);
}
-void KviRawEditor::getUniqueHandlerName(KviRawListViewItem *it,QString &buffer)
+void KviRawEditor::getUniqueHandlerName(KviRawListViewItem *it,TQString &buffer)
{
__range_valid(m_bOneTimeSetupDone);
- QString newName = buffer;
+ TQString newName = buffer;
if(newName.isEmpty())newName = __tr2qs("unnamed");
bool bFound = true;
@@ -198,10 +198,10 @@ void KviRawEditor::getUniqueHandlerName(KviRawListViewItem *it,QString &buffer)
for(KviRawHandlerListViewItem * ch = (KviRawHandlerListViewItem *)(it->firstChild());ch;ch = (KviRawHandlerListViewItem *)ch->nextSibling())
{
- if(KviQString::equalCI(newName,ch->m_szName))
+ if(KviTQString::equalCI(newName,ch->m_szName))
{
bFound = true;
- KviQString::sprintf(newName,"%Q_%d",&buffer,idx);
+ KviTQString::sprintf(newName,"%TQ_%d",&buffer,idx);
idx++;
break;
}
@@ -216,7 +216,7 @@ void KviRawEditor::addRaw()
{
bool bOk = false;
- int iIdx = QInputDialog::getInteger(__tr2qs("New Raw Event"),__tr2qs("Enter the numeric code of the message (0-999)"),0,0,999,1,&bOk,this);
+ int iIdx = TQInputDialog::getInteger(__tr2qs("New Raw Event"),__tr2qs("Enter the numeric code of the message (0-999)"),0,0,999,1,&bOk,this);
if(!bOk)return;
@@ -245,9 +245,9 @@ void KviRawEditor::addHandlerForCurrentRaw()
KviTalListViewItem * it = m_pListView->selectedItem();
if(it)
{
- if(it->parent() == 0)
+ if(it->tqparent() == 0)
{
- QString buffer = __tr2qs("default");
+ TQString buffer = __tr2qs("default");
getUniqueHandlerName((KviRawListViewItem *)it,buffer);
KviTalListViewItem * ch = new KviRawHandlerListViewItem(it,buffer,"",true);
it->setOpen(true);
@@ -275,7 +275,7 @@ void KviRawEditor::toggleCurrentHandlerEnabled()
if(m_pLastEditedItem)
{
m_pLastEditedItem->m_bEnabled = !(m_pLastEditedItem->m_bEnabled);
- m_pListView->repaintItem(m_pLastEditedItem);
+ m_pListView->tqrepaintItem(m_pLastEditedItem);
selectionChanged(m_pLastEditedItem);
}
}
@@ -290,11 +290,11 @@ void KviRawEditor::commit()
{
if(it->firstChild())
{
- QString szContext;
+ TQString szContext;
for(KviTalListViewItem * ch = it->firstChild();ch;ch = ch->nextSibling())
{
- KviQString::sprintf(szContext,"RawEvent%d::%Q",&(((KviRawListViewItem *)it)->m_iIdx),&(((KviRawHandlerListViewItem *)ch)->m_szName));
+ KviTQString::sprintf(szContext,"RawEvent%d::%Q",&(((KviRawListViewItem *)it)->m_iIdx),&(((KviRawHandlerListViewItem *)ch)->m_szName));
KviKvsScriptEventHandler * s = new KviKvsScriptEventHandler(
((KviRawHandlerListViewItem *)ch)->m_szName,
szContext,
@@ -315,14 +315,14 @@ void KviRawEditor::saveLastEditedItem()
__range_valid(m_bOneTimeSetupDone);
if(!m_pLastEditedItem)return;
- QString buffer = m_pNameEditor->text();
- if(!KviQString::equalCI(buffer,m_pLastEditedItem->m_szName))
+ TQString buffer = m_pNameEditor->text();
+ if(!KviTQString::equalCI(buffer,m_pLastEditedItem->m_szName))
{
- getUniqueHandlerName((KviRawListViewItem *)(m_pLastEditedItem->parent()),buffer);
+ getUniqueHandlerName((KviRawListViewItem *)(m_pLastEditedItem->tqparent()),buffer);
}
m_pLastEditedItem->m_szName = buffer;
- QString tmp;
+ TQString tmp;
m_pEditor->getText(tmp);
m_pLastEditedItem->m_szBuffer = tmp;
@@ -332,7 +332,7 @@ void KviRawEditor::selectionChanged(KviTalListViewItem * it)
{
__range_valid(m_bOneTimeSetupDone);
saveLastEditedItem();
- if(it->parent())
+ if(it->tqparent())
{
m_pLastEditedItem = (KviRawHandlerListViewItem *)it;
m_pNameEditor->setEnabled(true);
@@ -347,22 +347,22 @@ void KviRawEditor::selectionChanged(KviTalListViewItem * it)
}
}
-void KviRawEditor::showEvent(QShowEvent *e)
+void KviRawEditor::showEvent(TQShowEvent *e)
{
oneTimeSetup();
- QWidget::showEvent(e);
+ TQWidget::showEvent(e);
}
-void KviRawEditor::getExportEventBuffer(QString &buffer,KviRawHandlerListViewItem * it)
+void KviRawEditor::getExportEventBuffer(TQString &buffer,KviRawHandlerListViewItem * it)
{
- if(!it->parent())return;
+ if(!it->tqparent())return;
- QString szBuf = it->m_szBuffer;
+ TQString szBuf = it->m_szBuffer;
KviCommandFormatter::blockFromBuffer(szBuf);
buffer = "event(";
- buffer += ((KviRawListViewItem *)(it->parent()))->m_szName;
+ buffer += ((KviRawListViewItem *)(it->tqparent()))->m_szName;
buffer += ",";
buffer += it->m_szName;
buffer += ")\n";
@@ -373,7 +373,7 @@ void KviRawEditor::getExportEventBuffer(QString &buffer,KviRawHandlerListViewIte
{
buffer += "\n";
buffer += "eventctl -d ";
- buffer += ((KviRawListViewItem *)(it->parent()))->m_szName;
+ buffer += ((KviRawListViewItem *)(it->tqparent()))->m_szName;
buffer += " ";
buffer += it->m_szName;
}
@@ -385,24 +385,24 @@ void KviRawEditor::exportCurrentHandler()
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 += "raw";
- szName += ((KviRawListViewItem *)(m_pLastEditedItem->parent()))->m_szName;
+ szName += ((KviRawListViewItem *)(m_pLastEditedItem->tqparent()))->m_szName;
szName += ".";
szName += m_pLastEditedItem->m_szName;
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;
getExportEventBuffer(szOut,m_pLastEditedItem);
if(!KviFileUtils::writeFile(szFile,szOut))
{
- QMessageBox::warning(this,__tr2qs("Write Failed - KVIrc"),__tr2qs("Unable to write to the raw event file."),__tr2qs("&OK"));
+ TQMessageBox::warning(this,__tr2qs("Write Failed - KVIrc"),__tr2qs("Unable to write to the raw event file."),__tr2qs("&OK"));
}
}
@@ -412,14 +412,14 @@ void KviRawEditor::exportAllEvents()
KviRawListViewItem * it = (KviRawListViewItem *)m_pListView->firstChild();
- QString out;
+ TQString out;
while(it)
{
KviRawHandlerListViewItem * item = (KviRawHandlerListViewItem *)it->firstChild();
while(item)
{
- QString tmp;
+ TQString tmp;
getExportEventBuffer(tmp,item);
out += tmp;
out += "\n";
@@ -428,17 +428,17 @@ void KviRawEditor::exportAllEvents()
it = (KviRawListViewItem *)it->nextSibling();
}
- 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 += "rawevents.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 raw events file."),__tr2qs("Ok"));
+ TQMessageBox::warning(this,__tr2qs("Write Failed - KVIrc"),__tr2qs("Unable to write to the raw events file."),__tr2qs("Ok"));
}
}
@@ -452,21 +452,21 @@ KviRawEditorWindow::KviRawEditorWindow(KviFrame * lpFrm)
m_pEditor = new KviRawEditor(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);
@@ -495,14 +495,14 @@ void KviRawEditorWindow::cancelClicked()
}
-QPixmap * KviRawEditorWindow::myIconPtr()
+TQPixmap * KviRawEditorWindow::myIconPtr()
{
return g_pIconManager->getSmallIcon(KVI_SMALLICON_RAWEVENT);
}
-void KviRawEditorWindow::resizeEvent(QResizeEvent *e)
+void KviRawEditorWindow::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);
}
@@ -511,9 +511,9 @@ void KviRawEditorWindow::fillCaptionBuffers()
{
m_szPlainTextCaption = __tr2qs("Raw 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();
@@ -551,7 +551,7 @@ void KviRawEditorWindow::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));
diff --git a/src/modules/raweditor/raweditor.h b/src/modules/raweditor/raweditor.h
index 7adf2213..349399b4 100644
--- a/src/modules/raweditor/raweditor.h
+++ b/src/modules/raweditor/raweditor.h
@@ -25,9 +25,9 @@
#include "kvi_window.h"
#include "kvi_qstring.h"
-#include <qwidget.h>
+#include <tqwidget.h>
#include "kvi_tal_listview.h"
-#include <qlineedit.h>
+#include <tqlineedit.h>
class KviScriptEditor;
@@ -35,52 +35,53 @@ class KviRawListViewItem : public KviTalListViewItem
{
public:
int m_iIdx;
- QString m_szName;
+ TQString m_szName;
public:
KviRawListViewItem(KviTalListView * par,int idx);
~KviRawListViewItem() {};
public:
- virtual QString text(int col) const { return m_szName; };
- virtual const QPixmap * pixmap(int col) const;
+ virtual TQString text(int col) const { return m_szName; };
+ virtual const TQPixmap * pixmap(int col) const;
};
class KviRawHandlerListViewItem : public KviTalListViewItem
{
public:
- KviRawHandlerListViewItem(KviTalListViewItem * par,const QString & name,const QString & buffer,bool bEnabled)
+ KviRawHandlerListViewItem(KviTalListViewItem * par,const TQString & name,const TQString & buffer,bool bEnabled)
: KviTalListViewItem(par), m_szName(name) , m_szBuffer(buffer) , m_bEnabled(bEnabled) {};
~KviRawHandlerListViewItem() {};
public:
- QString m_szName;
- QString m_szBuffer;
+ TQString m_szName;
+ TQString m_szBuffer;
bool m_bEnabled;
- virtual QString text(int col) const { return m_szName; };
- virtual const QPixmap * pixmap(int col) const;
+ virtual TQString text(int col) const { return m_szName; };
+ virtual const TQPixmap * pixmap(int col) const;
};
class KviTalPopupMenu;
-class KviRawEditor : public QWidget
+class KviRawEditor : public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
- KviRawEditor(QWidget * par);
+ KviRawEditor(TQWidget * par);
~KviRawEditor();
public:
KviScriptEditor * m_pEditor;
KviTalListView * m_pListView;
- QLineEdit * m_pNameEditor;
+ TQLineEdit * m_pNameEditor;
KviTalPopupMenu * m_pContextPopup;
KviRawHandlerListViewItem * m_pLastEditedItem;
bool m_bOneTimeSetupDone;
public:
void commit();
void saveLastEditedItem();
- void getUniqueHandlerName(KviRawListViewItem *it,QString &buffer);
- void getExportEventBuffer(QString &szBuffer,KviRawHandlerListViewItem * it);
+ void getUniqueHandlerName(KviRawListViewItem *it,TQString &buffer);
+ void getExportEventBuffer(TQString &szBuffer,KviRawHandlerListViewItem * it);
protected slots:
void selectionChanged(KviTalListViewItem *it);
- void itemPressed(KviTalListViewItem *it,const QPoint &pnt,int col);
+ void itemPressed(KviTalListViewItem *it,const TQPoint &pnt,int col);
void toggleCurrentHandlerEnabled();
void removeCurrentHandler();
void addHandlerForCurrentRaw();
@@ -88,7 +89,7 @@ protected slots:
void exportAllEvents();
void exportCurrentHandler();
protected:
- void showEvent(QShowEvent *e);
+ void showEvent(TQShowEvent *e);
private:
void oneTimeSetup();
};
@@ -96,16 +97,17 @@ private:
class KviRawEditorWindow : public KviWindow
{
Q_OBJECT
+ TQ_OBJECT
public:
KviRawEditorWindow(KviFrame * lpFrm);
~KviRawEditorWindow();
protected:
KviRawEditor * m_pEditor;
- QWidget * m_pBase;
+ TQWidget * m_pBase;
protected:
- virtual QPixmap * myIconPtr();
+ virtual TQPixmap * myIconPtr();
virtual void fillCaptionBuffers();
- virtual void resizeEvent(QResizeEvent *e);
+ virtual void resizeEvent(TQResizeEvent *e);
virtual void getConfigGroupName(KviStr &szName);
virtual void saveProperties(KviConfig *);
virtual void loadProperties(KviConfig *);