diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kexi/main/startup/KexiConnSelector.cpp | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kexi/main/startup/KexiConnSelector.cpp')
-rw-r--r-- | kexi/main/startup/KexiConnSelector.cpp | 148 |
1 files changed, 74 insertions, 74 deletions
diff --git a/kexi/main/startup/KexiConnSelector.cpp b/kexi/main/startup/KexiConnSelector.cpp index 454f1e08..a6c4d160 100644 --- a/kexi/main/startup/KexiConnSelector.cpp +++ b/kexi/main/startup/KexiConnSelector.cpp @@ -40,19 +40,19 @@ #include <ktoolbarbutton.h> #include <kactionclasses.h> -#include <qlabel.h> -#include <qpushbutton.h> -#include <qlayout.h> -#include <qcheckbox.h> -#include <qtooltip.h> -#include <qtextedit.h> -#include <qgroupbox.h> -#include <qwidgetstack.h> -#include <qbuttongroup.h> +#include <tqlabel.h> +#include <tqpushbutton.h> +#include <tqlayout.h> +#include <tqcheckbox.h> +#include <tqtooltip.h> +#include <tqtextedit.h> +#include <tqgroupbox.h> +#include <tqwidgetstack.h> +#include <tqbuttongroup.h> ConnectionDataLVItem::ConnectionDataLVItem(KexiDB::ConnectionData *data, - const KexiDB::Driver::Info& info, QListView *list) - : QListViewItem(list) + const KexiDB::Driver::Info& info, TQListView *list) + : TQListViewItem(list) , m_data(data) { update(info); @@ -65,13 +65,13 @@ ConnectionDataLVItem::~ConnectionDataLVItem() void ConnectionDataLVItem::update(const KexiDB::Driver::Info& info) { setText(0, m_data->caption+" "); - const QString &sfile = i18n("File"); - QString drvname = info.caption.isEmpty() ? m_data->driverName : info.caption; + const TQString &sfile = i18n("File"); + TQString drvname = info.caption.isEmpty() ? m_data->driverName : info.caption; if (info.fileBased) setText(1, sfile + " ("+drvname+") " ); else setText(1, drvname+" " ); - setText(2, (info.fileBased ? (QString("<")+sfile.lower()+">") : m_data->serverInfoString(true))+" " ); + setText(2, (info.fileBased ? (TQString("<")+sfile.lower()+">") : m_data->serverInfoString(true))+" " ); } /*================================================================*/ @@ -87,11 +87,11 @@ public: { } - QWidget* openExistingWidget; + TQWidget* openExistingWidget; KexiPrjTypeSelector* prjTypeSelector; - QString startDirOrVariable; - QWidgetStack *stack; - QGuardedPtr<KexiDBConnectionSet> conn_set; + TQString startDirOrVariable; + TQWidgetStack *stack; + TQGuardedPtr<KexiDBConnectionSet> conn_set; KexiDB::DriverManager manager; bool conn_sel_shown;//! helper bool file_sel_shown; @@ -101,34 +101,34 @@ public: /*================================================================*/ KexiConnSelectorWidget::KexiConnSelectorWidget( KexiDBConnectionSet& conn_set, - const QString& startDirOrVariable, QWidget* parent, const char* name ) - : QWidget( parent, name ) + const TQString& startDirOrVariable, TQWidget* tqparent, const char* name ) + : TQWidget( tqparent, name ) ,d(new KexiConnSelectorWidgetPrivate()) { d->conn_set = &conn_set; d->startDirOrVariable = startDirOrVariable; - QString none, iconname = KMimeType::mimeType( KexiDB::Driver::defaultFileBasedDriverMimeType() )->icon(none,0); - const QPixmap &icon = KGlobal::iconLoader()->loadIcon( iconname, KIcon::Desktop ); + TQString none, iconname = KMimeType::mimeType( KexiDB::Driver::defaultFileBasedDriverMimeType() )->icon(none,0); + const TQPixmap &icon = KGlobal::iconLoader()->loadIcon( iconname, KIcon::Desktop ); setIcon( icon ); - QVBoxLayout* globalLyr = new QVBoxLayout( this ); + TQVBoxLayout* globalLyr = new TQVBoxLayout( this ); //create header with radio buttons - d->openExistingWidget = new QWidget(this, "openExistingWidget"); - QVBoxLayout* openExistingWidgetLyr = new QVBoxLayout( d->openExistingWidget ); -// QLabel* lbl = new QLabel(i18n("<b>Select existing Kexi project to open:</b>"), openExistingWidget); + d->openExistingWidget = new TQWidget(this, "openExistingWidget"); + TQVBoxLayout* openExistingWidgetLyr = new TQVBoxLayout( d->openExistingWidget ); +// TQLabel* lbl = new TQLabel(i18n("<b>Select existing Kexi project to open:</b>"), openExistingWidget); // openExistingWidgetLyr->addWidget( lbl ); d->prjTypeSelector = new KexiPrjTypeSelector( d->openExistingWidget ); - connect(d->prjTypeSelector->buttonGroup,SIGNAL(clicked(int)),this,SLOT(slotPrjTypeSelected(int))); + connect(d->prjTypeSelector->buttonGroup,TQT_SIGNAL(clicked(int)),this,TQT_SLOT(slotPrjTypeSelected(int))); openExistingWidgetLyr->addWidget( d->prjTypeSelector ); openExistingWidgetLyr->addSpacing( KDialogBase::spacingHint() ); - QFrame* line = new QFrame( d->openExistingWidget, "line" ); - line->setFrameShape( QFrame::HLine ); - line->setFrameShadow( QFrame::Sunken ); + TQFrame* line = new TQFrame( d->openExistingWidget, "line" ); + line->setFrameShape( TQFrame::HLine ); + line->setFrameShadow( TQFrame::Sunken ); openExistingWidgetLyr->addWidget( line ); globalLyr->addWidget(d->openExistingWidget); - d->stack = new QWidgetStack(this, "stack"); + d->stack = new TQWidgetStack(this, "stack"); globalLyr->addWidget(d->stack); // m_file = new KexiOpenExistingFile( this, "KexiOpenExistingFile"); @@ -136,28 +136,28 @@ KexiConnSelectorWidget::KexiConnSelectorWidget( KexiDBConnectionSet& conn_set, m_fileDlg = 0; // addWidget(m_file); -// connect(m_file->btn_advanced,SIGNAL(clicked()),this,SLOT(showAdvancedConn())); +// connect(m_file->btn_advanced,TQT_SIGNAL(clicked()),this,TQT_SLOT(showAdvancedConn())); m_remote = new KexiConnSelectorBase(d->stack, "conn_sel"); m_remote->icon->setPixmap( DesktopIcon("network") ); m_remote->icon->setFixedSize( m_remote->icon->pixmap()->size() ); // m_remote->btn_back->setIconSet( SmallIconSet("1uparrow") ); - connect(m_remote->btn_add, SIGNAL(clicked()), this, SLOT(slotRemoteAddBtnClicked())); - connect(m_remote->btn_edit, SIGNAL(clicked()), this, SLOT(slotRemoteEditBtnClicked())); - connect(m_remote->btn_remove, SIGNAL(clicked()), this, SLOT(slotRemoteRemoveBtnClicked())); - QToolTip::add(m_remote->btn_add, i18n("Add a new database connection")); - QToolTip::add(m_remote->btn_edit, i18n("Edit selected database connection")); - QToolTip::add(m_remote->btn_remove, i18n("Remove selected database connections")); + connect(m_remote->btn_add, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotRemoteAddBtnClicked())); + connect(m_remote->btn_edit, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotRemoteEditBtnClicked())); + connect(m_remote->btn_remove, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotRemoteRemoveBtnClicked())); + TQToolTip::add(m_remote->btn_add, i18n("Add a new database connection")); + TQToolTip::add(m_remote->btn_edit, i18n("Edit selected database connection")); + TQToolTip::add(m_remote->btn_remove, i18n("Remove selected database connections")); d->stack->addWidget(m_remote); - if (m_remote->layout()) - m_remote->layout()->setMargin(0); -// connect(m_remote->btn_back,SIGNAL(clicked()),this,SLOT(showSimpleConn())); - connect(m_remote->list,SIGNAL(doubleClicked(QListViewItem*)), - this,SLOT(slotConnectionItemExecuted(QListViewItem*))); - connect(m_remote->list,SIGNAL(returnPressed(QListViewItem*)), - this,SLOT(slotConnectionItemExecuted(QListViewItem*))); - connect(m_remote->list,SIGNAL(selectionChanged()), - this,SLOT(slotConnectionSelectionChanged())); + if (m_remote->tqlayout()) + m_remote->tqlayout()->setMargin(0); +// connect(m_remote->btn_back,TQT_SIGNAL(clicked()),this,TQT_SLOT(showSimpleConn())); + connect(m_remote->list,TQT_SIGNAL(doubleClicked(TQListViewItem*)), + this,TQT_SLOT(slotConnectionItemExecuted(TQListViewItem*))); + connect(m_remote->list,TQT_SIGNAL(returnPressed(TQListViewItem*)), + this,TQT_SLOT(slotConnectionItemExecuted(TQListViewItem*))); + connect(m_remote->list,TQT_SIGNAL(selectionChanged()), + this,TQT_SLOT(slotConnectionSelectionChanged())); } KexiConnSelectorWidget::~KexiConnSelectorWidget() @@ -167,7 +167,7 @@ KexiConnSelectorWidget::~KexiConnSelectorWidget() /*void KexiConnSelectorWidget::disconnectShowSimpleConnButton() { - m_remote->btn_back->disconnect(this,SLOT(showSimpleConn())); + m_remote->btn_back->disconnect(this,TQT_SLOT(showSimpleConn())); }*/ void KexiConnSelectorWidget::showAdvancedConn() @@ -197,8 +197,8 @@ void KexiConnSelectorWidget::slotPrjTypeSelected(int id) if (m_remote->list->firstChild()) { m_remote->list->setSelected(m_remote->list->firstChild(),true); } - m_remote->descriptionEdit->setPaletteBackgroundColor(palette().active().background()); - m_remote->descGroupBox->layout()->setMargin(2); + m_remote->descriptionEdit->setPaletteBackgroundColor(tqpalette().active().background()); + m_remote->descGroupBox->tqlayout()->setMargin(2); m_remote->list->setFocus(); slotConnectionSelectionChanged(); } @@ -222,15 +222,15 @@ void KexiConnSelectorWidget::showSimpleConn() m_fileDlg = new KexiStartupFileDialog( d->startDirOrVariable, KexiStartupFileDialog::Opening, d->stack, "openExistingFileDlg"); m_fileDlg->setConfirmOverwrites( d->confirmOverwrites ); -// static_cast<QVBoxLayout*>(m_file->layout())->insertWidget( 2, m_fileDlg ); +// static_cast<TQVBoxLayout*>(m_file->tqlayout())->insertWidget( 2, m_fileDlg ); d->stack->addWidget(m_fileDlg); - for (QWidget *w = parentWidget(true);w;w=w->parentWidget(true)) { + for (TQWidget *w = tqparentWidget(true);w;w=w->tqparentWidget(true)) { if (w->isDialog()) { -//#ifndef Q_WS_WIN - connect(m_fileDlg,SIGNAL(rejected()),static_cast<QDialog*>(w),SLOT(reject())); +//#ifndef TQ_WS_WIN + connect(m_fileDlg,TQT_SIGNAL(rejected()),static_cast<TQDialog*>(w),TQT_SLOT(reject())); //#endif -// connect(m_fileDlg,SIGNAL(cancelled()),static_cast<QDialog*>(w),SLOT(reject())); +// connect(m_fileDlg,TQT_SIGNAL(cancelled()),static_cast<TQDialog*>(w),TQT_SLOT(reject())); break; } } @@ -248,7 +248,7 @@ int KexiConnSelectorWidget::selectedConnectionType() const if (selectedConnectionType()!=KexiConnSelectorWidget::ServerBased) return 0; ConnectionDataLVItem *item = 0; // = static_cast<ConnectionDataLVItem*>(m_remote->list->selectedItem()); - for (QListViewItemIterator it(m_remote->list); it.current(); ++it) { + for (TQListViewItemIterator it(m_remote->list); it.current(); ++it) { if (it.current()->isSelected()) { if (item) return 0; //multiple @@ -266,21 +266,21 @@ KexiDB::ConnectionData* KexiConnSelectorWidget::selectedConnectionData() const return item->data(); } -QString KexiConnSelectorWidget::selectedFileName() +TQString KexiConnSelectorWidget::selectedFileName() { if (selectedConnectionType()!=KexiConnSelectorWidget::FileBased) - return QString::null; + return TQString(); return m_fileDlg->currentFileName(); } -void KexiConnSelectorWidget::setSelectedFileName(const QString& fileName) +void KexiConnSelectorWidget::setSelectedFileName(const TQString& fileName) { if (selectedConnectionType()!=KexiConnSelectorWidget::FileBased) return; return m_fileDlg->setSelection(fileName); } -void KexiConnSelectorWidget::slotConnectionItemExecuted(QListViewItem *item) +void KexiConnSelectorWidget::slotConnectionItemExecuted(TQListViewItem *item) { emit connectionItemExecuted(static_cast<ConnectionDataLVItem*>(item)); } @@ -291,7 +291,7 @@ void KexiConnSelectorWidget::slotConnectionSelectionChanged() //update buttons availability /* ConnectionDataLVItem *singleItem = 0; bool multi = false; - for (QListViewItemIterator it(m_remote->list); it.current(); ++it) { + for (TQListViewItemIterator it(m_remote->list); it.current(); ++it) { if (it.current()->isSelected()) { if (singleItem) { singleItem = 0; @@ -304,18 +304,18 @@ void KexiConnSelectorWidget::slotConnectionSelectionChanged() }*/ m_remote->btn_edit->setEnabled(item); m_remote->btn_remove->setEnabled(item); - m_remote->descriptionEdit->setText(item ? item->data()->description : QString::null); + m_remote->descriptionEdit->setText(item ? item->data()->description : TQString()); emit connectionItemHighlighted(item); } -QListView* KexiConnSelectorWidget::connectionsList() const +TQListView* KexiConnSelectorWidget::connectionsList() const { return m_remote->list; } void KexiConnSelectorWidget::setFocus() { - QWidget::setFocus(); + TQWidget::setFocus(); if (d->stack->visibleWidget()==m_fileDlg) m_fileDlg->setFocus(); //m_fileDlg->locationWidget()->setFocus(); else @@ -348,20 +348,20 @@ bool KexiConnSelectorWidget::confirmOverwrites() const return d->confirmOverwrites; } -/*static QString msgUnfinished() { +/*static TQString msgUnfinished() { return i18n("To define or change a connection, use command line options or click on .kexis file. " - "You can find example .kexis file at <a href=\"%1\">here</a>.").arg("") //temporary, please do not change for 0.8! + "You can find example .kexis file at <a href=\"%1\">here</a>.").tqarg("") //temporary, please do not change for 0.8! + "\nhttp://www.kexi-project.org/resources/testdb.kexis"; */ -// .arg("http://websvn.kde.org/*checkout*/branches/kexi/0.9/koffice/kexi/tests/startup/testdb.kexis"); +// .tqarg("http://websvn.kde.org/*checkout*/branches/kexi/0.9/koffice/kexi/tests/startup/testdb.kexis"); //} void KexiConnSelectorWidget::slotRemoteAddBtnClicked() { KexiDB::ConnectionData data; - KexiDBConnectionDialog dlg(data, QString::null, + KexiDBConnectionDialog dlg(data, TQString(), KGuiItem(i18n("&Add"), "button_ok", i18n("Add database connection")) ); dlg.setCaption(i18n("Add New Database Connection")); - if (QDialog::Accepted!=dlg.exec()) + if (TQDialog::Accepted!=dlg.exec()) return; //store this conn. data @@ -383,10 +383,10 @@ void KexiConnSelectorWidget::slotRemoteEditBtnClicked() ConnectionDataLVItem* item = static_cast<ConnectionDataLVItem*>(m_remote->list->selectedItem()); if (!item) return; - KexiDBConnectionDialog dlg(*item->data(), QString::null, + KexiDBConnectionDialog dlg(*item->data(), TQString(), KGuiItem(i18n("&Save"), "filesave", i18n("Save changes made to this database connection")) ); dlg.setCaption(i18n("Edit Database Connection")); - if (QDialog::Accepted!=dlg.exec()) + if (TQDialog::Accepted!=dlg.exec()) return; KexiDB::ConnectionData *newData = new KexiDB::ConnectionData( *dlg.currentProjectData().connectionData() ); @@ -407,11 +407,11 @@ void KexiConnSelectorWidget::slotRemoteRemoveBtnClicked() return; if (KMessageBox::Continue!=KMessageBox::warningContinueCancel(0, i18n("Do you want to remove database connection \"%1\" from the list of available connections?") - .arg(item->data()->serverInfoString(true)), QString::null, KStdGuiItem::del(), QString::null, + .tqarg(item->data()->serverInfoString(true)), TQString(), KStdGuiItem::del(), TQString(), KMessageBox::Notify|KMessageBox::Dangerous)) return; - QListViewItem* nextItem = item->itemBelow(); + TQListViewItem* nextItem = item->itemBelow(); if (!nextItem) nextItem = item->itemAbove(); if (!d->conn_set->removeConnectionData(item->data())) @@ -426,7 +426,7 @@ void KexiConnSelectorWidget::slotRemoteRemoveBtnClicked() void KexiConnSelectorWidget::hideConnectonIcon() { m_remote->icon->setFixedWidth(0); - m_remote->icon->setPixmap(QPixmap()); + m_remote->icon->setPixmap(TQPixmap()); } #include "KexiConnSelector.moc" |