diff options
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/objects/class_workspace.cpp | 4 | ||||
| -rw-r--r-- | src/modules/torrent/libkvitorrent.cpp | 184 | ||||
| -rw-r--r-- | src/modules/url/libkviurl.cpp | 1 |
3 files changed, 118 insertions, 71 deletions
diff --git a/src/modules/objects/class_workspace.cpp b/src/modules/objects/class_workspace.cpp index a541d4e71..cdf03a8ca 100644 --- a/src/modules/objects/class_workspace.cpp +++ b/src/modules/objects/class_workspace.cpp @@ -49,6 +49,10 @@ @description: This widget provides a workspace window that can contain decorated window. @functions: + !fn: $addSubWindow(<widget>) + Adds a widget as a subwindow of this workspace. + !fn: $removeSubWindow(<widget>) + Removes a subwindow from this this workspace. !fn: <object> $activeWindow() Returns the active window, or 0 if no window is active. !fn: <boolean> $scrollBarsEnabled() diff --git a/src/modules/torrent/libkvitorrent.cpp b/src/modules/torrent/libkvitorrent.cpp index 94f3c4d51..22df7b4e3 100644 --- a/src/modules/torrent/libkvitorrent.cpp +++ b/src/modules/torrent/libkvitorrent.cpp @@ -269,6 +269,32 @@ static KviTorrentInterface *auto_detect_torrent_client(KviWindow * pOut = 0) return true; \ } +/* + @doc: torrent.detect + @type: + command + @title: + torrent.detect + @short: + Detects the torrent client interface to use + @syntax: + torrent.detect [-q] + @description: + Attempts to detect the best torrent client interface + for the current system. The -q switch causes the detection + algorithm to run quietly. This function may attempt to start + the torrent clients in order to verify their presence on the system. + You can guide the function by starting the torrent client you + prefer before running it: if a running torrent client is found, it takes + precedence over the others.[br] + Take a look at the [module:torrent]torrent module documentation[/module] + for more details about how it works.[br] + @seealso: + [module:torrent]torrent module documentation[/module], + [cmd]torrent.setClient[/cmd], + [fnc]$torrent.client[/fnc] +*/ + TC_KVS_COMMAND(detect) { KviTorrentInterface::select(auto_detect_torrent_client(c->hasSwitch('q',"quiet") ? 0 : c->window())); @@ -287,10 +313,10 @@ TC_KVS_COMMAND(detect) $torrent.maxUploadSpeed() @description: Returns maximum upload speed set in client. - Take a look at the [module:torrent]torrent client documentation[/module] + Take a look at the [module:torrent]torrent module documentation[/module] for more details about how it works.[br] @seealso: - [module:torrent]torrent client documentation[/module], + [module:torrent]torrent module documentation[/module] */ TC_KVS_INTRET_FUNCTION(maxUploadSpeed, maxUploadSpeed) @@ -307,10 +333,10 @@ TC_KVS_INTRET_FUNCTION(maxUploadSpeed, maxUploadSpeed) $torrent.maxDownloadSpeed() @description: Returns maximum download speed set in client. - Take a look at the [module:torrent]torrent client documentation[/module] + Take a look at the [module:torrent]torrent module documentation[/module] for more details about how it works.[br] @seealso: - [module:torrent]torrent client documentation[/module], + [module:torrent]torrent module documentation[/module] */ TC_KVS_INTRET_FUNCTION(maxDownloadSpeed, maxDownloadSpeed) @@ -326,10 +352,10 @@ TC_KVS_INTRET_FUNCTION(maxDownloadSpeed, maxDownloadSpeed) torrent.setMaxUploadSpeed <kbytes_per_sec> @description: Sets maximum upload speed - Take a look at the [module:torrent]torrent client documentation[/module] + Take a look at the [module:torrent]torrent module documentation[/module] for more details about how it works.[br] @seealso: - [module:torrent]torrent client documentation[/module], + [module:torrent]torrent module documentation[/module] */ TC_KVS_INT_COMMAND(setMaxUploadSpeed, setMaxUploadSpeed, "kbytes_per_sec") @@ -345,10 +371,10 @@ TC_KVS_INT_COMMAND(setMaxUploadSpeed, setMaxUploadSpeed, "kbytes_per_sec") torrent.setMaxDownloadSpeed <kbytes_per_sec> @description: Sets maximum download speed - Take a look at the [module:torrent]torrent client documentation[/module] + Take a look at the [module:torrent]torrent module documentation[/module] for more details about how it works.[br] @seealso: - [module:torrent]torrent client documentation[/module], + [module:torrent]torrent module documentation[/module] */ TC_KVS_INT_COMMAND(setMaxDownloadSpeed, setMaxDownloadSpeed, "kbytes_per_sec") @@ -364,10 +390,10 @@ TC_KVS_INT_COMMAND(setMaxDownloadSpeed, setMaxDownloadSpeed, "kbytes_per_sec") $torrent.speedUp() @description: Returns current total upload speed - Take a look at the [module:torrent]torrent client documentation[/module] + Take a look at the [module:torrent]torrent module documentation[/module] for more details about how it works.[br] @seealso: - [module:torrent]torrent client documentation[/module], + [module:torrent]torrent module documentation[/module] */ TC_KVS_FLOATRET_FUNCTION(speedUp, speedUp) @@ -383,10 +409,10 @@ TC_KVS_FLOATRET_FUNCTION(speedUp, speedUp) $torrent.speedDown() @description: Returns current total download speed - Take a look at the [module:torrent]torrent client documentation[/module] + Take a look at the [module:torrent]torrent module documentation[/module] for more details about how it works.[br] @seealso: - [module:torrent]torrent client documentation[/module], + [module:torrent]torrent module documentation[/module] */ TC_KVS_FLOATRET_FUNCTION(speedDown, speedDown) @@ -402,10 +428,10 @@ TC_KVS_FLOATRET_FUNCTION(speedDown, speedDown) $torrent.trafficUp() @description: Returns the total number of bytes uploaded - Take a look at the [module:torrent]torrent client documentation[/module] + Take a look at the [module:torrent]torrent module documentation[/module] for more details about how it works.[br] @seealso: - [module:torrent]torrent client documentation[/module], + [module:torrent]torrent module documentation[/module] */ TC_KVS_FLOATRET_FUNCTION(trafficUp, trafficUp) @@ -416,15 +442,15 @@ TC_KVS_FLOATRET_FUNCTION(trafficUp, trafficUp) @title: $torrent.trafficDown @short: - Returns the total number of bytes download + Returns the total number of bytes downloaded @syntax: $torrent.trafficDown() @description: - Returns the total number of bytes download - Take a look at the [module:torrent]torrent client documentation[/module] + Returns the total number of bytes downloaded + Take a look at the [module:torrent]torrent module documentation[/module] for more details about how it works.[br] @seealso: - [module:torrent]torrent client documentation[/module], + [module:torrent]torrent module documentation[/module] */ TC_KVS_FLOATRET_FUNCTION(trafficDown, trafficDown) @@ -440,10 +466,10 @@ TC_KVS_FLOATRET_FUNCTION(trafficDown, trafficDown) $torrent.name() @description: Returns number of torrents in client - Take a look at the [module:torrent]torrent client documentation[/module] + Take a look at the [module:torrent]torrent module documentation[/module] for more details about how it works.[br] @seealso: - [module:torrent]torrent client documentation[/module], + [module:torrent]torrent module documentation[/module] */ TC_KVS_INTRET_FUNCTION(count, count) @@ -459,10 +485,10 @@ TC_KVS_INTRET_FUNCTION(count, count) $torrent.name(torrent_number) @description: Returns torrent name as displayed in client - Take a look at the [module:torrent]torrent client documentation[/module] + Take a look at the [module:torrent]torrent module documentation[/module] for more details about how it works.[br] @seealso: - [module:torrent]torrent client documentation[/module], + [module:torrent]torrent module documentation[/module] */ TC_KVS_STRINGRET_INT_FUNCTION(name, name, "torrent_number") @@ -478,10 +504,10 @@ TC_KVS_STRINGRET_INT_FUNCTION(name, name, "torrent_number") torrent.start <torrent_number> @description: Starts downloading of torrent <torrent_number> - Take a look at the [module:torrent]torrent client documentation[/module] + Take a look at the [module:torrent]torrent module documentation[/module] for more details about how it works.[br] @seealso: - [module:torrent]torrent client documentation[/module], + [module:torrent]torrent module documentation[/module], [cmd]torrent.stop[/cmd], [cmd]torrent.stopAll[/cmd], [cmd]torrent.startAll[/cmd] */ @@ -499,10 +525,10 @@ TC_KVS_INT_COMMAND(start, start, "torrent_number") torrent.stop <torrent_number> @description: Stops downloading of torrent <torrent_number> - Take a look at the [module:torrent]torrent client documentation[/module] + Take a look at the [module:torrent]torrent module documentation[/module] for more details about how it works.[br] @seealso: - [module:torrent]torrent client documentation[/module], + [module:torrent]torrent module documentation[/module], [cmd]torrent.stopAll[/cmd], [cmd]torrent.startAll[/cmd], [cmd]torrent.start[/cmd] */ @@ -520,10 +546,10 @@ TC_KVS_INT_COMMAND(stop, stop, "torrent_number") torrent.announce <torrent_number> @description: Manually announces torrent to tracker - Take a look at the [module:torrent]torrent client documentation[/module] + Take a look at the [module:torrent]torrent module documentation[/module] for more details about how it works.[br] @seealso: - [module:torrent]torrent client documentation[/module], + [module:torrent]torrent module documentation[/module] */ TC_KVS_INT_COMMAND(announce, announce, "torrent_number") @@ -539,10 +565,10 @@ TC_KVS_INT_COMMAND(announce, announce, "torrent_number") $torrent.fileCount <torrent_number> @description: Returns the number of files in a torrent. - Take a look at the [module:torrent]torrent client documentation[/module] + Take a look at the [module:torrent]torrent module documentation[/module] for more details about how it works.[br] @seealso: - [module:torrent]torrent client documentation[/module], + [module:torrent]torrent module documentation[/module] */ TC_KVS_INTRET_INT_FUNCTION(fileCount, fileCount, "torrent_number") @@ -558,10 +584,10 @@ TC_KVS_INTRET_INT_FUNCTION(fileCount, fileCount, "torrent_number") $torrent.fileName <torrent_number> <file_number> @description: Returns the name of a file in a torrent. - Take a look at the [module:torrent]torrent client documentation[/module] + Take a look at the [module:torrent]torrent module documentation[/module] for more details about how it works.[br] @seealso: - [module:torrent]torrent client documentation[/module], + [module:torrent]torrent module documentation[/module] */ TC_KVS_STRINGRET_INT_INT_FUNCTION(fileName, fileName, "torrent_number", "file_number") @@ -577,10 +603,10 @@ TC_KVS_STRINGRET_INT_INT_FUNCTION(fileName, fileName, "torrent_number", "file_nu $torrent.filePriority <torrent_number> <file_number> @description: Returns the priority of a file in a torrent. - Take a look at the [module:torrent]torrent client documentation[/module] + Take a look at the [module:torrent]torrent module documentation[/module] for more details about how it works.[br] @seealso: - [module:torrent]torrent client documentation[/module], + [module:torrent]torrent module documentation[/module] */ TC_KVS_STRINGRET_INT_INT_FUNCTION(filePriority, filePriority, "torrent_number", "file_number") @@ -596,10 +622,10 @@ TC_KVS_STRINGRET_INT_INT_FUNCTION(filePriority, filePriority, "torrent_number", torrent.setFilePriority <torrent_number> <file_number> @description: Sets the priority of a file in a torrent. - Take a look at the [module:torrent]torrent client documentation[/module] + Take a look at the [module:torrent]torrent module documentation[/module] for more details about how it works.[br] @seealso: - [module:torrent]torrent client documentation[/module], + [module:torrent]torrent module documentation[/module] */ TC_KVS_INT_INT_STRING_COMMAND(setFilePriority, setFilePriority, "torrent_number", "file_number", "priority") @@ -615,10 +641,10 @@ TC_KVS_INT_INT_STRING_COMMAND(setFilePriority, setFilePriority, "torrent_number" torrent.startAll @description: Starts downloading of all torrents - Take a look at the [module:torrent]torrent client documentation[/module] + Take a look at the [module:torrent]torrent module documentation[/module] for more details about how it works.[br] @seealso: - [module:torrent]torrent client documentation[/module], + [module:torrent]torrent module documentation[/module], [cmd]torrent.stopAll[/cmd], [cmd]torrent.start[/cmd], [cmd]torrent.stop[/cmd] */ @@ -637,39 +663,16 @@ TC_KVS_SIMPLE_COMMAND(startAll, startAll) torrent.stopAll @description: Stops downloading of all torrents - Take a look at the [module:torrent]torrent client documentation[/module] + Take a look at the [module:torrent]torrent module documentation[/module] for more details about how it works.[br] @seealso: - [module:torrent]torrent client documentation[/module], + [module:torrent]torrent module documentation[/module], [cmd]torrent.startAll[/cmd], [cmd]torrent.start[/cmd], [cmd]torrent.stop[/cmd] */ TC_KVS_SIMPLE_COMMAND(stopAll, stopAll) - -/* - @doc: torrent.list - @type: - function - @title: - torrent.list - @short: - Returns a list of all torrents - @syntax: - $torrent.list() - @description: - Returns a list of all torrents - Take a look at the [module:torrent]torrent client documentation[/module] - for more details about how it works.[br] - @seealso: - [module:torrent]torrent client documentation[/module], - [cmd]torrent.startAll[/cmd], [cmd]torrent.start[/cmd], - [cmd]torrent.stop[/cmd] -*/ - -//MP_KVS_SIMPLE_COMMAND(list,list) - /* @doc: torrent.setClient @type: @@ -684,10 +687,10 @@ TC_KVS_SIMPLE_COMMAND(stopAll, stopAll) Sets the torrent client interface to be used by the torrent interface module. <interface_name> must be one of the client names returned by [cmd]torrent.clientList[/cmd] - Take a look at the [module:torrent]torrent client documentation[/module] + Take a look at the [module:torrent]torrent module documentation[/module] for more details about how it works.[br] @seealso: - [module:torrent]torrent client documentation[/module], + [module:torrent]torrent module documentation[/module], [cmd]torrent.detect[/cmd], [fnc]$torrent.client[/fnc] */ @@ -735,10 +738,10 @@ TC_KVS_COMMAND(setClient) $torrent.client() @description: Returns the currently set torrent client interface. - Take a look at the [module:torrent]torrent client documentation[/module] + Take a look at the [module:torrent]torrent module documentation[/module] for more details about how it works.[br] @seealso: - [module:torrent]torrent client documentation[/module], + [module:torrent]torrent module documentation[/module], [cmd]torrent.detect[/cmd], [cmd]torrent.setClient[/cmd] */ TC_KVS_FUNCTION(client) @@ -759,10 +762,10 @@ TC_KVS_FUNCTION(client) $torrent.clientList() @description: Returns a list of all supported clients. - Take a look at the [module:torrent]torrent client documentation[/module] + Take a look at the [module:torrent]torrent module documentation[/module] for more details about how it works.[br] @seealso: - [module:torrent]torrent client documentation[/module], + [module:torrent]torrent module documentation[/module], [cmd]torrent.detect[/cmd], [cmd]torrent.setClient[/cmd], [cmd]torrent.client[/cmd] */ @@ -790,13 +793,52 @@ TC_KVS_FUNCTION(clientList) $torrent.state <torrent_number> @description: Returns state of torrent (Stopped, Stalled, Seeding, Downloading) - Take a look at the [module:torrent]torrent client documentation[/module] + Take a look at the [module:torrent]torrent module documentation[/module] for more details about how it works.[br] @seealso: - [module:torrent]torrent client documentation[/module], + [module:torrent]torrent module documentation[/module] */ TC_KVS_STRINGRET_INT_FUNCTION(state, state, "torrent_number") +/* + @doc: torrent + @type: + module + @short: + Interface to the torrent clients + @title: + The torrent module + @body: + The torrent module is an interface to torrent clients. It currently supports KTorrent using dbus.[br] + It provides the following set of commands:[br] + [cmd]torrent.detect[/cmd]: Performs an autodetection of installed torrent clients[br] + [cmd]torrent.setClient[/cmd]: Sets the torrent client interface[br] + [cmd]torrent.start[/cmd]: Starts downloading of a torrent[br] + [cmd]torrent.stop[/cmd]: Stops downloading of a torrent[br] + [cmd]torrent.announce[/cmd]: Manually announces torrent to tracker[br] + [cmd]torrent.startAll[/cmd]: Starts downloading of all torrents[br] + [cmd]torrent.stopAll[/cmd]: Stops downloading of all torrents[br] + [cmd]torrent.setMaxUploadSpeed[/cmd]: Sets maximum upload speed[br] + [cmd]torrent.setMaxDownloadSpeed[/cmd]: Sets maximum download speed[br] + [cmd]torrent.setFilePriority[/cmd]: Sets the priority of a file in a torrent[br] + [br] + It provides the following set of functions:[br] + [fnc]$torrent.client[/fnc]: Returns the currently set torrent client interface[br] + [fnc]$torrent.clientList[/fnc]: Returns a list of all supported clients[br] + [fnc]$torrent.maxUploadSpeed[/fnc]: Returns maximum upload speed set in client[br] + [fnc]$torrent.maxDownloadSpeed[/fnc]: Returns maximum download speed set in client[br] + [fnc]$torrent.speedUp[/fnc]: Returns current total upload speed[br] + [fnc]$torrent.speedDown[/fnc]: Returns current total download speed[br] + [fnc]$torrent.trafficUp[/fnc]: Returns the total number of bytes uploaded[br] + [fnc]$torrent.trafficDown[/fnc]: Returns the total number of bytes downloaded[br] + [fnc]$torrent.count[/fnc]: Returns number of torrents in client[br] + [fnc]$torrent.name[/fnc]: Returns torrent name as displayed in client[br] + [fnc]$torrent.state[/fnc]: Returns state of torrent[br] + [fnc]$torrent.fileCount[/fnc]: Returns the number of files in a torrent[br] + [fnc]$torrent.fileName[/fnc]: Returns the name of a file in a torrent[br] + [fnc]$torrent.filePriority[/fnc]: Returns the priority of a file in a torrent[br] +*/ + static bool torrent_module_init(KviModule *m) { #define TC_KVS_REGCMD(__name,__stringname) KVSM_REGISTER_SIMPLE_COMMAND(m, __stringname, torrent_kvs_cmd_ ## __name) diff --git a/src/modules/url/libkviurl.cpp b/src/modules/url/libkviurl.cpp index ba01b6e31..759a03e90 100644 --- a/src/modules/url/libkviurl.cpp +++ b/src/modules/url/libkviurl.cpp @@ -589,6 +589,7 @@ void saveUrlList() QString urllist; g_pApp->getLocalKvircDirectory(urllist,KviApplication::ConfigPlugins); urllist += g_pUrlListFilename; + qDebug("%s",urllist.toUtf8().data()); QFile file; file.setFileName(urllist); file.open(QIODevice::WriteOnly); |
