Uploaded image for project: 'MediaPortal 2'
  1. MediaPortal 2
  2. MP2-802

Ensure, that TV settings are available in all TV related screens

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.2.2
    • 2.2
    • TV
    • None

    Description

      <p>There are 2 different kind of models:</p>

      <ul>
      <li>"Normal" models, they are initialized on instantiating (usually in constructor)</li>
      <li>Workflow models, they are initizalied when the workflow is entered (lazy)</li>
      </ul>

      <p>The TV models are Workflow models, so they are initialized inside the related interface implementation: <a class="externalLink setFavicon" href="https://github.com/MediaPortal/MediaPortal-2/blob/11cc07571c5240288128e4dae4ce69b66085569c/MediaPortal/Source/UI/TV/SlimTvClient/Models/SlimTvModelBase.cs#L368-L397" style="background-image: url(&quot;//www.google.com/s2/favicons?domain=https://github.com/MediaPortal/MediaPortal-2/blob/11cc07571c5240288128e4dae4ce69b66085569c/MediaPortal/Source/UI/TV/SlimTvClient/Models/SlimTvModelBase.cs#L368-L397&quot;);" target="_blank">MediaPortal/MediaPortal-2</a>.<br>
      This means, at the moment the settings are initialized only when the Workflow was entered once.<br>
      <br>
      A solution could need some refactoring, i.e. to add a new "normal" model, like SlimTvSettingsModel, which does initialize immediately and can be used everywhere.</p>

      <ol>
      <li>Adding a "SlimTvSettingsModel.cs", which implements IDisposable (no need to derive from timer/message based model)</li>
      <li>Copying the settings related properties and settings change watcher into this new class (remember to dispose settings change watcher)</li>
      <li>A new line to plugin.xml to make the model known (create a new guid!). Example from <a class="externalLink setFavicon" href="https://github.com/MediaPortal/MediaPortal-2/blob/master/MediaPortal/Source/UI/UiComponents/Weather/plugin.xml#L30" style="background-image: url(&quot;//www.google.com/s2/favicons?domain=https://github.com/MediaPortal/MediaPortal-2/blob/master/MediaPortal/Source/UI/UiComponents/Weather/plugin.xml#L30&quot;);" target="_blank">weather</a> plugin.</li>
      <li>Like above, make the model known to the xaml screen/style:<br>
      &lt;Model x:Key="SlimTvSettings" Id="{guid from step 3}"/&gt;</li>
      </ol>

      Attachments

        Activity

          People

            henso96 henso
            ge2301 ge2301
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: