![]() |
2010-06-26
, 08:36
|
|
Posts: 2,154 |
Thanked: 2,186 times |
Joined on Dec 2009
@ Hellsinki, Finland
|
#2
|
![]() |
2010-06-26
, 08:40
|
Posts: 724 |
Thanked: 1,255 times |
Joined on Nov 2007
@ Cambridge, UK
|
#3
|
The Following User Says Thank You to tswindell For This Useful Post: | ||
![]() |
2010-06-26
, 08:52
|
|
Posts: 2,154 |
Thanked: 2,186 times |
Joined on Dec 2009
@ Hellsinki, Finland
|
#4
|
postinst is what you're looking for, you can run xterm from there, but popping up a dialog is much more user friendly. You can do that by writing a program to handle the dialog and executing it from the postinst script.
![]() |
2010-06-26
, 13:54
|
|
Posts: 2,154 |
Thanked: 2,186 times |
Joined on Dec 2009
@ Hellsinki, Finland
|
#5
|
![]() |
2010-06-26
, 14:03
|
|
Posts: 2,473 |
Thanked: 12,265 times |
Joined on Oct 2009
@ Jerusalem, PS/IL
|
#6
|
zenity --question --text="Install custom transitions?" --ok-label=Yes
The Following User Says Thank You to MohammadAG For This Useful Post: | ||
![]() |
2010-06-26
, 14:20
|
Posts: 94 |
Thanked: 253 times |
Joined on Jan 2010
@ Virginia
|
#7
|
Hello,
is it possible to show user a dialog window asking yes / no question when he install a package via HAM?
I would like to make a theme package that will include some optional stuff and I'd like to ask user if he wants to install those extras or not. And if user presses "yes" then some shell commands are ran in the background, and if he answers no then other actions are taken.
Can someone provide some help? Thanks in advance!
![]() |
2010-06-26
, 14:50
|
|
Posts: 2,154 |
Thanked: 2,186 times |
Joined on Dec 2009
@ Hellsinki, Finland
|
#8
|
Talked about this with tswindell but since he's offline I guess I'll post this.
Use zenity (I already had it installed, not sure if it comes preinstalled, if not just Depend on it) to display a dialog, see what the exit code is (if the user accepts it's 0, otherwise it's 1).
http://maemo.org/packages/view/zenity/
should do.Code:zenity --question --text="Install custom transitions?" --ok-label=Yes
To see the exit code (again, thanks to tswindell) add ;echo $? to the end.
If that works, thank his post above
#! /bin/sh -e zenity --question --text="Install custom transitions?" --ok-label=Yes if [ "$?" == "0" ]; then # install the custom things exit 0 else # do not install the custom things exit 0 fi
![]() |
2010-06-26
, 15:07
|
|
Posts: 2,154 |
Thanked: 2,186 times |
Joined on Dec 2009
@ Hellsinki, Finland
|
#9
|
Cool! So I can get the user's answer just by using $? ?
To be more clear, would this be workable (the postinst -file):
Code:#! /bin/sh -e zenity --question --text="Install custom transitions?" --ok-label=Yes if [ "$?" == "0" ]; then # install the custom things exit 0 else # do not install the custom things exit 0 fi
![]() |
2010-06-26
, 15:58
|
|
Posts: 2,154 |
Thanked: 2,186 times |
Joined on Dec 2009
@ Hellsinki, Finland
|
#10
|
is it possible to show user a dialog window asking yes / no question when he install a package via HAM?
I would like to make a theme package that will include some optional stuff and I'd like to ask user if he wants to install those extras or not. And if user presses "yes" then some shell commands are ran in the background, and if he answers no then other actions are taken.
Can someone provide some help? Thanks in advance!
If you're rich and you think I deserve a cold beer, you may donate one or two :-P
80's style stadium rock is back - FIRENOTE
Hi-Octane heavy metal - FORCE MAJEURE