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