diff options
Diffstat (limited to 'kpilot/kpilot/fileInstallWidget.cc')
-rw-r--r-- | kpilot/kpilot/fileInstallWidget.cc | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/kpilot/kpilot/fileInstallWidget.cc b/kpilot/kpilot/fileInstallWidget.cc index e8111ce8..69909302 100644 --- a/kpilot/kpilot/fileInstallWidget.cc +++ b/kpilot/kpilot/fileInstallWidget.cc @@ -35,15 +35,15 @@ #include <unistd.h> -#include <qlistbox.h> -#include <qstring.h> -#include <qlabel.h> -#include <qpushbutton.h> -#include <qlayout.h> -#include <qwhatsthis.h> -#include <qmultilineedit.h> -#include <qpixmap.h> -#include <qpopupmenu.h> +#include <tqlistbox.h> +#include <tqstring.h> +#include <tqlabel.h> +#include <tqpushbutton.h> +#include <tqlayout.h> +#include <tqwhatsthis.h> +#include <tqmultilineedit.h> +#include <tqpixmap.h> +#include <tqpopupmenu.h> #include <kfiledialog.h> #include <kurldrag.h> @@ -58,43 +58,43 @@ #include "fileInstallWidget.moc" -FileInstallWidget::FileInstallWidget(QWidget * parent, - const QString & path) : +FileInstallWidget::FileInstallWidget(TQWidget * parent, + const TQString & path) : PilotComponent(parent, "component_files", path), fSaveFileList(false), fInstaller(0L) { FUNCTIONSETUP; - QGridLayout *grid = new QGridLayout(this, 5, 5, SPACING); + TQGridLayout *grid = new TQGridLayout(this, 5, 5, SPACING); - QLabel *label = new QLabel(i18n("Files to install:"), this); + TQLabel *label = new TQLabel(i18n("Files to install:"), this); grid->addWidget(label, 1, 1); - QPushButton *abutton; + TQPushButton *abutton; - abutton = addButton = new QPushButton(i18n("Add File..."), this); - connect(abutton, SIGNAL(clicked()), this, SLOT(slotAddFile())); + abutton = addButton = new TQPushButton(i18n("Add File..."), this); + connect(abutton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotAddFile())); grid->addWidget(abutton, 3, 1); - QWhatsThis::add(abutton, + TQWhatsThis::add(abutton, i18n("<qt>Choose a file to add to the list of files to install.</qt>")); - abutton = clearButton= new QPushButton(i18n("Clear List"), this); - connect(abutton, SIGNAL(clicked()), this, SLOT(slotClearButton())); + abutton = clearButton= new TQPushButton(i18n("Clear List"), this); + connect(abutton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotClearButton())); grid->addWidget(abutton, 4, 1); - QWhatsThis::add(abutton, + TQWhatsThis::add(abutton, i18n("<qt>Clear the list of files to install. No files will be installed.</qt>")); fIconView = new KIconView(this); - connect(fIconView, SIGNAL(dropped(QDropEvent *, const QValueList<QIconDragItem> &)), - this, SLOT(slotDropEvent(QDropEvent *, const QValueList<QIconDragItem> &))); + connect(fIconView, TQT_SIGNAL(dropped(TQDropEvent *, const TQValueList<TQIconDragItem> &)), + this, TQT_SLOT(slotDropEvent(TQDropEvent *, const TQValueList<TQIconDragItem> &))); grid->addMultiCellWidget(fIconView, 1, 4, 2, 3); - QWhatsThis::add(fIconView, + TQWhatsThis::add(fIconView, i18n ("<qt>This lists files that will be installed on the Pilot during the next HotSync. Drag files here or use the Add button.</qt>")); fIconView->setAcceptDrops(true); - fIconView->setSelectionMode(QIconView::Extended); + fIconView->setSelectionMode(TQIconView::Extended); fIconView->viewport()->installEventFilter(this); grid->setRowStretch(2, 100); @@ -104,8 +104,8 @@ FileInstallWidget::FileInstallWidget(QWidget * parent, grid->addRowSpacing(5, SPACING); fInstaller = new FileInstaller; - connect(fInstaller, SIGNAL(filesChanged()), - this, SLOT(refreshFileInstallList())); + connect(fInstaller, TQT_SIGNAL(filesChanged()), + this, TQT_SLOT(refreshFileInstallList())); } @@ -114,12 +114,12 @@ FileInstallWidget::~FileInstallWidget() KPILOT_DELETE(fInstaller); } -static inline bool pdbOrPrc(const QString &s) +static inline bool pdbOrPrc(const TQString &s) { return s.endsWith(CSL1(".pdb"),false) || s.endsWith(CSL1(".prc"),false) ; } -void FileInstallWidget::dragEnterEvent(QDragEnterEvent *event) +void FileInstallWidget::dragEnterEvent(TQDragEnterEvent *event) { FUNCTIONSETUP; @@ -130,7 +130,7 @@ void FileInstallWidget::dragEnterEvent(QDragEnterEvent *event) } KURL::List::const_iterator it; - QString filename; + TQString filename; for ( it = urls.begin(); it != urls.end(); ++it ) { filename = (*it).fileName(); if(!pdbOrPrc(filename)) { @@ -141,32 +141,32 @@ void FileInstallWidget::dragEnterEvent(QDragEnterEvent *event) event->accept(true); } -bool FileInstallWidget::eventFilter(QObject *watched, QEvent *event) +bool FileInstallWidget::eventFilter(TQObject *watched, TQEvent *event) { FUNCTIONSETUP; if(watched == fIconView->viewport()) { - if(event->type() == QEvent::DragEnter) { - dragEnterEvent(static_cast<QDragEnterEvent*>(event)); + if(event->type() == TQEvent::DragEnter) { + dragEnterEvent(static_cast<TQDragEnterEvent*>(event)); return true; } // We have to skip the DragMove event, because it seems to override the // accept state, when it is set to false by dragEnterEvent() (event->accept(false);) - if(event->type() == QEvent::DragMove) { + if(event->type() == TQEvent::DragMove) { return true; } - if(event->type() == QEvent::MouseButtonPress) { - contextMenu(static_cast<QMouseEvent*>(event)); + if(event->type() == TQEvent::MouseButtonPress) { + contextMenu(static_cast<TQMouseEvent*>(event)); } } return false; } -void FileInstallWidget::dropEvent(QDropEvent * drop) +void FileInstallWidget::dropEvent(TQDropEvent * drop) { FUNCTIONSETUP; if (!shown) return; @@ -180,7 +180,7 @@ void FileInstallWidget::dropEvent(QDropEvent * drop) DEBUGKPILOT << ": Got " << list.first().prettyURL() << endl; #endif - QStringList files; + TQStringList files; for(KURL::List::ConstIterator it = list.begin(); it != list.end(); ++it) { if ((*it).isLocalFile()) @@ -190,7 +190,7 @@ void FileInstallWidget::dropEvent(QDropEvent * drop) fInstaller->addFiles(files, this ); } -void FileInstallWidget::slotDropEvent(QDropEvent * drop, const QValueList<QIconDragItem> & /*lst*/) +void FileInstallWidget::slotDropEvent(TQDropEvent * drop, const TQValueList<TQIconDragItem> & /*lst*/) { FUNCTIONSETUP; dropEvent(drop); @@ -213,16 +213,16 @@ void FileInstallWidget::slotAddFile() FUNCTIONSETUP; if (!shown) return; - QStringList fileNames = KFileDialog::getOpenFileNames( - QString::null, i18n("*.pdb *.prc|PalmOS Databases (*.pdb *.prc)")); + TQStringList fileNames = KFileDialog::getOpenFileNames( + TQString::null, i18n("*.pdb *.prc|PalmOS Databases (*.pdb *.prc)")); - for (QStringList::Iterator fileName = fileNames.begin(); fileName != fileNames.end(); ++fileName) + for (TQStringList::Iterator fileName = fileNames.begin(); fileName != fileNames.end(); ++fileName) { fInstaller->addFile(*fileName, this ); } } -bool FileInstallWidget::preHotSync(QString &) +bool FileInstallWidget::preHotSync(TQString &) { FUNCTIONSETUP; @@ -250,12 +250,12 @@ void FileInstallWidget::refreshFileInstallList() { FUNCTIONSETUP; - QStringList fileNames = fInstaller->fileNames(); - QPixmap kpilotIcon = KGlobal::iconLoader()->loadIcon(CSL1("kpilot"), KIcon::Desktop); + TQStringList fileNames = fInstaller->fileNames(); + TQPixmap kpilotIcon = KGlobal::iconLoader()->loadIcon(CSL1("kpilot"), KIcon::Desktop); fIconView->clear(); - for (QStringList::Iterator fileName = fileNames.begin(); fileName != fileNames.end(); ++fileName) + for (TQStringList::Iterator fileName = fileNames.begin(); fileName != fileNames.end(); ++fileName) { if(pdbOrPrc(*fileName)) { @@ -268,22 +268,22 @@ void FileInstallWidget::refreshFileInstallList() } } -void FileInstallWidget::contextMenu(QMouseEvent *event) +void FileInstallWidget::contextMenu(TQMouseEvent *event) { FUNCTIONSETUP; if(event->button() == Qt::LeftButton) return; - QIconViewItem *item; - QStringList files; + TQIconViewItem *item; + TQStringList files; for(item = fIconView->firstItem(); item; item = item->nextItem()) { if(item->isSelected()) files.append(item->text()); } - QPopupMenu popup(fIconView); + TQPopupMenu popup(fIconView); item = fIconView->findItem(event->pos()); if(item) { |