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/port_selector.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/port_selector.cpp')
-rw-r--r-- | src/progs/gui/port_selector.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/progs/gui/port_selector.cpp b/src/progs/gui/port_selector.cpp index 2aaaabf..4bb4539 100644 --- a/src/progs/gui/port_selector.cpp +++ b/src/progs/gui/port_selector.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ #include "port_selector.h" -#include <qtimer.h> +#include <tqtimer.h> #include <ktextbrowser.h> #include "common/port/serial.h" @@ -21,23 +21,23 @@ const char * const PortSelector::LABELS[PortType::Nb_Types] = { I18N_NOOP("Serial"), I18N_NOOP("Parallel"), I18N_NOOP("USB") }; -PortSelector::PortSelector(QWidget *parent) - : QFrame(parent, "port_selector"), _group(0), _main(0) +PortSelector::PortSelector(TQWidget *tqparent) + : TQFrame(tqparent, "port_selector"), _group(0), _main(0) { - _top = new QGridLayout(this, 1, 1, 0, 10); + _top = new TQGridLayout(this, 1, 1, 0, 10); _top->setRowStretch(1, 1); - _bgroup = new QButtonGroup; - connect(_bgroup, SIGNAL(clicked(int)), SIGNAL(changed())); + _bgroup = new TQButtonGroup; + connect(_bgroup, TQT_SIGNAL(clicked(int)), TQT_SIGNAL(changed())); } void PortSelector::setGroup(const Programmer::Group &group) { _group = &group; delete _main; - _main = new QWidget(this); + _main = new TQWidget(this); _top->addWidget(_main, 0, 0); - _grid = new QGridLayout(_main, 1, 1, 0, 10); + _grid = new TQGridLayout(_main, 1, 1, 0, 10); _grid->setColStretch(3, 1); FOR_EACH(PortType, type) { _combos[type.type()] = 0; @@ -52,7 +52,7 @@ void PortSelector::setGroup(const Programmer::Group &group) void PortSelector::addPortType(const Port::Description &pd) { - QString noDeviceMessage, notAvailableMessage; + TQString noDeviceMessage, notAvailableMessage; switch (pd.type.type()) { case PortType::Serial: noDeviceMessage = i18n("Your computer might not have any serial port."); @@ -70,38 +70,38 @@ void PortSelector::addPortType(const Port::Description &pd) case PortType::Nb_Types: Q_ASSERT(false); break; } - QRadioButton *rb = new QRadioButton(i18n(LABELS[pd.type.type()]), _main); + TQRadioButton *rb = new TQRadioButton(i18n(LABELS[pd.type.type()]), _main); _bgroup->insert(rb, pd.type.type()); if ( _bgroup->count()==1 ) _bgroup->setButton(pd.type.type()); _grid->addWidget(rb, 3*(_bgroup->count()-1), 0); - _status[pd.type.type()] = new QLabel(_main); + _status[pd.type.type()] = new TQLabel(_main); _grid->addWidget(_status[pd.type.type()], 3*(_bgroup->count()-1), 2); - QStringList list = Port::probedDeviceList(pd.type); + TQStringList list = Port::probedDeviceList(pd.type); bool noDevice = ( list.isEmpty() && pd.type.data().withDevice ); bool notAvailable = !Port::isAvailable(pd.type); rb->setEnabled(!notAvailable); if ( noDevice || notAvailable ) { KTextBrowser *comment = new KTextBrowser(_main); - QString text = (notAvailable ? notAvailableMessage : noDeviceMessage); + TQString text = (notAvailable ? notAvailableMessage : noDeviceMessage); text += "<p>"; - text += i18n("<a href=\"%1\">See Piklab homepage for help</a>.").arg(Piklab::URLS[Piklab::Support]); + text += i18n("<a href=\"%1\">See Piklab homepage for help</a>.").tqarg(Piklab::URLS[Piklab::Support]); comment->setText(text); _grid->addMultiCellWidget(comment, 3*(_bgroup->count()-1)+1,3*(_bgroup->count()-1)+1, 0,3); } if (pd.type.data().withDevice) { - _combos[pd.type.type()] = new QComboBox(true, _main); + _combos[pd.type.type()] = new TQComboBox(true, _main); for (uint i=0; i<list.count(); i++) _combos[pd.type.type()]->insertItem(list[i]); - if ( !pd.device.isEmpty() && !list.contains(pd.device) ) _combos[pd.type.type()]->insertItem(pd.device); + if ( !pd.device.isEmpty() && !list.tqcontains(pd.device) ) _combos[pd.type.type()]->insertItem(pd.device); _combos[pd.type.type()]->setCurrentText(pd.device); - connect(_combos[pd.type.type()], SIGNAL(activated(int)), SIGNAL(changed())); - connect(_combos[pd.type.type()], SIGNAL(textChanged(const QString &)), SLOT(textChanged())); + connect(_combos[pd.type.type()], TQT_SIGNAL(activated(int)), TQT_SIGNAL(changed())); + connect(_combos[pd.type.type()], TQT_SIGNAL(textChanged(const TQString &)), TQT_SLOT(textChanged())); _grid->addWidget(_combos[pd.type.type()], 3*(_bgroup->count()-1), 1); } } -void PortSelector::setStatus(PortType ptype, const QString &message) +void PortSelector::settqStatus(PortType ptype, const TQString &message) { _pending = false; FOR_EACH(PortType, type) { @@ -114,9 +114,9 @@ void PortSelector::setStatus(PortType ptype, const QString &message) } } -QString PortSelector::device(PortType type) const +TQString PortSelector::device(PortType type) const { - if ( type==PortType::Nb_Types || _combos[type.type()]==0 || !type.data().withDevice ) return QString::null; + if ( type==PortType::Nb_Types || _combos[type.type()]==0 || !type.data().withDevice ) return TQString(); return _combos[type.type()]->currentText(); } @@ -140,5 +140,5 @@ void PortSelector::textChanged() if (_pending) return; _status[type().type()]->hide(); _pending = true; - QTimer::singleShot(1000, this, SIGNAL(changed())); + TQTimer::singleShot(1000, this, TQT_SIGNAL(changed())); } |