All pastes #717936 Raw Edit

Someone

public text v1 · immutable
#717936 ·published 2007-09-27 23:53 UTC
rendered paste body
Index: Util.cpp
===================================================================
--- Util.cpp	(revision 10321)
+++ Util.cpp	(working copy)
@@ -53,6 +53,7 @@
 #include "cores/VideoRenderers/RenderManager.h"
 #endif
 #include "lib/libPython/XBPython.h"
+#include "utils/DownloadQueueManager.h"
 #include "utils/RegExp.h"
 #include "utils/AlarmClock.h"
 #include "ButtonTranslator.h"
@@ -61,6 +62,7 @@
 #include "GUIDialogMusicScan.h"
 #include "GUIDialogFileBrowser.h"
 #include "GUIDialogVideoScan.h"
+#include "GUIDialogDownloadQueue.h"
 #include "utils/fstrcmp.h"
 #include "utils/GUIInfoManager.h"
 #include "utils/trainer.h"
@@ -3327,7 +3329,8 @@
   "BackupSystemInfo",   false,  "Backup System Informations to local hdd",
   "UpdateLibrary",      true,   "Update the selected library (music or video)",
   "PageDown",           true,   "Send a page down event to the pagecontrol with given id",
-  "PageUp",             true,   "Send a page up event to the pagecontrol with given id"
+  "PageUp",             true,   "Send a page up event to the pagecontrol with given id",
+  "QueueDownload",			true,   "Download a URL, queue it if download already initiated"
 };
 
 bool CUtil::IsBuiltIn(const CStdString& execString)
@@ -3582,6 +3585,24 @@
       CLog::Log(LOGERROR, "CUtil::ExecBuiltIn, runxbe called with no arguments.");
     }
   }
+  else if (execute.Equals("queuedownload"))
+  {
+    if (!strParameterCaseIntact.IsEmpty())
+    {
+      std::vector<CStdString> params;
+      StringUtils::SplitString(strParameterCaseIntact,",",params);
+      CLog::Log(LOGERROR, params[0]);
+      CLog::Log(LOGERROR, params[1]);
+      if (params.size() < 2)
+        g_DownloadManager.RequestFile(params[0], NULL);
+      else
+        g_DownloadManager.RequestFile(params[0], params[1], NULL);
+    }
+    else
+    {
+      CLog::Log(LOGERROR, "XBMC.QueueDownload called with no arguments.");
+    }
+  }
   else if (execute.Equals("playmedia"))
   {
     if (strParameterCaseIntact.IsEmpty())