툴바와 폴더 탐색 및 기본 파일 창을 적용함
- 작성자
- 호시노 히나타
- 작성 시각
- 커밋
0729e1f93186fdfb121022793e086162c4c3ef75- 부모
- c583264
변경된 파일 28개
+1,366-730변경 내용이 커서 일부 파일의 Diff를 생략했어요. 생략한 파일은 파일 보기나 Raw로 확인할 수 있어요.
| @@ -205,6 +205,25 @@ version = "1.0.1" | ||
| 205 | 205 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 206 | 206 | checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" |
| 207 | 207 | |
| 208 | 추가: [[package]] | |
| 209 | 추가: name = "ashpd" | |
| 210 | 추가: version = "0.11.1" | |
| 211 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 212 | 추가: checksum = "d2f3f79755c74fd155000314eb349864caa787c6592eace6c6882dad873d9c39" | |
| 213 | 추가: dependencies = [ | |
| 214 | 추가: "async-fs", | |
| 215 | 추가: "async-net", | |
| 216 | 추가: "enumflags2", | |
| 217 | 추가: "futures-channel", | |
| 218 | 추가: "futures-util", | |
| 219 | 추가: "rand", | |
| 220 | 추가: "raw-window-handle", | |
| 221 | 추가: "serde", | |
| 222 | 추가: "serde_repr", | |
| 223 | 추가: "url", | |
| 224 | 추가: "zbus", | |
| 225 | 추가: ] | |
| 226 | 추가: | |
| 208 | 227 | [[package]] |
| 209 | 228 | name = "async-broadcast" |
| 210 | 229 | version = "0.7.2" |
| @@ -243,6 +262,17 @@ dependencies = [ | ||
| 243 | 262 | "slab", |
| 244 | 263 | ] |
| 245 | 264 | |
| 265 | 추가: [[package]] | |
| 266 | 추가: name = "async-fs" | |
| 267 | 추가: version = "2.2.0" | |
| 268 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 269 | 추가: checksum = "8034a681df4aed8b8edbd7fbe472401ecf009251c8b40556b304567052e294c5" | |
| 270 | 추가: dependencies = [ | |
| 271 | 추가: "async-lock", | |
| 272 | 추가: "blocking", | |
| 273 | 추가: "futures-lite", | |
| 274 | 추가: ] | |
| 275 | 추가: | |
| 246 | 276 | [[package]] |
| 247 | 277 | name = "async-io" |
| 248 | 278 | version = "2.6.0" |
| @@ -272,6 +302,17 @@ dependencies = [ | ||
| 272 | 302 | "pin-project-lite", |
| 273 | 303 | ] |
| 274 | 304 | |
| 305 | 추가: [[package]] | |
| 306 | 추가: name = "async-net" | |
| 307 | 추가: version = "2.0.0" | |
| 308 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 309 | 추가: checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7" | |
| 310 | 추가: dependencies = [ | |
| 311 | 추가: "async-io", | |
| 312 | 추가: "blocking", | |
| 313 | 추가: "futures-lite", | |
| 314 | 추가: ] | |
| 315 | 추가: | |
| 275 | 316 | [[package]] |
| 276 | 317 | name = "async-process" |
| 277 | 318 | version = "2.5.0" |
| @@ -748,9 +789,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 748 | 789 | checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38" |
| 749 | 790 | dependencies = [ |
| 750 | 791 | "bitflags 2.13.2", |
| 792 | 추가: "block2 0.6.2", | |
| 793 | 추가: "libc", | |
| 751 | 794 | "objc2 0.6.5", |
| 752 | 795 | ] |
| 753 | 796 | |
| 797 | 추가: [[package]] | |
| 798 | 추가: name = "displaydoc" | |
| 799 | 추가: version = "0.2.7" | |
| 800 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 801 | 추가: checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" | |
| 802 | 추가: dependencies = [ | |
| 803 | 추가: "proc-macro2", | |
| 804 | 추가: "quote", | |
| 805 | 추가: "syn 3.0.10", | |
| 806 | 추가: ] | |
| 807 | 추가: | |
| 754 | 808 | [[package]] |
| 755 | 809 | name = "dlib" |
| 756 | 810 | version = "0.5.3" |
| @@ -816,7 +870,7 @@ dependencies = [ | ||
| 816 | 870 | "objc2-foundation 0.3.2", |
| 817 | 871 | "parking_lot", |
| 818 | 872 | "percent-encoding", |
| 819 | 삭제: "pollster", | |
| 873 | 추가: "pollster 1.0.1", | |
| 820 | 874 | "profiling", |
| 821 | 875 | "raw-window-handle", |
| 822 | 876 | "send_wrapper", |
| @@ -1160,6 +1214,24 @@ version = "0.3.1" | ||
| 1160 | 1214 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1161 | 1215 | checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" |
| 1162 | 1216 | |
| 1217 | 추가: [[package]] | |
| 1218 | 추가: name = "form_urlencoded" | |
| 1219 | 추가: version = "1.2.2" | |
| 1220 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1221 | 추가: checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" | |
| 1222 | 추가: dependencies = [ | |
| 1223 | 추가: "percent-encoding", | |
| 1224 | 추가: ] | |
| 1225 | 추가: | |
| 1226 | 추가: [[package]] | |
| 1227 | 추가: name = "futures-channel" | |
| 1228 | 추가: version = "0.3.34" | |
| 1229 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1230 | 추가: checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4" | |
| 1231 | 추가: dependencies = [ | |
| 1232 | 추가: "futures-core", | |
| 1233 | 추가: ] | |
| 1234 | 추가: | |
| 1163 | 1235 | [[package]] |
| 1164 | 1236 | name = "futures-core" |
| 1165 | 1237 | version = "0.3.34" |
| @@ -1209,8 +1281,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1209 | 1281 | checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc" |
| 1210 | 1282 | dependencies = [ |
| 1211 | 1283 | "futures-core", |
| 1284 | 추가: "futures-io", | |
| 1212 | 1285 | "futures-macro", |
| 1213 | 1286 | "futures-task", |
| 1287 | 추가: "memchr", | |
| 1214 | 1288 | "pin-project-lite", |
| 1215 | 1289 | "slab", |
| 1216 | 1290 | ] |
| @@ -1462,6 +1536,110 @@ dependencies = [ | ||
| 1462 | 1536 | "digest", |
| 1463 | 1537 | ] |
| 1464 | 1538 | |
| 1539 | 추가: [[package]] | |
| 1540 | 추가: name = "icu_collections" | |
| 1541 | 추가: version = "2.4.0" | |
| 1542 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1543 | 추가: checksum = "fe090a42a0d3140fed8c63263ed1fecc02422cb2f4bfe55cd8de2de1b8e105dd" | |
| 1544 | 추가: dependencies = [ | |
| 1545 | 추가: "displaydoc", | |
| 1546 | 추가: "potential_utf", | |
| 1547 | 추가: "utf8_iter", | |
| 1548 | 추가: "yoke", | |
| 1549 | 추가: "zerofrom", | |
| 1550 | 추가: "zerovec", | |
| 1551 | 추가: ] | |
| 1552 | 추가: | |
| 1553 | 추가: [[package]] | |
| 1554 | 추가: name = "icu_locale_core" | |
| 1555 | 추가: version = "2.4.0" | |
| 1556 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1557 | 추가: checksum = "25d29b57c17c6528d0dc4c2141cfa2d08200465acb537a3909c8b9b8a4a984c0" | |
| 1558 | 추가: dependencies = [ | |
| 1559 | 추가: "displaydoc", | |
| 1560 | 추가: "litemap", | |
| 1561 | 추가: "tinystr", | |
| 1562 | 추가: "writeable", | |
| 1563 | 추가: "zerovec", | |
| 1564 | 추가: ] | |
| 1565 | 추가: | |
| 1566 | 추가: [[package]] | |
| 1567 | 추가: name = "icu_normalizer" | |
| 1568 | 추가: version = "2.4.0" | |
| 1569 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1570 | 추가: checksum = "404a3b8c486f205c87fe7f23ab6894d84a4ad76d6e4671ae1981ba7def87c599" | |
| 1571 | 추가: dependencies = [ | |
| 1572 | 추가: "icu_collections", | |
| 1573 | 추가: "icu_normalizer_data", | |
| 1574 | 추가: "icu_properties", | |
| 1575 | 추가: "icu_provider", | |
| 1576 | 추가: "smallvec", | |
| 1577 | 추가: "zerovec", | |
| 1578 | 추가: ] | |
| 1579 | 추가: | |
| 1580 | 추가: [[package]] | |
| 1581 | 추가: name = "icu_normalizer_data" | |
| 1582 | 추가: version = "2.4.0" | |
| 1583 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1584 | 추가: checksum = "20f0088bfb7441f7a37fa0c9e20cb1e9cba1cac6b9ce8cd2a6dc44294f8e8cbc" | |
| 1585 | 추가: | |
| 1586 | 추가: [[package]] | |
| 1587 | 추가: name = "icu_properties" | |
| 1588 | 추가: version = "2.4.0" | |
| 1589 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1590 | 추가: checksum = "2ea83d991c56158f7cf898bf86436c1dfe7c07ee82fe88951f2695c9f37a379f" | |
| 1591 | 추가: dependencies = [ | |
| 1592 | 추가: "displaydoc", | |
| 1593 | 추가: "icu_collections", | |
| 1594 | 추가: "icu_locale_core", | |
| 1595 | 추가: "icu_properties_data", | |
| 1596 | 추가: "icu_provider", | |
| 1597 | 추가: "zerotrie", | |
| 1598 | 추가: "zerovec", | |
| 1599 | 추가: ] | |
| 1600 | 추가: | |
| 1601 | 추가: [[package]] | |
| 1602 | 추가: name = "icu_properties_data" | |
| 1603 | 추가: version = "2.4.0" | |
| 1604 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1605 | 추가: checksum = "b98f29af82d02b163fe50161388350e743bb3107cc8e8c2f7314cb505faddfcf" | |
| 1606 | 추가: | |
| 1607 | 추가: [[package]] | |
| 1608 | 추가: name = "icu_provider" | |
| 1609 | 추가: version = "2.4.0" | |
| 1610 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1611 | 추가: checksum = "413099315636c588ee8f011190b329b971a09a8fae9d157e01dcae8379468514" | |
| 1612 | 추가: dependencies = [ | |
| 1613 | 추가: "displaydoc", | |
| 1614 | 추가: "icu_locale_core", | |
| 1615 | 추가: "writeable", | |
| 1616 | 추가: "yoke", | |
| 1617 | 추가: "zerofrom", | |
| 1618 | 추가: "zerotrie", | |
| 1619 | 추가: "zerovec", | |
| 1620 | 추가: ] | |
| 1621 | 추가: | |
| 1622 | 추가: [[package]] | |
| 1623 | 추가: name = "idna" | |
| 1624 | 추가: version = "1.1.0" | |
| 1625 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1626 | 추가: checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" | |
| 1627 | 추가: dependencies = [ | |
| 1628 | 추가: "idna_adapter", | |
| 1629 | 추가: "smallvec", | |
| 1630 | 추가: "utf8_iter", | |
| 1631 | 추가: ] | |
| 1632 | 추가: | |
| 1633 | 추가: [[package]] | |
| 1634 | 추가: name = "idna_adapter" | |
| 1635 | 추가: version = "1.2.2" | |
| 1636 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1637 | 추가: checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" | |
| 1638 | 추가: dependencies = [ | |
| 1639 | 추가: "icu_normalizer", | |
| 1640 | 추가: "icu_properties", | |
| 1641 | 추가: ] | |
| 1642 | 추가: | |
| 1465 | 1643 | [[package]] |
| 1466 | 1644 | name = "image" |
| 1467 | 1645 | version = "0.25.10" |
| @@ -1653,6 +1831,12 @@ version = "0.12.1" | ||
| 1653 | 1831 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1654 | 1832 | checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" |
| 1655 | 1833 | |
| 1834 | 추가: [[package]] | |
| 1835 | 추가: name = "litemap" | |
| 1836 | 추가: version = "0.8.3" | |
| 1837 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1838 | 추가: checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae" | |
| 1839 | 추가: | |
| 1656 | 1840 | [[package]] |
| 1657 | 1841 | name = "litrs" |
| 1658 | 1842 | version = "1.0.1" |
| @@ -2398,6 +2582,12 @@ dependencies = [ | ||
| 2398 | 2582 | "windows-sys 0.61.2", |
| 2399 | 2583 | ] |
| 2400 | 2584 | |
| 2585 | 추가: [[package]] | |
| 2586 | 추가: name = "pollster" | |
| 2587 | 추가: version = "0.4.0" | |
| 2588 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2589 | 추가: checksum = "2f3a9f18d041e6d0e102a0a46750538147e5e8992d3b4873aaafee2520b00ce3" | |
| 2590 | 추가: | |
| 2401 | 2591 | [[package]] |
| 2402 | 2592 | name = "pollster" |
| 2403 | 2593 | version = "1.0.1" |
| @@ -2428,6 +2618,24 @@ dependencies = [ | ||
| 2428 | 2618 | "portable-atomic", |
| 2429 | 2619 | ] |
| 2430 | 2620 | |
| 2621 | 추가: [[package]] | |
| 2622 | 추가: name = "potential_utf" | |
| 2623 | 추가: version = "0.1.6" | |
| 2624 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2625 | 추가: checksum = "d83eb9bc6d8e5cf568e7a1101d60ee05e81ed50ea106026f3d18deeb046d7661" | |
| 2626 | 추가: dependencies = [ | |
| 2627 | 추가: "zerovec", | |
| 2628 | 추가: ] | |
| 2629 | 추가: | |
| 2630 | 추가: [[package]] | |
| 2631 | 추가: name = "ppv-lite86" | |
| 2632 | 추가: version = "0.2.21" | |
| 2633 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2634 | 추가: checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" | |
| 2635 | 추가: dependencies = [ | |
| 2636 | 추가: "zerocopy", | |
| 2637 | 추가: ] | |
| 2638 | 추가: | |
| 2431 | 2639 | [[package]] |
| 2432 | 2640 | name = "presser" |
| 2433 | 2641 | version = "0.3.1" |
| @@ -2500,6 +2708,35 @@ version = "6.0.0" | ||
| 2500 | 2708 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 2501 | 2709 | checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" |
| 2502 | 2710 | |
| 2711 | 추가: [[package]] | |
| 2712 | 추가: name = "rand" | |
| 2713 | 추가: version = "0.9.5" | |
| 2714 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2715 | 추가: checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41" | |
| 2716 | 추가: dependencies = [ | |
| 2717 | 추가: "rand_chacha", | |
| 2718 | 추가: "rand_core", | |
| 2719 | 추가: ] | |
| 2720 | 추가: | |
| 2721 | 추가: [[package]] | |
| 2722 | 추가: name = "rand_chacha" | |
| 2723 | 추가: version = "0.9.0" | |
| 2724 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2725 | 추가: checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" | |
| 2726 | 추가: dependencies = [ | |
| 2727 | 추가: "ppv-lite86", | |
| 2728 | 추가: "rand_core", | |
| 2729 | 추가: ] | |
| 2730 | 추가: | |
| 2731 | 추가: [[package]] | |
| 2732 | 추가: name = "rand_core" | |
| 2733 | 추가: version = "0.9.5" | |
| 2734 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2735 | 추가: checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" | |
| 2736 | 추가: dependencies = [ | |
| 2737 | 추가: "getrandom 0.3.4", | |
| 2738 | 추가: ] | |
| 2739 | 추가: | |
| 2503 | 2740 | [[package]] |
| 2504 | 2741 | name = "range-alloc" |
| 2505 | 2742 | version = "0.1.5" |
| @@ -2556,6 +2793,30 @@ version = "1.1.0" | ||
| 2556 | 2793 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 2557 | 2794 | checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" |
| 2558 | 2795 | |
| 2796 | 추가: [[package]] | |
| 2797 | 추가: name = "rfd" | |
| 2798 | 추가: version = "0.16.0" | |
| 2799 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2800 | 추가: checksum = "a15ad77d9e70a92437d8f74c35d99b4e4691128df018833e99f90bcd36152672" | |
| 2801 | 추가: dependencies = [ | |
| 2802 | 추가: "ashpd", | |
| 2803 | 추가: "block2 0.6.2", | |
| 2804 | 추가: "dispatch2", | |
| 2805 | 추가: "js-sys", | |
| 2806 | 추가: "log", | |
| 2807 | 추가: "objc2 0.6.5", | |
| 2808 | 추가: "objc2-app-kit 0.3.2", | |
| 2809 | 추가: "objc2-core-foundation", | |
| 2810 | 추가: "objc2-foundation 0.3.2", | |
| 2811 | 추가: "pollster 0.4.0", | |
| 2812 | 추가: "raw-window-handle", | |
| 2813 | 추가: "urlencoding", | |
| 2814 | 추가: "wasm-bindgen", | |
| 2815 | 추가: "wasm-bindgen-futures", | |
| 2816 | 추가: "web-sys", | |
| 2817 | 추가: "windows-sys 0.60.2", | |
| 2818 | 추가: ] | |
| 2819 | 추가: | |
| 2559 | 2820 | [[package]] |
| 2560 | 2821 | name = "roxmltree" |
| 2561 | 2822 | version = "0.21.2" |
| @@ -2867,6 +3128,12 @@ dependencies = [ | ||
| 2867 | 3128 | "serde", |
| 2868 | 3129 | ] |
| 2869 | 3130 | |
| 3131 | 추가: [[package]] | |
| 3132 | 추가: name = "stable_deref_trait" | |
| 3133 | 추가: version = "1.2.1" | |
| 3134 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 3135 | 추가: checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" | |
| 3136 | 추가: | |
| 2870 | 3137 | [[package]] |
| 2871 | 3138 | name = "static_assertions" |
| 2872 | 3139 | version = "1.1.0" |
| @@ -2901,6 +3168,17 @@ dependencies = [ | ||
| 2901 | 3168 | "unicode-ident", |
| 2902 | 3169 | ] |
| 2903 | 3170 | |
| 3171 | 추가: [[package]] | |
| 3172 | 추가: name = "synstructure" | |
| 3173 | 추가: version = "0.14.0" | |
| 3174 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 3175 | 추가: checksum = "901704edd0dfe137f1987838ee4f259e4e063c31371bdb423f7ae38ec6f77f02" | |
| 3176 | 추가: dependencies = [ | |
| 3177 | 추가: "proc-macro2", | |
| 3178 | 추가: "quote", | |
| 3179 | 추가: "syn 3.0.10", | |
| 3180 | 추가: ] | |
| 3181 | 추가: | |
| 2904 | 3182 | [[package]] |
| 2905 | 3183 | name = "sys-locale" |
| 2906 | 3184 | version = "0.3.2" |
| @@ -2977,6 +3255,16 @@ dependencies = [ | ||
| 2977 | 3255 | "zune-jpeg", |
| 2978 | 3256 | ] |
| 2979 | 3257 | |
| 3258 | 추가: [[package]] | |
| 3259 | 추가: name = "tinystr" | |
| 3260 | 추가: version = "0.8.5" | |
| 3261 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 3262 | 추가: checksum = "abc840c238154d58f9e86b2792261edfde565a17696e1cda1a449de27979801a" | |
| 3263 | 추가: dependencies = [ | |
| 3264 | 추가: "displaydoc", | |
| 3265 | 추가: "zerovec", | |
| 3266 | 추가: ] | |
| 3267 | 추가: | |
| 2980 | 3268 | [[package]] |
| 2981 | 3269 | name = "tokio" |
| 2982 | 3270 | version = "1.54.1" |
| @@ -3127,6 +3415,40 @@ version = "0.2.3" | ||
| 3127 | 3415 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 3128 | 3416 | checksum = "ca718471876992059f251e33aafc334346ada08042b7661dd1fe313a9bced557" |
| 3129 | 3417 | |
| 3418 | 추가: [[package]] | |
| 3419 | 추가: name = "url" | |
| 3420 | 추가: version = "2.5.8" | |
| 3421 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 3422 | 추가: checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" | |
| 3423 | 추가: dependencies = [ | |
| 3424 | 추가: "form_urlencoded", | |
| 3425 | 추가: "idna", | |
| 3426 | 추가: "percent-encoding", | |
| 3427 | 추가: "serde", | |
| 3428 | 추가: "serde_derive", | |
| 3429 | 추가: ] | |
| 3430 | 추가: | |
| 3431 | 추가: [[package]] | |
| 3432 | 추가: name = "urlencoding" | |
| 3433 | 추가: version = "2.1.3" | |
| 3434 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 3435 | 추가: checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" | |
| 3436 | 추가: | |
| 3437 | 추가: [[package]] | |
| 3438 | 추가: name = "utf8_iter" | |
| 3439 | 추가: version = "1.1.0" | |
| 3440 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 3441 | 추가: checksum = "af3bd9d3e571c26fcce9d033b87ea5ab061b8d2ffe9b7a5675d810d68f03edf0" | |
| 3442 | 추가: dependencies = [ | |
| 3443 | 추가: "utf_types", | |
| 3444 | 추가: ] | |
| 3445 | 추가: | |
| 3446 | 추가: [[package]] | |
| 3447 | 추가: name = "utf_types" | |
| 3448 | 추가: version = "1.0.0" | |
| 3449 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 3450 | 추가: checksum = "3a3b425286980a367278453f3b6d28cdcb134b574e5a35824a6ff5eebad50bb6" | |
| 3451 | 추가: | |
| 3130 | 3452 | [[package]] |
| 3131 | 3453 | name = "uuid" |
| 3132 | 3454 | version = "1.29.2" |
| @@ -3654,7 +3976,7 @@ version = "0.52.0" | ||
| 3654 | 3976 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 3655 | 3977 | checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" |
| 3656 | 3978 | dependencies = [ |
| 3657 | 삭제: "windows-targets", | |
| 3979 | 추가: "windows-targets 0.52.6", | |
| 3658 | 3980 | ] |
| 3659 | 3981 | |
| 3660 | 3982 | [[package]] |
| @@ -3663,7 +3985,16 @@ version = "0.59.0" | ||
| 3663 | 3985 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 3664 | 3986 | checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" |
| 3665 | 3987 | dependencies = [ |
| 3666 | 삭제: "windows-targets", | |
| 3988 | 추가: "windows-targets 0.52.6", | |
| 3989 | 추가: ] | |
| 3990 | 추가: | |
| 3991 | 추가: [[package]] | |
| 3992 | 추가: name = "windows-sys" | |
| 3993 | 추가: version = "0.60.2" | |
| 3994 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 3995 | 추가: checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" | |
| 3996 | 추가: dependencies = [ | |
| 3997 | 추가: "windows-targets 0.53.5", | |
| 3667 | 3998 | ] |
| 3668 | 3999 | |
| 3669 | 4000 | [[package]] |
| @@ -3681,14 +4012,31 @@ version = "0.52.6" | ||
| 3681 | 4012 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 3682 | 4013 | checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" |
| 3683 | 4014 | dependencies = [ |
| 3684 | 삭제: "windows_aarch64_gnullvm", | |
| 3685 | 삭제: "windows_aarch64_msvc", | |
| 3686 | 삭제: "windows_i686_gnu", | |
| 3687 | 삭제: "windows_i686_gnullvm", | |
| 3688 | 삭제: "windows_i686_msvc", | |
| 3689 | 삭제: "windows_x86_64_gnu", | |
| 3690 | 삭제: "windows_x86_64_gnullvm", | |
| 3691 | 삭제: "windows_x86_64_msvc", | |
| 4015 | 추가: "windows_aarch64_gnullvm 0.52.6", | |
| 4016 | 추가: "windows_aarch64_msvc 0.52.6", | |
| 4017 | 추가: "windows_i686_gnu 0.52.6", | |
| 4018 | 추가: "windows_i686_gnullvm 0.52.6", | |
| 4019 | 추가: "windows_i686_msvc 0.52.6", | |
| 4020 | 추가: "windows_x86_64_gnu 0.52.6", | |
| 4021 | 추가: "windows_x86_64_gnullvm 0.52.6", | |
| 4022 | 추가: "windows_x86_64_msvc 0.52.6", | |
| 4023 | 추가: ] | |
| 4024 | 추가: | |
| 4025 | 추가: [[package]] | |
| 4026 | 추가: name = "windows-targets" | |
| 4027 | 추가: version = "0.53.5" | |
| 4028 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 4029 | 추가: checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" | |
| 4030 | 추가: dependencies = [ | |
| 4031 | 추가: "windows-link", | |
| 4032 | 추가: "windows_aarch64_gnullvm 0.53.1", | |
| 4033 | 추가: "windows_aarch64_msvc 0.53.1", | |
| 4034 | 추가: "windows_i686_gnu 0.53.1", | |
| 4035 | 추가: "windows_i686_gnullvm 0.53.1", | |
| 4036 | 추가: "windows_i686_msvc 0.53.1", | |
| 4037 | 추가: "windows_x86_64_gnu 0.53.1", | |
| 4038 | 추가: "windows_x86_64_gnullvm 0.53.1", | |
| 4039 | 추가: "windows_x86_64_msvc 0.53.1", | |
| 3692 | 4040 | ] |
| 3693 | 4041 | |
| 3694 | 4042 | [[package]] |
| @@ -3706,48 +4054,96 @@ version = "0.52.6" | ||
| 3706 | 4054 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 3707 | 4055 | checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" |
| 3708 | 4056 | |
| 4057 | 추가: [[package]] | |
| 4058 | 추가: name = "windows_aarch64_gnullvm" | |
| 4059 | 추가: version = "0.53.1" | |
| 4060 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 4061 | 추가: checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" | |
| 4062 | 추가: | |
| 3709 | 4063 | [[package]] |
| 3710 | 4064 | name = "windows_aarch64_msvc" |
| 3711 | 4065 | version = "0.52.6" |
| 3712 | 4066 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 3713 | 4067 | checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" |
| 3714 | 4068 | |
| 4069 | 추가: [[package]] | |
| 4070 | 추가: name = "windows_aarch64_msvc" | |
| 4071 | 추가: version = "0.53.1" | |
| 4072 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 4073 | 추가: checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" | |
| 4074 | 추가: | |
| 3715 | 4075 | [[package]] |
| 3716 | 4076 | name = "windows_i686_gnu" |
| 3717 | 4077 | version = "0.52.6" |
| 3718 | 4078 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 3719 | 4079 | checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" |
| 3720 | 4080 | |
| 4081 | 추가: [[package]] | |
| 4082 | 추가: name = "windows_i686_gnu" | |
| 4083 | 추가: version = "0.53.1" | |
| 4084 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 4085 | 추가: checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" | |
| 4086 | 추가: | |
| 3721 | 4087 | [[package]] |
| 3722 | 4088 | name = "windows_i686_gnullvm" |
| 3723 | 4089 | version = "0.52.6" |
| 3724 | 4090 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 3725 | 4091 | checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" |
| 3726 | 4092 | |
| 4093 | 추가: [[package]] | |
| 4094 | 추가: name = "windows_i686_gnullvm" | |
| 4095 | 추가: version = "0.53.1" | |
| 4096 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 4097 | 추가: checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" | |
| 4098 | 추가: | |
| 3727 | 4099 | [[package]] |
| 3728 | 4100 | name = "windows_i686_msvc" |
| 3729 | 4101 | version = "0.52.6" |
| 3730 | 4102 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 3731 | 4103 | checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" |
| 3732 | 4104 | |
| 4105 | 추가: [[package]] | |
| 4106 | 추가: name = "windows_i686_msvc" | |
| 4107 | 추가: version = "0.53.1" | |
| 4108 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 4109 | 추가: checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" | |
| 4110 | 추가: | |
| 3733 | 4111 | [[package]] |
| 3734 | 4112 | name = "windows_x86_64_gnu" |
| 3735 | 4113 | version = "0.52.6" |
| 3736 | 4114 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 3737 | 4115 | checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" |
| 3738 | 4116 | |
| 4117 | 추가: [[package]] | |
| 4118 | 추가: name = "windows_x86_64_gnu" | |
| 4119 | 추가: version = "0.53.1" | |
| 4120 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 4121 | 추가: checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" | |
| 4122 | 추가: | |
| 3739 | 4123 | [[package]] |
| 3740 | 4124 | name = "windows_x86_64_gnullvm" |
| 3741 | 4125 | version = "0.52.6" |
| 3742 | 4126 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 3743 | 4127 | checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" |
| 3744 | 4128 | |
| 4129 | 추가: [[package]] | |
| 4130 | 추가: name = "windows_x86_64_gnullvm" | |
| 4131 | 추가: version = "0.53.1" | |
| 4132 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 4133 | 추가: checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" | |
| 4134 | 추가: | |
| 3745 | 4135 | [[package]] |
| 3746 | 4136 | name = "windows_x86_64_msvc" |
| 3747 | 4137 | version = "0.52.6" |
| 3748 | 4138 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 3749 | 4139 | checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" |
| 3750 | 4140 | |
| 4141 | 추가: [[package]] | |
| 4142 | 추가: name = "windows_x86_64_msvc" | |
| 4143 | 추가: version = "0.53.1" | |
| 4144 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 4145 | 추가: checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" | |
| 4146 | 추가: | |
| 3751 | 4147 | [[package]] |
| 3752 | 4148 | name = "winit" |
| 3753 | 4149 | version = "0.30.13" |
| @@ -3832,6 +4228,12 @@ dependencies = [ | ||
| 3832 | 4228 | "wayland-protocols-wlr", |
| 3833 | 4229 | ] |
| 3834 | 4230 | |
| 4231 | 추가: [[package]] | |
| 4232 | 추가: name = "writeable" | |
| 4233 | 추가: version = "0.6.4" | |
| 4234 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 4235 | 추가: checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc" | |
| 4236 | 추가: | |
| 3835 | 4237 | [[package]] |
| 3836 | 4238 | name = "x11-dl" |
| 3837 | 4239 | version = "2.21.0" |
| @@ -3906,6 +4308,29 @@ dependencies = [ | ||
| 3906 | 4308 | "pkg-config", |
| 3907 | 4309 | ] |
| 3908 | 4310 | |
| 4311 | 추가: [[package]] | |
| 4312 | 추가: name = "yoke" | |
| 4313 | 추가: version = "0.8.4" | |
| 4314 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 4315 | 추가: checksum = "417ef3fcf6c300b7dbd25c85531a746931c02ad536f3cf4786ed1e88223340b3" | |
| 4316 | 추가: dependencies = [ | |
| 4317 | 추가: "stable_deref_trait", | |
| 4318 | 추가: "yoke-derive", | |
| 4319 | 추가: "zerofrom", | |
| 4320 | 추가: ] | |
| 4321 | 추가: | |
| 4322 | 추가: [[package]] | |
| 4323 | 추가: name = "yoke-derive" | |
| 4324 | 추가: version = "0.8.4" | |
| 4325 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 4326 | 추가: checksum = "ec8ebde2db3681e8c9980cc27822030e68752690ddfa9473e739aeb4dbde6d71" | |
| 4327 | 추가: dependencies = [ | |
| 4328 | 추가: "proc-macro2", | |
| 4329 | 추가: "quote", | |
| 4330 | 추가: "syn 3.0.10", | |
| 4331 | 추가: "synstructure", | |
| 4332 | 추가: ] | |
| 4333 | 추가: | |
| 3909 | 4334 | [[package]] |
| 3910 | 4335 | name = "zbus" |
| 3911 | 4336 | version = "5.19.0" |
| @@ -4032,6 +4457,27 @@ dependencies = [ | ||
| 4032 | 4457 | "syn 2.0.119", |
| 4033 | 4458 | ] |
| 4034 | 4459 | |
| 4460 | 추가: [[package]] | |
| 4461 | 추가: name = "zerofrom" | |
| 4462 | 추가: version = "0.1.8" | |
| 4463 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 4464 | 추가: checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272" | |
| 4465 | 추가: dependencies = [ | |
| 4466 | 추가: "zerofrom-derive", | |
| 4467 | 추가: ] | |
| 4468 | 추가: | |
| 4469 | 추가: [[package]] | |
| 4470 | 추가: name = "zerofrom-derive" | |
| 4471 | 추가: version = "0.1.8" | |
| 4472 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 4473 | 추가: checksum = "f75b4683f6c7f45248d4d64056a24298c6281e0993356d7d1b4a1a962ef10d4a" | |
| 4474 | 추가: dependencies = [ | |
| 4475 | 추가: "proc-macro2", | |
| 4476 | 추가: "quote", | |
| 4477 | 추가: "syn 3.0.10", | |
| 4478 | 추가: "synstructure", | |
| 4479 | 추가: ] | |
| 4480 | 추가: | |
| 4035 | 4481 | [[package]] |
| 4036 | 4482 | name = "zeroize" |
| 4037 | 4483 | version = "1.9.1" |
| @@ -4052,6 +4498,39 @@ dependencies = [ | ||
| 4052 | 4498 | "syn 2.0.119", |
| 4053 | 4499 | ] |
| 4054 | 4500 | |
| 4501 | 추가: [[package]] | |
| 4502 | 추가: name = "zerotrie" | |
| 4503 | 추가: version = "0.2.5" | |
| 4504 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 4505 | 추가: checksum = "4ea269c3bd32f0a32c321907a2ae912ba6f4649bb0fc764a15627e99a7095a3f" | |
| 4506 | 추가: dependencies = [ | |
| 4507 | 추가: "displaydoc", | |
| 4508 | 추가: "yoke", | |
| 4509 | 추가: "zerofrom", | |
| 4510 | 추가: ] | |
| 4511 | 추가: | |
| 4512 | 추가: [[package]] | |
| 4513 | 추가: name = "zerovec" | |
| 4514 | 추가: version = "0.11.9" | |
| 4515 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 4516 | 추가: checksum = "f58a2799cfe9a1670c7ea8edbd52ef8edb93cb37a7f83bf31ba9e35d9dae6a40" | |
| 4517 | 추가: dependencies = [ | |
| 4518 | 추가: "yoke", | |
| 4519 | 추가: "zerofrom", | |
| 4520 | 추가: "zerovec-derive", | |
| 4521 | 추가: ] | |
| 4522 | 추가: | |
| 4523 | 추가: [[package]] | |
| 4524 | 추가: name = "zerovec-derive" | |
| 4525 | 추가: version = "0.11.7" | |
| 4526 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 4527 | 추가: checksum = "c3743ddbf47738d929cd1ae2e199d40d0162979dfe31aef8ae646d2bf00bf97a" | |
| 4528 | 추가: dependencies = [ | |
| 4529 | 추가: "proc-macro2", | |
| 4530 | 추가: "quote", | |
| 4531 | 추가: "syn 3.0.10", | |
| 4532 | 추가: ] | |
| 4533 | 추가: | |
| 4055 | 4534 | [[package]] |
| 4056 | 4535 | name = "zip" |
| 4057 | 4536 | version = "9.5.0" |
| @@ -4121,6 +4600,7 @@ name = "zipelo-ui-memory-app" | ||
| 4121 | 4600 | version = "0.1.0" |
| 4122 | 4601 | dependencies = [ |
| 4123 | 4602 | "eframe", |
| 4603 | 추가: "rfd", | |
| 4124 | 4604 | "wgpu", |
| 4125 | 4605 | "zipelo-app-core-memory", |
| 4126 | 4606 | "zipelo-archive-worker", |
| @@ -4156,6 +4636,7 @@ dependencies = [ | ||
| 4156 | 4636 | "endi", |
| 4157 | 4637 | "enumflags2", |
| 4158 | 4638 | "serde", |
| 4639 | 추가: "url", | |
| 4159 | 4640 | "winnow", |
| 4160 | 4641 | "zcheapstr", |
| 4161 | 4642 | "zvariant_derive", |
| @@ -14,7 +14,7 @@ doctest = false | ||
| 14 | 14 | |
| 15 | 15 | [features] |
| 16 | 16 | default = [] |
| 17 | 삭제: ui = ["dep:eframe", "dep:wgpu"] | |
| 17 | 추가: ui = ["dep:eframe", "dep:wgpu", "dep:rfd"] | |
| 18 | 18 | ui-fixture = ["ui"] |
| 19 | 19 | |
| 20 | 20 | [dependencies] |
| @@ -43,6 +43,12 @@ path = "../../tests/rust-app-real-worker/flows.rs" | ||
| 43 | 43 | name = "format_contract" |
| 44 | 44 | path = "../../tests/rust-app-real-worker/formats.rs" |
| 45 | 45 | |
| 46 | 추가: [target.'cfg(target_os = "linux")'.dependencies] | |
| 47 | 추가: rfd = { version = "=0.16.0", optional = true, default-features = false, features = ["xdg-portal", "async-std"] } | |
| 48 | 추가: | |
| 49 | 추가: [target.'cfg(not(target_os = "linux"))'.dependencies] | |
| 50 | 추가: rfd = { version = "=0.16.0", optional = true, default-features = false } | |
| 51 | 추가: | |
| 46 | 52 | [target.'cfg(target_os = "windows")'.dependencies] |
| 47 | 53 | wgpu = { version = "=30.0.1", optional = true, default-features = false, features = ["std", "dx12"] } |
| 48 | 54 | eframe = { version = "=0.37.0", optional = true, default-features = false, features = ["wgpu_no_default_features"] } |
| @@ -0,0 +1,96 @@ | ||
| 1 | 추가: use crate::archive_ui::{Entry, Kind}; | |
| 2 | 추가: use std::collections::{BTreeMap, BTreeSet}; | |
| 3 | 추가: | |
| 4 | 추가: #[derive(Clone, Debug)] | |
| 5 | 추가: pub struct Row { | |
| 6 | 추가: pub path: String, | |
| 7 | 추가: pub name: String, | |
| 8 | 추가: pub directory: bool, | |
| 9 | 추가: pub ids: BTreeSet<u32>, | |
| 10 | 추가: pub bytes: Option<u64>, | |
| 11 | 추가: pub encrypted: bool, | |
| 12 | 추가: } | |
| 13 | 추가: | |
| 14 | 추가: pub fn normalized(name: &str) -> Option<String> { | |
| 15 | 추가: let name = name.replace('\\', "/"); | |
| 16 | 추가: let name = name.trim_end_matches('/'); | |
| 17 | 추가: if name.is_empty() | |
| 18 | 추가: || name.starts_with('/') | |
| 19 | 추가: || name.contains(':') | |
| 20 | 추가: || name | |
| 21 | 추가: .split('/') | |
| 22 | 추가: .any(|part| part.is_empty() || part == "." || part == ".." || part.contains('\0')) | |
| 23 | 추가: { | |
| 24 | 추가: return None; | |
| 25 | 추가: } | |
| 26 | 추가: Some(name.to_owned()) | |
| 27 | 추가: } | |
| 28 | 추가: | |
| 29 | 추가: pub fn rows(entries: &[Entry], current: &str, query: &str) -> Vec<Row> { | |
| 30 | 추가: let prefix = if current.is_empty() { | |
| 31 | 추가: String::new() | |
| 32 | 추가: } else { | |
| 33 | 추가: format!("{current}/") | |
| 34 | 추가: }; | |
| 35 | 추가: let mut rows = BTreeMap::<String, Row>::new(); | |
| 36 | 추가: for entry in entries { | |
| 37 | 추가: let Some(path) = normalized(&entry.name) else { | |
| 38 | 추가: continue; | |
| 39 | 추가: }; | |
| 40 | 추가: let Some(relative) = path.strip_prefix(&prefix) else { | |
| 41 | 추가: continue; | |
| 42 | 추가: }; | |
| 43 | 추가: if relative.is_empty() { | |
| 44 | 추가: continue; | |
| 45 | 추가: } | |
| 46 | 추가: let (name, implicit) = relative | |
| 47 | 추가: .split_once('/') | |
| 48 | 추가: .map_or((relative, false), |(first, _)| (first, true)); | |
| 49 | 추가: let directory = implicit || entry.kind == Kind::Directory; | |
| 50 | 추가: let row = rows.entry(name.to_owned()).or_insert_with(|| Row { | |
| 51 | 추가: path: format!("{prefix}{name}"), | |
| 52 | 추가: name: name.to_owned(), | |
| 53 | 추가: directory, | |
| 54 | 추가: ids: BTreeSet::new(), | |
| 55 | 추가: bytes: None, | |
| 56 | 추가: encrypted: false, | |
| 57 | 추가: }); | |
| 58 | 추가: row.directory |= directory; | |
| 59 | 추가: if matches!(entry.kind, Kind::File | Kind::Directory) { | |
| 60 | 추가: row.ids.insert(entry.id); | |
| 61 | 추가: } | |
| 62 | 추가: if !directory { | |
| 63 | 추가: row.bytes = entry.bytes; | |
| 64 | 추가: } | |
| 65 | 추가: row.encrypted |= entry.encrypted; | |
| 66 | 추가: } | |
| 67 | 추가: let query = query.to_lowercase(); | |
| 68 | 추가: let mut rows = rows | |
| 69 | 추가: .into_values() | |
| 70 | 추가: .filter(|row| row.name.to_lowercase().contains(&query)) | |
| 71 | 추가: .collect::<Vec<_>>(); | |
| 72 | 추가: rows.sort_by(|a, b| { | |
| 73 | 추가: b.directory | |
| 74 | 추가: .cmp(&a.directory) | |
| 75 | 추가: .then_with(|| a.name.cmp(&b.name)) | |
| 76 | 추가: }); | |
| 77 | 추가: rows | |
| 78 | 추가: } | |
| 79 | 추가: | |
| 80 | 추가: pub fn expand_selection(entries: &[Entry], selected: &BTreeSet<u32>) -> BTreeSet<u32> { | |
| 81 | 추가: let directories = entries | |
| 82 | 추가: .iter() | |
| 83 | 추가: .filter(|entry| entry.kind == Kind::Directory && selected.contains(&entry.id)) | |
| 84 | 추가: .filter_map(|entry| normalized(&entry.name).map(|path| format!("{path}/"))) | |
| 85 | 추가: .collect::<Vec<_>>(); | |
| 86 | 추가: entries | |
| 87 | 추가: .iter() | |
| 88 | 추가: .filter(|entry| { | |
| 89 | 추가: selected.contains(&entry.id) | |
| 90 | 추가: || normalized(&entry.name) | |
| 91 | 추가: .is_some_and(|name| directories.iter().any(|prefix| name.starts_with(prefix))) | |
| 92 | 추가: }) | |
| 93 | 추가: .filter(|entry| matches!(entry.kind, Kind::File | Kind::Directory)) | |
| 94 | 추가: .map(|entry| entry.id) | |
| 95 | 추가: .collect() | |
| 96 | 추가: } |
| @@ -0,0 +1,55 @@ | ||
| 1 | 추가: use std::path::PathBuf; | |
| 2 | 추가: | |
| 3 | 추가: #[derive(Clone, Copy, Debug, Eq, PartialEq)] | |
| 4 | 추가: pub enum Purpose { | |
| 5 | 추가: Open, | |
| 6 | 추가: Files, | |
| 7 | 추가: Folder, | |
| 8 | 추가: Destination, | |
| 9 | 추가: Retry, | |
| 10 | 추가: SaveZip, | |
| 11 | 추가: } | |
| 12 | 추가: | |
| 13 | 추가: #[derive(Clone, Debug)] | |
| 14 | 추가: pub struct DialogRequest { | |
| 15 | 추가: pub purpose: Purpose, | |
| 16 | 추가: pub directory: PathBuf, | |
| 17 | 추가: pub file_name: String, | |
| 18 | 추가: } | |
| 19 | 추가: | |
| 20 | 추가: pub trait Dialogs { | |
| 21 | 추가: fn choose(&mut self, request: DialogRequest) -> Result<Option<Vec<PathBuf>>, String>; | |
| 22 | 추가: } | |
| 23 | 추가: | |
| 24 | 추가: #[derive(Default)] | |
| 25 | 추가: pub struct NativeDialogs; | |
| 26 | 추가: | |
| 27 | 추가: impl Dialogs for NativeDialogs { | |
| 28 | 추가: fn choose(&mut self, request: DialogRequest) -> Result<Option<Vec<PathBuf>>, String> { | |
| 29 | 추가: let dialog = rfd::FileDialog::new().set_directory(request.directory); | |
| 30 | 추가: let answer = | |
| 31 | 추가: std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| match request.purpose { | |
| 32 | 추가: Purpose::Open => dialog | |
| 33 | 추가: .set_title("압축파일 열기") | |
| 34 | 추가: .add_filter("압축파일", &["zip", "7z", "tar", "gz", "tgz"]) | |
| 35 | 추가: .pick_file() | |
| 36 | 추가: .map(|path| vec![path]), | |
| 37 | 추가: Purpose::Files => dialog.set_title("파일 추가").pick_files(), | |
| 38 | 추가: Purpose::Folder => dialog | |
| 39 | 추가: .set_title("폴더 추가") | |
| 40 | 추가: .pick_folder() | |
| 41 | 추가: .map(|path| vec![path]), | |
| 42 | 추가: Purpose::Destination | Purpose::Retry => dialog | |
| 43 | 추가: .set_title("압축을 풀 폴더 선택") | |
| 44 | 추가: .pick_folder() | |
| 45 | 추가: .map(|path| vec![path]), | |
| 46 | 추가: Purpose::SaveZip => dialog | |
| 47 | 추가: .set_title("ZIP 파일 저장") | |
| 48 | 추가: .set_file_name(request.file_name) | |
| 49 | 추가: .add_filter("ZIP 압축파일", &["zip"]) | |
| 50 | 추가: .save_file() | |
| 51 | 추가: .map(|path| vec![path]), | |
| 52 | 추가: })); | |
| 53 | 추가: answer.map_err(|_| "파일 선택 창을 열지 못했습니다. 다시 시도하세요".to_owned()) | |
| 54 | 추가: } | |
| 55 | 추가: } |
| @@ -1,263 +0,0 @@ | ||
| 1 | 삭제: use crate::{archive_present as present, archive_theme as theme}; | |
| 2 | 삭제: use eframe::egui::{self, Align, Layout}; | |
| 3 | 삭제: use std::path::{Path, PathBuf}; | |
| 4 | 삭제: | |
| 5 | 삭제: #[derive(Clone, Copy, PartialEq)] | |
| 6 | 삭제: pub enum Purpose { | |
| 7 | 삭제: Open, | |
| 8 | 삭제: Destination, | |
| 9 | 삭제: Retry, | |
| 10 | 삭제: Files, | |
| 11 | 삭제: Folder, | |
| 12 | 삭제: ZipFolder, | |
| 13 | 삭제: } | |
| 14 | 삭제: | |
| 15 | 삭제: pub enum Choice { | |
| 16 | 삭제: Cancel, | |
| 17 | 삭제: Paths(Vec<PathBuf>), | |
| 18 | 삭제: } | |
| 19 | 삭제: | |
| 20 | 삭제: pub struct Picker { | |
| 21 | 삭제: pub purpose: Purpose, | |
| 22 | 삭제: current: PathBuf, | |
| 23 | 삭제: entries: Vec<present::BrowserEntry>, | |
| 24 | 삭제: selected: Vec<PathBuf>, | |
| 25 | 삭제: error: bool, | |
| 26 | 삭제: } | |
| 27 | 삭제: | |
| 28 | 삭제: impl Picker { | |
| 29 | 삭제: pub fn new(purpose: Purpose, start: &Path) -> Self { | |
| 30 | 삭제: let current = if start.is_dir() { | |
| 31 | 삭제: start.to_path_buf() | |
| 32 | 삭제: } else { | |
| 33 | 삭제: start | |
| 34 | 삭제: .parent() | |
| 35 | 삭제: .filter(|p| p.is_dir()) | |
| 36 | 삭제: .map(Path::to_path_buf) | |
| 37 | 삭제: .unwrap_or_else(present::home_directory) | |
| 38 | 삭제: }; | |
| 39 | 삭제: let mut picker = Self { | |
| 40 | 삭제: purpose, | |
| 41 | 삭제: current, | |
| 42 | 삭제: entries: Vec::new(), | |
| 43 | 삭제: selected: Vec::new(), | |
| 44 | 삭제: error: false, | |
| 45 | 삭제: }; | |
| 46 | 삭제: picker.reload(); | |
| 47 | 삭제: picker | |
| 48 | 삭제: } | |
| 49 | 삭제: | |
| 50 | 삭제: fn reload(&mut self) { | |
| 51 | 삭제: self.selected.clear(); | |
| 52 | 삭제: match present::directory_entries(&self.current) { | |
| 53 | 삭제: Ok(entries) => { | |
| 54 | 삭제: self.entries = entries; | |
| 55 | 삭제: self.error = false; | |
| 56 | 삭제: } | |
| 57 | 삭제: Err(_) => { | |
| 58 | 삭제: self.entries.clear(); | |
| 59 | 삭제: self.error = true; | |
| 60 | 삭제: } | |
| 61 | 삭제: } | |
| 62 | 삭제: } | |
| 63 | 삭제: | |
| 64 | 삭제: fn directory_mode(&self) -> bool { | |
| 65 | 삭제: matches!( | |
| 66 | 삭제: self.purpose, | |
| 67 | 삭제: Purpose::Destination | Purpose::Retry | Purpose::Folder | Purpose::ZipFolder | |
| 68 | 삭제: ) | |
| 69 | 삭제: } | |
| 70 | 삭제: | |
| 71 | 삭제: pub fn show(&mut self, ctx: &egui::Context) -> Option<Choice> { | |
| 72 | 삭제: let mut choice = None; | |
| 73 | 삭제: let mut navigate = None; | |
| 74 | 삭제: let width = (ctx.content_rect().width() - 64.0).min(720.0); | |
| 75 | 삭제: let height = (ctx.content_rect().height() - 280.0).clamp(160.0, 340.0); | |
| 76 | 삭제: let title = match self.purpose { | |
| 77 | 삭제: Purpose::Open => "파일 열기", | |
| 78 | 삭제: Purpose::Destination | Purpose::Retry => "풀 위치 선택", | |
| 79 | 삭제: Purpose::Files => "묶을 파일 선택", | |
| 80 | 삭제: Purpose::Folder => "묶을 폴더 선택", | |
| 81 | 삭제: Purpose::ZipFolder => "ZIP 저장 폴더 선택", | |
| 82 | 삭제: }; | |
| 83 | 삭제: let title = if self.purpose == Purpose::Open { | |
| 84 | 삭제: "파일 열기" | |
| 85 | 삭제: } else { | |
| 86 | 삭제: title | |
| 87 | 삭제: }; | |
| 88 | 삭제: let modal = egui::Modal::new(egui::Id::unique("archive-picker")).show(ctx, |ui| { | |
| 89 | 삭제: ui.set_width(width); | |
| 90 | 삭제: ui.heading(title); | |
| 91 | 삭제: egui::ScrollArea::horizontal() | |
| 92 | 삭제: .id_salt("breadcrumbs") | |
| 93 | 삭제: .show(ui, |ui| { | |
| 94 | 삭제: ui.horizontal(|ui| { | |
| 95 | 삭제: let mut ancestors = self.current.ancestors().collect::<Vec<_>>(); | |
| 96 | 삭제: ancestors.reverse(); | |
| 97 | 삭제: for path in ancestors { | |
| 98 | 삭제: let label = path | |
| 99 | 삭제: .file_name() | |
| 100 | 삭제: .unwrap_or(path.as_os_str()) | |
| 101 | 삭제: .to_string_lossy(); | |
| 102 | 삭제: if ui | |
| 103 | 삭제: .button(label.as_ref()) | |
| 104 | 삭제: .on_hover_text(path.display().to_string()) | |
| 105 | 삭제: .clicked() | |
| 106 | 삭제: { | |
| 107 | 삭제: navigate = Some(path.to_path_buf()); | |
| 108 | 삭제: } | |
| 109 | 삭제: } | |
| 110 | 삭제: }); | |
| 111 | 삭제: }); | |
| 112 | 삭제: ui.separator(); | |
| 113 | 삭제: ui.horizontal_top(|ui| { | |
| 114 | 삭제: ui.allocate_ui_with_layout( | |
| 115 | 삭제: egui::vec2(128.0, height), | |
| 116 | 삭제: Layout::top_down(Align::Min), | |
| 117 | 삭제: |ui| { | |
| 118 | 삭제: ui.set_min_size(egui::vec2(128.0, height)); | |
| 119 | 삭제: for (label, path) in present::shortcuts() { | |
| 120 | 삭제: if theme::action(ui, &label, false, true).clicked() { | |
| 121 | 삭제: navigate = Some(path); | |
| 122 | 삭제: } | |
| 123 | 삭제: } | |
| 124 | 삭제: if let Some(parent) = self.current.parent() { | |
| 125 | 삭제: if theme::action(ui, "상위 폴더", false, true).clicked() { | |
| 126 | 삭제: navigate = Some(parent.to_path_buf()); | |
| 127 | 삭제: } | |
| 128 | 삭제: } | |
| 129 | 삭제: }, | |
| 130 | 삭제: ); | |
| 131 | 삭제: ui.add_space(theme::SPACE); | |
| 132 | 삭제: ui.allocate_ui_with_layout( | |
| 133 | 삭제: egui::vec2((width - 160.0).max(240.0), height), | |
| 134 | 삭제: Layout::top_down(Align::Min), | |
| 135 | 삭제: |ui| { | |
| 136 | 삭제: ui.set_min_size(egui::vec2((width - 160.0).max(240.0), height)); | |
| 137 | 삭제: if self.error { | |
| 138 | 삭제: ui.colored_label( | |
| 139 | 삭제: theme::ERROR, | |
| 140 | 삭제: "이 폴더를 열 수 없습니다. 접근 권한을 확인하세요", | |
| 141 | 삭제: ); | |
| 142 | 삭제: } else if self.entries.is_empty() { | |
| 143 | 삭제: ui.label("이 폴더는 비어 있습니다"); | |
| 144 | 삭제: } | |
| 145 | 삭제: egui::ScrollArea::vertical() | |
| 146 | 삭제: .id_salt("picker-entries") | |
| 147 | 삭제: .max_height(height) | |
| 148 | 삭제: .show_rows(ui, theme::ROW, self.entries.len(), |ui, rows| { | |
| 149 | 삭제: for index in rows { | |
| 150 | 삭제: let entry = &self.entries[index]; | |
| 151 | 삭제: let selected = self.selected.contains(&entry.path); | |
| 152 | 삭제: let response = ui | |
| 153 | 삭제: .horizontal(|ui| { | |
| 154 | 삭제: theme::icon( | |
| 155 | 삭제: ui, | |
| 156 | 삭제: if entry.directory { | |
| 157 | 삭제: theme::Icon::Folder | |
| 158 | 삭제: } else { | |
| 159 | 삭제: theme::Icon::File | |
| 160 | 삭제: }, | |
| 161 | 삭제: 20.0, | |
| 162 | 삭제: ); | |
| 163 | 삭제: let name = if entry.link { | |
| 164 | 삭제: format!("{} (링크)", entry.name) | |
| 165 | 삭제: } else { | |
| 166 | 삭제: entry.name.clone() | |
| 167 | 삭제: }; | |
| 168 | 삭제: ui.add_sized( | |
| 169 | 삭제: [ui.available_width(), theme::ROW], | |
| 170 | 삭제: egui::Button::new("") | |
| 171 | 삭제: .left_text(present::middle_text(&name, 38)) | |
| 172 | 삭제: .selected(selected), | |
| 173 | 삭제: ) | |
| 174 | 삭제: .on_hover_text(entry.path.display().to_string()) | |
| 175 | 삭제: }) | |
| 176 | 삭제: .inner; | |
| 177 | 삭제: theme::focus(&response); | |
| 178 | 삭제: if response.clicked() { | |
| 179 | 삭제: if self.purpose == Purpose::Files | |
| 180 | 삭제: && ui.input(|i| i.modifiers.command || i.modifiers.ctrl) | |
| 181 | 삭제: { | |
| 182 | 삭제: if selected { | |
| 183 | 삭제: self.selected.retain(|p| p != &entry.path); | |
| 184 | 삭제: } else if !entry.directory { | |
| 185 | 삭제: self.selected.push(entry.path.clone()); | |
| 186 | 삭제: } | |
| 187 | 삭제: } else { | |
| 188 | 삭제: self.selected = vec![entry.path.clone()]; | |
| 189 | 삭제: } | |
| 190 | 삭제: } | |
| 191 | 삭제: let keyboard_activation = response.has_focus() | |
| 192 | 삭제: && ui.input(|i| { | |
| 193 | 삭제: i.key_pressed(egui::Key::Enter) | |
| 194 | 삭제: || i.key_pressed(egui::Key::Space) | |
| 195 | 삭제: }); | |
| 196 | 삭제: if response.double_clicked() || keyboard_activation { | |
| 197 | 삭제: if entry.directory && !entry.link { | |
| 198 | 삭제: navigate = Some(entry.path.clone()); | |
| 199 | 삭제: } else if !self.directory_mode() { | |
| 200 | 삭제: choice = Some(Choice::Paths(vec![entry.path.clone()])); | |
| 201 | 삭제: } | |
| 202 | 삭제: } | |
| 203 | 삭제: } | |
| 204 | 삭제: }); | |
| 205 | 삭제: }, | |
| 206 | 삭제: ); | |
| 207 | 삭제: }); | |
| 208 | 삭제: ui.separator(); | |
| 209 | 삭제: ui.horizontal(|ui| { | |
| 210 | 삭제: if self.purpose == Purpose::Files { | |
| 211 | 삭제: ui.label("Ctrl을 누르면 여러 파일을 고를 수 있습니다"); | |
| 212 | 삭제: } | |
| 213 | 삭제: ui.with_layout(Layout::right_to_left(Align::Center), |ui| { | |
| 214 | 삭제: let selected_directory = self.selected.first().filter(|path| { | |
| 215 | 삭제: self.entries | |
| 216 | 삭제: .iter() | |
| 217 | 삭제: .any(|e| &e.path == *path && (e.directory || e.link)) | |
| 218 | 삭제: }); | |
| 219 | 삭제: let paths = if self.directory_mode() { | |
| 220 | 삭제: vec![ | |
| 221 | 삭제: selected_directory | |
| 222 | 삭제: .cloned() | |
| 223 | 삭제: .unwrap_or_else(|| self.current.clone()), | |
| 224 | 삭제: ] | |
| 225 | 삭제: } else { | |
| 226 | 삭제: self.selected | |
| 227 | 삭제: .iter() | |
| 228 | 삭제: .filter(|path| { | |
| 229 | 삭제: self.entries | |
| 230 | 삭제: .iter() | |
| 231 | 삭제: .any(|e| &e.path == *path && !e.directory) | |
| 232 | 삭제: }) | |
| 233 | 삭제: .cloned() | |
| 234 | 삭제: .collect() | |
| 235 | 삭제: }; | |
| 236 | 삭제: let label = if self.directory_mode() { | |
| 237 | 삭제: "이 폴더 선택" | |
| 238 | 삭제: } else if self.purpose == Purpose::Files { | |
| 239 | 삭제: "추가" | |
| 240 | 삭제: } else { | |
| 241 | 삭제: "열기" | |
| 242 | 삭제: }; | |
| 243 | 삭제: let enabled = !paths.is_empty() && !self.error; | |
| 244 | 삭제: let (cancel, confirm) = theme::action_pair(ui, "취소", Some((label, enabled))); | |
| 245 | 삭제: if navigate.is_none() && confirm { | |
| 246 | 삭제: choice = Some(Choice::Paths(paths)); | |
| 247 | 삭제: } | |
| 248 | 삭제: if cancel { | |
| 249 | 삭제: choice = Some(Choice::Cancel); | |
| 250 | 삭제: } | |
| 251 | 삭제: }); | |
| 252 | 삭제: }); | |
| 253 | 삭제: }); | |
| 254 | 삭제: if modal.should_close() { | |
| 255 | 삭제: choice = Some(Choice::Cancel); | |
| 256 | 삭제: } | |
| 257 | 삭제: if let Some(path) = navigate { | |
| 258 | 삭제: self.current = path; | |
| 259 | 삭제: self.reload(); | |
| 260 | 삭제: } | |
| 261 | 삭제: choice | |
| 262 | 삭제: } | |
| 263 | 삭제: } |
| @@ -1,5 +1,6 @@ | ||
| 1 | 1 | use crate::{ |
| 2 | 삭제: archive_picker::{Choice, Picker, Purpose}, | |
| 2 | 추가: archive_browser as browser, | |
| 3 | 추가: archive_dialog::{DialogRequest, Dialogs, NativeDialogs, Purpose}, | |
| 3 | 4 | archive_present as present, |
| 4 | 5 | archive_theme::{self as theme, Icon}, |
| 5 | 6 | archive_ui::*, |
| @@ -28,8 +29,9 @@ pub struct ArchiveApp { | ||
| 28 | 29 | create: bool, |
| 29 | 30 | selected_only: bool, |
| 30 | 31 | method: Method, |
| 31 | 삭제: fixture: bool, | |
| 32 | 삭제: picker: Option<Picker>, | |
| 32 | 추가: dialogs: Box<dyn Dialogs>, | |
| 33 | 추가: folder: String, | |
| 34 | 추가: search: String, | |
| 33 | 35 | last_request: Option<Start>, |
| 34 | 36 | targets: Option<BTreeSet<String>>, |
| 35 | 37 | directories: BTreeSet<String>, |
| @@ -41,7 +43,7 @@ pub struct ArchiveApp { | ||
| 41 | 43 | } |
| 42 | 44 | |
| 43 | 45 | impl ArchiveApp { |
| 44 | 삭제: pub fn new(factory: Box<dyn Factory>, startup: Option<PathBuf>, fixture: bool) -> Self { | |
| 46 | 추가: pub fn new(factory: Box<dyn Factory>, startup: Option<PathBuf>, _fixture: bool) -> Self { | |
| 45 | 47 | let mut app = Self { |
| 46 | 48 | model: Model::default(), |
| 47 | 49 | factory, |
| @@ -60,8 +62,9 @@ impl ArchiveApp { | ||
| 60 | 62 | create: false, |
| 61 | 63 | selected_only: false, |
| 62 | 64 | method: Method::Deflate, |
| 63 | 삭제: fixture, | |
| 64 | 삭제: picker: None, | |
| 65 | 추가: dialogs: Box::new(NativeDialogs), | |
| 66 | 추가: folder: String::new(), | |
| 67 | 추가: search: String::new(), | |
| 65 | 68 | last_request: None, |
| 66 | 69 | targets: None, |
| 67 | 70 | directories: BTreeSet::new(), |
| @@ -77,6 +80,23 @@ impl ArchiveApp { | ||
| 77 | 80 | app |
| 78 | 81 | } |
| 79 | 82 | |
| 83 | 추가: pub fn set_dialogs(&mut self, dialogs: Box<dyn Dialogs>) { | |
| 84 | 추가: self.dialogs = dialogs; | |
| 85 | 추가: } | |
| 86 | 추가: | |
| 87 | 추가: pub fn browse_folder(&mut self, folder: &str) { | |
| 88 | 추가: self.folder = folder.trim_matches('/').to_owned(); | |
| 89 | 추가: self.search.clear(); | |
| 90 | 추가: } | |
| 91 | 추가: | |
| 92 | 추가: pub fn show_create(&mut self, encrypted: bool) { | |
| 93 | 추가: if !self.model.busy() { | |
| 94 | 추가: self.create = true; | |
| 95 | 추가: self.aes256 = encrypted; | |
| 96 | 추가: self.ui_error = None; | |
| 97 | 추가: } | |
| 98 | 추가: } | |
| 99 | 추가: | |
| 80 | 100 | fn clear_password(&mut self) { |
| 81 | 101 | for value in [&mut self.password, &mut self.password_confirm] { |
| 82 | 102 | let mut bytes = std::mem::take(value).into_bytes(); |
| @@ -100,6 +120,8 @@ impl ArchiveApp { | ||
| 100 | 120 | .unwrap_or("압축 해제 파일") |
| 101 | 121 | .into(); |
| 102 | 122 | self.selected_only = false; |
| 123 | 추가: self.folder.clear(); | |
| 124 | 추가: self.search.clear(); | |
| 103 | 125 | self.targets = None; |
| 104 | 126 | self.directories.clear(); |
| 105 | 127 | self.start(Start::List { archive }); |
| @@ -124,6 +146,31 @@ impl ArchiveApp { | ||
| 124 | 146 | if self.model.busy() { |
| 125 | 147 | return; |
| 126 | 148 | } |
| 149 | 추가: let mut validated = Vec::new(); | |
| 150 | 추가: for path in paths { | |
| 151 | 추가: let Ok(metadata) = std::fs::symlink_metadata(&path) else { | |
| 152 | 추가: self.ui_error = Some("파일이나 폴더를 찾지 못했습니다. 다시 선택하세요".into()); | |
| 153 | 추가: return; | |
| 154 | 추가: }; | |
| 155 | 추가: if metadata.file_type().is_symlink() || !(metadata.is_file() || metadata.is_dir()) { | |
| 156 | 추가: self.ui_error = Some("일반 파일과 폴더만 추가할 수 있습니다".into()); | |
| 157 | 추가: return; | |
| 158 | 추가: } | |
| 159 | 추가: let Ok(path) = path.canonicalize() else { | |
| 160 | 추가: return; | |
| 161 | 추가: }; | |
| 162 | 추가: if path.to_str().is_none() | |
| 163 | 추가: || !path | |
| 164 | 추가: .file_name() | |
| 165 | 추가: .and_then(|name| name.to_str()) | |
| 166 | 추가: .is_some_and(valid_leaf) | |
| 167 | 추가: { | |
| 168 | 추가: self.ui_error = Some("파일이나 폴더의 이름을 확인하세요".into()); | |
| 169 | 추가: return; | |
| 170 | 추가: } | |
| 171 | 추가: validated.push(path); | |
| 172 | 추가: } | |
| 173 | 추가: let paths = validated; | |
| 127 | 174 | if self.sources.is_empty() { |
| 128 | 175 | if let Some(first) = paths.first() { |
| 129 | 176 | self.zip_folder = first.parent().unwrap_or(Path::new("/")).to_path_buf(); |
| @@ -161,7 +208,11 @@ impl ArchiveApp { | ||
| 161 | 208 | .as_ref() |
| 162 | 209 | .is_some_and(|id| id.format == Format::Gzip); |
| 163 | 210 | let selection = if self.selected_only { |
| 164 | 삭제: Selection::EntryIds(self.model.selected.iter().copied().collect()) | |
| 211 | 추가: Selection::EntryIds( | |
| 212 | 추가: browser::expand_selection(&self.model.entries, &self.model.selected) | |
| 213 | 추가: .into_iter() | |
| 214 | 추가: .collect(), | |
| 215 | 추가: ) | |
| 165 | 216 | } else { |
| 166 | 217 | Selection::All |
| 167 | 218 | }; |
| @@ -232,24 +283,66 @@ impl ArchiveApp { | ||
| 232 | 283 | } |
| 233 | 284 | |
| 234 | 285 | fn open_picker(&mut self, purpose: Purpose) { |
| 235 | 삭제: let start = match purpose { | |
| 236 | 삭제: Purpose::Destination | Purpose::Retry => self.destination.clone(), | |
| 237 | 삭제: Purpose::ZipFolder => self.zip_folder.clone(), | |
| 238 | 삭제: Purpose::Open => self | |
| 286 | 추가: if self.model.busy() { | |
| 287 | 추가: return; | |
| 288 | 추가: } | |
| 289 | 추가: let directory = match purpose { | |
| 290 | 추가: Purpose::SaveZip => self.zip_folder.clone(), | |
| 291 | 추가: Purpose::Destination => self | |
| 239 | 292 | .model |
| 240 | 293 | .archive |
| 241 | 삭제: .as_deref() | |
| 242 | 삭제: .and_then(Path::parent) | |
| 294 | 추가: .as_ref() | |
| 295 | 추가: .and_then(|path| path.parent()) | |
| 243 | 296 | .map(Path::to_path_buf) |
| 244 | 297 | .unwrap_or_else(present::home_directory), |
| 298 | 추가: Purpose::Retry => self.destination.clone(), | |
| 245 | 299 | _ => self |
| 246 | 300 | .sources |
| 247 | 301 | .last() |
| 248 | 삭제: .and_then(|p| p.parent()) | |
| 302 | 추가: .and_then(|path| path.parent()) | |
| 249 | 303 | .map(Path::to_path_buf) |
| 250 | 304 | .unwrap_or_else(present::home_directory), |
| 251 | 305 | }; |
| 252 | 삭제: self.picker = Some(Picker::new(purpose, &start)); | |
| 306 | 추가: let request = DialogRequest { | |
| 307 | 추가: purpose, | |
| 308 | 추가: directory, | |
| 309 | 추가: file_name: self.zip_name.clone(), | |
| 310 | 추가: }; | |
| 311 | 추가: match self.dialogs.choose(request) { | |
| 312 | 추가: Ok(Some(paths)) if !paths.is_empty() => { | |
| 313 | 추가: let path = paths[0].clone(); | |
| 314 | 추가: match purpose { | |
| 315 | 추가: Purpose::Open => { | |
| 316 | 추가: if std::fs::symlink_metadata(&path) | |
| 317 | 추가: .is_ok_and(|m| m.is_file() && !m.file_type().is_symlink()) | |
| 318 | 추가: { | |
| 319 | 추가: self.open_path(path); | |
| 320 | 추가: } else { | |
| 321 | 추가: self.ui_error = Some("일반 압축파일을 선택하세요".into()); | |
| 322 | 추가: } | |
| 323 | 추가: } | |
| 324 | 추가: Purpose::Files | Purpose::Folder => self.add_sources(paths), | |
| 325 | 추가: Purpose::Destination | Purpose::Retry => { | |
| 326 | 추가: self.choose_destination(path); | |
| 327 | 추가: self.selected_only = !self.model.selected.is_empty(); | |
| 328 | 추가: if purpose == Purpose::Retry { | |
| 329 | 추가: self.retry(); | |
| 330 | 추가: } else { | |
| 331 | 추가: self.begin_extract(); | |
| 332 | 추가: } | |
| 333 | 추가: } | |
| 334 | 추가: Purpose::SaveZip => { | |
| 335 | 추가: if let Some(name) = path.file_name().and_then(|name| name.to_str()) { | |
| 336 | 추가: self.zip_name = name.to_owned(); | |
| 337 | 추가: self.zip_folder = path.parent().unwrap_or(Path::new("/")).to_path_buf(); | |
| 338 | 추가: self.begin_zip(); | |
| 339 | 추가: } | |
| 340 | 추가: } | |
| 341 | 추가: } | |
| 342 | 추가: } | |
| 343 | 추가: Ok(_) => {} | |
| 344 | 추가: Err(error) => self.ui_error = Some(error), | |
| 345 | 추가: } | |
| 253 | 346 | } |
| 254 | 347 | |
| 255 | 348 | fn retry(&mut self) { |
| @@ -278,34 +371,18 @@ impl ArchiveApp { | ||
| 278 | 371 | } |
| 279 | 372 | } |
| 280 | 373 | |
| 281 | 삭제: fn show_picker(&mut self, ctx: &egui::Context) { | |
| 282 | 삭제: let answer = self.picker.as_mut().and_then(|picker| picker.show(ctx)); | |
| 283 | 삭제: if let Some(answer) = answer { | |
| 284 | 삭제: let purpose = self.picker.take().unwrap().purpose; | |
| 285 | 삭제: if let Choice::Paths(paths) = answer { | |
| 286 | 삭제: if let Some(path) = paths.first() { | |
| 287 | 삭제: match purpose { | |
| 288 | 삭제: Purpose::Open => self.open_path(path.clone()), | |
| 289 | 삭제: Purpose::Destination | Purpose::Retry => { | |
| 290 | 삭제: self.choose_destination(path.clone()); | |
| 291 | 삭제: if purpose == Purpose::Retry { | |
| 292 | 삭제: self.retry(); | |
| 293 | 삭제: } | |
| 294 | 삭제: } | |
| 295 | 삭제: Purpose::ZipFolder => self.zip_folder = path.clone(), | |
| 296 | 삭제: Purpose::Files | Purpose::Folder => self.add_sources(paths), | |
| 297 | 삭제: } | |
| 298 | 삭제: } | |
| 299 | 삭제: } | |
| 300 | 삭제: } | |
| 301 | 삭제: } | |
| 302 | 삭제: | |
| 303 | 374 | fn on_drop(&mut self, paths: Vec<PathBuf>) { |
| 304 | 삭제: if self.model.busy() || paths.is_empty() || self.picker.is_some() { | |
| 375 | 추가: if self.model.busy() || paths.is_empty() { | |
| 305 | 376 | return; |
| 306 | 377 | } |
| 307 | 378 | if paths.len() == 1 && !self.create && !paths[0].is_dir() { |
| 308 | 삭제: self.open_path(paths[0].clone()); | |
| 379 | 추가: if std::fs::symlink_metadata(&paths[0]) | |
| 380 | 추가: .is_ok_and(|m| m.is_file() && !m.file_type().is_symlink()) | |
| 381 | 추가: { | |
| 382 | 추가: self.open_path(paths[0].clone()); | |
| 383 | 추가: } else { | |
| 384 | 추가: self.ui_error = Some("일반 압축파일을 선택하세요".into()); | |
| 385 | 추가: } | |
| 309 | 386 | } else { |
| 310 | 387 | self.add_sources(paths); |
| 311 | 388 | } |
| @@ -358,45 +435,79 @@ impl ArchiveApp { | ||
| 358 | 435 | if self.model.close == Close::Allowed { |
| 359 | 436 | ctx.send_viewport_cmd(egui::ViewportCommand::Close); |
| 360 | 437 | } |
| 438 | 추가: let title = self | |
| 439 | 추가: .model | |
| 440 | 추가: .archive | |
| 441 | 추가: .as_ref() | |
| 442 | 추가: .map(|path| { | |
| 443 | 추가: let full = if path.is_absolute() { | |
| 444 | 추가: path.clone() | |
| 445 | 추가: } else { | |
| 446 | 추가: std::env::current_dir().unwrap_or_default().join(path) | |
| 447 | 추가: }; | |
| 448 | 추가: format!("{} — Zipelo", full.display()) | |
| 449 | 추가: }) | |
| 450 | 추가: .unwrap_or_else(|| "Zipelo".into()); | |
| 451 | 추가: ctx.send_viewport_cmd(egui::ViewportCommand::Title(title)); | |
| 361 | 452 | egui::Panel::top("archive-actions") |
| 362 | 삭제: .frame(theme::panel(theme::PANEL).corner_radius(0)) | |
| 453 | 추가: .frame( | |
| 454 | 추가: theme::panel(theme::PANEL) | |
| 455 | 추가: .corner_radius(0) | |
| 456 | 추가: .inner_margin(egui::Margin::symmetric(16, 4)), | |
| 457 | 추가: ) | |
| 458 | 추가: .show(root, |ui| { | |
| 459 | 추가: ui.horizontal(|ui| { | |
| 460 | 추가: let idle = !self.model.busy() && self.model.close == Close::Open; | |
| 461 | 추가: if theme::tool(ui, "열기", theme::OPEN, idle, false).clicked() { | |
| 462 | 추가: self.open_picker(Purpose::Open); | |
| 463 | 추가: } | |
| 464 | 추가: if theme::tool(ui, "압축하기", theme::CREATE, idle, false).clicked() { | |
| 465 | 추가: self.show_create(false); | |
| 466 | 추가: } | |
| 467 | 추가: if theme::tool( | |
| 468 | 추가: ui, | |
| 469 | 추가: "압축해제", | |
| 470 | 추가: theme::EXTRACT, | |
| 471 | 추가: self.model.can_extract(), | |
| 472 | 추가: true, | |
| 473 | 추가: ) | |
| 474 | 추가: .clicked() | |
| 475 | 추가: { | |
| 476 | 추가: self.open_picker(Purpose::Destination); | |
| 477 | 추가: } | |
| 478 | 추가: if theme::tool(ui, "암호화", theme::PROTECT, idle, false).clicked() { | |
| 479 | 추가: self.show_create(true); | |
| 480 | 추가: } | |
| 481 | 추가: }); | |
| 482 | 추가: }); | |
| 483 | 추가: egui::Panel::bottom("archive-status") | |
| 484 | 추가: .frame( | |
| 485 | 추가: theme::panel(theme::STRIPE) | |
| 486 | 추가: .corner_radius(0) | |
| 487 | 추가: .inner_margin(egui::Margin::symmetric(16, 8)), | |
| 488 | 추가: ) | |
| 363 | 489 | .show(root, |ui| { |
| 364 | 490 | ui.horizontal(|ui| { |
| 365 | 삭제: theme::icon(ui, Icon::Archive, 24.0); | |
| 366 | 삭제: ui.heading("Zipelo"); | |
| 491 | 추가: ui.label(format!( | |
| 492 | 추가: "{}개 항목", | |
| 493 | 추가: browser::rows(&self.model.entries, &self.folder, &self.search).len() | |
| 494 | 추가: )); | |
| 367 | 495 | ui.with_layout(Layout::right_to_left(Align::Center), |ui| { |
| 368 | 삭제: if theme::action( | |
| 369 | 삭제: ui, | |
| 370 | 삭제: "ZIP 만들기", | |
| 371 | 삭제: false, | |
| 372 | 삭제: !self.model.busy() && self.model.close == Close::Open, | |
| 373 | 삭제: ) | |
| 374 | 삭제: .on_disabled_hover_text("작업이 끝나면 ZIP을 만들 수 있습니다") | |
| 375 | 삭제: .clicked() | |
| 376 | 삭제: { | |
| 377 | 삭제: self.create = true; | |
| 378 | 삭제: self.ui_error = None; | |
| 379 | 삭제: } | |
| 496 | 추가: ui.label(format!("선택 {}개", self.model.selected.len())); | |
| 380 | 497 | }); |
| 381 | 498 | }); |
| 382 | 삭제: if self.fixture { | |
| 383 | 삭제: ui.colored_label( | |
| 384 | 삭제: theme::WARNING, | |
| 385 | 삭제: "화면 시험 모드 / 파일을 읽거나 저장하지 않습니다", | |
| 386 | 삭제: ); | |
| 387 | 삭제: } | |
| 388 | 499 | }); |
| 389 | 삭제: if self.model.archive.is_some() | |
| 390 | 삭제: || self.model.busy() | |
| 391 | 삭제: || self.result_visible() | |
| 392 | 삭제: || self.ui_error.is_some() | |
| 393 | 삭제: { | |
| 500 | 추가: if self.model.busy() || self.result_visible() || self.ui_error.is_some() { | |
| 394 | 501 | egui::Panel::bottom("archive-work") |
| 395 | 502 | .frame(theme::panel(theme::PANEL).corner_radius(0)) |
| 396 | 503 | .show(root, |ui| self.work_area(ui)); |
| 397 | 504 | } |
| 398 | 505 | egui::CentralPanel::default() |
| 399 | 삭제: .frame(theme::panel(theme::BACKGROUND)) | |
| 506 | 추가: .frame( | |
| 507 | 추가: theme::panel(theme::PANEL) | |
| 508 | 추가: .corner_radius(0) | |
| 509 | 추가: .inner_margin(egui::Margin::ZERO), | |
| 510 | 추가: ) | |
| 400 | 511 | .show(root, |ui| { |
| 401 | 512 | if self.model.archive.is_some() { |
| 402 | 513 | self.archive_list(ui); |
| @@ -407,7 +518,6 @@ impl ArchiveApp { | ||
| 407 | 518 | if self.create && !self.model.busy() { |
| 408 | 519 | self.create_dialog(&ctx); |
| 409 | 520 | } |
| 410 | 삭제: self.show_picker(&ctx); | |
| 411 | 521 | if self.model.challenge.is_some() { |
| 412 | 522 | self.password_dialog(&ctx, new_challenge); |
| 413 | 523 | } |
| @@ -492,222 +602,170 @@ impl ArchiveApp { | ||
| 492 | 602 | } |
| 493 | 603 | |
| 494 | 604 | fn archive_list(&mut self, ui: &mut egui::Ui) { |
| 495 | 삭제: let archive = self.model.archive.as_ref().unwrap().clone(); | |
| 496 | 삭제: ui.horizontal(|ui| { | |
| 497 | 삭제: theme::icon(ui, Icon::Archive, 32.0); | |
| 498 | 삭제: let name = archive.file_name().unwrap_or_default().to_string_lossy(); | |
| 499 | 삭제: let limit = ((ui.available_width() - 144.0) / theme::TITLE).max(10.0) as usize; | |
| 500 | 삭제: ui.heading(present::middle_text(&name, limit)) | |
| 501 | 삭제: .on_hover_text(archive.display().to_string()); | |
| 502 | 삭제: ui.with_layout(Layout::right_to_left(Align::Center), |ui| { | |
| 503 | 삭제: if theme::action(ui, "다른 파일", false, !self.model.busy()).clicked() { | |
| 504 | 삭제: self.open_picker(Purpose::Open); | |
| 605 | 추가: theme::panel(theme::STRIPE).corner_radius(0).show(ui, |ui| { | |
| 606 | 추가: ui.horizontal(|ui| { | |
| 607 | 추가: let up = theme::icon_button( | |
| 608 | 추가: ui, | |
| 609 | 추가: "위로", | |
| 610 | 추가: theme::UP, | |
| 611 | 추가: !self.folder.is_empty() && !self.model.busy(), | |
| 612 | 추가: ); | |
| 613 | 추가: if up.clicked() { | |
| 614 | 추가: let parent = self | |
| 615 | 추가: .folder | |
| 616 | 추가: .rsplit_once('/') | |
| 617 | 추가: .map_or("", |(parent, _)| parent) | |
| 618 | 추가: .to_owned(); | |
| 619 | 추가: self.browse_folder(&parent); | |
| 505 | 620 | } |
| 621 | 추가: ui.label("현재 경로"); | |
| 622 | 추가: let mut path = format!("/{}", self.folder); | |
| 623 | 추가: ui.add_sized( | |
| 624 | 추가: [ui.available_width() - 270.0, 36.0], | |
| 625 | 추가: egui::TextEdit::singleline(&mut path).interactive(false), | |
| 626 | 추가: ); | |
| 627 | 추가: let (rect, _) = | |
| 628 | 추가: ui.allocate_exact_size(egui::vec2(20.0, 20.0), egui::Sense::hover()); | |
| 629 | 추가: theme::svg_icon(ui.painter(), rect, theme::SEARCH, theme::MUTED); | |
| 630 | 추가: let search = ui.add_sized( | |
| 631 | 추가: [220.0, 36.0], | |
| 632 | 추가: egui::TextEdit::singleline(&mut self.search) | |
| 633 | 추가: .id(egui::Id::unique("archive-search")) | |
| 634 | 추가: .hint_text("파일 찾기"), | |
| 635 | 추가: ); | |
| 636 | 추가: theme::focus(&search); | |
| 506 | 637 | }); |
| 507 | 638 | }); |
| 508 | 삭제: let bytes = self | |
| 509 | 삭제: .model | |
| 510 | 삭제: .entries | |
| 511 | 삭제: .iter() | |
| 512 | 삭제: .filter_map(|entry| entry.bytes) | |
| 513 | 삭제: .sum(); | |
| 514 | 삭제: ui.colored_label( | |
| 515 | 삭제: theme::MUTED, | |
| 516 | 삭제: format!( | |
| 517 | 삭제: "항목 {}개, {}", | |
| 518 | 삭제: self.model.entries.len(), | |
| 519 | 삭제: present::bytes_text(bytes) | |
| 520 | 삭제: ), | |
| 521 | 삭제: ); | |
| 522 | 삭제: ui.add_space(theme::SPACE); | |
| 523 | 삭제: let selectable = self | |
| 524 | 삭제: .model | |
| 525 | 삭제: .entries | |
| 639 | 추가: let rows = browser::rows(&self.model.entries, &self.folder, &self.search); | |
| 640 | 추가: let visible = rows | |
| 526 | 641 | .iter() |
| 527 | 삭제: .filter(|e| matches!(e.kind, Kind::File | Kind::Directory)) | |
| 528 | 삭제: .map(|e| e.id) | |
| 642 | 추가: .flat_map(|row| row.ids.iter().copied()) | |
| 529 | 643 | .collect::<BTreeSet<_>>(); |
| 530 | 삭제: let mut all = !selectable.is_empty() && selectable.is_subset(&self.model.selected); | |
| 531 | 삭제: let widths = | |
| 532 | 삭제: (ui.available_width() - 32.0 - 96.0 - 64.0 - theme::SPACE * 4.0 - 32.0).max(160.0); | |
| 533 | 삭제: theme::panel(theme::PANEL) | |
| 534 | 삭제: .inner_margin(egui::Margin::symmetric(theme::SPACE as i8, 0)) | |
| 535 | 삭제: .show(ui, |ui| { | |
| 536 | 삭제: ui.horizontal(|ui| { | |
| 537 | 삭제: let response = ui | |
| 538 | 삭제: .add_enabled( | |
| 539 | 삭제: !self.model.busy() && !selectable.is_empty(), | |
| 540 | 삭제: egui::Checkbox::without_text(&mut all), | |
| 541 | 삭제: ) | |
| 542 | 삭제: .on_hover_text("전체 선택"); | |
| 543 | 삭제: response.widget_info(|| { | |
| 544 | 삭제: egui::WidgetInfo::selected( | |
| 545 | 삭제: egui::Role::CheckBox, | |
| 546 | 삭제: !self.model.busy(), | |
| 547 | 삭제: all, | |
| 548 | 삭제: "전체 선택", | |
| 549 | 삭제: ) | |
| 550 | 삭제: }); | |
| 551 | 삭제: theme::focus(&response); | |
| 552 | 삭제: if response.changed() { | |
| 553 | 삭제: self.model.selected = if all { | |
| 554 | 삭제: selectable.clone() | |
| 555 | 삭제: } else { | |
| 556 | 삭제: BTreeSet::new() | |
| 557 | 삭제: }; | |
| 558 | 삭제: } | |
| 559 | 삭제: theme::column_label(ui, RichText::new("이름").strong(), widths, Align::Min); | |
| 560 | 삭제: theme::column_label(ui, "크기", 96.0, Align::Max); | |
| 561 | 삭제: theme::column_label(ui, "암호", 64.0, Align::Min); | |
| 562 | 삭제: }); | |
| 563 | 삭제: ui.separator(); | |
| 564 | 삭제: if self.model.entries.is_empty() { | |
| 565 | 삭제: ui.vertical_centered(|ui| { | |
| 566 | 삭제: ui.add_space(theme::SPACE * 8.0); | |
| 567 | 삭제: ui.label(if self.model.list_id.is_some() { | |
| 568 | 삭제: "이 압축파일은 비어 있습니다" | |
| 569 | 삭제: } else { | |
| 570 | 삭제: "압축파일을 읽는 중" | |
| 571 | 삭제: }); | |
| 572 | 삭제: }); | |
| 644 | 추가: let mut all = !visible.is_empty() && visible.is_subset(&self.model.selected); | |
| 645 | 추가: let name_width = (ui.available_width() - 32.0 - 96.0 - 64.0 - 64.0).max(160.0); | |
| 646 | 추가: ui.horizontal(|ui| { | |
| 647 | 추가: ui.add_space(16.0); | |
| 648 | 추가: let check = ui | |
| 649 | 추가: .add_enabled( | |
| 650 | 추가: !self.model.busy() && !visible.is_empty(), | |
| 651 | 추가: egui::Checkbox::without_text(&mut all), | |
| 652 | 추가: ) | |
| 653 | 추가: .on_hover_text("전체 선택"); | |
| 654 | 추가: if check.changed() { | |
| 655 | 추가: if all { | |
| 656 | 추가: self.model.selected.extend(&visible); | |
| 573 | 657 | } else { |
| 574 | 삭제: egui::ScrollArea::vertical() | |
| 575 | 삭제: .id_salt("archive-rows") | |
| 576 | 삭제: .auto_shrink([false, false]) | |
| 577 | 삭제: .show_rows(ui, theme::ROW, self.model.entries.len(), |ui, rows| { | |
| 578 | 삭제: for index in rows { | |
| 579 | 삭제: let entry = &self.model.entries[index]; | |
| 580 | 삭제: let enabled = !self.model.busy() | |
| 581 | 삭제: && matches!(entry.kind, Kind::File | Kind::Directory); | |
| 582 | 삭제: let mut selected = self.model.selected.contains(&entry.id); | |
| 583 | 삭제: let width = ui.available_width(); | |
| 584 | 삭제: let (rect, row) = ui.allocate_exact_size( | |
| 585 | 삭제: egui::vec2(width, theme::ROW), | |
| 586 | 삭제: if enabled { | |
| 587 | 삭제: egui::Sense::click() | |
| 588 | 삭제: } else { | |
| 589 | 삭제: egui::Sense::hover() | |
| 590 | 삭제: }, | |
| 591 | 삭제: ); | |
| 592 | 삭제: ui.painter().rect_filled( | |
| 593 | 삭제: rect, | |
| 594 | 삭제: 0, | |
| 595 | 삭제: if selected { | |
| 596 | 삭제: theme::SELECTED | |
| 597 | 삭제: } else if index % 2 == 0 { | |
| 598 | 삭제: theme::PANEL | |
| 599 | 삭제: } else { | |
| 600 | 삭제: theme::STRIPE | |
| 601 | 삭제: }, | |
| 602 | 삭제: ); | |
| 603 | 삭제: let mut changed = false; | |
| 604 | 삭제: ui.scope_builder( | |
| 605 | 삭제: egui::UiBuilder::new() | |
| 606 | 삭제: .max_rect(rect) | |
| 607 | 삭제: .layout(Layout::left_to_right(Align::Center)), | |
| 658 | 추가: self.model.selected.retain(|id| !visible.contains(id)); | |
| 659 | 추가: } | |
| 660 | 추가: } | |
| 661 | 추가: theme::focus(&check); | |
| 662 | 추가: theme::column_label(ui, RichText::new("이름").strong(), name_width, Align::Min); | |
| 663 | 추가: theme::column_label(ui, "크기", 96.0, Align::Max); | |
| 664 | 추가: theme::column_label(ui, "암호", 64.0, Align::Min); | |
| 665 | 추가: }); | |
| 666 | 추가: ui.separator(); | |
| 667 | 추가: egui::ScrollArea::vertical() | |
| 668 | 추가: .id_salt("archive-rows") | |
| 669 | 추가: .auto_shrink([false, false]) | |
| 670 | 추가: .show_rows(ui, 38.0, rows.len(), |ui, range| { | |
| 671 | 추가: for index in range { | |
| 672 | 추가: let row = &rows[index]; | |
| 673 | 추가: let mut selected = | |
| 674 | 추가: !row.ids.is_empty() && row.ids.is_subset(&self.model.selected); | |
| 675 | 추가: let response = ui | |
| 676 | 추가: .horizontal(|ui| { | |
| 677 | 추가: ui.set_min_height(36.0); | |
| 678 | 추가: ui.add_space(16.0); | |
| 679 | 추가: let check = ui.add_enabled( | |
| 680 | 추가: !self.model.busy() && !row.ids.is_empty(), | |
| 681 | 추가: egui::Checkbox::without_text(&mut selected), | |
| 682 | 추가: ); | |
| 683 | 추가: check.widget_info(|| { | |
| 684 | 추가: egui::WidgetInfo::selected( | |
| 685 | 추가: egui::Role::CheckBox, | |
| 686 | 추가: !self.model.busy(), | |
| 687 | 추가: selected, | |
| 688 | 추가: &row.name, | |
| 689 | 추가: ) | |
| 690 | 추가: }); | |
| 691 | 추가: theme::focus(&check); | |
| 692 | 추가: if check.changed() { | |
| 693 | 추가: if selected { | |
| 694 | 추가: self.model.selected.extend(&row.ids); | |
| 695 | 추가: } else { | |
| 696 | 추가: self.model.selected.retain(|id| !row.ids.contains(id)); | |
| 697 | 추가: } | |
| 698 | 추가: } | |
| 699 | 추가: theme::icon( | |
| 700 | 추가: ui, | |
| 701 | 추가: if row.directory { | |
| 702 | 추가: Icon::Folder | |
| 703 | 추가: } else { | |
| 704 | 추가: Icon::File | |
| 705 | 추가: }, | |
| 706 | 추가: 20.0, | |
| 707 | 추가: ); | |
| 708 | 추가: let label = ui | |
| 709 | 추가: .allocate_ui_with_layout( | |
| 710 | 추가: egui::vec2(name_width - 28.0, 34.0), | |
| 711 | 추가: Layout::left_to_right(Align::Center), | |
| 608 | 712 | |ui| { |
| 609 | 삭제: let check = ui.add_enabled( | |
| 610 | 삭제: enabled, | |
| 611 | 삭제: egui::Checkbox::without_text(&mut selected), | |
| 612 | 삭제: ); | |
| 613 | 삭제: check.widget_info(|| { | |
| 614 | 삭제: egui::WidgetInfo::selected( | |
| 615 | 삭제: egui::Role::CheckBox, | |
| 616 | 삭제: enabled, | |
| 617 | 삭제: selected, | |
| 618 | 삭제: &entry.name, | |
| 619 | 삭제: ) | |
| 620 | 삭제: }); | |
| 621 | 삭제: theme::focus(&check); | |
| 622 | 삭제: changed = check.changed(); | |
| 623 | 삭제: ui.allocate_ui_with_layout( | |
| 624 | 삭제: egui::vec2(widths, theme::ROW), | |
| 625 | 삭제: Layout::left_to_right(Align::Center), | |
| 626 | 삭제: |ui| { | |
| 627 | 삭제: ui.set_min_width(widths); | |
| 628 | 삭제: theme::icon( | |
| 629 | 삭제: ui, | |
| 630 | 삭제: if entry.kind == Kind::Directory { | |
| 631 | 삭제: Icon::Folder | |
| 632 | 삭제: } else { | |
| 633 | 삭제: Icon::File | |
| 634 | 삭제: }, | |
| 635 | 삭제: 20.0, | |
| 636 | 삭제: ); | |
| 637 | 삭제: let name = if matches!( | |
| 638 | 삭제: entry.kind, | |
| 639 | 삭제: Kind::Link | Kind::Other | |
| 640 | 삭제: ) { | |
| 641 | 삭제: format!("{} (링크)", entry.name) | |
| 642 | 삭제: } else { | |
| 643 | 삭제: entry.name.clone() | |
| 644 | 삭제: }; | |
| 645 | 삭제: let limit = ((widths - 32.0) / theme::BODY).max(8.0) | |
| 646 | 삭제: as usize; | |
| 647 | 삭제: ui.label(present::middle_text(&name, limit)); | |
| 648 | 삭제: }, | |
| 649 | 삭제: ); | |
| 650 | 삭제: ui.allocate_ui_with_layout( | |
| 651 | 삭제: egui::vec2(96.0, theme::ROW), | |
| 652 | 삭제: Layout::right_to_left(Align::Center), | |
| 653 | 삭제: |ui| { | |
| 654 | 삭제: ui.set_min_width(96.0); | |
| 655 | 삭제: ui.label(entry.bytes.map_or_else( | |
| 656 | 삭제: || "알 수 없음".into(), | |
| 657 | 삭제: present::bytes_text, | |
| 658 | 삭제: )); | |
| 659 | 삭제: }, | |
| 660 | 삭제: ); | |
| 661 | 삭제: ui.allocate_ui_with_layout( | |
| 662 | 삭제: egui::vec2(64.0, theme::ROW), | |
| 663 | 삭제: Layout::left_to_right(Align::Center), | |
| 664 | 삭제: |ui| { | |
| 665 | 삭제: ui.set_min_width(64.0); | |
| 666 | 삭제: if entry.encrypted { | |
| 667 | 삭제: theme::icon(ui, Icon::Lock, 16.0); | |
| 668 | 삭제: ui.label("있음"); | |
| 669 | 삭제: } | |
| 670 | 삭제: }, | |
| 671 | 삭제: ); | |
| 672 | 삭제: }, | |
| 673 | 삭제: ); | |
| 674 | 삭제: row.widget_info(|| { | |
| 675 | 삭제: egui::WidgetInfo::selected( | |
| 676 | 삭제: egui::Role::Button, | |
| 677 | 삭제: enabled, | |
| 678 | 삭제: selected, | |
| 679 | 삭제: &entry.name, | |
| 680 | 삭제: ) | |
| 681 | 삭제: }); | |
| 682 | 삭제: row.clone().on_hover_text(&entry.name); | |
| 683 | 삭제: theme::focus(&row); | |
| 684 | 삭제: let content = ui.interact( | |
| 685 | 삭제: egui::Rect::from_min_max( | |
| 686 | 삭제: rect.min + egui::vec2(32.0, 0.0), | |
| 687 | 삭제: rect.max, | |
| 688 | 삭제: ), | |
| 689 | 삭제: row.id.with("content"), | |
| 690 | 삭제: if enabled { | |
| 691 | 삭제: egui::Sense::CLICK | |
| 692 | 삭제: } else { | |
| 693 | 삭제: egui::Sense::hover() | |
| 713 | 추가: ui.set_min_width(name_width - 28.0); | |
| 714 | 추가: ui.add_enabled( | |
| 715 | 추가: !self.model.busy(), | |
| 716 | 추가: egui::Button::new(&row.name) | |
| 717 | 추가: .selected(selected) | |
| 718 | 추가: .frame(false) | |
| 719 | 추가: .min_size(egui::vec2(0.0, 34.0)), | |
| 720 | 추가: ) | |
| 694 | 721 | }, |
| 695 | 삭제: ); | |
| 696 | 삭제: if enabled && !changed && (row.clicked() || content.clicked()) { | |
| 697 | 삭제: selected = !selected; | |
| 698 | 삭제: changed = true; | |
| 699 | 삭제: } | |
| 700 | 삭제: if changed { | |
| 701 | 삭제: if selected { | |
| 702 | 삭제: self.model.selected.insert(entry.id); | |
| 703 | 삭제: } else { | |
| 704 | 삭제: self.model.selected.remove(&entry.id); | |
| 705 | 삭제: } | |
| 722 | 추가: ) | |
| 723 | 추가: .inner; | |
| 724 | 추가: theme::focus(&label); | |
| 725 | 추가: let enter = | |
| 726 | 추가: label.has_focus() && ui.input(|i| i.key_pressed(egui::Key::Enter)); | |
| 727 | 추가: if row.directory && (label.double_clicked() || enter) { | |
| 728 | 추가: self.browse_folder(&row.path); | |
| 729 | 추가: } else if !row.directory && label.clicked() { | |
| 730 | 추가: if selected { | |
| 731 | 추가: self.model.selected.retain(|id| !row.ids.contains(id)); | |
| 732 | 추가: } else { | |
| 733 | 추가: self.model.selected.extend(&row.ids); | |
| 706 | 734 | } |
| 707 | 735 | } |
| 708 | 삭제: }); | |
| 736 | 추가: theme::column_label( | |
| 737 | 추가: ui, | |
| 738 | 추가: if row.directory { | |
| 739 | 추가: "0 B".into() | |
| 740 | 추가: } else { | |
| 741 | 추가: row.bytes | |
| 742 | 추가: .map(present::bytes_text) | |
| 743 | 추가: .unwrap_or_else(|| "—".into()) | |
| 744 | 추가: }, | |
| 745 | 추가: 96.0, | |
| 746 | 추가: Align::Max, | |
| 747 | 추가: ); | |
| 748 | 추가: if row.encrypted { | |
| 749 | 추가: theme::icon(ui, Icon::Lock, 16.0); | |
| 750 | 추가: } | |
| 751 | 추가: }) | |
| 752 | 추가: .response; | |
| 753 | 추가: ui.painter().hline( | |
| 754 | 추가: response.rect.x_range(), | |
| 755 | 추가: response.rect.bottom(), | |
| 756 | 추가: egui::Stroke::new(1.0, theme::BORDER), | |
| 757 | 추가: ); | |
| 709 | 758 | } |
| 710 | 759 | }); |
| 760 | 추가: if rows.is_empty() { | |
| 761 | 추가: ui.centered_and_justified(|ui| { | |
| 762 | 추가: ui.label(if self.search.is_empty() { | |
| 763 | 추가: "이 폴더는 비어 있습니다" | |
| 764 | 추가: } else { | |
| 765 | 추가: "일치하는 항목이 없습니다" | |
| 766 | 추가: }); | |
| 767 | 추가: }); | |
| 768 | 추가: } | |
| 711 | 769 | } |
| 712 | 770 | |
| 713 | 771 | fn result_visible(&self) -> bool { |
| @@ -729,53 +787,6 @@ impl ArchiveApp { | ||
| 729 | 787 | self.progress(ui); |
| 730 | 788 | } else if self.result_visible() { |
| 731 | 789 | self.result(ui); |
| 732 | 삭제: } else if self.model.list_id.is_some() { | |
| 733 | 삭제: ui.horizontal(|ui| { | |
| 734 | 삭제: ui.strong("풀 위치"); | |
| 735 | 삭제: let width = ui.available_width() - 136.0; | |
| 736 | 삭제: theme::column_label( | |
| 737 | 삭제: ui, | |
| 738 | 삭제: present::middle_text( | |
| 739 | 삭제: &self.destination.display().to_string(), | |
| 740 | 삭제: (width / theme::BODY).max(10.0) as usize, | |
| 741 | 삭제: ), | |
| 742 | 삭제: width, | |
| 743 | 삭제: Align::Min, | |
| 744 | 삭제: ) | |
| 745 | 삭제: .on_hover_text(self.destination.display().to_string()); | |
| 746 | 삭제: if theme::action(ui, "폴더 바꾸기", false, true).clicked() { | |
| 747 | 삭제: self.open_picker(Purpose::Destination); | |
| 748 | 삭제: } | |
| 749 | 삭제: }); | |
| 750 | 삭제: if self | |
| 751 | 삭제: .model | |
| 752 | 삭제: .list_id | |
| 753 | 삭제: .as_ref() | |
| 754 | 삭제: .is_some_and(|id| id.format == Format::Gzip) | |
| 755 | 삭제: { | |
| 756 | 삭제: ui.horizontal(|ui| { | |
| 757 | 삭제: ui.label("저장할 파일 이름"); | |
| 758 | 삭제: let edit = ui.add( | |
| 759 | 삭제: egui::TextEdit::singleline(&mut self.gzip_name) | |
| 760 | 삭제: .id(egui::Id::unique("gzip-name")), | |
| 761 | 삭제: ); | |
| 762 | 삭제: theme::focus(&edit); | |
| 763 | 삭제: }); | |
| 764 | 삭제: } | |
| 765 | 삭제: ui.horizontal(|ui| { | |
| 766 | 삭제: let response = ui.checkbox(&mut self.selected_only, "선택한 항목만 풀기"); | |
| 767 | 삭제: theme::focus(&response); | |
| 768 | 삭제: ui.with_layout(Layout::right_to_left(Align::Center), |ui| { | |
| 769 | 삭제: let enabled = self.model.can_extract() | |
| 770 | 삭제: && (!self.selected_only || !self.model.selected.is_empty()); | |
| 771 | 삭제: if theme::action(ui, "풀기", true, enabled) | |
| 772 | 삭제: .on_disabled_hover_text("풀 항목을 선택하세요") | |
| 773 | 삭제: .clicked() | |
| 774 | 삭제: { | |
| 775 | 삭제: self.begin_extract(); | |
| 776 | 삭제: } | |
| 777 | 삭제: }); | |
| 778 | 삭제: }); | |
| 779 | 790 | } |
| 780 | 791 | if let Some(error) = &self.ui_error { |
| 781 | 792 | ui.colored_label(theme::ERROR, error); |
| @@ -1076,64 +1087,82 @@ impl ArchiveApp { | ||
| 1076 | 1087 | } |
| 1077 | 1088 | |
| 1078 | 1089 | fn create_dialog(&mut self, ctx: &egui::Context) { |
| 1079 | 삭제: let mut create = false; | |
| 1090 | 추가: let mut compress = false; | |
| 1080 | 1091 | let mut pick = None; |
| 1092 | 추가: let mut cancel = false; | |
| 1081 | 1093 | let modal = egui::Modal::new(egui::Id::unique("create-zip")).show(ctx, |ui| { |
| 1082 | 삭제: ui.set_width((ctx.content_rect().width() - 64.0).min(560.0)); | |
| 1083 | 삭제: ui.heading("ZIP 만들기"); | |
| 1094 | 추가: ui.set_width((ctx.content_rect().width() - 64.0).min(600.0)); | |
| 1095 | 추가: ui.horizontal(|ui| { | |
| 1096 | 추가: ui.heading("ZIP 만들기"); | |
| 1097 | 추가: ui.with_layout(Layout::right_to_left(Align::Center), |ui| { | |
| 1098 | 추가: let close = theme::icon_button(ui, "닫기", theme::CLOSE, true); | |
| 1099 | 추가: theme::focus(&close); | |
| 1100 | 추가: cancel = close.clicked(); | |
| 1101 | 추가: }); | |
| 1102 | 추가: }); | |
| 1084 | 1103 | egui::ScrollArea::vertical() |
| 1085 | 1104 | .id_salt("create-fields") |
| 1086 | 삭제: .scroll_bar_visibility(if ctx.content_rect().height() < 600.0 { | |
| 1087 | 삭제: egui::scroll_area::ScrollBarVisibility::AlwaysVisible | |
| 1088 | 삭제: } else { | |
| 1089 | 삭제: egui::scroll_area::ScrollBarVisibility::VisibleWhenNeeded | |
| 1090 | 삭제: }) | |
| 1091 | 삭제: .max_height((ctx.content_rect().height() - 200.0).max(240.0)) | |
| 1105 | 추가: .max_height((ctx.content_rect().height() - 180.0).max(180.0)) | |
| 1092 | 1106 | .show(ui, |ui| { |
| 1093 | 삭제: ui.strong("1. 묶을 파일과 폴더"); | |
| 1094 | 삭제: let mut remove = None; | |
| 1095 | 삭제: theme::panel(theme::STRIPE).show(ui, |ui| { | |
| 1096 | 삭제: egui::ScrollArea::vertical() | |
| 1097 | 삭제: .id_salt("zip-sources") | |
| 1098 | 삭제: .max_height(128.0) | |
| 1099 | 삭제: .show(ui, |ui| { | |
| 1100 | 삭제: if self.sources.is_empty() { | |
| 1101 | 삭제: ui.label("여기에 파일이나 폴더를 끌어 놓으세요"); | |
| 1102 | 삭제: } | |
| 1103 | 삭제: for (index, path) in self.sources.iter().enumerate() { | |
| 1104 | 삭제: ui.horizontal(|ui| { | |
| 1105 | 삭제: theme::icon( | |
| 1106 | 삭제: ui, | |
| 1107 | 삭제: if path.is_dir() { | |
| 1108 | 삭제: Icon::Folder | |
| 1109 | 삭제: } else { | |
| 1110 | 삭제: Icon::File | |
| 1111 | 삭제: }, | |
| 1112 | 삭제: 20.0, | |
| 1113 | 삭제: ); | |
| 1114 | 삭제: theme::column_label( | |
| 1115 | 삭제: ui, | |
| 1116 | 삭제: present::middle_text( | |
| 1117 | 삭제: &path | |
| 1118 | 삭제: .file_name() | |
| 1119 | 삭제: .unwrap_or_default() | |
| 1120 | 삭제: .to_string_lossy(), | |
| 1121 | 삭제: 28, | |
| 1122 | 삭제: ), | |
| 1123 | 삭제: ui.available_width() - 80.0, | |
| 1124 | 삭제: Align::Min, | |
| 1125 | 삭제: ) | |
| 1126 | 삭제: .on_hover_text(path.display().to_string()); | |
| 1127 | 삭제: if theme::action(ui, "빼기", false, true).clicked() { | |
| 1128 | 삭제: remove = Some(index); | |
| 1129 | 삭제: } | |
| 1130 | 삭제: }); | |
| 1131 | 삭제: } | |
| 1107 | 추가: ui.add_space(16.0); | |
| 1108 | 추가: let frame = theme::panel(theme::STRIPE) | |
| 1109 | 추가: .stroke(egui::Stroke::new(1.0, theme::DASH)) | |
| 1110 | 추가: .inner_margin(egui::Margin::same(24)); | |
| 1111 | 추가: let area = frame | |
| 1112 | 추가: .show(ui, |ui| { | |
| 1113 | 추가: ui.set_min_size(egui::vec2(ui.available_width(), 144.0)); | |
| 1114 | 추가: ui.vertical_centered(|ui| { | |
| 1115 | 추가: theme::icon(ui, Icon::File, 44.0); | |
| 1116 | 추가: ui.add_space(16.0); | |
| 1117 | 추가: ui.label( | |
| 1118 | 추가: RichText::new("파일이나 폴더를 여기에 끌어 놓으세요") | |
| 1119 | 추가: .size(18.0), | |
| 1120 | 추가: ); | |
| 1132 | 1121 | }); |
| 1122 | 추가: }) | |
| 1123 | 추가: .response; | |
| 1124 | 추가: let drop = ui.interact( | |
| 1125 | 추가: area.rect, | |
| 1126 | 추가: egui::Id::unique("zip-source-drop"), | |
| 1127 | 추가: egui::Sense::click(), | |
| 1128 | 추가: ); | |
| 1129 | 추가: theme::focus(&drop); | |
| 1130 | 추가: drop.widget_info(|| { | |
| 1131 | 추가: egui::WidgetInfo::labeled(egui::Role::Button, true, "파일 추가") | |
| 1133 | 1132 | }); |
| 1134 | 삭제: if let Some(index) = remove { | |
| 1135 | 삭제: self.sources.remove(index); | |
| 1133 | 추가: if drop.clicked() { | |
| 1134 | 추가: pick = Some(Purpose::Files); | |
| 1136 | 1135 | } |
| 1136 | 추가: egui::ScrollArea::vertical() | |
| 1137 | 추가: .id_salt("zip-sources") | |
| 1138 | 추가: .max_height(86.0) | |
| 1139 | 추가: .show(ui, |ui| { | |
| 1140 | 추가: let mut remove = None; | |
| 1141 | 추가: for (index, path) in self.sources.iter().enumerate() { | |
| 1142 | 추가: ui.horizontal(|ui| { | |
| 1143 | 추가: theme::icon( | |
| 1144 | 추가: ui, | |
| 1145 | 추가: if path.is_dir() { | |
| 1146 | 추가: Icon::Folder | |
| 1147 | 추가: } else { | |
| 1148 | 추가: Icon::File | |
| 1149 | 추가: }, | |
| 1150 | 추가: 20.0, | |
| 1151 | 추가: ); | |
| 1152 | 추가: ui.label(present::middle_text( | |
| 1153 | 추가: &path.file_name().unwrap_or_default().to_string_lossy(), | |
| 1154 | 추가: 36, | |
| 1155 | 추가: )) | |
| 1156 | 추가: .on_hover_text(path.display().to_string()); | |
| 1157 | 추가: if ui.button("빼기").clicked() { | |
| 1158 | 추가: remove = Some(index); | |
| 1159 | 추가: } | |
| 1160 | 추가: }); | |
| 1161 | 추가: } | |
| 1162 | 추가: if let Some(index) = remove { | |
| 1163 | 추가: self.sources.remove(index); | |
| 1164 | 추가: } | |
| 1165 | 추가: }); | |
| 1137 | 1166 | ui.horizontal(|ui| { |
| 1138 | 1167 | if theme::action(ui, "파일 추가", false, true).clicked() { |
| 1139 | 1168 | pick = Some(Purpose::Files); |
| @@ -1142,61 +1171,33 @@ impl ArchiveApp { | ||
| 1142 | 1171 | pick = Some(Purpose::Folder); |
| 1143 | 1172 | } |
| 1144 | 1173 | }); |
| 1145 | 삭제: ui.add_space(theme::SPACE); | |
| 1146 | 삭제: ui.strong("2. 저장 위치"); | |
| 1174 | 추가: ui.add_space(16.0); | |
| 1147 | 1175 | ui.horizontal(|ui| { |
| 1148 | 삭제: ui.label("이름"); | |
| 1149 | 삭제: let edit = ui.add( | |
| 1150 | 삭제: egui::TextEdit::singleline(&mut self.zip_name) | |
| 1151 | 삭제: .id(egui::Id::unique("zip-name")) | |
| 1152 | 삭제: .desired_width(ui.available_width()), | |
| 1153 | 삭제: ); | |
| 1154 | 삭제: theme::focus(&edit); | |
| 1176 | 추가: theme::icon(ui, Icon::Lock, 24.0); | |
| 1177 | 추가: ui.strong("암호화"); | |
| 1155 | 1178 | }); |
| 1179 | 추가: let check = ui.checkbox(&mut self.aes256, "암호로 보호하기"); | |
| 1180 | 추가: theme::focus(&check); | |
| 1156 | 1181 | if let Some(error) = &self.ui_error { |
| 1157 | 1182 | ui.colored_label(theme::ERROR, error); |
| 1158 | 1183 | } |
| 1159 | 삭제: ui.horizontal(|ui| { | |
| 1160 | 삭제: ui.label("폴더"); | |
| 1161 | 삭제: theme::column_label( | |
| 1162 | 삭제: ui, | |
| 1163 | 삭제: present::middle_text(&self.zip_folder.display().to_string(), 30), | |
| 1164 | 삭제: ui.available_width() - 136.0, | |
| 1165 | 삭제: Align::Min, | |
| 1166 | 삭제: ) | |
| 1167 | 삭제: .on_hover_text(self.zip_folder.display().to_string()); | |
| 1168 | 삭제: if theme::action(ui, "폴더 바꾸기", false, true).clicked() { | |
| 1169 | 삭제: pick = Some(Purpose::ZipFolder); | |
| 1170 | 삭제: } | |
| 1171 | 삭제: }); | |
| 1172 | 삭제: ui.add_space(theme::SPACE); | |
| 1173 | 삭제: ui.strong("3. 보호"); | |
| 1174 | 삭제: let response = ui.checkbox(&mut self.aes256, "암호로 보호하기"); | |
| 1175 | 삭제: theme::focus(&response); | |
| 1176 | 삭제: ui.collapsing("자세한 설정", |ui| { | |
| 1177 | 삭제: ui.radio_value(&mut self.method, Method::Deflate, "작게 압축(기본)"); | |
| 1178 | 삭제: ui.radio_value(&mut self.method, Method::Store, "빠르게 묶기"); | |
| 1179 | 삭제: }); | |
| 1184 | 추가: ui.add_space(16.0); | |
| 1180 | 1185 | }); |
| 1181 | 삭제: ui.separator(); | |
| 1182 | 삭제: let can_create = !self.sources.is_empty() && !self.zip_name.is_empty(); | |
| 1183 | 삭제: let (cancel, confirm) = theme::action_pair(ui, "취소", Some(("만들기", can_create))); | |
| 1184 | 삭제: if cancel { | |
| 1185 | 삭제: self.create = false; | |
| 1186 | 삭제: self.ui_error = None; | |
| 1187 | 삭제: return; | |
| 1188 | 삭제: } | |
| 1189 | 삭제: create = confirm; | |
| 1186 | 추가: let (dismiss, confirm) = | |
| 1187 | 추가: theme::action_pair(ui, "취소", Some(("압축하기", !self.sources.is_empty()))); | |
| 1188 | 추가: cancel |= dismiss; | |
| 1189 | 추가: compress = confirm; | |
| 1190 | 1190 | }); |
| 1191 | 삭제: if !self.create || modal.should_close() { | |
| 1191 | 추가: if cancel || modal.should_close() { | |
| 1192 | 1192 | self.create = false; |
| 1193 | 추가: self.ui_error = None; | |
| 1193 | 1194 | return; |
| 1194 | 1195 | } |
| 1195 | 1196 | if let Some(purpose) = pick { |
| 1196 | 1197 | self.open_picker(purpose); |
| 1197 | 1198 | } |
| 1198 | 삭제: if create { | |
| 1199 | 삭제: self.begin_zip(); | |
| 1199 | 추가: if compress { | |
| 1200 | 추가: self.open_picker(Purpose::SaveZip); | |
| 1200 | 1201 | } |
| 1201 | 1202 | } |
| 1202 | 1203 |
| @@ -18,7 +18,7 @@ pub const WARNING: Color32 = Color32::from_rgb(180, 83, 9); | ||
| 18 | 18 | pub const WARNING_BG: Color32 = Color32::from_rgb(255, 247, 232); |
| 19 | 19 | pub const ERROR: Color32 = Color32::from_rgb(185, 28, 28); |
| 20 | 20 | pub const ERROR_BG: Color32 = Color32::from_rgb(253, 237, 237); |
| 21 | 삭제: pub const FOLDER: Color32 = Color32::from_rgb(224, 165, 38); | |
| 21 | 추가: pub const FOLDER: Color32 = Color32::from_rgb(240, 160, 0); | |
| 22 | 22 | pub const FILE: Color32 = Color32::from_rgb(123, 135, 148); |
| 23 | 23 | pub const SPACE: f32 = 8.0; |
| 24 | 24 | pub const PAD: i8 = 16; |
| @@ -27,7 +27,7 @@ pub const DROP_HEIGHT: f32 = 280.0; | ||
| 27 | 27 | pub const DROP_RADIUS: u8 = 12; |
| 28 | 28 | pub const ROW: f32 = 32.0; |
| 29 | 29 | pub const BUTTON: f32 = 40.0; |
| 30 | 삭제: pub const BODY: f32 = 15.0; | |
| 30 | 추가: pub const BODY: f32 = 17.0; | |
| 31 | 31 | pub const TITLE: f32 = 22.0; |
| 32 | 32 | |
| 33 | 33 | pub fn apply(ctx: &egui::Context) { |
| @@ -279,3 +279,94 @@ pub fn indeterminate(ui: &mut egui::Ui) { | ||
| 279 | 279 | ) |
| 280 | 280 | }); |
| 281 | 281 | } |
| 282 | 추가: | |
| 283 | 추가: pub const OPEN: &str = include_str!("assets/icons/open-archive.svg"); | |
| 284 | 추가: pub const CREATE: &str = include_str!("assets/icons/create-zip.svg"); | |
| 285 | 추가: pub const EXTRACT: &str = include_str!("assets/icons/extract-archive.svg"); | |
| 286 | 추가: pub const PROTECT: &str = include_str!("assets/icons/protect-zip.svg"); | |
| 287 | 추가: pub const UP: &str = include_str!("assets/icons/navigate-up.svg"); | |
| 288 | 추가: pub const CLOSE: &str = include_str!("assets/icons/close-dialog.svg"); | |
| 289 | 추가: | |
| 290 | 추가: pub fn svg_icon(painter: &egui::Painter, rect: egui::Rect, asset: &str, color: Color32) { | |
| 291 | 추가: for element in asset.split("points=\"").skip(1) { | |
| 292 | 추가: let points = element | |
| 293 | 추가: .split('"') | |
| 294 | 추가: .next() | |
| 295 | 추가: .unwrap_or_default() | |
| 296 | 추가: .split_whitespace() | |
| 297 | 추가: .filter_map(|pair| { | |
| 298 | 추가: let (x, y) = pair.split_once(',')?; | |
| 299 | 추가: Some( | |
| 300 | 추가: rect.min | |
| 301 | 추가: + egui::vec2(x.parse::<f32>().ok()?, y.parse::<f32>().ok()?) | |
| 302 | 추가: * (rect.width() / 24.0), | |
| 303 | 추가: ) | |
| 304 | 추가: }) | |
| 305 | 추가: .collect::<Vec<_>>(); | |
| 306 | 추가: painter.add(egui::Shape::line( | |
| 307 | 추가: points, | |
| 308 | 추가: Stroke::new(rect.width() / 18.0, color), | |
| 309 | 추가: )); | |
| 310 | 추가: } | |
| 311 | 추가: } | |
| 312 | 추가: | |
| 313 | 추가: pub fn tool( | |
| 314 | 추가: ui: &mut egui::Ui, | |
| 315 | 추가: label: &str, | |
| 316 | 추가: asset: &str, | |
| 317 | 추가: enabled: bool, | |
| 318 | 추가: blue: bool, | |
| 319 | 추가: ) -> egui::Response { | |
| 320 | 추가: let response = ui.add_enabled( | |
| 321 | 추가: enabled, | |
| 322 | 추가: egui::Button::new( | |
| 323 | 추가: egui::RichText::new(label) | |
| 324 | 추가: .size(18.0) | |
| 325 | 추가: .color(Color32::TRANSPARENT), | |
| 326 | 추가: ) | |
| 327 | 추가: .frame(false) | |
| 328 | 추가: .min_size(egui::vec2(108.0, 86.0)), | |
| 329 | 추가: ); | |
| 330 | 추가: let rect = response.rect; | |
| 331 | 추가: let color = if enabled { | |
| 332 | 추가: if blue { BLUE } else { TEXT } | |
| 333 | 추가: } else { | |
| 334 | 추가: MUTED | |
| 335 | 추가: }; | |
| 336 | 추가: let icon_rect = egui::Rect::from_center_size( | |
| 337 | 추가: egui::pos2(rect.center().x, rect.top() + 27.0), | |
| 338 | 추가: egui::vec2(36.0, 36.0), | |
| 339 | 추가: ); | |
| 340 | 추가: ui.painter() | |
| 341 | 추가: .rect_filled(rect.shrink2(egui::vec2(1.0, 27.0)), 0, PANEL); | |
| 342 | 추가: svg_icon(ui.painter(), icon_rect, asset, color); | |
| 343 | 추가: ui.painter().text( | |
| 344 | 추가: egui::pos2(rect.center().x, rect.bottom() - 15.0), | |
| 345 | 추가: egui::Align2::CENTER_CENTER, | |
| 346 | 추가: label, | |
| 347 | 추가: FontId::proportional(18.0), | |
| 348 | 추가: color, | |
| 349 | 추가: ); | |
| 350 | 추가: focus(&response); | |
| 351 | 추가: response | |
| 352 | 추가: } | |
| 353 | 추가: | |
| 354 | 추가: pub const SEARCH: &str = include_str!("assets/icons/search-files.svg"); | |
| 355 | 추가: | |
| 356 | 추가: pub fn icon_button(ui: &mut egui::Ui, name: &str, asset: &str, enabled: bool) -> egui::Response { | |
| 357 | 추가: let response = ui | |
| 358 | 추가: .add_enabled( | |
| 359 | 추가: enabled, | |
| 360 | 추가: egui::Button::new("").min_size(egui::vec2(38.0, 36.0)), | |
| 361 | 추가: ) | |
| 362 | 추가: .on_hover_text(name); | |
| 363 | 추가: response.widget_info(|| egui::WidgetInfo::labeled(egui::Role::Button, enabled, name)); | |
| 364 | 추가: svg_icon( | |
| 365 | 추가: ui.painter(), | |
| 366 | 추가: egui::Rect::from_center_size(response.rect.center(), egui::vec2(22.0, 22.0)), | |
| 367 | 추가: asset, | |
| 368 | 추가: if enabled { TEXT } else { MUTED }, | |
| 369 | 추가: ); | |
| 370 | 추가: focus(&response); | |
| 371 | 추가: response | |
| 372 | 추가: } |
| @@ -0,0 +1 @@ | ||
| 1 | 추가: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><polyline points="4,4 20,20"/><polyline points="20,4 4,20"/></svg> |
| @@ -0,0 +1 @@ | ||
| 1 | 추가: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><polyline points="14,3 5,3 5,21 16,21"/><polyline points="14,3 20,9 14,9 14,3"/><polyline points="20,14 20,22"/><polyline points="16,18 24,18"/></svg> |
| @@ -0,0 +1 @@ | ||
| 1 | 추가: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><polyline points="12,2 12,16"/><polyline points="6,10 12,16 18,10"/><polyline points="3,16 3,22 21,22 21,16"/></svg> |
| @@ -0,0 +1 @@ | ||
| 1 | 추가: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><polyline points="5,10 12,3 19,10"/><polyline points="12,3 12,22"/></svg> |
| @@ -0,0 +1 @@ | ||
| 1 | 추가: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><polyline points="3,8 3,4 10,4 13,7 21,7 19,20 3,20 3,8 21,8"/></svg> |
| @@ -0,0 +1 @@ | ||
| 1 | 추가: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><polyline points="6,10 6,22 20,22 20,10 6,10"/><polyline points="9,10 9,5 11,2 15,2 18,5 18,10"/></svg> |
| @@ -0,0 +1 @@ | ||
| 1 | 추가: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><polyline points="16,16 23,23"/><polyline points="18,10 17,5 13,2 7,2 3,5 2,10 4,15 9,18 14,17 18,13 18,10"/></svg> |
| @@ -14,7 +14,8 @@ pub mod archive_process; | ||
| 14 | 14 | |
| 15 | 15 | pub mod archive_present; |
| 16 | 16 | |
| 17 | 추가: pub mod archive_browser; | |
| 17 | 18 | #[cfg(feature = "ui")] |
| 18 | 삭제: pub mod archive_picker; | |
| 19 | 추가: pub mod archive_dialog; | |
| 19 | 20 | #[cfg(feature = "ui")] |
| 20 | 21 | pub mod archive_theme; |
| @@ -156,19 +156,28 @@ fn completed(model: &Model) { | ||
| 156 | 156 | ); |
| 157 | 157 | } |
| 158 | 158 | #[cfg(feature = "ui")] |
| 159 | 추가: #[path = "../rust-app-ui/dialogs.rs"] | |
| 160 | 추가: mod dialogs; | |
| 161 | 추가: #[cfg(feature = "ui")] | |
| 159 | 162 | mod screen { |
| 163 | 추가: use super::dialogs::TestDialogs; | |
| 160 | 164 | use super::*; |
| 161 | 165 | use eframe::egui::{self, epaint::Shape}; |
| 162 | 166 | use zipelo_ui_memory_app::archive_screen::ArchiveApp; |
| 163 | 167 | struct Screen { |
| 164 | 168 | context: egui::Context, |
| 165 | 169 | app: ArchiveApp, |
| 170 | 추가: dialogs: TestDialogs, | |
| 166 | 171 | } |
| 167 | 172 | impl Screen { |
| 168 | 173 | fn new(factory: ObservedFactory) -> Self { |
| 174 | 추가: let dialogs = TestDialogs::default(); | |
| 175 | 추가: let mut app = ArchiveApp::new(Box::new(factory), None, false); | |
| 176 | 추가: app.set_dialogs(Box::new(dialogs.clone())); | |
| 169 | 177 | Self { |
| 170 | 178 | context: egui::Context::default(), |
| 171 | 삭제: app: ArchiveApp::new(Box::new(factory), None, false), | |
| 179 | 추가: app, | |
| 180 | 추가: dialogs, | |
| 172 | 181 | } |
| 173 | 182 | } |
| 174 | 183 | fn render(&mut self, events: Vec<egui::Event>) -> Vec<(String, egui::Pos2)> { |
| @@ -235,6 +244,10 @@ mod screen { | ||
| 235 | 244 | self.click_at(point); |
| 236 | 245 | } |
| 237 | 246 | fn set_text(&mut self, id: &str, value: &str) { |
| 247 | 추가: if id == "zip-name" { | |
| 248 | 추가: self.dialogs.0.borrow_mut().save_name = Some(value.to_owned()); | |
| 249 | 추가: return; | |
| 250 | 추가: } | |
| 238 | 251 | self.render(vec![]); |
| 239 | 252 | let point = self |
| 240 | 253 | .context |
| @@ -281,7 +294,12 @@ mod screen { | ||
| 281 | 294 | } |
| 282 | 295 | fn extract(&mut self, destination: &Path) { |
| 283 | 296 | self.app.choose_destination(destination.to_path_buf()); |
| 284 | 삭제: self.click("풀기"); | |
| 297 | 추가: self.dialogs | |
| 298 | 추가: .0 | |
| 299 | 추가: .borrow_mut() | |
| 300 | 추가: .answers | |
| 301 | 추가: .push_back(Some(vec![destination.to_path_buf()])); | |
| 302 | 추가: self.click("압축해제"); | |
| 285 | 303 | assert!(self.app.model.busy()); |
| 286 | 304 | self.settle(); |
| 287 | 305 | assert_eq!( |
| @@ -368,7 +386,7 @@ mod screen { | ||
| 368 | 386 | let mut screen = Screen::new(factory); |
| 369 | 387 | screen.app.add_sources(vec![source]); |
| 370 | 388 | screen.render(vec![]); |
| 371 | 삭제: screen.click("만들기"); | |
| 389 | 추가: screen.click("압축하기"); | |
| 372 | 390 | screen.settle(); |
| 373 | 391 | assert!(archive.is_file()); |
| 374 | 392 | screen.open(&archive); |
| @@ -411,7 +429,7 @@ mod screen { | ||
| 411 | 429 | screen.app.add_sources(vec![source.clone()]); |
| 412 | 430 | screen.render(vec![]); |
| 413 | 431 | screen.set_text("zip-name", archive.file_name().unwrap().to_str().unwrap()); |
| 414 | 삭제: screen.click("만들기"); | |
| 432 | 추가: screen.click("압축하기"); | |
| 415 | 433 | assert!(screen.app.model.busy()); |
| 416 | 434 | screen.settle(); |
| 417 | 435 | assert!(archive.is_file()); |
| @@ -449,12 +467,16 @@ fn broken_or_incomplete_worker_output_is_not_success() { | ||
| 449 | 467 | fs::copy(binary("zipelo-real-worker-probe"), &probe).unwrap(); |
| 450 | 468 | let mut factory = ProcessFactory::new(probe); |
| 451 | 469 | let mut model = Model::default(); |
| 452 | 삭제: assert!(model.begin( | |
| 453 | 삭제: Start::List { | |
| 454 | 삭제: archive: scratch.path("sample.zip") | |
| 455 | 삭제: }, | |
| 456 | 삭제: &mut factory | |
| 457 | 삭제: )); | |
| 470 | 추가: assert!( | |
| 471 | 추가: model.begin( | |
| 472 | 추가: Start::List { | |
| 473 | 추가: archive: scratch.path("sample.zip") | |
| 474 | 추가: }, | |
| 475 | 추가: &mut factory | |
| 476 | 추가: ), | |
| 477 | 추가: "{:?}", | |
| 478 | 추가: model.error | |
| 479 | 추가: ); | |
| 458 | 480 | model.request_close(); |
| 459 | 481 | model.confirm_close(); |
| 460 | 482 | assert_eq!(model.close, Close::Waiting); |
| @@ -474,12 +496,16 @@ fn dropping_live_connection_kills_and_reaps_owned_child() { | ||
| 474 | 496 | fs::copy(binary("zipelo-real-worker-probe"), &probe).unwrap(); |
| 475 | 497 | let mut factory = ProcessFactory::new(probe); |
| 476 | 498 | let mut model = Model::default(); |
| 477 | 삭제: assert!(model.begin( | |
| 478 | 삭제: Start::List { | |
| 479 | 삭제: archive: scratch.path("sample.zip") | |
| 480 | 삭제: }, | |
| 481 | 삭제: &mut factory | |
| 482 | 삭제: )); | |
| 499 | 추가: assert!( | |
| 500 | 추가: model.begin( | |
| 501 | 추가: Start::List { | |
| 502 | 추가: archive: scratch.path("sample.zip") | |
| 503 | 추가: }, | |
| 504 | 추가: &mut factory | |
| 505 | 추가: ), | |
| 506 | 추가: "{:?}", | |
| 507 | 추가: model.error | |
| 508 | 추가: ); | |
| 483 | 509 | let deadline = Instant::now() + Duration::from_secs(5); |
| 484 | 510 | while !scratch.path("probe.pid").exists() { |
| 485 | 511 | assert!(Instant::now() < deadline); |
| @@ -615,12 +641,16 @@ fn cancel_racing_child_exit_preserves_completed_result_before_poll() { | ||
| 615 | 641 | for iteration in 0..100 { |
| 616 | 642 | let mut factory = CompletedFactory(ProcessFactory::new(binary("zipelo-archive-worker"))); |
| 617 | 643 | let mut model = Model::default(); |
| 618 | 삭제: assert!(model.begin( | |
| 619 | 삭제: Start::List { | |
| 620 | 삭제: archive: archive.clone() | |
| 621 | 삭제: }, | |
| 622 | 삭제: &mut factory | |
| 623 | 삭제: )); | |
| 644 | 추가: assert!( | |
| 645 | 추가: model.begin( | |
| 646 | 추가: Start::List { | |
| 647 | 추가: archive: archive.clone() | |
| 648 | 추가: }, | |
| 649 | 추가: &mut factory | |
| 650 | 추가: ), | |
| 651 | 추가: "{:?}", | |
| 652 | 추가: model.error | |
| 653 | 추가: ); | |
| 624 | 654 | assert!(model.terminal.is_none()); |
| 625 | 655 | model.cancel(); |
| 626 | 656 | wait(&mut model); |
| @@ -637,12 +667,16 @@ fn cancel_racing_exit_without_terminal_remains_unconfirmed() { | ||
| 637 | 667 | fs::copy(binary("zipelo-real-worker-probe"), &probe).unwrap(); |
| 638 | 668 | let mut factory = ProcessFactory::new(probe); |
| 639 | 669 | let mut model = Model::default(); |
| 640 | 삭제: assert!(model.begin( | |
| 641 | 삭제: Start::List { | |
| 642 | 삭제: archive: scratch.path("sample.zip") | |
| 643 | 삭제: }, | |
| 644 | 삭제: &mut factory | |
| 645 | 삭제: )); | |
| 670 | 추가: assert!( | |
| 671 | 추가: model.begin( | |
| 672 | 추가: Start::List { | |
| 673 | 추가: archive: scratch.path("sample.zip") | |
| 674 | 추가: }, | |
| 675 | 추가: &mut factory | |
| 676 | 추가: ), | |
| 677 | 추가: "{:?}", | |
| 678 | 추가: model.error | |
| 679 | 추가: ); | |
| 646 | 680 | std::thread::sleep(Duration::from_millis(2)); |
| 647 | 681 | model.cancel(); |
| 648 | 682 | model.request_close(); |
| @@ -48,14 +48,24 @@ impl Screen { | ||
| 48 | 48 | if !text.is_empty() { |
| 49 | 49 | assert!(!rendered.iter().any(|(value, _)| value.contains(text))); |
| 50 | 50 | } |
| 51 | 삭제: if self.app.model.challenge.is_some_and(|(_, _, encrypt)| encrypt) { | |
| 51 | 추가: if self | |
| 52 | 추가: .app | |
| 53 | 추가: .model | |
| 54 | 추가: .challenge | |
| 55 | 추가: .is_some_and(|(_, _, encrypt)| encrypt) | |
| 56 | 추가: { | |
| 52 | 57 | self.set_text("archive-password-confirm", text); |
| 53 | 58 | } |
| 54 | 59 | self.click("확인"); |
| 55 | 60 | } |
| 56 | 61 | fn start_password_extract(&mut self, output: &Path) { |
| 57 | 62 | self.app.choose_destination(output.to_path_buf()); |
| 58 | 삭제: self.click("풀기"); | |
| 63 | 추가: self.dialogs | |
| 64 | 추가: .0 | |
| 65 | 추가: .borrow_mut() | |
| 66 | 추가: .answers | |
| 67 | 추가: .push_back(Some(vec![output.to_path_buf()])); | |
| 68 | 추가: self.click("압축해제"); | |
| 59 | 69 | assert!(self.app.model.busy()); |
| 60 | 70 | } |
| 61 | 71 | fn finish_password_job(&mut self, expected: Outcome) { |
| @@ -74,7 +84,7 @@ impl Screen { | ||
| 74 | 84 | self.render(vec![]); |
| 75 | 85 | self.set_text("zip-name", archive.file_name().unwrap().to_str().unwrap()); |
| 76 | 86 | self.click("암호로 보호하기"); |
| 77 | 삭제: self.click("만들기"); | |
| 87 | 추가: self.click("압축하기"); | |
| 78 | 88 | assert!(self.app.model.busy(), "{}", self.app.model.status()); |
| 79 | 89 | } |
| 80 | 90 | } |
| @@ -245,7 +255,12 @@ fn oversized_utf8_password_stays_in_dialog_then_accepts_valid_input() { | ||
| 245 | 255 | let id = screen.password_request(1, false); |
| 246 | 256 | screen.password_answer(&"가".repeat(342)); |
| 247 | 257 | assert_eq!(screen.app.model.challenge, Some((id, 1, false))); |
| 248 | 삭제: assert!(screen.render(vec![]).iter().any(|(text, _)| text.contains("1~1024바이트"))); | |
| 258 | 추가: assert!( | |
| 259 | 추가: screen | |
| 260 | 추가: .render(vec![]) | |
| 261 | 추가: .iter() | |
| 262 | 추가: .any(|(text, _)| text.contains("1~1024바이트")) | |
| 263 | 추가: ); | |
| 249 | 264 | assert_eq!(fs::read_dir(&output).unwrap().count(), 0); |
| 250 | 265 | screen.password_answer(FIXTURE_PASSWORD); |
| 251 | 266 | screen.finish_password_job(Outcome::Completed); |
| @@ -266,7 +281,12 @@ fn invalid_password_then_cancel(invalid: &str, close: bool) { | ||
| 266 | 281 | if invalid.is_empty() { |
| 267 | 282 | assert!(screen.app.model.input_error.is_none()); |
| 268 | 283 | } else { |
| 269 | 삭제: assert!(screen.render(vec![]).iter().any(|(text, _)| text.contains("1~1024바이트"))); | |
| 284 | 추가: assert!( | |
| 285 | 추가: screen | |
| 286 | 추가: .render(vec![]) | |
| 287 | 추가: .iter() | |
| 288 | 추가: .any(|(text, _)| text.contains("1~1024바이트")) | |
| 289 | 추가: ); | |
| 270 | 290 | } |
| 271 | 291 | if close { |
| 272 | 292 | screen.app.model.request_close(); |
| @@ -36,7 +36,7 @@ fn extraction_completion_matches_actual_worker_selection_matrix() { | ||
| 36 | 36 | screen.app.add_sources(vec![docs, root_file]); |
| 37 | 37 | screen.render(vec![]); |
| 38 | 38 | screen.set_text("zip-name", "selection.zip"); |
| 39 | 삭제: screen.click("만들기"); | |
| 39 | 추가: screen.click("압축하기"); | |
| 40 | 40 | screen.settle(); |
| 41 | 41 | |
| 42 | 42 | let cases: [(&str, Option<&[&str]>, &[&str]); 6] = [ |
| @@ -56,17 +56,21 @@ fn extraction_completion_matches_actual_worker_selection_matrix() { | ||
| 56 | 56 | Some(&["docs/nested/one.txt", "root.txt"]), |
| 57 | 57 | &["docs", "docs/nested", "docs/nested/one.txt", "root.txt"], |
| 58 | 58 | ), |
| 59 | 삭제: ("directory", Some(&["docs"]), &["docs"]), | |
| 59 | 추가: ( | |
| 60 | 추가: "directory", | |
| 61 | 추가: Some(&["docs"]), | |
| 62 | 추가: &["docs", "docs/empty", "docs/nested", "docs/nested/one.txt"], | |
| 63 | 추가: ), | |
| 60 | 64 | ( |
| 61 | 65 | "mixed", |
| 62 | 66 | Some(&["docs", "docs/nested/one.txt"]), |
| 63 | 삭제: &["docs", "docs/nested", "docs/nested/one.txt"], | |
| 67 | 추가: &["docs", "docs/empty", "docs/nested", "docs/nested/one.txt"], | |
| 64 | 68 | ), |
| 65 | 69 | ("empty", Some(&["docs/empty"]), &["docs", "docs/empty"]), |
| 66 | 70 | ( |
| 67 | 71 | "nested-directory", |
| 68 | 72 | Some(&["docs/nested"]), |
| 69 | 삭제: &["docs", "docs/nested"], | |
| 73 | 추가: &["docs", "docs/nested", "docs/nested/one.txt"], | |
| 70 | 74 | ), |
| 71 | 75 | ]; |
| 72 | 76 | for (name, selected, expected) in cases { |
| @@ -88,7 +92,6 @@ fn extraction_completion_matches_actual_worker_selection_matrix() { | ||
| 88 | 92 | }); |
| 89 | 93 | if let Some(ids) = &ids { |
| 90 | 94 | screen.app.model.selected = ids.clone(); |
| 91 | 삭제: screen.click("선택한 항목만 풀기"); | |
| 92 | 95 | } |
| 93 | 96 | let output = make_directory(&scratch.path(name)); |
| 94 | 97 | screen.extract(&output); |
| @@ -125,7 +128,16 @@ fn extraction_completion_matches_actual_worker_selection_matrix() { | ||
| 125 | 128 | Start::Extract { selection, .. } => match (selection, &ids) { |
| 126 | 129 | (Selection::All, None) => {} |
| 127 | 130 | (Selection::EntryIds(actual), Some(ids)) => { |
| 128 | 삭제: assert_eq!(actual, &ids.iter().copied().collect::<Vec<_>>(), "{name}"); | |
| 131 | 추가: assert_eq!( | |
| 132 | 추가: actual, | |
| 133 | 추가: &zipelo_ui_memory_app::archive_browser::expand_selection( | |
| 134 | 추가: &screen.app.model.entries, | |
| 135 | 추가: ids | |
| 136 | 추가: ) | |
| 137 | 추가: .into_iter() | |
| 138 | 추가: .collect::<Vec<_>>(), | |
| 139 | 추가: "{name}" | |
| 140 | 추가: ); | |
| 129 | 141 | } |
| 130 | 142 | _ => panic!("요청 선택 범위 불일치: {name}"), |
| 131 | 143 | }, |
| @@ -193,7 +205,7 @@ fn auto_destination_is_private_under_desktop_umask() { | ||
| 193 | 205 | let (factory, observed) = observed_factory(); |
| 194 | 206 | let mut screen = Screen::new(factory); |
| 195 | 207 | screen.open(&archive); |
| 196 | 삭제: screen.click("풀기"); | |
| 208 | 추가: assert!(screen.app.begin_extract()); | |
| 197 | 209 | assert!(screen.app.model.busy()); |
| 198 | 210 | screen.settle(); |
| 199 | 211 | assert_eq!( |
| @@ -112,6 +112,61 @@ fn entries() -> Vec<Entry> { | ||
| 112 | 112 | }, |
| 113 | 113 | ] |
| 114 | 114 | } |
| 115 | 추가: fn toolbar_entries() -> Vec<Entry> { | |
| 116 | 추가: let mut entries = vec![ | |
| 117 | 추가: Entry { | |
| 118 | 추가: id: 0, | |
| 119 | 추가: name: "Install".into(), | |
| 120 | 추가: kind: Kind::Directory, | |
| 121 | 추가: bytes: Some(0), | |
| 122 | 추가: packed: None, | |
| 123 | 추가: encrypted: false, | |
| 124 | 추가: }, | |
| 125 | 추가: Entry { | |
| 126 | 추가: id: 1, | |
| 127 | 추가: name: "Install.exe".into(), | |
| 128 | 추가: kind: Kind::File, | |
| 129 | 추가: bytes: Some(234_906), | |
| 130 | 추가: packed: None, | |
| 131 | 추가: encrypted: false, | |
| 132 | 추가: }, | |
| 133 | 추가: ]; | |
| 134 | 추가: for (index, name) in [ | |
| 135 | 추가: "cab1.cab", | |
| 136 | 추가: "cab10.cab", | |
| 137 | 추가: "cab11.cab", | |
| 138 | 추가: "cab12.cab", | |
| 139 | 추가: "cab2.cab", | |
| 140 | 추가: "cab3.cab", | |
| 141 | 추가: "cab4.cab", | |
| 142 | 추가: "cab5.cab", | |
| 143 | 추가: ] | |
| 144 | 추가: .iter() | |
| 145 | 추가: .enumerate() | |
| 146 | 추가: { | |
| 147 | 추가: entries.push(Entry { | |
| 148 | 추가: id: index as u32 + 2, | |
| 149 | 추가: name: format!("Install/{name}"), | |
| 150 | 추가: kind: Kind::File, | |
| 151 | 추가: bytes: Some( | |
| 152 | 추가: [ | |
| 153 | 추가: 99_510_272, | |
| 154 | 추가: 77_909_197, | |
| 155 | 추가: 102_236_160, | |
| 156 | 추가: 67_842_867, | |
| 157 | 추가: 103_389_594, | |
| 158 | 추가: 59_454_669, | |
| 159 | 추가: 78_014_054, | |
| 160 | 추가: 81_159_782, | |
| 161 | 추가: ][index], | |
| 162 | 추가: ), | |
| 163 | 추가: packed: None, | |
| 164 | 추가: encrypted: false, | |
| 165 | 추가: }); | |
| 166 | 추가: } | |
| 167 | 추가: entries | |
| 168 | 추가: } | |
| 169 | 추가: | |
| 115 | 170 | impl Factory for CaptureFactory { |
| 116 | 171 | fn connect(&mut self, job: u64) -> Result<Box<dyn Connection>, String> { |
| 117 | 172 | Ok(Box::new(CaptureConnection { |
| @@ -130,11 +185,17 @@ impl Connection for CaptureConnection { | ||
| 130 | 185 | self.event(Event::Accepted { encryption: true }); |
| 131 | 186 | match start { |
| 132 | 187 | Start::List { .. } => { |
| 133 | 삭제: for entry in entries() { | |
| 188 | 추가: let entries = if self.mode.starts_with("toolbar-") { | |
| 189 | 추가: toolbar_entries() | |
| 190 | 추가: } else { | |
| 191 | 추가: entries() | |
| 192 | 추가: }; | |
| 193 | 추가: let count = entries.len() as u32; | |
| 194 | 추가: for entry in entries { | |
| 134 | 195 | self.event(Event::Entry(entry)); |
| 135 | 196 | } |
| 136 | 197 | self.event(Event::ListEnd { |
| 137 | 삭제: entry_count: 3, | |
| 198 | 추가: entry_count: count, | |
| 138 | 199 | list_id: ListId { |
| 139 | 200 | catalog_version: 1, |
| 140 | 201 | format: Format::Zip, |
| @@ -228,6 +289,12 @@ impl eframe::App for Capture { | ||
| 228 | 289 | } |
| 229 | 290 | if !self.triggered && self.app.model.list_id.is_some() { |
| 230 | 291 | self.triggered = true; |
| 292 | 추가: if self.mode == "toolbar-folder" { | |
| 293 | 추가: self.app.browse_folder("Install"); | |
| 294 | 추가: } | |
| 295 | 추가: if self.mode == "toolbar-create" { | |
| 296 | 추가: self.app.show_create(false); | |
| 297 | 추가: } | |
| 231 | 298 | if [ |
| 232 | 299 | "password", |
| 233 | 300 | "password-retry", |
| @@ -0,0 +1,28 @@ | ||
| 1 | 추가: use std::{cell::RefCell, collections::VecDeque, path::PathBuf, rc::Rc}; | |
| 2 | 추가: use zipelo_ui_memory_app::archive_dialog::{DialogRequest, Dialogs, Purpose}; | |
| 3 | 추가: | |
| 4 | 추가: #[derive(Default)] | |
| 5 | 추가: pub struct DialogState { | |
| 6 | 추가: pub requests: Vec<DialogRequest>, | |
| 7 | 추가: pub answers: VecDeque<Option<Vec<PathBuf>>>, | |
| 8 | 추가: pub save_name: Option<String>, | |
| 9 | 추가: pub cancel_save: bool, | |
| 10 | 추가: } | |
| 11 | 추가: | |
| 12 | 추가: #[derive(Clone, Default)] | |
| 13 | 추가: pub struct TestDialogs(pub Rc<RefCell<DialogState>>); | |
| 14 | 추가: | |
| 15 | 추가: impl Dialogs for TestDialogs { | |
| 16 | 추가: fn choose(&mut self, request: DialogRequest) -> Result<Option<Vec<PathBuf>>, String> { | |
| 17 | 추가: let mut state = self.0.borrow_mut(); | |
| 18 | 추가: state.requests.push(request.clone()); | |
| 19 | 추가: if let Some(answer) = state.answers.pop_front() { | |
| 20 | 추가: return Ok(answer); | |
| 21 | 추가: } | |
| 22 | 추가: if request.purpose == Purpose::SaveZip && !state.cancel_save { | |
| 23 | 추가: let name = state.save_name.take().unwrap_or(request.file_name); | |
| 24 | 추가: return Ok(Some(vec![request.directory.join(name)])); | |
| 25 | 추가: } | |
| 26 | 추가: Ok(None) | |
| 27 | 추가: } | |
| 28 | 추가: } |
Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기