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/libgui/hex_editor.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/libgui/hex_editor.cpp')
-rw-r--r-- | src/libgui/hex_editor.cpp | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/src/libgui/hex_editor.cpp b/src/libgui/hex_editor.cpp index 48ad7e8..197eb83 100644 --- a/src/libgui/hex_editor.cpp +++ b/src/libgui/hex_editor.cpp @@ -9,14 +9,14 @@ ***************************************************************************/ #include "hex_editor.h" -#include <qgroupbox.h> -#include <qhgroupbox.h> -#include <qregexp.h> -#include <qlayout.h> -#include <qscrollview.h> -#include <qstringlist.h> -#include <qlabel.h> -#include <qtimer.h> +#include <tqgroupbox.h> +#include <tqhgroupbox.h> +#include <tqregexp.h> +#include <tqlayout.h> +#include <tqscrollview.h> +#include <tqstringlist.h> +#include <tqlabel.h> +#include <tqtimer.h> #include <klocale.h> #include <ktempfile.h> @@ -30,13 +30,13 @@ //----------------------------------------------------------------------------- HexEditorPart::HexEditorPart(HexEditor *editor) - : KParts::ReadWritePart(editor, "hex_editor_part") + : KParts::ReadWritePart(TQT_TQOBJECT(editor), "hex_editor_part") { setXMLFile("hexeditorpartui.rc"); - (void)KStdAction::save(editor, SLOT(save()), actionCollection()); - (void)KStdAction::saveAs(editor, SLOT(saveAs()), actionCollection()); - (void)new KToggleAction(i18n("Read Only Mode"), 0, 0, editor, SLOT(toggleReadOnly()), actionCollection(), "tools_toggle_write_lock"); + (void)KStdAction::save(TQT_TQOBJECT(editor), TQT_SLOT(save()), actionCollection()); + (void)KStdAction::saveAs(TQT_TQOBJECT(editor), TQT_SLOT(saveAs()), actionCollection()); + (void)new KToggleAction(i18n("Read Only Mode"), 0, 0, TQT_TQOBJECT(editor), TQT_SLOT(toggleReadOnly()), actionCollection(), "tools_toggle_write_lock"); } void HexEditorPart::setReadWrite(bool rw) @@ -46,14 +46,14 @@ void HexEditorPart::setReadWrite(bool rw) } //----------------------------------------------------------------------------- -HexEditor::HexEditor(const QString &name, QWidget *parent) - : DeviceEditor(name, QString::null, parent, "hex_editor") +HexEditor::HexEditor(const TQString &name, TQWidget *tqparent) + : DeviceEditor(name, TQString(), tqparent, "hex_editor") { init(); } -HexEditor::HexEditor(QWidget *parent) - : DeviceEditor(parent, "hex_editor") +HexEditor::HexEditor(TQWidget *tqparent) + : DeviceEditor(tqparent, "hex_editor") { init(); } @@ -76,18 +76,18 @@ void HexEditor::clear() _originalMemory = 0; } -QWidget *HexEditor::createView(const Device::Data *data, QWidget *parent) +TQWidget *HexEditor::createView(const Device::Data *data, TQWidget *tqparent) { clear(); if (data) { _originalMemory = data->group().createMemory(*data); _memory = data->group().createMemory(*data); } - if ( data==0 ) return new QWidget(parent); - Device::HexView *hv = Device::groupui(*data).createHexView(*this, parent); - connect(hv, SIGNAL(modified()), SLOT(slotModified())); + if ( data==0 ) return new TQWidget(tqparent); + Device::HexView *hv = Device::groupui(*data).createHexView(*this, tqparent); + connect(hv, TQT_SIGNAL(modified()), TQT_SLOT(slotModified())); _dirty = true; - QTimer::singleShot(0, this, SLOT(simpleLoad())); + TQTimer::singleShot(0, this, TQT_SLOT(simpleLoad())); return hv; } @@ -96,10 +96,10 @@ bool HexEditor::simpleLoad() if ( !_dirty ) return true; _dirty = false; if (_memory) { - QStringList warnings; + TQStringList warnings; if ( _memory->fromHexBuffer(_hexBuffer, warnings)!=Device::Memory::NoWarning ) { _labelWarning->setText(i18n("<b>Warning:</b> hex file seems to be incompatible with the selected device %1:<br>%2") - .arg(_memory->device().name()).arg(warnings.join("<br>"))); + .tqarg(_memory->device().name()).tqarg(warnings.join("<br>"))); _labelWarning->show(); } else _labelWarning->hide(); display(); @@ -128,7 +128,7 @@ bool HexEditor::open(const PURL::Url &url) _url = url; PURL::File file(url, Main::compileLog()); if ( !file.openForRead() ) return false; - QStringList errors; + TQStringList errors; if ( !_hexBuffer.load(file.stream(), errors) ) { MessageBox::detailedSorry(i18n("Error(s) reading hex file."), errors.join("\n"), Log::Show); return false; @@ -139,15 +139,15 @@ bool HexEditor::open(const PURL::Url &url) bool HexEditor::save(const PURL::Url &url) { - return save(url, i18n("File URL: \"%1\".").arg(url.pretty())); + return save(url, i18n("File URL: \"%1\".").tqarg(url.pretty())); } -bool HexEditor::save(const PURL::Url &url, const QString &fileErrorString) +bool HexEditor::save(const PURL::Url &url, const TQString &fileErrorString) { PURL::File file(url, Main::compileLog()); if ( !file.openForWrite() ) return false; if ( !_memory->save(file.stream(), HexBuffer::IHX32) ) { - MessageBox::detailedSorry(i18n("Error while writing file \"%1\".").arg(url.pretty()), fileErrorString, Log::Show); + MessageBox::detailedSorry(i18n("Error while writing file \"%1\".").tqarg(url.pretty()), fileErrorString, Log::Show); return false; } _originalMemory->copyFrom(*_memory); @@ -183,10 +183,10 @@ void HexEditor::slotModified() void HexEditor::statusChanged() { - QString s; + TQString s; if (_memory) { BitValue cs = static_cast<Device::HexView *>(_view)->checksum(); - s = i18n("Checksum: %1").arg(toHexLabel(cs, 4)); + s = i18n("Checksum: %1").tqarg(toHexLabel(cs, 4)); } emit statusTextChanged(s); } |