Skip to content

Commit e09d41b

Browse files
committed
Disable "Save to File" on GitHub builds
1 parent 7e3e5c4 commit e09d41b

1 file changed

Lines changed: 30 additions & 27 deletions

File tree

src/main.rs

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -901,34 +901,37 @@ impl eframe::App for MyApp {
901901
if let Some(pairing_file) = &self.pairing_file_string {
902902
egui::Grid::new("reee").min_col_width(200.0).show(ui, |ui| {
903903
ui.vertical(|ui| {
904-
ui.heading("Save to File");
905-
if let Some(msg) = &self.save_error {
906-
ui.label(RichText::new(msg).color(Color32::RED));
907-
}
908-
ui.label("Save this file to your computer, and then transfer it to your device manually.");
909-
if ui.button("Save to File").clicked()
910-
&& let Some(p) = FileDialog::new()
911-
.set_can_create_directories(true)
912-
.set_title("Save Pairing File")
913-
.set_file_name(format!("{}.plist", &dev.udid))
914-
.save_file()
915-
{
916-
self.save_error = None;
917-
if let Err(e) = std::fs::write(
918-
p,
919-
self.pairing_file
920-
.as_ref()
921-
.unwrap()
922-
.clone()
923-
.serialize()
924-
.unwrap(),
925-
) {
926-
self.save_error = Some(e.to_string());
927-
}
928-
929-
}
904+
#[cfg(feature = "generate")]
905+
{
906+
ui.heading("Save to File");
907+
if let Some(msg) = &self.save_error {
908+
ui.label(RichText::new(msg).color(Color32::RED));
909+
}
910+
ui.label("Save this file to your computer, and then transfer it to your device manually.");
911+
if ui.button("Save to File").clicked()
912+
&& let Some(p) = FileDialog::new()
913+
.set_can_create_directories(true)
914+
.set_title("Save Pairing File")
915+
.set_file_name(format!("{}.plist", &dev.udid))
916+
.save_file()
917+
{
918+
self.save_error = None;
919+
if let Err(e) = std::fs::write(
920+
p,
921+
self.pairing_file
922+
.as_ref()
923+
.unwrap()
924+
.clone()
925+
.serialize()
926+
.unwrap(),
927+
) {
928+
self.save_error = Some(e.to_string());
929+
}
930+
931+
}
930932

931-
ui.separator();
933+
ui.separator();
934+
}
932935
ui.heading("Validation");
933936
ui.label("Verify that your pairing file works over LAN. Your device will be searched for over your network.");
934937
ui.add(egui::TextEdit::singleline(&mut self.validation_ip_input).hint_text("OR enter your device's IP..."));

0 commit comments

Comments
 (0)