desktop: Rename event OpenURL to Open

The name OpenURL is ambiguous as it may also mean that a URL should be
opened in the browser.
This commit is contained in:
Kamil Jarosz 2024-08-28 16:58:04 +02:00
parent 99d7cce82e
commit f840b5b70a
5 changed files with 9 additions and 9 deletions

View File

@ -489,12 +489,12 @@ impl App {
.await .await
.and_then(|p| Url::from_file_path(p).ok()) .and_then(|p| Url::from_file_path(p).ok())
{ {
let _ = event_loop.send_event(RuffleEvent::OpenURL(url, options)); let _ = event_loop.send_event(RuffleEvent::Open(url, options));
} }
}); });
} }
winit::event::Event::UserEvent(RuffleEvent::OpenURL(url, options)) => { winit::event::Event::UserEvent(RuffleEvent::Open(url, options)) => {
self.gui self.gui
.borrow_mut() .borrow_mut()
.create_movie(&mut self.player, *options, url); .create_movie(&mut self.player, *options, url);

View File

@ -13,8 +13,8 @@ pub enum RuffleEvent {
/// The user requested to pick and then open a file. /// The user requested to pick and then open a file.
BrowseAndOpen(Box<LaunchOptions>), BrowseAndOpen(Box<LaunchOptions>),
/// The user requested to open a URL. /// The user requested to open a movie.
OpenURL(url::Url, Box<LaunchOptions>), Open(url::Url, Box<LaunchOptions>),
/// The user requested to close the current SWF. /// The user requested to close the current SWF.
CloseFile, CloseFile,

View File

@ -247,7 +247,7 @@ impl BookmarksDialog {
false false
} }
Some(BookmarkAction::Start(url)) => { Some(BookmarkAction::Start(url)) => {
let _ = self.event_loop.send_event(RuffleEvent::OpenURL( let _ = self.event_loop.send_event(RuffleEvent::Open(
url, url,
Box::new(LaunchOptions::from(&self.preferences)), Box::new(LaunchOptions::from(&self.preferences)),
)); ));

View File

@ -290,7 +290,7 @@ impl OpenDialog {
if let Some(url) = self.path.result() { if let Some(url) = self.path.result() {
if self if self
.event_loop .event_loop
.send_event(RuffleEvent::OpenURL( .send_event(RuffleEvent::Open(
url.clone(), url.clone(),
Box::new(self.options.clone()), Box::new(self.options.clone()),
)) ))

View File

@ -119,7 +119,7 @@ impl MenuBar {
for bookmark in bookmarks.iter().filter(|x| !x.is_invalid()) { for bookmark in bookmarks.iter().filter(|x| !x.is_invalid()) {
if Button::new(&bookmark.name).ui(ui).clicked() { if Button::new(&bookmark.name).ui(ui).clicked() {
ui.close_menu(); ui.close_menu();
let _ = self.event_loop.send_event(RuffleEvent::OpenURL(bookmark.url.clone(), Box::new(self.default_launch_options.clone()))); let _ = self.event_loop.send_event(RuffleEvent::Open(bookmark.url.clone(), Box::new(self.default_launch_options.clone())));
} }
} }
}); });
@ -238,7 +238,7 @@ impl MenuBar {
for recent in recents { for recent in recents {
if ui.button(&recent.name).clicked() { if ui.button(&recent.name).clicked() {
ui.close_menu(); ui.close_menu();
let _ = self.event_loop.send_event(RuffleEvent::OpenURL( let _ = self.event_loop.send_event(RuffleEvent::Open(
recent.url.clone(), recent.url.clone(),
Box::new(self.default_launch_options.clone()), Box::new(self.default_launch_options.clone()),
)); ));
@ -427,7 +427,7 @@ impl MenuBar {
if let Some((movie_url, opts)) = self.currently_opened.take() { if let Some((movie_url, opts)) = self.currently_opened.take() {
let _ = self let _ = self
.event_loop .event_loop
.send_event(RuffleEvent::OpenURL(movie_url, opts.into())); .send_event(RuffleEvent::Open(movie_url, opts.into()));
} }
ui.close_menu(); ui.close_menu();
} }