def on_import_container(self, widget=None): #import_links (importar contenedor)
        """"""
        
        openfile = FileChooserDialog(title=_("Open File"), parent=self.__parent, action=gtk.FILE_CHOOSER_ACTION_OPEN,
                                                        buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OPEN, gtk.RESPONSE_OK))
        openfile.set_default_response(gtk.RESPONSE_OK)
        
        filter = gtk.FileFilter()
        filter.set_name("OCH Files")
        filter.add_pattern("*.och")
        openfile.add_filter(filter)
        
        response = openfile.run()
        if response == gtk.RESPONSE_OK:
            #.decode(sys.getfilesystemencoding())
            fileh = openfile.get_filename().decode("utf-8") if response == gtk.RESPONSE_OK else None #ruta + nombre de archivo seleccionado
            logger.info("File opened: {0}".format(openfile.get_filename().decode(sys.getfilesystemencoding())))

            if fileh:
                container = Container(fileh)
                container.extract_links()
                links_list = container.get_linklist()
                
                if links_list:
                    self.checking_links(links_list, copy_link=False)
                
                #SaveFiles(linklist, self.download_manager, self.list_gui) #instancia de clase. SaveFiles(lista, clase, clase)
        openfile.destroy()
 def save_folder(self, widget):
     """
     Cuadro de dialogo para elegir donde se quiere guardar lo descargado.
     """
     openfolder = FileChooserDialog(title=_("Open Folder"), parent=self.__parent, action=gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER,
                                                     buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OK, gtk.RESPONSE_OK))
     openfolder.set_default_response(gtk.RESPONSE_OK)
     
     response = openfolder.run()
     
     if response == gtk.RESPONSE_OK:
         self.entry.set_text(openfolder.get_filename().decode("utf-8")) #.decode(sys.getfilesystemencoding())) #("utf-8"))
         
     openfolder.destroy()
    def save_folder(self, widget):
        """
        Cuadro de dialogo para elegir donde se quiere guardar lo descargado.
        """
        openfolder = FileChooserDialog(
            title=_("Open Folder"),
            parent=self.__parent,
            action=gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER,
            buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OK,
                     gtk.RESPONSE_OK))
        openfolder.set_default_response(gtk.RESPONSE_OK)

        response = openfolder.run()

        if response == gtk.RESPONSE_OK:
            self.entry.set_text(openfolder.get_filename().decode(
                "utf-8"))  #.decode(sys.getfilesystemencoding())) #("utf-8"))

        openfolder.destroy()
    def on_import_container(self,
                            widget=None):  #import_links (importar contenedor)
        """"""

        openfile = FileChooserDialog(title=_("Open File"),
                                     parent=self.__parent,
                                     action=gtk.FILE_CHOOSER_ACTION_OPEN,
                                     buttons=(gtk.STOCK_CANCEL,
                                              gtk.RESPONSE_CANCEL,
                                              gtk.STOCK_OPEN, gtk.RESPONSE_OK))
        openfile.set_default_response(gtk.RESPONSE_OK)

        filter = gtk.FileFilter()
        filter.set_name("OCH Files")
        filter.add_pattern("*.och")
        openfile.add_filter(filter)

        response = openfile.run()
        if response == gtk.RESPONSE_OK:
            #.decode(sys.getfilesystemencoding())
            fileh = openfile.get_filename().decode(
                "utf-8"
            ) if response == gtk.RESPONSE_OK else None  #ruta + nombre de archivo seleccionado
            logger.info("File opened: {0}".format(
                openfile.get_filename().decode(sys.getfilesystemencoding())))

            if fileh:
                container = Container(fileh)
                container.extract_links()
                links_list = container.get_linklist()

                if links_list:
                    self.checking_links(links_list, copy_link=False)

                #SaveFiles(linklist, self.download_manager, self.list_gui) #instancia de clase. SaveFiles(lista, clase, clase)
        openfile.destroy()