Index: tools/config.py
===================================================================
--- tools/config.py	(revision 2d93f1f9242c39f6e8a125f6fc3f2297727f4f04)
+++ tools/config.py	(revision beb39ee30d11ea37ff22e86ba249687416ff6540)
@@ -78,4 +78,7 @@
         else:
             sys.stdout.write('Enter choice number: ')
+
+    def menu(self, text, choices, button, defopt=None):
+        return self.choice(text, [button] + choices)
         
     def choice(self, text, choices, defopt=None):
@@ -103,5 +106,6 @@
         NoDialog.__init__(self)
         self.dlgcmd = os.environ.get('DIALOG','dialog')
-        self.title = 'HelenOS Configuration'
+        self.title = ''
+        self.backtitle = 'HelenOS Kernel Configuration'
         
         if os.system('%s --print-maxsize >/dev/null 2>&1' % self.dlgcmd) != 0:
@@ -120,5 +124,6 @@
             os.close(indesc)
             
-            dlgargs = [self.dlgcmd,'--title',self.title]
+            dlgargs = [self.dlgcmd,'--title',self.title,
+                       '--backtitle', self.backtitle]
             for key,val in kw.items():
                 dlgargs.append('--'+key)
@@ -157,4 +162,26 @@
             return 'y'
         return 'n'
+
+    def menu(self, text, choices, button, defopt=None):
+        text = text + ':'
+        width = '70'
+        height = str(8 + len(choices))
+        args = []
+        for key,val in choices:
+            args.append(key)
+            args.append(val)
+
+        kw = {}
+        if defopt:
+            kw['default-item'] = choices[defopt][0] 
+        res,data = self.calldlg('--cancel-label',button[1],
+                                '--menu',text,height,width,
+                                str(len(choices)),*args,**kw)
+        if res == 1:
+            return button[0]
+        elif res:
+            print data
+            raise EOFError
+        return data
     
     def choice(self, text, choices, defopt=None):
@@ -220,5 +247,5 @@
     return False
 
-def parse_config(input, output, dlg, defaults={}):
+def parse_config(input, output, dlg, defaults={}, askonly=None):
     "Parse configuration file and create Makefile.config on the fly"
     f = file(input, 'r')
@@ -228,4 +255,6 @@
     outf.write('## AUTO-GENERATED FILE, DO NOT EDIT!!! ##\n')
     outf.write('#########################################\n\n')
+
+    asked_names = []
 
     comment = ''
@@ -243,11 +272,5 @@
             cmd = args[0].lower()
             args = args[1:]
-            if cmd == 'askdefault':
-                if isinstance(dlg, DefaultDialog):
-                    continue
-                res = dlg.noyes('Change kernel configuration')
-                if res == 'n':
-                    dlg = DefaultDialog(dlg)
-            elif cmd == 'saveas':
+            if cmd == 'saveas':
                 outf.write('%s = %s\n' % (args[1],defaults[args[0]]))
                 
@@ -263,5 +286,5 @@
 
             default = defaults.get(varname,None)
-
+            
             if res.group(1):
                 if not check_condition(res.group(1), defaults):
@@ -273,4 +296,10 @@
                     choices = []
                     continue
+                
+            asked_names.append((varname,comment))
+
+            if default is not None and askonly and askonly != varname:
+                outf.write('%s = %s\n' % (varname, default))
+                continue
 
             if vartype == 'y/n':
@@ -319,4 +348,5 @@
     outf.close()
     f.close()
+    return asked_names
 
 def main():
@@ -327,13 +357,33 @@
         dlg = NoDialog()
 
+    if len(sys.argv) == 2 and sys.argv[1]=='default':
+        defmode = True
+    else:
+        defmode = False
+
     # Default run will update the configuration file
     # with newest options
-    if len(sys.argv) == 2 and sys.argv[1]=='default':
-        dlg = DefaultDialog(dlg)
-
     if os.path.exists(OUTPUT):
         read_defaults(OUTPUT, defaults)
     
-    parse_config(INPUT, TMPOUTPUT, dlg, defaults)
+    varnames = parse_config(INPUT, TMPOUTPUT, DefaultDialog(dlg), defaults)
+    # If not in default mode, present selection of all possibilities
+    if not defmode:
+        defopt = 0
+        while 1:
+            choices = [ (x[1],defaults[x[0]]) for x in varnames ]
+            res = dlg.menu('Configuration',choices,('save','Save'),defopt)
+            if res == 'save':
+                parse_config(INPUT, TMPOUTPUT, DefaultDialog(dlg), defaults)
+                break
+            # transfer description back to varname
+            for i,(vname,descr) in enumerate(varnames):
+                if res == descr:
+                    defopt = i
+                    break
+            varnames = parse_config(INPUT, TMPOUTPUT, dlg, defaults,
+                                    askonly=varnames[i][0])
+        
+    
     if os.path.exists(OUTPUT):
         os.unlink(OUTPUT)
