Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 25 Mar 2017, 09:41
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Building a universal file viewer
Post new topic   Reply to topic View previous topic :: View next topic
Page 6 of 7 [92 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, 7 Next
Author Message
perdido


Joined: 09 Dec 2013
Posts: 433
Location: Altair IV , Just north of Eeyore Junction.

PostPosted: Sun 12 Mar 2017, 22:05    Post subject:  

Humble suggestion.

When hilighting a file directory in file window pane it would be nice to see the sub-directories in the viewer window pane. Not all files, just sub-directories.

Just my thought while using.

.

_________________
.
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 3361
Location: www.eussenheim.de/

PostPosted: Mon 13 Mar 2017, 04:37    Post subject: Building a universal file viewer
Subject description: universal
 

jamesbond wrote:
Quote:
- I can't test the script sufficiently and can not provide support for different environments.
That's okay - we're going to handle that (now that both step and SFR have responded Very Happy)

You can count me in for universal users. Wink
mm_i.png
 Description   Just a teaser
made by:
<menu label="'$(gettext geany File)'">
<menuitem label="'$(gettext geany Quit)'"
<menu label="'$(gettext geany Preferences)'">
 Filesize   72.56 KB
 Viewed   465 Time(s)

mm_i.png

Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 3361
Location: www.eussenheim.de/

PostPosted: Mon 13 Mar 2017, 15:20    Post subject: Building a universal file viewer
Subject description: i18n
 

gettexted and translated using momanager.

TEXTDOMAIN is "puppyview"
mm_i18n.png
 Description   note, fatdog is full of translations
also usage messages already translated
 Filesize   42.69 KB
 Viewed   415 Time(s)

mm_i18n.png

mm_quickview_20170310_i18n.gz
Description  remove fake .gz
gz

 Download 
Filename  mm_quickview_20170310_i18n.gz 
Filesize  15.87 KB 
Downloaded  14 Time(s) 
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1222
Location: Japan

PostPosted: Wed 15 Mar 2017, 02:30    Post subject:  

@all Thanks for joining the naming contest and lots of interesting proposals. Makes it even harder to choose. How about 'MM Inlook'? Would sound familiar - somehow.

For the time being I'll only get rid of the "quick" and change the script name to mm_view. Pure egoism. It helps me to find it in my huge script pit where all of my more serious stuff starts with 'mm_' . I'll take the liberty to refer to it as MMview for the rest of this thread. Eventually, with more input from the community, the 'MM' will have to go. Let's see.

@mavrothal Maybe I can add '(disk usage)' to the output to make it less confusing.
Line wrapping is possible but I see too many disadvantages and have no plans to implement it.

@SFR I haven't yet tried avprobe/avplay. Tahrpup doesn't run well on my current machine, so tahrpup users will have to wait or roll their own code.

Thanks for pointing out Fatdog's xclip deficiency. Makes me wonder about the reasons, but no problem. This should take care of distros with even none of the two utilities installed:
Code:
type -p xclip  && CLIP=xclip || { type -p xsel && CLIP=xsel || CLIP=: ;} ; export CLIP
...
echo -n "$vCHOOSER" | $CLIP -i


File names with consecutive whitespace? You must have seen a lot in your life. But of course you are right. I'll fix the quotation marks.

I'll add (multi) user friendliness to my next update. I will put config settings into $HOME/.config/mm_view, so they may survive a reboot, and truly temporary files into /tmp/mm_view. This should be clean enough for multi-user installations.

@greengeek How do you pronounce "viewmmer"?

@belham2 I'm flattered to see "MochiView File Manager" in such big letters. It's not yet a file manager.

@jamesbond Thanks for your interest. Don't worry, I'm not striving for perfection and I will not ride this horse to death.

@stemsee MiView? Why not "MM MiEV"? Mitsubish Motors i-MiEV. Oh, I smell trouble.

@perdido Some kind of subdirectory display is scheduled for one of the next updates though it will be on-demand only, not when you simply select a directory. The problem is that calculation can take too much time and will cause the script to temporarily freeze. Even the current display, generated by the du command, can be extremely slow, e.g. when you select an external drive with thousands of subdirectories. I will therefore add a timeout to the current display, but you will be able to see the information when hitting the F1 key.

@L18L Error messages don't look any nicer in Japanese Laughing . As you may have noticed I never gettext my scripts. I don't mind if anyone takes the trouble and adds it, but be warned that I change texts frequently, so "internationalization" should be one of the very last tasks.
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 4473
Location: New Zealand

PostPosted: Wed 15 Mar 2017, 03:31    Post subject:  

MochiMoppel wrote:
How about 'MM Inlook'? Would sound familiar - somehow.
Haha - you may have just given Microsoft a new idea there. Smile

Quote:
How do you pronounce "viewmmer"?
Well, I was thinking it would be pronounced something like "vyoo ma". (not really sure how to do phonetic spelling)

"inlook" triggered a few more thoughts:
Can't help myself...

zoomin
zzoomm
zoommin
zoommer
zoommax
immedia
viewmmedia
seemmee
showmmee
inspector
mmonitor
mmicroscope
summary
summation
medium
mmaxiview

I'm going to stop now before my head bursts.
Back to top
View user's profile Send private message 
drunkjedi


Joined: 24 May 2015
Posts: 648

PostPosted: Wed 15 Mar 2017, 10:55    Post subject:  

MochiMoppel wrote:
@stemsee MiView? Why not "MM MiEV"? Mitsubish Motors i-MiEV. Oh, I smell trouble.
Mi reminds me of Chinese Phone maker Xiaomi.

They make,
Mi Phone (copies UI of iPhone, calls it MIUI),
Mi Pad,
Mi note,
Mi notebook Air,
Mi WiFi+ (wireless repeater),
Mi powerbank,
Mi Band (Fitness tracker band),
Mi Air purifier,
Mi Water purifier,
Mi Smart Scale (personal weighing scale),
Mi Induction Heating Pressure Rice Cooker,
Mi Robotic Vacuum,
Mi Drones,
And Mi whatever....

Heard they were gonna sell Washing M/C too, called....... Mi washing m/c. Shocked

I don't think they have a department to think of names for their products.
Ha ha.
Back to top
View user's profile Send private message 
stemsee

Joined: 27 Jun 2013
Posts: 1909
Location: In The Way

PostPosted: Wed 15 Mar 2017, 11:09    Post subject:  

@MochiMoppel

As a Honours linguist and a rampant polyglot I can explain the problems with MMview

['3m]['3m]['viju:w^h]
1) The initial vowel is formed under pulmonic air pressure flowing through an open approximation vocal-tract (open-mouth) along with glottal activity giving rise to voicing which continuous through the next sound

2) The <m> /m/ is made by complete stricture in the place of articulation, bi-labial (lips), (it is a nasal sonorant), the airflow is forced through the nasal cavity, while the glottis continues to provide voice.
Each /m/ trails off with ^h aspiration. And aspiration possibly occurs during the onset too, depending on whether or not the speaker has fluecny in English pronunciation or not!

er this happens twice in a short space of time!!!!!!

3) <view> /view/ Then the articulators are called upon to change radically into a labio-dental fricative, followed by a short-lived release phase as the 'i' vowel is sounded during a short spell of open-approximation, during which lip rounding occurs to form the 'oo' sound [u:] /u/, which tapers off into a gliding <double u> /w/ [w] accompanied by more aspiration ^h.

well, my dear fellow, people are lazy, and can't be bothered with all of that! This why MiView works and eMeMView doesn't!

CHEERS!
sayonara!
stemsee <stemsee> /stemsee/ [st3msi:]
Back to top
View user's profile Send private message MSN Messenger 
L18L

Joined: 19 Jun 2010
Posts: 3361
Location: www.eussenheim.de/

PostPosted: Thu 16 Mar 2017, 15:22    Post subject: Building a universal file viewer
Subject description: internationalization
 

MochiMoppel wrote:
@L18L Error messages don't look any nicer in Japanese Laughing . As you may have noticed I never gettext my scripts. I don't mind if anyone takes the trouble and adds it, but be warned that I change texts frequently, so "internationalization" should be one of the very last tasks.

There isn't any trouble adding gettext messages to a shell script.

Handling changes is usual "business", no problem at all.
Frequenz does not matter.

What happens if you change a text?
Nothing bad. This text appears in English.
The old translation which is no more valid is kept in the translation file.
Any old script version continues using the old translation.

What happens if you add a text?
Nothing bad. This text appears in English.

Thus "internationalization" should NOT be one of the very last tasks.
MMview is already too good to be restricted to users who understand some English. Very Happy
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1222
Location: Japan

PostPosted: Mon 20 Mar 2017, 05:06    Post subject:  

Update 2017-03-20 (see also initial post)

New vertical layout
One of the weak points of MMview is the layout. Sometimes I wish I could get the chooser out of the way and make the viewer occupy the whole window.
Technically it's no problem to do that by hiding/unhiding the chooser. The show-stopper appears when unhiding: Chooser always reverts to "Recently Used". It's impossible to continue at the previous location. Hiding means resetting and therefore is useless.

Making the chooser narrower is also no option. The left Places pane can't be hidden, its minimum width is fixed at 140px. and the tree widget, displaying the file list, contains a bug since the vertical scrollbar never disappears, even when it's not required. All this makes the chooser unnecessarily wide.

I figured that with a new vertical layout, putting the viewer beneath the chooser, we could gain considerable viewer space without compromising too much chooser functionality.

The new vertical layout is an option and can be switched on/off from the Preferences menu. The chooser height is set at 200px but can be changed in the script by setting the variable CHOOSER_HIGHT. The vertical layout may be especially suitable for reading text

Optimized scaling and layout
In order to provide maximal space for the viewer I fine-tuned image scaling and made many spacings and margins customizable. The section "Window settings" at the beginning of the script contains a couple of variables. E.g. setting all *SPACING and *MARGIN variables to a value of 0 may not look nice but would leave more room to the viewer and would result in slightly larger images.

A very effective way to gain space is hiding the menubar by setting MENUBAR_HIGHT to 1. For keyboard users nothing changes. The menubar is still accessible with F10 and can be used as before.

Support for audio/video files in Tharpup
The script now supports avprobe and avplay. Both tools seem to be compatible with ffprobe and ffplay. Have fun!

Better suppport of SVG files
Tharpup contains a background file FbBox-twilight.jpg, which is not a JPG. According to its MIME it's a SVG, but it's not a "scalable vector graphic" either. It's the equivalent of a JPG, pasted into a DOC document - that's what I receive when I ask my aunt to send me a picture, only that my aunt would not change the DOC extension to JPG. Anyway, MMview now supports such bizarre constructs.

Other changes
- Support for xsel in Fatdog (proposed by SFR)
- some clarification of du output for directories (proposed by mavrothal).
- User settings are now stored separately from tmp files. Directory $HOME/tmp/mm_view is still temporary and will be destroyed by the Puppy shutdown process, but experienced users may change the location to something more permanent like $HOME/.config/mm_view. I prefer to keep the user's system clean from any traces of the script, at least until a proper uninstall process is in place.
mm_view_vertical.jpg
 Description   
 Filesize   85.8 KB
 Viewed   215 Time(s)

mm_view_vertical.jpg

Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 4473
Location: New Zealand

PostPosted: Mon 20 Mar 2017, 13:35    Post subject:  

Just nitpicking but the spelling of height is incorrect in the definitions but not in your notes:
Code:
DEFAULT_HIGHT=500   # Default window height
CHOOSER_WIDTH=500   # Effective only in horizontal layout (default 500)
CHOOSER_HIGHT=200   # Effective only in vertical layout (default 200)
MENUBAR_HIGHT=25 
Back to top
View user's profile Send private message 
Keef


Joined: 20 Dec 2007
Posts: 808
Location: Staffordshire

PostPosted: Mon 20 Mar 2017, 15:48    Post subject:  

As it is a variable, the spelling matters not as long as it is consistent. Besides, that way the variable names are equal length and it looks neater!
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1222
Location: Japan

PostPosted: Mon 20 Mar 2017, 21:36    Post subject:  

I knew somebody would ask...

Thank you, Keef. Highly appreciated Wink
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 4473
Location: New Zealand

PostPosted: Tue 21 Mar 2017, 03:22    Post subject:  

Ok, the spelling police is off to bed for the night.
However I don't see the variable names as all being the same length. Hmmph. May have to hunt out my micrometer tomorrow.
Cool

ps: by the way - you left the "e" out of highly.
Back to top
View user's profile Send private message 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15205
Location: Paradox Realm

PostPosted: Tue 21 Mar 2017, 04:13    Post subject:  

Hey @MochiMoppe

Very Happy

Went to the first post to download latest
Downloaded OK - then told me it would decompress in location and remove original file.

Did not seem to?
Am I at fault?

Also tried from command line . . .
Code:
# gunzip mm_view_20170320.gz

gzip: mm_view_20170320.gz: not in gzip format
#


Incidentally congratulations on a great initiative, I want to look at your code for tips . . . Cool

_________________
Tmxxine Open Source Inter-Dimensional Travel
Back to top
View user's profile Send private message Visit poster's website 
01micko


Joined: 11 Oct 2008
Posts: 8605
Location: qld

PostPosted: Tue 21 Mar 2017, 05:28    Post subject:  

Lobster wrote:
Am I at fault?


Yes.. RTFM .. "Remove fake gz extension" (stated in the 'download' table; "description" row).

I don't like the trend either but hey, I'm _not_ a trend setter.

_________________
Puppy Linux Blog - contact me for access
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 6 of 7 [92 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, 7 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1649s ][ Queries: 15 (0.0138s) ][ GZIP on ]