[Approved] Fix for MP #0002253 (1 Viewer)

framug

Super Moderator
  • Team MediaPortal
  • January 31, 2005
    5,924
    1,995
    South of France
    Home Country
    France France
    This is for 0002253: MediaPortal does not start if "show last active module" would open a PIN protected folder - MediaPortal Bugtracker
    I found the problem but, I have no solution yet then, if you have an idea...
    It appears when showlastactivemodule and RememberLastFolder are enabled in a pincode protected.

    In this case, in GUIVideoFiles, we go in LoadDirectory(string newFolderName) method. (No GUI is displayed)
    Then, we want to fill the itemlist :
    Code:
          // here we get ALL files in every subdir, look for folderthumbs, defaultthumbs, etc
          List<GUIListItem> itemlist = _virtualDirectory.GetDirectoryExt(_currentFolder);
    Note : for testing I replaced by :
    List<GUIListItem> itemlist = _virtualDirectory.GetDirectoryUnProtectedExt(_currentFolder, true);
    and it works but, this is not the solution because no pin protect anymore.

    Then, in VirtualDirectory.cs, in GetDirectoryExt(string strDir) method, because folder is pin protected we do :
    Code:
          if (IsProtectedShare(strDir, out iPincodeCorrect))
          {
            #region Pin protected
            bool retry = true;
            {
              while (retry)
              {
                //no, then ask user to enter the pincode
                GUIMessage msgGetPassword = new GUIMessage(GUIMessage.MessageType.GUI_MSG_GET_PASSWORD, 0, 0, 0, 0, 0, 0);
                GUIWindowManager.SendMessage(msgGetPassword);
    and, the process is locked on the last line because, we want to display the VirtuaKeyboard with No GUI is displayed before.
    It's up to you to see how you would prefer to fix it.
     

    elliottmc

    Retired Team Member
  • Premium Supporter
  • August 7, 2005
    14,927
    6,061
    Cardiff, UK
    Home Country
    United Kingdom United Kingdom
    Hi,

    Can I suggest an alternative solution to this problem? If the user quits MediaPortal, and they are currently in a password protected folder, can you "tell" MediaPortal that it was on the home screen? Presumably at some point during quit, it stores the current module, so this should be relatively straightforward to do.

    Best wishes,

    Mark
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    Can I suggest an alternative solution to this problem? If the user quits MediaPortal, and they are currently in a password protected folder, can you "tell" MediaPortal that it was on the home screen? Presumably at some point during quit, it stores the current module, so this should be relatively straightforward to do.

    That would be much better approach from the security point of view. Now it is not possible to gain an access to the PIN protected folder if S3 was triggered by an accident and user did forgot that the password protected area was used as last item.
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,751
    7,196
    Sydney
    Home Country
    Australia Australia
    From my tests, this problem occurs with any type of dialog that may get invoked from a plugin on startup when using 'show last active module'.

    So ideally it would be nice if the fix takes that into consideration, not just the case for Pin Protected Folders where a Virtual Keyboard is expected.
     

    framug

    Super Moderator
  • Team MediaPortal
  • January 31, 2005
    5,924
    1,995
    South of France
    Home Country
    France France
    • Thread starter
    • Moderator
    • #5
    Ah yes, you're right, ltfearme :)
    Then, I just think about a lazy way :
    Simply remove the "show last active module", finally.
    Because was this functionality need a so expensive cost dev, for working on the right way ?
    My point of view (user side) : In most of case, it just avoid one click.
    What do you think about ?
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,751
    7,196
    Sydney
    Home Country
    Australia Australia
    In my opinion it should just show the last active module when resuming from standby, instead it shows last active module for both resuming from standby and restarting mediaportal.

    The only reason I can think of why it currently does both is because of the setting 'Restart Mediaportal on Resume', but this could just be treated as a Restart and not resume from standby (thats what is right?).

    If it was changed to just show when resuming from standby then the problem will go away as main GUI Window will be available.
     

    framug

    Super Moderator
  • Team MediaPortal
  • January 31, 2005
    5,924
    1,995
    South of France
    Home Country
    France France
    • Thread starter
    • Moderator
    • #7
    In my opinion it should just show the last active module when resuming from standby
    hmmm in this case, we could drop in case pointed by tourettes before, with pin protected folder on standby resuming, isn't it ?
    I have no clue, may be someone will have a brilliant idea.
     

    elliottmc

    Retired Team Member
  • Premium Supporter
  • August 7, 2005
    14,927
    6,061
    Cardiff, UK
    Home Country
    United Kingdom United Kingdom
    Hi,

    Just out of interest, when was "resume last module" on resume from stand-by actually added? I can't see anything in Mantis for this.

    While it is a nice feature, if it is causing problems, would it be better to remove this option and consider it for MP2 ? I guess the priority right now is to get MP1.1 finished, and I'd regard this as a feature rather than a bug-fix.

    Just had another idea. Is it possible to tell MP to go to the home screen and THEN to the chosen module? That way, you'd get all of the default behavior, although you won't go to the last-used folder in video/music (which is what is causing the problem anyway). I guess this would require basically changing WHEN the last-used module is resumed (i.e. after the home screen has been loaded rather than before) and not storing any information about WHERE in the module (which folder you were browsing) you were. In fact, maybe this is the simple solution - don't remember which screen you were on. Or am I totally missing the point?

    Best wishes,

    Mark
     

    Seidelin

    Retired Team Member
  • Premium Supporter
  • August 14, 2006
    1,755
    652
    Kgs. Lyngby
    Home Country
    Denmark Denmark
    Just out of interest, when was "resume last module" on resume from stand-by actually added? I can't see anything in Mantis for this.

    This feature was added by gibman on July 30th 2007 in SVN 15364. So it is not exactly a sparkling new feature (which is probably also why it is not in mantis, since mantis wasn't used as much back then).
     

    framug

    Super Moderator
  • Team MediaPortal
  • January 31, 2005
    5,924
    1,995
    South of France
    Home Country
    France France
    • Thread starter
    • Moderator
    • #10
    I had a bit time to spend yesterday.
    Here is a patch based on elliottmc proposal but, instead of going in "home", I found better to stay on active module. ;)
    Purpose is simply to get out from Pin protected folder.

    1/ Working for music, pictures and movies for sure.
    2/ Should also work with resume but, TVE3 doesn't want to suspend my dev PC then --> not tested.

    If you agree with this solution, here is the code :
     

    Attachments

    • MediaPortal.patch
      30.6 KB

    Users who are viewing this thread

    Top Bottom