Ejemplo n.º 1
0
    def onDownload(self,event):
        print("onDownload")

        if not wx.TheClipboard.IsOpened():  # may crash, otherwise
            do = wx.TextDataObject()
            wx.TheClipboard.Open()
            success = wx.TheClipboard.GetData(do)
            wx.TheClipboard.Close()
            if success:
                link = do.GetText()
                if re.match("https?://",link):
                    mkthumb.download(self.options,self.name_reduced,link)
                    print("download done")
                    mkthumb.number(self.options,self.name_reduced)
                    mkthumb.mkthumb(self.options,self.name_reduced)
                    self.update = True

        self.duplicate(0)
        if self.update:
            self.Update()
Ejemplo n.º 2
0
    def RightClickMenu(self,event):

        #-------------------------------------------------------------------------------
        print("ThumbPanel.RightClickMenu()")
        s=""

        if event.GetId() == self.popupID_REFRESH:
            mkthumb.number(self.options,self.name_reduced)
            mkthumb.mkthumb(self.options,self.name_reduced)
            self.Update()

        elif event.GetId() == self.popupID_DUPLICATE:
            print("CHECK_DUPLICATE")
            self.duplicate()
            if self.update:
                self.Update()

        elif event.GetId() == self.popupID_DOWNLOAD:

            self.onDownload(event)