diff options
| author | 2009-06-05 11:35:22 +0200 | |
|---|---|---|
| committer | 2009-06-05 11:35:22 +0200 | |
| commit | b5c69a4e0edd3c1486570a8d72786c899109dc73 (patch) | |
| tree | 14485493961c1e83d5b8a60bc12e6b02c3e8c3d2 | |
| parent | request fix (diff) | |
| parent | added clipboard, closing #2 (diff) | |
| download | pyload-b5c69a4e0edd3c1486570a8d72786c899109dc73.tar.xz | |
merged
| -rw-r--r-- | config | 2 | ||||
| -rwxr-xr-x | pyMainGui.py | 21 | 
2 files changed, 16 insertions, 7 deletions
| @@ -1,6 +1,6 @@  [general]  #use de or en -language: en +language: de  download_folder = Downloads  link_file = links.txt  failed_file = failed_links.txt diff --git a/pyMainGui.py b/pyMainGui.py index e672575d9..a966992b2 100755 --- a/pyMainGui.py +++ b/pyMainGui.py @@ -44,6 +44,15 @@ class _Download_Dialog(sized_control.SizedDialog):          self.Fit()          self.SetMinSize(self.GetSize()) +        #Clipboard +        self.data = wx.TextDataObject() +        if wx.TheClipboard.Open(): +            wx.TheClipboard.GetData(self.data) +            for link in self.data.GetText().split('\n'): +                if link.startswith("http"): +                    self.links.write(link + "\n") +            wx.TheClipboard.Close() +  class _Upper_Panel(wx.Panel):      def __init__(self, parent):          wx.Panel.__init__(self, parent) @@ -106,7 +115,7 @@ class Pyload_Main_Gui(wx.Frame):          #   Binds          self.Bind(wx.EVT_MENU, self.exit_button_clicked, submenu_exit)          self.Bind(wx.EVT_TOOL, self.add_button_clicked, add) -	self.Bind(EVT_DATA_ARRIVED, self.onUpdate)         +        self.Bind(EVT_DATA_ARRIVED, self.onUpdate)                  self.Centre()          self.Show(True) @@ -116,19 +125,19 @@ class Pyload_Main_Gui(wx.Frame):          self.Close()      def add_button_clicked(self, event): -	#test -	self.thread.push_exec("get_downloads") +        #test +        #self.thread.push_exec("get_downloads")          adddownload = _Download_Dialog(None, -1)          result = adddownload.ShowModal()          adddownload.Destroy()      def show_links(self, links): -	for link in links: -	    wx.CallAfter(wx.MessageDialog(self, str(link), 'info', style=wx.OK).ShowModal()) +        for link in links: +            wx.CallAfter(wx.MessageDialog(self, str(link), 'info', style=wx.OK).ShowModal())      def data_arrived(self, rep): -	evt = DataArrived(obj = rep) +        evt = DataArrived(obj = rep)          wx.PostEvent(self, evt)      def onUpdate(self, data): | 
