diff options
Diffstat (limited to 'src/libgui/device_editor.cpp')
-rw-r--r-- | src/libgui/device_editor.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/src/libgui/device_editor.cpp b/src/libgui/device_editor.cpp index 7a2a3c6..d3c2158 100644 --- a/src/libgui/device_editor.cpp +++ b/src/libgui/device_editor.cpp @@ -9,8 +9,8 @@ ***************************************************************************/ #include "device_editor.h" -#include <qscrollview.h> -#include <qregexp.h> +#include <tqscrollview.h> +#include <tqregexp.h> #include "devices/list/device_list.h" #include "toplevel.h" @@ -19,51 +19,51 @@ #include "common/global/pfile.h" #include "main_global.h" -DeviceEditor::DeviceEditor(const QString &title, const QString &tag, QWidget *parent, const char *name) - : Editor(title, tag, parent, name), _view(0) +DeviceEditor::DeviceEditor(const TQString &title, const TQString &tag, TQWidget *tqparent, const char *name) + : Editor(title, tag, tqparent, name), _view(0) { init(); } -DeviceEditor::DeviceEditor(QWidget *parent, const char *name) - : Editor(parent, name), _view(0) +DeviceEditor::DeviceEditor(TQWidget *tqparent, const char *name) + : Editor(tqparent, name), _view(0) { init(); } void DeviceEditor::init() { - QHBoxLayout *hbox = new QHBoxLayout(this, 0); - QScrollView *sview = new QScrollView(this, "scroll_view"); - sview->setResizePolicy(QScrollView::AutoOneFit); + TQHBoxLayout *hbox = new TQHBoxLayout(this, 0); + TQScrollView *sview = new TQScrollView(this, "scroll_view"); + sview->setResizePolicy(TQScrollView::AutoOneFit); hbox->addWidget(sview); - _widget = new QWidget(sview->viewport(), "main_scroll_widget"); + _widget = new TQWidget(sview->viewport(), "main_scroll_widget"); sview->addChild(_widget); - _top = new QVBoxLayout(_widget, 0, 0); - _labelDevice = new QLabel(_widget); + _top = new TQVBoxLayout(_widget, 0, 0); + _labelDevice = new TQLabel(_widget); _labelDevice->setMargin(10); _labelDevice->setTextFormat(RichText); _top->addWidget(_labelDevice); - _labelWarning = new QLabel(_widget); + _labelWarning = new TQLabel(_widget); _labelWarning->setMargin(10); _labelWarning->setTextFormat(RichText); _top->addWidget(_labelWarning); - _vbox = new QVBoxLayout(_top); + _vbox = new TQVBoxLayout(_top); - connect(&Main::toplevel(), SIGNAL(stateChanged()), SLOT(updateDevice())); + connect(&Main::toplevel(), TQT_SIGNAL(stateChanged()), TQT_SLOT(updateDevice())); } void DeviceEditor::setDevice(bool force) { if ( Main::device()==Device::AUTO_DATA.name ) { PURL::Url url = Main::projectManager().projectUrl(); - QString name = guessDeviceFromFile(url); + TQString name = guessDeviceFromFile(url); if ( !force && name==_device ) return; _device = name; if ( name==Device::AUTO_DATA.name ) _labelDevice->setText(i18n("The target device is not configured and cannot be guessed from source file. " "The source file either cannot be found or does not contain any processor directive.")); - else _labelDevice->setText(i18n("Device guessed from file: %1").arg(name)); + else _labelDevice->setText(i18n("Device guessed from file: %1").tqarg(name)); _labelDevice->show(); } else { if ( !force && Main::device()==_device ) return; @@ -71,7 +71,7 @@ void DeviceEditor::setDevice(bool force) _labelDevice->hide(); } if ( _view && isModified() ) { - if ( MessageBox::questionYesNo(i18n("File %1 not saved.").arg(filename()), KStdGuiItem::save(), KStdGuiItem::discard()) ) + if ( MessageBox::questionYesNo(i18n("File %1 not saved.").tqarg(filename()), KStdGuiItem::save(), KStdGuiItem::discard()) ) Editor::save(); } _labelWarning->hide(); @@ -103,7 +103,7 @@ PURL::Url DeviceEditor::findAsmFile(const PURL::Url &url) return PURL::Url(); } -QString DeviceEditor::guessDeviceFromFile(const PURL::Url &url) +TQString DeviceEditor::guessDeviceFromFile(const PURL::Url &url) { PURL::Url src = findAsmFile(url); if ( src.isEmpty() ) return Device::AUTO_DATA.name; @@ -111,12 +111,12 @@ QString DeviceEditor::guessDeviceFromFile(const PURL::Url &url) PURL::File file(src, sview); if ( !file.openForRead() ) return Device::AUTO_DATA.name; - QString device; - // QRegExp re1("^[ \\t]+(?:PROCESSOR|processor)[ \\t]+((?:p|sx|P|SX)[a-z0-9A-Z]+)" ) ; - QRegExp re1("^[ \\t]+(?:PROCESSOR|processor)[ \\t]+([a-z0-9A-Z]+)" ) ; - QRegExp re2("^[ \\t]+(?:LIST|list)[ \\t]+" ) ; + TQString device; + // TQRegExp re1("^[ \\t]+(?:PROCESSOR|processor)[ \\t]+((?:p|sx|P|SX)[a-z0-9A-Z]+)" ) ; + TQRegExp re1("^[ \\t]+(?:PROCESSOR|processor)[ \\t]+([a-z0-9A-Z]+)" ) ; + TQRegExp re2("^[ \\t]+(?:LIST|list)[ \\t]+" ) ; for (;;) { - QString line = file.readLine(); + TQString line = file.readLine(); if ( line.isNull() ) break; // search PROCESSOR directive if ( re1.search(line, 0)!=-1 ) { @@ -126,8 +126,8 @@ QString DeviceEditor::guessDeviceFromFile(const PURL::Url &url) // search LIST p=... directive int k = re2.search(line,0); if ( k!=-1 ) { - //QRegExp re3("(?:p|P)[ \\t]*=[ \\t]*((?:p|sx|P|SX)[a-z0-9A-Z]+)") ; - QRegExp re3("(?:p|P)[ \\t]*=[ \\t]*([a-z0-9A-Z]+)") ; + //TQRegExp re3("(?:p|P)[ \\t]*=[ \\t]*((?:p|sx|P|SX)[a-z0-9A-Z]+)") ; + TQRegExp re3("(?:p|P)[ \\t]*=[ \\t]*([a-z0-9A-Z]+)") ; if ( re3.search(line, k+5)!=-1 ) { device = re3.cap(1); break; |