← Back to team overview

cairo-dock-team team mailing list archive

[Merge] lp:~mycompostpile/cairo-dock-plug-ins-extras/YoutubeDl into lp:cairo-dock-plug-ins-extras

 

Brian has proposed merging lp:~mycompostpile/cairo-dock-plug-ins-extras/YoutubeDl into lp:cairo-dock-plug-ins-extras.

Requested reviews:
  Cairo-Dock Team (cairo-dock-team)

For more details, see:
https://code.launchpad.net/~mycompostpile/cairo-dock-plug-ins-extras/YoutubeDl/+merge/109558

Fixed urlListEdit: I had disabled tkinter (by making sure it would fail the import) while I was testing the message about not being able to edit and I forgot to re-enable it.

I had forgotten to keep the version number up to date so I updated the version number

Added the functionality for left click which brings up a dialog to add a url (if the url list is empty).  This was requested by Eduardo Mucelli on the forums.
-- 
https://code.launchpad.net/~mycompostpile/cairo-dock-plug-ins-extras/YoutubeDl/+merge/109558
Your team Cairo-Dock Team is requested to review the proposed merge of lp:~mycompostpile/cairo-dock-plug-ins-extras/YoutubeDl into lp:cairo-dock-plug-ins-extras.
=== modified file 'YoutubeDl/YoutubeDl'
--- YoutubeDl/YoutubeDl	2012-06-09 04:13:00 +0000
+++ YoutubeDl/YoutubeDl	2012-06-11 02:52:18 +0000
@@ -85,45 +85,57 @@
                 self.downloadManager.join(1)
 	
 	def on_click(self, iState):
-	    if self.useListView and (len(self.urlList) > self.urlListExceeds):
-	        endingCharacter = ';'
-            else:
-	        endingCharacter = '\n'
+	    if len(self.urlList) > 0:
+	        if self.useListView and (len(self.urlList) > self.urlListExceeds):
+	            endingCharacter = ';'
+                else:
+	            endingCharacter = '\n'
 
-            tempString = '          Current Download' + endingCharacter
-            if self.activeDownload:
-                tempString = tempString + '\n      -> '.join(self.urlList[0]) 
-                rangeStart = 1
-            else:
-                tempString = tempString + '    -> None' + endingCharacter
-                rangeStart = 0
-            tempString = tempString + '\n          Current URL List' + endingCharacter
-            if len(self.urlList) > rangeStart:
-                tempList = list()
-                for item in range(rangeStart,len(self.urlList)):
-                    tempList.append('\n      -> '.join(self.urlList[item]))
-                self.messageDebug(tempString)
-                tempString = tempString + endingCharacter.join(tempList)
-                self.messageDebug(tempString)
-            else:
-                tempString = tempString + '    -> Empty'
-                self.messageDebug(tempString)
-	    if self.useListView and (len(self.urlList) > self.urlListExceeds):
-                self.icon.PopupDialog( {"message" : "Youtube Download URL List",
-                "buttons" : "ok",  
-                "icon" : "gtk-stock-edit"},
-                {"visible" : True,
-                 "widget-type" : "list",
-                 "multi-lines" : True,
-                 "editable" : False,
-                 "values" : tempString})
-            else:
-                self.icon.PopupDialog( {"message" : tempString,
-                "icon" : "gtk-edit"},
-                {"visible" : True,
-                 "multi-lines" : True,
-                 "editable" : False, })
-            self.currentDialog = PopupTypes.infoDialog
+                tempString = '          Current Download' + endingCharacter
+                if self.activeDownload:
+                    tempString = tempString + '\n      -> '.join(self.urlList[0]) 
+                    rangeStart = 1
+                else:
+                    tempString = tempString + '    -> None' + endingCharacter
+                    rangeStart = 0
+                tempString = tempString + '\n          Current URL List' + endingCharacter
+                if len(self.urlList) > rangeStart:
+                    tempList = list()
+                    for item in range(rangeStart,len(self.urlList)):
+                        tempList.append('\n      -> '.join(self.urlList[item]))
+                    self.messageDebug(tempString)
+                    tempString = tempString + endingCharacter.join(tempList)
+                    self.messageDebug(tempString)
+                else:
+                    tempString = tempString + '    -> Empty'
+                    self.messageDebug(tempString)
+	        if self.useListView and (len(self.urlList) > self.urlListExceeds):
+                    self.icon.PopupDialog( {"message" : "Youtube Download URL List",
+                    "buttons" : "ok",  
+                    "icon" : "gtk-stock-edit"},
+                    {"visible" : True,
+                     "widget-type" : "list",
+                     "multi-lines" : True,
+                     "editable" : False,
+                     "values" : tempString})
+                else:
+                    self.icon.PopupDialog( {"message" : tempString,
+                    "icon" : "gtk-edit"},
+                    {"visible" : True,
+                     "multi-lines" : True,
+                     "editable" : False, })
+                self.currentDialog = PopupTypes.infoDialog
+            else:
+                dialog_attributes = {
+                        'message'    : "Please enter URL:",
+                        'use-markup' : True,
+                        'buttons'    : 'ok;cancel' }
+                widget_attributes = {
+                        'widget-type'   : 'text-entry',
+                        'initial-value' : "",
+                        'multi-lines'   : False}
+                self.icon.PopupDialog (dialog_attributes, widget_attributes)
+                self.currentDialog = PopupTypes.urlManualEntry
 
         def editURLs(self):
             urlEdit=urlListEditor(self.urlList).run()
@@ -363,6 +375,10 @@
                 if button == 0:
                     fileName = os.path.abspath(self.__urlList_directory + "/" + userResponse)
                     self.readTheList(fileName)
+            elif self.currentDialog == PopupTypes.urlManualEntry:
+                self.messageDebug("onAnswerDialog: URL Manual Entry: "+str(button)+" "+str(userResponse))
+                if button == 0:
+                    self.on_drop_data(userResponse)
             elif self.currentDialog == PopupTypes.infoDialog:
                 self.messageDebug("onAnswerDialog: info dialog : "+str(button)+" "+str(userResponse))
             elif self.currentDialog == PopupTypes.showUrlList:

=== modified file 'YoutubeDl/YoutubeDl.conf'
--- YoutubeDl/YoutubeDl.conf	2012-06-04 21:56:31 +0000
+++ YoutubeDl/YoutubeDl.conf	2012-06-11 02:52:18 +0000
@@ -1,4 +1,4 @@
-#!en;1.0.1
+#!en;0.0.9
 
 #[gtk-about]
 [Icon]

=== modified file 'YoutubeDl/auto-load.conf'
--- YoutubeDl/auto-load.conf	2012-05-31 00:01:58 +0000
+++ YoutubeDl/auto-load.conf	2012-06-11 02:52:18 +0000
@@ -10,7 +10,7 @@
 category = 3
 
 # Version of the applet; change it everytime you change something in the config file. Don't forget to update the version both in this file and in the config file.
-version = 0.0.5
+version = 0.0.9
 
 # Default icon to use if no icon has been defined by the user. If not specified, or if the file is not found, the "icon" file will be used.
 icon = 

=== modified file 'YoutubeDl/constantTypes.py'
--- YoutubeDl/constantTypes.py	2012-06-09 04:13:00 +0000
+++ YoutubeDl/constantTypes.py	2012-06-11 02:52:18 +0000
@@ -1,5 +1,5 @@
 class PopupTypes:
-    (infoDialog, confirmAbort, saveListFilename, getListFilename, delList, showUrlList) = range(0, 6)
+    (infoDialog, confirmAbort, saveListFilename, getListFilename, delList, showUrlList, urlManualEntry) = range(7)
 
 class menuEntries:
     (abortDownload, saveURLs, loadURLs, pauseDownload, enableDownload, clearURLs, editURLs) = range(7)

=== modified file 'YoutubeDl/urlListEdit.py'
--- YoutubeDl/urlListEdit.py	2012-06-09 04:21:38 +0000
+++ YoutubeDl/urlListEdit.py	2012-06-11 02:52:18 +0000
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
  
 try:
-    from Tkinter.junk import *
+    from Tkinter import *
     import tkFont
 
     class  urlListEditor(Frame):


Follow ups