1
2
3
4
5
6 import wx
7
8
9 import gettext
10
11
12
13
14
15
18
19 kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_DIALOG_STYLE | wx.MAXIMIZE_BOX | wx.MINIMIZE_BOX | wx.RESIZE_BORDER
20 wx.Dialog.__init__(self, *args, **kwds)
21 self.SetSize((600, 319))
22 self._LBL_header = wx.StaticText(self, wx.ID_ANY, _("\nDescribe the intended action.\n"))
23 self._BTN_select_directory = wx.Button(self, wx.ID_ANY, _("Path:"), style=wx.BU_EXACTFIT)
24 self._LBL_directory = wx.StaticText(self, wx.ID_ANY, _("<shows default path computed at runtime>"), style=wx.ST_ELLIPSIZE_START)
25 self._LBL_dir_is_empty = wx.StaticText(self, wx.ID_ANY, _("this path is/is not empty"))
26 self._BTN_open_directory = wx.Button(self, wx.ID_ANY, _("Open"), style=wx.BU_EXACTFIT)
27 self._BTN_clear_directory = wx.Button(self, wx.ID_ANY, _("Clear"), style=wx.BU_EXACTFIT)
28 self._CHBOX_use_subdirectory = wx.CheckBox(self, wx.ID_ANY, _("use subdirectory"), style=wx.CHK_2STATE)
29 self._CHBOX_generate_metadata = wx.CheckBox(self, wx.ID_ANY, _("generate &metadata"), style=wx.CHK_2STATE)
30 self._CHBOX_encrypt = wx.CheckBox(self, wx.ID_ANY, _("en&crypt"), style=wx.CHK_2STATE)
31 self._CHBOX_convert2pdf = wx.CheckBox(self, wx.ID_ANY, _("convert to PDF"), style=wx.CHK_2STATE)
32 self._BTN_save_files = wx.Button(self, wx.ID_OK, _("Save Files"))
33 self._BTN_save_archive = wx.Button(self, wx.ID_ANY, _("Save as Archive"))
34 self._BTN_cancel = wx.Button(self, wx.ID_CANCEL, "")
35
36 self.__set_properties()
37 self.__do_layout()
38
39 self.Bind(wx.EVT_BUTTON, self._on_select_directory_button_pressed, self._BTN_select_directory)
40 self.Bind(wx.EVT_BUTTON, self._on_open_directory_button_pressed, self._BTN_open_directory)
41 self.Bind(wx.EVT_BUTTON, self._on_clear_directory_button_pressed, self._BTN_clear_directory)
42 self.Bind(wx.EVT_CHECKBOX, self._on_use_subdirectory_toggled, self._CHBOX_use_subdirectory)
43 self.Bind(wx.EVT_CHECKBOX, self._on_generate_metadata_toggled, self._CHBOX_generate_metadata)
44 self.Bind(wx.EVT_CHECKBOX, self._on_save_as_encrypted_toggled, self._CHBOX_encrypt)
45 self.Bind(wx.EVT_BUTTON, self._on_save_archive_button_pressed, self._BTN_save_archive)
46
47
49
50 self.SetTitle(_("Saving export area items"))
51 self.SetSize((600, 319))
52 self._BTN_select_directory.SetToolTip(_("Select target directory for files or archive."))
53 self._LBL_directory.SetFont(wx.Font(9, wx.DEFAULT, wx.SLANT, wx.NORMAL, 0, ""))
54 self._LBL_dir_is_empty.SetForegroundColour(wx.Colour(255, 127, 0))
55 self._LBL_dir_is_empty.SetFont(wx.Font(9, wx.DEFAULT, wx.SLANT, wx.NORMAL, 0, ""))
56 self._BTN_open_directory.SetToolTip(_("Open selected target directory in file browser."))
57 self._BTN_clear_directory.SetToolTip(_("Clear selected target directory from any existing data."))
58 self._BTN_clear_directory.Enable(False)
59 self._CHBOX_use_subdirectory.SetToolTip(_("Save into patient specific subdirectory ?\n\nCheck if you want GNUmed to create a suitable subdirectory within the selected path and save to that."))
60 self._CHBOX_use_subdirectory.SetValue(1)
61 self._CHBOX_generate_metadata.SetToolTip(_("Generate metadata ?\n\nCheck if you want GNUmed to generate metadata describing the exported patient data and save it alongside the files.\n\nWhen saving into an archive metadata will always be included."))
62 self._CHBOX_encrypt.SetToolTip(_("Use encryption ?\n\nWhen you save as files each file will be encrypted individually.\n\nWhen you save into an archive the ZIP archive itself will be encrypted rather than the files contained within. Encrypted archives will not include any patient data into the archive filename."))
63 self._CHBOX_convert2pdf.SetToolTip(_("Convert files to PDF before encryption, if possible.\n\nWhen you save encrypted files GNUmed will try to convert each file to PDF first. This will typically work for any images and will ensure maximum compatibility with receiver systems not nicely set up for handling encrypted content. Files which cannot be converted will be encrypted as is.\n\nIgnored when saving into an archive."))
64 self._CHBOX_convert2pdf.Enable(False)
65 self._CHBOX_convert2pdf.SetValue(1)
66 self._BTN_save_files.SetToolTip(_("Save entries as individual files."))
67 self._BTN_save_files.SetFocus()
68 self._BTN_save_files.SetDefault()
69 self._BTN_save_archive.SetToolTip(_("Save entries packaged into an archive."))
70 self._BTN_cancel.SetToolTip(_("Abort saving entries."))
71
72
74
75 __szr_main = wx.BoxSizer(wx.VERTICAL)
76 __szr_buttons = wx.BoxSizer(wx.HORIZONTAL)
77 _grszr_options = wx.FlexGridSizer(4, 2, 2, 5)
78 __szr_encryption_options = wx.BoxSizer(wx.HORIZONTAL)
79 __szr_save_as = wx.BoxSizer(wx.HORIZONTAL)
80 __szr_dir_state = wx.BoxSizer(wx.HORIZONTAL)
81 __szr_main.Add(self._LBL_header, 0, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 3)
82 _grszr_options.Add(self._BTN_select_directory, 0, wx.ALIGN_CENTER_VERTICAL, 5)
83 _grszr_options.Add(self._LBL_directory, 1, wx.ALIGN_CENTER_VERTICAL, 5)
84 _grszr_options.Add((20, 20), 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
85 __szr_dir_state.Add(self._LBL_dir_is_empty, 0, wx.ALIGN_CENTER | wx.LEFT | wx.RIGHT | wx.TOP, 3)
86 __szr_dir_state.Add((20, 20), 2, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
87 __szr_dir_state.Add(self._BTN_open_directory, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
88 __szr_dir_state.Add(self._BTN_clear_directory, 0, wx.ALIGN_CENTER_VERTICAL, 5)
89 _grszr_options.Add(__szr_dir_state, 0, wx.EXPAND, 3)
90 __lbl_save_as = wx.StaticText(self, wx.ID_ANY, _("Options:"))
91 _grszr_options.Add(__lbl_save_as, 0, wx.ALIGN_CENTER_VERTICAL, 5)
92 __szr_save_as.Add(self._CHBOX_use_subdirectory, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 10)
93 __szr_save_as.Add(self._CHBOX_generate_metadata, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
94 _grszr_options.Add(__szr_save_as, 0, wx.EXPAND, 3)
95 _grszr_options.Add((20, 20), 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
96 __szr_encryption_options.Add(self._CHBOX_encrypt, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
97 __szr_encryption_options.Add(self._CHBOX_convert2pdf, 0, wx.ALIGN_CENTER_VERTICAL, 0)
98 _grszr_options.Add(__szr_encryption_options, 1, wx.EXPAND, 0)
99 _grszr_options.AddGrowableCol(1)
100 __szr_main.Add(_grszr_options, 1, wx.EXPAND | wx.LEFT | wx.RIGHT, 3)
101 __hline_bottom = wx.StaticLine(self, wx.ID_ANY)
102 __szr_main.Add(__hline_bottom, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 3)
103 __szr_buttons.Add((20, 20), 2, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
104 __szr_buttons.Add(self._BTN_save_files, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 3)
105 __szr_buttons.Add(self._BTN_save_archive, 0, wx.ALIGN_CENTER_VERTICAL, 3)
106 __szr_buttons.Add((20, 20), 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
107 __szr_buttons.Add(self._BTN_cancel, 0, wx.ALIGN_CENTER_VERTICAL, 0)
108 __szr_buttons.Add((20, 20), 2, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
109 __szr_main.Add(__szr_buttons, 0, wx.ALL | wx.EXPAND, 3)
110 self.SetSizer(__szr_main)
111 self.Layout()
112
113
115 print("Event handler '_on_select_directory_button_pressed' not implemented!")
116 event.Skip()
117
119 print("Event handler '_on_open_directory_button_pressed' not implemented!")
120 event.Skip()
121
123 print("Event handler '_on_clear_directory_button_pressed' not implemented!")
124 event.Skip()
125
127 print("Event handler '_on_use_subdirectory_toggled' not implemented!")
128 event.Skip()
129
131 print("Event handler '_on_generate_metadata_toggled' not implemented!")
132 event.Skip()
133
135 print("Event handler '_on_save_as_encrypted_toggled' not implemented!")
136 event.Skip()
137
139 print("Event handler '_on_save_archive_button_pressed' not implemented!")
140 event.Skip()
141
142
143