summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2009-12-27 22:16:51 +0100
committerGravatar mkaay <mkaay@mkaay.de> 2009-12-27 22:16:51 +0100
commit090c9d2abdac07025fe6d7351e376e85aabc0891 (patch)
tree8177a488a95cc977bab10b66caa2d4b738a18d20 /module
parentcloses #51 (diff)
downloadpyload-090c9d2abdac07025fe6d7351e376e85aabc0891.tar.xz
fixed uploaded.to and netload.in, gui clipboard check
Diffstat (limited to 'module')
-rw-r--r--module/file_list.py8
-rw-r--r--module/gui/MainWindow.py35
-rw-r--r--module/gui/connector.py1
-rw-r--r--module/plugins/hoster/NetloadIn.py2
-rw-r--r--module/plugins/hoster/UploadedTo.py4
5 files changed, 43 insertions, 7 deletions
diff --git a/module/file_list.py b/module/file_list.py
index bb04ae898..d80310cdd 100644
--- a/module/file_list.py
+++ b/module/file_list.py
@@ -365,6 +365,14 @@ class File_List(object):
pyfile.status.type = None
finally:
packager.file_list.lock.release()
+
+ def abortFile(packager, fileid):
+ packager.file_list.lock.acquire()
+ try:
+ key, n, pyfile, pypack, pid = packager._getFileFromID(fileid)
+ pyfile.plugin.req.abort = True
+ finally:
+ packager.file_list.lock.release()
#oooops, duplicate?
def removeFileFromPackage(packager, id, pid):
diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py
index 06df7447c..1e769110b 100644
--- a/module/gui/MainWindow.py
+++ b/module/gui/MainWindow.py
@@ -121,9 +121,12 @@ class MainWindow(QMainWindow):
self.actions["status_stop"] = self.toolbar.addAction(QIcon("icons/gui/toolbar_stop.png"), "Stop")
self.toolbar.addSeparator()
self.actions["add"] = self.toolbar.addAction(QIcon("icons/gui/toolbar_add.png"), "Add")
- #self.toolbar.addAction(QIcon("icons/gui/toolbar_remove.png"), "Remove")
+ self.toolbar.addSeparator()
+ self.actions["clipboard"] = self.toolbar.addAction(QIcon("icons/gui/clipboard.png"), "Check Clipboard")
+ self.actions["clipboard"].setCheckable(True)
self.connect(self.actions["toggle_status"], SIGNAL("toggled(bool)"), self.slotToggleStatus)
+ self.connect(self.actions["clipboard"], SIGNAL("toggled(bool)"), self.slotToggleClipboard)
self.connect(self.actions["status_stop"], SIGNAL("triggered()"), self.slotStatusStop)
self.addMenu = QMenu()
packageAction = self.addMenu.addAction("Package")
@@ -185,6 +188,8 @@ class MainWindow(QMainWindow):
"""
create context menus
"""
+ self.activeMenu = None
+ #queue
self.queueContext = QMenu()
self.queueContext.buttons = {}
self.queueContext.item = (None, None)
@@ -194,6 +199,14 @@ class MainWindow(QMainWindow):
self.queueContext.addAction(self.queueContext.buttons["restart"])
self.connect(self.queueContext.buttons["remove"], SIGNAL("triggered()"), self.slotRemoveDownload)
self.connect(self.queueContext.buttons["restart"], SIGNAL("triggered()"), self.slotRestartDownload)
+
+ #package collector
+ self.packageCollectorContext = QMenu()
+ self.packageCollectorContext.buttons = {}
+ self.packageCollectorContext.item = (None, None)
+ self.packageCollectorContext.buttons["remove"] = QAction(QIcon("icons/gui/remove_small.png"), "Remove", self.packageCollectorContext)
+ self.packageCollectorContext.addAction(self.packageCollectorContext.buttons["remove"])
+ self.connect(self.packageCollectorContext.buttons["remove"], SIGNAL("triggered()"), self.slotRemoveDownload)
def slotToggleStatus(self, status):
"""
@@ -317,13 +330,23 @@ class MainWindow(QMainWindow):
self.queueContext.item = (i.data(0, Qt.UserRole).toPyObject(), i.parent() == None)
menuPos = QCursor.pos()
menuPos.setX(menuPos.x()+2)
+ self.activeMenu = self.queueContext
self.queueContext.exec_(menuPos)
def slotPackageCollectorContextMenu(self, pos):
"""
custom context menu in package collector view requested
"""
- pass
+ globalPos = self.tabs["collector"]["package_view"].mapToGlobal(pos)
+ i = self.tabs["collector"]["package_view"].itemAt(pos)
+ if not i:
+ return
+ i.setSelected(True)
+ self.packageCollectorContext.item = (i.data(0, Qt.UserRole).toPyObject(), i.parent() == None)
+ menuPos = QCursor.pos()
+ menuPos.setX(menuPos.x()+2)
+ self.activeMenu = self.packageCollectorContext
+ self.packageCollectorContext.exec_(menuPos)
def slotLinkCollectorContextMenu(self, pos):
"""
@@ -343,7 +366,13 @@ class MainWindow(QMainWindow):
"""
remove download action is triggered
"""
- id, isTopLevel = self.queueContext.item
+ id, isTopLevel = self.activeMenu.item
if not id == None:
self.emit(SIGNAL("removeDownload"), id, isTopLevel)
+
+ def slotToggleClipboard(self, status):
+ """
+ check clipboard (toolbar)
+ """
+ self.emit(SIGNAL("setClipboardStatus"), status)
diff --git a/module/gui/connector.py b/module/gui/connector.py
index 8458d74b9..3f594d68e 100644
--- a/module/gui/connector.py
+++ b/module/gui/connector.py
@@ -335,6 +335,7 @@ class connector(QThread):
"""
self.mutex.lock()
try:
+ self.proxy.pause_server()
self.proxy.stop_downloads()
except Exception, e:
self.emit(SIGNAL("proxy_error"), "stopAllDownloads", e)
diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py
index bc755fb58..dc639df45 100644
--- a/module/plugins/hoster/NetloadIn.py
+++ b/module/plugins/hoster/NetloadIn.py
@@ -64,7 +64,7 @@ class NetloadIn(Plugin):
def download_api_data(self):
url = self.parent.url
- id_regex = re.compile("http://netload.in/datei(.*?)(?:\.htm|/)")
+ id_regex = re.compile("http://.*netload.in/datei(.*?)(?:\.htm|/)")
match = id_regex.search(url)
if match:
apiurl = "http://netload.in/share/fileinfos2.php"
diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py
index bb623b4e6..0d487be46 100644
--- a/module/plugins/hoster/UploadedTo.py
+++ b/module/plugins/hoster/UploadedTo.py
@@ -84,9 +84,6 @@ class UploadedTo(Plugin):
self.api_data["checksum"] = lines[2] #sha1
def download_html(self):
- if self.config['premium']:
- self.config['username'], self.config['password']
- self.req.load("http://uploaded.to/login", None, { "email" : self.config['username'], "password" : self.config['password']})
url = self.parent.url
self.html = self.req.load(url, cookies=False)
@@ -131,6 +128,7 @@ class UploadedTo(Plugin):
def proceed(self, url, location):
if self.config['premium']:
+ self.req.load("http://uploaded.to/login", None, { "email" : self.config['username'], "password" : self.config['password']}, cookies=True)
self.req.download(url, location, cookies=True)
else:
self.req.download(url, location, cookies=False, post={"download_submit": "Free Download"})