FileCommander.Inputmod & InputBoxmod

Moderators: Gully, peteru

User avatar
adoxa
Wizard
Posts: 1490
Joined: Thu Feb 23, 2017 22:58
Location: CQ
Contact:

Re: FileCommander.Inputmod & InputBoxmod

Post by adoxa » Fri Jul 06, 2018 16:54

IanSav wrote:
Fri Jul 06, 2018 16:48
adoxa wrote:
Fri Jul 06, 2018 16:45
I've had another thought. Since the header allows for two lines, make it an actual two-line header: one line for the path/name and the other for the stats.
What "header"?
Where it displays the path/name and the stats of the current entry (list_left_head and list_right_head). At least in FMW it's a two-line header.

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: FileCommander.Inputmod & InputBoxmod

Post by prl » Fri Jul 06, 2018 17:21

adoxa wrote:
Fri Jul 06, 2018 16:54
IanSav wrote:
Fri Jul 06, 2018 16:48
adoxa wrote:
Fri Jul 06, 2018 16:45
I've had another thought. Since the header allows for two lines, make it an actual two-line header: one line for the path/name and the other for the stats.
What "header"?
Where it displays the path/name and the stats of the current entry (list_left_head and list_right_head). At least in FMW it's a two-line header.
The same in easy-skin-aus-hd. In OverlayHD, it looks like there's room for 3 lines.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: FileCommander.Inputmod & InputBoxmod

Post by prl » Fri Jul 06, 2018 17:22

adoxa wrote:
Fri Jul 06, 2018 16:45
I've had another thought. Since the header allows for two lines, make it an actual two-line header: one line for the path/name and the other for the stats.

That's a good idea. It should make it much easier to read.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: FileCommander.Inputmod & InputBoxmod

Post by prl » Tue Jul 10, 2018 13:42

prl wrote:
Fri Jun 22, 2018 11:44
After having a bit of a look at the code and seeing how Setup fetches and uses setup.xml:
  • I can't see how Setup/setup.xml can be used directly for the FileCommander setup, since the FileCommander setup has a default directory setting and I can't see how it can be used to set or change directory names using a browser like LocationBox.
  • I can't see a simple way of inheriting from Setup and adding that directory setting functionality. The methods of Setup itself don't seem to provide a way in to capture key-presses directed at specific config items. All input handling in Setup is done by its ConfigListScreen mixin and acted on by ConfigListScreen's ConfigList instance. It might be possible to replace the ConfigList instance with a subclass of ConfigList, but it would be a bit messy.
It looks like the simplest path will be a code cleanup of FileCommanderConfigScreen.

It turned out to actually be fairly simple to refactor FileCommanderConfigScreen as a subclass of Setup once I thought about it a bit:

Code: Select all

class FileCommanderConfigScreen(Setup):
	def __init__(self, session):
		Setup.__init__(self, session, "filecommander", plugin="Extensions/FileCommander")

		self["actions"].actions["ok"] = self.ok

	def ok(self):
		if self["config"].getCurrent()[1] is config.plugins.filecommander.path_default:
			self.session.openWithCallback(self.pathSelected, LocationBox, text=_("Default Folder"), currDir=config.plugins.filecommander.path_default.getValue(), minFree=100)

	def pathSelected(self, res):
		if res is not None:
			config.plugins.filecommander.path_default.value = res
The plugin="Extensions/FileCommander" in the initialisation of Setup is all that's needed to make it use a plugin-local setup.xml instead of the global one.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: FileCommander.Inputmod & InputBoxmod

Post by prl » Tue Jul 10, 2018 13:48

Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: FileCommander.Inputmod & InputBoxmod

Post by prl » Tue Jul 10, 2018 13:57

adoxa wrote:
Thu Jul 05, 2018 12:30
prl wrote:
Thu Jul 05, 2018 12:10
adoxa wrote:
Thu Jul 05, 2018 10:55
I've now thought of a new operation - copy to a new name. I missed the end of Madam Secretary, so downloaded the last few minutes. I'd like to copy the eit from the recording, but atm that means copying to another directory, renaming there, then moving back.

Move, too? Perhaps they should both be handled the way symlink does it.

Move is rename.

No, in File Commander Move (GREEN) is move, and Rename (BLUE) is rename. Move moves a file to the same name in another directory, while Rename changes the name of the file, leaving it in the same directory.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: FileCommander.Inputmod & InputBoxmod

Post by prl » Tue Jul 10, 2018 16:13

Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

User avatar
adoxa
Wizard
Posts: 1490
Joined: Thu Feb 23, 2017 22:58
Location: CQ
Contact:

Re: FileCommander.Inputmod & InputBoxmod

Post by adoxa » Tue Jul 10, 2018 16:39

prl wrote:
Tue Jul 10, 2018 13:57
adoxa wrote:
Thu Jul 05, 2018 12:30
prl wrote:
Thu Jul 05, 2018 12:10
adoxa wrote:
Thu Jul 05, 2018 10:55
I've now thought of a new operation - copy to a new name. I missed the end of Madam Secretary, so downloaded the last few minutes. I'd like to copy the eit from the recording, but atm that means copying to another directory, renaming there, then moving back.

Move, too? Perhaps they should both be handled the way symlink does it.

Move is rename.

No, in File Commander Move (GREEN) is move, and Rename (BLUE) is rename. Move moves a file to the same name in another directory, while Rename changes the name of the file, leaving it in the same directory.

When you asked "Move, too?" I took that to mean "Move to a new name", which is the same as rename.

IanSav
Uber Wizard
Posts: 16846
Joined: Tue May 29, 2007 15:00
Location: Melbourne, Australia

Re: FileCommander.Inputmod & InputBoxmod

Post by IanSav » Tue Jul 10, 2018 23:14

Hi Prl,
prl wrote:
Tue Jul 10, 2018 13:42
It turned out to actually be fairly simple to refactor FileCommanderConfigScreen as a subclass of Setup once I thought about it a bit:

Code: Select all

class FileCommanderConfigScreen(Setup):
	def __init__(self, session):
		Setup.__init__(self, session, "filecommander", plugin="Extensions/FileCommander")

		self["actions"].actions["ok"] = self.ok

	def ok(self):
		if self["config"].getCurrent()[1] is config.plugins.filecommander.path_default:
			self.session.openWithCallback(self.pathSelected, LocationBox, text=_("Default Folder"), currDir=config.plugins.filecommander.path_default.getValue(), minFree=100)

	def pathSelected(self, res):
		if res is not None:
			config.plugins.filecommander.path_default.value = res
The plugin="Extensions/FileCommander" in the initialisation of Setup is all that's needed to make it use a plugin-local setup.xml instead of the global one.
I would have hoped this wouldn't have been so difficult given I gave you code to review that does exactly this. It is also demonstrated in the OverlayHD plugin that has been around for a very long time. ;)

Anyway, it is good to have more code using the system libraries as was originally intended. This should also have allowed you to removed a lot of duplicated and bloat code. :)

Regards,
Ian.

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: FileCommander.Inputmod & InputBoxmod

Post by prl » Wed Jul 11, 2018 11:50

IanSav wrote:
Tue Jul 10, 2018 23:14
I would have hoped this wouldn't have been so difficult given I gave you code to review that does exactly this. It is also demonstrated in the OverlayHD plugin that has been around for a very long time. ;)

I don't recall seeing examples of subclassing from Setup. I hadn't looked the OverlayHD Setup screen code, but now tht I have, I see that there's a much better way to handle the OK press in derived Setup screens than what I've done.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: FileCommander.Inputmod & InputBoxmod

Post by prl » Wed Jul 11, 2018 14:16

adoxa wrote:
Tue Jul 03, 2018 17:29
prl wrote:
Sat Jun 30, 2018 19:02
IanSav wrote:
Sat Jun 30, 2018 17:35
Can some other function be assigned to (3) to eliminate the hole? I don't think the hole in the numbering is optimal.
Yes, another function could fill the hole. Any suggestions?
I can't think of any function to fill it, but how about "Properties"? This would be useful to see the size in bytes, or when a long name takes over the header.

How does this look, then?
Screen Shot 2018-07-11 at 14.11.27.png
Time & date format are taken from the MENU>Setup>Time>Time settings.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

User avatar
adoxa
Wizard
Posts: 1490
Joined: Thu Feb 23, 2017 22:58
Location: CQ
Contact:

Re: FileCommander.Inputmod & InputBoxmod

Post by adoxa » Wed Jul 11, 2018 16:13

I'd rather see size with commas ("{0:n}".format(size)), no B, binary prefixes (decimal can be done manually, which commas help with), make GiB the largest, use one decimal point, and a space between the number and its unit. The example would then be
Size: 2,384,664,004 (2.2 GiB).

Grumpy_Geoff
Uber Wizard
Posts: 6490
Joined: Thu Mar 05, 2009 22:54
Location: Perth

Re: FileCommander.Inputmod & InputBoxmod

Post by Grumpy_Geoff » Wed Jul 11, 2018 16:44

prl wrote:
Mon Jul 02, 2018 11:56
...Uninstall this patch before doing any online firmware update! A firmware update from USB will safely remove this patch, and recover from any errors you might make in doing the install or uninstall.

Aw crap, I forgot I had the File Commander alpha "fc-symlink3" installed, and I've online updated to 20180711.

Can I simply delete files "plugin.py" and "plugin.pyo.bak" from below?

Code: Select all

root@beyonwizu4:~# ls -al /usr/lib/enigma2/python/Plugins/Extensions/FileCommander
drwxr-xr-x    5 root     root          4096 Jul 11 14:29 .
drwxr-xr-x   23 root     root          4096 Jul 11 12:23 ..
-rw-r--r--    1 root     root         11343 Jul 11 12:23 FileList.pyo
-rw-r--r--    1 root     root          2057 Jul 11 12:23 InputBox.pyo
-rw-r--r--    1 root     root           155 Jul 11 12:23 __init__.pyo
drwxr-xr-x    2 root     root          4096 Jul 11 14:29 addons
drwxr-xr-x    2 root     root          4096 Jul 11 14:29 images
drwxr-xr-x    2 root     root          4096 Jul 11 14:29 pic
-rw-r--r--    1 root     root         39442 Jul  3 08:32 plugin.py
-rw-r--r--    1 root     root         40497 Jul 11 12:23 plugin.pyo
-rw-r--r--    1 root     root         41870 Jun 29 16:17 plugin.pyo.bak
-rw-r--r--    1 root     root          1672 Jul 11 12:23 setup.xml
root@beyonwizu4:~#

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: FileCommander.Inputmod & InputBoxmod

Post by prl » Wed Jul 11, 2018 17:02

Grumpy_Geoff wrote:
Wed Jul 11, 2018 16:44
Can I simply delete files "plugin.py" and "plugin.pyo.bak" from below?

Yes, that should be fine. 20180711 should have everything that's in fc-symlink3 (and more :))
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

Grumpy_Geoff
Uber Wizard
Posts: 6490
Joined: Thu Mar 05, 2009 22:54
Location: Perth

Re: FileCommander.Inputmod & InputBoxmod

Post by Grumpy_Geoff » Wed Jul 11, 2018 17:20

prl wrote:
Wed Jul 11, 2018 17:02
Grumpy_Geoff wrote:
Wed Jul 11, 2018 16:44
Can I simply delete files "plugin.py" and "plugin.pyo.bak" from below?

Yes, that should be fine. 20180711 should have everything that's in fc-symlink3 (and more :))

Thanks. I was hoping that was the case, because as far as I could see, "installer.sh" only renamed plugin.pyo and dropped in a new plugin.py

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: FileCommander.Inputmod & InputBoxmod

Post by prl » Wed Jul 11, 2018 17:30

adoxa wrote:
Wed Jul 11, 2018 16:13
I'd rather see size with commas ("{0:n}".format(size)), no B, binary prefixes (decimal can be done manually, which commas help with), make GiB the largest, use one decimal point, and a space between the number and its unit. The example would then be
Size: 2,384,664,004 (2.2 GiB).

Done.

The file sizes in the panel headers in File Commander are calculated as kiB and MiB, but reported as KB (kelvin-bytes :?: :roll:) and MB. What multipliers should they be reported in?
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

User avatar
adoxa
Wizard
Posts: 1490
Joined: Thu Feb 23, 2017 22:58
Location: CQ
Contact:

Re: FileCommander.Inputmod & InputBoxmod

Post by adoxa » Wed Jul 11, 2018 17:44

prl wrote:
Wed Jul 11, 2018 17:30
The file sizes in the panel headers in File Commander are calculated as kiB and MiB, but reported as KB (kelvin-bytes :?: :roll:) and MB. What multipliers should they be reported in?
I'd prefer decimal (movies would match the movie list, then).

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: FileCommander.Inputmod & InputBoxmod

Post by prl » Wed Jul 11, 2018 17:58

adoxa wrote:
Wed Jul 11, 2018 17:44
prl wrote:
Wed Jul 11, 2018 17:30
The file sizes in the panel headers in File Commander are calculated as kiB and MiB, but reported as KB (kelvin-bytes :?: :roll:) and MB. What multipliers should they be reported in?
I'd prefer decimal (movies would match the movie list, then).

Sounds good to me. here's the IEC-prefix style conversion for the popup:
UnitScaler(scaleTable=UnitMultipliers.Iec, maxNumLen=3, decimals=1).scale(st.st_size) (it goes up to yotta/yobi 1000^8/1024^8)

10^3^n scaling for the header would be
UnitScaler(maxNumLen=3, decimals=1, firstScaleIndex=0).scale(st.st_size) (using default SI multipliers)
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

IanSav
Uber Wizard
Posts: 16846
Joined: Tue May 29, 2007 15:00
Location: Melbourne, Australia

Re: FileCommander.Inputmod & InputBoxmod

Post by IanSav » Wed Jul 11, 2018 18:11

Hi,
prl wrote:
Wed Jul 11, 2018 17:02
Grumpy_Geoff wrote:
Wed Jul 11, 2018 16:44
Can I simply delete files "plugin.py" and "plugin.pyo.bak" from below?
Yes, that should be fine. 20180711 should have everything that's in fc-symlink3 (and more :))
My advice is to force re-install the enigma2 update. opkg install --force-reinstall enigma2

If any source files are present when a firmware update is applied then when the update completes and the system reboots the source file will be compiled and replace the newer binary file that just updated as part of the firmware update. This could mean that changes not in the patch will be lost. This could leave the receiver in an unstable state.

This is one of the reasons why I am so concerned about using patch kits. This relates to my reservations expressed in the Config and VirtualKeyBoard enhancements thread.

Regards,
Ian.
Last edited by IanSav on Wed Jul 11, 2018 19:13, edited 1 time in total.

Grumpy_Geoff
Uber Wizard
Posts: 6490
Joined: Thu Mar 05, 2009 22:54
Location: Perth

Re: FileCommander.Inputmod & InputBoxmod

Post by Grumpy_Geoff » Wed Jul 11, 2018 18:19

IanSav wrote:
Wed Jul 11, 2018 18:11
...If any source files are present when a firmware update is applied then when the update completes and the system reboots the source file will be compiled and replace the newer binary file that just updated as part of the firmware update. This could mean that changes not in the patch will be lost. This could leave the receiver in an unstable state.

I didn't immediately reboot after installing the update; I waited for prl's reply and then removed the files.
You can see the .pyo file still has a date/time from the online update package, not a reboot time.

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: FileCommander.Inputmod & InputBoxmod

Post by prl » Wed Jul 11, 2018 18:33

Grumpy_Geoff wrote:
Wed Jul 11, 2018 18:19
IanSav wrote:
Wed Jul 11, 2018 18:11
...If any source files are present when a firmware update is applied then when the update completes and the system reboots the source file will be compiled and replace the newer binary file that just updated as part of the firmware update. This could mean that changes not in the patch will be lost. This could leave the receiver in an unstable state.

I didn't immediately reboot after installing the update; I waited for prl's reply and then removed the files.
You can see the .pyo file still has a date/time from the online update package, not a reboot time.

And I noted the file datestamps when providing the advice.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

IanSav
Uber Wizard
Posts: 16846
Joined: Tue May 29, 2007 15:00
Location: Melbourne, Australia

Re: FileCommander.Inputmod & InputBoxmod

Post by IanSav » Wed Jul 11, 2018 18:47

Hi,

I didn't note the time stamps but I think my warning and advice are *always* safe options.

I have been creating test kits for OpenViX and OpenPLi users and they still keep tripping people up.

Regards,
Ian.

User avatar
Gully
Moderator
Posts: 7736
Joined: Thu Aug 30, 2007 22:08
Location: Melbourne

Re: FileCommander.Inputmod & InputBoxmod

Post by Gully » Wed Jul 11, 2018 19:08

IanSav wrote:
Wed Jul 11, 2018 18:11
My advice is to force re-install the enigma2 update. opkg -install --force-reinstall enigma2
I think an extra hyphen snuck in there and it should be opkg install --force-reinstall enigma2
Cheers
Gully
_____________
Beyonwiz U4
Logitech Harmony Elite
Google Pixel 6 Pro

IanSav
Uber Wizard
Posts: 16846
Joined: Tue May 29, 2007 15:00
Location: Melbourne, Australia

Re: FileCommander.Inputmod & InputBoxmod

Post by IanSav » Wed Jul 11, 2018 19:13

Hi Gully,

Thank you. Looks like a copy past glitch. (Fixed!) :)

Regards,
Ian.

User avatar
Gully
Moderator
Posts: 7736
Joined: Thu Aug 30, 2007 22:08
Location: Melbourne

Re: FileCommander.Inputmod & InputBoxmod

Post by Gully » Wed Jul 11, 2018 19:56

IanSav wrote:
Wed Jul 11, 2018 19:13
Thank you. Looks like a copy past glitch. (Fixed!) :)
:wink:
Cheers
Gully
_____________
Beyonwiz U4
Logitech Harmony Elite
Google Pixel 6 Pro

User avatar
adoxa
Wizard
Posts: 1490
Joined: Thu Feb 23, 2017 22:58
Location: CQ
Contact:

Re: FileCommander.Inputmod & InputBoxmod

Post by adoxa » Thu Jul 12, 2018 11:31

adoxa wrote:
Wed Jul 11, 2018 16:13
I'd rather see size [...] use one decimal point [...]
Thinking a bit more on this, I think three significant digits (1.23, 12.3, 123) would be better, but it doesn't look like UnitScaler does that, so never mind (I'd rather have 999.9 than just 1).

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: FileCommander.Inputmod & InputBoxmod

Post by prl » Thu Jul 12, 2018 12:16

adoxa wrote:
Thu Jul 12, 2018 11:31
adoxa wrote:
Wed Jul 11, 2018 16:13
I'd rather see size [...] use one decimal point [...]
Thinking a bit more on this, I think three significant digits (1.23, 12.3, 123) would be better, but it doesn't look like UnitScaler does that, so never mind (I'd rather have 999.9 than just 1).
You're right. UnitScaler is more like %f than %g :)
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: FileCommander.Inputmod & InputBoxmod

Post by prl » Fri Jul 13, 2018 17:23

I've submitted an implementation of Enhancement #671: Add file information popup to FileCommander.

IanSav, I haven't written an OverlayHD skin for the FileCommanderFileStatInfo screen, because I didn't know how you'd want it laid out. The screen will work in OverlayHD by using the skin specified in the FileCommanderFileStatInfo class.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

User avatar
peteru
Uber Wizard
Posts: 9741
Joined: Tue Jun 12, 2007 23:06
Location: Sydney, Australia
Contact:

Re: FileCommander.Inputmod & InputBoxmod

Post by peteru » Fri Jul 13, 2018 18:08

Will be in an update going out tonight.

"Beauty lies in the hands of the beer holder."
Blog.

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: FileCommander.Inputmod & InputBoxmod

Post by prl » Fri Jul 13, 2018 19:06

Thanks.

Is mediainfo available as/in a Beyonwiz package? I'm sure I remember installing it (and not all that long ago), but now I can't find it!
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

IanSav
Uber Wizard
Posts: 16846
Joined: Tue May 29, 2007 15:00
Location: Melbourne, Australia

Re: FileCommander.Inputmod & InputBoxmod

Post by IanSav » Fri Jul 13, 2018 22:04

Hi Prl,
prl wrote:
Fri Jul 13, 2018 17:23
IanSav, I haven't written an OverlayHD skin for the FileCommanderFileStatInfo screen, because I didn't know how you'd want it laid out. The screen will work in OverlayHD by using the skin specified in the FileCommanderFileStatInfo class.
I am applying the updates as they are released on my development machine. I will try to make some time this weekend to get some of the new changes into OverlayHD.

Thank you for the prompt on the area to be changed. :)

Regards,
Ian.

User avatar
peteru
Uber Wizard
Posts: 9741
Joined: Tue Jun 12, 2007 23:06
Location: Sydney, Australia
Contact:

Re: FileCommander.Inputmod & InputBoxmod

Post by peteru » Sat Jul 14, 2018 01:27

prl wrote:
Fri Jul 13, 2018 19:06
Is mediainfo available as/in a Beyonwiz package?
opkg list says no.

"Beauty lies in the hands of the beer holder."
Blog.

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: FileCommander.Inputmod & InputBoxmod

Post by prl » Sat Jul 14, 2018 10:21

Yes, I know. But was it available in the recent past?
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

Grumpy_Geoff
Uber Wizard
Posts: 6490
Joined: Thu Mar 05, 2009 22:54
Location: Perth

Re: FileCommander.Inputmod & InputBoxmod

Post by Grumpy_Geoff » Sat Jul 14, 2018 10:35

prl wrote:
Sat Jul 14, 2018 10:21
Yes, I know. But was it available in the recent past?

I'm assuming here you used it on your Mac -
Cambyses:Movies prl$ mediainfo *.ts | egrep '^(Format|Channel\(s\)|Complete name) '
From viewtopic.php?f=56&t=12327&p=163941#p163941

Here you mention that it was (at least then) available as a plugin - viewtopic.php?f=47&t=12193&p=161581#p161574

User avatar
adoxa
Wizard
Posts: 1490
Joined: Thu Feb 23, 2017 22:58
Location: CQ
Contact:

Re: FileCommander.Inputmod & InputBoxmod

Post by adoxa » Sat Jul 14, 2018 11:53

Grumpy_Geoff wrote:
Sat Jul 14, 2018 10:35
prl wrote:
Sat Jul 14, 2018 10:21
Yes, I know. But was it available in the recent past?

Here you mention that it was (at least then) available as a plugin - viewtopic.php?f=47&t=12193&p=161581#p161574

It would seem that plugin "downloads HTTP streams", so it's not the right MediaInfo, anyway.

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: FileCommander.Inputmod & InputBoxmod

Post by prl » Sat Jul 14, 2018 12:03

OK. Thanks, everyone. I'll comment out the interface to mediainfo in File Commander for now.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: FileCommander.Inputmod & InputBoxmod

Post by prl » Sat Jul 14, 2018 16:26

I've implemented running file, ffprobe and checksums on files in File Commander. I doesn't look like mediainfo is available for File Commander to use.

The current implementation for checksums is to run a user-chosen set of checksums out of {MD5, SHA1, SHA3, SHA256, SHA512}. The current default is {MD5, SHA3, SHA256}, but perhaps it should only be one of them the default, perhaps MD5.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

IanSav
Uber Wizard
Posts: 16846
Joined: Tue May 29, 2007 15:00
Location: Melbourne, Australia

Re: FileCommander.Inputmod & InputBoxmod

Post by IanSav » Mon Jul 16, 2018 02:20

Hi Prl,

In the new file status screen, is there a reason why you don't show the RED (Cancel) button even though it is in the ActionMap?

Also, would you consider changing the MENU button menu structure to match that used by the MovieSelection layout? That is, make all the numeric functions an entry in a menu triggered by the MENU button and have the first item of that menu be "Settings..." to take the use to the configuration settings. (The direct access to the numeric functions should be retained.)

When my Setup, etc changes get integrated I would like to talk about changing the navigation buttons that are defined/used.

Regards,
Ian.

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: FileCommander.Inputmod & InputBoxmod

Post by prl » Mon Jul 16, 2018 11:19

IanSav wrote:
Mon Jul 16, 2018 02:20
In the new file status screen, is there a reason why you don't show the RED (Cancel) button even though it is in the ActionMap?

No particular reason, though that choice isn't particularly unusual (e.g. MessageBox).
IanSav wrote:
Mon Jul 16, 2018 02:20
Also, would you consider changing the MENU button menu structure to match that used by the MovieSelection layout? That is, make all the numeric functions an entry in a menu triggered by the MENU button and have the first item of that menu be "Settings..." to take the use to the configuration settings. (The direct access to the numeric functions should be retained.)

I had thought about that. I think there are too many important and useful functions only available on the numerical buttons. At least they are now all enumerated in the help screen.
IanSav wrote:
Mon Jul 16, 2018 02:20
When my Setup, etc changes get integrated I would like to talk about changing the navigation buttons that are defined/used.

Good idea. Others may well want to be part of that discussion. I suspect there will be a lot of ground to cover.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

User avatar
MrQuade
Uber Wizard
Posts: 11844
Joined: Sun Jun 24, 2007 13:40
Location: Perth

Re: FileCommander.Inputmod & InputBoxmod

Post by MrQuade » Mon Jul 16, 2018 12:01

IanSav wrote:
Mon Jul 16, 2018 02:20
Also, would you consider changing the MENU button menu structure to match that used by the MovieSelection layout? That is, make all the numeric functions an entry in a menu triggered by the MENU button and have the first item of that menu be "Settings..." to take the use to the configuration settings. (The direct access to the numeric functions should be retained.)
I think that is a good idea. In general, I personally dislike the use of magic shortcut buttons that lack an obvious on-screen prompt. Being able to access those functions from a popup menu like the Media Player uses would be handy for users who don't frequently access those functions (and thus lack muscle memory for the shortcuts).

Having the numeric keys function documented in the HELP screen is a fantastic improvement, but the way the info is presented doesn't lend itself to conveying information "at a glance".
As clunky as it was (and I am certainly not suggesting bringing it back), the old table that was displayed when pressing MENU was still useful.
If the popup was to be implemented, does anyone think there is a way to also display the shortcut button that corresponds to each function without the interface turning into a mess?
Logitech Harmony Ultimate+Elite RCs
Beyonwiz T2/3/U4/V2, DP-S1 PVRs
Denon AVR-X3400h, LG OLED65C7T TV
QNAP TS-410 NAS, Centos File Server (Hosted under KVM)
Ubiquiti UniFi Managed LAN/WLAN, Draytek Vigor130/Asus RT-AC86U Internet
Pixel 4,5&6, iPad 3 Mobile Devices

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: FileCommander.Inputmod & InputBoxmod

Post by prl » Mon Jul 16, 2018 16:10

MrQuade wrote:
Mon Jul 16, 2018 12:01
As clunky as it was (and I am certainly not suggesting bringing it back), the old table that was displayed when pressing MENU was still useful.
If the popup was to be implemented, does anyone think there is a way to also display the shortcut button that corresponds to each function without the interface turning into a mess?

In the one interface that does that in the main code (the channel list), the code is indeed a bit of a mess, though something similar for the FileCommander probably wouldn't be so complicated.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: FileCommander.Inputmod & InputBoxmod

Post by prl » Mon Jul 16, 2018 17:16

Enhancement #672: Add interfaces to useful file information programs to FileCommander

Implementation submitted.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

Paul_oz53
Wizard
Posts: 2791
Joined: Sat Jun 13, 2009 02:34
Location: Melbourne

Re: FileCommander.Inputmod & InputBoxmod

Post by Paul_oz53 » Mon Jul 16, 2018 19:04

Installed, working and looking much refined. Thanks prl.

In playing with it, I went intoMenuand changed the default storage path to /media/hddfromList of storage deviceswith consument ease. I then decided to revert to List of storage devices but it appears there is no direct path back once the default value is changed.

Comparing thesettingsfile pre and post modification, it would appear thatconfig.plugins.filecommander.path_default=/media/hdd/ must be deleted to revert toList of storage devices. Fortunately, I was able to restore settings but, if a backup is taken after the default has changed, it appears one would have to editsettingsto revert to the prior behaviour.

For information.
__________________________________
Paul
Beyonwiz T4, 2 x U4: FW - 19.3 20211010
Samsung QA85Q80BAWXXY 4K TV
Samsung QA65Q80TAWXXY 4K TV
Samsung HW Q800BXY soundbar
OverlayHD 1.70, IceTV, Foxtel IQ4
2 x Win7 PCs, 2 x Win10 PCs
Denon AVR -X2400H

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: FileCommander.Inputmod & InputBoxmod

Post by prl » Mon Jul 16, 2018 19:23

Paul_oz53 wrote:
Mon Jul 16, 2018 19:04
In playing with it, I went intoMenuand changed the default storage path to /media/hddfromList of storage deviceswith consument ease. I then decided to revert to List of storage devices but it appears there is no direct path back once the default value is changed.

Comparing thesettingsfile pre and post modification, it would appear thatconfig.plugins.filecommander.path_default=/media/hdd/ must be deleted to revert toList of storage devices. Fortunately, I was able to restore settings but, if a backup is taken after the default has changed, it appears one would have to editsettingsto revert to the prior behaviour.

For information.

I know about that one (like you, I came across it in testing), and I'm not sure how to go about fixing it. The problem is that the LocationBox that's used to select the path returns None when the user cancels the LocationBox, but it's also the value used to represent the pseudo-path List of storage devices. :(

Because LocationBox is used pretty widely, and because List of storage devices usually isn't a valid setting for a path, I'm not sure how best to deal with it.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

Paul_oz53
Wizard
Posts: 2791
Joined: Sat Jun 13, 2009 02:34
Location: Melbourne

Re: FileCommander.Inputmod & InputBoxmod

Post by Paul_oz53 » Mon Jul 16, 2018 19:30

prl wrote:
Mon Jul 16, 2018 19:23

I know about that one (like you, I came across it in testing), and I'm not sure how to go about fixing it. The problem is that the LocationBox that's used to select the path returns None when the user cancels the LocationBox, but it's also the value used to represent the pseudo-path List of storage devices. :(

Because LocationBox is used pretty widely, and because List of storage devices usually isn't a valid setting for a path, I'm not sure how best to deal with it.

Maybe just keep the option of editing settingsas the fall back if someone really cares about it.
__________________________________
Paul
Beyonwiz T4, 2 x U4: FW - 19.3 20211010
Samsung QA85Q80BAWXXY 4K TV
Samsung QA65Q80TAWXXY 4K TV
Samsung HW Q800BXY soundbar
OverlayHD 1.70, IceTV, Foxtel IQ4
2 x Win7 PCs, 2 x Win10 PCs
Denon AVR -X2400H

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: FileCommander.Inputmod & InputBoxmod

Post by prl » Tue Jul 17, 2018 14:31

Enhancement #674: [skins] Increase default font size for FileList
Implementation submitted (including for OverlayHD)

Increases font size in all FileLists (e.g. YELLOW Location>Other in media selection screen) from 18px to 20px. Restores font size in File Commander lists to 20px.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: FileCommander.Inputmod & InputBoxmod

Post by prl » Tue Jul 17, 2018 17:48

MrQuade wrote:
Mon Jul 16, 2018 12:01
IanSav wrote:
Mon Jul 16, 2018 02:20
Also, would you consider changing the MENU button menu structure to match that used by the MovieSelection layout? That is, make all the numeric functions an entry in a menu triggered by the MENU button and have the first item of that menu be "Settings..." to take the use to the configuration settings. (The direct access to the numeric functions should be retained.)
I think that is a good idea. In general, I personally dislike the use of magic shortcut buttons that lack an obvious on-screen prompt. Being able to access those functions from a popup menu like the Media Player uses would be handy for users who don't frequently access those functions (and thus lack muscle memory for the shortcuts).

Having the numeric keys function documented in the HELP screen is a fantastic improvement, but the way the info is presented doesn't lend itself to conveying information "at a glance".
As clunky as it was (and I am certainly not suggesting bringing it back), the old table that was displayed when pressing MENU was still useful.

Enhancement #678: Settings and actions menu for FileCommander
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: FileCommander.Inputmod & InputBoxmod

Post by prl » Wed Jul 18, 2018 13:05

Current status:
Bug #388: Filenames containing some shell metacharacters are not handled correctly in some Tasks or Console commandsBug #655: ASCII keyboard doesn't work for FileCommander text entry (fix in beta)
Enhancement #656: Refactor Input & InputBox in FileCommander (implemented in beta)
Enhancement #657: Refactor FileList in FileCommander (implemented in beta)
Enhancement #658: Add help screens to FileCommander (implemented in beta)
Bug #659: Both lists showing as selected in FileCommander multi-select (implemented in beta)
Bug #660: Changes to FileCommander extension filter doesn't update when changed (implemented in beta)
Bug #661: File commander extension filters incomplete (fixed in beta)
Bug #663: File commander sometimes silently fails to execute script (implemented in beta)
Enhancement #669: Make FileCommander setup screen a more standard setup (implemented in beta)
Enhancement #671: Add file information popup to FileCommander (implemented in beta)
Enhancement #672: Add interfaces to useful file information programs to FileCommander (implemented in beta)
Enhancement #673: Tidy up FileCommander list headers (implemented in beta)
Enhancement #674: [skins] Increase default font size for FileList (implemented in beta)
Enhancement #678: Settings and actions menu for FileCommander (implemented in beta)
Enhancement #679: Add .log as a text file type in File Commander (implemented in beta)
Enhancement #680: Remove configuration clutter when ffprobe is run from File Commander (implemented in beta)
Enhancement #681: Show link targets in File Commander file status (implemented in beta
Enhancement #682: Offer to install required packages in File Commander (implemented in beta)
Bug #683: Incorrect name prefill in FileCommander Rename (fixed in beta)
Bug #684: Crash in File Commander when file used (OK) directly after move (fixed in beta)
Enhancement #685: Show link "arrows" on files as well as directories in File Commander (implemented in beta)
Enhancement #686: Update File Commander file lists on Move and Copy completion
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

User avatar
adoxa
Wizard
Posts: 1490
Joined: Thu Feb 23, 2017 22:58
Location: CQ
Contact:

Re: FileCommander.Inputmod & InputBoxmod

Post by adoxa » Wed Jul 18, 2018 15:10

Here's some patches to consider.

Use the "txt" image for log files.

Code: Select all

diff --git a/lib/python/Plugins/Extensions/FileCommander/FileList.py b/lib/python/Plugins/Extensions/FileCommander/FileList.py
index 1a4e5cbdf..daf28657e 100755
--- a/lib/python/Plugins/Extensions/FileCommander/FileList.py
+++ b/lib/python/Plugins/Extensions/FileCommander/FileList.py
@@ -15,6 +15,7 @@ LOCAL_EXTENSIONS = {
 	"conf": "txt",
 	"cfg": "txt",
 	"srt": "txt",
+	"log": "txt",
 	"py": "py",
 	"sh": "sh",
 	"html": "html",
 
Add -hide_banner to the ffprobe command.

Code: Select all

diff --git a/lib/python/Plugins/Extensions/FileCommander/addons/key_actions.py b/lib/python/Plugins/Extensions/FileCommander/addons/key_actions.py
index 286089728..175f7c074 100755
--- a/lib/python/Plugins/Extensions/FileCommander/addons/key_actions.py
+++ b/lib/python/Plugins/Extensions/FileCommander/addons/key_actions.py
@@ -175,12 +175,12 @@ class key_actions():
 		self.run_prog("file")
 
 	def run_ffprobe(self):
-		self.run_prog("ffprobe")
+		self.run_prog("ffprobe", "-hide_banner")
 
 	def run_mediainfo(self):
 		self.run_prog("mediainfo")
 
-	def run_prog(self, prog):
+	def run_prog(self, prog, args=None):
 		if not self.have_program(prog):
 			pkg = self.progPackages.get(prog)
 			if pkg:
@@ -203,7 +203,13 @@ class key_actions():
 			__, filetype = os.path.splitext(filename.lower())
 			filepath = os.path.join(sourceDir, filename)
 		if prog == "file" or filetype == ".ts" or filetype in MOVIE_EXTENSIONS:
-			toRun = (prog, filepath)
+			if args:
+				if isinstance(args, (tuple, list)):
+					toRun = (prog,) + tuple(args) + (filepath,)
+				else:
+					toRun = (prog, args, filepath)
+			else:
+				toRun = (prog, filepath)
 			self.session.open(Console, cmdlist=(toRun,))
 		else:
 			self.session.open(MessageBox, _("You can't usefully run '%s' on '%s'.") % (prog, filename), type=MessageBox.TYPE_ERROR, close_on_any_key=True)

In the stats, show the target of a link with the file name ("->" doesn't look too good, maybe brackets or something instead?).

Code: Select all

diff --git a/lib/python/Plugins/Extensions/FileCommander/plugin.py b/lib/python/Plugins/Extensions/FileCommander/plugin.py
index 8514ef090..e93e30b5f 100644
--- a/lib/python/Plugins/Extensions/FileCommander/plugin.py
+++ b/lib/python/Plugins/Extensions/FileCommander/plugin.py
@@ -916,9 +916,6 @@ class FileCommanderFileStatInfo(Screen):
 			self["list"].pageDown()
 
 	def fillList(self):
-		self["filename"].text = self.filename
-		self.list = []
-
 		try:
 			st = os.lstat(self.filepath)
 		except OSError as oe:
@@ -927,6 +924,8 @@ class FileCommanderFileStatInfo(Screen):
 			return
 
 		mode = st.st_mode
+		self["filename"].text = self.filename + " -> " + os.readlink(self.filepath) if stat.S_ISLNK(mode) else self.filename
+		self.list = []
 		self.list.append((_("Type:"), self.filetype(mode)))
 		self.list.append((_("Owner:"), "%s (%d)" % (self.username(st.st_uid), st.st_uid)))
 		self.list.append((_("Group:"), "%s (%d)" % (self.groupname(st.st_gid), st.st_gid)))
I was going to use long YELLOW to add "Copy to another name", but that's not as simple as I thought, so can wait for another time. On a related note, though, should renaming a movie automatically rename all the associated files?

Another thing that might be nice to have is a list of favourite directories; maybe 5 could be expanded to a ChoiceBox, rather than a simple default? Don't know about adding a directory to the favourites, maybe that could be done in the menu, when it's added.

Post Reply

Return to “Developers Community”