summaryrefslogtreecommitdiffstats
path: root/ksirc/puke/ptabdialog.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitbcb704366cb5e333a626c18c308c7e0448a8e69f (patch)
treef0d6ab7d78ecdd9207cf46536376b44b91a1ca71 /ksirc/puke/ptabdialog.cpp
downloadtdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.tar.gz
tdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksirc/puke/ptabdialog.cpp')
-rw-r--r--ksirc/puke/ptabdialog.cpp101
1 files changed, 101 insertions, 0 deletions
diff --git a/ksirc/puke/ptabdialog.cpp b/ksirc/puke/ptabdialog.cpp
new file mode 100644
index 00000000..b0e3ba2c
--- /dev/null
+++ b/ksirc/puke/ptabdialog.cpp
@@ -0,0 +1,101 @@
+#include <stdio.h>
+
+
+#include "ptabdialog.h"
+#include "commands.h"
+#include <iostream>
+
+PObject *
+PTabDialog::createWidget(CreateArgs &ca)
+{
+ PTabDialog *ptd = new PTabDialog(ca.parent);
+ QTabDialog *qtd;
+ // Retreive the border and direction information out of the
+ // carg string
+ if(ca.fetchedObj != 0 && ca.fetchedObj->inherits("QTabDialog") == TRUE){
+ qtd = (QTabDialog *) ca.fetchedObj;
+ ptd->setDeleteAble(FALSE);
+ }
+ else if(ca.parent != 0 && ca.parent->widget()->isWidgetType() == TRUE)
+ qtd = new QTabDialog((QWidget *) ca.parent->widget());
+ else
+ qtd = new QTabDialog();
+ ptd->setWidget(qtd);
+ ptd->setWidgetId(ca.pwI);
+ ptd->setPukeController(ca.pc);
+ return ptd;
+}
+
+PTabDialog::PTabDialog(QObject *)
+ : PWidget()
+{
+ // Connect slots as needed
+ setWidget(0);
+}
+
+PTabDialog::~PTabDialog()
+{
+ // kdDebug(5008) << "PObject: in destructor" << endl;
+ /*
+ delete widget();
+ tab = 0;
+ setWidget(0);
+ */
+}
+
+void PTabDialog::messageHandler(int fd, PukeMessage *pm)
+{
+ PukeMessage pmRet;
+
+ if(pm->iCommand == PUKE_TABDIALOG_ADDTAB){
+ if(!(pm->iTextSize > 0)){
+ qWarning("QTabDialog/addtab: incorrent cArg size, bailing out. Needed: >0 got: %d\n", pm->iTextSize);
+ pmRet.iCommand = PUKE_TABDIALOG_ADDTAB_ACK; // ack the add widget
+ pmRet.iWinId = pm->iWinId;
+ pmRet.iArg = 1;
+ pmRet.cArg = 0;
+ emit outputMessage(fd, &pmRet);
+ return;
+ }
+ widgetId wiWidget;
+ wiWidget.fd = fd;
+ wiWidget.iWinId = pm->iArg;
+ PWidget *pw = controller()->id2pwidget(&wiWidget);
+ // kdDebug(5008) << "Adding widget with stretch: " << (int) pm->cArg[0] << " and align: " << // (int) pm->cArg[1] << endl;
+ widget()->addTab(pw->widget(), pm->cArg);
+
+ pmRet.iCommand = PUKE_TABDIALOG_ADDTAB_ACK; // ack the add widget
+ pmRet.iWinId = pm->iWinId;
+ pmRet.iArg = 0;
+ pmRet.cArg = 0;
+ emit outputMessage(fd, &pmRet);
+ }
+ else {
+ PWidget::messageHandler(fd, pm);
+ }
+
+}
+
+void PTabDialog::setWidget(QObject *tb)
+{
+ if(tb != 0 && tb->inherits("QTabDialog") == FALSE)
+ {
+ errorInvalidSet(tb);
+ return;
+ }
+
+ tab = (QTabDialog *) tb;
+ if(tab != 0){
+ }
+ PObject::setWidget(tb);
+
+}
+
+QTabDialog *PTabDialog::widget()
+{
+ // kdDebug(5008) << "PObject widget called" << endl;
+ return tab;
+}
+
+#include "ptabdialog.moc"
+