Ejemplo n.º 1
0
    def __init__(self, session=None, campo_retorno=None):
        if session is None:
            self.session = Entidades.Init.Session()
        else:
            self.session = session

        self.handlers = {
            'search_volumen': self.search_volumen,
            'search_editorial': self.search_editorial,
            'click_lookup_editorial': self.click_lookup_editorial,
            'seleccion_volumen': self.seleccion_volumen,
            'click_boton_aceptar': self.click_boton_aceptar,
            'gtk_tree_view_volumen_double_click':
            self.gtk_tree_view_volumen_double_click,
            'combobox_change': self.combobox_change,
            'foco_busquedas': self.foco_busquedas
        }
        self.builder = Gtk.Builder()
        self.builder.add_from_file("../Glade_files/Volumen_lookup_gtk.glade")
        self.builder.connect_signals(self.handlers)
        self.window = self.builder.get_object("Volumen_lookup_gtk")
        self.window.set_icon_from_file('../iconos/BabelComic.png')
        self.search_entry_editorial = self.builder.get_object(
            "search_entry_editorial")
        self.imagen_cover_volumen = self.builder.get_object(
            "imagen_cover_volumen")
        self.gtk_tree_view_volumen = self.builder.get_object(
            'gtk_tree_view_volumen')
        self.listmodel_volumens = self.builder.get_object("listmodel_volumens")
        self.label_nombre_editorial = self.builder.get_object(
            "label_nombre_editorial")
        self.volumens = self.session.query(Volume).all()
        self.search_entry_volumen = self.builder.get_object(
            'search_entry_volumen')
        self.search_entry_editorial = self.builder.get_object(
            'search_entry_editorial')
        self.volumens_manager = Volumens(session=self.session)
        self.volumens_manager.set_order(Volume.nombre)
        self.combobox_orden = self.builder.get_object("combobox_orden")
        self.liststore_combobox = self.builder.get_object("liststore_combobox")
        self._load_data()
        if campo_retorno is None:
            print("error campo retorno requerido")
        self.campo_retorno = campo_retorno
        self.publisher = None
        self.volume = None
Ejemplo n.º 2
0
    def __init__(self, session=None):
        if session is not None:
            self.session = session
        else:
            self.session = Entidades.Init.Session()
        self.handlers = {
            'getFirst': self.getFirst,
            'getLast': self.getLast,
            'getPrev': self.getPrev,
            'getNext': self.getNext,
            'getLast': self.getLast,
            'boton_cargar_desde_web_click': self.boton_cargar_desde_web_click,
            'click_lookup_volume': self.click_lookup_volume,
            'change_id_volume': self.change_id_volume,
            'click_nuevo': self.click_nuevo,
            'combobox_change': self.combobox_change,
            'selecion_pagina': self.selecion_pagina,
            'click_guardar': self.click_guardar,
            'evento': self.evento,
            'click_eliminar': self.click_eliminar,
            'click_derecho': self.click_derecho,
            'click_lookup_editorial': self.click_lookup_editorial,
            'pop_up_menu': self.pop_up_menu,
            'abrir_covers': self.abrir_covers
        }

        self.builder = Gtk.Builder()
        self.builder.add_from_file("../Glade_files/Volumen.glade")
        self.builder.connect_signals(self.handlers)
        self.window = self.builder.get_object("Volume_gtk")
        self.window.set_icon_from_file('../iconos/BabelComic.png')
        self.stack = self.builder.get_object("stack")
        self.lista_items = [
            self.builder.get_object("item_0"),
            self.builder.get_object("item_1")
        ]
        self.index = 0
        self.list_entry_id = [
            self.builder.get_object("entry_id"),
            self.builder.get_object("entry_id1")
        ]
        self.list_entry_nombre = [
            self.builder.get_object("entry_nombre"),
            self.builder.get_object("entry_nombre1")
        ]
        self.list_label_url = [
            self.builder.get_object("label_url"),
            self.builder.get_object("label_url1")
        ]
        print(type(self.list_entry_id[self.index]))
        self.list_label_api_url = [
            self.builder.get_object("label_api_url"),
            self.builder.get_object("label_api_url1")
        ]
        self.list_label_cover_url = [
            self.builder.get_object("label_cover_url"),
            self.builder.get_object("label_cover_url1")
        ]
        self.list_entry_id_editorial = [
            self.builder.get_object("entry_id_editorial"),
            self.builder.get_object("entry_id_editorial1")
        ]
        self.list_volumen_logo_image = [
            self.builder.get_object("volumen_logo_image"),
            self.builder.get_object("volumen_logo_image1")
        ]
        # self.volumen_logo_image = self.builder.get_object("volumen_logo_image")

        self.list_label_nombre_editorial = [
            self.builder.get_object("label_nombre_editorial"),
            self.builder.get_object("label_nombre_editorial1")
        ]
        self.list_entry_anio_inicio = [
            self.builder.get_object("entry_anio_inicio"),
            self.builder.get_object("entry_anio_inicio1")
        ]
        self.list_entry_cantidad_numeros = [
            self.builder.get_object("entry_cantidad_numeros"),
            self.builder.get_object("entry_cantidad_numeros1")
        ]
        self.list_liststore_combobox = [
            self.builder.get_object("liststore_combobox"),
            self.builder.get_object("liststore_combobox1")
        ]
        self.list_resumen_volumen = [
            self.builder.get_object("resumen_volumen"),
            self.builder.get_object("resumen_volumen1")
        ]
        self.list_liststore_comics_in_volume = [
            self.builder.get_object("liststore_comics_in_volume"),
            self.builder.get_object("liststore_comics_in_volume1")
        ]
        self.list_treeview_comics_in_volumen = [
            self.builder.get_object("treeview_comics_in_volumen"),
            self.builder.get_object("treeview_comics_in_volumen1")
        ]
        self.list_progressbar_procentaje_completado = [
            self.builder.get_object("progressbar_procentaje_completado"),
            self.builder.get_object("progressbar_procentaje_completado1")
        ]
        self.list_label_cantidad_comics_asociados = [
            self.builder.get_object("label_cantidad_comics_asociados"),
            self.builder.get_object("label_cantidad_comics_asociados1")
        ]

        self.volumens_manager = Volumens(session=self.session)
        self.volume = None
        # print(self.volume)
        # if self.volume is not None:
        #     self.loadVolume(self.volume)
        self.getFirst(None)

        # self.combobox_orden = self.builder.get_object("combobox_orden")
        self.offset = 0
        self.cantidadRegistros = self.volumens_manager.get_count()
        self.pagina_actual = 0
        self.menu = self.builder.get_object("menu")
Ejemplo n.º 3
0
 def set_volume(self, id_volume):
     self.comicbooks_manager.set_volume(id_volume=id_volume)
     volume_mamange = Volumens(session=self.session)
     volume = volume_mamange.get(id_volume)
     self.label_nombre_volumen.set_text(volume.nombre)
Ejemplo n.º 4
0
    def __init__(self, session=None, volumen_id=None):
        ImageFile.LOAD_TRUNCATED_IMAGES = True
        if session is None:
            self.session = Entidades.Init.Session()
        else:
            self.session = session
        self.volumens_manager = Volumens(session)

        #Nos posicionamos en algun volumen ya se el pasado por parametro si existo o el primero
        if volumen_id is None:
            self.volumens_manager.getFirst()
        else:
            volumen = self.volumens_manager.get(volumen_id)
            if volumen is None:
                self.volumens_manager.getFirst()

        self.load_setup()

        self.handlers = {'click_derecho': self.click_derecho,
                         'cambio_seleccion': self.cambio_seleccion,
                         'get_prev_cover': self.get_prev_cover,
                         'get_next_cover': self.get_next_cover}

        self.cataloged_pix = Pixbuf.new_from_file_at_size('../iconos/Cataloged.png', 32, 32)

        self.builder = Gtk.Builder()
        self.builder.add_from_file("../Glade_files/Comicbooks_info.glade")
        self.builder.connect_signals(self.handlers)
        self.window = self.builder.get_object("Comicbooks_info")
        self.menu = self.builder.get_object("menu")
        self.window.set_title("Comicbooks info")
        self.app_icon = Pixbuf.new_from_file_at_size('../iconos/iconoBabelComics-buuf.png', 32, 32)
        self.window.set_icon_from_file('../iconos/iconoBabelComics-buuf.png')
        self.window.set_default_icon_list([self.app_icon])
        self.iconview_Comicbooks_info = self.builder.get_object('iconview_Comicbooks_info')
        self.thread_creacion_thumnails = None
        self.lista_comics_esperando_por_thumnail=[]
        self.updating_gui = False
        self.salir_thread = False

        self.liststore = self.builder.get_object('liststore')
        self.lista_pendientes = []
        self.filtro = ''
        self.limit = self.session.query(Setup).first().cantidadComicsPorPagina
        self.offset = 0
        self.query = None
        self.comicbooks_info_manager = {}
        self.dictionary = {}
        self.cantidad_thumnails_pendiente = 0
        #self.search_change(None)

        self.iconview_Comicbooks_info.set_pixbuf_column(0)
        self.iconview_Comicbooks_info.set_text_column(1)
        self.iconview_Comicbooks_info.set_text_column(2)
        self.iconview_Comicbooks_info.set_column_spacing(-1)
        self.iconview_Comicbooks_info.set_item_padding(10)
        self.iconview_Comicbooks_info.set_item_width(1)
        self.iconview_Comicbooks_info.set_spacing(30)


        self.load_comicbooks_info()
        screen = Gdk.Screen.get_default()
        self.window.set_default_size(screen.width(), self.window.get_size()[1])