diff options
Diffstat (limited to 'kexi/plugins/forms/kexidatasourcepage.cpp')
-rw-r--r-- | kexi/plugins/forms/kexidatasourcepage.cpp | 160 |
1 files changed, 80 insertions, 80 deletions
diff --git a/kexi/plugins/forms/kexidatasourcepage.cpp b/kexi/plugins/forms/kexidatasourcepage.cpp index 6c0de830..ce11e7d9 100644 --- a/kexi/plugins/forms/kexidatasourcepage.cpp +++ b/kexi/plugins/forms/kexidatasourcepage.cpp @@ -19,10 +19,10 @@ #include "kexidatasourcepage.h" -#include <qlabel.h> -#include <qlayout.h> -#include <qtooltip.h> -#include <qheader.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqtooltip.h> +#include <tqheader.h> #include <kiconloader.h> #include <klocale.h> @@ -43,11 +43,11 @@ #include <koproperty/property.h> #include <koproperty/utils.h> -KexiDataSourcePage::KexiDataSourcePage(QWidget *parent, const char *name) - : QWidget(parent, name) +KexiDataSourcePage::KexiDataSourcePage(TQWidget *tqparent, const char *name) + : TQWidget(tqparent, name) , m_insideClearDataSourceSelection(false) { - QVBoxLayout *vlyr = new QVBoxLayout(this); + TQVBoxLayout *vlyr = new TQVBoxLayout(this); m_objectInfoLabel = new KexiObjectInfoLabel(this, "KexiObjectInfoLabel"); vlyr->addWidget(m_objectInfoLabel); @@ -60,67 +60,67 @@ KexiDataSourcePage::KexiDataSourcePage(QWidget *parent, const char *name) KoProperty::GroupContainer *container = new KoProperty::GroupContainer(i18n("Data Source"), this); vlyr->addWidget(container); - QWidget *contents = new QWidget(container); + TQWidget *contents = new TQWidget(container); container->setContents(contents); - QVBoxLayout *contentsVlyr = new QVBoxLayout(contents); + TQVBoxLayout *contentsVlyr = new TQVBoxLayout(contents); - m_noDataSourceAvailableLabel = new QLabel(m_noDataSourceAvailableSingleText, contents); - m_noDataSourceAvailableLabel->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + m_noDataSourceAvailableLabel = new TQLabel(m_noDataSourceAvailableSingleText, contents); + m_noDataSourceAvailableLabel->tqsetSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Fixed); m_noDataSourceAvailableLabel->setMargin(2); - m_noDataSourceAvailableLabel->setAlignment(Qt::WordBreak | Qt::AlignBottom | Qt::AlignLeft); + m_noDataSourceAvailableLabel->tqsetAlignment(TQt::WordBreak | TQt::AlignBottom | TQt::AlignLeft); contentsVlyr->addWidget(m_noDataSourceAvailableLabel); //-Widget's Data Source - QHBoxLayout *hlyr = new QHBoxLayout(contentsVlyr); + TQHBoxLayout *hlyr = new TQHBoxLayout(contentsVlyr); #if 0 //! @todo unhide this when expression work -// m_widgetDSLabel = new QLabel(i18n("Table Field, Query Field or Expression", "Source field or expression:"), this); +// m_widgetDSLabel = new TQLabel(i18n("Table Field, Query Field or Expression", "Source field or expression:"), this); #else - m_widgetDSLabel = new QLabel(i18n("Table Field or Query Field", "Widget's data source:"), contents); + m_widgetDSLabel = new TQLabel(i18n("Table Field or Query Field", "Widget's data source:"), contents); #endif - m_widgetDSLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); + m_widgetDSLabel->tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Fixed); m_widgetDSLabel->setMargin(2); m_widgetDSLabel->setMinimumHeight(IconSize(KIcon::Small)+4); - m_widgetDSLabel->setAlignment(AlignLeft|AlignBottom); + m_widgetDSLabel->tqsetAlignment(AlignLeft|AlignBottom); hlyr->addWidget(m_widgetDSLabel); - m_clearWidgetDSButton = new KexiSmallToolButton(contents, QString::null, "clear_left", "clearWidgetDSButton"); + m_clearWidgetDSButton = new KexiSmallToolButton(contents, TQString(), "clear_left", "clearWidgetDSButton"); m_clearWidgetDSButton->setMinimumHeight(m_widgetDSLabel->minimumHeight()); - QToolTip::add(m_clearWidgetDSButton, i18n("Clear widget's data source")); + TQToolTip::add(m_clearWidgetDSButton, i18n("Clear widget's data source")); hlyr->addWidget(m_clearWidgetDSButton); - connect(m_clearWidgetDSButton, SIGNAL(clicked()), this, SLOT(clearWidgetDataSourceSelection())); + connect(m_clearWidgetDSButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(clearWidgetDataSourceSelection())); m_sourceFieldCombo = new KexiFieldComboBox(contents, "sourceFieldCombo"); m_widgetDSLabel->setBuddy(m_sourceFieldCombo); contentsVlyr->addWidget(m_sourceFieldCombo); -/* m_dataSourceSeparator = new QFrame(contents); - m_dataSourceSeparator->setFrameShape(QFrame::HLine); - m_dataSourceSeparator->setFrameShadow(QFrame::Sunken); +/* m_dataSourceSeparator = new TQFrame(contents); + m_dataSourceSeparator->setFrameShape(TQFrame::HLine); + m_dataSourceSeparator->setFrameShadow(TQFrame::Sunken); contentsVlyr->addWidget(m_dataSourceSeparator);*/ contentsVlyr->addSpacing(8); //- Form's Data Source - hlyr = new QHBoxLayout(contentsVlyr); - m_dataSourceLabel = new QLabel(i18n("Form's data source:"), contents); - m_dataSourceLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); + hlyr = new TQHBoxLayout(contentsVlyr); + m_dataSourceLabel = new TQLabel(i18n("Form's data source:"), contents); + m_dataSourceLabel->tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Fixed); m_dataSourceLabel->setMargin(2); m_dataSourceLabel->setMinimumHeight(IconSize(KIcon::Small)+4); - m_dataSourceLabel->setAlignment(AlignLeft|AlignBottom); + m_dataSourceLabel->tqsetAlignment(AlignLeft|AlignBottom); hlyr->addWidget(m_dataSourceLabel); - m_gotoButton = new KexiSmallToolButton(contents, QString::null, "goto", "gotoButton"); + m_gotoButton = new KexiSmallToolButton(contents, TQString(), "goto", "gotoButton"); m_gotoButton->setMinimumHeight(m_dataSourceLabel->minimumHeight()); - QToolTip::add(m_gotoButton, i18n("Go to selected form's data source")); + TQToolTip::add(m_gotoButton, i18n("Go to selected form's data source")); hlyr->addWidget(m_gotoButton); - connect(m_gotoButton, SIGNAL(clicked()), this, SLOT(slotGotoSelected())); + connect(m_gotoButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotGotoSelected())); - m_clearDSButton = new KexiSmallToolButton(contents, QString::null, "clear_left", "clearDSButton"); + m_clearDSButton = new KexiSmallToolButton(contents, TQString(), "clear_left", "clearDSButton"); m_clearDSButton->setMinimumHeight(m_dataSourceLabel->minimumHeight()); - QToolTip::add(m_clearDSButton, i18n("Clear form's data source")); + TQToolTip::add(m_clearDSButton, i18n("Clear form's data source")); hlyr->addWidget(m_clearDSButton); - connect(m_clearDSButton, SIGNAL(clicked()), this, SLOT(clearDataSourceSelection())); + connect(m_clearDSButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(clearDataSourceSelection())); m_dataSourceCombo = new KexiDataSourceComboBox(contents, "dataSourceCombo"); m_dataSourceLabel->setBuddy(m_dataSourceCombo); @@ -133,9 +133,9 @@ KexiDataSourcePage::KexiDataSourcePage(QWidget *parent, const char *name) vlyr->addStretch(); #else vlyr->addSpacing(fontMetrics().height()); -/* QFrame *separator = new QFrame(this); - separator->setFrameShape(QFrame::HLine); - separator->setFrameShadow(QFrame::Sunken); +/* TQFrame *separator = new TQFrame(this); + separator->setFrameShape(TQFrame::HLine); + separator->setFrameShadow(TQFrame::Sunken); vlyr->addWidget(separator);*/ /* KPopupTitle *title = new KPopupTitle(this); @@ -150,24 +150,24 @@ KexiDataSourcePage::KexiDataSourcePage(QWidget *parent, const char *name) //helper info //! @todo allow to hide such helpers by adding global option - contents = new QWidget(container); + contents = new TQWidget(container); container->setContents(contents); - contentsVlyr = new QVBoxLayout(contents); - hlyr = new QHBoxLayout(contentsVlyr); - m_mousePointerLabel = new QLabel(contents); + contentsVlyr = new TQVBoxLayout(contents); + hlyr = new TQHBoxLayout(contentsVlyr); + m_mousePointerLabel = new TQLabel(contents); hlyr->addWidget(m_mousePointerLabel); m_mousePointerLabel->setPixmap( SmallIcon("mouse_pointer") ); m_mousePointerLabel->setFixedWidth( m_mousePointerLabel->pixmap() ? m_mousePointerLabel->pixmap()->width() : 0); - m_availableFieldsDescriptionLabel = new QLabel( + m_availableFieldsDescriptionLabel = new TQLabel( i18n("Select fields from the list below and drag them onto a form or click the \"Insert\" button"), contents); - m_availableFieldsDescriptionLabel->setAlignment( Qt::AlignAuto | Qt::WordBreak ); + m_availableFieldsDescriptionLabel->tqsetAlignment( TQt::AlignAuto | TQt::WordBreak ); hlyr->addWidget(m_availableFieldsDescriptionLabel); //Available Fields contentsVlyr->addSpacing(4); - hlyr = new QHBoxLayout(contentsVlyr); - m_availableFieldsLabel = new QLabel(i18n("Available fields:"), contents); - m_availableFieldsLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); + hlyr = new TQHBoxLayout(contentsVlyr); + m_availableFieldsLabel = new TQLabel(i18n("Available fields:"), contents); + m_availableFieldsLabel->tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Fixed); m_availableFieldsLabel->setMargin(2); m_availableFieldsLabel->setMinimumHeight(IconSize(KIcon::Small)); hlyr->addWidget(m_availableFieldsLabel); @@ -175,27 +175,27 @@ KexiDataSourcePage::KexiDataSourcePage(QWidget *parent, const char *name) m_addField = new KexiSmallToolButton(contents, i18n("Insert selected field into form", "Insert"), "add_field", "addFieldButton"); m_addField->setMinimumHeight(m_availableFieldsLabel->minimumHeight()); -// m_addField->setTextPosition(QToolButton::Right); - m_addField->setFocusPolicy(StrongFocus); - QToolTip::add(m_addField, i18n("Insert selected fields into form")); +// m_addField->setTextPosition(TQToolButton::Right); + m_addField->setFocusPolicy(TQ_StrongFocus); + TQToolTip::add(m_addField, i18n("Insert selected fields into form")); hlyr->addWidget(m_addField); - connect(m_addField, SIGNAL(clicked()), this, SLOT(slotInsertSelectedFields())); + connect(m_addField, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotInsertSelectedFields())); m_fieldListView = new KexiFieldListView(contents, "fieldListView", KexiFieldListView::ShowDataTypes | KexiFieldListView::AllowMultiSelection ); - m_fieldListView->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding)); + m_fieldListView->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Expanding)); m_availableFieldsLabel->setBuddy(m_fieldListView); contentsVlyr->addWidget(m_fieldListView, 1); - connect(m_fieldListView, SIGNAL(selectionChanged()), this, SLOT(slotFieldListViewSelectionChanged())); - connect(m_fieldListView, SIGNAL(fieldDoubleClicked(const QString&, const QString&, const QString&)), - this, SLOT(slotFieldDoubleClicked(const QString&, const QString&, const QString&))); + connect(m_fieldListView, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(slotFieldListViewSelectionChanged())); + connect(m_fieldListView, TQT_SIGNAL(fieldDoubleClicked(const TQString&, const TQString&, const TQString&)), + this, TQT_SLOT(slotFieldDoubleClicked(const TQString&, const TQString&, const TQString&))); #endif vlyr->addStretch(1); - connect(m_dataSourceCombo, SIGNAL(textChanged(const QString &)), this, SLOT(slotDataSourceTextChanged(const QString &))); - connect(m_dataSourceCombo, SIGNAL(dataSourceChanged()), this, SLOT(slotDataSourceChanged())); - connect(m_sourceFieldCombo, SIGNAL(selected()), this, SLOT(slotFieldSelected())); + connect(m_dataSourceCombo, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(slotDataSourceTextChanged(const TQString &))); + connect(m_dataSourceCombo, TQT_SIGNAL(dataSourceChanged()), this, TQT_SLOT(slotDataSourceChanged())); + connect(m_sourceFieldCombo, TQT_SIGNAL(selected()), this, TQT_SLOT(slotFieldSelected())); clearDataSourceSelection(); slotFieldListViewSelectionChanged(); @@ -235,7 +235,7 @@ void KexiDataSourcePage::clearWidgetDataSourceSelection() { if (!m_sourceFieldCombo->currentText().isEmpty()) { m_sourceFieldCombo->setCurrentText(""); - m_sourceFieldCombo->setFieldOrExpression(QString::null); + m_sourceFieldCombo->setFieldOrExpression(TQString()); slotFieldSelected(); } m_clearWidgetDSButton->setEnabled(false); @@ -243,7 +243,7 @@ void KexiDataSourcePage::clearWidgetDataSourceSelection() void KexiDataSourcePage::slotGotoSelected() { - QCString mime = m_dataSourceCombo->selectedMimeType().latin1(); + TQCString mime = m_dataSourceCombo->selectedMimeType().latin1(); if (mime=="kexi/table" || mime=="kexi/query") { if (m_dataSourceCombo->isSelectionValid()) emit jumpToObjectRequested(mime, m_dataSourceCombo->selectedName().latin1()); @@ -253,7 +253,7 @@ void KexiDataSourcePage::slotGotoSelected() void KexiDataSourcePage::slotInsertSelectedFields() { #ifndef KEXI_NO_AUTOFIELD_WIDGET - QStringList selectedFieldNames(m_fieldListView->selectedFieldNames()); + TQStringList selectedFieldNames(m_fieldListView->selectedFieldNames()); if (selectedFieldNames.isEmpty()) return; @@ -262,17 +262,17 @@ void KexiDataSourcePage::slotInsertSelectedFields() #endif } -void KexiDataSourcePage::slotFieldDoubleClicked(const QString& sourceMimeType, const QString& sourceName, - const QString& fieldName) +void KexiDataSourcePage::slotFieldDoubleClicked(const TQString& sourceMimeType, const TQString& sourceName, + const TQString& fieldName) { #ifndef KEXI_NO_AUTOFIELD_WIDGET - QStringList selectedFields; + TQStringList selectedFields; selectedFields.append(fieldName); emit insertAutoFields(sourceMimeType, sourceName, selectedFields); #endif } -void KexiDataSourcePage::slotDataSourceTextChanged(const QString & string) +void KexiDataSourcePage::slotDataSourceTextChanged(const TQString & string) { Q_UNUSED(string); const bool enable = m_dataSourceCombo->isSelectionValid(); //!string.isEmpty() && m_dataSourceCombo->selectedName() == string.latin1(); @@ -291,9 +291,9 @@ void KexiDataSourcePage::slotDataSourceChanged() { if (!m_dataSourceCombo->project()) return; - QCString mime = m_dataSourceCombo->selectedMimeType().latin1(); + TQCString mime = m_dataSourceCombo->selectedMimeType().latin1(); bool dataSourceFound = false; - QCString name = m_dataSourceCombo->selectedName().latin1(); + TQCString name = m_dataSourceCombo->selectedName().latin1(); if ((mime=="kexi/table" || mime=="kexi/query") && m_dataSourceCombo->isSelectionValid()) { KexiDB::TableOrQuerySchema *tableOrQuery = new KexiDB::TableOrQuerySchema( m_dataSourceCombo->project()->dbConnection(), name, mime=="kexi/table"); @@ -349,34 +349,34 @@ void KexiDataSourcePage::slotFieldSelected() ); } -void KexiDataSourcePage::setDataSource(const QCString& mimeType, const QCString& name) +void KexiDataSourcePage::setDataSource(const TQCString& mimeType, const TQCString& name) { m_dataSourceCombo->setDataSource(mimeType, name); } void KexiDataSourcePage::assignPropertySet(KoProperty::Set* propertySet) { - QCString objectName; - if (propertySet && propertySet->contains("name")) + TQCString objectName; + if (propertySet && propertySet->tqcontains("name")) objectName = (*propertySet)["name"].value().toCString(); if (!objectName.isEmpty() && objectName == m_currentObjectName) return; //the same object m_currentObjectName = objectName; - QCString objectClassName; - if (propertySet && propertySet->contains("this:className")) + TQCString objectClassName; + if (propertySet && propertySet->tqcontains("this:className")) objectClassName = (*propertySet)["this:className"].value().toCString(); /*moved if (propertySet) { - QCString iconName; - QString objectClassString; - if (propertySet->contains("this:iconName")) + TQCString iconName; + TQString objectClassString; + if (propertySet->tqcontains("this:iconName")) iconName = (*propertySet)["this:iconName"].value().toCString(); - if (propertySet->contains("this:classString")) + if (propertySet->tqcontains("this:classString")) objectClassString = (*propertySet)["this:classString"].value().toString(); m_objectInfoLabel->setObjectName(objectName); m_objectInfoLabel->setObjectClassIcon(iconName); m_objectInfoLabel->setObjectClassName(objectClassString); - if (propertySet->contains("this:className")) + if (propertySet->tqcontains("this:className")) objectClassName = (*propertySet)["this:className"].value().toCString(); }*/ KexiPropertyEditorView::updateInfoLabelForPropertySet( @@ -386,7 +386,7 @@ void KexiDataSourcePage::assignPropertySet(KoProperty::Set* propertySet) // kdDebug() << "objectClassName=" << objectClassName << endl; // { /* //this is top level form's surface: data source means table or query - QCString dataSourceMimeType, dataSource; + TQCString dataSourceMimeType, dataSource; if (buffer->hasProperty("dataSourceMimeType")) dataSourceMimeType = (*buffer)["dataSourceMimeType"].value().toCString(); if (buffer->hasProperty("dataSource")) @@ -396,16 +396,16 @@ void KexiDataSourcePage::assignPropertySet(KoProperty::Set* propertySet) // else { const bool multipleSelection = objectClassName=="special:multiple"; - const bool hasDataSourceProperty = propertySet && propertySet->contains("dataSource") && !multipleSelection; + const bool hasDataSourceProperty = propertySet && propertySet->tqcontains("dataSource") && !multipleSelection; if (!isForm) { //this is a widget - QCString dataSource; + TQCString dataSource; if (hasDataSourceProperty) { if (propertySet) dataSource = (*propertySet)["dataSource"].value().toCString(); m_noDataSourceAvailableLabel->hide(); - m_sourceFieldCombo->setFieldOrExpression(dataSource); + m_sourceFieldCombo->setFieldOrExpression(dataSource.data()); m_sourceFieldCombo->setEnabled(true); m_clearWidgetDSButton->setEnabled(!m_sourceFieldCombo->currentText().isEmpty()); m_widgetDSLabel->show(); @@ -445,7 +445,7 @@ void KexiDataSourcePage::slotFieldListViewSelectionChanged() { #ifndef KEXI_NO_AUTOFIELD_WIDGET //update "add field" button's state - for (QListViewItemIterator it(m_fieldListView); it.current(); ++it) { + for (TQListViewItemIterator it(m_fieldListView); it.current(); ++it) { if (it.current()->isSelected()) { m_addField->setEnabled(true); return; |