Installer import into contrib (real import this time)
[dragonfly.git] / contrib / bsdinstaller-1.1.6 / src / backend / lua / configure / 200_select_disk.lua
1 -- $Id: 200_select_disk.lua,v 1.5 2005/02/24 23:08:03 cpressey Exp $
2
3 require "gettext"
4 require "storage_ui"
5
6 return {
7     name = "select_disk",
8     title = "Select Disk",
9     action = function(fsm)
10         App.state.sel_disk = nil
11         App.state.sel_part = nil
12
13         -- XXX there might be a better place to handle this.
14         if App.state.storage:get_disk_count() == 0 then
15                 App.ui:inform(_(
16                     "The installer could not find any suitable disks "  ..
17                     "attached to this computer.  If you wish to "       ..
18                     "configure an installation of %s "                  ..
19                     "on an unorthodox storage device, you will have to " ..
20                     "exit to a LiveCD command prompt and configure it " ..
21                     "manually, using the file /README as a guide.",
22                     App.os.name)
23                 )
24                 return nil
25         end
26
27         local dd = StorageUI.select_disk({
28             sd = App.state.storage,
29             short_desc = _(
30                 "Select the disk on which the installation of %s " ..
31                 "that you wish to configure resides.",
32                 App.os.name),
33             cancel_desc = _("Return to Main") -- _("Return to %s", fsm:prev().title)
34         })
35
36         if dd then
37                 App.state.sel_disk = dd
38                 return fsm:next()
39         else
40                 return nil -- fsm:prev()
41         end
42     end
43 }