1 |
charlieb |
1.1 |
# |
2 |
|
|
# installpath_text: text mode installation type selection dialog |
3 |
|
|
# |
4 |
|
|
# Copyright 2001-2002 Red Hat, Inc. |
5 |
|
|
# |
6 |
|
|
# This software may be freely redistributed under the terms of the GNU |
7 |
|
|
# library public license. |
8 |
|
|
# |
9 |
|
|
# You should have received a copy of the GNU Library Public License |
10 |
|
|
# along with this program; if not, write to the Free Software |
11 |
|
|
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
12 |
|
|
# |
13 |
|
|
|
14 |
|
|
from snack import * |
15 |
|
|
from constants_text import * |
16 |
|
|
from rhpl.translate import _ |
17 |
|
|
from flags import flags |
18 |
|
|
import installclass |
19 |
|
|
|
20 |
|
|
class InstallPathWindow: |
21 |
|
|
def __call__ (self, screen, dispatch, id, method, intf): |
22 |
|
|
tmpclasses = installclass.availableClasses() |
23 |
|
|
|
24 |
|
|
# strip out '_' in names cause we dont do mnemonics in text mode |
25 |
|
|
classes = [] |
26 |
|
|
for (n, o, l) in tmpclasses: |
27 |
|
|
n2 = n.replace("_", "") |
28 |
|
|
classes.append((n2, o, l)) |
29 |
|
|
|
30 |
|
|
choices = [] |
31 |
|
|
default = 0 |
32 |
|
|
i = 0 |
33 |
|
|
orig = None |
34 |
|
|
|
35 |
|
|
for (name, object, icon) in classes: |
36 |
|
|
choices.append(_(name)) |
37 |
|
|
|
38 |
|
|
if isinstance(id.instClass, object): |
39 |
|
|
orig = i |
40 |
|
|
elif object.default: |
41 |
|
|
default = i |
42 |
|
|
|
43 |
|
|
i = i + 1 |
44 |
|
|
|
45 |
|
|
if orig != None: |
46 |
|
|
default = orig |
47 |
|
|
|
48 |
|
|
choice = default |
49 |
slords |
1.6 |
rc = intf.messageWindow(_("Warning"), |
50 |
charlieb |
1.1 |
_("All disks will be reformatted and any data will be lost. Proceed?"), |
51 |
gordonr |
1.5 |
type = "yesno", default = "no") |
52 |
charlieb |
1.1 |
|
53 |
slords |
1.6 |
if rc == 0: |
54 |
charlieb |
1.1 |
return INSTALL_BACK |
55 |
|
|
|
56 |
|
|
if (choice != orig): |
57 |
|
|
(name, objectClass, logo) = classes[choice] |
58 |
|
|
c = objectClass(flags.expert) |
59 |
|
|
c.setSteps(dispatch) |
60 |
|
|
c.setInstallData(id) |
61 |
|
|
|
62 |
|
|
return INSTALL_OK |
63 |
|
|
|