Esempio n. 1
0
class BasePanel(Gtk.Paned):

    __gtype_name__ = 'PygiHackBasePanel'

    __gsignals__ = {
    "update": (GObject.SIGNAL_RUN_LAST,
        GObject.TYPE_NONE, (GObject.TYPE_STRING,))}

    def __init__(self):

        Gtk.Paned.__init__(self, orientation=Gtk.Orientation.VERTICAL)

        vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)

        self.base_notebook = BaseNotebook()
        self.jamedia_gstreamer = JAMediaGstreamer()

        vbox.pack_start(self.base_notebook, True, True, 0)
        vbox.pack_end(self.jamedia_gstreamer, True, True, 0)

        self.pack1(vbox, resize=True, shrink=False)

        self.terminal = Terminal()
        self.terminal.set_size_request(-1, 200)
        self.pack2(self.terminal, resize=False, shrink=False)

        self.show_all()

        self.connect("realize", self.__do_realize)

    def __do_realize(self, widget):

        self.set_accion("ver", "Terminal", False)
        self.set_accion("ver", "Apis PyGiHack", True)
        self.base_notebook.import_modulo("python-gi", "Gtk")

    def set_accion(self, menu, wid_lab, valor):

        if menu == "ver":
            if wid_lab == "Terminal":
                if valor == True:
                    self.terminal.show()
                elif valor == False:
                    self.terminal.hide()

            elif wid_lab == "Gstreamer - Inspect 1.0":
                self.base_notebook.hide()
                self.jamedia_gstreamer.show()

            elif wid_lab == "Apis PyGiHack":
                self.jamedia_gstreamer.hide()
                self.base_notebook.show()

            self.emit("update", wid_lab)

    def import_modulo(self, paquete, modulo):

        self.base_notebook.import_modulo(paquete, modulo)
class BasePanel(Gtk.Paned):

    __gtype_name__ = 'PygiHackBasePanel'

    __gsignals__ = {
        "update":
        (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, (GObject.TYPE_STRING, ))
    }

    def __init__(self):

        Gtk.Paned.__init__(self, orientation=Gtk.Orientation.VERTICAL)

        vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)

        self.base_notebook = BaseNotebook()
        self.jamedia_gstreamer = JAMediaGstreamer()

        vbox.pack_start(self.base_notebook, True, True, 0)
        vbox.pack_end(self.jamedia_gstreamer, True, True, 0)

        self.pack1(vbox, resize=True, shrink=False)

        self.terminal = Terminal()
        self.terminal.set_size_request(-1, 200)
        self.pack2(self.terminal, resize=False, shrink=False)

        self.show_all()

        self.connect("realize", self.__do_realize)

    def __do_realize(self, widget):
        self.set_accion("ver", "Terminal", False)
        self.set_accion("ver", "Apis PyGiHack", True)
        self.base_notebook.import_modulo("python-gi", "Gtk")

    def set_accion(self, menu, wid_lab, valor):
        if menu == "ver":
            if wid_lab == "Terminal":
                if valor == True:
                    self.terminal.show()
                elif valor == False:
                    self.terminal.hide()

            elif wid_lab == "Gstreamer - Inspect 1.0":
                self.base_notebook.hide()
                self.jamedia_gstreamer.show()

            elif wid_lab == "Apis PyGiHack":
                self.jamedia_gstreamer.hide()
                self.base_notebook.show()

            self.emit("update", wid_lab)

    def import_modulo(self, paquete, modulo):
        self.base_notebook.import_modulo(paquete, modulo)
    def __init__(self):

        Gtk.Paned.__init__(self, orientation=Gtk.Orientation.VERTICAL)

        vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)

        self.base_notebook = BaseNotebook()
        self.jamedia_gstreamer = JAMediaGstreamer()

        vbox.pack_start(self.base_notebook, True, True, 0)
        vbox.pack_end(self.jamedia_gstreamer, True, True, 0)

        self.pack1(vbox, resize=True, shrink=False)

        self.terminal = Terminal()
        self.terminal.set_size_request(-1, 200)
        self.pack2(self.terminal, resize=False, shrink=False)

        self.show_all()

        self.connect("realize", self.__do_realize)
Esempio n. 4
0
 def set_accion(self, menu, wid_lab, valor):
     if menu == "ver":
         if wid_lab == "Gstreamer - Inspect 1.0":
             if self.base_notebook:
                 self.base_notebook.hide()
                 print "FIXME: preguntar al usuario si mata el widget", self.set_accion
             if not self.jamedia_gstreamer:
                 self.jamedia_gstreamer = JAMediaGstreamer()
                 self.pack_end(self.jamedia_gstreamer, True, True, 0)
             self.jamedia_gstreamer.show()
         elif wid_lab == "Apis PyGiHack":
             if self.jamedia_gstreamer:
                 self.jamedia_gstreamer.hide()
                 print "FIXME: preguntar al usuario si mata el widget", self.set_accion
             if not self.base_notebook:
                 self.base_notebook = BaseNotebook()
                 self.pack_start(self.base_notebook, True, True, 0)
                 self.base_notebook.connect("nobusquedas",
                                            self.__re_emit_nobusquedas)
                 self.base_notebook.connect('abrir', self.__open_file)
             self.base_notebook.show()
         self.emit("update", wid_lab)
Esempio n. 5
0
    def __init__(self):

        Gtk.Paned.__init__(self, orientation=Gtk.Orientation.VERTICAL)

        vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)

        self.base_notebook = BaseNotebook()
        self.jamedia_gstreamer = JAMediaGstreamer()

        vbox.pack_start(self.base_notebook, True, True, 0)
        vbox.pack_end(self.jamedia_gstreamer, True, True, 0)

        self.pack1(vbox, resize=True, shrink=False)

        self.terminal = Terminal()
        self.terminal.set_size_request(-1, 200)
        self.pack2(self.terminal, resize=False, shrink=False)

        self.show_all()

        self.connect("realize", self.__do_realize)
Esempio n. 6
0
 def set_accion(self, menu, wid_lab, valor):
     if menu == "ver":
         if wid_lab == "Gstreamer - Inspect 1.0":
             if self.base_notebook:
                 self.base_notebook.hide()
                 print "FIXME: preguntar al usuario si mata el widget", self.set_accion
             if not self.jamedia_gstreamer:
                 self.jamedia_gstreamer = JAMediaGstreamer()
                 self.pack_end(self.jamedia_gstreamer, True, True, 0)
             self.jamedia_gstreamer.show()
         elif wid_lab == "Apis PyGiHack":
             if self.jamedia_gstreamer:
                 self.jamedia_gstreamer.hide()
                 print "FIXME: preguntar al usuario si mata el widget", self.set_accion
             if not self.base_notebook:
                 self.base_notebook = BaseNotebook()
                 self.pack_start(self.base_notebook, True, True, 0)
                 self.base_notebook.connect("nobusquedas",
                     self.__re_emit_nobusquedas)
                 self.base_notebook.connect('abrir', self.__open_file)
             self.base_notebook.show()
         self.emit("update", wid_lab)
Esempio n. 7
0
class BaseBox(Gtk.Box):

    __gsignals__ = {
    "update": (GObject.SIGNAL_RUN_LAST,
        GObject.TYPE_NONE, (GObject.TYPE_STRING,)),
    "nobusquedas": (GObject.SIGNAL_RUN_LAST,
        GObject.TYPE_NONE, []),
    "abrir": (GObject.SIGNAL_RUN_LAST,
        GObject.TYPE_NONE, (GObject.TYPE_STRING,))}

    def __init__(self):

        Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL)

        self.base_notebook = False
        self.jamedia_gstreamer = False
        self.show_all()

    def __re_emit_nobusquedas(self, widget):
        self.emit("nobusquedas")

    def set_accion(self, menu, wid_lab, valor):
        if menu == "ver":
            if wid_lab == "Gstreamer - Inspect 1.0":
                if self.base_notebook:
                    self.base_notebook.hide()
                    print "FIXME: preguntar al usuario si mata el widget", self.set_accion
                if not self.jamedia_gstreamer:
                    self.jamedia_gstreamer = JAMediaGstreamer()
                    self.pack_end(self.jamedia_gstreamer, True, True, 0)
                self.jamedia_gstreamer.show()
            elif wid_lab == "Apis PyGiHack":
                if self.jamedia_gstreamer:
                    self.jamedia_gstreamer.hide()
                    print "FIXME: preguntar al usuario si mata el widget", self.set_accion
                if not self.base_notebook:
                    self.base_notebook = BaseNotebook()
                    self.pack_start(self.base_notebook, True, True, 0)
                    self.base_notebook.connect("nobusquedas",
                        self.__re_emit_nobusquedas)
                    self.base_notebook.connect('abrir', self.__open_file)
                self.base_notebook.show()
            self.emit("update", wid_lab)

    def __open_file(self, widget, modulo_path):
        self.emit("abrir", modulo_path)

    def import_modulo(self, paquete, modulo):
        self.set_accion("ver", "Apis PyGiHack", True)
        self.base_notebook.import_modulo(paquete, modulo)

    def buscar_mas(self, accion, texto):
        if self.base_notebook:
            if self.base_notebook.get_visible():
                self.base_notebook.buscar_mas(accion, texto)
        if self.jamedia_gstreamer:
            if self.jamedia_gstreamer.get_visible():
                self.jamedia_gstreamer.buscar_mas(accion, texto)

    def check_busquedas(self):
        return self.jamedia_gstreamer or self.base_notebook

    def zoom(self, zoom):
        if self.base_notebook:
            if self.base_notebook.get_visible():
                self.base_notebook.zoom(zoom)
        if self.jamedia_gstreamer:
            if self.jamedia_gstreamer.get_visible():
                self.jamedia_gstreamer.zoom(zoom)

    def get_estructura(self):
        if self.base_notebook:
            if self.base_notebook.get_visible():
                return self.base_notebook.get_estructura()
        if self.jamedia_gstreamer:
            if self.jamedia_gstreamer.get_visible():
                return self.jamedia_gstreamer.get_estructura()
        return ""
Esempio n. 8
0
class BaseBox(Gtk.Box):

    __gsignals__ = {
        "update":
        (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, (GObject.TYPE_STRING, )),
        "nobusquedas": (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, []),
        "abrir":
        (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, (GObject.TYPE_STRING, ))
    }

    def __init__(self):

        Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL)

        self.base_notebook = False
        self.jamedia_gstreamer = False
        self.show_all()

    def __re_emit_nobusquedas(self, widget):
        self.emit("nobusquedas")

    def set_accion(self, menu, wid_lab, valor):
        if menu == "ver":
            if wid_lab == "Gstreamer - Inspect 1.0":
                if self.base_notebook:
                    self.base_notebook.hide()
                    print "FIXME: preguntar al usuario si mata el widget", self.set_accion
                if not self.jamedia_gstreamer:
                    self.jamedia_gstreamer = JAMediaGstreamer()
                    self.pack_end(self.jamedia_gstreamer, True, True, 0)
                self.jamedia_gstreamer.show()
            elif wid_lab == "Apis PyGiHack":
                if self.jamedia_gstreamer:
                    self.jamedia_gstreamer.hide()
                    print "FIXME: preguntar al usuario si mata el widget", self.set_accion
                if not self.base_notebook:
                    self.base_notebook = BaseNotebook()
                    self.pack_start(self.base_notebook, True, True, 0)
                    self.base_notebook.connect("nobusquedas",
                                               self.__re_emit_nobusquedas)
                    self.base_notebook.connect('abrir', self.__open_file)
                self.base_notebook.show()
            self.emit("update", wid_lab)

    def __open_file(self, widget, modulo_path):
        self.emit("abrir", modulo_path)

    def import_modulo(self, paquete, modulo):
        self.set_accion("ver", "Apis PyGiHack", True)
        self.base_notebook.import_modulo(paquete, modulo)

    def buscar_mas(self, accion, texto):
        if self.base_notebook:
            if self.base_notebook.get_visible():
                self.base_notebook.buscar_mas(accion, texto)
        if self.jamedia_gstreamer:
            if self.jamedia_gstreamer.get_visible():
                self.jamedia_gstreamer.buscar_mas(accion, texto)

    def check_busquedas(self):
        return self.jamedia_gstreamer or self.base_notebook

    def zoom(self, zoom):
        if self.base_notebook:
            if self.base_notebook.get_visible():
                self.base_notebook.zoom(zoom)
        if self.jamedia_gstreamer:
            if self.jamedia_gstreamer.get_visible():
                self.jamedia_gstreamer.zoom(zoom)

    def get_estructura(self):
        if self.base_notebook:
            if self.base_notebook.get_visible():
                return self.base_notebook.get_estructura()
        if self.jamedia_gstreamer:
            if self.jamedia_gstreamer.get_visible():
                return self.jamedia_gstreamer.get_estructura()
        return ""