(self)
| 137 | self.Center() |
| 138 | |
| 139 | def Validate(self): |
| 140 | # Since this dialog is shown through as ShowModal(), |
| 141 | # we hook into the Validate function to veto the closing of the dialog until we're ready. |
| 142 | # This always returns False, and when we're ready will EndModal() |
| 143 | selected = self.GetSelected() |
| 144 | options = self.GetOptions() |
| 145 | |
| 146 | settings = SettingsProvider.getInstance().getSettings("pyfaExport") |
| 147 | settings["format"] = selected |
| 148 | settings["options"] = options |
| 149 | self.waitDialog = None |
| 150 | |
| 151 | def cb(text): |
| 152 | if self.waitDialog: |
| 153 | del self.waitDialog |
| 154 | toClipboard(text) |
| 155 | self.EndModal(wx.ID_OK) |
| 156 | |
| 157 | export_options = options.get(selected) |
| 158 | if selected == CopySelectDialog.copyFormatMultiBuy and export_options.get(PortMultiBuyOptions.OPTIMIZE_PRICES, False): |
| 159 | self.waitDialog = wx.BusyInfo("Optimizing Prices", parent=self) |
| 160 | |
| 161 | self.CopySelectDict[selected](export_options, callback=cb) |
| 162 | |
| 163 | return False |
| 164 | |
| 165 | def Selected(self, event): |
| 166 | obj = event.GetEventObject() |
nothing calls this directly
no test coverage detected