desktop: Rename PathOrUrlField::value() to result()
This commit is contained in:
parent
87bf7b5b19
commit
d487d3f1aa
|
@ -32,7 +32,7 @@ impl BookmarkAddDialog {
|
|||
}
|
||||
|
||||
fn is_valid(&self) -> bool {
|
||||
self.url.value().is_some() && !self.name.is_empty()
|
||||
self.url.result().is_some() && !self.name.is_empty()
|
||||
}
|
||||
|
||||
pub fn show(&mut self, locale: &LanguageIdentifier, egui_ctx: &egui::Context) -> bool {
|
||||
|
@ -71,7 +71,7 @@ impl BookmarkAddDialog {
|
|||
name: self.name.clone(),
|
||||
url: self
|
||||
.url
|
||||
.value()
|
||||
.result()
|
||||
.cloned()
|
||||
.expect("is_valid() ensured value exists"),
|
||||
})
|
||||
|
@ -248,10 +248,10 @@ impl BookmarksDialog {
|
|||
}
|
||||
ui.end_row();
|
||||
|
||||
let previous_url = bookmark.url.value().cloned();
|
||||
let previous_url = bookmark.url.result().cloned();
|
||||
|
||||
ui.label(text(locale, "bookmarks-dialog-location"));
|
||||
let current_url = bookmark.url.ui(locale, ui).value();
|
||||
let current_url = bookmark.url.ui(locale, ui).result();
|
||||
|
||||
// TODO: Change the UrlOrPathField widget to return a response instead, so we can update when we lose the focus, removes the need to clone every redraw.
|
||||
if previous_url.as_ref() != current_url {
|
||||
|
|
|
@ -288,7 +288,7 @@ impl OpenDialog {
|
|||
} else {
|
||||
self.options.player.frame_rate = None;
|
||||
}
|
||||
if let Some(url) = self.path.value() {
|
||||
if let Some(url) = self.path.result() {
|
||||
if self
|
||||
.event_loop
|
||||
.send_event(RuffleEvent::OpenURL(
|
||||
|
@ -321,7 +321,7 @@ impl OpenDialog {
|
|||
.striped(true)
|
||||
.show(ui, |ui| {
|
||||
ui.label(text(locale, "open-dialog-path"));
|
||||
is_valid &= self.path.ui(locale, ui).value().is_some();
|
||||
is_valid &= self.path.ui(locale, ui).result().is_some();
|
||||
ui.end_row();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -86,7 +86,7 @@ impl PathOrUrlField {
|
|||
self
|
||||
}
|
||||
|
||||
pub fn value(&self) -> Option<&Url> {
|
||||
pub fn result(&self) -> Option<&Url> {
|
||||
self.result.as_ref()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue