LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-20-2013, 11:24 AM   #1
defila
LQ Newbie
 
Registered: Aug 2013
Posts: 14

Rep: Reputation: Disabled
Zenity+file dialog+limitation ?


Hi guys,

I did play with simple script but from some reason the filesection dialog won't take the input from FTP, May I know why ? I tried to create function and pipe it into zenity (second example of code) but it failed again 'cause --filename is additional parameter and the function is not redirected into it
IS it possible to redirect the structure of folders on FTP into filedialog?

Code:
test=$(
ftp -in <<+
open $IP $PORT
user $user $pwd
cd $dir
ls
bye
+
)
zenity --file-selection --filename="$test"
Second example
Code:
test () {
ftp -in <<+
open $IP $PORT
user $user $pwd
cd $dir
ls
bye
+
}
test | zenity --file-selection --filename=test
 
Old 10-20-2013, 01:11 PM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Try
Code:
ftpls () {
ftp -in <<+
open $IP $PORT
user $user $pwd
cd $dir
ls
bye
+
}
and then
Code:
zOpen=$(zenity --entry); ftpls $zOpen" | zenity --text-info --width 500 --height 400
I'd stay away from 'test', as it may be a reserved word in your shell.
 
Old 10-20-2013, 01:30 PM   #3
defila
LQ Newbie
 
Registered: Aug 2013
Posts: 14

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Habitual View Post
Try
Code:
ftpls () {
ftp -in <<+
open $IP $PORT
user $user $pwd
cd $dir
ls
bye
+
}
and then
Code:
zOpen=$(zenity --entry); ftpls $zOpen" | zenity --text-info --width 500 --height 400
I'd stay away from 'test', as it may be a reserved word in your shell.
Thanks :}

anyway, it seems like a similar approach which I have already tried before with --list value for zenity, e.g.like this
below code will generate quite similar output

My question is if is it possible to use file-selection dialog directly ... the path of the files is identified with additional flag "--filename" which seems to be unable to get its input from function -> it is possible to retrieve the input from variable which i have tested on the local drive but I am unable to paste the function into it and get the output from FTP
Code:
folder () {
ftp -in <<+
open $IP $PORT
user $user $pwd
cd $dir
ls
bye
+
}
folder | zenity --width=100 --height=400 --list --column "Folders"
 
Old 10-20-2013, 02:32 PM   #4
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by defila View Post
My question is if is it possible to use file-selection dialog directly ... the path of the files is identified with additional flag "--filename" which seems to be unable to get its input from function -> it is possible to retrieve the input from variable which i have tested on the local drive but I am unable to paste the function into it and get the output from FTP
Are able to get the ftpls output redirected to a local file?

I believe you are misusing the "--file-selection --filename=test" combination.

Have a look at http://tildehash.com/?article=advanc...ts-with-zenity
for some great examples.

subscribed with interest...
 
Old 10-25-2013, 03:52 AM   #5
defila
LQ Newbie
 
Registered: Aug 2013
Posts: 14

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Habitual View Post
Are able to get the ftpls output redirected to a local file?

I believe you are misusing the "--file-selection --filename=test" combination.

Have a look at http://tildehash.com/?article=advanc...ts-with-zenity
for some great examples.

subscribed with interest...
Thanks :}, I have played with it a little bit and it solved my issue :}
 
Old 10-25-2013, 06:55 AM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
You are very welcome.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Zenity - force one dialog / window over another stan79 Linux - General 8 08-10-2013 04:05 PM
GUI Dialog Box w/embedded terminal window. eg. Zenity? ... Sean Moran Linux - Software 2 06-23-2011 03:16 AM
show for-loop result in one zenity dialog Dr_Death_UAE Programming 3 11-01-2009 03:04 PM
Improve the zenity dialog box....... shivarajM Linux - Software 1 05-02-2009 06:08 AM
program output displayed in zenity/ gdialog/ dialog schneidz Programming 1 12-05-2006 02:27 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration