diff options
Diffstat (limited to 'src/progs/direct/gui')
-rw-r--r-- | src/progs/direct/gui/direct_config_widget.cpp | 88 | ||||
-rw-r--r-- | src/progs/direct/gui/direct_config_widget.h | 26 |
2 files changed, 58 insertions, 56 deletions
diff --git a/src/progs/direct/gui/direct_config_widget.cpp b/src/progs/direct/gui/direct_config_widget.cpp index 985cacd..fc7b867 100644 --- a/src/progs/direct/gui/direct_config_widget.cpp +++ b/src/progs/direct/gui/direct_config_widget.cpp @@ -9,87 +9,87 @@ ***************************************************************************/ #include "direct_config_widget.h" -#include <qtooltip.h> -#include <qcheckbox.h> -#include <qtimer.h> -#include <qpushbutton.h> +#include <tqtooltip.h> +#include <tqcheckbox.h> +#include <tqtimer.h> +#include <tqpushbutton.h> #include "progs/direct/base/direct_prog_config.h" #include "progs/direct/base/direct_prog.h" //----------------------------------------------------------------------------- -::Programmer::ConfigWidget *Direct::GroupUI::createConfigWidget(QWidget *parent) const +::Programmer::ConfigWidget *Direct::GroupUI::createConfigWidget(TQWidget *tqparent) const { - return new ConfigWidget(static_cast<const ::Programmer::Group &>(group()), parent); + return new ConfigWidget(static_cast<const ::Programmer::Group &>(group()), tqparent); } //----------------------------------------------------------------------------- const char * const INV_PIN_LABEL = I18N_NOOP("Check this option if your hardware uses negative logic for this pin."); const char * const DELAY_LABEL = I18N_NOOP("Some programming cards need low clock rate:\nadding delay to clock pulses might help."); -Direct::HConfigWidget::HConfigWidget(::Programmer::Base &base, QWidget *parent, bool edit) - : ::Hardware::HConfigWidget(base, parent, edit) +Direct::HConfigWidget::HConfigWidget(::Programmer::Base &base, TQWidget *tqparent, bool edit) + : ::Hardware::HConfigWidget(base, tqparent, edit) { // pins assignment - QGroupBox *groupb = new QGroupBox(1, Horizontal, i18n("Pin assignment"), this); + TQGroupBox *groupb = new TQGroupBox(1,Qt::Horizontal, i18n("Pin assignment"), this); _mainVBox->addWidget(groupb); - QWidget *w = new QWidget(groupb); - QGridLayout *grid = new QGridLayout(w, 1, 1, 0, 10); + TQWidget *w = new TQWidget(groupb); + TQGridLayout *grid = new TQGridLayout(w, 1, 1, 0, 10); if (edit) grid->setColStretch(5, 1); for (uint i=0; i<Nb_PinTypes; i++) { - QLabel *label = new QLabel(i18n(PIN_DATA[i].label), w); - QToolTip::add(label, PIN_DATA[i].comment); + TQLabel *label = new TQLabel(i18n(PIN_DATA[i].label), w); + TQToolTip::add(label, PIN_DATA[i].comment); grid->addWidget(label, i, 0); - _combos[i] = new QComboBox(w); + _combos[i] = new TQComboBox(w); _combos[i]->setEnabled(edit); - connect(_combos[i], SIGNAL(activated(int)), SLOT(slotPinChanged())); - QToolTip::add(_combos[i], PIN_DATA[i].comment); + connect(_combos[i], TQT_SIGNAL(activated(int)), TQT_SLOT(slotPinChanged())); + TQToolTip::add(_combos[i], PIN_DATA[i].comment); grid->addWidget(_combos[i], i, 1); - _invcbs[i] = new QCheckBox(i18n("Inverted"), w); + _invcbs[i] = new TQCheckBox(i18n("Inverted"), w); _invcbs[i]->setEnabled(edit); - QToolTip::add(_invcbs[i], i18n(INV_PIN_LABEL)); + TQToolTip::add(_invcbs[i], i18n(INV_PIN_LABEL)); grid->addWidget(_invcbs[i], i, 2); if (edit) { - _testcbs[i] = new QCheckBox(i18n("on"), w); - QToolTip::add(_testcbs[i], PIN_DATA[i].testComment); - connect(_testcbs[i], SIGNAL(clicked()), SLOT(slotTestPin())); + _testcbs[i] = new TQCheckBox(i18n("on"), w); + TQToolTip::add(_testcbs[i], PIN_DATA[i].testComment); + connect(_testcbs[i], TQT_SIGNAL(clicked()), TQT_SLOT(slotTestPin())); grid->addWidget(_testcbs[i], i, 3); - _testLabels[i] = new QLabel(w); - QToolTip::add(_testcbs[i], PIN_DATA[i].testComment); + _testLabels[i] = new TQLabel(w); + TQToolTip::add(_testcbs[i], PIN_DATA[i].testComment); grid->addWidget(_testLabels[i], i, 4); - updateTestStatus(PinType(i), false); + updateTesttqStatus(PinType(i), false); } else { _testcbs[i] = 0; _testLabels[i] = 0; } } - QHBoxLayout *hbox = new QHBoxLayout(_mainVBox); - QLabel *label = new QLabel(i18n("Clock delay"), this); - QToolTip::add(label, i18n(DELAY_LABEL)); + TQHBoxLayout *hbox = new TQHBoxLayout(_mainVBox); + TQLabel *label = new TQLabel(i18n("Clock delay"), this); + TQToolTip::add(label, i18n(DELAY_LABEL)); hbox->addWidget(label); - _delay = new KIntNumInput(0, Horizontal, this); + _delay = new KIntNumInput(0,Qt::Horizontal, this); _delay->setRange(0, 50, 5); _delay->setEnabled(edit); - QToolTip::add(_delay, i18n(DELAY_LABEL)); + TQToolTip::add(_delay, i18n(DELAY_LABEL)); hbox->addWidget(_delay); if (edit) { - _sendBitsButton = new QPushButton(i18n("Send 0xA55A"), this); + _sendBitsButton = new TQPushButton(i18n("Send 0xA55A"), this); _sendBitsButton->setToggleButton(true); - connect(_sendBitsButton, SIGNAL(clicked()), SLOT(sendBits())); - QToolTip::add(_sendBitsButton, i18n("Continuously send 0xA55A on \"Data out\" pin.")); + connect(_sendBitsButton, TQT_SIGNAL(clicked()), TQT_SLOT(sendBits())); + TQToolTip::add(_sendBitsButton, i18n("Continuously send 0xA55A on \"Data out\" pin.")); _editVBox->addWidget(_sendBitsButton); _editVBox->addStretch(1); } else _sendBitsButton = 0; // timer for sending bits - _timerSendBits = new QTimer(this); - connect(_timerSendBits, SIGNAL(timeout()), SLOT(slotSendBits())); + _timerSendBits = new TQTimer(this); + connect(_timerSendBits, TQT_SIGNAL(timeout()), TQT_SLOT(slotSendBits())); // timer for automatically polling DataOut pin - _timerPollDataOut = new QTimer(this); - connect(_timerPollDataOut, SIGNAL(timeout()), SLOT(updateDataIn())); + _timerPollDataOut = new TQTimer(this); + connect(_timerPollDataOut, TQT_SIGNAL(timeout()), TQT_SLOT(updateDataIn())); } void Direct::HConfigWidget::sendBits() @@ -150,11 +150,11 @@ void Direct::HConfigWidget::updateTestPin(PinType ptype) Q_ASSERT( _connected && ptype!=DataIn ); bool on = _testcbs[ptype]->isChecked(); hardware()->setPin(ptype, on); - updateTestStatus(ptype, on); + updateTesttqStatus(ptype, on); if ( ptype==Vpp ) updateDataIn(); } -void Direct::HConfigWidget::updateTestStatus(PinType ptype, bool on) +void Direct::HConfigWidget::updateTesttqStatus(PinType ptype, bool on) { if (on) _testLabels[ptype]->setText(i18n(PIN_DATA[ptype].onLabel)); else _testLabels[ptype]->setText(i18n(PIN_DATA[ptype].offLabel)); @@ -163,7 +163,7 @@ void Direct::HConfigWidget::updateTestStatus(PinType ptype, bool on) void Direct::HConfigWidget::updateDataIn() { bool on = hardware()->readBit(); - updateTestStatus(DataIn, on); + updateTesttqStatus(DataIn, on); _testcbs[DataIn]->setChecked(on); } @@ -204,7 +204,7 @@ bool Direct::HConfigWidget::set(const Port::Description &pd, const ::Hardware::D if (_edit) { for (uint i=0; i<Nb_PinTypes; i++) { _testcbs[i]->setEnabled(_connected); - updateTestStatus(PinType(i), false); + updateTesttqStatus(PinType(i), false); } if ( _connected ) _timerPollDataOut->start(100); _sendBitsButton->setEnabled(_connected); @@ -239,11 +239,11 @@ Hardware::Data *Direct::HConfigWidget::data() const } //----------------------------------------------------------------------------- -Direct::ConfigWidget::ConfigWidget(const ::Programmer::Group &group, QWidget *parent) - : ::Hardware::ConfigWidget(new ::Direct::PicBase(group, 0), new Config, parent) +Direct::ConfigWidget::ConfigWidget(const ::Programmer::Group &group, TQWidget *tqparent) + : ::Hardware::ConfigWidget(new ::Direct::PicBase(group, 0), new Config, tqparent) {} -Hardware::HConfigWidget *Direct::ConfigWidget::createHardwareConfigWidget(QWidget *parent, bool edit) const +Hardware::HConfigWidget *Direct::ConfigWidget::createHardwareConfigWidget(TQWidget *tqparent, bool edit) const { - return new HConfigWidget(*_base, parent, edit); + return new HConfigWidget(*_base, tqparent, edit); } diff --git a/src/progs/direct/gui/direct_config_widget.h b/src/progs/direct/gui/direct_config_widget.h index 4a5e4c6..093e9fa 100644 --- a/src/progs/direct/gui/direct_config_widget.h +++ b/src/progs/direct/gui/direct_config_widget.h @@ -22,17 +22,18 @@ namespace Direct class GroupUI : public ::Programmer::GroupUI { public: - virtual ::Programmer::ConfigWidget *createConfigWidget(QWidget *parent) const; + virtual ::Programmer::ConfigWidget *createConfigWidget(TQWidget *tqparent) const; virtual bool hasAdvancedDialog() const { return false; } - virtual ::Programmer::AdvancedDialog *createAdvancedDialog(::Programmer::Base &, QWidget *) const { return 0; } + virtual ::Programmer::AdvancedDialog *createAdvancedDialog(::Programmer::Base &, TQWidget *) const { return 0; } }; //----------------------------------------------------------------------------- class HConfigWidget : public ::Hardware::HConfigWidget { Q_OBJECT + TQ_OBJECT public: - HConfigWidget(::Programmer::Base &base, QWidget *parent, bool edit); + HConfigWidget(::Programmer::Base &base, TQWidget *tqparent, bool edit); virtual bool set(const Port::Description &pd, const ::Hardware::Data &data); virtual ::Hardware::Data *data() const; @@ -44,17 +45,17 @@ private slots: void slotSendBits(); private: - QComboBox *_combos[Nb_PinTypes]; - QCheckBox *_invcbs[Nb_PinTypes]; - QCheckBox *_testcbs[Nb_PinTypes]; - QLabel *_testLabels[Nb_PinTypes]; + TQComboBox *_combos[Nb_PinTypes]; + TQCheckBox *_invcbs[Nb_PinTypes]; + TQCheckBox *_testcbs[Nb_PinTypes]; + TQLabel *_testLabels[Nb_PinTypes]; KIntNumInput *_delay; - QPushButton *_sendBitsButton; - QTimer *_timerSendBits, *_timerPollDataOut; + TQPushButton *_sendBitsButton; + TQTimer *_timerSendBits, *_timerPollDataOut; void sendBits(uint d, int nbb); void updateTestPin(PinType ptype); - void updateTestStatus(PinType ptype, bool on); + void updateTesttqStatus(PinType ptype, bool on); uint pin(PinType ptype) const; void updatePin(PinType ptype); Hardware *hardware() { return static_cast<Hardware *>(_hardware); } @@ -64,9 +65,10 @@ private: class ConfigWidget : public ::Hardware::ConfigWidget { Q_OBJECT + TQ_OBJECT public: - ConfigWidget(const ::Programmer::Group &group, QWidget *parent); - virtual ::Hardware::HConfigWidget *createHardwareConfigWidget(QWidget *parent, bool edit) const; + ConfigWidget(const ::Programmer::Group &group, TQWidget *tqparent); + virtual ::Hardware::HConfigWidget *createHardwareConfigWidget(TQWidget *tqparent, bool edit) const; }; } // namespace |