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/project_wizard.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/project_wizard.cpp')
-rw-r--r-- | src/libgui/project_wizard.cpp | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/src/libgui/project_wizard.cpp b/src/libgui/project_wizard.cpp index b4d26df..72ecefc 100644 --- a/src/libgui/project_wizard.cpp +++ b/src/libgui/project_wizard.cpp @@ -8,10 +8,10 @@ ***************************************************************************/ #include "project_wizard.h" -#include <qheader.h> -#include <qvbuttongroup.h> -#include <qradiobutton.h> -#include <qstyle.h> +#include <tqheader.h> +#include <tqvbuttongroup.h> +#include <tqradiobutton.h> +#include <tqstyle.h> #include <kfiledialog.h> #include <kiconloader.h> @@ -36,7 +36,7 @@ FileListItem::FileListItem(KListView *view) void FileListItem::toggle() { _copy = !_copy; - repaint(); + tqrepaint(); } PURL::FileGroup FileListItem::fileGroup() const @@ -60,7 +60,7 @@ PURL::FileGroup FileListItem::fileGroup() const return PURL::Nb_FileGroups; } -const QPixmap *FileListItem::pixmap(int column) const +const TQPixmap *FileListItem::pixmap(int column) const { if ( column==0 && _copy ) return &_pixmap; @@ -68,35 +68,35 @@ const QPixmap *FileListItem::pixmap(int column) const } //----------------------------------------------------------------------------- -FileListBox::FileListBox(QWidget *parent) - : EditListBox(2, 0, 0, parent, "file_list_box") +FileListBox::FileListBox(TQWidget *tqparent) + : EditListBox(2, 0, 0, tqparent, "file_list_box") { _listView->header()->show(); _listView->header()->setClickEnabled(false); _listView->header()->setResizeEnabled(false); _listView->header()->setMovingEnabled(false); _listView->setColumnText(0, i18n("Copy")); - int spacing = style().pixelMetric(QStyle::PM_HeaderMargin); - QFontMetrics fm(font()); + int spacing = tqstyle().tqpixelMetric(TQStyle::PM_HeaderMargin); + TQFontMetrics fm(font()); _listView->header()->resizeSection(0, fm.width(i18n("Copy")) + 2*spacing); // hack _listView->setColumnText(1, i18n("Filename")); _listView->setAllColumnsShowFocus(true); - connect(_listView, SIGNAL(clicked(QListViewItem *, const QPoint &, int)), SLOT(clicked(QListViewItem *, const QPoint &, int))); + connect(_listView, TQT_SIGNAL(clicked(TQListViewItem *, const TQPoint &, int)), TQT_SLOT(clicked(TQListViewItem *, const TQPoint &, int))); } void FileListBox::addItem() { - PURL::UrlList urls = PURL::getOpenUrls(_directory.path(), QString::null, this, i18n("Select Files")); + PURL::UrlList urls = PURL::getOpenUrls(_directory.path(), TQString(), this, i18n("Select Files")); PURL::UrlList::const_iterator it; for (it=urls.begin(); it!=urls.end(); ++it) EditListBox::addItem((*it).pretty()); } -QListViewItem *FileListBox::createItem() +TQListViewItem *FileListBox::createItem() { return new FileListItem(_listView); } -void FileListBox::clicked(QListViewItem *item, const QPoint &, int column) +void FileListBox::clicked(TQListViewItem *item, const TQPoint &, int column) { if ( item==0 || column!=0 ) return; static_cast<FileListItem *>(item)->toggle(); @@ -104,36 +104,36 @@ void FileListBox::clicked(QListViewItem *item, const QPoint &, int column) void FileListBox::setToolGroup(const Tool::Group &group) { - QListViewItem *item = _listView->firstChild(); + TQListViewItem *item = _listView->firstChild(); for (; item; item = item->nextSibling()) static_cast<FileListItem *>(item)->setToolGroup(group); } //----------------------------------------------------------------------------- -ProjectWizard::ProjectWizard(QWidget *parent) - : KWizard(parent, "project_wizard"), _project(0) +ProjectWizard::ProjectWizard(TQWidget *tqparent) + : KWizard(tqparent, "project_wizard"), _project(0) { // first page - _first = new QWidget(this); + _first = new TQWidget(this); addPage(_first, i18n("New Project: Basic Settings")); setHelpEnabled(_first, false); - QGridLayout *grid = new QGridLayout(_first, 1, 1, 10, 10); - QLabel *label = new QLabel(i18n("Name:"), _first); + TQGridLayout *grid = new TQGridLayout(_first, 1, 1, 10, 10); + TQLabel *label = new TQLabel(i18n("Name:"), _first); grid->addWidget(label, 0, 0); _name = new KLineEdit(_first); _name->setFocus(); grid->addMultiCellWidget(_name, 0,0, 1,2); - label = new QLabel(i18n("Directory:"), _first); + label = new TQLabel(i18n("Directory:"), _first); grid->addWidget(label, 1, 0); _directory = new PURL::DirectoryWidget(":new_project", _first); grid->addMultiCellWidget(_directory, 1,1, 1,2); - label = new QLabel(i18n("Device:"), _first); + label = new TQLabel(i18n("Device:"), _first); grid->addWidget(label, 2, 0); _device = new DeviceChooser::Button(false, _first); _device->setDevice(Main::device()); grid->addWidget(_device, 2, 1); - label = new QLabel(i18n("Toolchain:"), _first); + label = new TQLabel(i18n("Toolchain:"), _first); grid->addWidget(label, 3, 0); - _toolchain = new KeyComboBox<QString>(_first); + _toolchain = new KeyComboBox<TQString>(_first); Tool::Lister::ConstIterator it; for (it=Tool::lister().begin(); it!=Tool::lister().end(); ++it) _toolchain->appendItem(it.key(), it.data()->label()); @@ -143,22 +143,22 @@ ProjectWizard::ProjectWizard(QWidget *parent) grid->setRowStretch(4, 1); // second page - _second = new QWidget(this); + _second = new TQWidget(this); addPage(_second, i18n("New Project: Source Files")); - grid = new QGridLayout(_second, 1, 1, 10, 10); - _bgroup = new QVButtonGroup(i18n("Add Source Files"), _second); - _templateButton = new QRadioButton(i18n("Create template source file."), _bgroup); - _addButton = new QRadioButton(i18n("Add existing files."), _bgroup); - (void)new QRadioButton(i18n("Do not add files now."), _bgroup); - connect(_bgroup, SIGNAL(clicked(int)), SLOT(buttonClicked(int))); + grid = new TQGridLayout(_second, 1, 1, 10, 10); + _bgroup = new TQVButtonGroup(i18n("Add Source Files"), _second); + _templateButton = new TQRadioButton(i18n("Create template source file."), _bgroup); + _addButton = new TQRadioButton(i18n("Add existing files."), _bgroup); + (void)new TQRadioButton(i18n("Do not add files now."), _bgroup); + connect(_bgroup, TQT_SIGNAL(clicked(int)), TQT_SLOT(buttonClicked(int))); grid->addWidget(_bgroup, 0, 0); // third page - _third = new QWidget(this); + _third = new TQWidget(this); addPage(_third, i18n("New Project: Add Files")); setHelpEnabled(_third, false); setFinishEnabled(_third, true); - grid = new QGridLayout(_third, 1, 1, 10, 10); + grid = new TQGridLayout(_third, 1, 1, 10, 10); _files = new FileListBox(_third); grid->addWidget(_files, 0, 0); } @@ -166,7 +166,7 @@ ProjectWizard::ProjectWizard(QWidget *parent) void ProjectWizard::next() { if ( currentPage()==_first ) { - QString name = _name->text().stripWhiteSpace(); + TQString name = _name->text().stripWhiteSpace(); if ( name.isEmpty() ) { MessageBox::sorry(i18n("Project name is empty."), Log::Show); return; @@ -184,7 +184,7 @@ void ProjectWizard::next() return; } } else if ( url().exists() ) { - if ( !MessageBox::askContinue(i18n("Project \"%1\"already exists. Overwrite it?").arg(url().filename())) ) return; + if ( !MessageBox::askContinue(i18n("Project \"%1\"already exists. Overwrite it?").tqarg(url().filename())) ) return; } if ( !toolchain().check(device(), &Main::compileLog()) ) return; _files->setDirectory(_directory->directory()); @@ -203,7 +203,7 @@ void ProjectWizard::next() for (uint i=0; i<_files->count(); i++) if ( static_cast<const FileListItem *>(_files->item(i))->fileGroup()==PURL::Source ) nb++; if ( toolchain().compileType()==Tool::SingleFile && nb>1 ) { - if ( !MessageBox::askContinue(i18n("The selected toolchain can only compile a single source file and you have selected %1 source files. Continue anyway? ").arg(nb)) ) return; + if ( !MessageBox::askContinue(i18n("The selected toolchain can only compile a single source file and you have selected %1 source files. Continue anyway? ").tqarg(nb)) ) return; } } KWizard::next(); @@ -229,7 +229,7 @@ void ProjectWizard::done(int r) } Q_ASSERT( ftype!=PURL::Nb_FileTypes ); PURL::Url turl = url().toFileType(ftype); - QString text; + TQString text; const Tool::SourceGenerator *generator = toolchain().sourceGenerator(); if ( generator==0 ) text = i18n("Template source file generation not implemented yet for this toolchain..."); else { @@ -243,7 +243,7 @@ void ProjectWizard::done(int r) } Log::StringView sview; if ( turl.write(text, sview) ) files += turl; - else MessageBox::detailedSorry(i18n("Error creating template file."), i18n("File: %1\n").arg(turl.pretty()) + sview.string(), Log::Show); + else MessageBox::detailedSorry(i18n("Error creating template file."), i18n("File: %1\n").tqarg(turl.pretty()) + sview.string(), Log::Show); _project->setOpenedFiles(files); } else { Log::StringView sview; @@ -271,7 +271,7 @@ const Tool::Group &ProjectWizard::toolchain() const return *Tool::lister().group(_toolchain->currentItem()); } -QString ProjectWizard::device() const +TQString ProjectWizard::device() const { return _device->device(); } |