summaryrefslogtreecommitdiffstats
path: root/kget/kmainwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kget/kmainwidget.cpp')
-rw-r--r--kget/kmainwidget.cpp96
1 files changed, 48 insertions, 48 deletions
diff --git a/kget/kmainwidget.cpp b/kget/kmainwidget.cpp
index 3271f0d0..ad5fa4a9 100644
--- a/kget/kmainwidget.cpp
+++ b/kget/kmainwidget.cpp
@@ -38,7 +38,7 @@
#include <net/if.h>
#endif
-#include <clipboard.h>
+#include <tqclipboard.h>
#include <tqregexp.h>
#include <tqdragobject.h>
#include <tqwhatsthis.h>
@@ -142,8 +142,8 @@ KMainWidget::KMainWidget(bool bStartDocked)
kmain = this;
// Set log time, needed for the name of log file
- TQDate date = TQDateTime::currentDateTime().date();
- TQTime time = TQDateTime::currentDateTime().time();
+ TQDate date = TQDateTime::tqcurrentDateTime().date();
+ TQTime time = TQDateTime::tqcurrentDateTime().time();
TQString tmp;
tmp.sprintf("log%d:%d:%d-%d:%d:%d", date.day(), date.month(), date.year(), time.hour(), time.minute(), time.second());
@@ -151,7 +151,7 @@ KMainWidget::KMainWidget(bool bStartDocked)
logFileName = locateLocal("appdata", "logs/");
logFileName += tmp;
- lastClipboard = TQApplication::clipboard()->text( TQClipboard::Clipboard ).stripWhiteSpace();
+ lastClipboard = TQApplication::tqclipboard()->text( TQClipboard::Clipboard ).stripWhiteSpace();
// Load all settings from KConfig
ksettings.load();
@@ -223,7 +223,7 @@ KMainWidget::KMainWidget(bool bStartDocked)
kdock = new DockWidget(this);
connect(kdock, TQT_SIGNAL(quitSelected()), TQT_SLOT(slotQuit()));
- // Set geometry
+ // Set tqgeometry
if (ksettings.mainPosition.x() != -1) {
resize(ksettings.mainSize);
move(ksettings.mainPosition);
@@ -411,11 +411,11 @@ void KMainWidget::setupGUI()
createGUI("kgetui.rc");
// setup statusbar
- statusBar()->insertFixedItem(i18n(" Transfers: %1 ").arg(99), ID_TOTAL_TRANSFERS);
- statusBar()->insertFixedItem(i18n(" Files: %1 ").arg(555), ID_TOTAL_FILES);
- statusBar()->insertFixedItem(i18n(" Size: %1 KB ").arg("134.56"), ID_TOTAL_SIZE);
- statusBar()->insertFixedItem(i18n(" Time: %1 ").arg(KIO::convertSeconds(0)), ID_TOTAL_TIME);
- statusBar()->insertFixedItem(i18n(" %1 KB/s ").arg("123.34"), ID_TOTAL_SPEED);
+ statusBar()->insertFixedItem(i18n(" Transfers: %1 ").tqarg(99), ID_TOTAL_TRANSFERS);
+ statusBar()->insertFixedItem(i18n(" Files: %1 ").tqarg(555), ID_TOTAL_FILES);
+ statusBar()->insertFixedItem(i18n(" Size: %1 KB ").tqarg("134.56"), ID_TOTAL_SIZE);
+ statusBar()->insertFixedItem(i18n(" Time: %1 ").tqarg(KIO::convertSeconds(0)), ID_TOTAL_TIME);
+ statusBar()->insertFixedItem(i18n(" %1 KB/s ").tqarg("123.34"), ID_TOTAL_SPEED);
setAutoSaveSettings( "MainWindow", false /*Settings takes care of size & pos & state */ );
@@ -485,7 +485,7 @@ void KMainWidget::setupWhatsThis()
tmp = i18n("<b>Auto paste</b> button toggles the auto-paste mode\n" "on and off.\n" "\n" "When set, KGet will periodically scan the clipboard\n" "for URLs and paste them automatically.");
m_paAutoPaste->setWhatsThis(tmp);
- tmp = i18n("<b>Drop target</b> button toggles the window style\n" "between a normal window and a drop target.\n" "\n" "When set, the main window will be hidden and\n" "instead a small shaped window will appear.\n" "\n" "You can show/hide a normal window with a simple click\n" "on a shaped window.");
+ tmp = i18n("<b>Drop target</b> button toggles the window style\n" "between a normal window and a drop target.\n" "\n" "When set, the main window will be hidden and\n" "instead a small tqshaped window will appear.\n" "\n" "You can show/hide a normal window with a simple click\n" "on a tqshaped window.");
m_paDropTarget->setWhatsThis(tmp);
/*
tmp = i18n("<b>Dock widget</b> button toggles the window style\n" "between a normal window and a docked widget.\n" "\n" "When set, the main window will be hidden and\n" "instead a docked widget will appear on the panel.\n" "\n" "You can show/hide a normal window by simply clicking\n" "on a docked widget.");
@@ -708,7 +708,7 @@ void KMainWidget::slotQuit()
for (; it.current(); ++it) {
item = it.current();
- if (item->getStatus() == Transfer::ST_RUNNING && !ksettings.b_expertMode) {
+ if (item->gettqStatus() == Transfer::ST_RUNNING && !ksettings.b_expertMode) {
if (KMessageBox::warningContinueCancel(this, i18n("Some transfers are still running.\nAre you sure you want to quit KGet?"), i18n("Warning"), KStdGuiItem::quit()) != KMessageBox::Continue) {
#ifdef _DEBUG
sDebugOut << endl;
@@ -876,10 +876,10 @@ void KMainWidget::stopAll()
log(i18n("Stopping all jobs"), false);
TransferIterator it(myTransferList);
- Transfer::TransferStatus Status;
+ Transfer::TransfertqStatus tqStatus;
for (; it.current(); ++it) {
- Status = it.current()->getStatus();
- if (Status == Transfer::ST_TRYING || Status == Transfer::ST_RUNNING)
+ tqStatus = it.current()->gettqStatus();
+ if (tqStatus == Transfer::ST_TRYING || tqStatus == Transfer::ST_RUNNING)
it.current()->slotStop();
}
slotUpdateActions();
@@ -977,7 +977,7 @@ void KMainWidget::slotOpenTransfer()
KURL url = KURL::fromPathOrURL(newtransfer);
if (!url.isValid()) {
- KMessageBox::error(this, i18n("Malformed URL:\n%1").arg(newtransfer), i18n("Error"));
+ KMessageBox::error(this, i18n("Malformed URL:\n%1").tqarg(newtransfer), i18n("Error"));
ok = false;
}
}
@@ -997,7 +997,7 @@ void KMainWidget::slotCheckClipboard()
//sDebugIn << endl;
#endif
- TQString clipData = TQApplication::clipboard()->text( TQClipboard::Clipboard ).stripWhiteSpace();
+ TQString clipData = TQApplication::tqclipboard()->text( TQClipboard::Clipboard ).stripWhiteSpace();
if (clipData != lastClipboard) {
sDebug << "New clipboard event" << endl;
@@ -1026,7 +1026,7 @@ void KMainWidget::slotPasteTransfer()
TQString newtransfer;
- newtransfer = TQApplication::clipboard()->text();
+ newtransfer = TQApplication::tqclipboard()->text();
newtransfer = newtransfer.stripWhiteSpace();
if (!ksettings.b_expertMode) {
@@ -1114,7 +1114,7 @@ void KMainWidget::addTransferEx(const KURL& url, const KURL& destFile)
//check if destination already exists
if(KIO::NetAccess::exists(destURL, false, this))
{
- if (KMessageBox::warningYesNo(this,i18n("Destination file \n%1\nalready exists.\nDo you want to overwrite it?").arg( destURL.prettyURL()), TQString(), i18n("Overwrite"), i18n("Do Not Overwrite") )
+ if (KMessageBox::warningYesNo(this,i18n("Destination file \n%1\nalready exists.\nDo you want to overwrite it?").tqarg( destURL.prettyURL()), TQString(), i18n("Overwrite"), i18n("Do Not Overwrite") )
== KMessageBox::Yes)
{
bDestisMalformed=false;
@@ -1141,7 +1141,7 @@ void KMainWidget::addTransferEx(const KURL& url, const KURL& destFile)
// create a new transfer item
Transfer *item = myTransferList->addTransfer(url, destURL);
- KNotifyClient::event(kdock->winId(), "added", i18n("<i>%1</i> has been added.").arg(url.prettyURL()));
+ KNotifyClient::event(kdock->winId(), "added", i18n("<i>%1</i> has been added.").tqarg(url.prettyURL()));
item->updateAll(); // update the remaining fields
if (ksettings.b_showIndividual)
@@ -1192,7 +1192,7 @@ void KMainWidget::addTransfers( const KURL::List& src, const TQString& destDir )
destURL.setFileName( fileName );
if(KIO::NetAccess::exists(destURL, false, this))
{
- if (KMessageBox::warningYesNo(this,i18n("Destination file \n%1\nalready exists.\nDo you want to overwrite it?").arg( destURL.prettyURL()), TQString(), i18n("Overwrite"), i18n("Do Not Overwrite") )
+ if (KMessageBox::warningYesNo(this,i18n("Destination file \n%1\nalready exists.\nDo you want to overwrite it?").tqarg( destURL.prettyURL()), TQString(), i18n("Overwrite"), i18n("Do Not Overwrite") )
== KMessageBox::Yes)
{
SafeDelete::deleteFile( destURL );
@@ -1360,7 +1360,7 @@ void KMainWidget::checkQueue()
// count running transfers
for (; it.current(); ++it) {
- status = it.current()->getStatus();
+ status = it.current()->gettqStatus();
if (status == Transfer::ST_RUNNING || status == Transfer::ST_TRYING)
numRun++;
}
@@ -1370,7 +1370,7 @@ void KMainWidget::checkQueue()
bool isQuequed;
for (; it.current() && numRun < ksettings.maxSimultaneousConnections; ++it) {
item = it.current();
- isRunning = (item->getStatus() == Transfer::ST_RUNNING) || ((item->getStatus() == Transfer::ST_TRYING));
+ isRunning = (item->gettqStatus() == Transfer::ST_RUNNING) || ((item->gettqStatus() == Transfer::ST_TRYING));
isQuequed = (item->getMode() == Transfer::MD_TQUEUED || item->getMode() == Transfer::MD_NEW);
@@ -1394,7 +1394,7 @@ void KMainWidget::checkQueue()
for (; it.current(); ++it)
{
item = it.current();
- if (item->getMode() == Transfer::MD_NEW && item->getStatus() == Transfer::ST_STOPPED)
+ if (item->getMode() == Transfer::MD_NEW && item->gettqStatus() == Transfer::ST_STOPPED)
{
item->checkCache();
}
@@ -1420,7 +1420,7 @@ void KMainWidget::slotAnimTimeout()
animCounter = 0;
}
// update status of all items of transferList
- isTransfer = myTransferList->updateStatus(animCounter);
+ isTransfer = myTransferList->updatetqStatus(animCounter);
//if (this->isVisible()) {
updateStatusBar();
@@ -1445,7 +1445,7 @@ void KMainWidget::slotTransferTimeout()
for (; it.current(); ++it) {
item = it.current();
- if (item->getMode() == Transfer::MD_SCHEDULED && item->getStartTime() <= TQDateTime::currentDateTime()) {
+ if (item->getMode() == Transfer::MD_SCHEDULED && item->getStartTime() <= TQDateTime::tqcurrentDateTime()) {
item->setMode(Transfer::MD_TQUEUED);
flag = true;
}
@@ -1455,7 +1455,7 @@ void KMainWidget::slotTransferTimeout()
checkQueue();
}
- if (ksettings.b_autoDisconnect && ksettings.b_timedDisconnect && ksettings.disconnectTime <= TQTime::currentTime() && ksettings.disconnectDate == TQDate::currentDate()) {
+ if (ksettings.b_autoDisconnect && ksettings.b_timedDisconnect && ksettings.disconnectTime <= TQTime::currentTime() && ksettings.disconnectDate == TQDate::tqcurrentDate()) {
onlineDisconnect();
}
@@ -1511,7 +1511,7 @@ void KMainWidget::slotStatusChanged(Transfer * item, int _operation)
}
else
{
- KNotifyClient::event(kdock->winId(), "finished", i18n("<i>%1</i> successfully downloaded.").arg(srcurl));
+ KNotifyClient::event(kdock->winId(), "finished", i18n("<i>%1</i> successfully downloaded.").tqarg(srcurl));
}
if ( item )
@@ -1593,7 +1593,7 @@ void KMainWidget::slotCopyToClipboard()
if (item) {
TQString url = item->getSrc().url();
- TQClipboard *cb = TQApplication::clipboard();
+ TQClipboard *cb = TQApplication::tqclipboard();
cb->setText( url, TQClipboard::Selection );
cb->setText( url, TQClipboard::Clipboard);
myTransferList->clearSelection();
@@ -2040,7 +2040,7 @@ void KMainWidget::slotUpdateActions()
sDebug << "-->ONLINE= " << ksettings.b_offline << endl;
#endif
if (item == first_item && !ksettings.b_offline) {
- switch (item->getStatus()) {
+ switch (item->gettqStatus()) {
case Transfer::ST_TRYING:
case Transfer::ST_RUNNING:
m_paResume->setEnabled(false);
@@ -2052,7 +2052,7 @@ void KMainWidget::slotUpdateActions()
m_paPause->setEnabled(false);
m_paRestart->setEnabled(false);
#ifdef _DEBUG
- sDebug << "STATUS IS stopped" << item->getStatus() << endl;
+ sDebug << "STATUS IS stopped" << item->gettqStatus() << endl;
#endif
break;
case Transfer::ST_FINISHED:
@@ -2064,7 +2064,7 @@ void KMainWidget::slotUpdateActions()
} //end switch
- } else if (item->getStatus() != first_item->getStatus()) {
+ } else if (item->gettqStatus() != first_item->gettqStatus()) {
// disable all when all selected items don't have the same status
m_paResume->setEnabled(false);
m_paPause->setEnabled(false);
@@ -2076,7 +2076,7 @@ void KMainWidget::slotUpdateActions()
m_paDelete->setEnabled(true);
m_paCopy->setEnabled(true);
m_paIndividual->setEnabled(true);
- if (item->getStatus() != Transfer::ST_FINISHED) {
+ if (item->gettqStatus() != Transfer::ST_FINISHED) {
m_paQueue->setEnabled(true);
m_paTimer->setEnabled(true);
m_paDelay->setEnabled(true);
@@ -2166,11 +2166,11 @@ void KMainWidget::updateStatusBar()
}
}
- statusBar()->changeItem(i18n(" Transfers: %1 ").arg(myTransferList->childCount()), ID_TOTAL_TRANSFERS);
- statusBar()->changeItem(i18n(" Files: %1 ").arg(totalFiles), ID_TOTAL_FILES);
- statusBar()->changeItem(i18n(" Size: %1 ").arg(KIO::convertSize(totalSize)), ID_TOTAL_SIZE);
- statusBar()->changeItem(i18n(" Time: %1 ").arg(KIO::convertSeconds(remTime)), ID_TOTAL_TIME);
- statusBar()->changeItem(i18n(" %1/s ").arg(KIO::convertSize(totalSpeed)), ID_TOTAL_SPEED);
+ statusBar()->changeItem(i18n(" Transfers: %1 ").tqarg(myTransferList->childCount()), ID_TOTAL_TRANSFERS);
+ statusBar()->changeItem(i18n(" Files: %1 ").tqarg(totalFiles), ID_TOTAL_FILES);
+ statusBar()->changeItem(i18n(" Size: %1 ").tqarg(KIO::convertSize(totalSize)), ID_TOTAL_SIZE);
+ statusBar()->changeItem(i18n(" Time: %1 ").tqarg(KIO::convertSeconds(remTime)), ID_TOTAL_TIME);
+ statusBar()->changeItem(i18n(" %1/s ").tqarg(KIO::convertSize(totalSpeed)), ID_TOTAL_SPEED);
//update size for each statusbar field
statusBar()->setItemFixed(ID_TOTAL_TRANSFERS, -1);
statusBar()->setItemFixed(ID_TOTAL_FILES, -1);
@@ -2179,11 +2179,11 @@ void KMainWidget::updateStatusBar()
statusBar()->setItemFixed(ID_TOTAL_SPEED, -1);
if (kdock) {
- tmpstr = i18n("<b>Transfers:</b> %1 ").arg(myTransferList->childCount()) +
- i18n("<br /><b>Files:</b> %1 ").arg(totalFiles) +
- i18n("<br /><b>Size:</b> %1 ").arg(KIO::convertSize(totalSize)) +
- i18n("<br /><b>Time:</b> %1 ").arg(KIO::convertSeconds(remTime)) +
- i18n("<br /><b>Speed:</b> %1/s").arg(KIO::convertSize(totalSpeed));
+ tmpstr = i18n("<b>Transfers:</b> %1 ").tqarg(myTransferList->childCount()) +
+ i18n("<br /><b>Files:</b> %1 ").tqarg(totalFiles) +
+ i18n("<br /><b>Size:</b> %1 ").tqarg(KIO::convertSize(totalSize)) +
+ i18n("<br /><b>Time:</b> %1 ").tqarg(KIO::convertSeconds(remTime)) +
+ i18n("<br /><b>Speed:</b> %1/s").tqarg(KIO::convertSize(totalSpeed));
kdock->updateToolTip( tmpstr );
//trayicon changes if download is in progress
if (totalSpeed == 0)
@@ -2461,7 +2461,7 @@ bool KMainWidget::sanityChecksSuccessful( const KURL& url )
if (!url.isValid() || !KProtocolInfo::supportsReading( url ) )
{
if (!ksettings.b_expertMode)
- KMessageBox::error(this, i18n("Malformed URL:\n%1").arg(url.prettyURL()), i18n("Error"));
+ KMessageBox::error(this, i18n("Malformed URL:\n%1").tqarg(url.prettyURL()), i18n("Error"));
return false;
}
@@ -2469,11 +2469,11 @@ bool KMainWidget::sanityChecksSuccessful( const KURL& url )
Transfer *transfer = myTransferList->find( url );
if ( transfer )
{
- if ( transfer->getStatus() != Transfer::ST_FINISHED )
+ if ( transfer->gettqStatus() != Transfer::ST_FINISHED )
{
if ( !ksettings.b_expertMode )
{
- KMessageBox::error(this, i18n("Already saving URL\n%1").arg(url.prettyURL()), i18n("Error"));
+ KMessageBox::error(this, i18n("Already saving URL\n%1").tqarg(url.prettyURL()), i18n("Error"));
}
transfer->showIndividual();
@@ -2483,7 +2483,7 @@ bool KMainWidget::sanityChecksSuccessful( const KURL& url )
else // transfer is finished, ask if we want to download again
{
if ( ksettings.b_expertMode ||
- (KMessageBox::questionYesNo(this, i18n("Already saved URL\n%1\nDownload again?").arg(url.prettyURL()),i18n("Question"),i18n("Download Again"),KStdGuiItem::cancel() )
+ (KMessageBox::questionYesNo(this, i18n("Already saved URL\n%1\nDownload again?").tqarg(url.prettyURL()),i18n("Question"),i18n("Download Again"),KStdGuiItem::cancel() )
== KMessageBox::Yes) )
{
transfer->slotRequestRemove();
@@ -2498,7 +2498,7 @@ bool KMainWidget::sanityChecksSuccessful( const KURL& url )
// why restrict this to ftp and http? (pfeiffer)
// // don't download file URL's TODO : uncomment?
// if (url.protocol() == "http" && url.protocol() != "ftp") {
-// KMessageBox::error(this, i18n("File protocol not accepted!\n%1").arg(url.prettyURL()), i18n("Error"));
+// KMessageBox::error(this, i18n("File protocol not accepted!\n%1").tqarg(url.prettyURL()), i18n("Error"));
// #ifdef _DEBUG
// sDebugOut << endl;
// #endif