| 153 | } |
| 154 | |
| 155 | void DialogAttachments::OnExtract(wxCommandEvent &) { |
| 156 | long i = listView->GetFirstSelected(); |
| 157 | if (i == -1) return; |
| 158 | |
| 159 | agi::fs::path path; |
| 160 | bool fullPath = false; |
| 161 | |
| 162 | // Multiple or single? |
| 163 | if (listView->GetNextSelected(i) != -1) |
| 164 | path = wxDirSelector(_("Select the path to save the files to:"), to_wx(OPT_GET("Path/Fonts Collector Destination")->GetString())).utf8_str().data(); |
| 165 | else { |
| 166 | path = SaveFileSelector( |
| 167 | _("Select the path to save the file to:"), |
| 168 | "Path/Fonts Collector Destination", |
| 169 | ass->Attachments[i].GetFileName(), |
| 170 | ".ttf", "Font Files (*.ttf)|*.ttf", |
| 171 | &d); |
| 172 | fullPath = true; |
| 173 | } |
| 174 | if (path.empty()) return; |
| 175 | |
| 176 | // Loop through items in list |
| 177 | while (i != -1) { |
| 178 | auto& attach = ass->Attachments[i]; |
| 179 | attach.Extract(fullPath ? path : path/attach.GetFileName()); |
| 180 | i = listView->GetNextSelected(i); |
| 181 | } |
| 182 | } |
| 183 | |
| 184 | void DialogAttachments::OnDelete(wxCommandEvent &) { |
| 185 | size_t removed = 0; |
nothing calls this directly
no test coverage detected