diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-30 00:15:53 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-30 00:15:53 +0000 |
commit | 0aaa8e3fc8f8a1481333b564f0922277c8d8ad59 (patch) | |
tree | b95c0ca86c4876dd139af376b9f4afd8917cf0cd /src/progs/gui/hardware_config_widget.cpp | |
parent | b79a2c28534cf09987eeeba3077fff9236df182a (diff) | |
download | piklab-0aaa8e3fc8f8a1481333b564f0922277c8d8ad59.tar.gz piklab-0aaa8e3fc8f8a1481333b564f0922277c8d8ad59.zip |
TQt4 port piklab
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1238822 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/progs/gui/hardware_config_widget.cpp')
-rw-r--r-- | src/progs/gui/hardware_config_widget.cpp | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/src/progs/gui/hardware_config_widget.cpp b/src/progs/gui/hardware_config_widget.cpp index 8d82ddb..4dbaac6 100644 --- a/src/progs/gui/hardware_config_widget.cpp +++ b/src/progs/gui/hardware_config_widget.cpp @@ -9,7 +9,7 @@ ***************************************************************************/ #include "hardware_config_widget.h" -#include <qlabel.h> +#include <tqlabel.h> #include <kpushbutton.h> #include "progs/base/prog_config.h" @@ -17,39 +17,39 @@ #include "common/gui/misc_gui.h" //----------------------------------------------------------------------------- -Hardware::HConfigWidget::HConfigWidget(::Programmer::Base &base, QWidget *parent, bool edit) - : QFrame(parent, "hardware_config_widget"), _edit(edit), _connected(false), _base(base) +Hardware::HConfigWidget::HConfigWidget(::Programmer::Base &base, TQWidget *tqparent, bool edit) + : TQFrame(tqparent, "hardware_config_widget"), _edit(edit), _connected(false), _base(base) { _hardware = 0; - QHBoxLayout *top = new QHBoxLayout(this, 0, 10); - _mainVBox = new QVBoxLayout(top); + TQHBoxLayout *top = new TQHBoxLayout(this, 0, 10); + _mainVBox = new TQVBoxLayout(top); if (edit) { - _editVBox = new QVBoxLayout(top); + _editVBox = new TQVBoxLayout(top); top->setStretchFactor(_editVBox, 1); } else _editVBox = 0; } //----------------------------------------------------------------------------- -Hardware::EditDialog::EditDialog(ConfigWidget *cwidget, const QString &name, const Port::Description &pd, Data *data) +Hardware::EditDialog::EditDialog(ConfigWidget *cwidget, const TQString &name, const Port::Description &pd, Data *data) : KDialogBase(Plain, i18n("Edit and test hardware"), Ok|Cancel, Cancel, cwidget, "hardware_edit_dialog", true, true), _cwidget(cwidget), _savedName(name), _oldData(data) { setButtonOK(i18n("Save")); setButtonCancel(i18n("Close")); - QGridLayout *grid = new QGridLayout(plainPage(), 1, 1, 0, 10); + TQGridLayout *grid = new TQGridLayout(plainPage(), 1, 1, 0, 10); grid->setColStretch(2, 1); - QLabel *label = new QLabel(i18n("Hardware name:"), plainPage()); + TQLabel *label = new TQLabel(i18n("Hardware name:"), plainPage()); grid->addWidget(label, 0, 0); - _name = new QLineEdit(name, plainPage()); + _name = new TQLineEdit(name, plainPage()); grid->addWidget(_name, 0, 1); - label = new QLabel(i18n("%1 at %2:").arg(pd.type.label()).arg(pd.device), plainPage()); + label = new TQLabel(i18n("%1 at %2:").tqarg(pd.type.label()).tqarg(pd.device), plainPage()); grid->addWidget(label, 1, 0); - label = new QLabel(plainPage()); + label = new TQLabel(plainPage()); grid->addWidget(label, 1, 1); _hc = cwidget->createHardwareConfigWidget(plainPage(), true); @@ -71,9 +71,9 @@ void Hardware::EditDialog::slotOk() MessageBox::sorry(i18n("The hardware name is already used for a standard hardware."), Log::Show); return; } - QStringList names = _cwidget->_config->hardwareNames(PortType::Nb_Types); // all hardwares - if ( names.contains(_name->text()) ) { - if ( !MessageBox::askContinue(i18n("Do you want to overwrite this custom hardware \"%1\"?").arg(_name->text()), + TQStringList names = _cwidget->_config->hardwareNames(PortType::Nb_Types); // all hardwares + if ( names.tqcontains(_name->text()) ) { + if ( !MessageBox::askContinue(i18n("Do you want to overwrite this custom hardware \"%1\"?").tqarg(_name->text()), KStdGuiItem::save()) ) return; } delete _oldData; @@ -94,19 +94,19 @@ void Hardware::EditDialog::slotCancel() } //----------------------------------------------------------------------------- -Hardware::ConfigWidget::ConfigWidget(::Programmer::Base *base, Config *config, QWidget *parent) - : ::Programmer::ConfigWidget(base->group(), parent), _base(base), _config(config), _hc(0) +Hardware::ConfigWidget::ConfigWidget(::Programmer::Base *base, Config *config, TQWidget *tqparent) + : ::Programmer::ConfigWidget(base->group(), tqparent), _base(base), _config(config), _hc(0) { // programmer combo uint row = numRows(); - _configCombo = new QComboBox(this); - connect(_configCombo, SIGNAL(activated(int)), SLOT(configChanged(int))); + _configCombo = new TQComboBox(this); + connect(_configCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(configChanged(int))); addWidget(_configCombo, row,row, 0,0); row++; // hardware config - QHBoxLayout *hbox = new QHBoxLayout(10); - _hbox = new QHBoxLayout(10); + TQHBoxLayout *hbox = new TQHBoxLayout(10); + _hbox = new TQHBoxLayout(10); hbox->addLayout(_hbox); addLayout(hbox, row,row, 0,1); row++; @@ -117,12 +117,12 @@ Hardware::ConfigWidget::ConfigWidget(::Programmer::Base *base, Config *config, Q row++; // buttons - QVBoxLayout *vbox = new QVBoxLayout(hbox); + TQVBoxLayout *vbox = new TQVBoxLayout(hbox); _editButton = new KPushButton(this); - connect(_editButton, SIGNAL(clicked()), SLOT(editClicked())); + connect(_editButton, TQT_SIGNAL(clicked()), TQT_SLOT(editClicked())); vbox->addWidget(_editButton); _deleteButton = new KPushButton(i18n("Delete"), this); - connect(_deleteButton, SIGNAL(clicked()), SLOT(deleteClicked())); + connect(_deleteButton, TQT_SIGNAL(clicked()), TQT_SLOT(deleteClicked())); vbox->addWidget(_deleteButton); vbox->addStretch(1); } @@ -148,7 +148,7 @@ bool Hardware::ConfigWidget::set(const Port::Description &pd, uint i) } bool ok = _hc->set(pd, *hd); delete hd; - QString s = _config->comment(_names[i]); + TQString s = _config->comment(_names[i]); if ( s.isEmpty() ) _comment->hide(); else { _comment->setText(s); @@ -163,7 +163,7 @@ bool Hardware::ConfigWidget::set(const Port::Description &pd, uint i) bool Hardware::ConfigWidget::setPort(const ::Programmer::HardwareDescription &hd) { updateList(hd.port.type); - int i = _names.findIndex(_config->currentHardware(hd.port.type)); + int i = _names.tqfindIndex(_config->currentHardware(hd.port.type)); if ( i!=-1 ) _configCombo->setCurrentItem(i); return set(hd.port, _configCombo->currentItem()); } @@ -174,29 +174,29 @@ void Hardware::ConfigWidget::updateList(PortType type) _names = _config->hardwareNames(type); for (uint i=0; i<_names.count(); i++) { bool standard = _config->isStandardHardware(_names[i]); - QString s = (standard ? _config->label(_names[i]) : i18n("%1 <custom>").arg(_names[i])); + TQString s = (standard ? _config->label(_names[i]) : i18n("%1 <custom>").tqarg(_names[i])); _configCombo->insertItem(s); } } void Hardware::ConfigWidget::editClicked() { - QString name = _names[_configCombo->currentItem()]; - QString cname = (_config->isStandardHardware(name) ? QString::null : name); + TQString name = _names[_configCombo->currentItem()]; + TQString cname = (_config->isStandardHardware(name) ? TQString() : name); Port::Description pd = _hc->portDescription(); EditDialog *hcd = new EditDialog(this, cname, pd, _hc->data()); int res = hcd->exec(); - if ( res==QDialog::Rejected ) return; + if ( res==TQDialog::Rejected ) return; updateList(pd.type); - int index = _names.findIndex(hcd->savedName()); + int index = _names.tqfindIndex(hcd->savedName()); _configCombo->setCurrentItem(index); configChanged(_configCombo->currentItem()); } void Hardware::ConfigWidget::deleteClicked() { - QString name = _names[_configCombo->currentItem()]; - if ( !MessageBox::askContinue(i18n("Do you want to delete custom hardware \"%1\"?").arg(name), + TQString name = _names[_configCombo->currentItem()]; + if ( !MessageBox::askContinue(i18n("Do you want to delete custom hardware \"%1\"?").tqarg(name), KStdGuiItem::del()) ) return; _config->deleteCustomHardware(name); updateList(_hc->portDescription().type); |