1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 from PyQt4 import QtGui
29 from camelot.core.utils import ugettext_lazy as _
30 from camelot.view.wizard.pages.select import SelectFilePage
31 from camelot.view.wizard.pages.progress_page import ProgressPage
32 from camelot.view.art import Icon
33
35 title = _('Select backup file')
36 sub_title = _(
37 "Please select a backup file. "
38 "All data in this file will be overwritten."
39 )
40 icon = Icon('tango/32x32/actions/document-save.png')
41 save = True
42
43 -class BackupPage(ProgressPage):
44 title = _('Backup in progress')
45
46 - def __init__(self, backup_mechanism, parent=None):
47 super(BackupPage, self).__init__(parent)
48 self._backup_mechanism = backup_mechanism
49
51 filename = self.field('datasource').toString()
52 backup_mechanism = self._backup_mechanism(filename)
53 for completed, total, description in backup_mechanism.backup():
54 self.emit( self.update_maximum_signal, total )
55 self.emit( self.update_progress_signal, completed, description )
56
58 """Wizard to perform a backup using a BackupMechanism"""
59
60 window_title = _('Backup')
61
62 - def __init__(self, backup_mechanism, parent=None):
67
68 -class RestorePage(ProgressPage):
69 title = _('Restore in progress')
70
71 - def __init__(self, backup_mechanism, parent=None):
72 super(RestorePage, self).__init__(parent)
73 self._backup_mechanism = backup_mechanism
74
76 filename = self.field('datasource').toString()
77 backup_mechanism = self._backup_mechanism(filename)
78 for completed, total, description in backup_mechanism.restore():
79 self.emit( self.update_maximum_signal, total )
80 self.emit( self.update_progress_signal, completed, description )
81
83 title = _('Select restore file')
84 sub_title = _( "Please select a backup file from which to restore the database."
85 "All data in the database will be overwritten with data from this file" )
86 icon = Icon('tango/32x32/devices/drive-harddisk.png')
87 save = False
88
90 """Wizard to perform a restore using a BackupMechanism"""
91
92 window_title = _('Restore')
93
94 - def __init__(self, backup_mechanism, parent=None):
99