summaryrefslogtreecommitdiffstats
path: root/kftpgrabber/src/widgets/queueview/queueview.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-07-24 15:27:17 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-07-24 15:27:17 -0500
commit883a1fc629f00e9a41efad8514afd1ccf259d8c2 (patch)
tree53191c33748f9cd949a2eb86a64fbedc86c5ac75 /kftpgrabber/src/widgets/queueview/queueview.cpp
parent1385303ea163214e30825730ac0fbcc27f9634aa (diff)
downloadkftpgrabber-883a1fc629f00e9a41efad8514afd1ccf259d8c2.tar.gz
kftpgrabber-883a1fc629f00e9a41efad8514afd1ccf259d8c2.zip
Convert to TDE R14 API
Diffstat (limited to 'kftpgrabber/src/widgets/queueview/queueview.cpp')
-rw-r--r--kftpgrabber/src/widgets/queueview/queueview.cpp246
1 files changed, 123 insertions, 123 deletions
diff --git a/kftpgrabber/src/widgets/queueview/queueview.cpp b/kftpgrabber/src/widgets/queueview/queueview.cpp
index 4fc8e5f..e0249e4 100644
--- a/kftpgrabber/src/widgets/queueview/queueview.cpp
+++ b/kftpgrabber/src/widgets/queueview/queueview.cpp
@@ -44,27 +44,27 @@
#include "widgets/searchdialog.h"
#include "misc/config.h"
-#include <kapplication.h>
-#include <kfiledialog.h>
+#include <tdeapplication.h>
+#include <tdefiledialog.h>
#include <kiconloader.h>
-#include <kio/job.h>
-#include <klocale.h>
-#include <kmessagebox.h>
+#include <tdeio/job.h>
+#include <tdelocale.h>
+#include <tdemessagebox.h>
#include <kmimetype.h>
-#include <kpopupmenu.h>
-#include <klistviewsearchline.h>
+#include <tdepopupmenu.h>
+#include <tdelistviewsearchline.h>
#include <kdebug.h>
-#include <qspinbox.h>
-#include <qtooltip.h>
+#include <ntqspinbox.h>
+#include <ntqtooltip.h>
using namespace KFTPGrabberBase;
using namespace KFTPCore;
namespace KFTPWidgets {
-QueueViewItem::QueueViewItem(QueueView *view, KFTPQueue::QueueObject *object, QListView *parent)
- : QListViewItem(parent),
+QueueViewItem::QueueViewItem(QueueView *view, KFTPQueue::QueueObject *object, TQListView *parent)
+ : TQListViewItem(parent),
m_lastChild(0),
m_queueObject(object),
m_queueView(view),
@@ -73,8 +73,8 @@ QueueViewItem::QueueViewItem(QueueView *view, KFTPQueue::QueueObject *object, QL
init();
}
-QueueViewItem::QueueViewItem(QueueView *view, KFTPQueue::QueueObject *object, QListViewItem *parent)
- : QListViewItem(parent, static_cast<QueueViewItem*>(parent)->lastChild()),
+QueueViewItem::QueueViewItem(QueueView *view, KFTPQueue::QueueObject *object, TQListViewItem *parent)
+ : TQListViewItem(parent, static_cast<QueueViewItem*>(parent)->lastChild()),
m_lastChild(0),
m_queueObject(object),
m_queueView(view),
@@ -88,16 +88,16 @@ QueueViewItem::~QueueViewItem()
m_queueView->m_queuedItems.remove(m_queueId);
}
-void QueueViewItem::insertItem(QListViewItem *newChild)
+void QueueViewItem::insertItem(TQListViewItem *newChild)
{
- QListViewItem::insertItem(newChild);
+ TQListViewItem::insertItem(newChild);
m_lastChild = newChild;
}
-void QueueViewItem::takeItem(QListViewItem *item)
+void QueueViewItem::takeItem(TQListViewItem *item)
{
if (item == m_lastChild) {
- QListViewItem *above = item->itemAbove();
+ TQListViewItem *above = item->itemAbove();
if (above->parent() == m_lastChild->parent())
m_lastChild = above;
@@ -105,18 +105,18 @@ void QueueViewItem::takeItem(QListViewItem *item)
m_lastChild = 0;
}
- QListViewItem::takeItem(item);
+ TQListViewItem::takeItem(item);
}
void QueueViewItem::moveUp()
{
- QListViewItem *above = itemAbove();
+ TQListViewItem *above = itemAbove();
- if (above && above->parent() == QListViewItem::parent()) {
- QListViewItem *previous = above->itemAbove();
+ if (above && above->parent() == TQListViewItem::parent()) {
+ TQListViewItem *previous = above->itemAbove();
- if (previous && previous->parent() == QListViewItem::parent()) {
- QueueViewItem *parent = static_cast<QueueViewItem*>(QListViewItem::parent());
+ if (previous && previous->parent() == TQListViewItem::parent()) {
+ QueueViewItem *parent = static_cast<QueueViewItem*>(TQListViewItem::parent());
moveItem(previous);
if (parent && this == parent->lastChild())
@@ -129,7 +129,7 @@ void QueueViewItem::moveUp()
void QueueViewItem::moveDown()
{
- QueueViewItem *parent = static_cast<QueueViewItem*>(QListViewItem::parent());
+ QueueViewItem *parent = static_cast<QueueViewItem*>(TQListViewItem::parent());
QueueViewItem *next = static_cast<QueueViewItem*>(nextSibling());
if (next) {
@@ -142,29 +142,29 @@ void QueueViewItem::moveDown()
void QueueViewItem::moveToTop()
{
- QueueViewItem *parent = static_cast<QueueViewItem*>(QListViewItem::parent());
+ QueueViewItem *parent = static_cast<QueueViewItem*>(TQListViewItem::parent());
// Just reinsert the item
if (parent) {
if (this == parent->lastChild())
parent->m_lastChild = itemAbove();
- parent->QListViewItem::takeItem(this);
- parent->QListViewItem::insertItem(this);
+ parent->TQListViewItem::takeItem(this);
+ parent->TQListViewItem::insertItem(this);
} else {
ListView *view = m_queueView->m_queue;
- view->QListView::takeItem(this);
- view->QListView::insertItem(this);
+ view->TQListView::takeItem(this);
+ view->TQListView::insertItem(this);
}
}
void QueueViewItem::moveToBottom()
{
- QueueViewItem *parent = static_cast<QueueViewItem*>(QListViewItem::parent());
+ QueueViewItem *parent = static_cast<QueueViewItem*>(TQListViewItem::parent());
// Just reinsert the item
if (parent) {
- QListViewItem *last = parent->lastChild();
+ TQListViewItem *last = parent->lastChild();
parent->takeItem(this);
parent->insertItem(this);
@@ -176,12 +176,12 @@ void QueueViewItem::moveToBottom()
}
}
-void QueueViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment)
+void QueueViewItem::paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int alignment)
{
- QColorGroup _cg(cg);
- QColor c = _cg.text();
+ TQColorGroup _cg(cg);
+ TQColor c = _cg.text();
- QColor n_color;
+ TQColor n_color;
if (m_queueObject && m_queueObject->isTransfer()) {
switch (m_queueObject->getStatus()) {
@@ -194,10 +194,10 @@ void QueueViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, in
}
if (n_color.isValid())
- _cg.setColor(QColorGroup::Text, n_color);
+ _cg.setColor(TQColorGroup::Text, n_color);
- QListViewItem::paintCell(p, _cg, column, width, alignment);
- _cg.setColor(QColorGroup::Text, c);
+ TQListViewItem::paintCell(p, _cg, column, width, alignment);
+ _cg.setColor(TQColorGroup::Text, c);
}
void QueueViewItem::init()
@@ -206,25 +206,25 @@ void QueueViewItem::init()
KFTPQueue::Transfer *transfer = static_cast<KFTPQueue::Transfer*>(getObject());
setText(0, transfer->getSourceUrl().fileName());
- setText(1, KIO::convertSize(transfer->getActualSize()));
+ setText(1, TDEIO::convertSize(transfer->getActualSize()));
setText(2, transfer->getSourceUrl().pathOrURL());
setText(3, transfer->getDestUrl().pathOrURL());
// Icon
- QString iconText;
+ TQString iconText;
if (transfer->isDir()) {
iconText = "folder";
} else {
KMimeType::Ptr theType = KMimeType::findByURL("/" + transfer->getSourceUrl().path(), 0, false, true);
- iconText = theType->icon(QString::null, false);
+ iconText = theType->icon(TQString::null, false);
}
setPixmap(0, loadSmallPixmap(iconText));
} else if (m_queueObject->getType() == KFTPQueue::QueueObject::Site) {
KFTPQueue::Site *site = static_cast<KFTPQueue::Site*>(getObject());
- setText(0, QString("%1:%2").arg(site->getUrl().host()).arg(site->getUrl().port()));
- setText(1, KIO::convertSize(site->getActualSize()));
+ setText(0, TQString("%1:%2").arg(site->getUrl().host()).arg(site->getUrl().port()));
+ setText(1, TDEIO::convertSize(site->getActualSize()));
// Set the pixmap
setPixmap(0, loadSmallPixmap("server"));
@@ -241,7 +241,7 @@ void QueueViewItem::refresh()
// Speed
bool noSpeed = transfer->getStatus() == KFTPQueue::Transfer::Waiting || transfer->getStatus() == KFTPQueue::Transfer::Connecting;
- QString speed;
+ TQString speed;
if ((!transfer->isDir() || !isOpen()) && transfer->isRunning() && !noSpeed) {
speed.sprintf( "%lld B/s", (transfer->getSpeed()) );
@@ -259,19 +259,19 @@ void QueueViewItem::refresh()
}
// ETA
- QString eta;
+ TQString eta;
if (transfer->isRunning() && transfer->getSpeed() > 0) {
- eta = KIO::convertSeconds(KIO::calculateRemainingSeconds(transfer->getSize(),
+ eta = TDEIO::convertSeconds(TDEIO::calculateRemainingSeconds(transfer->getSize(),
transfer->getCompleted(),
transfer->getSpeed()));
} else {
- eta = QString::null;
+ eta = TQString::null;
}
// Set the columns
setText(0, transfer->getSourceUrl().fileName());
- setText(1, KIO::convertSize(transfer->getActualSize()));
+ setText(1, TDEIO::convertSize(transfer->getActualSize()));
setText(2, transfer->getSourceUrl().pathOrURL());
setText(3, transfer->getDestUrl().pathOrURL());
setText(5, speed);
@@ -309,21 +309,21 @@ void QueueViewItem::refresh()
} else if (progress > 0) {
setPixmap(4, createProgressPixmap(progress, r_progress));
- QString progressText;
+ TQString progressText;
progressText.sprintf("%d %%", progress);
setText(4, progressText);
} else {
setPixmap(4, NULL);
- setText(4, QString::null);
+ setText(4, TQString::null);
}
// Icon
- QString iconText;
+ TQString iconText;
if (transfer->isDir()) {
iconText = "folder";
} else {
KMimeType::Ptr theType = KMimeType::findByURL("/" + transfer->getSourceUrl().path(), 0, false, true);
- iconText = theType->icon(QString::null, false);
+ iconText = theType->icon(TQString::null, false);
}
setPixmap(0, loadSmallPixmap(iconText));
@@ -331,7 +331,7 @@ void QueueViewItem::refresh()
KFTPQueue::Site *site = static_cast<KFTPQueue::Site*>(getObject());
// Speed
- QString speed;
+ TQString speed;
speed.sprintf( "%lld B/s", (site->getSpeed()) );
if (site->getSpeed() > 1024)
@@ -341,13 +341,13 @@ void QueueViewItem::refresh()
speed.sprintf("%lld MB/s", (site->getSpeed() / 1024) / 1024);
if (site->getSpeed() == 0)
- speed = QString::null;
+ speed = TQString::null;
// ETA
- QString eta;
+ TQString eta;
if (site->isRunning() && site->getSpeed() > 0) {
- eta = KIO::convertSeconds(KIO::calculateRemainingSeconds(site->getSize(),
+ eta = TDEIO::convertSeconds(TDEIO::calculateRemainingSeconds(site->getSize(),
site->getCompleted(),
site->getSpeed()));
} else {
@@ -363,17 +363,17 @@ void QueueViewItem::refresh()
setPixmap(4, createProgressPixmap(progress, 0));
- QString progressText;
+ TQString progressText;
progressText.sprintf("%d %%", progress);
setText(4, progressText);
} else {
setPixmap(4, NULL);
- setText(4, QString::null);
+ setText(4, TQString::null);
}
// Set the columns
- setText(0, QString("%1:%2").arg(site->getUrl().host()).arg(site->getUrl().port()));
- setText(1, KIO::convertSize(site->getActualSize()));
+ setText(0, TQString("%1:%2").arg(site->getUrl().host()).arg(site->getUrl().port()));
+ setText(1, TDEIO::convertSize(site->getActualSize()));
setText(5, speed);
setText(6, eta);
@@ -382,46 +382,46 @@ void QueueViewItem::refresh()
}
}
-QueueListView::QueueListView(QWidget *parent)
+QueueListView::QueueListView(TQWidget *parent)
: ListView(parent)
{
}
-void QueueListView::insertItem(QListViewItem *item)
+void QueueListView::insertItem(TQListViewItem *item)
{
- QListViewItem *last = lastChild();
- QListView::insertItem(item);
+ TQListViewItem *last = lastChild();
+ TQListView::insertItem(item);
if (last)
item->moveItem(last);
}
-QueueView::QueueView(QWidget *parent, const char *name)
- : QWidget(parent, name)
+QueueView::QueueView(TQWidget *parent, const char *name)
+ : TQWidget(parent, name)
{
- QVBoxLayout *layout = new QVBoxLayout(this);
+ TQVBoxLayout *layout = new TQVBoxLayout(this);
- m_toolBar = new KToolBar(this, "queueToolBar");
+ m_toolBar = new TDEToolBar(this, "queueToolBar");
m_toolBar->setIconSize(16);
layout->addWidget(m_toolBar);
- m_searchToolBar = new KToolBar(this, "searchToolBar");
+ m_searchToolBar = new TDEToolBar(this, "searchToolBar");
m_searchToolBar->setEnableContextMenu(false);
m_searchToolBar->setMovingEnabled(false);
m_searchToolBar->setFullSize(true);
// Create the erase button
- m_searchToolBar->insertButton(QApplication::reverseLayout() ? "clear_left" :"locationbar_erase", 0, SIGNAL(clicked()), this, SLOT(slotSearchEraseClicked()), true);
+ m_searchToolBar->insertButton(TQApplication::reverseLayout() ? "clear_left" :"locationbar_erase", 0, SIGNAL(clicked()), this, SLOT(slotSearchEraseClicked()), true);
// Create the labels
- QLabel *searchLabel = new QLabel(i18n("Filter: "), m_searchToolBar);
+ TQLabel *searchLabel = new TQLabel(i18n("Filter: "), m_searchToolBar);
m_searchToolBar->insertWidget(1, 35, searchLabel);
// Create the list view
m_queue = new QueueListView(this);
// Create the search field
- m_searchField = new KListViewSearchLine(m_searchToolBar, m_queue);
+ m_searchField = new TDEListViewSearchLine(m_searchToolBar, m_queue);
// Do some more stuff
m_searchToolBar->setItemAutoSized(1, true);
@@ -444,17 +444,17 @@ QueueView::QueueView(QWidget *parent, const char *name)
m_queue->setEmptyListText(i18n("You do not have any files in the queue."));
// Multi-select
- m_queue->setSelectionModeExt(KListView::FileManager);
+ m_queue->setSelectionModeExt(TDEListView::FileManager);
m_queue->setAllColumnsShowFocus(true);
m_queue->setRootIsDecorated(true);
- m_queue->QListView::setSorting(-1);
- m_queue->QListView::setSortColumn(-1);
+ m_queue->TQListView::setSorting(-1);
+ m_queue->TQListView::setSortColumn(-1);
layout->addWidget(m_queue);
// The signals
- connect(m_queue, SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint&)), this,
- SLOT(contextMenuRequested(KListView*, QListViewItem*, const QPoint&)));
+ connect(m_queue, SIGNAL(contextMenu(TDEListView*, TQListViewItem*, const TQPoint&)), this,
+ SLOT(contextMenuRequested(TDEListView*, TQListViewItem*, const TQPoint&)));
connect(m_queue, SIGNAL(selectionChanged()), this, SLOT(updateActions()));
// Let us be up-to-date
@@ -504,18 +504,18 @@ void QueueView::initToolBar()
// Create speed control widgets
m_toolBar->insertSeparator();
- QSpinBox *downloadSpeed = new QSpinBox(0, 10240, 1, m_toolBar);
- QToolTip::add(downloadSpeed, i18n("Limit download transfer speed"));
- m_toolBar->insertWidget(1, 35, new QLabel(i18n("Down: "), m_toolBar));
+ TQSpinBox *downloadSpeed = new TQSpinBox(0, 10240, 1, m_toolBar);
+ TQToolTip::add(downloadSpeed, i18n("Limit download transfer speed"));
+ m_toolBar->insertWidget(1, 35, new TQLabel(i18n("Down: "), m_toolBar));
m_toolBar->insertWidget(2, 35, downloadSpeed);
downloadSpeed->setValue(Config::downloadSpeedLimit());
connect(downloadSpeed, SIGNAL(valueChanged(int)), this, SLOT(slotDownloadLimitChanged(int)));
m_toolBar->insertSeparator();
- QSpinBox *uploadSpeed = new QSpinBox(0, 10240, 1, m_toolBar);
- QToolTip::add(uploadSpeed, i18n("Limit upload transfer speed"));
- m_toolBar->insertWidget(3, 35, new QLabel(i18n("Up: "), m_toolBar));
+ TQSpinBox *uploadSpeed = new TQSpinBox(0, 10240, 1, m_toolBar);
+ TQToolTip::add(uploadSpeed, i18n("Limit upload transfer speed"));
+ m_toolBar->insertWidget(3, 35, new TQLabel(i18n("Up: "), m_toolBar));
m_toolBar->insertWidget(4, 35, uploadSpeed);
uploadSpeed->setValue(Config::uploadSpeedLimit());
connect(uploadSpeed, SIGNAL(valueChanged(int)), this, SLOT(slotUploadLimitChanged(int)));
@@ -523,9 +523,9 @@ void QueueView::initToolBar()
// Create thread count control widget
m_toolBar->insertSeparator();
- QSpinBox *threadCount = new QSpinBox(1, 10, 1, m_toolBar);
- QToolTip::add(threadCount, i18n("Per-session transfer thread count"));
- m_toolBar->insertWidget(5, 35, new QLabel(i18n("Threads: "), m_toolBar));
+ TQSpinBox *threadCount = new TQSpinBox(1, 10, 1, m_toolBar);
+ TQToolTip::add(threadCount, i18n("Per-session transfer thread count"));
+ m_toolBar->insertWidget(5, 35, new TQLabel(i18n("Threads: "), m_toolBar));
m_toolBar->insertWidget(6, 35, threadCount);
threadCount->setValue(Config::threadCount());
connect(threadCount, SIGNAL(valueChanged(int)), this, SLOT(slotThreadCountChanged(int)));
@@ -551,28 +551,28 @@ void QueueView::slotThreadCountChanged(int value)
void QueueView::initActions()
{
- m_actionCollection = new KActionCollection(this, this);
+ m_actionCollection = new TDEActionCollection(this, this);
// Create all the actions
- m_launchAction = new KAction(i18n("&Start Transfer"), "launch", KShortcut(), this, SLOT(slotLaunch()), m_actionCollection, "launch");
- m_abortAction = new KAction(i18n("&Abort Transfer"), KShortcut(), this, SLOT(slotAbort()), m_actionCollection, "abort");
- m_removeAction = new KAction(i18n("&Remove"), "editdelete", KShortcut(Qt::Key_Delete), this, SLOT(slotRemove()), m_actionCollection, "remove");
- m_removeAllAction = new KAction(i18n("Remove &All"), KShortcut(), this, SLOT(slotRemoveAll()), m_actionCollection, "removeAll");
- m_moveUpAction = new KAction(i18n("Move &Up"), "up", KShortcut(), this, SLOT(slotMoveUp()), m_actionCollection, "moveUp");
- m_moveDownAction = new KAction(i18n("Move &Down"), "down", KShortcut("del"), this, SLOT(slotMoveDown()), m_actionCollection, "moveDown");
- m_moveTopAction = new KAction(i18n("Move To &Top"), "top", KShortcut(), this, SLOT(slotMoveTop()), m_actionCollection, "moveTop");
- m_moveBottomAction = new KAction(i18n("Move To &Bottom"), "bottom", KShortcut(), this, SLOT(slotMoveBottom()), m_actionCollection, "moveBottom");
- m_editAction = new KAction(i18n("&Change Transfer Info"), KShortcut(), this, SLOT(slotEdit()), m_actionCollection, "changeTransfer");
+ m_launchAction = new TDEAction(i18n("&Start Transfer"), "launch", TDEShortcut(), this, SLOT(slotLaunch()), m_actionCollection, "launch");
+ m_abortAction = new TDEAction(i18n("&Abort Transfer"), TDEShortcut(), this, SLOT(slotAbort()), m_actionCollection, "abort");
+ m_removeAction = new TDEAction(i18n("&Remove"), "editdelete", TDEShortcut(TQt::Key_Delete), this, SLOT(slotRemove()), m_actionCollection, "remove");
+ m_removeAllAction = new TDEAction(i18n("Remove &All"), TDEShortcut(), this, SLOT(slotRemoveAll()), m_actionCollection, "removeAll");
+ m_moveUpAction = new TDEAction(i18n("Move &Up"), "up", TDEShortcut(), this, SLOT(slotMoveUp()), m_actionCollection, "moveUp");
+ m_moveDownAction = new TDEAction(i18n("Move &Down"), "down", TDEShortcut("del"), this, SLOT(slotMoveDown()), m_actionCollection, "moveDown");
+ m_moveTopAction = new TDEAction(i18n("Move To &Top"), "top", TDEShortcut(), this, SLOT(slotMoveTop()), m_actionCollection, "moveTop");
+ m_moveBottomAction = new TDEAction(i18n("Move To &Bottom"), "bottom", TDEShortcut(), this, SLOT(slotMoveBottom()), m_actionCollection, "moveBottom");
+ m_editAction = new TDEAction(i18n("&Change Transfer Info"), TDEShortcut(), this, SLOT(slotEdit()), m_actionCollection, "changeTransfer");
// Create the toolbar actions
- m_loadAction = new KAction(i18n("&Load Queue From File"), "fileopen", KShortcut(), this, SLOT(slotLoad()), m_actionCollection, "load");
- m_saveAction = new KAction(i18n("&Save Queue to File"), "filesaveas", KShortcut(), this, SLOT(slotSave()), m_actionCollection, "save");
- m_startAction = new KAction(i18n("S&tart"), "player_play", KShortcut(), this, SLOT(slotStart()), m_actionCollection, "start");
- m_pauseAction = new KAction(i18n("&Pause"), "player_pause", KShortcut(), this, SLOT(slotPause()), m_actionCollection, "pause");
- m_stopAction = new KAction(i18n("St&op"), "player_stop", KShortcut(), this, SLOT(slotStop()), m_actionCollection, "stop");
- m_addAction = new KAction(i18n("&Add Transfer..."), "filenew", KShortcut(), this, SLOT(slotAdd()), m_actionCollection, "add");
- m_searchAction = new KAction(i18n("&Search && Replace..."), "find", KShortcut(), this, SLOT(slotSearch()), m_actionCollection, "search");
- m_filterAction = new KToggleAction(i18n("Show &Filter"), "filter", KShortcut(), this, SLOT(slotFilter()), m_actionCollection, "filter");
+ m_loadAction = new TDEAction(i18n("&Load Queue From File"), "fileopen", TDEShortcut(), this, SLOT(slotLoad()), m_actionCollection, "load");
+ m_saveAction = new TDEAction(i18n("&Save Queue to File"), "filesaveas", TDEShortcut(), this, SLOT(slotSave()), m_actionCollection, "save");
+ m_startAction = new TDEAction(i18n("S&tart"), "player_play", TDEShortcut(), this, SLOT(slotStart()), m_actionCollection, "start");
+ m_pauseAction = new TDEAction(i18n("&Pause"), "player_pause", TDEShortcut(), this, SLOT(slotPause()), m_actionCollection, "pause");
+ m_stopAction = new TDEAction(i18n("St&op"), "player_stop", TDEShortcut(), this, SLOT(slotStop()), m_actionCollection, "stop");
+ m_addAction = new TDEAction(i18n("&Add Transfer..."), "filenew", TDEShortcut(), this, SLOT(slotAdd()), m_actionCollection, "add");
+ m_searchAction = new TDEAction(i18n("&Search && Replace..."), "find", TDEShortcut(), this, SLOT(slotSearch()), m_actionCollection, "search");
+ m_filterAction = new TDEToggleAction(i18n("Show &Filter"), "filter", TDEShortcut(), this, SLOT(slotFilter()), m_actionCollection, "filter");
m_saveAction->setEnabled( false );
m_startAction->setEnabled(false);
@@ -590,7 +590,7 @@ void QueueView::updateActions()
m_stopAction->setEnabled(KFTPQueue::Manager::self()->isProcessing());
m_removeAllAction->setEnabled(!KFTPQueue::Manager::self()->isProcessing());
- QPtrList<QListViewItem> selection = m_queue->selectedItems();
+ TQPtrList<TQListViewItem> selection = m_queue->selectedItems();
QueueViewItem *firstItem = static_cast<QueueViewItem*>(selection.first());
m_removeAction->setEnabled((bool) firstItem);
@@ -611,8 +611,8 @@ void QueueView::updateActions()
// Only allow moving of multi selections if they have the same parent
bool allowMove = true;
- for (QListViewItem *i = selection.first(); i; i = selection.next()) {
- if (i->parent() != static_cast<QListViewItem*>(firstItem)->parent()) {
+ for (TQListViewItem *i = selection.first(); i; i = selection.next()) {
+ if (i->parent() != static_cast<TQListViewItem*>(firstItem)->parent()) {
allowMove = false;
break;
}
@@ -667,7 +667,7 @@ void QueueView::slotObjectRemoved(long id)
void QueueView::slotObjectUpdated()
{
- KFTPQueue::QueueObject *object = (KFTPQueue::QueueObject*) QObject::sender();
+ KFTPQueue::QueueObject *object = (KFTPQueue::QueueObject*) TQObject::sender();
if (object) {
QueueViewItem *item = m_queuedItems.find(object->getId());
@@ -677,13 +677,13 @@ void QueueView::slotObjectUpdated()
}
}
-void QueueView::contextMenuRequested(KListView*, QListViewItem* item, const QPoint& p)
+void QueueView::contextMenuRequested(TDEListView*, TQListViewItem* item, const TQPoint& p)
{
if (!item)
return;
QueueViewItem *firstItem = static_cast<QueueViewItem*>(m_queue->selectedItems().first());
- KPopupMenu *contextMenu = new KPopupMenu(m_queue);
+ TDEPopupMenu *contextMenu = new TDEPopupMenu(m_queue);
// Populate context menu
if (firstItem->getObject()->isTransfer()) {
@@ -734,8 +734,8 @@ void QueueView::slotRemove()
if (KMessageBox::questionYesNo(this, i18n("Are you sure you want to remove queued file(s)?")) == KMessageBox::Yes) {
KFTPQueue::Manager::self()->setEmitUpdate(false);
- QPtrList<QListViewItem> selection = m_queue->selectedItems();
- for (QListViewItem *item = selection.first(); item; item = selection.next()) {
+ TQPtrList<TQListViewItem> selection = m_queue->selectedItems();
+ for (TQListViewItem *item = selection.first(); item; item = selection.next()) {
if (item && static_cast<QueueViewItem*>(item)->getObject())
KFTPQueue::Manager::self()->removeTransfer(static_cast<KFTPQueue::Transfer*>(static_cast<QueueViewItem*>(item)->getObject()));
}
@@ -754,9 +754,9 @@ void QueueView::slotRemoveAll()
void QueueView::slotMoveUp()
{
- QPtrList<QListViewItem> selection = m_queue->selectedItems();
+ TQPtrList<TQListViewItem> selection = m_queue->selectedItems();
- for (QListViewItem *item = selection.first(); item; item = selection.next()) {
+ for (TQListViewItem *item = selection.first(); item; item = selection.next()) {
QueueViewItem *queueItem = static_cast<QueueViewItem*>(item);
// Move the transfer
@@ -767,9 +767,9 @@ void QueueView::slotMoveUp()
void QueueView::slotMoveDown()
{
- QPtrList<QListViewItem> selection = m_queue->selectedItems();
+ TQPtrList<TQListViewItem> selection = m_queue->selectedItems();
- for (QListViewItem *item = selection.last(); item; item = selection.prev()) {
+ for (TQListViewItem *item = selection.last(); item; item = selection.prev()) {
QueueViewItem *queueItem = static_cast<QueueViewItem*>(item);
// Move the transfer
@@ -780,9 +780,9 @@ void QueueView::slotMoveDown()
void QueueView::slotMoveTop()
{
- QPtrList<QListViewItem> selection = m_queue->selectedItems();
+ TQPtrList<TQListViewItem> selection = m_queue->selectedItems();
- for (QListViewItem *item = selection.last(); item; item = selection.prev()) {
+ for (TQListViewItem *item = selection.last(); item; item = selection.prev()) {
QueueViewItem *queueItem = static_cast<QueueViewItem*>(item);
// Move the transfer
@@ -793,9 +793,9 @@ void QueueView::slotMoveTop()
void QueueView::slotMoveBottom()
{
- QPtrList<QListViewItem> selection = m_queue->selectedItems();
+ TQPtrList<TQListViewItem> selection = m_queue->selectedItems();
- for (QListViewItem *item = selection.first(); item; item = selection.next()) {
+ for (TQListViewItem *item = selection.first(); item; item = selection.next()) {
QueueViewItem *queueItem = static_cast<QueueViewItem*>(item);
// Move the transfer
@@ -812,7 +812,7 @@ void QueueView::slotEdit()
editor->setData(static_cast<KFTPQueue::Transfer*>(item->getObject()));
// Show the queue editor
- if (editor->exec() == QDialog::Accepted) {
+ if (editor->exec() == TQDialog::Accepted) {
editor->saveData();
KFTPQueue::Manager::self()->revalidateTransfer(static_cast<KFTPQueue::Transfer*>(item->getObject()));
@@ -834,7 +834,7 @@ void QueueView::slotLoad()
if (m_queue->childCount() && KMessageBox::warningContinueCancel(0L, i18n("Loading a new queue will overwrite the existing one; are you sure you want to continue?"), i18n("Load Queue")) == KMessageBox::Cancel)
return;
- QString loadPath = KFileDialog::getOpenFileName();
+ TQString loadPath = KFileDialog::getOpenFileName();
if (!loadPath.isEmpty()) {
KFTPQueue::Manager::self()->getConverter()->importQueue(loadPath);
@@ -843,7 +843,7 @@ void QueueView::slotLoad()
void QueueView::slotSave()
{
- QString savePath = KFileDialog::getSaveFileName();
+ TQString savePath = KFileDialog::getSaveFileName();
if (!savePath.isEmpty()) {
KFTPQueue::Manager::self()->getConverter()->exportQueue(savePath);