Hi,
I am missing an essential feature in MP2: I want to choose different power actions from a menu to shutdown the pc, supend or restart it. Close and Minimize MP2 etc.
I already wrote down some ideas and specification in wiki: http://wiki.team-mediaportal.com/index.php?title=2_MEDIAPORTAL_2/Contribute/Development/Tasks_&_Todos/Shutdown_menu
The branch which will be used for the development can be found on GIT: https://github.com/MediaPortal/MediaPortal-2/tree/FEAT_ShutdownManager
After some time now, I decided to try to develop it on my own. There are a few different things which needs to be implemented:
Please remember that these are the steps I worked myself into the topic. It is not best practice. If there are things which I improve later I try to link to the better practice from the worse one.
Table of Contents:
I am missing an essential feature in MP2: I want to choose different power actions from a menu to shutdown the pc, supend or restart it. Close and Minimize MP2 etc.
I already wrote down some ideas and specification in wiki: http://wiki.team-mediaportal.com/index.php?title=2_MEDIAPORTAL_2/Contribute/Development/Tasks_&_Todos/Shutdown_menu
The branch which will be used for the development can be found on GIT: https://github.com/MediaPortal/MediaPortal-2/tree/FEAT_ShutdownManager
After some time now, I decided to try to develop it on my own. There are a few different things which needs to be implemented:
- The name of the plugin
Does not matter at this stage, and will be re-defined during the code review after everything else is done.
- The GUI dialog for showing the user the shutdown / power actions which will be executed immediately.
- The GUI dialog for showing the user the shutdown / power actions which will be executed delayed. (Sleeptimer feature)
- A settings UI to:
- reorder items of dialog (2.) containing the immediate executed actions
- hide/show item of dialog (2.) containing the immediate executed actions - The implementation to actually perform the power actions.
- Make the dialogs or the power actions available in GUI and via keybindings.
Please remember that these are the steps I worked myself into the topic. It is not best practice. If there are things which I improve later I try to link to the better practice from the worse one.
Table of Contents:
- Creating the directory structure and plugin.xml file
- Creating the first skin files for the dialogs (screens)
- Use a class Consts.cs to re-use localization resource identifiers, workflow states and additional keys for GUI usage
- Settings vs. Configurations in MP2 & Creating a GUI for a CustomConfigSetting
- Filling a ListView / ItemList with own data types (classes)
- Improve the integration of the shutdown dialogs in MP2 GUI
- Add the actual implementation to put all the buttons / controls into use
- Code reviews and improvements
- Conclusions & ToDo tasks in general (independent from this plugin/implementation):
- Documentation of the default available styles/ controls....
- Documentation of the available Commands/ properties?
- Where does DataContext apply??? i.e.
<ControlTemplate x:Key="Contents_Template" DataContext="{Binding Source={StaticResource Model}}">
on ControlTemplate does not work, but
<StackPanel DataContext="{Binding Source={StaticResource Model}}">
on StackPanel does. - How to build and use ItemLists? Which data type are the items of? derived from ListItem? ...
- What is ListItem AdditionalProperties for?
- How to find defintions of styles? where to look for, i.e. EditPlaylistListViewStyle
Last edited: