Advertisement
s243a

showConfigureInterfaceWindow() - Network Wizard - Puppylinux

Nov 30th, 2016
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.28 KB | None | 0 0
  1. showConfigureInterfaceWindow()
  2. {
  3.   INTERFACE="$1"
  4.  
  5.   initializeConfigureInterfaceWindow
  6.  
  7.   RETVALUE=""
  8.   # 1=Close window 19=Back Button 22=Save configuration
  9.   while true
  10.   do
  11.     buildConfigureInterfaceWindow
  12.    
  13.     I=$IFS; IFS=""
  14.     for STATEMENT in  $(gtkdialog3 --program NETWIZ_Configure_Interface_Window); do
  15.       eval $STATEMENT
  16.     done
  17.     IFS=$I
  18.     clean_up_gtkdialog NETWIZ_Configure_Interface_Window
  19.     unset NETWIZ_Configure_Interface_Window
  20.  
  21.     RETVALUE=$EXIT
  22.     [ "$RETVALUE" = "abort" ] && RETVALUE=1
  23.  
  24.     RETSETUP=99
  25.     case $RETVALUE in
  26.        1 | 19) # close window
  27.           TOPMSG="$(eval echo $L_TOPMSG_Configuration_Cancelled)"
  28.           break
  29.           ;;
  30.       66) # Dougal: add "Done" button to exit (there was a wrong message)
  31.           cleanUpTmp
  32.           exit
  33.           ;;
  34.       10) # AutoDHCP
  35.           # Must kill old dhcpcd first
  36.           killDhcpcd "$INTERFACE"
  37.           sleep 3
  38.           setupDHCP
  39.           RETSETUP=$?
  40.           ;;
  41.       11) # StaticIP
  42.           showStaticIPWindow
  43.           RETSETUP=$?
  44.           ;;
  45.       13) # Test
  46.           testInterface "$INTERFACE"
  47.           RETSETUP=$?
  48.           ;;
  49.       14) # Wireless
  50.           configureWireless "$INTERFACE"
  51.           ;;
  52.       #21) # Help
  53.           #showHelp
  54.           #;;
  55.       22) # Save configuration
  56.           break
  57.           ;;
  58.     esac
  59.  
  60.     # Dougal: define the "Done" button here, so it doesn't appear the first time around...
  61.     DONEBUTTON="<button>
  62.                     <label>$L_BUTTON_Done</label>
  63.                     <input file stock=\"gtk-apply\"></input>
  64.                     <action>EXIT:66</action>
  65.                 </button>"
  66.  
  67.     if [ $RETVALUE -eq 10 ] || [ $RETVALUE -eq 11 ] ; then
  68.       if [ $RETSETUP -ne 0 ] ; then
  69.         TOPMSG="$(eval echo $L_TOPMSG_Configuration_Unsuccessful)
  70. $L_TOPMSG_Configuration_Offer_Try_Again"
  71.       else
  72.         RETVALUE=1
  73.         Xdialog --yesno "$(eval echo $L_TOPMSG_Configuration_Successful)
  74. $L_TOPMSG_Configuration_Offer_To_Save" 0 0
  75.         if [ $? -eq 0 ] ; then
  76.           saveInterfaceSetup "$INTERFACE"
  77.           # Dougal: might add some info in here
  78.           TOPMSG="$(eval echo $L_TOPMSG_Configuration_Successful)
  79. $L_TOPMSG_Configuration_Offer_To_Finish"
  80.         else
  81.           TOPMSG="$(eval echo $L_TOPMSG_Configuration_Successful)
  82. $L_TOPMSG_Configuration_Not_Saved"
  83.         fi
  84.       fi
  85.     fi
  86.  
  87.   done
  88.  
  89. } # end showConfigureInterfaceWindow
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement