[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/network/kmldonkey
From:       Gioacchino Mazzurco <gioxmx () libero ! it>
Date:       2009-05-28 15:05:48
Message-ID: 1243523148.825718.27034.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 974137 by gmazzurco:

understood how to get correct local ip fro donkeysocket
added submit_torrent action and menuitem
undestood how to submit url after created http server that host file
TODO: implement a little http server that host the torrent file


 M  +18 -16    kmldonkey/kmldonkey.cpp  
 M  +2 -0      kmldonkey/kmldonkey.h  
 M  +1 -0      kmldonkey/kmldonkeyui.rc  
 M  +1 -0      libkmldonkey/donkeyprotocol.cpp  
 M  +4 -144    libkmldonkey/donkeyprotocol.h  
 M  +1 -0      libkmldonkey/donkeysocket.cpp  
 M  +1 -0      libkmldonkey/donkeysocket.h  
 D             libkmldonkey/localtorrent.cpp  


--- trunk/extragear/network/kmldonkey/kmldonkey/kmldonkey.cpp #974136:974137
@@ -381,12 +381,19 @@
     connect(action, SIGNAL(triggered()), this, SLOT(actionSubmitUrl()));
     addCoreAction(action);
 
+
     action = new KAction(KIcon("document-open"), i18n("Submit Collection File..."), \
this);  action->setIconText(i18n("Collection"));
     actionCollection()->addAction("submit_collection", action);
     connect(action, SIGNAL(triggered()), this, SLOT(actionSubmitCollection()));
     addCoreAction(action);
 
+    action = new KAction(KIcon("document-open"), i18n("Submit Torrent File..."), \
this); +    action->setIconText(i18n("Torrent"));
+    actionCollection()->addAction("submit_torrent", action);
+    connect(action, SIGNAL(triggered()), this, SLOT(actionSubmitTorrent()));
+    addCoreAction(action);
+
     action = new KAction(KIcon("mldonkey"), i18n("Configure MLDonkey..."), this);
     actionCollection()->addAction("configure_mldonkey", action);
     connect(action, SIGNAL(triggered()), this, SLOT(optionsConfigureMLDonkey()));
@@ -675,30 +682,25 @@
     }
     else KMessageBox::error(this, i18n("Failed to open collection file %1.", url));
     
+}
 
+void KMLDonkey::actionSubmitTorrent(){
 
-/*
+    QString url = KFileDialog::getOpenFileName(KUrl("kfiledialog:///KMLDonkeySubmitTorrent"), \
QString("*.torrent\n*"), this, i18n("Open Torrent File")); +    if (url.isEmpty()) \
return; +    
+    
     QFile f(url);
-    if (! f.open(QIODevice::ReadOnly | QIODevice::Text)) {
-        KMessageBox::error(this, i18n("Failed to open collection file %1.", url));
+    if (! f.open(QIODevice::ReadOnly)){
+        KMessageBox::error(this, i18n("Failed to open torrent file %1.", url));
         return;
     }
-    QStringList urls;
-    while (! f.atEnd()) {
-         QByteArray line = f.readLine().trimmed();
-         if (line.indexOf("//") >= 0) //skip invalid lines
-            urls << line;
-    }
+
     f.close();
-
-    SubmitDialog *dlg = findChild<SubmitDialog*>();
-    if (! dlg)
-        dlg = new SubmitDialog(this);
-    dlg->show();
-    dlg->setText(urls.join("\n"));
-*/
+    
 }
 
+
 bool KMLDonkey::queryClose()
 {
     if (closeToTrayIcon && QObject::sender() == 0) {
--- trunk/extragear/network/kmldonkey/kmldonkey/kmldonkey.h #974136:974137
@@ -5,6 +5,7 @@
  * Copyright (C) 2003 Petter Stokke <ummo@hellokitty.com>
  * Copyright (C) 2003,2004,2007 Sebastian Sauer <mail@dipe.org>
  * Copyright (C) 2006 Christian Muehlhaeuser <chris@chris.de>
+ * Copyright (C) 2009 Gioacchino Mazzurco <gmazzurco89@gmail.com>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -154,6 +155,7 @@
         void actionKillCore();
         void actionSubmitUrl();
         void actionSubmitCollection();
+	void actionSubmitTorrent();
 
         void changeStatusbar(const QString& text);
         void changeCaption(const QString& text);
--- trunk/extragear/network/kmldonkey/kmldonkey/kmldonkeyui.rc #974136:974137
@@ -10,6 +10,7 @@
     <Separator />
     <Action name="submit_url" />
     <Action name="submit_collection" />
+    <Action name="submit_torrent" />
     <Separator />
     <Action name="quit" />
   </Menu>
--- trunk/extragear/network/kmldonkey/libkmldonkey/donkeyprotocol.cpp #974136:974137
@@ -5,6 +5,7 @@
  * Copyright (C) 2003 Petter Stokke <ummo@hellokitty.com>
  * Copyright (C) 2003 Sebastian Sauer <mail@dipe.org>
  * Copyright (C) 2006 Christian Muehlhaeuser <chris@chris.de>
+ * Copyright (C) 2009 Gioacchino Mazzurco <gmazzurco89@gmail.com>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
--- trunk/extragear/network/kmldonkey/libkmldonkey/donkeyprotocol.h #974136:974137
@@ -5,6 +5,7 @@
  * Copyright (C) 2003 Petter Stokke <ummo@hellokitty.com>
  * Copyright (C) 2003 Sebastian Sauer <mail@dipe.org>
  * Copyright (C) 2006 Christian Muehlhaeuser <chris@chris.de>
+ * Copyright (C) 2009 Gioacchino Mazzurco <gmazzurco89@gmail.com>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -141,70 +142,6 @@
         Pending,
         Search,
         Version // this is new
-
-	/*TODO: update to last GUIprotocol (v41 ) from core version
-	CoreProtocol,
-	Options_info,
-
-	DefineSearches,
-	Result_info,
-	Search_result,
-	Search_waiting,
-
-	File_info,
-	File_downloaded,
-	File_add_source,
-	File_update_availability,
-	File_remove_source,
-
-	Server_busy,
-	Server_user,
-	Server_state,
-	Server_info,
-
-	Client_info,
-	Client_state,
-	Client_friend,
-	Client_file,
-
-	Console,
-
-	Network_info,
-	User_info,
-
-	Room_info,
-	Room_message,
-	Room_add_user,
-
-	Client_stats,
-
-	ConnectedServers,
-	DownloadFiles,
-	DownloadedFiles,
-	MessageFromClient,
-
-	Room_remove_user,
-	Shared_file_info,
-	Shared_file_upload,
-	Shared_file_unshared,
-
-	Add_section_option,
-
-	Add_plugin_option,
-
-	BadPassword,
-
-	CleanTables,
-	Uploaders,
-	Pending,
-	Search,
-	Version,
-
-	GiftServerAttach,
-	GiftServerStats,
-	Stats,
-
-	*/
     };
 
     //! Opcodes from GUI messages.
@@ -278,83 +215,6 @@
         ServerRename,
         ServerSetPreferred
 
-	/*TODO: update to last GUIprotocol(v41) from GUI version
-	GuiProtocol _ -> "GuiProtocol"
-	ConnectMore_query -> "ConnectMore_query"
-	CleanOldServers -> "CleanOldServers"
-	KillServer -> "KillServer"
-	ExtendedSearch _ -> "ExtendedSearch"
-	Password _ -> "Password"
-	Search_query _ -> "Search_query"
-	Download_query _ -> "Download_query"
-	Url _ -> "Url"
-	RemoveServer_query _ -> "RemoveServer_query"
-	SaveOptions_query _ -> "SaveOptions_query"
-	RemoveDownload_query _ -> "RemoveDownload_query"
-	ServerUsers_query _ -> "ServerUsers_query"
-	SaveFile _ -> "SaveFile"
-	AddClientFriend _ -> "AddClientFriend"
-	AddUserFriend _ -> "AddUserFriend"
-	RemoveFriend _ -> "RemoveFriend"
-	RemoveAllFriends -> "RemoveAllFriends"
-	FindFriend _ -> "FindFriend"
-	ViewUsers _ -> "ViewUsers"
-	ConnectAll _ -> "ConnectAll"
-	ConnectServer _ -> "ConnectServer"
-	DisconnectServer _ -> "DisconnectServer"
-	SwitchDownload _ -> "SwitchDownload"
-	VerifyAllChunks _ -> "VerifyAllChunks"
-	QueryFormat _ -> "QueryFormat"
-	ModifyMp3Tags _ -> "ModifyMp"
-	CloseSearch _ -> "CloseSearch"
-	SetOption _ -> "SetOption"
-	Command _ -> "Command"
-	Preview _ -> "Preview"
-	ConnectFriend _ -> "ConnectFriend"
-	GetServer_users _ -> "GetServer_users"
-	GetClient_files _ -> "GetClient_files"
-	GetFile_locations _ -> "GetFile_locations"
-	GetServer_info _ -> "GetServer_info"
-	GetClient_info _ -> "GetClient_info"
-	GetFile_info _ -> "GetFile_info"
-	GetUser_info n -> Printf.sprintf "GetUser_info %d" n
-	SendMessage _ -> "SendMessage"
-	EnableNetwork _ -> "EnableNetwork"
-	BrowseUser _ -> "BrowseUser"
-
-	MessageToClient _ -> "MessageToClient"
-	GuiExtensions _ -> "GuiExtensions"
-	GetConnectedServers -> "GetConnectedServers"
-	GetDownloadFiles -> "GetDownloadFiles"
-	GetDownloadedFiles -> "GetDownloadedFiles"
-	SetRoomState _ -> "CloseRoom"
-
-	RefreshUploadStats -> "RefreshUploadStats"
-	SetFilePriority _ -> "SetFilePriority"      
-	AddServer_query _ -> "AddServer_query"
-
-	MessageVersions _ -> "MessageVersions"
-
-	RenameFile _ -> "RenameFile"
-	GetUploaders -> "GetUploaders"
-	GetPending -> "GetPending"
-	GetSearches -> "GetSearches"
-	GetSearch _ -> "GetSearch"
-
-	ConnectClient _ -> "ConnectClient"
-	DisconnectClient _ -> "DisconnectClient"
-	NetworkMessage _ -> "NetworkMessage"
-
-	GiftAttach _ -> "GiftAttach"
-	GiftStats -> "GiftStats"
-
-	InterestedInSources _ -> "InterestedInSources"
-	GetVersion -> "GetVersion"
-
-	ServerRename _ -> "ServerRename"
-	ServerSetPreferred _ -> "ServerSetPreferred"
-	GetStats _ -> "GetStats"
-	*/
     };
 
     //! Search types.
@@ -639,10 +499,10 @@
      */
     void previewFile(int fileno);
 
-    //! Submit an ed2k URL for downloading.
+    //! Submit an URL for downloading.
     /*!
-     * Submit an ed2k URL to the core for downloading.
-     * \param url The ed2k URL to download.
+     * Submit an URL to the core for downloading.
+     * \param url The URL to download.
      */
     void submitUrl(const QString& url);
 
--- trunk/extragear/network/kmldonkey/libkmldonkey/donkeysocket.cpp #974136:974137
@@ -3,6 +3,7 @@
  * donkeysocket.cpp
  *
  * Copyright (C) 2003 Petter Stokke <ummo@hellokitty.com>
+ * Copyright (C) 2009 Gioacchino Mazzurco <gmazzurco89@gmail.com>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
--- trunk/extragear/network/kmldonkey/libkmldonkey/donkeysocket.h #974136:974137
@@ -3,6 +3,7 @@
  * donkeysocket.h
  *
  * Copyright (C) 2003 Petter Stokke <ummo@hellokitty.com>
+ * Copyright (C) 2009 Gioacchino Mazzurco <gmazzurco89@gmail.com>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic