Skip to content

Conversation

TurRil
Copy link

@TurRil TurRil commented Oct 2, 2018

As a plugin I want to be able to display another title in the recorder UI so that when a user sees the galicaster screen their name could be displayed correctly.

@andiempett
Copy link
Collaborator

andiempett commented Nov 16, 2018

I'm not sure that modifying the variable in the RecorderService class directly is the best way to do this.
i'd suggest having a method in the class that does this probably. something like:

    def set_title_standin(self, title):
        self.title_standin = title

You can test this PR with the below plugin

from galicaster.core import context


def init():
    dispatcher = context.get_dispatcher()
    dispatcher.connect('timer-short', hello_world)
    dispatcher.connect('timer-long', say_hello)


def hello_world(signal=None):
    print context.get('recorder').title_standin


def say_hello(signal=None):
    context.get('recorder').title_standin = 'Hello World!'

@andiempett andiempett assigned andiempett and unassigned andiempett Nov 16, 2018
@andiempett andiempett self-requested a review November 16, 2018 11:07
@andiempett
Copy link
Collaborator

from testing i seems this only affects manually recorded mediapackages, the title in the events panel in the recorder UI is changed only and seems to work well.

event_type.set_text("")
if status.get_text():
status.set_text("")
title.set_text(_(self.recorder.title_standin))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey sorry! this is almost there.
i think you forgot to call self.recorder.set_title_standin(self, title) here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think not, it looks like the set_title_standin() function is meant to be called through a plugin (and if not the behaviour should be the same as before this PR)
@TurRil can you confirm?

Copy link
Contributor

@Alfro Alfro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @TurRil, sorry for the huge delay here.
I'm hesitant to merge this, as I think we should not add this logic using the recorder service.

What do you think of adding the title_standin to classui.mainwindow?

self.__create_drawing_areas_func = None
self.__handle_recover_id = None
self.autorecover = autorecover
self.title_standin = None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be added to the recorder service.
See if you can add it to the classui/mainwindow instead (to keep ui logic on the ui)

event_type.set_text("")
if status.get_text():
status.set_text("")
title.set_text(_(self.recorder.title_standin))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think not, it looks like the set_title_standin() function is meant to be called through a plugin (and if not the behaviour should be the same as before this PR)
@TurRil can you confirm?

@Alfro Alfro added feature Use this label for new features or enhancements and removed feature labels Jun 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Use this label for new features or enhancements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants