/[gli]/branches/overhaul/src/fe/gtk/Stage.py
Gentoo

Diff of /branches/overhaul/src/fe/gtk/Stage.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1647 Revision 1648
40""" 40"""
41 41
42 def __init__(self, controller): 42 def __init__(self, controller):
43 GLIScreen.GLIScreen.__init__(self, controller) 43 GLIScreen.GLIScreen.__init__(self, controller)
44 44
45 self.has_systempkgs = GLIUtility.is_file("/usr/livecd/systempkgs.txt")
46
47 vert = gtk.VBox(False, 0) 45 vert = gtk.VBox(False, 0)
48 vert.set_border_width(10) 46 vert.set_border_width(10)
49 47
48 if self.controller.install_type == "networkless":
49 hbox = gtk.HBox(False, 0)
50 label = gtk.Label()
51 label.set_markup('<b>Your base system will be created from files on the LiveCD.</b>')
52 hbox.pack_start(label, expand=False, fill=False, padding=5)
53 vert.pack_start(hbox, expand=False, fill=False, padding=10)
54 else:
50 self.radio_fetchstage = gtk.RadioButton(None, "Fetch stage from internet") 55 self.radio_fetchstage = gtk.RadioButton(None, "Fetch stage from internet")
51 self.radio_fetchstage.set_name("fetch") 56 self.radio_fetchstage.set_name("fetch")
52 self.radio_fetchstage.connect("toggled", self.stage_selected, "fetch") 57 self.radio_fetchstage.connect("toggled", self.stage_selected, "fetch")
53# self.radio_fetchstage.set_size_request(100, -1)
54 hbox = gtk.HBox(False, 0) 58 hbox = gtk.HBox(False, 0)
55 hbox.pack_start(self.radio_fetchstage, expand=False, fill=False, padding=5) 59 hbox.pack_start(self.radio_fetchstage, expand=False, fill=False, padding=5)
56 vert.pack_start(hbox, expand=False, fill=False, padding=10) 60 vert.pack_start(hbox, expand=False, fill=False, padding=10)
57 61
58 hbox = gtk.HBox(False, 0) 62 hbox = gtk.HBox(False, 0)
59 hbox.pack_start(gtk.Label("Stage tarball URI:"), expand=False, fill=False, padding=30) 63 hbox.pack_start(gtk.Label("Stage tarball URI:"), expand=False, fill=False, padding=30)
60 self.entry_stage_tarball_uri = gtk.Entry() 64 self.entry_stage_tarball_uri = gtk.Entry()
61 self.entry_stage_tarball_uri.set_width_chars(70) 65 self.entry_stage_tarball_uri.set_width_chars(70)
62 hbox.pack_start(self.entry_stage_tarball_uri, expand=False, fill=False, padding=0) 66 hbox.pack_start(self.entry_stage_tarball_uri, expand=False, fill=False, padding=0)
63 self.browse_uri = gtk.Button("Browse") 67 self.browse_uri = gtk.Button("Browse")
64 self.browse_uri.connect("clicked", self.browse_uri_clicked) 68 self.browse_uri.connect("clicked", self.browse_uri_clicked)
65 hbox.pack_start(self.browse_uri, expand=False, fill=False, padding=0) 69 hbox.pack_start(self.browse_uri, expand=False, fill=False, padding=0)
66 vert.pack_start(hbox, expand=False, fill=False, padding=5) 70 vert.pack_start(hbox, expand=False, fill=False, padding=5)
67 71
68# self.check_grp = gtk.CheckButton("GRP Install")
69# self.check_grp.set_sensitive(False)
70# self.check_grp.set_size_request(100, -1)
71# hbox = gtk.HBox(False, 0)
72# hbox.pack_start(self.check_grp, expand=False, fill=False, padding=5)
73# tmplabel = gtk.Label("Any extra packages installed (beyond the stage3) will be installed using binaries from the LiveCD that you are installing from")
74# tmplabel.set_line_wrap(True)
75# hbox.pack_start(tmplabel, expand=False, fill=False, padding=20)
76# vert.pack_start(hbox, expand=False, fill=False, padding=10)
77
78 self.radio_dynamicstage = gtk.RadioButton(self.radio_fetchstage, "Build stage from files on LiveCD") 72 self.radio_dynamicstage = gtk.RadioButton(self.radio_fetchstage, "Build stage from files on LiveCD")
79 self.radio_dynamicstage.set_name("dynamic") 73 self.radio_dynamicstage.set_name("dynamic")
80 self.radio_dynamicstage.connect("toggled", self.stage_selected, "dynamic") 74 self.radio_dynamicstage.connect("toggled", self.stage_selected, "dynamic")
81# self.radio_dynamicstage.set_size_request(100, -1)
82 hbox = gtk.HBox(False, 0) 75 hbox = gtk.HBox(False, 0)
83 hbox.pack_start(self.radio_dynamicstage, expand=False, fill=False, padding=5) 76 hbox.pack_start(self.radio_dynamicstage, expand=False, fill=False, padding=5)
84 vert.pack_start(hbox, expand=False, fill=False, padding=40) 77 vert.pack_start(hbox, expand=False, fill=False, padding=40)
85 78
86 self.add_content(vert) 79 self.add_content(vert)
87 80
88 def browse_uri_clicked(self, widget): 81 def browse_uri_clicked(self, widget):
89 uribrowser = URIBrowser.URIBrowser(self, self.entry_stage_tarball_uri) 82 uribrowser = URIBrowser.URIBrowser(self, self.entry_stage_tarball_uri)
101 self.controller.SHOW_BUTTON_BACK = False 94 self.controller.SHOW_BUTTON_BACK = False
102 self.controller.SHOW_BUTTON_FORWARD = True 95 self.controller.SHOW_BUTTON_FORWARD = True
103 self.entry_stage_tarball_uri.set_text(self.controller.install_profile.get_stage_tarball_uri()) 96 self.entry_stage_tarball_uri.set_text(self.controller.install_profile.get_stage_tarball_uri())
104# self.check_grp.set_active(self.controller.install_profile.get_grp_install()) 97# self.check_grp.set_active(self.controller.install_profile.get_grp_install())
105# self.check_dynamic.set_active(self.controller.install_profile.get_dynamic_stage3()) 98# self.check_dynamic.set_active(self.controller.install_profile.get_dynamic_stage3())
106# if self.controller.install_type == "networkless":
107 99
108 def deactivate(self): 100 def next(self):
109# if not self.check_dynamic.get_active(): 101 if self.controller.install_type == "networkless":
102 self.controller.install_profile.set_install_stage(None, 3, None)
103 self.controller.install_profile.set_dynamic_stage3(None, True, None)
104 else:
105 if self.radio_fetchstage.get_active():
110# if not self.entry_stage_tarball_uri.get_text(): 106 uri = self.entry_stage_tarball_uri.get_text().strip()
107 if not uri:
111# msgdlg = gtk.MessageDialog(parent=self.controller.window, type=gtk.MESSAGE_QUESTION, buttons=gtk.BUTTONS_YES_NO, message_format="You did not enter a stage tarball URI. You cannot complete an installation until you set this value. Continue?") 108 msgdlg = gtk.MessageDialog(parent=self.controller.window, type=gtk.MESSAGE_WARNING, buttons=gtk.BUTTONS_OK, message_format="You did not enter a stage tarball URI. You cannot continue until you set this value.")
112# resp = msgdlg.run() 109 resp = msgdlg.run()
113# msgdlg.destroy() 110 msgdlg.destroy()
114# if resp == gtk.RESPONSE_NO:
115# return False 111 return
116# elif not GLIUtility.validate_uri(self.entry_stage_tarball_uri.get_text()): 112 if not GLIUtility.validate_uri(uri):
117# msgdlg = gtk.MessageDialog(parent=self.controller.window, type=gtk.MESSAGE_QUESTION, buttons=gtk.BUTTONS_YES_NO, message_format="The stage tarball URI you entered does not exist. You cannot complete an installation until this value is a valid. Continue?") 113 msgdlg = gtk.MessageDialog(parent=self.controller.window, type=gtk.MESSAGE_WARNING, buttons=gtk.BUTTONS_OK, message_format="The stage tarball URI you entered does not exist or is invalid. You cannot continue until this value is valid")
118# resp = msgdlg.run() 114 resp = msgdlg.run()
119# msgdlg.destroy() 115 msgdlg.destroy()
120# if resp == gtk.RESPONSE_NO:
121# return False 116 return
122# elif self.active_selection == 3 and self.check_grp.get_active() and self.has_systempkgs:
123# msgdlg = gtk.MessageDialog(parent=self.controller.window, type=gtk.MESSAGE_QUESTION, buttons=gtk.BUTTONS_YES_NO, message_format="When doing a GRP install, it is recommended to use the Dynamic option instead of selecting your own tarball. Continue?")
124# resp = msgdlg.run()
125# msgdlg.destroy()
126# if resp == gtk.RESPONSE_NO:
127# return False
128# self.controller.install_profile.set_install_stage(None, self.active_selection, None) 117 self.controller.install_profile.set_install_stage(None, 3, None)
129# if self.active_selection == 3:
130# self.controller.install_profile.set_grp_install(None, self.check_grp.get_active(), None)
131# self.controller.install_profile.set_dynamic_stage3(None, self.check_dynamic.get_active(), None) 118 self.controller.install_profile.set_dynamic_stage3(None, self.radio_dynamicstage.get_active(), None)
132# else:
133# self.controller.install_profile.set_grp_install(None, False, None)
134# try: self.controller.install_profile.set_stage_tarball_uri(None, self.entry_stage_tarball_uri.get_text(), None) 119 self.controller.install_profile.set_stage_tarball_uri(None, self.entry_stage_tarball_uri.get_text(), None)
135# except: pass 120 progress = ProgressDialog(self.controller, ("unpack_stage_tarball", ), self.progress_callback)
136 return True 121 progress.run()
122
123 def progress_callback(self, result, data=None):
124 if result == PROGRESS_DONE:
125 self.controller.load_screen("Portage Tree")
126

Legend:
Removed from v.1647  
changed lines
  Added in v.1648

  ViewVC Help
Powered by ViewVC 1.1.20