Package Gnumed :: Package wxGladeWidgets :: Module wxgExportAreaSaveAsDlg |
[frames] | no frames]

# Source Code for Module Gnumed.wxGladeWidgets.wxgExportAreaSaveAsDlg

      1  # -*- coding: UTF-8 -*-
      2  #
      3  # generated by wxGlade
      4  #
      5
      6  import wx
      7
      8  # begin wxGlade: dependencies
      9  import gettext
     10  # end wxGlade
     11
     12  # begin wxGlade: extracode
     13  # end wxGlade
     14
     15
     16 -class wxgExportAreaSaveAsDlg(wx.Dialog):
     17 -        def __init__(self, *args, **kwds):
     18                  # begin wxGlade: wxgExportAreaSaveAsDlg.__init__
     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_encrypt = wx.CheckBox(self, wx.ID_ANY, _("en&crypt"), style=wx.CHK_2STATE)
     29                  self._CHBOX_generate_metadata = wx.CheckBox(self, wx.ID_ANY, _("generate &metadata"), style=wx.CHK_2STATE)
     30                  self._CHBOX_use_subdirectory = wx.CheckBox(self, wx.ID_ANY, _("use subdirectory"), style=wx.CHK_2STATE)
     31                  self._BTN_save_files = wx.Button(self, wx.ID_OK, _("Save Files"))
     32                  self._BTN_save_archive = wx.Button(self, wx.ID_ANY, _("Save as Archive"))
     33                  self._BTN_cancel = wx.Button(self, wx.ID_CANCEL, "")
     34
     35                  self.__set_properties()
     36                  self.__do_layout()
     37
     38                  self.Bind(wx.EVT_BUTTON, self._on_select_directory_button_pressed, self._BTN_select_directory)
     39                  self.Bind(wx.EVT_BUTTON, self._on_open_directory_button_pressed, self._BTN_open_directory)
     40                  self.Bind(wx.EVT_BUTTON, self._on_clear_directory_button_pressed, self._BTN_clear_directory)
     41                  self.Bind(wx.EVT_CHECKBOX, self._on_save_as_encrypted_toggled, self._CHBOX_encrypt)
     42                  self.Bind(wx.EVT_CHECKBOX, self._on_generate_metadata_toggled, self._CHBOX_generate_metadata)
     43                  self.Bind(wx.EVT_CHECKBOX, self._on_use_subdirectory_toggled, self._CHBOX_use_subdirectory)
     44                  self.Bind(wx.EVT_BUTTON, self._on_save_archive_button_pressed, self._BTN_save_archive)
     45                  # end wxGlade
     46
     47 -        def __set_properties(self):
     48                  # begin wxGlade: wxgExportAreaSaveAsDlg.__set_properties
     49                  self.SetTitle(_("Saving export area items"))
     50                  self.SetSize((600, 319))
     51                  self._BTN_select_directory.SetToolTip(_("Select target directory for files or archive."))
     52                  self._LBL_directory.SetFont(wx.Font(9, wx.DEFAULT, wx.SLANT, wx.NORMAL, 0, ""))
     53                  self._LBL_dir_is_empty.SetForegroundColour(wx.Colour(255, 127, 0))
     54                  self._LBL_dir_is_empty.SetFont(wx.Font(9, wx.DEFAULT, wx.SLANT, wx.NORMAL, 0, ""))
     55                  self._BTN_open_directory.SetToolTip(_("Open selected target directory in file browser."))
     56                  self._BTN_clear_directory.SetToolTip(_("Clear selected target directory from any existing data."))
     57                  self._BTN_clear_directory.Enable(False)
     58                  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."))
     59                  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."))
     60                  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."))
     61                  self._CHBOX_use_subdirectory.SetValue(1)
     62                  self._BTN_save_files.SetToolTip(_("Save entries as individual files."))
     63                  self._BTN_save_files.SetFocus()
     64                  self._BTN_save_files.SetDefault()
     65                  self._BTN_save_archive.SetToolTip(_("Save entries packaged into an archive."))
     66                  self._BTN_cancel.SetToolTip(_("Abort saving entries."))
     67                  # end wxGlade
     68
     69 -        def __do_layout(self):
     70                  # begin wxGlade: wxgExportAreaSaveAsDlg.__do_layout
     71                  __szr_main = wx.BoxSizer(wx.VERTICAL)
     72                  __szr_buttons = wx.BoxSizer(wx.HORIZONTAL)
     73                  _grszr_options = wx.FlexGridSizer(0, 2, 2, 5)
     74                  __szr_save_as = wx.BoxSizer(wx.HORIZONTAL)
     75                  __szr_dir_state = wx.BoxSizer(wx.HORIZONTAL)
     76                  __szr_main.Add(self._LBL_header, 0, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 3)
     77                  _grszr_options.Add(self._BTN_select_directory, 0, wx.ALIGN_CENTER_VERTICAL, 5)
     78                  _grszr_options.Add(self._LBL_directory, 1, wx.ALIGN_CENTER_VERTICAL, 5)
     79                  _grszr_options.Add((20, 20), 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     80                  __szr_dir_state.Add(self._LBL_dir_is_empty, 0, wx.ALIGN_CENTER | wx.LEFT | wx.RIGHT | wx.TOP, 3)
     81                  __szr_dir_state.Add((20, 20), 2, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     82                  __szr_dir_state.Add(self._BTN_open_directory, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
     83                  __szr_dir_state.Add(self._BTN_clear_directory, 0, wx.ALIGN_CENTER_VERTICAL, 5)
     84                  _grszr_options.Add(__szr_dir_state, 0, wx.EXPAND, 3)
     85                  __lbl_save_as = wx.StaticText(self, wx.ID_ANY, _("Options:"))
     86                  _grszr_options.Add(__lbl_save_as, 0, wx.ALIGN_CENTER_VERTICAL, 5)
     87                  __szr_save_as.Add(self._CHBOX_encrypt, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
     88                  __szr_save_as.Add(self._CHBOX_generate_metadata, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
     89                  __szr_save_as.Add(self._CHBOX_use_subdirectory, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 10)
     90                  _grszr_options.Add(__szr_save_as, 0, wx.EXPAND, 3)
     91                  _grszr_options.AddGrowableCol(1)
     92                  __szr_main.Add(_grszr_options, 1, wx.EXPAND | wx.LEFT | wx.RIGHT, 3)
     93                  __hline_bottom = wx.StaticLine(self, wx.ID_ANY)
     94                  __szr_main.Add(__hline_bottom, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 3)
     95                  __szr_buttons.Add((20, 20), 2, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     96                  __szr_buttons.Add(self._BTN_save_files, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 3)
     97                  __szr_buttons.Add(self._BTN_save_archive, 0, wx.ALIGN_CENTER_VERTICAL, 3)
     98                  __szr_buttons.Add((20, 20), 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     99                  __szr_buttons.Add(self._BTN_cancel, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    100                  __szr_buttons.Add((20, 20), 2, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
    101                  __szr_main.Add(__szr_buttons, 0, wx.ALL | wx.EXPAND, 3)
    102                  self.SetSizer(__szr_main)
    103                  self.Layout()
    104                  # end wxGlade
    105
    106 -        def _on_select_directory_button_pressed(self, event):  # wxGlade: wxgExportAreaSaveAsDlg.<event_handler>
    107                  print("Event handler '_on_select_directory_button_pressed' not implemented!")
    108                  event.Skip()
    109
    110 -        def _on_open_directory_button_pressed(self, event):  # wxGlade: wxgExportAreaSaveAsDlg.<event_handler>
    111                  print("Event handler '_on_open_directory_button_pressed' not implemented!")
    112                  event.Skip()
    113
    114 -        def _on_clear_directory_button_pressed(self, event):  # wxGlade: wxgExportAreaSaveAsDlg.<event_handler>
    115                  print("Event handler '_on_clear_directory_button_pressed' not implemented!")
    116                  event.Skip()
    117
    118 -        def _on_save_as_encrypted_toggled(self, event):  # wxGlade: wxgExportAreaSaveAsDlg.<event_handler>
    119                  print("Event handler '_on_save_as_encrypted_toggled' not implemented!")
    120                  event.Skip()
    121
    122 -        def _on_generate_metadata_toggled(self, event):  # wxGlade: wxgExportAreaSaveAsDlg.<event_handler>
    123                  print("Event handler '_on_generate_metadata_toggled' not implemented!")
    124                  event.Skip()
    125
    126 -        def _on_use_subdirectory_toggled(self, event):  # wxGlade: wxgExportAreaSaveAsDlg.<event_handler>
    127                  print("Event handler '_on_use_subdirectory_toggled' not implemented!")
    128                  event.Skip()
    129
    130 -        def _on_save_archive_button_pressed(self, event):  # wxGlade: wxgExportAreaSaveAsDlg.<event_handler>
    131                  print("Event handler '_on_save_archive_button_pressed' not implemented!")
    132                  event.Skip()
    133
    134  # end of class wxgExportAreaSaveAsDlg
    135