Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PVR] - Recording edit context menu visible when not supported #15634

Merged
merged 1 commit into from Mar 1, 2019

Conversation

Projects
None yet
2 participants
@linknetx
Copy link
Contributor

commented Feb 28, 2019

Description

PVR Recording edit context menu still visible when backend doesn't have recording editing capability.

Motivation and Context

Fixes recording edit menu opening blank dialog when backend doesn't have recording editing capability.

How Has This Been Tested?

Tested with pvr.dbvlink which doesn't have editing capability. Not tested with PVR with this capability.

Screenshots (if appropriate):

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Clean up (non-breaking change which removes non-working, unmaintained functionality)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that will cause existing functionality to change)
  • Cosmetic change (non-breaking change that doesn't touch code)
  • None of the above (please explain below)

Checklist:

  • My code follows the Code Guidelines of this project
  • My change requires a change to the documentation, either Doxygen or wiki
  • I have updated the documentation accordingly
  • I have read the Contributing document
  • I have added tests to cover my change
  • All new and existing tests passed
@ksooo

This comment has been minimized.

Copy link
Member

commented Feb 28, 2019

Sorry, this is wrong. "Edit recording" menu entry is not for editing EDLs. It opens a recording settings dialog for renaming the recording, setting play count, life time - all according to different client capabilities. The minimum content this dialog will contain is the (read-only) title of the recording. Thus, the conditions for displaying the menu item are correct.

screenshot001

@linknetx

This comment has been minimized.

Copy link
Contributor Author

commented Feb 28, 2019

Fair enough, but all I get is this which isn't much use:

2019-02-28_170608

@ksooo

This comment has been minimized.

Copy link
Member

commented Feb 28, 2019

Maybe, but works as designed. No issue.

@linknetx

This comment has been minimized.

Copy link
Contributor Author

commented Feb 28, 2019

If the Edit Recording menu brings up a dialog in which nothing is editable due to a lack of capability from the backend then surely it would make sense for the menu item not to be visible?

@ksooo

This comment has been minimized.

Copy link
Member

commented Feb 28, 2019

Sure, but the implementation you provided for this is wrong.

@linknetx

This comment has been minimized.

Copy link
Contributor Author

commented Feb 28, 2019

Sure, but the implementation you provided for this is wrong.

@ksooo

OK, changed the implementation.

@ksooo

This comment has been minimized.

Copy link
Member

commented Feb 28, 2019

Correct conditions, wrong place. You now make the context menu implementation dependent from recording settings implementation details. If somebody in the future changes the conditions in the settings dialog, one needs to know that context menu implementation must also be changed. This is really bad design. You need the conditions to be all in one place (source file) which is the settings dialog.

@ksooo

This comment has been minimized.

Copy link
Member

commented Feb 28, 2019

Introduce bool GUIActions::CanEditRecording(const CFileItem &item) and static RecordingSettingsDialog::CanEditRecording(const CFileItem &item), check the conditions there.

@linknetx

This comment has been minimized.

Copy link
Contributor Author

commented Feb 28, 2019

@ksooo

Thanks for the hint, revised it so that now the conditions are at least in the same file.

Should 'CanEditRecording' be referenced in 'InitializeSettings'?

@ksooo
Copy link
Member

left a comment

Thanks. In general okay, only needs a bit more love.

And please, for the new code, for the new function's parameters, put the & everywhere directly after the type, not before variable's name. In the past we did different, but for new code we want it this way (not CFileItem &item, but CFileItem& item).

Show resolved Hide resolved xbmc/pvr/dialogs/GUIDialogPVRRecordingSettings.h Outdated
Show resolved Hide resolved xbmc/pvr/dialogs/GUIDialogPVRRecordingSettings.cpp Outdated
Show resolved Hide resolved xbmc/pvr/dialogs/GUIDialogPVRRecordingSettings.cpp Outdated
Show resolved Hide resolved xbmc/pvr/PVRGUIActions.cpp Outdated
Show resolved Hide resolved xbmc/pvr/PVRContextMenus.cpp Outdated
@linknetx

This comment has been minimized.

Copy link
Contributor Author

commented Mar 1, 2019

@ksooo

I believe that's covered all of the change requests :-)

@ksooo
Copy link
Member

left a comment

Almost done...

Show resolved Hide resolved xbmc/pvr/dialogs/GUIDialogPVRRecordingSettings.cpp Outdated

@ksooo ksooo dismissed their stale review Mar 1, 2019

accidentally approval. still needs changes.

@ksooo

ksooo approved these changes Mar 1, 2019

Copy link
Member

left a comment

Very nice. Thanks for your contribution. :-)

@ksooo

This comment has been minimized.

Copy link
Member

commented Mar 1, 2019

jenkins build this please

@ksooo ksooo added this to the Leia 18.2-rc1 milestone Mar 1, 2019

@linknetx

This comment has been minimized.

Copy link
Contributor Author

commented Mar 1, 2019

Very nice. Thanks for your contribution. :-)

Thanks for all your help, without which it wasn't going anywhere :-)

@ksooo ksooo merged commit bebf785 into xbmc:master Mar 1, 2019

1 check passed

default You're awesome. Have a cookie
Details

@linknetx linknetx deleted the linknetx:pvr-recording branch Mar 1, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.