| | @@ -811,10 +811,16 @@ impl ArchiveApp { |
| 811 | 811 | } |
| 812 | 812 | if ctx.input(|i| i.viewport().close_requested()) { |
| 813 | 813 | self.model.request_close(); |
| 814 | +추가: // 실행 중인 작업이 없으면 결과 확인 안내 없이 바로 닫음. |
| 815 | +추가: self.model.acknowledge_close(); |
| 814 | 816 | if self.model.close != Close::Allowed { |
| 815 | 817 | ctx.send_viewport_cmd(egui::ViewportCommand::CancelClose); |
| 816 | 818 | } |
| 817 | 819 | } |
| 820 | +추가: if self.model.close == Close::Review { |
| 821 | +추가: // 작업을 취소하고 닫기로 한 뒤 정리가 끝난 경우도 안내 없이 닫음. |
| 822 | +추가: self.model.acknowledge_close(); |
| 823 | +추가: } |
| 818 | 824 | if self.model.close == Close::Allowed { |
| 819 | 825 | ctx.send_viewport_cmd(egui::ViewportCommand::Close); |
| 820 | 826 | } |
| | @@ -2377,7 +2383,11 @@ impl ArchiveApp { |
| 2377 | 2383 | } |
| 2378 | 2384 | |
| 2379 | 2385 | fn close_dialog(&mut self, ctx: &egui::Context) { |
| 2380 | | -삭제: if self.model.close == Close::Open || self.model.close == Close::Allowed { |
| 2386 | +추가: // Review(결과 확인 후 닫기)는 show()에서 바로 확인 처리하므로 그리지 않음. |
| 2387 | +추가: if matches!( |
| 2388 | +추가: self.model.close, |
| 2389 | +추가: Close::Open | Close::Allowed | Close::Review |
| 2390 | +추가: ) { |
| 2381 | 2391 | return; |
| 2382 | 2392 | } |
| 2383 | 2393 | egui::Modal::new(egui::Id::unique("archive-close")).show(ctx, |ui| { |
| | @@ -2403,53 +2413,6 @@ impl ArchiveApp { |
| 2403 | 2413 | self.model.keep_open(); |
| 2404 | 2414 | } |
| 2405 | 2415 | } |
| 2406 | | -삭제: Close::Review => { |
| 2407 | | -삭제: let creating = matches!(self.last_request, Some(Start::CreateZip { .. })); |
| 2408 | | -삭제: ui.heading("결과 확인 후 닫기"); |
| 2409 | | -삭제: let wrote = self |
| 2410 | | -삭제: .last_request |
| 2411 | | -삭제: .as_ref() |
| 2412 | | -삭제: .is_some_and(|request| !matches!(request, Start::List { .. })); |
| 2413 | | -삭제: ui.label(if !wrote { |
| 2414 | | -삭제: "프로그램을 닫을까요?".to_owned() |
| 2415 | | -삭제: } else if self.model.confirmed { |
| 2416 | | -삭제: "작업 결과를 확인한 뒤 닫으세요".to_owned() |
| 2417 | | -삭제: } else { |
| 2418 | | -삭제: present::operation_text(present::UNCERTAIN, creating) |
| 2419 | | -삭제: }); |
| 2420 | | -삭제: egui::ScrollArea::vertical() |
| 2421 | | -삭제: .max_height(160.0) |
| 2422 | | -삭제: .show(ui, |ui| { |
| 2423 | | -삭제: if let Some(code) = self.model.terminal.as_ref().and_then(|t| t.error) { |
| 2424 | | -삭제: ui.colored_label( |
| 2425 | | -삭제: theme::ERROR, |
| 2426 | | -삭제: present::operation_text(present::error_text(code), creating), |
| 2427 | | -삭제: ); |
| 2428 | | -삭제: } |
| 2429 | | -삭제: if wrote { |
| 2430 | | -삭제: for warning in present::warnings( |
| 2431 | | -삭제: self.model.terminal.as_ref(), |
| 2432 | | -삭제: self.model.confirmed, |
| 2433 | | -삭제: self.targets.as_ref(), |
| 2434 | | -삭제: &self.directories, |
| 2435 | | -삭제: &self.model.outputs, |
| 2436 | | -삭제: ) { |
| 2437 | | -삭제: ui.colored_label( |
| 2438 | | -삭제: theme::WARNING, |
| 2439 | | -삭제: present::operation_text(warning, creating), |
| 2440 | | -삭제: ); |
| 2441 | | -삭제: } |
| 2442 | | -삭제: } |
| 2443 | | -삭제: }); |
| 2444 | | -삭제: ui.horizontal(|ui| { |
| 2445 | | -삭제: if theme::action(ui, "계속 작업", false, true).clicked() { |
| 2446 | | -삭제: self.model.keep_open(); |
| 2447 | | -삭제: } |
| 2448 | | -삭제: if theme::action(ui, "닫기", true, true).clicked() { |
| 2449 | | -삭제: self.model.acknowledge_close(); |
| 2450 | | -삭제: } |
| 2451 | | -삭제: }); |
| 2452 | | -삭제: } |
| 2453 | 2416 | _ => {} |
| 2454 | 2417 | } |
| 2455 | 2418 | }); |