Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- showConfigureInterfaceWindow()
- {
- INTERFACE="$1"
- initializeConfigureInterfaceWindow
- RETVALUE=""
- # 1=Close window 19=Back Button 22=Save configuration
- while true
- do
- buildConfigureInterfaceWindow
- I=$IFS; IFS=""
- for STATEMENT in $(gtkdialog3 --program NETWIZ_Configure_Interface_Window); do
- eval $STATEMENT
- done
- IFS=$I
- clean_up_gtkdialog NETWIZ_Configure_Interface_Window
- unset NETWIZ_Configure_Interface_Window
- RETVALUE=$EXIT
- [ "$RETVALUE" = "abort" ] && RETVALUE=1
- RETSETUP=99
- case $RETVALUE in
- 1 | 19) # close window
- TOPMSG="$(eval echo $L_TOPMSG_Configuration_Cancelled)"
- break
- ;;
- 66) # Dougal: add "Done" button to exit (there was a wrong message)
- cleanUpTmp
- exit
- ;;
- 10) # AutoDHCP
- # Must kill old dhcpcd first
- killDhcpcd "$INTERFACE"
- sleep 3
- setupDHCP
- RETSETUP=$?
- ;;
- 11) # StaticIP
- showStaticIPWindow
- RETSETUP=$?
- ;;
- 13) # Test
- testInterface "$INTERFACE"
- RETSETUP=$?
- ;;
- 14) # Wireless
- configureWireless "$INTERFACE"
- ;;
- #21) # Help
- #showHelp
- #;;
- 22) # Save configuration
- break
- ;;
- esac
- # Dougal: define the "Done" button here, so it doesn't appear the first time around...
- DONEBUTTON="<button>
- <label>$L_BUTTON_Done</label>
- <input file stock=\"gtk-apply\"></input>
- <action>EXIT:66</action>
- </button>"
- if [ $RETVALUE -eq 10 ] || [ $RETVALUE -eq 11 ] ; then
- if [ $RETSETUP -ne 0 ] ; then
- TOPMSG="$(eval echo $L_TOPMSG_Configuration_Unsuccessful)
- $L_TOPMSG_Configuration_Offer_Try_Again"
- else
- RETVALUE=1
- Xdialog --yesno "$(eval echo $L_TOPMSG_Configuration_Successful)
- $L_TOPMSG_Configuration_Offer_To_Save" 0 0
- if [ $? -eq 0 ] ; then
- saveInterfaceSetup "$INTERFACE"
- # Dougal: might add some info in here
- TOPMSG="$(eval echo $L_TOPMSG_Configuration_Successful)
- $L_TOPMSG_Configuration_Offer_To_Finish"
- else
- TOPMSG="$(eval echo $L_TOPMSG_Configuration_Successful)
- $L_TOPMSG_Configuration_Not_Saved"
- fi
- fi
- fi
- done
- } # end showConfigureInterfaceWindow
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement