Пример #1
0
     def __init__(self, parent=None):
         if not parent:
             parent = context.get_mainwindow()
         gtk.AboutDialog.__init__(self)
         if parent:
             self.set_transient_for(parent)
         
         size=context.get_mainwindow().get_size()
         a=0.3*size[0]
         b=0.5*size[1]
         k = size[0]/1920.0
         self.set_resizable(True)
         self.set_default_size(int(0.3*size[0]),int(0.4*size[1]))
         self.set_title("About Galicaster "+__version__)
         
         #self.set_decorated(True)
         self.set_position(gtk.WIN_POS_CENTER_ON_PARENT)

         self.set_program_name(PROGRAM)
         self.set_version(__version__)
         self.set_website(WEB)
         self.set_website_label("Galicaster Website")
         self.set_authors(AUTHORS)
         self.set_documenters(DOCS)
         self.set_artists(ARTISTS)
         self.set_copyright("\n".join((COPY1,COPY2)))
         self.set_license(LICENSE)
         pixbuf = gtk.gdk.pixbuf_new_from_file(get_image_path('logo.svg')) 
         pixbuf = pixbuf.scale_simple(
              int(pixbuf.get_width()*k),
              int(pixbuf.get_height()*k),
              gtk.gdk.INTERP_BILINEAR)

         self.set_logo(pixbuf)

         #ADD TELTEK LOGO
         box=self.get_content_area()
         company_logo=gtk.Image()
         pixbuf = gtk.gdk.pixbuf_new_from_file(get_image_path('teltek.svg')) 
         pixbuf = pixbuf.scale_simple(
              int(pixbuf.get_width()*k),
              int(pixbuf.get_height()*k),
            gtk.gdk.INTERP_BILINEAR)

         company_logo.set_from_pixbuf(pixbuf)

         box.pack_end(company_logo,True,True,0)
         company_logo.show()

         #ADD THANKS
         #thanks=gtk.Button("Thanks")
         #buttons=self.get_action_area()
         #thanks.connect("clicked",self.show_thanks)
         #buttons.pack_start(thanks)
         #buttons.reorder_child(thanks,0)
         #thanks.show()

         self.run()
         self.destroy()
Пример #2
0
     def __init__(self, parent=None):
         if not parent:
             parent = context.get_mainwindow()
         Gtk.AboutDialog.__init__(self)
#         GObject.GObject.__init__(self)
         if parent:
             self.set_transient_for(parent)
         
         size=context.get_mainwindow().get_size()
         k = size[0]/1920.0
         self.set_resizable(True)
         self.set_default_size(int(0.3*size[0]),int(0.4*size[1]))
         self.set_title(_("About Galicaster {version}").format(version = __version__))
         
         strip = Header(size=size, title=_("About"))
         self.vbox.pack_start(strip, False, True, 0)
         self.vbox.reorder_child(strip,0)
         strip.show()
         self.set_type_hint(Gdk.WindowTypeHint.TOOLBAR)
         
         #self.set_decorated(True)
         self.set_position(Gtk.WindowPosition.CENTER_ON_PARENT)

         self.set_program_name(PROGRAM)
         self.set_version(__version__)
         self.set_website(WEB)
         self.set_website_label(_("Galicaster Website"))
         self.set_authors(AUTHORS)
         self.set_documenters(DOCS)
         self.set_artists(ARTISTS)
         self.set_copyright(COPY)
         self.set_license(LICENSE)
         pixbuf = GdkPixbuf.Pixbuf.new_from_file(get_image_path('logo.svg')) 
         pixbuf = pixbuf.scale_simple(
              int(pixbuf.get_width()*k),
              int(pixbuf.get_height()*k),
              GdkPixbuf.InterpType.BILINEAR)

         #self.set_logo(pixbuf)

         #ADD TELTEK LOGO
         box=self.get_content_area()
         company_logo=Gtk.Image()
         pixbuf = GdkPixbuf.Pixbuf.new_from_file(get_image_path('teltek.svg')) 
         pixbuf = pixbuf.scale_simple(
              int(pixbuf.get_width()*k),
              int(pixbuf.get_height()*k),
            GdkPixbuf.InterpType.BILINEAR)

         company_logo.set_from_pixbuf(pixbuf)

         box.pack_end(company_logo,True,True,0)
         company_logo.show()
Пример #3
0
    def __init__(self, parent=None):
        if not parent:
            parent = context.get_mainwindow()
        gtk.AboutDialog.__init__(self)
        if parent:
            self.set_transient_for(parent)

        size = context.get_mainwindow().get_size()
        k = size[0] / 1920.0
        self.set_resizable(True)
        self.set_default_size(int(0.3 * size[0]), int(0.4 * size[1]))
        self.set_title(
            _("About Galicaster {version}").format(version=__version__))

        strip = Header(size=size, title=_("About"))
        self.vbox.pack_start(strip, False, True, 0)
        self.vbox.reorder_child(strip, 0)
        strip.show()
        self.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_TOOLBAR)

        #self.set_decorated(True)
        self.set_position(gtk.WIN_POS_CENTER_ON_PARENT)

        self.set_program_name(PROGRAM)
        self.set_version(__version__)
        self.set_website(WEB)
        self.set_website_label(_("Galicaster Website"))
        self.set_authors(AUTHORS)
        self.set_documenters(DOCS)
        self.set_artists(ARTISTS)
        self.set_copyright(COPY)
        self.set_license(LICENSE)
        pixbuf = gtk.gdk.pixbuf_new_from_file(get_image_path('logo.svg'))
        pixbuf = pixbuf.scale_simple(int(pixbuf.get_width() * k),
                                     int(pixbuf.get_height() * k),
                                     gtk.gdk.INTERP_BILINEAR)

        #self.set_logo(pixbuf)

        #ADD TELTEK LOGO
        box = self.get_content_area()
        company_logo = gtk.Image()
        pixbuf = gtk.gdk.pixbuf_new_from_file(get_image_path('teltek.svg'))
        pixbuf = pixbuf.scale_simple(int(pixbuf.get_width() * k),
                                     int(pixbuf.get_height() * k),
                                     gtk.gdk.INTERP_BILINEAR)

        company_logo.set_from_pixbuf(pixbuf)

        box.pack_end(company_logo, True, True, 0)
        company_logo.show()
Пример #4
0
    def resize(self): 
        """Adapts GUI elements to the screen size"""
        size = context.get_mainwindow().get_size()
        anchura = size[0]
        k = anchura / 1920.0

        pixbuf = GdkPixbuf.Pixbuf.new_from_file(get_image_path('logo.svg'))    
        pixbuf = pixbuf.scale_simple(
            int(pixbuf.get_width()*k),
            int(pixbuf.get_height()*k),
            GdkPixbuf.InterpType.BILINEAR)
        align2 = self.builder.get_object("top_align")
        
        logo2 = self.builder.get_object("logo2")

        logo2.set_from_pixbuf(pixbuf)
        align2.set_padding(int(k*51),int(k*30),0,0)

        for name in ["previousbutton"]:
            button = self.builder.get_object(name)
            button.set_property("width-request", int(k*70) )
            button.set_property("height-request", int(k*70) )
            
            image = button.get_children()
            if type(image[0]) == Gtk.Image:
                image[0].set_pixel_size(int(k*56))
Пример #5
0
def get_icon(imgname):
    size = get_res() * 56
    pix = GdkPixbuf.Pixbuf.new_from_file_at_size(
        get_image_path("camctrl-images/" + imgname + ".svg"), size, size)
    img = Gtk.Image.new_from_pixbuf(pix)
    img.show()
    return img
Пример #6
0
    def __init__(self, dispatcher=None, size=None, logger=None):
        Gtk.Window.__init__(self, Gtk.WindowType.TOPLEVEL)
        self.logger = logger

        self.full_size = self.discover_size()  # Fullscreen size
        self.custom_size = self.full_size
        expr = '[0-9]+[\,x\:][0-9]+'  # Parse custom size
        if re.match(expr, size):
            self.custom_size = [
                int(a) for a in size.split(re.search('[,x:]', size).group())
            ]
        elif size == "auto":
            self.logger.info("Default resolution and fullscreen: " +
                             str(self.full_size))
        else:
            self.logger.warning(
                "Invalid resolution, set default. Should be 'width,height'. " +
                size)

        if self.custom_size[0] > self.full_size[0]:
            self.custom_size[0] = self.full_size[0]
            self.logger.warning(
                "Resolution Width is bigger than the monitor, set to monitor maximum"
            )

        if self.custom_size[1] > self.full_size[1]:
            self.custom_size[1] = self.full_size[1]
            self.logger.warning(
                "Resolution height is bigger than the monitor, set to monitor maximum"
            )

        self.__def_win_size__ = (self.custom_size[0], self.custom_size[1])
        self.set_size_request(self.custom_size[0], self.custom_size[1])
        #        self.resize(self.custom_size[0],self.custom_size[1])

        self.set_title(_("GaliCASTER {0}").format(__version__))
        self.set_decorated(False)
        self.set_position(Gtk.WindowPosition.CENTER)
        self.is_fullscreen = (self.custom_size == self.full_size)

        self.set_style()
        self.set_width_interval_class(self.get_size()[0])

        pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(
            get_image_path('galicaster.svg'), 48, 48)
        pixbuf = pixbuf.scale_simple(128, 128, GdkPixbuf.InterpType.BILINEAR)
        self.set_icon(pixbuf)
        self.connect('delete_event', lambda *x: self.__on_delete_event())
        self.dispatcher = dispatcher
        self.connect('visibility-notify-event', self.on_visibility_event)
        if self.dispatcher:
            self.dispatcher.connect('action-quit', self.close)
            self.dispatcher.connect('action-shutdown', self.shutdown)

        self.nbox = Gtk.Notebook()
        self.nbox.set_show_tabs(False)
        self.add(self.nbox)

        self.connect('key-press-event', self.on_key_press)
        self.connect('key-release-event', self.on_key_release)
Пример #7
0
    def __init__(self, size=[1920, 1080], title=None):

        wprop = size[0] / 1920.0
        hprop = size[1] / 1080.0
        gtk.VBox.__init__(self)
        box = gtk.HBox()
        box.set_border_width(int(wprop * 10))
        strip = gtk.Image()
        pixbuf = gtk.gdk.pixbuf_new_from_file(get_image_path('logo.svg'))
        pixbuf = pixbuf.scale_simple(int(pixbuf.get_width() * wprop * 0.6),
                                     int(pixbuf.get_height() * wprop * 0.6),
                                     gtk.gdk.INTERP_BILINEAR)
        strip.set_from_pixbuf(pixbuf)
        strip.set_alignment(0.05, 0.5)
        box.pack_start(strip, True, True, 0)  # introduce hprop
        strip.show()
        if title:
            label = gtk.Label(title)
            label.set_alignment(0.95, 0.5)
            font = pango.FontDescription("bold " + str(int(15) * hprop))
            label.modify_font(font)
            box.pack_end(label, True, True, 0)  # introduce hprop
        separator = gtk.HSeparator()
        self.pack_start(box, True, True, 0)
        self.pack_start(separator, True, True, 0)
        box.show_all()
        separator.show()
Пример #8
0
def init():
    global conf, logger, event_handler, jobs
    dispatcher = context.get_dispatcher()
    conf = context.get_conf()
    logger = context.get_logger()

    path = conf.get('cameracontrol', 'path')
    pysca.connect(path)
    pysca.set_zoom(1, 0)
    pysca.pan_tilt_home(1)
    dispatcher.connect('init', load_ui)
    pysca.osd_off(1)
    logger.info("Cam connected")

    icons = [
        "left", "right", "up1", "down1", "up_right", "up_left", "down_left",
        "down_right", "plus", "minus"
    ]
    icontheme = Gtk.IconTheme()
    for name in icons:
        pixbuf = GdkPixbuf.Pixbuf.new_from_file(get_image_path(name + ".svg"))
        icontheme.add_builtin_icon(name, 20, pixbuf)

    dispatcher.connect("action-key-press", on_key_press)
    dispatcher.connect("action-key-release", on_key_release)

    event_handler = Handler()
    jobs = Queue.Queue()
    t = T(jobs)
    t.setDaemon(True)
    t.start()
Пример #9
0
    def set_logos(self, gui):
        """ Set the logos of the product and the company
        """

        pixbuf = GdkPixbuf.Pixbuf.new_from_file(get_image_path('logo.svg'))
        pixbuf = pixbuf.scale_simple(int(pixbuf.get_width() * self.wprop),
                                     int(pixbuf.get_height() * self.wprop),
                                     GdkPixbuf.InterpType.BILINEAR)
        self.dialog.set_logo(pixbuf)

        teltek_logo = gui.get_object("teltek")
        pixbuf = GdkPixbuf.Pixbuf.new_from_file(get_image_path('teltek.svg'))
        pixbuf = pixbuf.scale_simple(int(pixbuf.get_width() * self.wprop),
                                     int(pixbuf.get_height() * self.wprop),
                                     GdkPixbuf.InterpType.BILINEAR)
        teltek_logo.set_from_pixbuf(pixbuf)
Пример #10
0
 def __init__(self, size=[1920,1080],title = None):
     
     wprop = size[0]/1920.0
     hprop = size[1]/1080.0
     gtk.VBox.__init__(self)
     box = gtk.HBox()
     box.set_border_width(int(wprop*10))
     strip = gtk.Image()
     pixbuf = gtk.gdk.pixbuf_new_from_file(get_image_path('logo.svg')) 
     pixbuf = pixbuf.scale_simple(
         int(pixbuf.get_width()*wprop*0.6),
         int(pixbuf.get_height()*wprop*0.6),
         gtk.gdk.INTERP_BILINEAR)
     strip.set_from_pixbuf(pixbuf)
     strip.set_alignment(0.05,0.5)
     box.pack_start(strip, True, True, 0) # introduce hprop
     strip.show()
     if title:
         label = gtk.Label(title)
         label.set_alignment(0.95,0.5)
         font = pango.FontDescription("bold "+str(int(15)*hprop))
         label.modify_font(font)
         box.pack_end(label, True, True, 0) # introduce hprop
     separator=gtk.HSeparator()
     self.pack_start(box, True, True, 0)
     self.pack_start(separator, True, True, 0)
     box.show_all()
     separator.show()
Пример #11
0
    def resize(self):
        """Adapts GUI elements to the screen size"""
        size = context.get_mainwindow().get_size()
        anchura = size[0]
        k = anchura / 1920.0

        pixbuf = gtk.gdk.pixbuf_new_from_file(get_image_path('logo.svg'))
        pixbuf = pixbuf.scale_simple(int(pixbuf.get_width() * k),
                                     int(pixbuf.get_height() * k),
                                     gtk.gdk.INTERP_BILINEAR)
        align2 = self.builder.get_object("top_align")

        logo2 = self.builder.get_object("logo2")

        logo2.set_from_pixbuf(pixbuf)
        align2.set_padding(int(k * 51), int(k * 30), 0, 0)

        for name in ["previousbutton"]:
            button = self.builder.get_object(name)
            button.set_property("width-request", int(k * 70))
            button.set_property("height-request", int(k * 70))

            image = button.get_children()
            if type(image[0]) == gtk.Image:
                image[0].set_pixel_size(int(k * 56))
Пример #12
0
    def resize(self): 
        size = context.get_mainwindow().get_size()

        altura = size[1]
        anchura = size[0]
        k = anchura / 1920.0

        builder= self.builder
        logos = builder.get_object("logo_align")
        logos.set_padding(int(k*52),int(k*30),0,0)
        disal = builder.get_object("dis_align")
        #disal.set_padding(int(k*25),int(k*25),int(k*50),int(k*50))

        l1 = builder.get_object("reclabel")
        l2 = builder.get_object("mmlabel")
        l3 = builder.get_object("selected_profile")
        i1 = builder.get_object("recimage")
        i2 = builder.get_object("mmimage")
        b1 = builder.get_object("button1")
        b2 = builder.get_object("button2")
	relabel(l1,k*48,True)
        relabel(l2,k*48,True)  
        relabel(l3,k*26,True)  
        i1.set_pixel_size(int(k*120))
        i2.set_pixel_size(int(k*120))
        b1.set_property("width-request", int(anchura/3.5) )
        b2.set_property("width-request", int(anchura/3.5) )
        b1.set_property("height-request", int(anchura/3.5) )
        b2.set_property("height-request", int(anchura/3.5) )
   
        lclass = builder.get_object("logo2")
        lcompany = builder.get_object("logo1")

        iclass=gtk.gdk.pixbuf_new_from_file(get_image_path("logo.svg"))
        icompany=gtk.gdk.pixbuf_new_from_file(get_image_path("teltek.svg"))
        iclass = iclass.scale_simple(
            int(iclass.get_width()*k),
            int(iclass.get_height()*k),
            gtk.gdk.INTERP_BILINEAR)
        icompany = icompany.scale_simple(
            int(icompany.get_width()*k),
            int(icompany.get_height()*k),
            gtk.gdk.INTERP_BILINEAR)
        lclass.set_from_pixbuf(iclass)
        lcompany.set_from_pixbuf(icompany)
Пример #13
0
    def set_logos(self, gui):
        """ Set the logos of the product and the company
        """

        pixbuf = GdkPixbuf.Pixbuf.new_from_file(get_image_path('logo.svg'))
        pixbuf = pixbuf.scale_simple(
            int(pixbuf.get_width()*self.wprop),
            int(pixbuf.get_height()*self.wprop),
            GdkPixbuf.InterpType.BILINEAR)
        self.dialog.set_logo(pixbuf)

        teltek_logo = gui.get_object("teltek")
        pixbuf = GdkPixbuf.Pixbuf.new_from_file(get_image_path('teltek.svg'))
        pixbuf = pixbuf.scale_simple(
            int(pixbuf.get_width()*self.wprop),
            int(pixbuf.get_height()*self.wprop),
            GdkPixbuf.InterpType.BILINEAR)
        teltek_logo.set_from_pixbuf(pixbuf)
Пример #14
0
    def resize(self): 
        size = context.get_mainwindow().get_size()

        anchura = size[0]
        k = anchura / 1920.0

        builder= self.builder
        logos = builder.get_object("logo_align")
        logos.set_padding(int(k*52),int(k*30),0,0)
        # disal = builder.get_object("dis_align")
        # disal.set_padding(int(k*25),int(k*25),int(k*50),int(k*50))

        l1 = builder.get_object("reclabel")
        l2 = builder.get_object("mmlabel")
        l3 = builder.get_object("selected_profile")
        i1 = builder.get_object("recimage")
        i2 = builder.get_object("mmimage")
        b1 = builder.get_object("button1")
        b2 = builder.get_object("button2")
	relabel(l1,k*48,True)
        relabel(l2,k*48,True)  
        relabel(l3,k*26,True)  
        i1.set_pixel_size(int(k*120))
        i2.set_pixel_size(int(k*120))
        b1.set_property("width-request", int(anchura/3.5) )
        b2.set_property("width-request", int(anchura/3.5) )
        b1.set_property("height-request", int(anchura/3.5) )
        b2.set_property("height-request", int(anchura/3.5) )
   
        lclass = builder.get_object("logo2")
        lcompany = builder.get_object("logo1")

        iclass=gtk.gdk.pixbuf_new_from_file(get_image_path("logo.svg"))
        icompany=gtk.gdk.pixbuf_new_from_file(get_image_path("teltek.svg"))
        iclass = iclass.scale_simple(
            int(iclass.get_width()*k),
            int(iclass.get_height()*k),
            gtk.gdk.INTERP_BILINEAR)
        icompany = icompany.scale_simple(
            int(icompany.get_width()*k),
            int(icompany.get_height()*k),
            gtk.gdk.INTERP_BILINEAR)
        lclass.set_from_pixbuf(iclass)
        lcompany.set_from_pixbuf(icompany)
Пример #15
0
    def __init__(self, dispatcher=None, state=None, size=None, logger=None):

        gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
        self.full_size = self.discover_size()  # Fullscreen size
        self.custom_size = self.full_size
        expr = '[0-9]+[\,x\:][0-9]+'  # Parse custom size
        if re.match(expr, size):
            self.custom_size = [
                int(a) for a in size.split(re.search('[,x:]', size).group())
            ]
        elif size == "auto":
            logger.info("Default resolution and fullscreen: " +
                        str(self.full_size))
        else:
            logger.warning(
                "Invalid resolution, set default. Should be 'width,height'. " +
                size)

        if self.custom_size[0] > self.full_size[0]:
            self.custom_size[0] = self.full_size[0]
            logger.warning(
                "Resolution Width is bigger than the monitor, set to monitor maximum"
            )

        if self.custom_size[1] > self.full_size[1]:
            self.custom_size[1] = self.full_size[1]
            logger.warning(
                "Resolution height is bigger than the monitor, set to monitor maximum"
            )

        self.__def_win_size__ = (self.custom_size[0], self.custom_size[1])
        self.set_size_request(self.custom_size[0], self.custom_size[1])

        self.set_title(_("GaliCASTER {0}").format(__version__))
        self.set_decorated(False)
        self.set_position(gtk.WIN_POS_CENTER)
        self.is_fullscreen = (self.custom_size == self.full_size)
        self.logger = logger

        pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(
            get_image_path('galicaster.svg'), 48, 48)
        pixbuf = pixbuf.scale_simple(128, 128, gtk.gdk.INTERP_BILINEAR)
        self.set_icon(pixbuf)
        self.connect('delete_event', lambda *x: self.__on_delete_event())
        self.dispatcher = dispatcher
        if self.dispatcher:
            self.dispatcher.connect('galicaster-quit', self.close)
            self.dispatcher.connect('galicaster-shutdown', self.shutdown)

        self.nbox = gtk.Notebook()
        self.nbox.set_show_tabs(False)
        self.add(self.nbox)
Пример #16
0
    def __init__(self, dispatcher=None, size=None, logger=None):
        Gtk.Window.__init__(self, Gtk.WindowType.TOPLEVEL)
        self.logger = logger

        self.full_size = self.discover_size()  # Fullscreen size
        self.custom_size = self.full_size
        expr = '[0-9]+[\,x\:][0-9]+'  # Parse custom size
        if re.match(expr, size):
            self.custom_size = [int(a) for a in size.split(re.search('[,x:]', size).group())]
        elif size == "auto":
            self.logger.info("Default resolution and fullscreen: " + str(self.full_size))
        else:
            self.logger.warning("Invalid resolution, set default. Should be 'width,height'. " + size)

        if self.custom_size[0] > self.full_size[0]:
            self.custom_size[0] = self.full_size[0]
            self.logger.warning("Resolution Width is bigger than the monitor, set to monitor maximum")

        if self.custom_size[1] > self.full_size[1]:
            self.custom_size[1] = self.full_size[1]
            self.logger.warning("Resolution height is bigger than the monitor, set to monitor maximum")

        self.__def_win_size__ = (self.custom_size[0], self.custom_size[1])
        self.set_size_request(self.custom_size[0], self.custom_size[1])
        #        self.resize(self.custom_size[0],self.custom_size[1])

        self.set_title(_("GaliCASTER {0}").format(__version__))
        self.set_decorated(False)
        self.set_position(Gtk.WindowPosition.CENTER)
        self.is_fullscreen = (self.custom_size == self.full_size)

        self.set_style()
        self.set_width_interval_class(self.get_size()[0])

        pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(get_image_path('galicaster.svg'),48,48)
        pixbuf = pixbuf.scale_simple(128, 128, GdkPixbuf.InterpType.BILINEAR)
        self.set_icon(pixbuf)
        self.connect('delete_event', lambda *x: self.__on_delete_event())
        self.dispatcher = dispatcher
        self.connect('visibility-notify-event', self.on_visibility_event)
        if self.dispatcher:
            self.dispatcher.connect('action-quit', self.close)
            self.dispatcher.connect('action-shutdown', self.shutdown)

        self.nbox = Gtk.Notebook()
        self.nbox.set_show_tabs(False)
        self.add(self.nbox)

        self.connect('key-press-event', self.on_key_press)
        self.connect('key-release-event', self.on_key_release)
Пример #17
0
 def create_pause_dialog(self, parent):
     gui = Gtk.Builder()
     gui.add_from_file(get_ui_path("paused.glade"))
     dialog = gui.get_object("dialog")
     dialog.set_transient_for(parent)
     dialog.set_type_hint(Gdk.WindowTypeHint.TOOLBAR)
     dialog.set_modal(True)
     dialog.set_keep_above(False)
     dialog.set_skip_taskbar_hint(True)
     scale = context.get_mainwindow().get_size()[1] / 100.0
     size = int(scale*self.pausedialog_size)
     dialog.set_default_size(size,size)
     button = gui.get_object("image")
     pause_svg = get_image_path('gc-pause.svg')
     pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(pause_svg, size, size)
     button.set_from_pixbuf(pixbuf)
     return dialog
Пример #18
0
 def create_pause_dialog(self, parent):
     gui = Gtk.Builder()
     gui.add_from_file(get_ui_path("paused.glade"))
     dialog = gui.get_object("dialog")
     dialog.set_transient_for(parent)
     dialog.set_type_hint(Gdk.WindowTypeHint.TOOLBAR)
     dialog.set_modal(True)
     dialog.set_keep_above(False)
     dialog.set_skip_taskbar_hint(True)
     scale = context.get_mainwindow().get_size()[1] / 100.0
     size = int(scale*self.pausedialog_size)
     dialog.set_default_size(size,size)
     button = gui.get_object("image")
     pause_svg = get_image_path('gc-pause.svg')
     pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(pause_svg, size, size)
     button.set_from_pixbuf(pixbuf)
     return dialog
Пример #19
0
    def set_logo(self):
        size = context.get_mainwindow().get_size()
        anchura = size[0]
        k = anchura / 1920.0

        lcompany = Gtk.Image()
        icompany=GdkPixbuf.Pixbuf.new_from_file(get_image_path("teltek.svg"))
        icompany = icompany.scale_simple(
            int(icompany.get_width()*k),
            int(icompany.get_height()*k),
            GdkPixbuf.InterpType.BILINEAR)
        lcompany.set_from_pixbuf(icompany)

        buttonbox = self.builder.get_object("hbuttonbox1")
        buttonbox.pack_start(lcompany,True,True,0)
        self.builder.get_object("previousbutton").destroy()
        buttonbox.reorder_child(lcompany,0)
Пример #20
0
    def create_pause_dialog(self, parent):

        gui = gtk.Builder()
        gui.add_from_file(get_ui_path("paused.glade"))
        dialog = gui.get_object("dialog")
        dialog.set_transient_for(parent)
        dialog.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_TOOLBAR)
        dialog.set_keep_above(True)
        dialog.set_skip_taskbar_hint(True)
        size = context.get_mainwindow().get_size()
        k2 = size[1] / 1080.0
        size = int(k2 * 150)
        dialog.set_default_size(size, size)
        button = gui.get_object("image")
        pixbuf = gtk.gdk.pixbuf_new_from_file(get_image_path('gc-pause.svg'))
        pixbuf = pixbuf.scale_simple(size, size, gtk.gdk.INTERP_BILINEAR)
        button.set_from_pixbuf(pixbuf)
        return dialog
Пример #21
0
    def create_pause_dialog(self, parent):

        gui = gtk.Builder()
        gui.add_from_file(get_ui_path("paused.glade"))
        dialog = gui.get_object("dialog")
        dialog.set_transient_for(parent)
        dialog.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_TOOLBAR)
        dialog.set_keep_above(True)
        dialog.set_skip_taskbar_hint(True)
        size = context.get_mainwindow().get_size()
        k2 = size[1] / 1080.0
        size = int(k2 * 150)
        dialog.set_default_size(size, size)
        button = gui.get_object("image")
        pixbuf = gtk.gdk.pixbuf_new_from_file(get_image_path("gc-pause.svg"))
        pixbuf = pixbuf.scale_simple(size, size, gtk.gdk.INTERP_BILINEAR)
        button.set_from_pixbuf(pixbuf)
        return dialog
Пример #22
0
    def __init__(self, dispatcher=None, state=None, size=None, logger=None):  

        gtk.Window.__init__(self,gtk.WINDOW_TOPLEVEL)
        self.full_size = self.discover_size() # Fullscreen size
        self.custom_size = self.full_size
        expr='[0-9]+[\,x\:][0-9]+' # Parse custom size     
        if re.match(expr,size): 
            self.custom_size = [int(a) for a in size.split(re.search('[,x:]',size).group())]
        elif size=="auto":
            logger.info("Default resolution and fullscreen: "+str(self.full_size))
        else:
            logger.warning("Invalid resolution, set default. Should be 'width,height'. "+size)

        if self.custom_size[0]>self.full_size[0]:
            self.custom_size[0]=self.full_size[0]
            logger.warning("Resolution Width is bigger than the monitor, set to monitor maximum")

        if self.custom_size[1]>self.full_size[1]:
            self.custom_size[1]=self.full_size[1]
            logger.warning("Resolution height is bigger than the monitor, set to monitor maximum")

        self.__def_win_size__=(self.custom_size[0],self.custom_size[1])
        self.set_size_request(self.custom_size[0],self.custom_size[1])

        self.set_title(_("GaliCASTER {0}").format(__version__));    
        self.set_decorated(False)
        self.set_position(gtk.WIN_POS_CENTER)
        self.is_fullscreen = (self.custom_size == self.full_size)
        self.logger = logger

        pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(get_image_path('galicaster.svg'),48,48)        
        pixbuf = pixbuf.scale_simple(128, 128, gtk.gdk.INTERP_BILINEAR)
        self.set_icon(pixbuf)
        self.connect('delete_event', lambda *x: self.__on_delete_event())    
        self.dispatcher = dispatcher
        if self.dispatcher:
            self.dispatcher.connect('galicaster-quit',self.close)
            self.dispatcher.connect('galicaster-shutdown',self.shutdown)

        self.nbox = gtk.Notebook()
        self.nbox.set_show_tabs(False)
        self.add(self.nbox)
Пример #23
0
    def __init__(self, dispatcher=None, state=None):  
        gtk.Window.__init__(self,gtk.WINDOW_TOPLEVEL)
        self.set_size_request(*self.__def_win_size__) #FIXME make it unchangable
        self.full_size = self.discover_size()
        self.set_title("GaliCASTER " + __version__ );    
        self.set_decorated(False)
        self.set_position(gtk.WIN_POS_CENTER)
        self.is_fullscreen = True

        #pixbuf = gtk.gdk.pixbuf_new_from_file(get_image_path('galicaster.svg'))
        pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(get_image_path('galicaster.svg'),48,48)        
        pixbuf = pixbuf.scale_simple(128, 128, gtk.gdk.INTERP_BILINEAR)
        self.set_icon(pixbuf)
        self.connect('delete_event', lambda *x: self.__on_delete_event())    
        self.dispatcher = dispatcher
        if self.dispatcher:
            self.dispatcher.connect('galicaster-quit',self.close)

        self.nbox = gtk.Notebook()
        self.nbox.set_show_tabs(False)
        self.add(self.nbox)
Пример #24
0
    def __init__(self, size=[1920, 1080], title=None):

        wprop = size[0] / 1920.0
        hprop = size[1] / 1080.0
        Gtk.Frame.__init__(self)
        box = Gtk.HBox()
        box.set_border_width(int(wprop * 10))
        strip = Gtk.Image()
        pixbuf = GdkPixbuf.Pixbuf.new_from_file(get_image_path('logo.svg'))
        pixbuf = pixbuf.scale_simple(int(pixbuf.get_width() * wprop * 0.2),
                                     int(pixbuf.get_height() * wprop * 0.2),
                                     GdkPixbuf.InterpType.BILINEAR)
        strip.set_from_pixbuf(pixbuf)
        strip.set_alignment(0.05, 0.5)
        box.pack_start(strip, True, True, 0)  # introduce hprop
        if title:
            label = Gtk.Label(label=title)
            label.set_alignment(0.95, 0.5)
            font = Pango.FontDescription("bold " + str(int(15) * hprop))
            label.modify_font(font)
            box.pack_end(label, True, True, 0)  # introduce hprop
        self.add(box)
        box.show_all()
Пример #25
0
    def __init__(self, dispatcher=None, state=None):
        gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
        self.set_size_request(
            *self.__def_win_size__)  #FIXME make it unchangable
        self.full_size = self.discover_size()
        self.set_title("GaliCASTER " + __version__)
        self.set_decorated(False)
        self.set_position(gtk.WIN_POS_CENTER)
        self.is_fullscreen = True

        #pixbuf = gtk.gdk.pixbuf_new_from_file(get_image_path('galicaster.svg'))
        pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(
            get_image_path('galicaster.svg'), 48, 48)
        pixbuf = pixbuf.scale_simple(128, 128, gtk.gdk.INTERP_BILINEAR)
        self.set_icon(pixbuf)
        self.connect('delete_event', lambda *x: self.__on_delete_event())
        self.dispatcher = dispatcher
        if self.dispatcher:
            self.dispatcher.connect('galicaster-quit', self.close)

        self.nbox = gtk.Notebook()
        self.nbox.set_show_tabs(False)
        self.add(self.nbox)
    def __init__(self, size=[1920,1080],title = None):

        wprop = size[0]/1920.0
        hprop = size[1]/1080.0
        Gtk.Frame.__init__(self)
        box = Gtk.HBox()
        box.set_border_width(int(wprop*10))
        strip = Gtk.Image()
        pixbuf = GdkPixbuf.Pixbuf.new_from_file(get_image_path('logo.svg'))
        pixbuf = pixbuf.scale_simple(
            int(pixbuf.get_width()*wprop*0.2),
            int(pixbuf.get_height()*wprop*0.2),
            GdkPixbuf.InterpType.BILINEAR)
        strip.set_from_pixbuf(pixbuf)
        strip.set_alignment(0.05,0.5)
        box.pack_start(strip, True, True, 0) # introduce hprop
        if title:
            label = Gtk.Label(label=title)
            label.set_alignment(0.95,0.5)
            font = Pango.FontDescription("bold "+str(int(15)*hprop))
            label.modify_font(font)
            box.pack_end(label, True, True, 0) # introduce hprop
        self.add(box)
        box.show_all()
Пример #27
0
    def resize(self):
        """Adapts GUI elements to the screen size"""
        size = context.get_mainwindow().get_size()
        anchura = size[0]
        k = anchura / 1920.0

        pixbuf = GdkPixbuf.Pixbuf.new_from_file(get_image_path('logo.svg'))
        pixbuf = pixbuf.scale_simple(
            int(pixbuf.get_width()*k*0.5),
            int(pixbuf.get_height()*k*0.5),
            GdkPixbuf.InterpType.BILINEAR)
        align2 = self.builder.get_object("top_align")

        logo2 = self.builder.get_object("logo2")

        logo2.set_from_pixbuf(pixbuf)
        align2.set_padding(int(k*51),int(k*30),0,0)

        for name in ["previousbutton"]:
            button = self.builder.get_object(name)
            button.set_property("width-request", int(k*70) )
            button.set_property("height-request", int(k*70) )

            resize_button(button,size_image=k*56)
Пример #28
0
    def resize(self):
        """Adapts GUI elements to the screen size"""
        size = context.get_mainwindow().get_size()
        altura = size[1]
        anchura = size[0]

        k1 = anchura / 1920.0
        k2 = altura / 1080.0
        self.proportion = k1

        #Recorder
        clock = self.gui.get_object("local_clock")
        logo = self.gui.get_object("classlogo")
        nextl = self.gui.get_object("nextlabel")
        title = self.gui.get_object("titlelabel")
        # eventl = self.gui.get_object("eventlabel")
        pbox = self.gui.get_object("prebox")

        rec_title = self.gui.get_object("recording1")
        rec_elapsed = self.gui.get_object("recording3")
        status_panel = self.gui.get_object('status_panel')

        l1 = self.gui.get_object("tab1")
        l2 = self.gui.get_object("tab2")
        l3 = self.gui.get_object("tab3")

        relabel(clock, k1 * 25, False)
        font = pango.FontDescription("bold " + str(int(k2 * 48)))
        self.renderer.set_property('font-desc', font)
        self.renderer.set_fixed_size(int(k2 * 400), -1)
        pixbuf = gtk.gdk.pixbuf_new_from_file(get_image_path('logo.svg'))
        pixbuf = pixbuf.scale_simple(int(pixbuf.get_width() * k1),
                                     int(pixbuf.get_height() * k1),
                                     gtk.gdk.INTERP_BILINEAR)
        logo.set_from_pixbuf(pixbuf)

        modification = "bold " + str(k1 * 42)
        self.font = pango.FontDescription(modification)
        relabel(nextl, k1 * 25, True)
        relabel(title, k1 * 33, True)

        # REC AND STATUS PANEL
        relabel(rec_title, k1 * 25, True)
        rec_title.set_line_wrap(True)
        rec_title.set_width_chars(40)
        relabel(rec_elapsed, k1 * 28, True)

        for child in status_panel.get_children():
            if type(child) is gtk.Label:
                relabel(child, k1 * 19, True)
        relabel(l1, k1 * 20, False)
        relabel(l2, k1 * 20, False)
        relabel(l3, k1 * 20, False)

        for name in ["recbutton", "pausebutton", "stopbutton", "helpbutton"]:
            button = self.gui.get_object(name)
            button.set_property("width-request", int(k1 * 100))
            button.set_property("height-request", int(k1 * 100))

            image = button.get_children()
            if type(image[0]) == gtk.Image:
                image[0].set_pixel_size(int(k1 * 80))
            elif type(image[0]) == gtk.VBox:
                for element in image[0].get_children():
                    if type(element) == gtk.Image:
                        element.set_pixel_size(int(k1 * 46))
            else:
                relabel(image[0], k1 * 28, False)

        for name in ["previousbutton", "morebutton"]:
            button = self.gui.get_object(name)
            button.set_property("width-request", int(k1 * 70))
            button.set_property("height-request", int(k1 * 70))

            image = button.get_children()
            if type(image[0]) == gtk.Image:
                image[0].set_pixel_size(int(k1 * 56))

        talign = self.gui.get_object("top_align")
        talign.set_padding(int(k1 * 10), int(k1 * 25), 0, 0)
        calign = self.gui.get_object("control_align")
        calign.set_padding(int(k1 * 10), int(k1 * 30), int(k1 * 50),
                           int(k1 * 50))
        vum = self.gui.get_object("vubox")
        vum.set_padding(int(k1 * 20), int(k1 * 10), int(k1 * 40), int(k1 * 40))
        pbox.set_property("width-request", int(k1 * 225))
        return True
Пример #29
0
    def resize(self):
        """Adapts GUI elements to the screen size"""
        size = context.get_mainwindow().get_size()

        anchura = size[0]

        k1 = anchura / 1920.0
        self.proportion = k1

        #Recorder
        clock = self.gui.get_object("local_clock")
        logo = self.gui.get_object("classlogo")
        nextl = self.gui.get_object("nextlabel")
        title = self.gui.get_object("titlelabel")
        pbox = self.gui.get_object("prebox")

        rec_title = self.gui.get_object("recording1")
        status_panel = self.gui.get_object('status_panel')

        l1 = self.gui.get_object("tab1")
        l2 = self.gui.get_object("tab2")
        l3 = self.gui.get_object("tab3")

        relabel(clock,k1*25,False)
        pixbuf = GdkPixbuf.Pixbuf.new_from_file(get_image_path('logo.svg'))
        pixbuf = pixbuf.scale_simple(
            int(pixbuf.get_width()*k1*0.5),
            int(pixbuf.get_height()*k1*0.5),
            GdkPixbuf.InterpType.BILINEAR)
        logo.set_from_pixbuf(pixbuf)

        modification = "bold "+str(k1*42)
        self.font = Pango.FontDescription(modification)
        relabel(nextl,k1*25,True)
        relabel(title,k1*33,True)

        # REC AND STATUS PANEL
        relabel(rec_title, k1*25, True)
        rec_title.set_line_wrap(True)

        for child in status_panel.get_children():
            if type(child) is Gtk.Label:
                relabel(child,k1*19,True)
        relabel(l1,k1*20,False)
        relabel(l2,k1*20,False)
        relabel(l3,k1*20,False)

        # change stop button
        for name in ["pause","stop"]:
            button = self.gui.get_object(name+"button")
            image = button.get_children()[0]
            pixbuf = GdkPixbuf.Pixbuf.new_from_file(get_image_path('gc-'+name+'.svg'))
            pixbuf = pixbuf.scale_simple(
                int(60*k1),
                int(60*k1),
                GdkPixbuf.InterpType.BILINEAR)
            image.set_from_pixbuf(pixbuf)

        for name  in ["previousbutton", "morebutton"]:
            button = self.gui.get_object(name)
            button.set_property("width-request", int(k1*250) )
            button.set_property("height-request", int(k1*70) )

            image = button.get_children()
            if type(image[0]) == Gtk.Image:
                image[0].set_pixel_size(int(k1*56))

        vum = self.gui.get_object("vubox")
        vum.set_padding(int(k1*20),int(k1*10),0,0)
        pbox.set_property("width-request", int(k1*225) )
        hbox1 = self.gui.get_object('hbox1')
        hbox1.set_property('spacing', int(k1*325))

        for name  in ["recbutton","pausebutton","stopbutton","helpbutton","editbutton","swapbutton"]:
            button = self.gui.get_object(name)
            resize_button(button,size_image=k1*60,size_box=k1*46,size_label=k1*16)

        return True
Пример #30
0
    def resize(self):
        """Adapts GUI elements to the screen size"""
        size = context.get_mainwindow().get_size()

        anchura = size[0]

        k1 = anchura / 1920.0
        self.proportion = k1

        #Recorder
        clock = self.gui.get_object("local_clock")
        logo = self.gui.get_object("classlogo")
        nextl = self.gui.get_object("nextlabel")
        title = self.gui.get_object("titlelabel")
        pbox = self.gui.get_object("prebox")

        rec_title = self.gui.get_object("recording1")
        status_panel = self.gui.get_object('status_panel')

        l1 = self.gui.get_object("tab1")
        l2 = self.gui.get_object("tab2")
        l3 = self.gui.get_object("tab3")

        relabel(clock, k1 * 25, False)
        pixbuf = GdkPixbuf.Pixbuf.new_from_file(get_image_path('logo.svg'))
        pixbuf = pixbuf.scale_simple(int(pixbuf.get_width() * k1 * 0.5),
                                     int(pixbuf.get_height() * k1 * 0.5),
                                     GdkPixbuf.InterpType.BILINEAR)
        logo.set_from_pixbuf(pixbuf)

        modification = "bold " + str(k1 * 42)
        self.font = Pango.FontDescription(modification)
        relabel(nextl, k1 * 25, True)
        relabel(title, k1 * 33, True)

        # REC AND STATUS PANEL
        relabel(rec_title, k1 * 25, True)
        rec_title.set_line_wrap(True)

        for child in status_panel.get_children():
            if type(child) is Gtk.Label:
                relabel(child, k1 * 19, True)
        relabel(l1, k1 * 20, False)
        relabel(l2, k1 * 20, False)
        relabel(l3, k1 * 20, False)

        # change stop button
        for name in ["pause", "stop"]:
            button = self.gui.get_object(name + "button")
            image = button.get_children()[0]
            pixbuf = GdkPixbuf.Pixbuf.new_from_file(
                get_image_path('gc-' + name + '.svg'))
            pixbuf = pixbuf.scale_simple(int(60 * k1), int(60 * k1),
                                         GdkPixbuf.InterpType.BILINEAR)
            image.set_from_pixbuf(pixbuf)

        for name in ["previousbutton", "morebutton"]:
            button = self.gui.get_object(name)
            button.set_property("width-request", int(k1 * 250))
            button.set_property("height-request", int(k1 * 70))

            image = button.get_children()
            if type(image[0]) == Gtk.Image:
                image[0].set_pixel_size(int(k1 * 56))

        vum = self.gui.get_object("vubox")
        vum.set_padding(int(k1 * 20), int(k1 * 10), 0, 0)
        pbox.set_property("width-request", int(k1 * 225))
        hbox1 = self.gui.get_object('hbox1')
        hbox1.set_property('spacing', int(k1 * 325))

        for name in [
                "recbutton", "pausebutton", "stopbutton", "helpbutton",
                "editbutton", "swapbutton"
        ]:
            button = self.gui.get_object(name)
            resize_button(button,
                          size_image=k1 * 60,
                          size_box=k1 * 46,
                          size_label=k1 * 16)

        return True
Пример #31
0
    def resize(self):
        """Adapts GUI elements to the screen size"""
        size = context.get_mainwindow().get_size()
        altura = size[1]
        anchura = size[0]
        
        k1 = anchura / 1920.0
        k2 = altura / 1080.0
        self.proportion = k1

        #Recorder
        clock = self.gui.get_object("local_clock")
        logo = self.gui.get_object("classlogo")       
        nextl = self.gui.get_object("nextlabel")
        title = self.gui.get_object("titlelabel")
        # eventl = self.gui.get_object("eventlabel")
        pbox = self.gui.get_object("prebox")

        rec_title = self.gui.get_object("recording1")
        rec_elapsed = self.gui.get_object("recording3")
        status_panel = self.gui.get_object('status_panel')

        l1 = self.gui.get_object("tab1")
        l2 = self.gui.get_object("tab2")
        l3 = self.gui.get_object("tab3")
                    
        relabel(clock,k1*25,False)
        font = pango.FontDescription("bold "+str(int(k2*48)))
        self.renderer.set_property('font-desc', font)
        self.renderer.set_fixed_size(int(k2*400),-1)
        pixbuf = gtk.gdk.pixbuf_new_from_file(get_image_path('logo.svg'))  
        pixbuf = pixbuf.scale_simple(
            int(pixbuf.get_width()*k1),
            int(pixbuf.get_height()*k1),
            gtk.gdk.INTERP_BILINEAR)
        logo.set_from_pixbuf(pixbuf)

        modification = "bold "+str(k1*42)
        self.font = pango.FontDescription(modification)     
        relabel(nextl,k1*25,True)
        relabel(title,k1*33,True)

        # REC AND STATUS PANEL
        relabel(rec_title, k1*25, True)
        rec_title.set_line_wrap(True)
        rec_title.set_width_chars(40)
        relabel(rec_elapsed, k1*28, True)

        for child in status_panel.get_children():
            if type(child) is gtk.Label:
                relabel(child,k1*19,True)
        relabel(l1,k1*20,False)
        relabel(l2,k1*20,False)
        relabel(l3,k1*20,False)

        for name  in ["recbutton","pausebutton","stopbutton","editbutton","swapbutton","helpbutton"]:
            button = self.gui.get_object(name)
            button.set_property("width-request", int(k1*100) )
            button.set_property("height-request", int(k1*100) )

            image = button.get_children()
            if type(image[0]) == gtk.Image:
                image[0].set_pixel_size(int(k1*80))   
            elif type(image[0]) == gtk.VBox:
                for element in image[0].get_children():
                    if type(element) == gtk.Image:
                        element.set_pixel_size(int(k1*46))
            else:
                relabel(image[0],k1*28,False)
        # change stop button
        for name in ["pause","stop"]:
            button = self.gui.get_object(name+"button")
            image = button.get_children()[0]
            pixbuf = gtk.gdk.pixbuf_new_from_file(get_image_path('gc-'+name+'.svg'))
            pixbuf = pixbuf.scale_simple(
                int(80*k1),
                int(80*k1),
                gtk.gdk.INTERP_BILINEAR)
            image.set_from_pixbuf(pixbuf)  

        for name  in ["previousbutton", "morebutton"]:
            button = self.gui.get_object(name)
            button.set_property("width-request", int(k1*70) )
            button.set_property("height-request", int(k1*70) )

            image = button.get_children()
            if type(image[0]) == gtk.Image:
                image[0].set_pixel_size(int(k1*56))  


        talign = self.gui.get_object("top_align")
        talign.set_padding(int(k1*10),int(k1*25),0,0)
        calign = self.gui.get_object("control_align")
        calign.set_padding(int(k1*10),int(k1*30),int(k1*50),int(k1*50))
        vum = self.gui.get_object("vubox")
        vum.set_padding(int(k1*20),int(k1*10),int(k1*40),int(k1*40))         
        pbox.set_property("width-request", int(k1*225) )        
        return True