summaryrefslogtreecommitdiffstats
path: root/kftpgrabber/src/widgets/browser/actions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kftpgrabber/src/widgets/browser/actions.cpp')
-rw-r--r--kftpgrabber/src/widgets/browser/actions.cpp136
1 files changed, 68 insertions, 68 deletions
diff --git a/kftpgrabber/src/widgets/browser/actions.cpp b/kftpgrabber/src/widgets/browser/actions.cpp
index cc9fc8c..bb7c260 100644
--- a/kftpgrabber/src/widgets/browser/actions.cpp
+++ b/kftpgrabber/src/widgets/browser/actions.cpp
@@ -54,23 +54,23 @@
#include "misc/filter.h"
#include "misc/customcommands/manager.h"
-#include <kglobal.h>
+#include <tdeglobal.h>
#include <kcharsets.h>
-#include <kapplication.h>
-#include <kmainwindow.h>
-#include <klocale.h>
-#include <kmessagebox.h>
-#include <kpopupmenu.h>
+#include <tdeapplication.h>
+#include <tdemainwindow.h>
+#include <tdelocale.h>
+#include <tdemessagebox.h>
+#include <tdepopupmenu.h>
#include <kinputdialog.h>
#include <kpropertiesdialog.h>
-#include <kio/job.h>
+#include <tdeio/job.h>
#include <kshred.h>
#include <klineedit.h>
-#include <kfiledialog.h>
+#include <tdefiledialog.h>
#include <kstandarddirs.h>
-#include <qdir.h>
-#include <qclipboard.h>
+#include <ntqdir.h>
+#include <ntqclipboard.h>
using namespace KFTPGrabberBase;
using namespace KFTPEngine;
@@ -82,14 +82,14 @@ namespace KFTPWidgets {
namespace Browser {
Actions::Actions(View *parent)
- : QObject(parent),
+ : TQObject(parent),
m_view(parent)
{
}
void Actions::initActions()
{
- m_actionCollection = new KActionCollection(m_view, this);
+ m_actionCollection = new TDEActionCollection(m_view, this);
// Create all the actions
m_goUpAction = KStdAction::up(this, SLOT(slotGoUp()), m_actionCollection, "go_up");
@@ -99,45 +99,45 @@ void Actions::initActions()
m_reloadAction = KStdAction::redisplay(this, SLOT(slotReload()), m_actionCollection, "reload");
m_reloadAction->setText(i18n("&Reload"));
- m_reloadAction->setShortcut(KShortcut(Qt::Key_F5));
+ m_reloadAction->setShortcut(TDEShortcut(TQt::Key_F5));
- m_abortAction = new KAction(i18n("&Abort"), "stop", KShortcut(), this, SLOT(slotAbort()), m_actionCollection, "abort");
- m_toggleTreeViewAction = new KToggleAction(i18n("&Show Tree View"), "view_tree", KShortcut(), this, SLOT(slotShowHideTree()), m_actionCollection, "toggle_tree_view");
- m_toggleFilterAction = new KToggleAction(i18n("Show &Filter"), "filter", KShortcut(), this, SLOT(slotShowHideFilter()), m_actionCollection, "toggle_filter");
+ m_abortAction = new TDEAction(i18n("&Abort"), "stop", TDEShortcut(), this, SLOT(slotAbort()), m_actionCollection, "abort");
+ m_toggleTreeViewAction = new TDEToggleAction(i18n("&Show Tree View"), "view_tree", TDEShortcut(), this, SLOT(slotShowHideTree()), m_actionCollection, "toggle_tree_view");
+ m_toggleFilterAction = new TDEToggleAction(i18n("Show &Filter"), "filter", TDEShortcut(), this, SLOT(slotShowHideFilter()), m_actionCollection, "toggle_filter");
- m_renameAction = new KAction(i18n("&Rename"), KShortcut(Qt::Key_F2), this, SLOT(slotRename()), m_actionCollection, "edit_rename");
- m_deleteAction = new KAction(i18n("&Delete"), "editdelete", KShortcut(Qt::Key_Delete), this, SLOT(slotDelete()), m_actionCollection, "edit_delete");
- m_propsAction = new KAction(i18n("&Properties"), KShortcut(), this, SLOT(slotProps()), m_actionCollection, "edit_properties");
- m_shredAction = new KAction(i18n("&Shred"), "editshred", KShortcut(), this, SLOT(slotShred()), m_actionCollection, "edit_shred");
+ m_renameAction = new TDEAction(i18n("&Rename"), TDEShortcut(TQt::Key_F2), this, SLOT(slotRename()), m_actionCollection, "edit_rename");
+ m_deleteAction = new TDEAction(i18n("&Delete"), "editdelete", TDEShortcut(TQt::Key_Delete), this, SLOT(slotDelete()), m_actionCollection, "edit_delete");
+ m_propsAction = new TDEAction(i18n("&Properties"), TDEShortcut(), this, SLOT(slotProps()), m_actionCollection, "edit_properties");
+ m_shredAction = new TDEAction(i18n("&Shred"), "editshred", TDEShortcut(), this, SLOT(slotShred()), m_actionCollection, "edit_shred");
m_copyAction = KStdAction::copy(this, SLOT(slotCopy()), m_actionCollection, "edit_copy");
m_pasteAction = KStdAction::paste(this, SLOT(slotPaste()), m_actionCollection, "edit_paste");
- m_filterActions = new KActionMenu(i18n("&Filter Options"), "", m_actionCollection, "edit_filter_options");
- m_alwaysSkipAction = new KAction(i18n("Always &skip this file when queuing"), KShortcut(), this, SLOT(slotAlwaysSkip()), m_actionCollection);
- m_topPriorityAction = new KAction(i18n("Make this file &top priority"), KShortcut(), this, SLOT(slotTopPriority()), m_actionCollection);
- m_lowPriorityAction = new KAction(i18n("Make this file &lowest priority"), KShortcut(), this, SLOT(slotLowPriority()), m_actionCollection);
+ m_filterActions = new TDEActionMenu(i18n("&Filter Options"), "", m_actionCollection, "edit_filter_options");
+ m_alwaysSkipAction = new TDEAction(i18n("Always &skip this file when queuing"), TDEShortcut(), this, SLOT(slotAlwaysSkip()), m_actionCollection);
+ m_topPriorityAction = new TDEAction(i18n("Make this file &top priority"), TDEShortcut(), this, SLOT(slotTopPriority()), m_actionCollection);
+ m_lowPriorityAction = new TDEAction(i18n("Make this file &lowest priority"), TDEShortcut(), this, SLOT(slotLowPriority()), m_actionCollection);
m_filterActions->insert(m_alwaysSkipAction);
m_filterActions->insert(m_topPriorityAction);
m_filterActions->insert(m_lowPriorityAction);
- m_transferAction = new KAction(i18n("&Transfer"), KShortcut(), this, SLOT(slotTransfer()), m_actionCollection, "transfer");
- m_queueTransferAction = new KAction(i18n("&Queue Transfer"), "queue", KShortcut(), this, SLOT(slotQueueTransfer()), m_actionCollection, "queue_transfer");
- m_createDirAction = new KAction(i18n("&Create Directory..."), "folder_new", KShortcut(), this, SLOT(slotCreateDir()), m_actionCollection, "create_dir");
- m_fileEditAction = new KAction(i18n("&Open file"), "fileopen", KShortcut(), this, SLOT(slotFileEdit()), m_actionCollection, "open_file");
- m_verifyAction = new KAction(i18n("&Verify..."), "ok", KShortcut(), this, SLOT(slotVerify()), m_actionCollection, "verify");
+ m_transferAction = new TDEAction(i18n("&Transfer"), TDEShortcut(), this, SLOT(slotTransfer()), m_actionCollection, "transfer");
+ m_queueTransferAction = new TDEAction(i18n("&Queue Transfer"), "queue", TDEShortcut(), this, SLOT(slotQueueTransfer()), m_actionCollection, "queue_transfer");
+ m_createDirAction = new TDEAction(i18n("&Create Directory..."), "folder_new", TDEShortcut(), this, SLOT(slotCreateDir()), m_actionCollection, "create_dir");
+ m_fileEditAction = new TDEAction(i18n("&Open file"), "fileopen", TDEShortcut(), this, SLOT(slotFileEdit()), m_actionCollection, "open_file");
+ m_verifyAction = new TDEAction(i18n("&Verify..."), "ok", TDEShortcut(), this, SLOT(slotVerify()), m_actionCollection, "verify");
populateEncodings();
- m_moreActions = new KActionMenu(i18n("&More Actions"), "configure", this);
- m_rawCmdAction = new KAction(i18n("&Manual Command Entry..."), "openterm", KShortcut(), this, SLOT(slotRawCmd()), m_actionCollection, "send_raw_cmd");
- m_exportListingAction = new KAction(i18n("&Export Directory Listing..."), "", KShortcut(), this, SLOT(slotExportListing()), m_actionCollection, "export_listing");
- m_showHiddenFilesAction = new KToggleAction(i18n("Show &Hidden Files && Directories"), KShortcut(), this, SLOT(slotShowHiddenFiles()), m_actionCollection, "show_hidden");
- m_openExternalAction = new KAction(i18n("Open current directory in &Konqueror..."), "konqueror", KShortcut(), this, SLOT(slotOpenExternal()), m_actionCollection, "open_konqi");
+ m_moreActions = new TDEActionMenu(i18n("&More Actions"), "configure", this);
+ m_rawCmdAction = new TDEAction(i18n("&Manual Command Entry..."), "openterm", TDEShortcut(), this, SLOT(slotRawCmd()), m_actionCollection, "send_raw_cmd");
+ m_exportListingAction = new TDEAction(i18n("&Export Directory Listing..."), "", TDEShortcut(), this, SLOT(slotExportListing()), m_actionCollection, "export_listing");
+ m_showHiddenFilesAction = new TDEToggleAction(i18n("Show &Hidden Files && Directories"), TDEShortcut(), this, SLOT(slotShowHiddenFiles()), m_actionCollection, "show_hidden");
+ m_openExternalAction = new TDEAction(i18n("Open current directory in &Konqueror..."), "konqueror", TDEShortcut(), this, SLOT(slotOpenExternal()), m_actionCollection, "open_konqi");
- m_markItemsAction = new KAction(i18n("Compare &selected items"), "", KShortcut(Qt::Key_Space), this, SLOT(slotMarkItems()), m_actionCollection, "compare_selected");
- m_compareAction = new KAction(i18n("Compare &directories"), "", KShortcut(), this, SLOT(slotCompare()), m_actionCollection, "compare_dirs");
+ m_markItemsAction = new TDEAction(i18n("Compare &selected items"), "", TDEShortcut(TQt::Key_Space), this, SLOT(slotMarkItems()), m_actionCollection, "compare_selected");
+ m_compareAction = new TDEAction(i18n("Compare &directories"), "", TDEShortcut(), this, SLOT(slotCompare()), m_actionCollection, "compare_dirs");
m_showHiddenFilesAction->setChecked(KFTPCore::Config::showHiddenFiles());
@@ -158,10 +158,10 @@ void Actions::initActions()
m_moreActions->setStickyMenu(true);
m_moreActions->setDelayed(false);
- m_siteChangeAction = new KActionMenu(i18n("&Change Site"), "goto", this);
- m_quickConnectAction = new KAction(i18n("&Quick Connect..."), "connect_creating", KShortcut(), this, SLOT(slotQuickConnect()), m_actionCollection, "quick_connect");
- m_connectAction = new KActionMenu(i18n("&Connect To"), this);
- m_disconnectAction = new KAction(i18n("&Disconnect"), "connect_no", KShortcut(), this, SLOT(slotDisconnect()), m_actionCollection, "disconnect");
+ m_siteChangeAction = new TDEActionMenu(i18n("&Change Site"), "goto", this);
+ m_quickConnectAction = new TDEAction(i18n("&Quick Connect..."), "connect_creating", TDEShortcut(), this, SLOT(slotQuickConnect()), m_actionCollection, "quick_connect");
+ m_connectAction = new TDEActionMenu(i18n("&Connect To"), this);
+ m_disconnectAction = new TDEAction(i18n("&Disconnect"), "connect_no", TDEShortcut(), this, SLOT(slotDisconnect()), m_actionCollection, "disconnect");
m_siteChangeAction->insert(m_quickConnectAction);
m_siteChangeAction->insert(m_connectAction);
@@ -170,21 +170,21 @@ void Actions::initActions()
m_siteChangeAction->setDelayed(false);
// Populate bookmarks
- KFTPBookmarks::Manager::self()->guiPopulateBookmarksMenu(m_connectAction, QDomNode(), false, m_view->m_session);
+ KFTPBookmarks::Manager::self()->guiPopulateBookmarksMenu(m_connectAction, TQDomNode(), false, m_view->m_session);
}
void Actions::populateEncodings()
{
// Charsets
- m_changeEncodingAction = new KActionMenu(i18n("Change Remote &Encoding"), "charset", m_actionCollection, "changeremoteencoding");
+ m_changeEncodingAction = new TDEActionMenu(i18n("Change Remote &Encoding"), "charset", m_actionCollection, "changeremoteencoding");
m_changeEncodingAction->setDelayed(false);
- KPopupMenu *menu = m_changeEncodingAction->popupMenu();
+ TDEPopupMenu *menu = m_changeEncodingAction->popupMenu();
menu->clear();
- QStringList charsets = KGlobal::charsets()->descriptiveEncodingNames();
+ TQStringList charsets = TDEGlobal::charsets()->descriptiveEncodingNames();
int count = 0;
- for (QStringList::iterator i = charsets.begin(); i != charsets.end(); ++i)
+ for (TQStringList::iterator i = charsets.begin(); i != charsets.end(); ++i)
menu->insertItem(*i, this, SLOT(slotCharsetChanged(int)), 0, ++count);
menu->insertSeparator();
@@ -201,7 +201,7 @@ void Actions::updateActions()
// History
int index = 0;
- const QValueList<LocationNavigator::Element> list = m_view->history(index);
+ const TQValueList<LocationNavigator::Element> list = m_view->history(index);
m_goBackAction->setEnabled(index < static_cast<int>(list.count()) - 1);
m_goForwardAction->setEnabled(index > 0);
@@ -334,14 +334,14 @@ void Actions::slotRename()
KFTPWidgets::Browser::DetailsView *view = m_view->getDetailsView();
// Rename the first file in the current selection
- view->rename(view->KListView::selectedItems().at(0), 0);
+ view->rename(view->TDEListView::selectedItems().at(0), 0);
// Enhanced rename: Don't highlight the file extension. (from Konqueror)
KLineEdit *le = view->renameLineEdit();
if (le) {
- const QString txt = le->text();
- QString pattern;
+ const TQString txt = le->text();
+ TQString pattern;
KMimeType::diagnoseFileName(txt, pattern);
if (!pattern.isEmpty() && pattern.at(0) == '*' && pattern.find('*',1) == -1)
@@ -362,7 +362,7 @@ void Actions::slotDelete()
// Delete a file or directory
KURL::List selection = m_view->selectedURLs();
KURL::List::ConstIterator i = selection.begin();
- QStringList prettyList;
+ TQStringList prettyList;
for (; i != selection.end(); ++i) {
prettyList.append((*i).pathOrURL());
}
@@ -372,13 +372,13 @@ void Actions::slotDelete()
prettyList,
i18n("Delete Files"),
KStdGuiItem::del(),
- QString::null,
+ TQString::null,
KMessageBox::Dangerous) == KMessageBox::Cancel)
return;
// Go trough all files and delete them
if (!session->isRemote()) {
- KIO::del(selection);
+ TDEIO::del(selection);
} else {
KURL::List::Iterator end(selection.end());
@@ -391,17 +391,17 @@ void Actions::slotDelete()
void Actions::slotCopy()
{
- QClipboard *cb = QApplication::clipboard();
- cb->setData(m_view->getDetailsView()->dragObject(), QClipboard::Clipboard);
+ TQClipboard *cb = TQApplication::clipboard();
+ cb->setData(m_view->getDetailsView()->dragObject(), TQClipboard::Clipboard);
}
void Actions::slotPaste()
{
// Decode the data and try to init transfer
- KIO::MetaData p_meta;
+ TDEIO::MetaData p_meta;
KURL::List p_urls;
- if (KURLDrag::decode(QApplication::clipboard()->data(), p_urls, p_meta)) {
+ if (KURLDrag::decode(TQApplication::clipboard()->data(), p_urls, p_meta)) {
// Add destination url and call the QueueManager
p_meta.insert("DestURL", m_view->url().url());
KURLDrag *drag = new KURLDrag(p_urls, p_meta, m_view, name());
@@ -451,7 +451,7 @@ void Actions::addPriorityItems(int priority)
if (priority == 0) {
rule->setName(i18n("Skip '%1'").arg((*i).filename()));
const_cast<ConditionChain*>(rule->conditions())->append(new Condition(Filename, Condition::Is, (*i).filename()));
- const_cast<ActionChain*>(rule->actions())->append(new Action(Action::Skip, QVariant()));
+ const_cast<ActionChain*>(rule->actions())->append(new Action(Action::Skip, TQVariant()));
} else {
rule->setName(i18n("Priority '%1'").arg((*i).filename()));
const_cast<ConditionChain*>(rule->conditions())->append(new Condition(Filename, Condition::Is, (*i).filename()));
@@ -540,14 +540,14 @@ void Actions::slotCreateDir()
{
// Create new directory
bool ok;
- QString newDirName = KInputDialog::getText(i18n("Create Directory"), i18n("Directory name:"), "", &ok);
+ TQString newDirName = KInputDialog::getText(i18n("Create Directory"), i18n("Directory name:"), "", &ok);
if (ok) {
KURL url = m_view->url();
url.addPath(newDirName);
if (url.isLocalFile())
- KIO::mkdir(url);
+ TDEIO::mkdir(url);
else
m_view->m_ftpClient->mkdir(url);
}
@@ -564,7 +564,7 @@ void Actions::slotFileEdit()
// Create a new transfer to download the file and open it
KFTPQueue::TransferFile *transfer = new KFTPQueue::TransferFile(KFTPQueue::Manager::self());
transfer->setSourceUrl(item->url());
- transfer->setDestUrl(KURL(KGlobal::dirs()->saveLocation("tmp") + QString("%1-%2").arg(KApplication::randomString(7)).arg(item->name())));
+ transfer->setDestUrl(KURL(TDEGlobal::dirs()->saveLocation("tmp") + TQString("%1-%2").arg(TDEApplication::randomString(7)).arg(item->name())));
transfer->addSize(item->size());
transfer->setTransferType(KFTPQueue::Download);
transfer->setOpenAfterTransfer(true);
@@ -588,7 +588,7 @@ void Actions::slotAbort()
void Actions::slotRawCmd()
{
bool ok;
- QString rawCmd = KInputDialog::getText(i18n("Send Raw Command"), i18n("Command:"), "", &ok);
+ TQString rawCmd = KInputDialog::getText(i18n("Send Raw Command"), i18n("Command:"), "", &ok);
if (ok)
m_view->m_ftpClient->raw(rawCmd);
@@ -614,8 +614,8 @@ void Actions::slotShowHideFilter()
void Actions::slotCharsetChanged(int id)
{
if (!m_changeEncodingAction->popupMenu()->isItemChecked(id)) {
- QStringList charsets = KGlobal::charsets()->descriptiveEncodingNames();
- QString charset = KGlobal::charsets()->encodingForName(charsets[id - 1]);
+ TQStringList charsets = TDEGlobal::charsets()->descriptiveEncodingNames();
+ TQString charset = TDEGlobal::charsets()->encodingForName(charsets[id - 1]);
// Set the current socket's charset
m_view->m_ftpClient->socket()->changeEncoding(charset);
@@ -645,15 +645,15 @@ void Actions::slotCharsetReset(int id)
void Actions::slotExportListing()
{
- QString savePath = KFileDialog::getSaveFileName(QString::null, "*.txt|Directory Dump", 0, i18n("Export Directory Listing"));
+ TQString savePath = KFileDialog::getSaveFileName(TQString::null, "*.txt|Directory Dump", 0, i18n("Export Directory Listing"));
if (!savePath.isEmpty()) {
- QFile file(savePath);
+ TQFile file(savePath);
if (!file.open(IO_WriteOnly))
return;
- QTextStream stream(&file);
+ TQTextStream stream(&file);
KFileItemList list(*m_view->items());
KFileItemListIterator i(list);
@@ -720,7 +720,7 @@ void Actions::slotCompare()
DetailsView *oView = opposite->getFileView()->getDetailsView();
// All items in the other list view should be visible by default
- QListViewItemIterator j(oView);
+ TQListViewItemIterator j(oView);
while (j.current()) {
KFileItem *oItem = static_cast<KFileListViewItem*>(*j)->fileInfo();
oView->setItemVisibility(oItem, true);
@@ -729,7 +729,7 @@ void Actions::slotCompare()
}
// Compare the two listviews
- QListViewItemIterator i(tView);
+ TQListViewItemIterator i(tView);
while (i.current()) {
KFileItem *tItem = static_cast<KFileListViewItem*>(*i)->fileInfo();