summaryrefslogtreecommitdiffstats
path: root/src/progs/gui
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-30 00:15:53 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-30 00:15:53 +0000
commit0aaa8e3fc8f8a1481333b564f0922277c8d8ad59 (patch)
treeb95c0ca86c4876dd139af376b9f4afd8917cf0cd /src/progs/gui
parentb79a2c28534cf09987eeeba3077fff9236df182a (diff)
downloadpiklab-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')
-rw-r--r--src/progs/gui/debug_config_center.cpp2
-rw-r--r--src/progs/gui/debug_config_center.h8
-rw-r--r--src/progs/gui/hardware_config_widget.cpp66
-rw-r--r--src/progs/gui/hardware_config_widget.h33
-rw-r--r--src/progs/gui/port_selector.cpp44
-rw-r--r--src/progs/gui/port_selector.h29
-rw-r--r--src/progs/gui/prog_config_center.cpp50
-rw-r--r--src/progs/gui/prog_config_center.h21
-rw-r--r--src/progs/gui/prog_config_widget.cpp14
-rw-r--r--src/progs/gui/prog_config_widget.h7
-rw-r--r--src/progs/gui/prog_group_ui.cpp56
-rw-r--r--src/progs/gui/prog_group_ui.h15
12 files changed, 177 insertions, 168 deletions
diff --git a/src/progs/gui/debug_config_center.cpp b/src/progs/gui/debug_config_center.cpp
index 9286e3e..a35eeba 100644
--- a/src/progs/gui/debug_config_center.cpp
+++ b/src/progs/gui/debug_config_center.cpp
@@ -10,7 +10,7 @@
#include <kiconloader.h>
-QPixmap Debugger::OptionsConfigWidget::pixmap() const
+TQPixmap Debugger::OptionsConfigWidget::pixmap() const
{
KIconLoader loader;
return loader.loadIcon("piklab_config_debugger", KIcon::Toolbar, KIcon::SizeMedium);
diff --git a/src/progs/gui/debug_config_center.h b/src/progs/gui/debug_config_center.h
index a8e496e..169829e 100644
--- a/src/progs/gui/debug_config_center.h
+++ b/src/progs/gui/debug_config_center.h
@@ -9,7 +9,7 @@
#ifndef DEBUG_CONFIG_CENTER_H
#define DEBUG_CONFIG_CENTER_H
-#include <qcheckbox.h>
+#include <tqcheckbox.h>
#include "common/gui/config_widget.h"
#include "progs/base/debug_config.h"
@@ -18,9 +18,9 @@ namespace Debugger
{
BEGIN_DECLARE_CONFIG_WIDGET(Config, OptionsConfigWidget)
- virtual QString header() const { return i18n("Debugging Options"); }
- virtual QString title() const { return i18n("Debugging Options"); }
- virtual QPixmap pixmap() const;
+ virtual TQString header() const { return i18n("Debugging Options"); }
+ virtual TQString title() const { return i18n("Debugging Options"); }
+ virtual TQPixmap pixmap() const;
END_DECLARE_CONFIG_WIDGET
} // namespace
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);
diff --git a/src/progs/gui/hardware_config_widget.h b/src/progs/gui/hardware_config_widget.h
index d373990..2f94e81 100644
--- a/src/progs/gui/hardware_config_widget.h
+++ b/src/progs/gui/hardware_config_widget.h
@@ -10,8 +10,8 @@
#ifndef HARDWARE_CONFIG_WIDGET
#define HARDWARE_CONFIG_WIDGET
-#include <qlineedit.h>
-#include <qcombobox.h>
+#include <tqlineedit.h>
+#include <tqcombobox.h>
#include <kdialogbase.h>
#include <ktextbrowser.h>
@@ -24,11 +24,12 @@ namespace Hardware
{
//-----------------------------------------------------------------------------
-class HConfigWidget : public QFrame
+class HConfigWidget : public TQFrame
{
Q_OBJECT
+ TQ_OBJECT
public:
- HConfigWidget(::Programmer::Base &base, QWidget *parent, bool edit);
+ HConfigWidget(::Programmer::Base &base, TQWidget *tqparent, bool edit);
virtual ~HConfigWidget() { delete _hardware; }
virtual bool set(const Port::Description &pd, const Data &data) = 0;
virtual Data *data() const = 0;
@@ -36,7 +37,7 @@ public:
protected:
::Programmer::Hardware *_hardware;
- QVBoxLayout *_mainVBox, *_editVBox;
+ TQVBoxLayout *_mainVBox, *_editVBox;
bool _edit, _connected;
::Programmer::Base &_base;
};
@@ -47,9 +48,10 @@ class ConfigWidget;
class EditDialog : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- EditDialog(ConfigWidget *parent, const QString &name, const Port::Description &pd, Data *data);
- QString savedName() const { return _savedName; }
+ EditDialog(ConfigWidget *tqparent, const TQString &name, const Port::Description &pd, Data *data);
+ TQString savedName() const { return _savedName; }
private slots:
virtual void slotOk();
@@ -57,22 +59,23 @@ private slots:
private:
ConfigWidget *_cwidget;
- QString _savedName;
+ TQString _savedName;
Data *_oldData;
HConfigWidget *_hc;
- QLineEdit *_name;
+ TQLineEdit *_name;
};
//-----------------------------------------------------------------------------
class ConfigWidget : public ::Programmer::ConfigWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
- ConfigWidget(::Programmer::Base *base, Config *config, QWidget *parent);
+ ConfigWidget(::Programmer::Base *base, Config *config, TQWidget *tqparent);
virtual ~ConfigWidget() { delete _base; }
virtual void saveConfig();
virtual bool setPort(const ::Programmer::HardwareDescription &hd);
- virtual HConfigWidget *createHardwareConfigWidget(QWidget *parent, bool edit) const = 0;
+ virtual HConfigWidget *createHardwareConfigWidget(TQWidget *tqparent, bool edit) const = 0;
private slots:
void editClicked();
@@ -84,12 +87,12 @@ protected:
private:
Config *_config;
- QStringList _names;
+ TQStringList _names;
HConfigWidget *_hc;
- QPushButton *_editButton, *_deleteButton;
- QComboBox *_configCombo;
+ TQPushButton *_editButton, *_deleteButton;
+ TQComboBox *_configCombo;
KTextBrowser *_comment;
- QHBoxLayout *_hbox;
+ TQHBoxLayout *_hbox;
void updateList(PortType type);
bool set(const Port::Description &pd, uint i);
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()));
}
diff --git a/src/progs/gui/port_selector.h b/src/progs/gui/port_selector.h
index 6304d1a..86a0d4d 100644
--- a/src/progs/gui/port_selector.h
+++ b/src/progs/gui/port_selector.h
@@ -9,24 +9,25 @@
#ifndef PORT_SELECTOR_H
#define PORT_SELECTOR_H
-#include <qradiobutton.h>
-#include <qcombobox.h>
-#include <qlayout.h>
-#include <qbuttongroup.h>
-#include <qlabel.h>
+#include <tqradiobutton.h>
+#include <tqcombobox.h>
+#include <tqlayout.h>
+#include <tqbuttongroup.h>
+#include <tqlabel.h>
#include "common/port/port.h"
namespace Programmer { class Group; }
-class PortSelector : public QFrame
+class PortSelector : public TQFrame
{
Q_OBJECT
+ TQ_OBJECT
public:
- PortSelector(QWidget *parent);
+ PortSelector(TQWidget *tqparent);
void setGroup(const Programmer::Group &group);
Port::Description portDescription() const { return Port::Description(type(), device(type())); }
void saveConfig();
- void setStatus(PortType type, const QString &message);
+ void settqStatus(PortType type, const TQString &message);
signals:
void changed();
@@ -36,17 +37,17 @@ private slots:
private:
const Programmer::Group *_group;
- QGridLayout *_top, *_grid;
- QWidget *_main;
- QButtonGroup *_bgroup;
- QComboBox *_combos[PortType::Nb_Types];
- QLabel *_status[PortType::Nb_Types];
+ TQGridLayout *_top, *_grid;
+ TQWidget *_main;
+ TQButtonGroup *_bgroup;
+ TQComboBox *_combos[PortType::Nb_Types];
+ TQLabel *_status[PortType::Nb_Types];
bool _pending;
static const char * const LABELS[PortType::Nb_Types];
void addPortType(const Port::Description &pd);
PortType type() const;
- QString device(PortType type) const;
+ TQString device(PortType type) const;
};
#endif
diff --git a/src/progs/gui/prog_config_center.cpp b/src/progs/gui/prog_config_center.cpp
index 3210921..f781280 100644
--- a/src/progs/gui/prog_config_center.cpp
+++ b/src/progs/gui/prog_config_center.cpp
@@ -8,13 +8,13 @@
***************************************************************************/
#include "prog_config_center.h"
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qwidgetstack.h>
-#include <qcombobox.h>
-#include <qcheckbox.h>
-#include <qtimer.h>
-#include <qtabwidget.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqwidgetstack.h>
+#include <tqcombobox.h>
+#include <tqcheckbox.h>
+#include <tqtimer.h>
+#include <tqtabwidget.h>
#include <kiconloader.h>
#include "progs/list/prog_list.h"
@@ -25,7 +25,7 @@
#include "libgui/main_global.h"
//----------------------------------------------------------------------------
-QPixmap Programmer::OptionsConfigWidget::pixmap() const
+TQPixmap Programmer::OptionsConfigWidget::pixmap() const
{
KIconLoader loader;
return loader.loadIcon("piklab_config_programmer", KIcon::Toolbar, KIcon::SizeMedium);
@@ -37,15 +37,15 @@ Programmer::SelectConfigWidget::SelectConfigWidget()
uint row = 0;
// programmer type
- QLabel *label = new QLabel(i18n("Programmer in use:"), this);
+ TQLabel *label = new TQLabel(i18n("Programmer in use:"), this);
addWidget(label, row,row, 0,0);
- _combo = new KeyComboBox<QString>(this);
- connect(_combo->widget(), SIGNAL(activated(int)), SLOT(programmerChanged()));
+ _combo = new KeyComboBox<TQString>(this);
+ connect(_combo->widget(), TQT_SIGNAL(activated(int)), TQT_SLOT(programmerChanged()));
addWidget(_combo->widget(), row,row, 1,1);
row++;
// tab widget
- _tabWidget = new QTabWidget(this);
+ _tabWidget = new TQTabWidget(this);
addWidget(_tabWidget, row,row, 0,2);
row++;
@@ -53,14 +53,14 @@ Programmer::SelectConfigWidget::SelectConfigWidget()
_portSelectorContainer = new Container;
_portSelectorContainer->setMargin(10);
_portSelector = new PortSelector(_portSelectorContainer);
- connect(_portSelector, SIGNAL(changed()), SLOT(portChanged()));
+ connect(_portSelector, TQT_SIGNAL(changed()), TQT_SLOT(portChanged()));
_portSelectorContainer->addWidget(_portSelector, 0,0, 0,0);
// specific programmer config
- _stack = new KeyWidgetStack<QString>(_tabWidget);
- static_cast<QFrame *>(_stack->widget())->setMargin(10);
+ _stack = new KeyWidgetStack<TQString>(_tabWidget);
+ static_cast<TQFrame *>(_stack->widget())->setMargin(10);
KIconLoader loader;
- QPixmap icon = loader.loadIcon("configure", KIcon::Small);
+ TQPixmap icon = loader.loadIcon("configure", KIcon::Small);
_tabWidget->addTab(_stack->widget(), icon, i18n("Specific"));
::Programmer::Lister::ConstIterator it;
for (it=::Programmer::lister().begin(); it!=::Programmer::lister().end(); ++it) {
@@ -73,23 +73,23 @@ Programmer::SelectConfigWidget::SelectConfigWidget()
// init
_combo->setCurrentItem(GlobalConfig::programmerGroup().name());
_stack->setCurrentItem(GlobalConfig::programmerGroup().name());
- QTimer::singleShot(0, this, SLOT(programmerChanged()));
+ TQTimer::singleShot(0, this, TQT_SLOT(programmerChanged()));
}
void Programmer::SelectConfigWidget::portChanged()
{
- ::BusyCursor bc; // can take a few seconds to connect programmer...
+ ::PBusyCursor bc; // can take a few seconds to connect programmer...
HardwareDescription hd;
hd.port = _portSelector->portDescription();
::Hardware::Config *config = Main::programmerGroup().hardwareConfig();
if (config) hd.name = config->currentHardware(hd.port.type);
delete config;
- QWidget *w = _stack->item(_combo->currentItem());
+ TQWidget *w = _stack->item(_combo->currentItem());
bool ok = static_cast< ::Programmer::ConfigWidget *>(w)->setPort(hd);
- _portSelector->setStatus(hd.port.type, ok ? i18n("Connection: Ok") : i18n("Connection: Error"));
+ _portSelector->settqStatus(hd.port.type, ok ? i18n("Connection: Ok") : i18n("Connection: Error"));
}
-QPixmap Programmer::SelectConfigWidget::pixmap() const
+TQPixmap Programmer::SelectConfigWidget::pixmap() const
{
KIconLoader loader;
return loader.loadIcon("piklab_config_programmer", KIcon::Toolbar, KIcon::SizeMedium);
@@ -98,25 +98,25 @@ QPixmap Programmer::SelectConfigWidget::pixmap() const
void Programmer::SelectConfigWidget::saveConfig()
{
_portSelector->saveConfig();
- QString key = _combo->currentItem();
+ TQString key = _combo->currentItem();
static_cast<ConfigWidget *>(_stack->item(key))->saveConfig();
GlobalConfig::writeProgrammerGroup(*::Programmer::lister().group(key));
}
void Programmer::SelectConfigWidget::programmerChanged()
{
- QString key = _combo->currentItem();
+ TQString key = _combo->currentItem();
const ::Programmer::Group &group = *::Programmer::lister().group(key);
bool isHardware = !group.isSoftware();
bool hasTab = ( _tabWidget->indexOf(_portSelectorContainer)!=-1 );
if (isHardware) {
if ( !hasTab ) {
KIconLoader loader;
- QPixmap icon = loader.loadIcon("connect_creating", KIcon::Small);
+ TQPixmap icon = loader.loadIcon("connect_creating", KIcon::Small);
_tabWidget->insertTab(_portSelectorContainer, icon, i18n("Port Selection"), 0);
}
} else if (hasTab) _tabWidget->removePage(_portSelectorContainer);
_portSelector->setGroup(group);
_stack->setCurrentItem(key);
- if (isHardware) QTimer::singleShot(0, this, SLOT(portChanged()));
+ if (isHardware) TQTimer::singleShot(0, this, TQT_SLOT(portChanged()));
}
diff --git a/src/progs/gui/prog_config_center.h b/src/progs/gui/prog_config_center.h
index ea5ee6d..e2f13c8 100644
--- a/src/progs/gui/prog_config_center.h
+++ b/src/progs/gui/prog_config_center.h
@@ -9,7 +9,7 @@
#ifndef PROG_CONFIG_CENTER_H
#define PROG_CONFIG_CENTER_H
-#include <qcheckbox.h>
+#include <tqcheckbox.h>
#include "common/gui/config_widget.h"
#include "common/gui/key_gui.h"
@@ -20,21 +20,22 @@ class PortSelector;
namespace Programmer
{
BEGIN_DECLARE_CONFIG_WIDGET(Config, OptionsConfigWidget)
- virtual QString header() const { return i18n("Programmer Options"); }
- virtual QString title() const { return i18n("Programmer Options"); }
- virtual QPixmap pixmap() const;
+ virtual TQString header() const { return i18n("Programmer Options"); }
+ virtual TQString title() const { return i18n("Programmer Options"); }
+ virtual TQPixmap pixmap() const;
END_DECLARE_CONFIG_WIDGET
//----------------------------------------------------------------------------
class SelectConfigWidget : public ::ConfigWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
SelectConfigWidget();
virtual void loadConfig() {}
- virtual QString header() const { return i18n("Programmer Selection"); }
- virtual QString title() const { return i18n("Programmer Selection"); }
- virtual QPixmap pixmap() const;
+ virtual TQString header() const { return i18n("Programmer Selection"); }
+ virtual TQString title() const { return i18n("Programmer Selection"); }
+ virtual TQPixmap pixmap() const;
public slots:
virtual void saveConfig();
@@ -44,11 +45,11 @@ private slots:
void portChanged();
private:
- KeyComboBox<QString> *_combo;
+ KeyComboBox<TQString> *_combo;
PortSelector *_portSelector;
- KeyWidgetStack<QString> *_stack;
+ KeyWidgetStack<TQString> *_stack;
Container *_portSelectorContainer;
- QTabWidget *_tabWidget;
+ TQTabWidget *_tabWidget;
};
} // namespace
diff --git a/src/progs/gui/prog_config_widget.cpp b/src/progs/gui/prog_config_widget.cpp
index be767c2..5ff6047 100644
--- a/src/progs/gui/prog_config_widget.cpp
+++ b/src/progs/gui/prog_config_widget.cpp
@@ -8,21 +8,21 @@
***************************************************************************/
#include "prog_config_widget.h"
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qcombobox.h>
-#include <qcheckbox.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqcombobox.h>
+#include <tqcheckbox.h>
#include <kurlrequester.h>
#include "progs/base/prog_config.h"
#include "progs/base/prog_group.h"
-Programmer::ConfigWidget::ConfigWidget(const Group &group, QWidget *parent)
- : ::ConfigWidget(parent), _group(group)
+Programmer::ConfigWidget::ConfigWidget(const Group &group, TQWidget *tqparent)
+ : ::ConfigWidget(tqparent), _group(group)
{
if ( group.properties() & NeedDeviceSpecificFirmware ) {
uint row = numRows();
- QLabel *label = new QLabel(i18n("Firmware directory:"), this);
+ TQLabel *label = new TQLabel(i18n("Firmware directory:"), this);
addWidget(label, row,row, 0,0);
_firmwareDir = new KURLRequester(this);
_firmwareDir->setMode(KFile::Directory | KFile::ExistingOnly);
diff --git a/src/progs/gui/prog_config_widget.h b/src/progs/gui/prog_config_widget.h
index d201cea..2dc8b7e 100644
--- a/src/progs/gui/prog_config_widget.h
+++ b/src/progs/gui/prog_config_widget.h
@@ -9,7 +9,7 @@
#ifndef PROG_CONFIG_WIDGET
#define PROG_CONFIG_WIDGET
-class QCheckBox;
+class TQCheckBox;
class KURLRequester;
#include "common/gui/config_widget.h"
@@ -23,15 +23,16 @@ class HardwareDescription;
class ConfigWidget: public ::ConfigWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
- ConfigWidget(const Group &group, QWidget *parent);
+ ConfigWidget(const Group &group, TQWidget *tqparent);
virtual void loadConfig();
const Group &group() const { return _group; }
virtual void saveConfig();
virtual bool setPort(const HardwareDescription &hd);
signals:
- void updatePortStatus(bool ok);
+ void updatePorttqStatus(bool ok);
protected:
const Group &_group;
diff --git a/src/progs/gui/prog_group_ui.cpp b/src/progs/gui/prog_group_ui.cpp
index 14cf7b0..90643a0 100644
--- a/src/progs/gui/prog_group_ui.cpp
+++ b/src/progs/gui/prog_group_ui.cpp
@@ -24,50 +24,50 @@
#include "devices/pic/prog/pic_prog.h"
//----------------------------------------------------------------------------
-Programmer::StandaloneMemoryCalibrationEditor::StandaloneMemoryCalibrationEditor(const Pic::Memory &memory, QWidget *parent)
- : Pic::MemoryCalibrationEditor(0, const_cast<Pic::Memory &>(memory), parent)
+Programmer::StandaloneMemoryCalibrationEditor::StandaloneMemoryCalibrationEditor(const Pic::Memory &memory, TQWidget *tqparent)
+ : Pic::MemoryCalibrationEditor(0, const_cast<Pic::Memory &>(memory), tqparent)
{}
void Programmer::StandaloneMemoryCalibrationEditor::init(bool first)
{
Pic::MemoryCalibrationEditor::init(first);
- KAction *action = new KAction(i18n("Read"), "reload", 0, this, SIGNAL(updateCalibration()), Main::toplevel().actionCollection());
+ KAction *action = new KAction(i18n("Read"), "reload", 0, TQT_TQOBJECT(this), TQT_SIGNAL(updateCalibration()), Main::toplevel().actionCollection());
addAction(action);
- action = new KAction(i18n("Regenerating..."), 0, 0, this, SIGNAL(regenerate()), Main::toplevel().actionCollection());
+ action = new KAction(i18n("Regenerating..."), 0, 0, TQT_TQOBJECT(this), TQT_SIGNAL(regenerate()), Main::toplevel().actionCollection());
addAction(action);
}
//----------------------------------------------------------------------------
-Programmer::ButtonContainer::ButtonContainer(const QString &title,
- QObject *receiver, const char *updateSlot, QWidget *parent)
- : ::ButtonContainer(title, parent)
+Programmer::ButtonContainer::ButtonContainer(const TQString &title,
+ TQObject *receiver, const char *updateSlot, TQWidget *tqparent)
+ : ::ButtonContainer(title, tqparent)
{
if (receiver) button().appendAction(i18n("Read"), "reload", receiver, updateSlot);
}
//----------------------------------------------------------------------------
-Programmer::AdvancedDialog::AdvancedDialog(Base &base, QWidget *parent, const char *name)
- : Dialog(IconList, i18n("Advanced Dialog"), Close, Close, parent, name, true, false),
+Programmer::AdvancedDialog::AdvancedDialog(Base &base, TQWidget *tqparent, const char *name)
+ : Dialog(IconList, i18n("Advanced Dialog"), Close, Close, tqparent, name, true, false),
_base(base), _calEditor(0)
{
// programmer
KIconLoader loader;
- QPixmap pixmap = loader.loadIcon("piklab_burnchip", KIcon::Toolbar, KIcon::SizeMedium);
- QFrame *page = addPage(i18n("Programmer"), _base.group().label(), pixmap);
- QVBoxLayout *vbox = new QVBoxLayout(page);
+ TQPixmap pixmap = loader.loadIcon("piklab_burnchip", KIcon::Toolbar, KIcon::SizeMedium);
+ TQFrame *page = addPage(i18n("Programmer"), _base.group().label(), pixmap);
+ TQVBoxLayout *vbox = new TQVBoxLayout(page);
_programmerContainer = new Container(page);
vbox->addWidget(_programmerContainer);
Properties properties = _base.group().properties();
uint row = _programmerContainer->numRows();
if ( properties & HasFirmware ) {
- _firmwareContainer = new ButtonContainer(i18n("Firmware"), this, SLOT(updateFirmware()), _programmerContainer);
+ _firmwareContainer = new ButtonContainer(i18n("Firmware"), TQT_TQOBJECT(this), TQT_SLOT(updateFirmware()), _programmerContainer);
_programmerContainer->addWidget(_firmwareContainer, row,row, 0,1);
if ( _base.group().properties() & CanUploadFirmware )
- _firmwareContainer->button().appendAction(i18n("Uploading..."), "piklab_burnchip", this, SLOT(uploadFirmware()));
- QLabel *label = new QLabel(i18n("Version:"), _firmwareContainer);
+ _firmwareContainer->button().appendAction(i18n("Uploading..."), "piklab_burnchip", TQT_TQOBJECT(this), TQT_SLOT(uploadFirmware()));
+ TQLabel *label = new TQLabel(i18n("Version:"), _firmwareContainer);
_firmwareContainer->addWidget(label, 1,1, 0,0);
- _firmwareLabel = new QLabel(_firmwareContainer);
+ _firmwareLabel = new TQLabel(_firmwareContainer);
_firmwareContainer->addWidget(_firmwareLabel, 1,1, 1,1);
row++;
} else {
@@ -76,13 +76,13 @@ Programmer::AdvancedDialog::AdvancedDialog(Base &base, QWidget *parent, const ch
}
if ( _base.group().canReadVoltages() ) {
- _voltagesContainer = new ButtonContainer(i18n("Voltages"), this, SLOT(updateVoltages()), _programmerContainer);
+ _voltagesContainer = new ButtonContainer(i18n("Voltages"), TQT_TQOBJECT(this), TQT_SLOT(updateVoltages()), _programmerContainer);
_programmerContainer->addWidget(_voltagesContainer, row,row, 0,1);
row++;
} else _voltagesContainer = 0;
if ( properties & HasSelfTest ) {
- _selfTestContainer = new ButtonContainer(i18n("Self-test"), this, SLOT(updateSelfTest()), _programmerContainer);
+ _selfTestContainer = new ButtonContainer(i18n("Self-test"), TQT_TQOBJECT(this), TQT_SLOT(updateSelfTest()), _programmerContainer);
_programmerContainer->addWidget(_selfTestContainer, row,row, 0,1);
row++;
} else _selfTestContainer = 0;
@@ -90,11 +90,11 @@ Programmer::AdvancedDialog::AdvancedDialog(Base &base, QWidget *parent, const ch
// calibration
pixmap = loader.loadIcon("configure", KIcon::Toolbar, KIcon::SizeMedium);
page = addPage(i18n("Calibration"), i18n("Calibration"), pixmap);
- vbox = new QVBoxLayout(page);
+ vbox = new TQVBoxLayout(page);
_calibrationContainer = new Container(page);
vbox->addWidget(_calibrationContainer);
const Device::Data *data = Main::deviceData();
- QString s;
+ TQString s;
if ( data==0 ) s = i18n("No device selected.");
else if ( data->group().name()!="pic" || !static_cast<const Pic::Data *>(data)->isReadable(Pic::MemoryRangeType::Cal) )
s = i18n("This device has no calibration information.");
@@ -102,14 +102,14 @@ Programmer::AdvancedDialog::AdvancedDialog(Base &base, QWidget *parent, const ch
else {
const ::Programmer::PicBase &pbase = static_cast<const ::Programmer::PicBase &>(_base);
_calEditor = new StandaloneMemoryCalibrationEditor(pbase.deviceMemory(), _calibrationContainer);
- connect(_calEditor, SIGNAL(updateCalibration()), SLOT(updateCalibration()));
- connect(_calEditor, SIGNAL(regenerate()), SLOT(regenerateCalibration()));
+ connect(_calEditor, TQT_SIGNAL(updateCalibration()), TQT_SLOT(updateCalibration()));
+ connect(_calEditor, TQT_SIGNAL(regenerate()), TQT_SLOT(regenerateCalibration()));
_calEditor->init(true);
_calEditor->setReadOnly(true);
_calibrationContainer->addWidget(_calEditor, 0,0, 0,0);
}
if ( !s.isEmpty() ) {
- QLabel *label = new QLabel(s, _calibrationContainer);
+ TQLabel *label = new TQLabel(s, _calibrationContainer);
_calibrationContainer->addWidget(label, 0,0, 0,0);
}
}
@@ -132,7 +132,7 @@ bool Programmer::AdvancedDialog::ensureConnected()
void Programmer::AdvancedDialog::updateFirmware()
{
- ::BusyCursor bc;
+ ::PBusyCursor bc;
if ( ensureConnected() ) _base.readFirmwareVersion();
updateDisplay();
}
@@ -141,7 +141,7 @@ void Programmer::AdvancedDialog::uploadFirmware()
{
PURL::Url url = PURL::getOpenUrl(":open_firmware", PURL::filter(PURL::Hex), this ,i18n("Open Firmware"));
if ( url.isEmpty() ) return;
- ::BusyCursor bc;
+ ::PBusyCursor bc;
if ( !connectProgrammer() ) return;
if ( _base.uploadFirmware(url) )
MessageBox::information(i18n("Firmware uploaded successfully."), Log::Show);
@@ -151,21 +151,21 @@ void Programmer::AdvancedDialog::uploadFirmware()
void Programmer::AdvancedDialog::updateVoltages()
{
- ::BusyCursor bc;
+ ::PBusyCursor bc;
if ( ensureConnected() ) _base.readVoltages();
updateDisplay();
}
void Programmer::AdvancedDialog::updateSelfTest()
{
- ::BusyCursor bc;
+ ::PBusyCursor bc;
if ( ensureConnected() ) _base.selfTest(false);
updateDisplay();
}
void Programmer::AdvancedDialog::updateCalibration()
{
- ::BusyCursor bc;
+ ::PBusyCursor bc;
if ( ensureConnected() ) static_cast< ::Programmer::PicBase &>(_base).readCalibration();
updateDisplay();
}
diff --git a/src/progs/gui/prog_group_ui.h b/src/progs/gui/prog_group_ui.h
index cd97834..edc15ee 100644
--- a/src/progs/gui/prog_group_ui.h
+++ b/src/progs/gui/prog_group_ui.h
@@ -27,8 +27,9 @@ class Group;
class StandaloneMemoryCalibrationEditor : public Pic::MemoryCalibrationEditor
{
Q_OBJECT
+ TQ_OBJECT
public:
- StandaloneMemoryCalibrationEditor(const Pic::Memory &memory, QWidget *parent);
+ StandaloneMemoryCalibrationEditor(const Pic::Memory &memory, TQWidget *tqparent);
virtual void init(bool first);
virtual bool hasAction(Device::Action) const { return false; }
@@ -41,16 +42,18 @@ signals:
class ButtonContainer : public ::ButtonContainer
{
Q_OBJECT
+ TQ_OBJECT
public:
- ButtonContainer(const QString &title, QObject *receiver, const char *updateSlot, QWidget *parent);
+ ButtonContainer(const TQString &title, TQObject *receiver, const char *updateSlot, TQWidget *tqparent);
};
//----------------------------------------------------------------------------
class AdvancedDialog : public Dialog
{
Q_OBJECT
+ TQ_OBJECT
public:
- AdvancedDialog(Base &base, QWidget *parent, const char *name);
+ AdvancedDialog(Base &base, TQWidget *tqparent, const char *name);
virtual void updateDisplay();
protected:
@@ -70,16 +73,16 @@ protected slots:
virtual void regenerateCalibration();
private:
- QLabel *_firmwareLabel;
+ TQLabel *_firmwareLabel;
};
//----------------------------------------------------------------------------
class GroupUI : public ::Group::BaseGui
{
public:
- virtual ::Programmer::ConfigWidget *createConfigWidget(QWidget *parent) const = 0;
+ virtual ::Programmer::ConfigWidget *createConfigWidget(TQWidget *tqparent) const = 0;
virtual bool hasAdvancedDialog() const = 0;
- virtual AdvancedDialog *createAdvancedDialog(Base &base, QWidget *parent) const = 0;
+ virtual AdvancedDialog *createAdvancedDialog(Base &base, TQWidget *tqparent) const = 0;
};
inline const ::Programmer::GroupUI &groupui(const ::Programmer::Base &base) { return static_cast<const ::Programmer::GroupUI &>(*base.group().gui()); }