Example #1
0
    def __init__(self, app):
        self.app = app
        self.stack = app.matches_stack
        self.filter = None

        self.matches = Gtk.Builder()
        self.matches.add_from_file(relative_path('ui/matches.ui'))
        self.matches.connect_signals(self)

        self.matches_box = self.matches.get_object('box_matches')
        self.stack.add_named(self.matches_box, 'matches_container')

        self.matches_filters = self.matches.get_object(
            'list_box_matches_filters')
        self.matches_list = self.matches.get_object('flow_box_matches_list')
        self.matches_list.set_filter_func(self.on_matches_list_row_changed)

        self.match = Gtk.Builder()
        self.match.add_from_file(relative_path('ui/match.ui'))
        self.match.connect_signals(self)

        self.match_box = self.match.get_object('box_match')
        self.stack.add_named(self.match_box, 'match_container')

        self.match_teams = self.match.get_object('box_match_teams')
        self.match_streams = self.match.get_object('list_box_match_streams')

        GLib.idle_add(self.do_initial_setup)
        GLib.idle_add(self.do_matches_widgets)

        GLib.timeout_add(5 * 60000, self.update_live_data)
Example #2
0
def add_custom_css(style):
    screen = Gdk.Screen.get_default()
    priority = Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
    provider = Gtk.CssProvider()
    filename = relative_path(style)

    if os.path.exists(filename):
        provider.load_from_path(filename)
    else:
        provider.load_from_data(style.encode())

    Gtk.StyleContext.add_provider_for_screen(screen, provider, priority)
Example #3
0
def add_widget_custom_css(widget, style):
    priority = Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
    provider = Gtk.CssProvider()
    context = widget.get_style_context()
    filename = relative_path(style)

    if os.path.exists(filename):
        provider.load_from_path(filename)
    else:
        provider.load_from_data(style.encode())

    context.add_provider(provider, priority)
Example #4
0
    def __init__(self, app):
        self.stream = StreamHandler(self)
        self.app = app
        self.stack = app.player_stack

        self.sesbus = dbus.SessionBus()
        self.isaver = self.get_isaver()
        self.cookie = None

        self.url = None
        self.xid = None

        self.loading = False
        self.cstream = None

        self.is_fullscreen = False
        self.toolbar_stick = True

        self.player = Gtk.Builder()
        self.player.add_from_file(relative_path('ui/player.ui'))
        self.player.connect_signals(self)

        self.overlay = self.player.get_object('overlay_player')
        self.stack.add_named(self.overlay, 'player_video')

        self.eventbox = self.player.get_object('eventbox_player')
        self.eventbox.connect('button-press-event',
                              self.on_eventbox_button_press_event)
        self.eventbox.connect('motion-notify-event',
                              self.on_eventbox_motion_notify_event)

        self.playbin = VideoBox(callback=self.update_status)
        self.eventbox.add(self.playbin)

        self.status = self.player.get_object('label_player_status')
        self.status.set_text('Not playing')

        self.toolbar = self.player.get_object('toolbox_player')
        self.volume_button = self.player.get_object('button_volume')
        self.full_button = self.player.get_object('button_fullscreen')
        self.restore_button = self.player.get_object('button_unfullscreen')
        self.play_button = self.player.get_object('button_play')
        self.pause_button = self.player.get_object('button_pause')
        self.stop_button = self.player.get_object('button_stop')
        self.toolbar_event = GLib.timeout_add(3000, self.toggle_toolbar, True)
Example #5
0
    def __init__(self, app):
        self.app = app
        self.stack = app.channels_stack
        self.filter = None

        self.channels = Gtk.Builder()
        self.channels.add_from_file(relative_path('ui/channels.ui'))
        self.channels.connect_signals(self)

        self.channels_box = self.channels.get_object('box_channels')
        self.stack.add_named(self.channels_box, 'channels_container')

        self.channels_filters = self.channels.get_object(
            'list_box_channels_filters')
        self.channels_list = self.channels.get_object('flow_box_channels_list')
        self.channels_list.set_filter_func(self.on_channels_list_row_changed)

        GLib.idle_add(self.do_initial_setup)
Example #6
0
    def logo(self):
        fname = str(self.host).lower()
        image = relative_path("images/%s.svg" % fname)

        return image
Example #7
0
    def logo(self):
        stock = relative_path('images/channel-logo.svg')
        path = str(self.logo_path)
        path = path if os.path.exists(path) else stock

        return path
Example #8
0
    def crest(self):
        stock = relative_path('images/team-emblem.svg')
        path = str(self.crest_path)
        path = path if os.path.exists(path) else stock

        return path