[20] | 1 | import wx |
---|
| 2 | import wx.wizard as wiz |
---|
| 3 | import sys |
---|
| 4 | import gettext |
---|
| 5 | from wx.lib.mixins.listctrl import CheckListCtrlMixin |
---|
| 6 | import wx.lib.filebrowsebutton as filebrowse |
---|
| 7 | |
---|
| 8 | cat = gettext.GNUTranslations(open(sys.argv[1])) |
---|
| 9 | _ = cat.gettext |
---|
| 10 | |
---|
| 11 | global FinalArgs |
---|
| 12 | FinalArgs = ['','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','',''] |
---|
| 13 | #global selected_hosts, selected_clients, lenghth |
---|
| 14 | #lenghth = 0 |
---|
| 15 | |
---|
| 16 | #---------------------------------------------------------------------- |
---|
| 17 | ClonezillaStartSaveArgs = { |
---|
| 18 | 1: ("-q", _('msg_ocs_param_q')), |
---|
| 19 | 2: ("-c", _('msg_ocs_param_c')), |
---|
| 20 | 3: ("-nogui", _('msg_ocs_param_nogui')), |
---|
| 21 | 4: ("-a", _('msg_ocs_param_a')), |
---|
| 22 | 5: ("-f", _('msg_ocs_param_f')), |
---|
| 23 | 6: ("-s", _('msg_ocs_param_s')), |
---|
| 24 | } |
---|
| 25 | |
---|
| 26 | #---------------------------------------------------------------------- |
---|
| 27 | ClonezillaStartRestoreArgs = { |
---|
| 28 | 1: ("-g auto", _('msg_ocs_param_g_auto')), |
---|
| 29 | 2: ("-x", _('msg_ocs_param_x')), |
---|
| 30 | 3: ("-brdcst", _('msg_ocs_param_broadcast')), |
---|
| 31 | 4: ("-v", _('msg_ocs_param_v')), |
---|
| 32 | 5: ("-nogui", _('msg_ocs_param_nogui')), |
---|
| 33 | 6: ("-c", _('msg_ocs_param_c')), |
---|
| 34 | 7: ("-u", _('msg_ocs_param_u')), |
---|
| 35 | 8: ("-t", _('msg_ocs_param_t')), |
---|
| 36 | 9: ("-j0", _('msg_ocs_param_j0')), |
---|
| 37 | 10: ("-ns", _('msg_ocs_param_ns')), |
---|
| 38 | 11: ("-k", _('msg_ocs_param_k')), |
---|
| 39 | 12: ("-r", _('msg_ocs_param_r')), |
---|
| 40 | 13: ("-e", _('msg_ocs_param_e')), |
---|
| 41 | 14: ("-f", _('msg_ocs_param_f')), |
---|
| 42 | 15: ("-s", _('msg_ocs_param_s')), |
---|
| 43 | 16: ("-a", _('msg_ocs_param_a')), |
---|
| 44 | 17: ("-o", _('msg_ocs_param_o')), |
---|
| 45 | 18: ("-hn0", _('msg_ocs_param_hn0')), |
---|
| 46 | 19: ("-hn1", _('msg_ocs_param_hn1')), |
---|
| 47 | } |
---|
| 48 | |
---|
| 49 | #---------------------------------------------------------------------- |
---|
| 50 | class CSSCheckListCtrl(wx.ListCtrl, CheckListCtrlMixin): |
---|
| 51 | def __init__(self, parent, log): |
---|
| 52 | wx.ListCtrl.__init__(self, parent, -1, style=wx.LC_REPORT) |
---|
| 53 | CheckListCtrlMixin.__init__(self) |
---|
| 54 | self.log = log |
---|
| 55 | self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated) |
---|
| 56 | |
---|
| 57 | def OnItemActivated(self, evt): |
---|
| 58 | self.ToggleItem(evt.m_itemIndex) |
---|
| 59 | |
---|
| 60 | # this is called by the base class when an item is checked/unchecked |
---|
| 61 | def OnCheckItem(self, index, flag): |
---|
| 62 | data = self.GetItemData(index) |
---|
| 63 | arg = ClonezillaStartSaveArgs[data][0] |
---|
| 64 | if flag: |
---|
| 65 | FinalArgs[index+3] = arg |
---|
| 66 | else: |
---|
| 67 | FinalArgs[index+3] = '' |
---|
| 68 | |
---|
| 69 | #---------------------------------------------------------------------- |
---|
| 70 | class CSRCheckListCtrl(wx.ListCtrl, CheckListCtrlMixin): |
---|
| 71 | def __init__(self, parent, log): |
---|
| 72 | wx.ListCtrl.__init__(self, parent, -1, style=wx.LC_REPORT) |
---|
| 73 | CheckListCtrlMixin.__init__(self) |
---|
| 74 | self.log = log |
---|
| 75 | self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated) |
---|
| 76 | |
---|
| 77 | def OnItemActivated(self, evt): |
---|
| 78 | self.ToggleItem(evt.m_itemIndex) |
---|
| 79 | |
---|
| 80 | # this is called by the base class when an item is checked/unchecked |
---|
| 81 | def OnCheckItem(self, index, flag): |
---|
| 82 | data = self.GetItemData(index) |
---|
| 83 | arg = ClonezillaStartRestoreArgs[data][0] |
---|
| 84 | if flag: |
---|
| 85 | if index == 18: |
---|
| 86 | FinalArgs[index+4] = arg |
---|
| 87 | else: |
---|
| 88 | FinalArgs[index+3] = arg |
---|
| 89 | else: |
---|
| 90 | if index == 18: |
---|
| 91 | FinalArgs[index+4] = '' |
---|
| 92 | else: |
---|
| 93 | FinalArgs[index+3] = '' |
---|
| 94 | |
---|
| 95 | #---------------------------------------------------------------------- |
---|
| 96 | def makePageTitle(wizPg, title): |
---|
| 97 | sizer = wx.BoxSizer(wx.VERTICAL) |
---|
| 98 | wizPg.SetSizer(sizer) |
---|
| 99 | title = wx.StaticText(wizPg, -1, title) |
---|
| 100 | title.SetFont(wx.Font(12, wx.SWISS, wx.NORMAL, wx.BOLD)) |
---|
| 101 | sizer.Add(title, 0, wx.ALIGN_CENTRE|wx.ALL, 5) |
---|
| 102 | sizer.Add(wx.StaticLine(wizPg, -1), 0, wx.EXPAND|wx.ALL, 5) |
---|
| 103 | return sizer |
---|
| 104 | |
---|
| 105 | #---------------------------------------------------------------------- |
---|
| 106 | class WizardBasePage(wiz.PyWizardPage): |
---|
| 107 | def __init__(self, parent, title): |
---|
| 108 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 109 | self.next = self.prev = None |
---|
| 110 | self.sizer = makePageTitle(self, title) |
---|
| 111 | |
---|
| 112 | def SetNext(self, next): |
---|
| 113 | self.next = next |
---|
| 114 | |
---|
| 115 | def SetPrev(self, prev): |
---|
| 116 | self.prev = prev |
---|
| 117 | |
---|
| 118 | def GetNext(self): |
---|
| 119 | return self.next |
---|
| 120 | |
---|
| 121 | def GetPrev(self): |
---|
| 122 | return self.prev |
---|
| 123 | |
---|
| 124 | #---------------------------------------------------------------------- |
---|
| 125 | class SetAllClientsPage(wiz.PyWizardPage): |
---|
| 126 | def __init__(self, parent, title): |
---|
| 127 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 128 | self.next = self.prev = None |
---|
| 129 | self.sizer = makePageTitle(self, title) |
---|
| 130 | |
---|
| 131 | self.cb = wx.CheckBox(self, -1, _('msg_title_set_all_clients')) |
---|
| 132 | self.cb.SetValue(True) |
---|
| 133 | self.sizer.Add(self.cb, 0, wx.ALL, 5) |
---|
| 134 | |
---|
| 135 | def SetNext(self, next): |
---|
| 136 | self.next = next |
---|
| 137 | |
---|
| 138 | def SetPrev(self, prev): |
---|
| 139 | self.prev = prev |
---|
| 140 | |
---|
| 141 | def GetNext(self): |
---|
| 142 | next = self.next |
---|
| 143 | if self.cb.GetValue(): |
---|
| 144 | FinalArgs[1] = '' |
---|
| 145 | next = next.GetNext() |
---|
| 146 | else: |
---|
| 147 | #FinalArgs[1] = '' |
---|
| 148 | FinalArgs[1] = '-h' |
---|
| 149 | return next |
---|
| 150 | |
---|
| 151 | def GetPrev(self): |
---|
| 152 | return self.prev |
---|
| 153 | |
---|
| 154 | #---------------------------------------------------------------------- |
---|
| 155 | class SelectClientsPage(wiz.PyWizardPage): |
---|
| 156 | def __init__(self, parent, title): |
---|
| 157 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 158 | self.next = self.prev = None |
---|
| 159 | self.sizer = makePageTitle(self, title) |
---|
| 160 | self.selected_hosts = [] |
---|
| 161 | self.selected_clients = '' |
---|
| 162 | self.lenghth = 0 |
---|
| 163 | |
---|
| 164 | g = open("/tmp/ip_list", "r") |
---|
| 165 | ip_list = g.read() |
---|
| 166 | tokens = ("%s" % ip_list).split() |
---|
| 167 | self.lenghth = len(tokens) |
---|
| 168 | for i in range(0,len(tokens)): |
---|
| 169 | self.selected_hosts.insert(len(tokens),"") |
---|
| 170 | i = i+1 |
---|
| 171 | g.close() |
---|
| 172 | |
---|
| 173 | lb = wx.CheckListBox(self, -1, (35,50), (290,250), tokens) |
---|
| 174 | self.Bind(wx.EVT_CHECKLISTBOX, self.EvtCheckListBox, lb) |
---|
| 175 | lb.SetSelection(0) |
---|
| 176 | counts = lb.GetCount() |
---|
| 177 | self.lb = lb |
---|
| 178 | pos = lb.GetPosition().x + lb.GetSize().width + 25 |
---|
| 179 | |
---|
| 180 | def EvtCheckListBox(self, event): |
---|
| 181 | j = 0 |
---|
| 182 | index = event.GetSelection() |
---|
| 183 | label = self.lb.GetString(index) |
---|
| 184 | if self.lb.IsChecked(index): |
---|
| 185 | del self.selected_hosts[index] |
---|
| 186 | self.selected_hosts.insert(index,label) |
---|
| 187 | if not (self.lb.IsChecked(index)): |
---|
| 188 | self.selected_hosts.remove(label) |
---|
| 189 | self.selected_hosts.insert(index,"") |
---|
| 190 | self.lb.SetSelection(index) #so that (un)checking also selects (moves the highlight) |
---|
| 191 | self.selected_clients = '' |
---|
| 192 | while j < self.lenghth: |
---|
| 193 | if self.selected_hosts[j] != "": |
---|
| 194 | self.selected_clients = self.selected_clients + self.selected_hosts[j] + ' ' |
---|
| 195 | j = j+1 |
---|
| 196 | self.selected_clients = '\"' + self.selected_clients + '\"' |
---|
| 197 | FinalArgs[2] = self.selected_clients |
---|
| 198 | |
---|
| 199 | def SetNext(self, next): |
---|
| 200 | self.next = next |
---|
| 201 | |
---|
| 202 | def SetPrev(self, prev): |
---|
| 203 | self.prev = prev |
---|
| 204 | |
---|
| 205 | def GetNext(self): |
---|
| 206 | #print self.selected_clients |
---|
| 207 | return self.next |
---|
| 208 | |
---|
| 209 | def GetPrev(self): |
---|
| 210 | return self.prev |
---|
| 211 | |
---|
| 212 | #---------------------------------------------------------------------- |
---|
| 213 | class RemoteLinuxGraPage(wiz.PyWizardPage): |
---|
| 214 | def __init__(self, parent, title): |
---|
| 215 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 216 | self.next = self.prev = None |
---|
| 217 | self.sizer = makePageTitle(self, title) |
---|
| 218 | |
---|
| 219 | wx.StaticText(self, -1, _('msg_remote_linux_graphic'),(50,100)) |
---|
| 220 | FinalArgs[0] = '/opt/drbl/sbin/dcs' |
---|
| 221 | FinalArgs[3] = 'remote-linux-gra' |
---|
| 222 | |
---|
| 223 | def SetNext(self, next): |
---|
| 224 | self.next = next |
---|
| 225 | |
---|
| 226 | def SetPrev(self, prev): |
---|
| 227 | self.prev = prev |
---|
| 228 | |
---|
| 229 | def GetNext(self): |
---|
| 230 | return self.next |
---|
| 231 | |
---|
| 232 | def GetPrev(self): |
---|
| 233 | prev = self.prev |
---|
| 234 | prev = prev.GetPrev() |
---|
| 235 | return prev |
---|
| 236 | |
---|
| 237 | #---------------------------------------------------------------------- |
---|
| 238 | class RemoteLinuxTxtPage(wiz.PyWizardPage): |
---|
| 239 | def __init__(self, parent, title): |
---|
| 240 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 241 | self.next = self.prev = None |
---|
| 242 | self.sizer = makePageTitle(self, title) |
---|
| 243 | |
---|
| 244 | wx.StaticText(self, -1, _('msg_remote_linux_text'),(50,100)) |
---|
| 245 | FinalArgs[0] = '/opt/drbl/sbin/dcs' |
---|
| 246 | FinalArgs[3] = 'remote-linux-text' |
---|
| 247 | |
---|
| 248 | def SetNext(self, next): |
---|
| 249 | self.next = next |
---|
| 250 | |
---|
| 251 | def SetPrev(self, prev): |
---|
| 252 | self.prev = prev |
---|
| 253 | |
---|
| 254 | def GetNext(self): |
---|
| 255 | return self.next |
---|
| 256 | |
---|
| 257 | def GetPrev(self): |
---|
| 258 | prev = self.prev |
---|
| 259 | prev = prev.GetPrev() |
---|
| 260 | return prev |
---|
| 261 | |
---|
| 262 | #---------------------------------------------------------------------- |
---|
| 263 | class TerminalPage(wiz.PyWizardPage): |
---|
| 264 | def __init__(self, parent, title): |
---|
| 265 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 266 | self.next = self.prev = None |
---|
| 267 | self.sizer = makePageTitle(self, title) |
---|
| 268 | |
---|
| 269 | wx.StaticText(self, -1, _('msg_thin_client'),(50,100)) |
---|
| 270 | FinalArgs[0] = '/opt/drbl/sbin/dcs' |
---|
| 271 | FinalArgs[3] = 'remote-thin-client' |
---|
| 272 | |
---|
| 273 | def SetNext(self, next): |
---|
| 274 | self.next = next |
---|
| 275 | |
---|
| 276 | def SetPrev(self, prev): |
---|
| 277 | self.prev = prev |
---|
| 278 | |
---|
| 279 | def GetNext(self): |
---|
| 280 | return self.next |
---|
| 281 | |
---|
| 282 | def GetPrev(self): |
---|
| 283 | prev = self.prev |
---|
| 284 | prev = prev.GetPrev() |
---|
| 285 | return prev |
---|
| 286 | |
---|
| 287 | #---------------------------------------------------------------------- |
---|
| 288 | class RemoteMemTestPage(wiz.PyWizardPage): |
---|
| 289 | def __init__(self, parent, title): |
---|
| 290 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 291 | self.next = self.prev = None |
---|
| 292 | self.sizer = makePageTitle(self, title) |
---|
| 293 | |
---|
| 294 | wx.StaticText(self, -1, _('msg_remote_memtest'),(50,100)) |
---|
| 295 | FinalArgs[0] = '/opt/drbl/sbin/dcs' |
---|
| 296 | FinalArgs[3] = 'remote-memtest' |
---|
| 297 | |
---|
| 298 | def SetNext(self, next): |
---|
| 299 | self.next = next |
---|
| 300 | |
---|
| 301 | def SetPrev(self, prev): |
---|
| 302 | self.prev = prev |
---|
| 303 | |
---|
| 304 | def GetNext(self): |
---|
| 305 | return self.next |
---|
| 306 | |
---|
| 307 | def GetPrev(self): |
---|
| 308 | prev = self.prev |
---|
| 309 | prev = prev.GetPrev() |
---|
| 310 | return prev |
---|
| 311 | |
---|
| 312 | #---------------------------------------------------------------------- |
---|
| 313 | class RemotefdosPage(wiz.PyWizardPage): |
---|
| 314 | def __init__(self, parent, title): |
---|
| 315 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 316 | self.next = self.prev = None |
---|
| 317 | self.sizer = makePageTitle(self, title) |
---|
| 318 | |
---|
| 319 | wx.StaticText(self, -1, _('msg_remote_fdos'),(50,100)) |
---|
| 320 | FinalArgs[0] = '/opt/drbl/sbin/dcs' |
---|
| 321 | FinalArgs[3] = 'remote-fdos' |
---|
| 322 | |
---|
| 323 | def SetNext(self, next): |
---|
| 324 | self.next = next |
---|
| 325 | |
---|
| 326 | def SetPrev(self, prev): |
---|
| 327 | self.prev = prev |
---|
| 328 | |
---|
| 329 | def GetNext(self): |
---|
| 330 | return self.next |
---|
| 331 | |
---|
| 332 | def GetPrev(self): |
---|
| 333 | prev = self.prev |
---|
| 334 | prev = prev.GetPrev() |
---|
| 335 | return prev |
---|
| 336 | |
---|
| 337 | #---------------------------------------------------------------------- |
---|
| 338 | class ClonezillaStartSavePage1(wiz.PyWizardPage): |
---|
| 339 | def __init__(self, parent, title): |
---|
| 340 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 341 | self.next = self.prev = None |
---|
| 342 | self.sizer = makePageTitle(self, title) |
---|
| 343 | ModeList = [_('msg_clonezilla_save_disk'), _('msg_clonezilla_save_parts')] |
---|
| 344 | |
---|
| 345 | rb = wx.RadioBox( |
---|
| 346 | self, -1, _('msg_choose_mode'), (35, 50), (260,90), |
---|
| 347 | ModeList, 1, wx.RA_SPECIFY_COLS |
---|
| 348 | ) |
---|
| 349 | |
---|
| 350 | self.Bind(wx.EVT_RADIOBOX, self.EvtRadioBox, rb) |
---|
| 351 | FinalArgs[0] = '/opt/drbl/sbin/drbl-ocs -b' |
---|
| 352 | FinalArgs[12] = 'startdisk save' |
---|
| 353 | |
---|
| 354 | def EvtRadioBox(self, event): |
---|
| 355 | if event.GetInt() == 0: |
---|
| 356 | FinalArgs[12] = 'startdisk save' |
---|
| 357 | if event.GetInt() == 1: |
---|
| 358 | FinalArgs[12] = 'startpart save' |
---|
| 359 | |
---|
| 360 | def SetNext(self, next): |
---|
| 361 | self.next = next |
---|
| 362 | |
---|
| 363 | def SetPrev(self, prev): |
---|
| 364 | self.prev = prev |
---|
| 365 | |
---|
| 366 | def GetNext(self): |
---|
| 367 | return self.next |
---|
| 368 | |
---|
| 369 | def GetPrev(self): |
---|
| 370 | return self.prev |
---|
| 371 | |
---|
| 372 | #---------------------------------------------------------------------- |
---|
| 373 | class ClonezillaStartSavePage2(wiz.PyWizardPage): |
---|
| 374 | def __init__(self, parent, title): |
---|
| 375 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 376 | self.next = self.prev = None |
---|
| 377 | self.sizer = makePageTitle(self, title) |
---|
| 378 | |
---|
| 379 | wx.StaticText(self,-1,_('msg_ask_if_input_save_image_name_in_server'),wx.DLG_PNT(self, 10, 20),wx.DLG_SZE(self, 200, 100),wx.TE_MULTILINE) |
---|
| 380 | |
---|
| 381 | self.cb = wx.CheckBox(self, -1, 'YES',(20,130)) # not translated |
---|
| 382 | self.cb.SetValue(True) |
---|
| 383 | #self.sizer.Add(self.cb, 0, wx.TOP|wx.LEFT, 80) |
---|
| 384 | |
---|
| 385 | def SetNext(self, next): |
---|
| 386 | self.next = next |
---|
| 387 | |
---|
| 388 | def SetPrev(self, prev): |
---|
| 389 | self.prev = prev |
---|
| 390 | |
---|
| 391 | def GetNext(self): |
---|
| 392 | next = self.next |
---|
| 393 | if not self.cb.GetValue(): |
---|
| 394 | next = next.GetNext() |
---|
| 395 | return next |
---|
| 396 | |
---|
| 397 | def GetPrev(self): |
---|
| 398 | return self.prev |
---|
| 399 | |
---|
| 400 | #---------------------------------------------------------------------- |
---|
| 401 | class ClonezillaStartSavePage3(wiz.PyWizardPage): |
---|
| 402 | def __init__(self, parent, title): |
---|
| 403 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 404 | self.next = self.prev = None |
---|
| 405 | self.sizer = makePageTitle(self, title) |
---|
| 406 | |
---|
| 407 | wx.StaticText(self, -1, _('msg_input_image_name'), (10, 160)) |
---|
| 408 | self.text_img = wx.TextCtrl(self, -1, '', (10, 180), size=(200, -1)) |
---|
| 409 | |
---|
| 410 | wx.StaticText(self, -1, _('msg_input_device_name'), (10, 210)) |
---|
| 411 | self.text_dev = wx.TextCtrl(self, -1, '', (10, 230), size=(190, -1)) |
---|
| 412 | |
---|
| 413 | def SetNext(self, next): |
---|
| 414 | self.next = next |
---|
| 415 | |
---|
| 416 | def SetPrev(self, prev): |
---|
| 417 | self.prev = prev |
---|
| 418 | |
---|
| 419 | def GetNext(self): |
---|
| 420 | FinalArgs[13] = self.text_img.GetValue() |
---|
| 421 | FinalArgs[14] = self.text_dev.GetValue() |
---|
| 422 | return self.next |
---|
| 423 | |
---|
| 424 | def GetPrev(self): |
---|
| 425 | return self.prev |
---|
| 426 | |
---|
| 427 | #---------------------------------------------------------------------- |
---|
| 428 | class ClonezillaStartSavePage4(wiz.PyWizardPage): |
---|
| 429 | def __init__(self, parent, title): |
---|
| 430 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 431 | self.next = self.prev = None |
---|
| 432 | self.sizer = makePageTitle(self, title) |
---|
| 433 | |
---|
| 434 | self.list = CSSCheckListCtrl(self, title) |
---|
| 435 | sizer = wx.BoxSizer() |
---|
| 436 | sizer.Add(self.list, 1, wx.EXPAND) |
---|
| 437 | self.SetSizer(sizer) |
---|
| 438 | |
---|
| 439 | self.list.InsertColumn(0, _('argument')) #not translated |
---|
| 440 | self.list.InsertColumn(1, _('meannings'), wx.LIST_FORMAT_LEFT) #not translated |
---|
| 441 | |
---|
| 442 | for key, data in ClonezillaStartSaveArgs.iteritems(): |
---|
| 443 | index = self.list.InsertStringItem(sys.maxint, data[0]) |
---|
| 444 | self.list.SetStringItem(index, 1, data[1]) |
---|
| 445 | self.list.SetItemData(index, key) |
---|
| 446 | |
---|
| 447 | self.list.SetColumnWidth(0, wx.LIST_AUTOSIZE) |
---|
| 448 | self.list.SetColumnWidth(1, wx.LIST_AUTOSIZE) |
---|
| 449 | |
---|
| 450 | self.list.CheckItem(0) |
---|
| 451 | self.list.CheckItem(1) |
---|
| 452 | |
---|
| 453 | def SetNext(self, next): |
---|
| 454 | self.next = next |
---|
| 455 | |
---|
| 456 | def SetPrev(self, prev): |
---|
| 457 | self.prev = prev |
---|
| 458 | |
---|
| 459 | def GetNext(self): |
---|
| 460 | next = self.next |
---|
| 461 | if self.list.IsChecked(0) == self.list.IsChecked(1) == self.list.IsChecked(2) == self.list.IsChecked(3) == self.list.IsChecked(4) == self.list.IsChecked(5) == 0: |
---|
| 462 | next = 0 |
---|
| 463 | return next |
---|
| 464 | |
---|
| 465 | def GetPrev(self): |
---|
| 466 | prev = self.prev |
---|
| 467 | prev = prev.GetPrev() |
---|
| 468 | return prev |
---|
| 469 | |
---|
| 470 | #---------------------------------------------------------------------- |
---|
| 471 | class ClonezillaStartSavePage5(wiz.PyWizardPage): |
---|
| 472 | def __init__(self, parent, title): |
---|
| 473 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 474 | self.next = self.prev = None |
---|
| 475 | self.sizer = makePageTitle(self, title) |
---|
| 476 | |
---|
| 477 | ArgList = [_('msg_ocs_param_p_choose'), _('msg_ocs_param_p_true'), |
---|
| 478 | _('msg_ocs_param_p_poweroff'), _('msg_ocs_param_p_reboot')] |
---|
| 479 | |
---|
| 480 | rb = wx.RadioBox( |
---|
| 481 | self, -1, _('msg_choose_post_mode_after_clone'), (35,50), (290,150), |
---|
| 482 | ArgList, 1, wx.RA_SPECIFY_COLS |
---|
| 483 | ) |
---|
| 484 | self.Bind(wx.EVT_RADIOBOX, self.EvtRadioBox, rb) |
---|
| 485 | rb.SetSelection(3) |
---|
| 486 | FinalArgs[9] = '-p reboot' |
---|
| 487 | |
---|
| 488 | def EvtRadioBox(self, event): |
---|
| 489 | if event.GetSelection() == 0: |
---|
| 490 | FinalArgs[9] = '-p choose' |
---|
| 491 | if event.GetSelection() == 1: |
---|
| 492 | FinalArgs[9] = '-p true' |
---|
| 493 | if event.GetSelection() == 2: |
---|
| 494 | FinalArgs[9] = '-p poweroff' |
---|
| 495 | if event.GetSelection() == 3: |
---|
| 496 | FinalArgs[9] = '-p reboot' |
---|
| 497 | |
---|
| 498 | def SetNext(self, next): |
---|
| 499 | self.next = next |
---|
| 500 | |
---|
| 501 | def SetPrev(self, prev): |
---|
| 502 | self.prev = prev |
---|
| 503 | |
---|
| 504 | def GetNext(self): |
---|
| 505 | return self.next |
---|
| 506 | |
---|
| 507 | def GetPrev(self): |
---|
| 508 | return self.prev |
---|
| 509 | |
---|
| 510 | #---------------------------------------------------------------------- |
---|
| 511 | class ClonezillaStartSavePage6(wiz.PyWizardPage): |
---|
| 512 | def __init__(self, parent, title): |
---|
| 513 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 514 | self.next = self.prev = None |
---|
| 515 | self.sizer = makePageTitle(self, title) |
---|
| 516 | |
---|
| 517 | ArgList = [ _('msg_ocs_param_z0'), _('msg_ocs_param_z1'), _('msg_ocs_param_z2'), _('msg_ocs_param_z3')] |
---|
| 518 | rb = wx.RadioBox(self, -1, _('msg_choose_post_mode_after_clone'), (35,50), (340,150), ArgList, 1, wx.RA_SPECIFY_COLS) |
---|
| 519 | self.Bind(wx.EVT_RADIOBOX, self.EvtRadioBox, rb) |
---|
| 520 | rb.SetSelection(3) |
---|
| 521 | FinalArgs[10] = '-z3' |
---|
| 522 | |
---|
| 523 | def EvtRadioBox(self, event): |
---|
| 524 | if event.GetSelection() == 0: |
---|
| 525 | FinalArgs[10] = '-z0' |
---|
| 526 | if event.GetSelection() == 1: |
---|
| 527 | FinalArgs[10] = '-z1' |
---|
| 528 | if event.GetSelection() == 2: |
---|
| 529 | FinalArgs[10] = '-z2' |
---|
| 530 | if event.GetSelection() == 3: |
---|
| 531 | FinalArgs[10] = '-z3' |
---|
| 532 | |
---|
| 533 | def SetNext(self, next): |
---|
| 534 | self.next = next |
---|
| 535 | |
---|
| 536 | def SetPrev(self, prev): |
---|
| 537 | self.prev = prev |
---|
| 538 | |
---|
| 539 | def GetNext(self): |
---|
| 540 | return self.next |
---|
| 541 | |
---|
| 542 | def GetPrev(self): |
---|
| 543 | return self.prev |
---|
| 544 | |
---|
| 545 | #---------------------------------------------------------------------- |
---|
| 546 | class ClonezillaStartRestorePage1(wiz.PyWizardPage): |
---|
| 547 | def __init__(self, parent, title): |
---|
| 548 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 549 | self.next = self.prev = None |
---|
| 550 | self.sizer = makePageTitle(self, title) |
---|
| 551 | ModeList = [_('msg_clonezilla_restore_disk'), _('msg_clonezilla_restore_parts')] |
---|
| 552 | |
---|
| 553 | rb = wx.RadioBox(self, -1, _('msg_choose_mode'), (35, 50), (260,90), ModeList, 1, wx.RA_SPECIFY_COLS) |
---|
| 554 | |
---|
| 555 | self.Bind(wx.EVT_RADIOBOX, self.EvtRadioBox, rb) |
---|
| 556 | FinalArgs[0] = '/opt/drbl/sbin/drbl-ocs -b' |
---|
| 557 | FinalArgs[32] = 'startdisk' |
---|
| 558 | |
---|
| 559 | def EvtRadioBox(self, event): |
---|
| 560 | if event.GetInt() == 0: |
---|
| 561 | FinalArgs[32] = 'startdisk' |
---|
| 562 | if event.GetInt() == 1: |
---|
| 563 | FinalArgs[32] = 'startpart' |
---|
| 564 | |
---|
| 565 | def SetNext(self, next): |
---|
| 566 | self.next = next |
---|
| 567 | |
---|
| 568 | def SetPrev(self, prev): |
---|
| 569 | self.prev = prev |
---|
| 570 | |
---|
| 571 | def GetNext(self): |
---|
| 572 | return self.next |
---|
| 573 | |
---|
| 574 | def GetPrev(self): |
---|
| 575 | return self.prev |
---|
| 576 | |
---|
| 577 | #---------------------------------------------------------------------- |
---|
| 578 | class ClonezillaStartRestorePage2(wiz.PyWizardPage): |
---|
| 579 | def __init__(self, parent, title): |
---|
| 580 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 581 | self.next = self.prev = None |
---|
| 582 | self.sizer = makePageTitle(self, title) |
---|
| 583 | |
---|
| 584 | self.list = CSRCheckListCtrl(self, title) |
---|
| 585 | sizer = wx.BoxSizer() |
---|
| 586 | sizer.Add(self.list, 1, wx.EXPAND) |
---|
| 587 | self.SetSizer(sizer) |
---|
| 588 | |
---|
| 589 | self.list.InsertColumn(0, _('argument')) #not translated |
---|
| 590 | self.list.InsertColumn(1, _('meannings'), wx.LIST_FORMAT_LEFT) #not translated |
---|
| 591 | |
---|
| 592 | for key, data in ClonezillaStartRestoreArgs.iteritems(): |
---|
| 593 | index = self.list.InsertStringItem(sys.maxint, data[0]) |
---|
| 594 | self.list.SetStringItem(index, 1, data[1]) |
---|
| 595 | self.list.SetItemData(index, key) |
---|
| 596 | |
---|
| 597 | self.list.SetColumnWidth(0, wx.LIST_AUTOSIZE) |
---|
| 598 | self.list.SetColumnWidth(1, wx.LIST_AUTOSIZE) |
---|
| 599 | |
---|
| 600 | self.list.CheckItem(0) |
---|
| 601 | self.list.CheckItem(1) |
---|
| 602 | |
---|
| 603 | def SetNext(self, next): |
---|
| 604 | self.next = next |
---|
| 605 | |
---|
| 606 | def SetPrev(self, prev): |
---|
| 607 | self.prev = prev |
---|
| 608 | |
---|
| 609 | def GetNext(self): |
---|
| 610 | j = 0 |
---|
| 611 | check_sum = 0 |
---|
| 612 | next = self.next |
---|
| 613 | for j in range(0,18): |
---|
| 614 | check_sum = check_sum + self.list.IsChecked(j) |
---|
| 615 | if check_sum == 0: # if user didn't check any box, then return NULL. |
---|
| 616 | next = 0 |
---|
| 617 | if (self.list.IsChecked(17) or self.list.IsChecked(18)): |
---|
| 618 | next = self.next |
---|
| 619 | else: |
---|
| 620 | next = next.GetNext() |
---|
| 621 | next = next.GetNext() |
---|
| 622 | return next |
---|
| 623 | |
---|
| 624 | def GetPrev(self): |
---|
| 625 | return self.prev |
---|
| 626 | |
---|
| 627 | #---------------------------------------------------------------------- |
---|
| 628 | class ClonezillaStartRestorePage3(wiz.PyWizardPage): |
---|
| 629 | def __init__(self, parent, title): |
---|
| 630 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 631 | self.next = self.prev = None |
---|
| 632 | self.sizer = makePageTitle(self, title) |
---|
| 633 | |
---|
| 634 | wx.StaticText(self,-1,_('msg_write_MS_WIN_is_necessary'),wx.DLG_PNT(self, 10, 20),wx.DLG_SZE(self, 200, 100),wx.TE_MULTILINE) |
---|
| 635 | #if len(_('msg_write_MS_WIN_is_necessary')) <= 517: |
---|
| 636 | #wx.StaticText(self, -1, _('msg_write_MS_WIN_is_necessary')[:60], (10,60)) |
---|
| 637 | #wx.StaticText(self, -1, _('msg_write_MS_WIN_is_necessary')[60:122], (10,80)) |
---|
| 638 | #wx.StaticText(self, -1, _('msg_write_MS_WIN_is_necessary')[122:184], (10,100)) |
---|
| 639 | #wx.StaticText(self, -1, _('msg_write_MS_WIN_is_necessary')[184:253], (10,120)) |
---|
| 640 | #wx.StaticText(self, -1, _('msg_write_MS_WIN_is_necessary')[253:314], (10,140)) |
---|
| 641 | #wx.StaticText(self, -1, _('msg_write_MS_WIN_is_necessary')[314:380], (10,160)) |
---|
| 642 | #wx.StaticText(self, -1, _('msg_write_MS_WIN_is_necessary')[380:440], (10,180)) |
---|
| 643 | #wx.StaticText(self, -1, _('msg_write_MS_WIN_is_necessary')[440:495], (10,220)) |
---|
| 644 | #wx.StaticText(self, -1, _('msg_write_MS_WIN_is_necessary')[495:], (10,240)) |
---|
| 645 | #else: |
---|
| 646 | #wx.StaticText(self, -1, _('msg_write_MS_WIN_is_necessary')[:79], (10,60)) |
---|
| 647 | #wx.StaticText(self, -1, _('msg_write_MS_WIN_is_necessary')[79:156], (10,80)) |
---|
| 648 | #wx.StaticText(self, -1, _('msg_write_MS_WIN_is_necessary')[156:248], (10,100)) |
---|
| 649 | #wx.StaticText(self, -1, _('msg_write_MS_WIN_is_necessary')[248:331], (10,120)) |
---|
| 650 | #wx.StaticText(self, -1, _('msg_write_MS_WIN_is_necessary')[331:413], (10,140)) |
---|
| 651 | #wx.StaticText(self, -1, _('msg_write_MS_WIN_is_necessary')[413:449], (10,160)) |
---|
| 652 | #wx.StaticText(self, -1, _('msg_write_MS_WIN_is_necessary')[449:], (10,200)) |
---|
| 653 | |
---|
| 654 | def SetNext(self, next): |
---|
| 655 | self.next = next |
---|
| 656 | |
---|
| 657 | def SetPrev(self, prev): |
---|
| 658 | self.prev = prev |
---|
| 659 | |
---|
| 660 | def GetNext(self): |
---|
| 661 | return self.next |
---|
| 662 | |
---|
| 663 | def GetPrev(self): |
---|
| 664 | return self.prev |
---|
| 665 | |
---|
| 666 | #---------------------------------------------------------------------- |
---|
| 667 | class ClonezillaStartRestorePage4(wiz.PyWizardPage): |
---|
| 668 | def __init__(self, parent, title): |
---|
| 669 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 670 | self.next = self.prev = None |
---|
| 671 | self.sizer = makePageTitle(self, title) |
---|
| 672 | |
---|
| 673 | wx.StaticText(self, -1, _('msg_What_the_win_hostname_prefix'), (5, 80)) |
---|
| 674 | self.text = wx.TextCtrl(self, -1, "PC", (5, 110), size=(200, -1)) |
---|
| 675 | |
---|
| 676 | def SetNext(self, next): |
---|
| 677 | self.next = next |
---|
| 678 | |
---|
| 679 | def SetPrev(self, prev): |
---|
| 680 | self.prev = prev |
---|
| 681 | |
---|
| 682 | def GetNext(self): |
---|
| 683 | #print FinalArgs |
---|
| 684 | if FinalArgs[20] == '-hn0' and FinalArgs[22] == '-hn1': |
---|
| 685 | FinalArgs[21] = FinalArgs[23] = self.text.GetValue() |
---|
| 686 | elif FinalArgs[20] == '-hn0'and FinalArgs[22] != '-hn1': |
---|
| 687 | FinalArgs[21] = self.text.GetValue() |
---|
| 688 | elif FinalArgs[22] == '-hn1' and FinalArgs[20] != '-hn0': |
---|
| 689 | FinalArgs[23] = self.text.GetValue() |
---|
| 690 | elif FinalArgs[20] != '-hn0' and FinalArgs[22] != '-hn1': |
---|
| 691 | FinalArgs[21] = FinalArgs[23] = '' |
---|
| 692 | return self.next |
---|
| 693 | |
---|
| 694 | def GetPrev(self): |
---|
| 695 | prev = self.prev |
---|
| 696 | prev = prev.GetPrev() |
---|
| 697 | return prev |
---|
| 698 | |
---|
| 699 | #---------------------------------------------------------------------- |
---|
| 700 | class ClonezillaStartRestorePage5(wiz.PyWizardPage): |
---|
| 701 | def __init__(self, parent, title): |
---|
| 702 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 703 | self.next = self.prev = None |
---|
| 704 | self.sizer = makePageTitle(self, title) |
---|
| 705 | |
---|
| 706 | ModeList = [_('msg_ocs_param_y0'), _('msg_ocs_param_y1'), _('msg_ocs_param_y2'), _('msg_ocs_param_skip')] |
---|
| 707 | wx.StaticText(self,-1,_('msg_if_always_provide_clonezilla_srv'),wx.DLG_PNT(self, 10, 20),wx.DLG_SZE(self, 200, 100),wx.TE_MULTILINE) |
---|
| 708 | rb = wx.RadioBox(self, -1, '', (5,150), wx.DefaultSize, ModeList, 1, wx.RA_SPECIFY_COLS) |
---|
| 709 | self.Bind(wx.EVT_RADIOBOX, self.EvtRadioBox, rb) |
---|
| 710 | rb.SetSelection(3) |
---|
| 711 | |
---|
| 712 | def EvtRadioBox(self, event): |
---|
| 713 | if event.GetInt() == 0: |
---|
| 714 | FinalArgs[24] = '-y0' |
---|
| 715 | elif event.GetInt() == 1: |
---|
| 716 | FinalArgs[24] = '-y1' |
---|
| 717 | elif event.GetInt() == 2: |
---|
| 718 | FinalArgs[24] = '-y2' |
---|
| 719 | elif event.GetInt() == 3: |
---|
| 720 | FinalArgs[24] = '' |
---|
| 721 | |
---|
| 722 | def SetNext(self, next): |
---|
| 723 | self.next = next |
---|
| 724 | |
---|
| 725 | def SetPrev(self, prev): |
---|
| 726 | self.prev = prev |
---|
| 727 | |
---|
| 728 | def GetNext(self): |
---|
| 729 | return self.next |
---|
| 730 | |
---|
| 731 | def GetPrev(self): |
---|
| 732 | return self.prev |
---|
| 733 | |
---|
| 734 | #---------------------------------------------------------------------- |
---|
| 735 | class ClonezillaStartRestorePage6(wiz.PyWizardPage): |
---|
| 736 | def __init__(self, parent, title): |
---|
| 737 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 738 | self.next = self.prev = None |
---|
| 739 | self.sizer = makePageTitle(self, title) |
---|
| 740 | |
---|
| 741 | ArgList = [_('msg_ocs_param_p_choose'), _('msg_ocs_param_p_true'), _('msg_ocs_param_p_poweroff'), _('msg_ocs_param_p_reboot')] |
---|
| 742 | rb = wx.RadioBox(self, -1, _('msg_choose_post_mode_after_clone'), (35,50), (290,150), ArgList, 1, wx.RA_SPECIFY_COLS) |
---|
| 743 | self.Bind(wx.EVT_RADIOBOX, self.EvtRadioBox, rb) |
---|
| 744 | rb.SetSelection(3) |
---|
| 745 | FinalArgs[25] = '-p reboot' |
---|
| 746 | |
---|
| 747 | def EvtRadioBox(self, event): |
---|
| 748 | if event.GetSelection() == 0: |
---|
| 749 | FinalArgs[25] = '-p choose' |
---|
| 750 | if event.GetSelection() == 1: |
---|
| 751 | FinalArgs[25] = '-p true' |
---|
| 752 | if event.GetSelection() == 2: |
---|
| 753 | FinalArgs[25] = '-p poweroff' |
---|
| 754 | if event.GetSelection() == 3: |
---|
| 755 | FinalArgs[25] = '-p reboot' |
---|
| 756 | |
---|
| 757 | def SetNext(self, next): |
---|
| 758 | self.next = next |
---|
| 759 | |
---|
| 760 | def SetPrev(self, prev): |
---|
| 761 | self.prev = prev |
---|
| 762 | |
---|
| 763 | def GetNext(self): |
---|
| 764 | next = self.next |
---|
| 765 | if FinalArgs[9] == '-u': |
---|
| 766 | next = next.GetNext() |
---|
| 767 | next = next.GetNext() |
---|
| 768 | next = next.GetNext() |
---|
| 769 | return next |
---|
| 770 | |
---|
| 771 | def GetPrev(self): |
---|
| 772 | return self.prev |
---|
| 773 | |
---|
| 774 | #---------------------------------------------------------------------- |
---|
| 775 | class ClonezillaStartRestorePage7(wiz.PyWizardPage): |
---|
| 776 | def __init__(self, parent, title): |
---|
| 777 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 778 | self.next = self.prev = None |
---|
| 779 | self.sizer = makePageTitle(self, title) |
---|
| 780 | |
---|
| 781 | wx.StaticText(self, -1, _('msg_choose_the_image_to_restore'), (5,80)) |
---|
| 782 | self.fbb = filebrowse.FileBrowseButton(self, -1, pos=(50,150), size=(350, -1), buttonText='browse', toolTip='Type filename or click browse to choose file', fileMask='*.img', changeCallback = self.fbbCallback) |
---|
| 783 | |
---|
| 784 | def fbbCallback(self, evt): |
---|
| 785 | FinalArgs[34] = evt.GetString() |
---|
| 786 | |
---|
| 787 | def SetNext(self, next): |
---|
| 788 | self.next = next |
---|
| 789 | |
---|
| 790 | def SetPrev(self, prev): |
---|
| 791 | self.prev = prev |
---|
| 792 | |
---|
| 793 | def GetNext(self): |
---|
| 794 | return self.next |
---|
| 795 | |
---|
| 796 | def GetPrev(self): |
---|
| 797 | return self.prev |
---|
| 798 | |
---|
| 799 | #---------------------------------------------------------------------- |
---|
| 800 | class ClonezillaStartRestorePage8(wiz.PyWizardPage): |
---|
| 801 | def __init__(self, parent, title): |
---|
| 802 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 803 | self.next = self.prev = None |
---|
| 804 | self.sizer = makePageTitle(self, title) |
---|
| 805 | |
---|
| 806 | if FinalArgs[32] == 'startdisk': |
---|
| 807 | wx.StaticText(self, -1, _('msg_choose_the_disks_to_restore'), (5,80)) |
---|
| 808 | elif FinalArgs[32] == 'startpart': |
---|
| 809 | wx.StaticText(self, -1, _(msg_choose_the_parts_to_restore), (5,80)) |
---|
| 810 | self.text = wx.TextCtrl(self, -1, "hda", (5, 110), size=(200, -1)) |
---|
| 811 | |
---|
| 812 | def SetNext(self, next): |
---|
| 813 | self.next = next |
---|
| 814 | |
---|
| 815 | def SetPrev(self, prev): |
---|
| 816 | self.prev = prev |
---|
| 817 | |
---|
| 818 | def GetNext(self): |
---|
| 819 | if FinalArgs[9] == '-u': |
---|
| 820 | FinalArgs[35] = '' |
---|
| 821 | elif FinalArgs[9] == '': |
---|
| 822 | FinalArgs[35] = self.text.GetValue() |
---|
| 823 | return self.next |
---|
| 824 | |
---|
| 825 | def GetPrev(self): |
---|
| 826 | return self.prev |
---|
| 827 | |
---|
| 828 | #---------------------------------------------------------------------- |
---|
| 829 | class ClonezillaStartRestorePage9(wiz.PyWizardPage): |
---|
| 830 | def __init__(self, parent, title): |
---|
| 831 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 832 | self.next = self.prev = None |
---|
| 833 | self.sizer = makePageTitle(self, title) |
---|
| 834 | |
---|
| 835 | ModeList = [_('msg_multicast_restore'), _('msg_unicast_restore')] |
---|
| 836 | if FinalArgs[32] == 'startdisk': |
---|
| 837 | rb = wx.RadioBox(self, -1, _('msg_choose_the_mode_to_restore_disk'), (35,50), (290,150), ModeList, 1, wx.RA_SPECIFY_COLS) |
---|
| 838 | elif FinalArgs[32] == 'startpart': |
---|
| 839 | rb = wx.RadioBox(self, -1, _('msg_choose_the_mode_to_restore_parts'), (35,50), (290,150), ModeList, 1, wx.RA_SPECIFY_COLS) |
---|
| 840 | self.Bind(wx.EVT_RADIOBOX, self.EvtRadioBox, rb) |
---|
| 841 | if FinalArgs[9] == '-u': |
---|
| 842 | FinalArgs[33] = 'restore' |
---|
| 843 | else: |
---|
| 844 | FinalArgs[33] = 'multicast_restore' |
---|
| 845 | |
---|
| 846 | def EvtRadioBox(self, event): |
---|
| 847 | if event.GetInt() == 0: |
---|
| 848 | FinalArgs[33] = 'multicast_restore' |
---|
| 849 | if event.GetInt() == 1: |
---|
| 850 | FinalArgs[33] = 'restore' |
---|
| 851 | |
---|
| 852 | def SetNext(self, next): |
---|
| 853 | self.next = next |
---|
| 854 | |
---|
| 855 | def SetPrev(self, prev): |
---|
| 856 | self.prev = prev |
---|
| 857 | |
---|
| 858 | def GetNext(self): |
---|
| 859 | next = self.next |
---|
| 860 | if FinalArgs[9] == '-u': |
---|
| 861 | FinalArgs[33] = 'restore' |
---|
| 862 | if FinalArgs[33] == 'restore': |
---|
| 863 | next = next.GetNext() |
---|
| 864 | next = next.GetNext() |
---|
| 865 | next = next.GetNext() |
---|
| 866 | return next |
---|
| 867 | |
---|
| 868 | def GetPrev(self): |
---|
| 869 | return self.prev |
---|
| 870 | |
---|
| 871 | #---------------------------------------------------------------------- |
---|
| 872 | class ClonezillaStartRestorePage10(wiz.PyWizardPage): |
---|
| 873 | def __init__(self, parent, title): |
---|
| 874 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 875 | self.next = self.prev = None |
---|
| 876 | self.sizer = makePageTitle(self, title) |
---|
| 877 | |
---|
| 878 | ModeList = [_('msg_clients_time_to_wait'), _('msg_time_to_wait'), _('msg_clients_to_wait')] |
---|
| 879 | rb = wx.RadioBox(self, -1, _('msg_choose_mode'), (35,50), (350, 150), ModeList, 1, wx.RA_SPECIFY_COLS) |
---|
| 880 | self.Bind(wx.EVT_RADIOBOX, self.EvtRadioBox, rb) |
---|
| 881 | FinalArgs[26] = '--clients-to-wait' |
---|
| 882 | FinalArgs[28] = '--max-time-to-wait' |
---|
| 883 | |
---|
| 884 | def EvtRadioBox(self, event): |
---|
| 885 | if event.GetInt() == 0: |
---|
| 886 | FinalArgs[26] = '--clients-to-wait' |
---|
| 887 | FinalArgs[28] = '--max-time-to-wait' |
---|
| 888 | elif event.GetInt() == 1: |
---|
| 889 | FinalArgs[26] = '' |
---|
| 890 | FinalArgs[28] = '--max-time-to-wait' |
---|
| 891 | elif event.GetInt() == 2: |
---|
| 892 | FinalArgs[26] = '--clients-to-wait' |
---|
| 893 | FinalArgs[28] = '' |
---|
| 894 | |
---|
| 895 | def SetNext(self, next): |
---|
| 896 | self.next = next |
---|
| 897 | |
---|
| 898 | def SetPrev(self, prev): |
---|
| 899 | self.prev = prev |
---|
| 900 | |
---|
| 901 | def GetNext(self): |
---|
| 902 | next = self.next |
---|
| 903 | if FinalArgs[33] == 'restore': |
---|
| 904 | FinalArgs[26] = '' |
---|
| 905 | FinalArgs[28] = '' |
---|
| 906 | next = self.next |
---|
| 907 | if FinalArgs[26] == '' and FinalArgs[28] != '': |
---|
| 908 | next = next.GetNext() |
---|
| 909 | return next |
---|
| 910 | |
---|
| 911 | def GetPrev(self): |
---|
| 912 | return self.prev |
---|
| 913 | #---------------------------------------------------------------------- |
---|
| 914 | class ClonezillaStartRestorePage11(wiz.PyWizardPage): |
---|
| 915 | def __init__(self, parent, title): |
---|
| 916 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 917 | self.next = self.prev = None |
---|
| 918 | self.sizer = makePageTitle(self, title) |
---|
| 919 | |
---|
| 920 | wx.StaticText(self, -1, _('msg_how_many_clients_to_restore'), (20, 80)) |
---|
| 921 | self.text = wx.TextCtrl(self, -1, '5', (20, 110), size=(200, -1)) |
---|
| 922 | |
---|
| 923 | def SetNext(self, next): |
---|
| 924 | self.next = next |
---|
| 925 | |
---|
| 926 | def SetPrev(self, prev): |
---|
| 927 | self.prev = prev |
---|
| 928 | |
---|
| 929 | def GetNext(self): |
---|
| 930 | next = self.next |
---|
| 931 | if FinalArgs[26] != '': |
---|
| 932 | FinalArgs[27] = self.text.GetValue() |
---|
| 933 | next = self.next |
---|
| 934 | if FinalArgs[28] == '': |
---|
| 935 | next = next.GetNext() |
---|
| 936 | return next |
---|
| 937 | |
---|
| 938 | def GetPrev(self): |
---|
| 939 | return self.prev |
---|
| 940 | |
---|
| 941 | #---------------------------------------------------------------------- |
---|
| 942 | class ClonezillaStartRestorePage12(wiz.PyWizardPage): |
---|
| 943 | def __init__(self, parent, title): |
---|
| 944 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 945 | self.next = self.prev = None |
---|
| 946 | self.sizer = makePageTitle(self, title) |
---|
| 947 | |
---|
| 948 | wx.StaticText(self, -1, _('msg_max_time_to_wait_sec'), (20, 80)) |
---|
| 949 | self.text = wx.TextCtrl(self, -1, "300", (20, 110), size=(200, -1)) |
---|
| 950 | |
---|
| 951 | def SetNext(self, next): |
---|
| 952 | self.next = next |
---|
| 953 | |
---|
| 954 | def SetPrev(self, prev): |
---|
| 955 | self.prev = prev |
---|
| 956 | |
---|
| 957 | def GetNext(self): |
---|
| 958 | if FinalArgs[28] != '': |
---|
| 959 | FinalArgs[29] = self.text.GetValue() |
---|
| 960 | return self.next |
---|
| 961 | |
---|
| 962 | def GetPrev(self): |
---|
| 963 | return self.prev |
---|
| 964 | |
---|
| 965 | #---------------------------------------------------------------------- |
---|
| 966 | class ClonezillaStartRestorePage13(wiz.PyWizardPage): |
---|
| 967 | def __init__(self, parent, title): |
---|
| 968 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 969 | self.next = self.prev = None |
---|
| 970 | self.sizer = makePageTitle(self, title) |
---|
| 971 | |
---|
| 972 | def SetNext(self, next): |
---|
| 973 | self.next = next |
---|
| 974 | |
---|
| 975 | def SetPrev(self, prev): |
---|
| 976 | self.prev = prev |
---|
| 977 | |
---|
| 978 | def GetNext(self): |
---|
| 979 | return self.next |
---|
| 980 | |
---|
| 981 | def GetPrev(self): |
---|
| 982 | return self.prev |
---|
| 983 | |
---|
| 984 | #---------------------------------------------------------------------- |
---|
| 985 | class ClonezillaSelectPage1(wiz.PyWizardPage): |
---|
| 986 | def __init__(self, parent, title): |
---|
| 987 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 988 | self.next = self.prev = None |
---|
| 989 | self.sizer = makePageTitle(self, title) |
---|
| 990 | |
---|
| 991 | ModeList = [_('msg_ocs_param_y0'), _('msg_ocs_param_y1'), _('msg_ocs_param_y2'), _('msg_ocs_param_skip')] |
---|
| 992 | wx.StaticText(self,-1,_('msg_if_always_provide_clonezilla_srv'),wx.DLG_PNT(self, 10, 20),wx.DLG_SZE(self, 200, 100),wx.TE_MULTILINE) |
---|
| 993 | rb = wx.RadioBox(self, -1, '', (5,150), wx.DefaultSize, ModeList, 1, wx.RA_SPECIFY_COLS) |
---|
| 994 | self.Bind(wx.EVT_RADIOBOX, self.EvtRadioBox, rb) |
---|
| 995 | rb.SetSelection(1) |
---|
| 996 | FinalArgs[5] = '-y1' |
---|
| 997 | |
---|
| 998 | def EvtRadioBox(self, event): |
---|
| 999 | if event.GetInt() == 0: |
---|
| 1000 | FinalArgs[5] = '-y0' |
---|
| 1001 | elif event.GetInt() == 1: |
---|
| 1002 | FinalArgs[5] = '-y1' |
---|
| 1003 | elif event.GetInt() == 2: |
---|
| 1004 | FinalArgs[5] = '-y2' |
---|
| 1005 | elif event.GetInt() == 3: |
---|
| 1006 | FinalArgs[5] = '' |
---|
| 1007 | |
---|
| 1008 | def SetNext(self, next): |
---|
| 1009 | self.next = next |
---|
| 1010 | |
---|
| 1011 | def SetPrev(self, prev): |
---|
| 1012 | self.prev = prev |
---|
| 1013 | |
---|
| 1014 | def GetNext(self): |
---|
| 1015 | return self.next |
---|
| 1016 | |
---|
| 1017 | def GetPrev(self): |
---|
| 1018 | return self.prev |
---|
| 1019 | |
---|
| 1020 | #---------------------------------------------------------------------- |
---|
| 1021 | class ClonezillaSelectPage2(wiz.PyWizardPage): |
---|
| 1022 | def __init__(self, parent, title): |
---|
| 1023 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 1024 | self.next = self.prev = None |
---|
| 1025 | self.sizer = makePageTitle(self, title) |
---|
| 1026 | |
---|
| 1027 | ArgList = [_('msg_ocs_param_p_choose'), _('msg_ocs_param_p_true'), _('msg_ocs_param_p_poweroff'), _('msg_ocs_param_p_reboot')] |
---|
| 1028 | rb = wx.RadioBox(self, -1, _('msg_choose_post_mode_after_clone'), (35,50), (290,150), ArgList, 1, wx.RA_SPECIFY_COLS) |
---|
| 1029 | self.Bind(wx.EVT_RADIOBOX, self.EvtRadioBox, rb) |
---|
| 1030 | rb.SetSelection(0) |
---|
| 1031 | FinalArgs[6] = '-p choose' |
---|
| 1032 | |
---|
| 1033 | def EvtRadioBox(self, event): |
---|
| 1034 | if event.GetSelection() == 0: |
---|
| 1035 | FinalArgs[6] = '-p choose' |
---|
| 1036 | if event.GetSelection() == 1: |
---|
| 1037 | FinalArgs[6] = '-p true' |
---|
| 1038 | if event.GetSelection() == 2: |
---|
| 1039 | FinalArgs[6] = '-p poweroff' |
---|
| 1040 | if event.GetSelection() == 3: |
---|
| 1041 | FinalArgs[6] = '-p reboot' |
---|
| 1042 | |
---|
| 1043 | def SetNext(self, next): |
---|
| 1044 | self.next = next |
---|
| 1045 | |
---|
| 1046 | def SetPrev(self, prev): |
---|
| 1047 | self.prev = prev |
---|
| 1048 | |
---|
| 1049 | def GetNext(self): |
---|
| 1050 | FinalArgs[7] = 'select_in_client' |
---|
| 1051 | return self.next |
---|
| 1052 | |
---|
| 1053 | def GetPrev(self): |
---|
| 1054 | return self.prev |
---|
| 1055 | |
---|
| 1056 | #---------------------------------------------------------------------- |
---|
| 1057 | class ClonezillaStopPage(wiz.PyWizardPage): |
---|
| 1058 | def __init__(self, parent, title): |
---|
| 1059 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 1060 | self.next = self.prev = None |
---|
| 1061 | self.sizer = makePageTitle(self, title) |
---|
| 1062 | |
---|
| 1063 | wx.StaticText(self, -1, _('msg_clonezilla_stop'),(50,100)) |
---|
| 1064 | FinalArgs[0] = '/opt/drbl/sbin/dcs' |
---|
| 1065 | FinalArgs[3] = 'clonezilla-stop' |
---|
| 1066 | |
---|
| 1067 | def SetNext(self, next): |
---|
| 1068 | self.next = next |
---|
| 1069 | |
---|
| 1070 | def SetPrev(self, prev): |
---|
| 1071 | self.prev = prev |
---|
| 1072 | |
---|
| 1073 | def GetNext(self): |
---|
| 1074 | return self.next |
---|
| 1075 | |
---|
| 1076 | def GetPrev(self): |
---|
| 1077 | return self.prev |
---|
| 1078 | |
---|
| 1079 | #---------------------------------------------------------------------- |
---|
| 1080 | class LocalPage(wiz.PyWizardPage): |
---|
| 1081 | def __init__(self, parent, title): |
---|
| 1082 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 1083 | self.next = self.prev = None |
---|
| 1084 | self.sizer = makePageTitle(self, title) |
---|
| 1085 | |
---|
| 1086 | wx.StaticText(self, -1, _('msg_local'),(50,100)) |
---|
| 1087 | FinalArgs[0] = '/opt/drbl/sbin/dcs' |
---|
| 1088 | FinalArgs[3] = 'local' |
---|
| 1089 | |
---|
| 1090 | def SetNext(self, next): |
---|
| 1091 | self.next = next |
---|
| 1092 | |
---|
| 1093 | def SetPrev(self, prev): |
---|
| 1094 | self.prev = prev |
---|
| 1095 | |
---|
| 1096 | def GetNext(self): |
---|
| 1097 | return self.next |
---|
| 1098 | |
---|
| 1099 | def GetPrev(self): |
---|
| 1100 | return self.prev |
---|
| 1101 | |
---|
| 1102 | #---------------------------------------------------------------------- |
---|
| 1103 | class RebootPage(wiz.PyWizardPage): |
---|
| 1104 | def __init__(self, parent, title): |
---|
| 1105 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 1106 | self.next = self.prev = None |
---|
| 1107 | self.sizer = makePageTitle(self, title) |
---|
| 1108 | |
---|
| 1109 | wx.StaticText(self, -1, _('msg_reboot'),(50,100)) |
---|
| 1110 | FinalArgs[0] = '/opt/drbl/sbin/dcs' |
---|
| 1111 | FinalArgs[3] = 'reboot' |
---|
| 1112 | |
---|
| 1113 | def SetNext(self, next): |
---|
| 1114 | self.next = next |
---|
| 1115 | |
---|
| 1116 | def SetPrev(self, prev): |
---|
| 1117 | self.prev = prev |
---|
| 1118 | |
---|
| 1119 | def GetNext(self): |
---|
| 1120 | return self.next |
---|
| 1121 | |
---|
| 1122 | def GetPrev(self): |
---|
| 1123 | return self.prev |
---|
| 1124 | |
---|
| 1125 | #---------------------------------------------------------------------- |
---|
| 1126 | class ShutdownPage(wiz.PyWizardPage): |
---|
| 1127 | def __init__(self, parent, title): |
---|
| 1128 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 1129 | self.next = self.prev = None |
---|
| 1130 | self.sizer = makePageTitle(self, title) |
---|
| 1131 | |
---|
| 1132 | wx.StaticText(self, -1, _('msg_shutdown'),(50,100)) |
---|
| 1133 | FinalArgs[0] = '/opt/drbl/sbin/dcs' |
---|
| 1134 | FinalArgs[3] = 'shutdown' |
---|
| 1135 | |
---|
| 1136 | def SetNext(self, next): |
---|
| 1137 | self.next = next |
---|
| 1138 | |
---|
| 1139 | def SetPrev(self, prev): |
---|
| 1140 | self.prev = prev |
---|
| 1141 | |
---|
| 1142 | def GetNext(self): |
---|
| 1143 | return self.next |
---|
| 1144 | |
---|
| 1145 | def GetPrev(self): |
---|
| 1146 | return self.prev |
---|
| 1147 | |
---|
| 1148 | #---------------------------------------------------------------------- |
---|
| 1149 | class WakeOnLanPage(wiz.PyWizardPage): |
---|
| 1150 | def __init__(self, parent, title): |
---|
| 1151 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 1152 | self.next = self.prev = None |
---|
| 1153 | self.sizer = makePageTitle(self, title) |
---|
| 1154 | |
---|
| 1155 | wx.StaticText(self, -1, _('msg_Wake_on_LAN'), (50,100)) |
---|
| 1156 | FinalArgs[0] = '/opt/drbl/sbin/dcs' |
---|
| 1157 | FinalArgs[3] = 'Wake-on-LAN' |
---|
| 1158 | |
---|
| 1159 | def SetNext(self, next): |
---|
| 1160 | self.next = next |
---|
| 1161 | |
---|
| 1162 | def SetPrev(self, prev): |
---|
| 1163 | self.prev = prev |
---|
| 1164 | |
---|
| 1165 | def GetNext(self): |
---|
| 1166 | return self.next |
---|
| 1167 | |
---|
| 1168 | def GetPrev(self): |
---|
| 1169 | return self.prev |
---|
| 1170 | |
---|
| 1171 | #---------------------------------------------------------------------- |
---|
| 1172 | class FinalPage(wiz.PyWizardPage): |
---|
| 1173 | def __init__(self, parent, title): |
---|
| 1174 | wiz.PyWizardPage.__init__(self, parent) |
---|
| 1175 | self.next = self.prev = None |
---|
| 1176 | self.sizer = makePageTitle(self, title) |
---|
| 1177 | |
---|
| 1178 | self.tc = wx.TextCtrl(self, -1,'', pos=(35,50), size=(350, 350), style=wx.TE_MULTILINE|wx.TE_READONLY) |
---|
| 1179 | b = wx.Button(self, -1, 'see log', pos=(400,250)) |
---|
| 1180 | self.Bind(wx.EVT_BUTTON, self.OnWriteLog, b) |
---|
| 1181 | |
---|
| 1182 | def OnWriteLog(self, evt): |
---|
| 1183 | i = 0 |
---|
| 1184 | for i in range(0,36): |
---|
| 1185 | if FinalArgs[i] != '': |
---|
| 1186 | self.tc.WriteText('%s ' % FinalArgs[i]) |
---|
| 1187 | FinalArgs[i] = '' |
---|
| 1188 | |
---|
| 1189 | def SetNext(self, next): |
---|
| 1190 | self.next = next |
---|
| 1191 | |
---|
| 1192 | def SetPrev(self, prev): |
---|
| 1193 | self.prev = prev |
---|
| 1194 | |
---|
| 1195 | def GetNext(self): |
---|
| 1196 | return self.next |
---|
| 1197 | |
---|
| 1198 | def GetPrev(self): |
---|
| 1199 | return self.prev |
---|
| 1200 | |
---|
| 1201 | #---------------------------------------------------------------------- |
---|
| 1202 | class MainFrame(wx.Frame): |
---|
| 1203 | def __init__(self, parent, id): |
---|
| 1204 | wx.Frame.__init__(self, parent, id, 'TEST WIZARD', (300,200), (600,400), style=wx.CAPTION) |
---|
| 1205 | #wx.NO_FULL_REPAINT_ON_RESIZE |
---|
| 1206 | self.scroll = wx.ScrolledWindow(self, -1) |
---|
| 1207 | self.scroll.SetScrollbars(1, 1, 550, 500) |
---|
| 1208 | |
---|
| 1209 | FunctionList = [_('msg_remote_linux_graphic'), _('msg_remote_linux_text'), _('msg_thin_client') |
---|
| 1210 | , _('msg_remote_memtest'), _('msg_remote_fdos'), _('msg_clonezilla_start_save') |
---|
| 1211 | , _('msg_clonezilla_start_restore'), _('msg_clonezilla_selec_in_client'), _('msg_clonezilla_stop') |
---|
| 1212 | , _('msg_local'), _('msg_reboot'), _('msg_shutdown'), _('msg_Wake_on_LAN')] |
---|
| 1213 | rb = wx.RadioBox(self.scroll, -1, '', (35,20), (0,0), FunctionList, 1, wx.RA_SPECIFY_COLS|wx.NO_BORDER) |
---|
| 1214 | self.scroll.Bind(wx.EVT_RADIOBOX, self.EvtRadioBox, rb) |
---|
| 1215 | rb.SetSelection(0) |
---|
| 1216 | self.b = wx.Button(self.scroll, wx.ID_FORWARD, pos=(450, 350)) # not translated |
---|
| 1217 | self.scroll.Bind(wx.EVT_BUTTON, self.RemoteLinuxGraWizard, self.b) |
---|
| 1218 | |
---|
| 1219 | def EvtRadioBox(self, event): |
---|
| 1220 | if event.GetSelection() == 0: |
---|
| 1221 | #b = wx.Button(self.scroll, wx.ID_FORWARD,(pos,220)) |
---|
| 1222 | self.scroll.Bind(wx.EVT_BUTTON, self.RemoteLinuxGraWizard, self.b) |
---|
| 1223 | if event.GetSelection() == 1: |
---|
| 1224 | #b = wx.Button(self.scroll, wx.ID_FORWARD) |
---|
| 1225 | self.scroll.Bind(wx.EVT_BUTTON, self.RemoteLinuxTxtWizard, self.b) |
---|
| 1226 | if event.GetSelection() == 2: |
---|
| 1227 | #b = wx.Button(self.scroll, wx.ID_FORWARD) |
---|
| 1228 | self.scroll.Bind(wx.EVT_BUTTON, self.TerminalWizard, self.b) |
---|
| 1229 | if event.GetSelection() == 3: |
---|
| 1230 | #b = wx.Button(self.scroll, wx.ID_FORWARD, pos=(450, 350)) |
---|
| 1231 | self.scroll.Bind(wx.EVT_BUTTON, self.RemoteMemTestWizard, self.b) |
---|
| 1232 | if event.GetSelection() == 4: |
---|
| 1233 | #b = wx.Button(self.scroll, wx.ID_FORWARD, pos=(450, 350)) |
---|
| 1234 | self.scroll.Bind(wx.EVT_BUTTON, self.RemotefdosWizard, self.b) |
---|
| 1235 | if event.GetSelection() == 5: |
---|
| 1236 | #b = wx.Button(self.scroll, wx.ID_FORWARD, pos=(450, 350)) |
---|
| 1237 | self.scroll.Bind(wx.EVT_BUTTON, self.ClonezillaStartSaveWizard, self.b) |
---|
| 1238 | if event.GetSelection() == 6: |
---|
| 1239 | #b = wx.Button(self.scroll, wx.ID_FORWARD, pos=(450, 350)) |
---|
| 1240 | self.scroll.Bind(wx.EVT_BUTTON, self.ClonezillaStartRestoreWizard, self.b) |
---|
| 1241 | if event.GetSelection() == 7: |
---|
| 1242 | #b = wx.Button(self.scroll, wx.ID_FORWARD, pos=(450, 350)) |
---|
| 1243 | self.scroll.Bind(wx.EVT_BUTTON, self.ClonezillaSelectWizard, self.b) |
---|
| 1244 | if event.GetSelection() == 8: |
---|
| 1245 | #b = wx.Button(self.scroll, wx.ID_FORWARD, pos=(450, 350)) |
---|
| 1246 | self.scroll.Bind(wx.EVT_BUTTON, self.ClonezillaStopWizard, self.b) |
---|
| 1247 | if event.GetSelection() == 9: |
---|
| 1248 | #b = wx.Button(self.scroll, wx.ID_FORWARD, pos=(450, 350)) |
---|
| 1249 | self.scroll.Bind(wx.EVT_BUTTON, self.LocalWizard, self.b) |
---|
| 1250 | if event.GetSelection() == 10: |
---|
| 1251 | #b = wx.Button(self.scroll, wx.ID_FORWARD, pos=(450, 350)) |
---|
| 1252 | self.scroll.Bind(wx.EVT_BUTTON, self.RebootWizard, self.b) |
---|
| 1253 | if event.GetSelection() == 11: |
---|
| 1254 | #b = wx.Button(self.scroll, wx.ID_FORWARD, pos=(450, 350)) |
---|
| 1255 | self.scroll.Bind(wx.EVT_BUTTON, self.ShutdownWizard, self.b) |
---|
| 1256 | if event.GetSelection() == 12: |
---|
| 1257 | #b = wx.Button(self.scroll, wx.ID_FORWARD, pos=(450, 350)) |
---|
| 1258 | self.scroll.Bind(wx.EVT_BUTTON, self.WakeOnLanWizard, self.b) |
---|
| 1259 | |
---|
| 1260 | |
---|
| 1261 | #------------------------------Wizard Modules-------------------------- |
---|
| 1262 | def RemoteLinuxGraWizard(self,evt): |
---|
| 1263 | wizard = wiz.Wizard(self, -1, 'RemoteLinuxGraWizard', pos = (500,200)) |
---|
| 1264 | |
---|
| 1265 | page1 = SetAllClientsPage(wizard, '') |
---|
| 1266 | page2 = SelectClientsPage(wizard, '') |
---|
| 1267 | page3 = RemoteLinuxGraPage(wizard, '') |
---|
| 1268 | page4 = FinalPage(wizard, '') |
---|
| 1269 | |
---|
| 1270 | self.page1 = page1 |
---|
| 1271 | wizard.SetPageSize((500,300)) |
---|
| 1272 | |
---|
| 1273 | page1.SetNext(page2) |
---|
| 1274 | page2.SetPrev(page1) |
---|
| 1275 | page2.SetNext(page3) |
---|
| 1276 | page3.SetPrev(page2) |
---|
| 1277 | page3.SetNext(page4) |
---|
| 1278 | |
---|
| 1279 | if wizard.RunWizard(page1): |
---|
| 1280 | wx.MessageBox(_('success'), "That's all folks!") |
---|
| 1281 | else: |
---|
| 1282 | wx.MessageBox(_('cancel'), "That's all folks!") |
---|
| 1283 | |
---|
| 1284 | #------------------------------Wizard Modules-------------------------- |
---|
| 1285 | def RemoteLinuxTxtWizard(self,evt): |
---|
| 1286 | wizard = wiz.Wizard(self, -1, 'RemoteLinuxTextWizard', pos = (500,200)) |
---|
| 1287 | |
---|
| 1288 | page1 = SetAllClientsPage(wizard, '') |
---|
| 1289 | page2 = SelectClientsPage(wizard, '') |
---|
| 1290 | page3 = RemoteLinuxTxtPage(wizard, '') |
---|
| 1291 | page4 = FinalPage(wizard, '') |
---|
| 1292 | |
---|
| 1293 | self.page1 = page1 |
---|
| 1294 | wizard.SetPageSize((500,300)) |
---|
| 1295 | |
---|
| 1296 | page1.SetNext(page2) |
---|
| 1297 | page2.SetPrev(page1) |
---|
| 1298 | page2.SetNext(page3) |
---|
| 1299 | page3.SetPrev(page2) |
---|
| 1300 | page3.SetNext(page4) |
---|
| 1301 | |
---|
| 1302 | if wizard.RunWizard(page1): |
---|
| 1303 | wx.MessageBox(_('success'), "That's all folks!") |
---|
| 1304 | else: |
---|
| 1305 | wx.MessageBox(_('cancel'), "That's all folks!") |
---|
| 1306 | |
---|
| 1307 | #------------------------------Wizard Modules-------------------------- |
---|
| 1308 | def TerminalWizard(self,evt): |
---|
| 1309 | wizard = wiz.Wizard(self, -1, 'TerminalWizard', pos = (500,200)) |
---|
| 1310 | |
---|
| 1311 | page1 = SetAllClientsPage(wizard, '') |
---|
| 1312 | page2 = SelectClientsPage(wizard, '') |
---|
| 1313 | page3 = TerminalPage(wizard, '') |
---|
| 1314 | page4 = FinalPage(wizard, '') |
---|
| 1315 | |
---|
| 1316 | self.page1 = page1 |
---|
| 1317 | wizard.SetPageSize((500,300)) |
---|
| 1318 | |
---|
| 1319 | page1.SetNext(page2) |
---|
| 1320 | page2.SetPrev(page1) |
---|
| 1321 | page2.SetNext(page3) |
---|
| 1322 | page3.SetPrev(page2) |
---|
| 1323 | page3.SetNext(page4) |
---|
| 1324 | |
---|
| 1325 | if wizard.RunWizard(page1): |
---|
| 1326 | wx.MessageBox(_('success'), "That's all folks!") |
---|
| 1327 | else: |
---|
| 1328 | wx.MessageBox(_('cancel'), "That's all folks!") |
---|
| 1329 | |
---|
| 1330 | #------------------------------Wizard Modules-------------------------- |
---|
| 1331 | def RemoteMemTestWizard(self,evt): |
---|
| 1332 | wizard = wiz.Wizard(self, -1, 'RemoteMemTestWizard', pos = (500,200)) |
---|
| 1333 | |
---|
| 1334 | page1 = SetAllClientsPage(wizard, '') |
---|
| 1335 | page2 = SelectClientsPage(wizard, '') |
---|
| 1336 | page3 = RemoteMemTestPage(wizard, '') |
---|
| 1337 | page4 = FinalPage(wizard, '') |
---|
| 1338 | |
---|
| 1339 | self.page1 = page1 |
---|
| 1340 | wizard.SetPageSize((500,300)) |
---|
| 1341 | |
---|
| 1342 | page1.SetNext(page2) |
---|
| 1343 | page2.SetPrev(page1) |
---|
| 1344 | page2.SetNext(page3) |
---|
| 1345 | page3.SetPrev(page2) |
---|
| 1346 | page3.SetNext(page4) |
---|
| 1347 | |
---|
| 1348 | if wizard.RunWizard(page1): |
---|
| 1349 | wx.MessageBox(_('success'), "That's all folks!") |
---|
| 1350 | else: |
---|
| 1351 | wx.MessageBox(_('cancel'), "That's all folks!") |
---|
| 1352 | |
---|
| 1353 | #------------------------------Wizard Modules-------------------------- |
---|
| 1354 | def RemotefdosWizard(self,evt): |
---|
| 1355 | wizard = wiz.Wizard(self, -1, 'RemotefdosWizard', pos = (500,200)) |
---|
| 1356 | |
---|
| 1357 | page1 = SetAllClientsPage(wizard, '') |
---|
| 1358 | page2 = SelectClientsPage(wizard, '') |
---|
| 1359 | page3 = RemotefdosPage(wizard,'') |
---|
| 1360 | page4 = FinalPage(wizard,'') |
---|
| 1361 | |
---|
| 1362 | self.page1 = page1 |
---|
| 1363 | wizard.SetPageSize((500,300)) |
---|
| 1364 | |
---|
| 1365 | page1.SetNext(page2) |
---|
| 1366 | page2.SetPrev(page1) |
---|
| 1367 | page2.SetNext(page3) |
---|
| 1368 | page3.SetPrev(page2) |
---|
| 1369 | page3.SetNext(page4) |
---|
| 1370 | |
---|
| 1371 | if wizard.RunWizard(page1): |
---|
| 1372 | wx.MessageBox(_('success'), "That's all folks!") |
---|
| 1373 | else: |
---|
| 1374 | wx.MessageBox(_('cancel'), "That's all folks!") |
---|
| 1375 | |
---|
| 1376 | #------------------------------Wizard Modules-------------------------- |
---|
| 1377 | def ClonezillaStartSaveWizard(self,evt): |
---|
| 1378 | wizard = wiz.Wizard(self, -1, 'ClonezillaStartSaveWizard', pos = (500,200)) |
---|
| 1379 | |
---|
| 1380 | page1 = SetAllClientsPage(wizard, '') |
---|
| 1381 | page2 = SelectClientsPage(wizard, '') |
---|
| 1382 | page3 = ClonezillaStartSavePage1(wizard, '') |
---|
| 1383 | page4 = ClonezillaStartSavePage2(wizard, '') |
---|
| 1384 | page5 = ClonezillaStartSavePage3(wizard, '') |
---|
| 1385 | page6 = ClonezillaStartSavePage4(wizard, '') |
---|
| 1386 | page7 = ClonezillaStartSavePage5(wizard, '') |
---|
| 1387 | page8 = ClonezillaStartSavePage6(wizard, '') |
---|
| 1388 | page9 = FinalPage(wizard,'') |
---|
| 1389 | |
---|
| 1390 | self.page1 = page1 |
---|
| 1391 | wizard.SetPageSize((500,300)) |
---|
| 1392 | |
---|
| 1393 | page1.SetNext(page2) |
---|
| 1394 | page2.SetPrev(page1) |
---|
| 1395 | page2.SetNext(page3) |
---|
| 1396 | page3.SetPrev(page2) |
---|
| 1397 | page3.SetNext(page4) |
---|
| 1398 | page4.SetPrev(page3) |
---|
| 1399 | page4.SetNext(page5) |
---|
| 1400 | page5.SetPrev(page4) |
---|
| 1401 | page5.SetNext(page6) |
---|
| 1402 | page6.SetPrev(page5) |
---|
| 1403 | page6.SetNext(page7) |
---|
| 1404 | page7.SetPrev(page6) |
---|
| 1405 | page7.SetNext(page8) |
---|
| 1406 | page8.SetPrev(page7) |
---|
| 1407 | page8.SetNext(page9) |
---|
| 1408 | |
---|
| 1409 | if wizard.RunWizard(page1): |
---|
| 1410 | wx.MessageBox(_('success'), "That's all folks!") |
---|
| 1411 | else: |
---|
| 1412 | wx.MessageBox(_('cancel'), "That's all folks!") |
---|
| 1413 | |
---|
| 1414 | #------------------------------Wizard Modules-------------------------- |
---|
| 1415 | def ClonezillaStartRestoreWizard(self,evt): |
---|
| 1416 | wizard = wiz.Wizard(self, -1, 'ClonezillaStartRestoreWizard', pos = (500,200)) |
---|
| 1417 | |
---|
| 1418 | page1 = SetAllClientsPage(wizard, '') |
---|
| 1419 | page2 = SelectClientsPage(wizard, '') |
---|
| 1420 | page3 = ClonezillaStartRestorePage1(wizard, '') |
---|
| 1421 | page4 = ClonezillaStartRestorePage2(wizard, '') |
---|
| 1422 | page5 = ClonezillaStartRestorePage3(wizard, '') |
---|
| 1423 | page6 = ClonezillaStartRestorePage4(wizard, '') |
---|
| 1424 | page7 = ClonezillaStartRestorePage5(wizard, '') |
---|
| 1425 | page8 = ClonezillaStartRestorePage6(wizard, '') |
---|
| 1426 | page9 = ClonezillaStartRestorePage7(wizard, '') |
---|
| 1427 | page10 = ClonezillaStartRestorePage8(wizard, '') |
---|
| 1428 | page11 = ClonezillaStartRestorePage9(wizard, '') |
---|
| 1429 | page12 = ClonezillaStartRestorePage10(wizard, '') |
---|
| 1430 | page13 = ClonezillaStartRestorePage11(wizard, '') |
---|
| 1431 | page14 = ClonezillaStartRestorePage12(wizard, '') |
---|
| 1432 | page15 = ClonezillaStartRestorePage13(wizard, '') |
---|
| 1433 | page16 = FinalPage(wizard,'') |
---|
| 1434 | |
---|
| 1435 | self.page1 = page1 |
---|
| 1436 | wizard.SetPageSize((500,300)) |
---|
| 1437 | |
---|
| 1438 | page1.SetNext(page2) |
---|
| 1439 | page2.SetPrev(page1) |
---|
| 1440 | page2.SetNext(page3) |
---|
| 1441 | page3.SetPrev(page2) |
---|
| 1442 | page3.SetNext(page4) |
---|
| 1443 | page4.SetPrev(page3) |
---|
| 1444 | page4.SetNext(page5) |
---|
| 1445 | page5.SetPrev(page4) |
---|
| 1446 | page5.SetNext(page6) |
---|
| 1447 | page6.SetPrev(page5) |
---|
| 1448 | page6.SetNext(page7) |
---|
| 1449 | page7.SetPrev(page6) |
---|
| 1450 | page7.SetNext(page8) |
---|
| 1451 | page8.SetPrev(page7) |
---|
| 1452 | page8.SetNext(page9) |
---|
| 1453 | page9.SetPrev(page8) |
---|
| 1454 | page9.SetNext(page10) |
---|
| 1455 | page10.SetPrev(page9) |
---|
| 1456 | page10.SetNext(page11) |
---|
| 1457 | page11.SetPrev(page9) |
---|
| 1458 | page11.SetNext(page12) |
---|
| 1459 | page12.SetPrev(page9) |
---|
| 1460 | page12.SetNext(page13) |
---|
| 1461 | page13.SetPrev(page9) |
---|
| 1462 | page13.SetNext(page14) |
---|
| 1463 | page14.SetPrev(page9) |
---|
| 1464 | page14.SetNext(page15) |
---|
| 1465 | page15.SetPrev(page14) |
---|
| 1466 | page15.SetNext(page16) |
---|
| 1467 | |
---|
| 1468 | if wizard.RunWizard(page1): |
---|
| 1469 | wx.MessageBox(_('success'), "That's all folks!") |
---|
| 1470 | else: |
---|
| 1471 | wx.MessageBox(_('cancel'), "That's all folks!") |
---|
| 1472 | |
---|
| 1473 | #------------------------------Wizard Modules-------------------------- |
---|
| 1474 | def ClonezillaSelectWizard(self,evt): |
---|
| 1475 | wizard = wiz.Wizard(self, -1, 'ClonezillaSelectWizard', pos = (500,200)) |
---|
| 1476 | |
---|
| 1477 | page1 = SetAllClientsPage(wizard, '') |
---|
| 1478 | page2 = SelectClientsPage(wizard, '') |
---|
| 1479 | page3 = ClonezillaSelectPage1(wizard, '') |
---|
| 1480 | page4 = ClonezillaSelectPage2(wizard, '') |
---|
| 1481 | page5 = FinalPage(wizard, '') |
---|
| 1482 | |
---|
| 1483 | self.page1 = page1 |
---|
| 1484 | wizard.SetPageSize((500,300)) |
---|
| 1485 | |
---|
| 1486 | page1.SetNext(page2) |
---|
| 1487 | page2.SetPrev(page1) |
---|
| 1488 | page2.SetNext(page3) |
---|
| 1489 | page3.SetPrev(page2) |
---|
| 1490 | page3.SetNext(page4) |
---|
| 1491 | page4.SetPrev(page3) |
---|
| 1492 | page4.SetNext(page5) |
---|
| 1493 | |
---|
| 1494 | if wizard.RunWizard(page1): |
---|
| 1495 | wx.MessageBox(_('success'), "That's all folks!") |
---|
| 1496 | else: |
---|
| 1497 | wx.MessageBox(_('cancel'), "That's all folks!") |
---|
| 1498 | |
---|
| 1499 | #------------------------------Wizard Modules-------------------------- |
---|
| 1500 | def ClonezillaStopWizard(self,evt): |
---|
| 1501 | wizard = wiz.Wizard(self, -1, 'ClonezillaStopWizard', pos = (500,200)) |
---|
| 1502 | |
---|
| 1503 | page1 = SetAllClientsPage(wizard, '') |
---|
| 1504 | page2 = SelectClientsPage(wizard, '') |
---|
| 1505 | page3 = ClonezillaStopPage(wizard, '') |
---|
| 1506 | page4 = FinalPage(wizard, '') |
---|
| 1507 | |
---|
| 1508 | self.page1 = page1 |
---|
| 1509 | wizard.SetPageSize((500,300)) |
---|
| 1510 | |
---|
| 1511 | page1.SetNext(page2) |
---|
| 1512 | page2.SetPrev(page1) |
---|
| 1513 | page2.SetNext(page3) |
---|
| 1514 | page3.SetPrev(page2) |
---|
| 1515 | page3.SetNext(page4) |
---|
| 1516 | |
---|
| 1517 | if wizard.RunWizard(page1): |
---|
| 1518 | wx.MessageBox(_('success'), "That's all folks!") |
---|
| 1519 | else: |
---|
| 1520 | wx.MessageBox(_('cancel'), "That's all folks!") |
---|
| 1521 | |
---|
| 1522 | #------------------------------Wizard Modules-------------------------- |
---|
| 1523 | def LocalWizard(self,evt): |
---|
| 1524 | wizard = wiz.Wizard(self, -1, 'LocalWizard', pos = (500,200)) |
---|
| 1525 | |
---|
| 1526 | page1 = SetAllClientsPage(wizard, '') |
---|
| 1527 | page2 = SelectClientsPage(wizard, '') |
---|
| 1528 | page3 = LocalPage(wizard, '') |
---|
| 1529 | page4 = FinalPage(wizard, '') |
---|
| 1530 | |
---|
| 1531 | self.page1 = page1 |
---|
| 1532 | wizard.SetPageSize((500,300)) |
---|
| 1533 | |
---|
| 1534 | page1.SetNext(page2) |
---|
| 1535 | page2.SetPrev(page1) |
---|
| 1536 | page2.SetNext(page3) |
---|
| 1537 | page3.SetPrev(page2) |
---|
| 1538 | page3.SetNext(page4) |
---|
| 1539 | |
---|
| 1540 | if wizard.RunWizard(page1): |
---|
| 1541 | wx.MessageBox(_('success'), "That's all folks!") |
---|
| 1542 | else: |
---|
| 1543 | wx.MessageBox(_('cancel'), "That's all folks!") |
---|
| 1544 | |
---|
| 1545 | #------------------------------Wizard Modules-------------------------- |
---|
| 1546 | def RebootWizard(self,evt): |
---|
| 1547 | wizard = wiz.Wizard(self, -1, 'RebootWizard', pos = (500,200)) |
---|
| 1548 | |
---|
| 1549 | page1 = SetAllClientsPage(wizard, '') |
---|
| 1550 | page2 = SelectClientsPage(wizard, '') |
---|
| 1551 | page3 = RebootPage(wizard, '') |
---|
| 1552 | page4 = FinalPage(wizard, '') |
---|
| 1553 | |
---|
| 1554 | self.page1 = page1 |
---|
| 1555 | wizard.SetPageSize((500,300)) |
---|
| 1556 | |
---|
| 1557 | page1.SetNext(page2) |
---|
| 1558 | page2.SetPrev(page1) |
---|
| 1559 | page2.SetNext(page3) |
---|
| 1560 | page3.SetPrev(page2) |
---|
| 1561 | page3.SetNext(page4) |
---|
| 1562 | |
---|
| 1563 | if wizard.RunWizard(page1): |
---|
| 1564 | wx.MessageBox(_('success'), "That's all folks!") |
---|
| 1565 | else: |
---|
| 1566 | wx.MessageBox(_('cancel'), "That's all folks!") |
---|
| 1567 | |
---|
| 1568 | #------------------------------Wizard Modules-------------------------- |
---|
| 1569 | def ShutdownWizard(self,evt): |
---|
| 1570 | wizard = wiz.Wizard(self, -1, 'ShutdownWizard', pos = (500,200)) |
---|
| 1571 | |
---|
| 1572 | page1 = SetAllClientsPage(wizard, '') |
---|
| 1573 | page2 = SelectClientsPage(wizard, '') |
---|
| 1574 | page3 = ShutdownPage(wizard, '') |
---|
| 1575 | page4 = FinalPage(wizard, '') |
---|
| 1576 | |
---|
| 1577 | self.page1 = page1 |
---|
| 1578 | wizard.SetPageSize((500,300)) |
---|
| 1579 | |
---|
| 1580 | page1.SetNext(page2) |
---|
| 1581 | page2.SetPrev(page1) |
---|
| 1582 | page2.SetNext(page3) |
---|
| 1583 | page3.SetPrev(page2) |
---|
| 1584 | page3.SetNext(page4) |
---|
| 1585 | |
---|
| 1586 | if wizard.RunWizard(page1): |
---|
| 1587 | wx.MessageBox(_('success'), "That's all folks!") |
---|
| 1588 | else: |
---|
| 1589 | wx.MessageBox(_('cancel'), "That's all folks!") |
---|
| 1590 | |
---|
| 1591 | #------------------------------Wizard Modules----------------------------- |
---|
| 1592 | def WakeOnLanWizard(self,evt): |
---|
| 1593 | wizard = wiz.Wizard(self, -1, 'WakeOnLanWizard', pos = (500,200)) |
---|
| 1594 | |
---|
| 1595 | page1 = SetAllClientsPage(wizard, '') |
---|
| 1596 | page2 = SelectClientsPage(wizard, '') |
---|
| 1597 | page3 = WakeOnLanPage(wizard, '') |
---|
| 1598 | page4 = FinalPage(wizard, '') |
---|
| 1599 | |
---|
| 1600 | self.page1 = page1 |
---|
| 1601 | wizard.SetPageSize((500,300)) |
---|
| 1602 | |
---|
| 1603 | page1.SetNext(page2) |
---|
| 1604 | page2.SetPrev(page1) |
---|
| 1605 | page2.SetNext(page3) |
---|
| 1606 | page3.SetPrev(page2) |
---|
| 1607 | page3.SetNext(page4) |
---|
| 1608 | |
---|
| 1609 | if wizard.RunWizard(page1): |
---|
| 1610 | wx.MessageBox(_('success'), "That's all folks!") |
---|
| 1611 | else: |
---|
| 1612 | wx.MessageBox(_('cancel'), "That's all folks!") |
---|
| 1613 | |
---|
| 1614 | #------------------------------------------------------------------------ |
---|
| 1615 | if __name__ == '__main__': |
---|
| 1616 | app = wx.PySimpleApp() |
---|
| 1617 | frame = MainFrame(parent=None, id=-1) |
---|
| 1618 | frame.Show() |
---|
| 1619 | app.MainLoop() |
---|
| 1620 | |
---|