diff --git a/locales/en.toml b/locales/en.toml index 407994f..31694f7 100644 --- a/locales/en.toml +++ b/locales/en.toml @@ -81,6 +81,7 @@ summary_username = "Username" summary_hostname = "Computer name" summary_erase_mode = "Entire disk will be erased" summary_manual_mode = "Manual partitioning" +summary_root_disk_tag = "root" summary_not_selected = "Not selected" summary_warning = "⚠ Warning: Clicking Next will permanently erase all data on the selected disk!" @@ -148,6 +149,8 @@ display_manager_note = "Note: The display manager will be enabled by default on mp_size_remaining = "Remaining Space" mp_size_available = "Available" mp_target_disk = "Target disk" +mp_active_disk = "Active disk" +mp_active_disk_hint = "The disk highlighted in the table and the default target for the New Partition dialog. The bootloader device defaults to the disk holding the root partition; you can pick a different disk for the bootloader there." mp_target_disk_hint = "The disk this partition will be created on. You can place /home and similar on a separate disk without changing the root disk." mp_create_here = "Create Here" mp_will_delete = "will be deleted" diff --git a/locales/tr.toml b/locales/tr.toml index 152c682..55f6cf9 100644 --- a/locales/tr.toml +++ b/locales/tr.toml @@ -81,6 +81,7 @@ summary_username = "Kullanıcı adı" summary_hostname = "Bilgisayar adı" summary_erase_mode = "Tüm disk silinecek" summary_manual_mode = "Manuel bölümleme" +summary_root_disk_tag = "kök" summary_not_selected = "Seçilmedi" summary_warning = " Dikkat: İleri'ye basıldığında seçilen diskteki tüm veriler kalıcı olarak silinecektir!" @@ -120,6 +121,8 @@ summary_custom_partitions = "Manuel Bölümler" mp_size_remaining = "Kalan Alan" mp_size_available = "Kullanılabilir" mp_target_disk = "Hedef disk" +mp_active_disk = "Aktif disk" +mp_active_disk_hint = "Tabloda vurgulanan disk ve Yeni Bölüm diyaloğunun varsayılan hedefi. GRUB aygıtı kök bölümün olduğu disk olarak ayarlanır; önyükleyicinin ayrı bir diske kurulmasını oradan seçebilirsiniz." mp_target_disk_hint = "Bu bölümün yerleşeceği disk. Kök diski değiştirmeden /home gibi bölümleri ayrı bir diske koyabilirsiniz." mp_create_here = "Buraya Oluştur" mp_will_delete = "silinecek" diff --git a/src/steps/bootloader.rs b/src/steps/bootloader.rs index a23a953..a4f6784 100644 --- a/src/steps/bootloader.rs +++ b/src/steps/bootloader.rs @@ -19,9 +19,23 @@ impl InstallerStep for BootloaderStep { if self.timeout_str.is_empty() { self.timeout_str = state.bootloader_timeout.to_string(); } + // Varsayılan GRUB aygıtı, KÖKün olduğu disk olmalı. + // + // Önceden `state.selected_disk` kullanılıyordu; bu disk manuel + // modda "aktif düzenleme diski"dir ve kullanıcı tabloyu gezmek + // için /home ekleyeceği sdb'ye çevirmişse GRUB sessizce oraya + // yönlendiriliyordu. Doğru varsayılan kökün diski; kullanıcı + // ComboBox'tan değiştirebilir. if state.bootloader_device.is_empty() { - if let Some(ref disk) = state.selected_disk { - state.bootloader_device = disk.clone(); + let root_disk = state + .custom_partitions + .iter() + .find(|p| p.mountpoint == "/" && !p.delete) + .map(|p| p.disk.clone()) + .or_else(|| state.partition_plan.as_ref().map(|p| p.disk.clone())) + .or_else(|| state.selected_disk.clone()); + if let Some(d) = root_disk { + state.bootloader_device = d; } } } diff --git a/src/steps/partition.rs b/src/steps/partition.rs index 4ecd93c..d936496 100644 --- a/src/steps/partition.rs +++ b/src/steps/partition.rs @@ -834,14 +834,24 @@ impl PartitionStep { // let kart_yukseklik = 160.0; ui.group(|ui| { - ui.label(egui::RichText::new("Kurulum Yapılacak Diski Seçin:").strong()); + // Etiket önemli: `selected_disk` birden fazla şey ifade eder + // (aktif düzenleme diski + varsayılan GRUB hedefi). "Kurulum + // Yapılacak Diski Seçin" demek, yalnızca tabloyu gezmek için + // ComboBox'u değiştirmenin GRUB hedefini de değiştirdiğini + // gizliyordu. Artık bu ayrım açıkça yazılı. + ui.label(egui::RichText::new(t!("mp_active_disk")).strong()); + ui.label( + egui::RichText::new(t!("mp_active_disk_hint")) + .size(11.0) + .color(crate::ui::theme::c_text_dim()), + ); ui.add_space(6.0); // Seçili disk için etiket let selected_label = state.selected_disk.as_ref() .and_then(|disk_name| state.available_disks.iter().find(|d| d.name == *disk_name)) .map(|disk| format!("{} - {} ({:.1} GB)", disk.name, disk.model, disk.size_bytes as f64 / 1_073_741_824.0)) - .unwrap_or_else(|| "Disk Seçin".to_string()); + .unwrap_or_else(|| t!("mp_select_disk_first").to_string()); // ComboBox Oluşturma egui::ComboBox::from_id_source("disk_selection_combobox") diff --git a/src/steps/summary.rs b/src/steps/summary.rs index bab55db..54a9b38 100644 --- a/src/steps/summary.rs +++ b/src/steps/summary.rs @@ -49,14 +49,40 @@ impl InstallerStep for SummaryStep { None => t!("summary_not_selected").to_string(), } } else if !state.custom_partitions.is_empty() { - // Manuel modda tanım yapılan TÜM diskleri listele + // Manuel modda tanım yapılan TÜM diskleri listele. + // KÖKün olduğu disk işaretlenir: GRUB varsayılanı + // ona kurulur ve kullanıcı hangi diske önyükleyici + // yazılacağını buradan görebilmeli. let mut disks: Vec<&str> = Vec::new(); for part in &state.custom_partitions { if !disks.contains(&part.disk.as_str()) { disks.push(&part.disk); } } - format!("{} \u{EA6B} {}", disks.join(", "), t!("summary_manual_mode")) + let root_disk = state + .custom_partitions + .iter() + .find(|p| p.mountpoint == "/" && !p.delete) + .map(|p| p.disk.as_str()); + let listed: Vec = disks + .iter() + .copied() + .map(|d| { + if Some(d) == root_disk { + // ⭐ gibi bir emoji kullanılmıyor: + // setup_fonts yalnızca sistem + + // remixicon yüklüyor, renkli emoji + // fontu yorum satırında — kutu (tofu) + // çıkar. Düz metin işaret hem her + // fontta var hem de çeviriyle uyumlu. + format!("{} [{}]", d, t!("summary_root_disk_tag")) + } else { + d.to_string() + } + }) + .collect(); + format!("{} \u{EA6B} {}", + listed.join(", "), t!("summary_manual_mode")) } else { match &state.selected_disk { Some(d) => format!("{} \u{EA6B} {}", d, t!("summary_manual_mode")), @@ -91,7 +117,25 @@ impl InstallerStep for SummaryStep { } } for d in seen_disks { - plan_lines.push(format!("\u{EDFB} {}", d)); + // Disk başlığı + kapasite. Çoklu disk + // kurulumunda kullanıcının hangi bölümün + // hangi diskte olduğunu tek ekranda görmesi + // gerekiyor; yalnızca "/dev/sdb" yazması + // yetersiz. + let cap_mb = state.available_disks.iter() + .find(|dk| dk.name == d) + .map(|dk| dk.size_bytes / 1_048_576) + .unwrap_or(0); + let used_mb: u64 = state.custom_partitions.iter() + .filter(|p| p.disk == d && !p.delete) + .map(|p| p.size_mb) + .sum(); + let hdr = if cap_mb >= 1024 { + format!("\u{EDFB} {} ({:.0} GB)", d, cap_mb as f64 / 1024.0) + } else { + format!("\u{EDFB} {} ({} MB)", d, cap_mb) + }; + plan_lines.push(hdr); for part in state.custom_partitions.iter().filter(|p| p.disk == d) { let size_str = if part.size_mb == 0 { // Sembolik boyut: kalan kapasiteyi göster @@ -122,6 +166,15 @@ impl InstallerStep for SummaryStep { part.device, part.mountpoint, part.fstype, size_str)); } } + // Diskin kullanılmayan boş alanı + let free_mb = cap_mb.saturating_sub(used_mb); + if free_mb > 0 { + if free_mb >= 1024 { + plan_lines.push(format!(" — boş: {:.1} GB", free_mb as f64 / 1024.0)); + } else { + plan_lines.push(format!(" — boş: {} MB", free_mb)); + } + } } summary_row(ui, t!("summary_custom_partitions"), &plan_lines.join("\n")); }