A custom File & Folder selector.
Ok screenies are the only way here...
yad --file-selection --file-filter="IMAGES | *.png *.jpg" --file-filter="ALL | *.*"
produces the first... see the options list....
yad --file-selection --filename=/root/vincent.jpg --save --confirm-overwrite="Eat More Bananas?"
Provides alternative text for the confirm dialog...second image.
By the way how can GTK2 be set for single click in theshortcuts pane? Set at compile time?
mike
yad --file-selection --file-filter="IMAGES | *.png *.jpg" --file-filter="ALL | *.*"
produces the first... see the options list....
yad --file-selection --filename=/root/vincent.jpg --save --confirm-overwrite="Eat More Bananas?"
Provides alternative text for the confirm dialog...second image.
By the way how can GTK2 be set for single click in theshortcuts pane? Set at compile time?
mike
Hmm i fiddled with the sources a little...
--form spinwheel output is now an integer and not floating... seemed logical and easier for scripts.
Color selector in -form dialog now has 6 digit result not 12.
Removed mysterious error with --notification dialog connected with middle click exit...removed option...in any case it could be added to the right click menu if required.
mike
edit ..update see later post
--form spinwheel output is now an integer and not floating... seemed logical and easier for scripts.
Color selector in -form dialog now has 6 digit result not 12.
Removed mysterious error with --notification dialog connected with middle click exit...removed option...in any case it could be added to the right click menu if required.
mike
edit ..update see later post
Last edited by mikeb on Tue 27 Aug 2013, 21:18, edited 1 time in total.
mikeb; Downloaded your modded Yad dialog, I`ll look at it.
Haven`t seen the shortcuts pane, so I haven`t a clue...
It`s senseable to make a std. filter list to be used for all of the file dialogs.
So to set it in code at startup don`t use an alias with "--file-filter=".
Q: Can no alias and a std. set of aliases be used together? . A: YES...
So filtering at startup, and the popup menu works to choose new filtering.
Mike, you do C programming it appears, ever mess with X ( custom windows ) ?
A way to do away with GTK and QT, and have a rational GUI foundation.
Jasper; Ah yes, that`s what the alias command does, it makes cli commands.
.
Haven`t seen the shortcuts pane, so I haven`t a clue...
It`s senseable to make a std. filter list to be used for all of the file dialogs.
So to set it in code at startup don`t use an alias with "--file-filter=".
Q: Can no alias and a std. set of aliases be used together? . A: YES...
So filtering at startup, and the popup menu works to choose new filtering.
Mike, you do C programming it appears, ever mess with X ( custom windows ) ?
A way to do away with GTK and QT, and have a rational GUI foundation.
Jasper; Ah yes, that`s what the alias command does, it makes cli commands.
.
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....
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
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++..A way to do away with GTK and QT, and have a rational GUI foundation.
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
- Attachments
-
- short.png
- (69.91 KiB) Downloaded 469 times
You`re very skilled Mike, don`t ever let anyone tell you otherwise.
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.
.
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.
.
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
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: Select all
#!/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
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
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
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
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
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
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
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
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
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
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
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.
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.
- Attachments
-
- yad.file.dlg.gz
- (1.25 KiB) Downloaded 365 times
Last edited by sunburnt on Wed 21 Aug 2013, 01:44, edited 1 time in total.
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.
Ok this produces the desired result....
each level of variable nesting reverses the need for quotes it seems.
mike
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 pointI like this way better than Xdialog`s filer and it`s more controllable than the GTK FileDialog.
Ok this produces the desired result....
Code: Select all
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
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 )
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 )