Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    How to create dialog to pop up on package install?

    Reply
    Page 2 of 2 | Prev |   1   2 |
    MohammadAG | # 11 | 2010-06-26, 16:04 | Report

    Originally Posted by D-Iivil View Post
    Holy smoke! It's working Kudos to you guys!

    Edit: only "downside" is that zenity window is ugly when it's ran by root (uses GTK default graphics instead of Hildon), but I guess there's nothing that can be done?
    I forgot that HAM runs stuff with sudo and not with "root" (for some reason there's a difference in variables(?)), change it to
    Code:
    run-standalone.sh zenity --question --text="Install custom transitions?" --ok-label=Yes
    I'll check the script in a bit.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    MohammadAG | # 12 | 2010-06-26, 16:25 | Report

    Right, try this.
    Code:
    #! /bin/sh -e
    
    Q=`run-standalone.sh zenity --question --text="Install custom transitions?" --ok-label=Yes; echo $?`
    
    if [ "$Q" = "0" ]; then
          # install the custom things
          echo "User chose yes"
    else
          # do not install the custom things
          echo "User chose no"
    fi
    Haven't tested the script cause I'm not on Maemo (on Ubuntu atm) on the N900, but it works on my PC
    Hope it works

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to MohammadAG For This Useful Post:
    d-iivil

     
    d-iivil | # 13 | 2010-06-26, 16:47 | Report

    Originally Posted by MohammadAG View Post
    Right, try this.
    Code:
    #! /bin/sh -e
    
    Q=`run-standalone.sh zenity --question --text="Install custom transitions?" --ok-label=Yes; echo $?`
    
    if [ "$Q" = "0" ]; then
          # install the custom things
          echo "User chose yes"
    else
          # do not install the custom things
          echo "User chose no"
    fi
    Haven't tested the script cause I'm not on Maemo (on Ubuntu atm) on the N900, but it works on my PC
    Hope it works
    Works like a charm! I was going to come and ask how can I change the return value of zenity to be something else than exit code, but you already posted the answer and now things seems to be rolling just fine

    Best regards to you guys!
    - R

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to d-iivil For This Useful Post:
    MohammadAG

     
    d-iivil | # 14 | 2010-06-27, 18:07 | Report

    Okay... sorry to bother, but I'll have to ask some more quaetions (my googling didn't provide solution), hopefully somebody finds time to answer

    I've got the script working fine during installation, but I would like to provide end user possibility to easily run the "setup script" again so that he can setup the theme differently without having to re-install the whole package.

    My problem is that my script needs root priviledges to run and I cannot find a way to create shortcut to the script with root priviledges.

    What should I do?

    Here's the script:
    Code:
    #! /bin/sh -e
    
    THEMEDIR='/usr/share/themes/blackplastictheme-themedir'
    
    if [ ! -d $THEMEDIR ]; then
      exit 0
    fi
    
    rm -rf /usr/share/themes/blackplastictheme-themedir/gtk-2.0/*.cache
    
    if [ "`readlink /etc/hildon/theme`" = /usr/share/themes/blackplastictheme-themedir ]; then
       if [ -x /usr/bin/personalisation ]; then
    	   /usr/bin/personalisation /usr/share/themes/default
       fi
    fi
    
    Q=`run-standalone.sh zenity --question --text="Enable customized transitions?\n(affects only the Black Plastic theme)\n\nNote: tap outside this window to NOT to enable the transitions\n\n(choose Yes if you don't know what to do)" --ok-label=Yes; echo $?`
    
    if [ "$Q" = "0" ]; then
          # install the custom things
         	cp -rf /usr/share/themes/blackplastictheme-themedir/transitions.tmp /usr/share/themes/blackplastictheme-themedir/transitions.ini
    
    else
    
    	rm -rf /usr/share/themes/blackplastictheme-themedir/transitions.ini
    
    fi
    
    Q2=`run-standalone.sh zenity  --list  --text "Choose color scheme" --radiolist  --column "Pick" --column "Scheme" TRUE Black FALSE Blue FALSE Orange FALSE Pink; echo $ans`
    
    if [ "$Q2" = "Black" ]; then
    
    	cp -rf /usr/share/themes/blackplastictheme-themedir/variations/black/* /usr/share/themes/blackplastictheme-themedir/
    
    elif [ "$Q2" = "Blue" ]; then
    
    	cp -rf /usr/share/themes/blackplastictheme-themedir/variations/blue/* /usr/share/themes/blackplastictheme-themedir/
    
    elif [ "$Q2" = "Orange" ]; then
    
    	cp -rf /usr/share/themes/blackplastictheme-themedir/variations/orange/* /usr/share/themes/blackplastictheme-themedir/
    
    elif [ "$Q2" = "Pink" ]; then
    
    	cp -rf /usr/share/themes/blackplastictheme-themedir/variations/pink/* /usr/share/themes/blackplastictheme-themedir/
    
    fi
    
    hildon-theme-cacher $THEMEDIR
    
    Q3=`run-standalone.sh zenity --info --text="Done! Remember to do a reboot after you have selected Black Plastic Theme to use."`
    
    exit 0

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Page 2 of 2 | Prev |   1   2 |
vBulletin® Version 3.8.8
Normal Logout