summaryrefslogtreecommitdiffstats
path: root/kexi/formeditor/connectiondialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kexi/formeditor/connectiondialog.cpp')
-rw-r--r--kexi/formeditor/connectiondialog.cpp128
1 files changed, 64 insertions, 64 deletions
diff --git a/kexi/formeditor/connectiondialog.cpp b/kexi/formeditor/connectiondialog.cpp
index a40348e7..03302d3a 100644
--- a/kexi/formeditor/connectiondialog.cpp
+++ b/kexi/formeditor/connectiondialog.cpp
@@ -18,12 +18,12 @@
* Boston, MA 02110-1301, USA.
*/
-#include <qlayout.h>
-#include <qhbox.h>
-#include <qlabel.h>
-#include <qregexp.h>
-#include <qmetaobject.h>
-#include <qstrlist.h>
+#include <tqlayout.h>
+#include <tqhbox.h>
+#include <tqlabel.h>
+#include <tqregexp.h>
+#include <tqmetaobject.h>
+#include <tqstrlist.h>
#include <kpushbutton.h>
#include <kiconloader.h>
@@ -45,25 +45,25 @@ namespace KFormDesigner {
/////////////////////////////////////////////////////////////////////////////////
///////////// The dialog to edit or add/remove connections //////////////////////
/////////////////////////////////////////////////////////////////////////////////
-ConnectionDialog::ConnectionDialog(QWidget *parent)
-: KDialogBase(parent, "connections_dialog", true, i18n("Edit Form Connections"),
+ConnectionDialog::ConnectionDialog(TQWidget *tqparent)
+: KDialogBase(tqparent, "connections_dialog", true, i18n("Edit Form Connections"),
Ok|Cancel|Details, Ok, false)
, m_buffer(0)
{
- QFrame *frame = makeMainWidget();
- QHBoxLayout *layout = new QHBoxLayout(frame, 0, 6);
+ TQFrame *frame = makeMainWidget();
+ TQHBoxLayout *tqlayout = new TQHBoxLayout(frame, 0, 6);
// Setup the details widget /////////
- QHBox *details = new QHBox(frame);
+ TQHBox *details = new TQHBox(frame);
setDetailsWidget(details);
setDetails(true);
- m_pixmapLabel = new QLabel(details);
+ m_pixmapLabel = new TQLabel(details);
m_pixmapLabel->setFixedWidth( int(IconSize(KIcon::Desktop) * 1.5) );
- m_pixmapLabel->setAlignment(AlignHCenter | AlignTop);
+ m_pixmapLabel->tqsetAlignment(AlignHCenter | AlignTop);
- m_textLabel = new QLabel(details);
- m_textLabel->setAlignment(AlignLeft | AlignTop);
+ m_textLabel = new TQLabel(details);
+ m_textLabel->tqsetAlignment(AlignLeft | AlignTop);
//setStatusOk();
// And the KexiTableView ////////
@@ -74,27 +74,27 @@ ConnectionDialog::ConnectionDialog(QWidget *parent)
initTable();
m_table->setData(m_data, false);
m_table->adjustColumnWidthToContents(0);
- layout->addWidget(m_table);
+ tqlayout->addWidget(m_table);
//// Setup the icon toolbar /////////////////
- QVBoxLayout *vlayout = new QVBoxLayout(layout, 3);
+ TQVBoxLayout *vtqlayout = new TQVBoxLayout(tqlayout, 3);
KPushButton *newItem = new KPushButton(SmallIconSet("filenew"), i18n("&New Connection"), frame);
- vlayout->addWidget(newItem);
+ vtqlayout->addWidget(newItem);
m_buttons.insert(BAdd, newItem);
- connect(newItem, SIGNAL(clicked()), this, SLOT(newItem()));
+ connect(newItem, TQT_SIGNAL(clicked()), this, TQT_SLOT(newItem()));
KPushButton *delItem = new KPushButton(SmallIconSet("editdelete"), i18n("&Remove Connection"), frame);
- vlayout->addWidget(delItem);
+ vtqlayout->addWidget(delItem);
m_buttons.insert(BRemove, delItem);
- connect(delItem, SIGNAL(clicked()), this, SLOT(removeItem()));
+ connect(delItem, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeItem()));
- vlayout->addStretch();
+ vtqlayout->addStretch();
- setInitialSize(QSize(600, 300));
+ setInitialSize(TQSize(600, 300));
//setWFlags(WDestructiveClose);
- connect(m_table,SIGNAL(cellSelected(int, int)), this, SLOT(slotCellSelected(int, int)));
- connect(m_table->data(), SIGNAL(rowInserted(KexiTableItem*,bool)), this, SLOT(slotRowInserted(KexiTableItem*,bool)));
+ connect(m_table,TQT_SIGNAL(cellSelected(int, int)), this, TQT_SLOT(slotCellSelected(int, int)));
+ connect(m_table->KexiDataAwareObjectInterface::data(), TQT_SIGNAL(rowInserted(KexiTableItem*,bool)), this, TQT_SLOT(slotRowInserted(KexiTableItem*,bool)));
this->newItem();
}
@@ -126,15 +126,15 @@ ConnectionDialog::initTable()
col4->setRelatedData( m_slotsColumnData );
m_data->addColumn(col4);
- QValueList<int> c;
+ TQValueList<int> c;
c << 2 << 4;
m_table->maximizeColumnsWidth(c);
m_table->setColumnStretchEnabled( true, 4 );
- connect(m_data, SIGNAL(aboutToChangeCell(KexiTableItem*, int, QVariant&, KexiDB::ResultInfo*)),
- this,SLOT(slotCellChanged(KexiTableItem*, int, QVariant, KexiDB::ResultInfo*)));
- connect(m_data, SIGNAL(rowUpdated(KexiTableItem*)), this, SLOT(checkConnection(KexiTableItem *)));
- connect(m_table, SIGNAL(itemSelected(KexiTableItem *)), this, SLOT(checkConnection(KexiTableItem *)));
+ connect(m_data, TQT_SIGNAL(aboutToChangeCell(KexiTableItem*, int, TQVariant&, KexiDB::ResultInfo*)),
+ this,TQT_SLOT(slotCellChanged(KexiTableItem*, int, TQVariant, KexiDB::ResultInfo*)));
+ connect(m_data, TQT_SIGNAL(rowUpdated(KexiTableItem*)), this, TQT_SLOT(checkConnection(KexiTableItem *)));
+ connect(m_table, TQT_SIGNAL(itemSelected(KexiTableItem *)), this, TQT_SLOT(checkConnection(KexiTableItem *)));
}
void
@@ -183,7 +183,7 @@ ConnectionDialog::slotOk()
delete m_form->connectionBuffer();
m_form->setConnectionBuffer(m_buffer);
- QDialog::accept();
+ TQDialog::accept();
}
void
@@ -204,7 +204,7 @@ ConnectionDialog::updateTableData()
// Then we fill the columns with the form connections
for(Connection *c = m_form->connectionBuffer()->first(); c ; c = m_form->connectionBuffer()->next())
{
- KexiTableItem *item = m_table->data()->createItem(); //new KexiTableItem(5);
+ KexiTableItem *item = m_table->KexiDataAwareObjectInterface::data()->createItem(); //new KexiTableItem(5);
(*item)[1] = c->sender();
(*item)[2] = c->signal();
(*item)[3] = c->receiver();
@@ -229,13 +229,13 @@ ConnectionDialog::setStatusOk(KexiTableItem *item)
if (item)
(*item)[0] = "button_ok";
else {
- m_pixmapLabel->setPixmap( QPixmap() );
- m_textLabel->setText(QString::null);
+ m_pixmapLabel->setPixmap( TQPixmap() );
+ m_textLabel->setText(TQString());
}
}
void
-ConnectionDialog::setStatusError(const QString &msg, KexiTableItem *item)
+ConnectionDialog::setStatusError(const TQString &msg, KexiTableItem *item)
{
m_pixmapLabel->setPixmap( DesktopIcon("button_cancel") );
m_textLabel->setText("<qt><h2>The connection is invalid.</h2></qt>" + msg);
@@ -248,24 +248,24 @@ ConnectionDialog::setStatusError(const QString &msg, KexiTableItem *item)
if (item)
(*item)[0] = "button_cancel";
else {
- m_pixmapLabel->setPixmap( QPixmap() );
- m_textLabel->setText(QString::null);
+ m_pixmapLabel->setPixmap( TQPixmap() );
+ m_textLabel->setText(TQString());
}
}
void
-ConnectionDialog::slotCellChanged(KexiTableItem *item, int col, QVariant&, KexiDB::ResultInfo*)
+ConnectionDialog::slotCellChanged(KexiTableItem *item, int col, TQVariant&, KexiDB::ResultInfo*)
{
switch(col)
{
// sender changed, we clear siganl and slot
case 1:
- (*item)[2] = QString("");
+ (*item)[2] = TQString("");
// signal or receiver changed, we clear the slot cell
case 2:
case 3:
{
- (*item)[4] = QString("");
+ (*item)[4] = TQString("");
break;
}
default:
@@ -277,8 +277,8 @@ void
ConnectionDialog::updateSlotList(KexiTableItem *item)
{
m_slotsColumnData->deleteAllRows();
- QString widget = (*item)[1].toString();
- QString signal = (*item)[2].toString();
+ TQString widget = (*item)[1].toString();
+ TQString signal = (*item)[2].toString();
if((widget.isEmpty()) || signal.isEmpty())
return;
@@ -286,22 +286,22 @@ ConnectionDialog::updateSlotList(KexiTableItem *item)
if(!tree || !tree->widget())
return;
- QString signalArg(signal);
- signalArg = signalArg.remove( QRegExp(".*[(]|[)]") );
+ TQString signalArg(signal);
+ signalArg = signalArg.remove( TQRegExp(".*[(]|[)]") );
- QStrList slotList = tree->widget()->metaObject()->slotNames(true);
- QStrListIterator it(slotList);
+ TQStrList slotList = tree->widget()->tqmetaObject()->slotNames(true);
+ TQStrListIterator it(slotList);
for(; it.current() != 0; ++it)
{
// we add the slot only if it is compatible with the signal
- QString slotArg(*it);
- slotArg = slotArg.remove( QRegExp(".*[(]|[)]") );
+ TQString slotArg(*it);
+ slotArg = slotArg.remove( TQRegExp(".*[(]|[)]") );
- if(!signalArg.startsWith(slotArg, true) && (!signal.isEmpty())) // args not compatible
+ if(!signalArg.tqstartsWith(slotArg, true) && (!signal.isEmpty())) // args not compatible
continue;
KexiTableItem *item = m_slotsColumnData->createItem(); //new KexiTableItem(2);
- (*item)[0] = QString(*it);
+ (*item)[0] = TQString(*it);
(*item)[1] = (*item)[0];
m_slotsColumnData->append(item);
}
@@ -315,12 +315,12 @@ ConnectionDialog::updateSignalList(KexiTableItem *item)
return;
m_signalsColumnData->deleteAllRows();
- QStrList signalList = tree->widget()->metaObject()->signalNames(true);
- QStrListIterator it(signalList);
+ TQStrList signalList = tree->widget()->tqmetaObject()->signalNames(true);
+ TQStrListIterator it(signalList);
for(; it.current() != 0; ++it)
{
KexiTableItem *item = m_signalsColumnData->createItem(); //new KexiTableItem(2);
- (*item)[0] = QString(*it);
+ (*item)[0] = TQString(*it);
(*item)[1] = (*item)[0];
m_signalsColumnData->append(item);
}
@@ -334,19 +334,19 @@ ConnectionDialog::checkConnection(KexiTableItem *item)
{
if( !item || (*item)[i].toString().isEmpty())
{
- setStatusError( i18n("<qt>You have not selected item: <b>%1</b>.</qt>").arg(m_data->column(i)->captionAliasOrName()),
+ setStatusError( i18n("<qt>You have not selected item: <b>%1</b>.</qt>").tqarg(m_data->column(i)->captionAliasOrName()),
item);
return;
}
}
// Then we check if signal/slot args are compatible
- QString signal = (*item)[2].toString();
- signal = signal.remove( QRegExp(".*[(]|[)]") ); // just keep the args list
- QString slot = (*item)[4].toString();
- slot = slot.remove( QRegExp(".*[(]|[)]") );
+ TQString signal = (*item)[2].toString();
+ signal = signal.remove( TQRegExp(".*[(]|[)]") ); // just keep the args list
+ TQString slot = (*item)[4].toString();
+ slot = slot.remove( TQRegExp(".*[(]|[)]") );
- if(!signal.startsWith(slot, true))
+ if(!signal.tqstartsWith(slot, true))
{
setStatusError( i18n("The signal/slot arguments are not compatible."), item);
return;
@@ -366,8 +366,8 @@ void
ConnectionDialog::newItemByDragnDrop()
{
KFormDesigner::FormManager::self()->startCreatingConnection();
- connect(KFormDesigner::FormManager::self(), SIGNAL(connectionAborted(KFormDesigner::Form*)), this, SLOT(slotConnectionAborted(KFormDesigner::Form*)));
- connect(KFormDesigner::FormManager::self(), SIGNAL(connectionCreated(KFormDesigner::Form*, Connection&)), this, SLOT(slotConnectionCreated(KFormDesigner::Form*, Connection&)) );
+ connect(KFormDesigner::FormManager::self(), TQT_SIGNAL(connectionAborted(KFormDesigner::Form*)), this, TQT_SLOT(slotConnectionAborted(KFormDesigner::Form*)));
+ connect(KFormDesigner::FormManager::self(), TQT_SIGNAL(connectionCreated(KFormDesigner::Form*, Connection&)), this, TQT_SLOT(slotConnectionCreated(KFormDesigner::Form*, Connection&)) );
hide();
}
@@ -380,7 +380,7 @@ ConnectionDialog::slotConnectionCreated(KFormDesigner::Form *form, Connection &c
return;
Connection *c = new Connection(connection);
- KexiTableItem *item = m_table->data()->createItem(); //new KexiTableItem(5);
+ KexiTableItem *item = m_table->KexiDataAwareObjectInterface::data()->createItem(); //new KexiTableItem(5);
(*item)[1] = c->sender();
(*item)[2] = c->signal();
(*item)[3] = c->receiver();
@@ -405,8 +405,8 @@ ConnectionDialog::removeItem()
if(m_table->currentRow() == -1 || m_table->currentRow()>=m_table->rows())
return;
- int confirm = KMessageBox::warningContinueCancel(parentWidget(),
- QString("<qt>")+i18n("Do you want to delete this connection ?")+"</qt>", QString::null, KGuiItem(i18n("&Delete Connection")),
+ int confirm = KMessageBox::warningContinueCancel(tqparentWidget(),
+ TQString("<qt>")+i18n("Do you want to delete this connection ?")+"</qt>", TQString(), KGuiItem(i18n("&Delete Connection")),
"dontAskBeforeDeleteConnection"/*config entry*/);
if(confirm == KMessageBox::Cancel)
return;