[Lunar-commits] <lunar> Fixed menu driven module installation dialogs

Stefan Wold ratler at lunar-linux.org
Mon Mar 15 19:55:59 CET 2010


commit d8c2fe3ab54eedefb3935848eed5149dc8292433
Author: Stefan Wold <ratler at lunar-linux.org>
Date:   Mon Mar 15 19:55:59 2010 +0100

    Fixed menu driven module installation dialogs
    
    [FIX] Remove module will once again show a module description
    [FIX] Add module for installation is now working again
    [FIX] Adjusted height and width for some dialog windows
---
 sbin/lunar |   27 +++++++++++++++------------
 1 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/sbin/lunar b/sbin/lunar
index 43bac62..67f42b4 100755
--- a/sbin/lunar
+++ b/sbin/lunar
@@ -109,24 +109,25 @@ add_pkgs()  { (
     SECTION=`select_section`
   do
     while
-    show_modules $SECTION ; read
-      MODULE=`$DIALOG  --title "Select module to install please"  \
+      SECTION_MODULES=$(show_modules $SECTION)
+      MODULE=`$DIALOG  --title "Select module to install please" \
                        --item-help                               \
                        --menu                                    \
-                       "$SECTION"                                \
+                       "Section: $SECTION"                       \
                        0 60 10                                   \
-                       $(show_modules $SECTION)`
+                       $SECTION_MODULES`
     do
-      DESCRIPTION=`$MOONBASE/$SECTION/$MODULE/DETAILS`
+      SCRIPT_DIRECTORY=$MOONBASE/$SECTION/$MODULE
+      DESCRIPTION=$(run_module_file $MODULE DETAILS)
 
       if  $DIALOG  --title      "Install $MODULE"  \
                    --yesno      "$DESCRIPTION"    \
-                   0 0
+                   14 76
       then
         push_install_queue  $MODULE
-        $DIALOG  --msgbox  "$MODULE added to the install queue."  0 0
+        $DIALOG  --msgbox  "$MODULE added to the install queue."  5 60
       else
-        $DIALOG  --msgbox  "$MODULE will not be installed."  0 0
+        $DIALOG  --msgbox  "$MODULE will not be installed."  5 60
       fi
     done
   done
@@ -200,15 +201,17 @@ remove_pkgs()	{
                     $INSTALLED_MODULES`
   do
    (
+    SECTION=$(find_section $MODULE)
+    SCRIPT_DIRECTORY=$MOONBASE/$SECTION/$MODULE
     DESCRIPTION=$(run_module_file $MODULE DETAILS)
 
-    if  $DIALOG  --title      "Removal $MODULE"  \
+    if  $DIALOG  --title      "Remove $MODULE"  \
                  --yesno      "$DESCRIPTION"    \
-                 0 0
+                 12 76
     then
       push_remove_queue  $MODULE                                    &&
-      $DIALOG  --msgbox  "$MODULE added to the remove queue."  0 0  ||
-      $DIALOG  --msgbox  "$MODULE is not really installed?"    0 0
+      $DIALOG  --msgbox  "$MODULE added to the remove queue."  5 60  ||
+      $DIALOG  --msgbox  "$MODULE is not really installed?"    5 60
     fi
    )
   done


More information about the Lunar-commits mailing list