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 Wed 23 Apr 2014, 20:23
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
A custom File & Folder selector.
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 4 of 7 [97 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, 7 Next
Author Message
mikeb


Joined: 23 Nov 2006
Posts: 7217

PostPosted: Thu 15 Aug 2013, 15:42    Post subject:  

Well its nice to have an option...eg for pburn I can avoid a huge list of mp3 when all I want is the pburn file....the alias option is just for user friendliness and not essential....

Quote:
A way to do away with GTK and QT, and have a rational GUI foundation.

I am a bad hacker,,,I find C akin to double dutch though realising what a low level language it is it at least makes a little more sense to me....as for C++..
It does not come naturally like other languages I play with.

FLTK looks nice but has never taken off as a major alternative.

The shortcut pane is... see piccie... see how skilled I am with a mouse.
mike
short.png
 Description   
 Filesize   69.91 KB
 Viewed   331 Time(s)

short.png

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


Joined: 08 Jun 2005
Posts: 4985
Location: Arizona, U.S.A.

PostPosted: Thu 15 Aug 2013, 16:38    Post subject:  

You`re very skilled Mike, don`t ever let anyone tell you otherwise. Wink

FLTK is pretty spartan from what I`ve seen in Tiny Core Linux.

Ahhh, the Places pane...


I hate wasted space, the file dialog puts the filter aliases above the buttons.
It should be next to the buttons, then the panes would be proper full height.
.
Back to top
View user's profile Send private message 
greengeek

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

PostPosted: Thu 15 Aug 2013, 18:34    Post subject:  

sunburnt wrote:
You`re very skilled Mike, don`t ever let anyone tell you otherwise. Wink .
Except when it comes to making straight arrows Smile
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 7217

PostPosted: Thu 15 Aug 2013, 19:00    Post subject:  

Yes I forgot there was a drawing tablet attached.... Mr smiley was relieved I noticed it eventually,

I wonder if this is why I have only once been asked to write technical documentation?

I am on the blunt side of the cutting edge....

mike
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 4985
Location: Arizona, U.S.A.

PostPosted: Fri 16 Aug 2013, 23:54    Post subject:  

Got most of it working, but the file filters is just kicking my arse.

Anyone see anything that`s wrong with this picture?

There`s test code at the bottom that shows the command line.

For help type: yfiledlg -h
Code:
#!/bin/sh
#########   Setup a Yad file/dir. selector.

#####   Usage:  yad_filer [-f,-d,-m,-s,-t][-o /path/file][-p /path,-g W, H, X, Y][-x ext.]


appP=`dirname $0`
i=1

all='--file-filter="All | *"'            #####   Combo list of file groups.
hid='--file-filter="Hidden | .*"'
doc='--file-filter="Document | *.txt *.pdf *.doc *.docx *.xml *.htm* *.pps *.ppt* *.csv"'
img='--file-filter="Image | *.jpg *.jpeg *.png *.xpm *.svg *.ico *.bmp *.tif, *.gif"'
aud='--file-filter="Audio | *.mp3 *.mp2 *.wma *.ogg *.aac *.ac3 *.flac *.m4a *.wav'
aud=$aud' *.m4a *.m4b *.m3u *.m1a *.mka *.mpa *.pcm *.midi *.mid *.m4p *.m4r"'
vid='--file-filter="Video | *.mp4 *.m4v *.ogm *.wmv *.wmx *.mpe *.mpeg *.mpg *.avi *.vob'
vid=$vid' *.mov *.qt *.mpeg-1 *.mpeg-2 *.mp2v *.m2v *.m2s *.mpa *.mp2 *.m2a *.asf *.asx *.swf"'


while [ $i -le $# ]                     #####   Loop:  Parse command args.
do
   case `echo $@ |cut -d' ' -f$i` in

   -f) args="$args --file" ; ((i=i+1)) ;;                              # file dialog

   -d) args="$args --directory" ; ((i=i+1)) ;;                           # folder dialog

   -m) args="$args --multiple" ; ((i=i+1)) ;;                           # multi. select

   -s) args="$args --save" ; ((i=i+1)) ;;                              # save file

   -o) eval O=\${$((i+1))} ; Txt=`cat $O`                              # overwrite file
         args="$args --confirm-overwrite=$Txt" ; ((i=i+2)) ;;

   -p) eval O=\${$((i+1))} ; args="$args --filename=$O" ; ((i=i+2)) ;;         # startup /path

   -x) eval O=\${$((i+1))} ; args="$args --file-filter=$O" ; ((i=i+2)) ;;      # extension filters

   -t) TB=55 ; ((i=i+1)) ;;                                       # taskbar offset

                                                            # window geometry
   -g) eval W=\${$((i+1))} ; eval H=\${$((i+2))} ; eval X=\${$((i+3))} ; eval Y=\${$((i+4))}

         scrW=$((`xwininfo -root |grep '\-geo' |sed 's#.* ##;s#x.*##'`-5))
#         scrW=`xwininfo -root |grep '\-geo' |sed 's#.* ##;s#x.*##'`
         [ $W -gt $scrW ]&& W=$scrW                                 # fix W
         [ $((W+X)) -gt $scrW ]&& X=$((scrW-W))                        # fix X

         scrH=`xwininfo -root |grep '\-geo' |sed 's#.*x##;s#+.*##'`
         [ $H -gt $scrH ]&& H=$((scrH-TB))                           # fix H
         [ $((H+Y)) -gt $scrH ]&& Y=$((scrH-H-TB))                     # fix Y

         args="$args --geometry=${W}x${H}+${X}+${Y}" ; ((i=i+5)) ;;
                                                            # help
   -h) echo -e '\n\t\t#####\tyFileDlg\n\n\t# Usage:  yFileDlg [opt.1] [opt.2] ...\n'
         echo -e '\tFile open:  -f\n\tDirectory open:  -d\n\tPath:  -p /path/'
         echo -e '\tSave file:  -s\n\tOverwrite file:  -o filename'
         echo -e '\tMultiple files & folders:  -m\n\tExtension patterns:  -x *.txt *.doc'
         echo -e '\tGeometry:  -g W H X Y\n\tTaskbar offset:  -t  ( Comes before -g )\n'
         exit ;;
   esac
done


echo -e "\nScreen W x H  =  $scrW x $scrH\n\nYAD$args $all $hid $doc $img $aud $vid\n"

yad $args $all $hid $doc $img $aud $vid
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 7217

PostPosted: Sat 17 Aug 2013, 06:47    Post subject:  

tis a bash thingy it seems... this test works interminal

tart=--file-filter="Image | *.jpg *.jpeg *.png *.xpm *.svg *.ico *.bmp *.tif *.gif" ; yad --file-selection --filename=/mnt/hda2/ --geometry=600x400+20+20 "$tart"

so no wrapper quotes for making the variable and double quote in the command line...

note there is a slipped in ',' in the img variable in your script...

tested the above in a quick script and it worked...

mike
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 4985
Location: Arizona, U.S.A.

PostPosted: Sat 17 Aug 2013, 14:36    Post subject:  

Many thanks Mike; After a bit of fiddling I got the filters working.

--confirm-overwrite= doesn`t show the text. Last item I think.

But this is minor stuff, I`ll figure it out. Thanks again... Terry
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 7217

PostPosted: Sat 17 Aug 2013, 16:09    Post subject:  

Hmm might need quotes again.
To test it you open with --filename=existing_file and then ok... should prompt the popup if you did not know already.

Generally all my testing has been done on gtk 2.12 ... I assume you are using a more recent release which does at least confirm compatability.

With the filebrowser and other widgets one hopes to use it rather than a combination of (g)xmessage, Xdialog, yafsplash, gtklogfileviewer in conjunction with gtkdialog without the more dubious of the latters functions.

Well one has no brain so time to flee

mike
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 4985
Location: Arizona, U.S.A.

PostPosted: Sat 17 Aug 2013, 22:30    Post subject:  

I`ll keep fiddling. It`s close to being more automated and easier to use.

Yeah, like another thread I`m following, Puppy`s a monster mash of O.S. parts.

But there`s a few variants that attempt to fix this with Xfce, or Lxde, or ???
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 7217

PostPosted: Sun 18 Aug 2013, 07:12    Post subject:  

Hmm a unified desktop like Xfce4 can help.... trying to have a common system can only be of benefit. Actually on puppy I use an old approach of early xfce4 plus Rox which is a light fast method but does give a more unified taskbar, useful additions and a complient menu system...no hacky scripts needed. I also recently added those alternative drive icons...the ones driven by binaries and they are so much easier/lighter to work with especially for multiuser. Scripts are useful but overuse has its drawbacks.

As for puppy as a whole compiling it as an independant distro would make much more sense...after all ubuntu and slackware are hardly minimalist and there are some rediculous dependancies. I cut memory footprint of mplayer down 50% just by rebuilding with only whats needed as a media player as an example.

But I digress but its your thread so we can without any tantrums Very Happy

have fun

mike

hijacking another thread by using this one lol...death to /usr/bin/bootmanager. As I found with japanese motorbikes the more I removed the better they ran Wink
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 4985
Location: Arizona, U.S.A.

PostPosted: Sun 18 Aug 2013, 16:05    Post subject:  

Hey Mike; Nearly ready to post my wrapper script for the yad Filer.

# I`m thinking that the --confirm-overwrite should just be a permanent "save" default.

I can`t think of a circumstance that overwriting a file without warning is a good idea.

What do you think?
.
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 7217

PostPosted: Sun 18 Aug 2013, 19:59    Post subject:  

Hmm yes.... I would say thats expected behaviour.

It definately saves the script writer having to add a check and perhaps it should be default in the binary too. I will double check if there are any drawbacks on that one.

Today I am in NT4 land posting in Opera 10 so will play tomorrow....

regards

Mike
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 4985
Location: Arizona, U.S.A.

PostPosted: Tue 20 Aug 2013, 15:00    Post subject:  

Can`t get the Save Overwrite Text to accept spaces no matter what I try.
So I did the usual Linux thing of substituting underlines.

I like this way better than Xdialog`s filer and it`s more controllable than the GTK FileDialog.
This is my new filer for any Puppy apps. I make. Other distros. may not have Yad in them.

Here`s the wrapper script that mods. the Yad File Dialog.
yad.file.dlg.gz
Description 
gz

 Download 
Filename  yad.file.dlg.gz 
Filesize  1.25 KB 
Downloaded  149 Time(s) 

Last edited by sunburnt on Tue 20 Aug 2013, 21:44; edited 1 time in total
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 7217

PostPosted: Tue 20 Aug 2013, 17:21    Post subject:  

args="$args --confirm-overwrite=$Txt".... hmm perhaps some escaping needed.... as an original rather than generated command line it behaves...or it does for me.
Quote:

I like this way better than Xdialog`s filer and it`s more controllable than the GTK FileDialog.

Yes it reaches the parts others do not...plus some other useful functions in there...I have yet to fully utilise it but will have a frenzy at some point

Ok this produces the desired result....
Code:
TXT="Butt Cheek" ; ARGS="--confirm-overwrite=$TXT" ; yad --file-selection --save --filename=app.log "$ARGS"



each level of variable nesting reverses the need for quotes it seems.

mike
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 4985
Location: Arizona, U.S.A.

PostPosted: Tue 20 Aug 2013, 21:25    Post subject:  

Hey Mike; I pasted your code and Yad didn`t even give a Save dialog, it was a dir. dialog!

I`ve about had it with Bash not handling command lines and spaces.
And then the apps. join in and add insult to injury.

I`m just going to use underlines, it`s okay...

I uploaded a newer one, all it does is check for Yad and error if it`s not found. ( Portability )
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 4 of 7 [97 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 » Advanced Topics » Cutting edge
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.1075s ][ Queries: 13 (0.0312s) ][ GZIP on ]