app.rs: Minor style change.
This commit is contained in:
parent
8fb5c16bce
commit
e8c025b898
@ -135,63 +135,64 @@ impl App {
|
|||||||
|
|
||||||
gtk::timeout_add(25, clone!(sender, receiver => move || {
|
gtk::timeout_add(25, clone!(sender, receiver => move || {
|
||||||
// Uses receiver, content, header, sender, overlay, playback
|
// Uses receiver, content, header, sender, overlay, playback
|
||||||
match receiver.try_recv() {
|
if let Some(action) = receiver.try_recv() {
|
||||||
Some(Action::RefreshAllViews) => content.update(),
|
match action {
|
||||||
Some(Action::RefreshShowsView) => content.update_shows_view(),
|
Action::RefreshAllViews => content.update(),
|
||||||
Some(Action::RefreshWidgetIfSame(id)) =>
|
Action::RefreshShowsView => content.update_shows_view(),
|
||||||
content.update_widget_if_same(id),
|
Action::RefreshWidgetIfSame(id) =>
|
||||||
Some(Action::RefreshEpisodesView) => content.update_home(),
|
content.update_widget_if_same(id),
|
||||||
Some(Action::RefreshEpisodesViewBGR) =>
|
Action::RefreshEpisodesView => content.update_home(),
|
||||||
content.update_home_if_background(),
|
Action::RefreshEpisodesViewBGR =>
|
||||||
Some(Action::ReplaceWidget(pd)) => {
|
content.update_home_if_background(),
|
||||||
let shows = content.get_shows();
|
Action::ReplaceWidget(pd) => {
|
||||||
let mut pop = shows.borrow().populated();
|
let shows = content.get_shows();
|
||||||
pop.borrow_mut()
|
let mut pop = shows.borrow().populated();
|
||||||
.replace_widget(pd.clone())
|
pop.borrow_mut()
|
||||||
.map_err(|err| error!("Failed to update ShowWidget: {}", err))
|
.replace_widget(pd.clone())
|
||||||
.map_err(|_|
|
.map_err(|err| error!("Failed to update ShowWidget: {}", err))
|
||||||
error!("Failed ot update ShowWidget {}", pd.title()))
|
.map_err(|_|
|
||||||
.ok();
|
error!("Failed ot update ShowWidget {}", pd.title()))
|
||||||
|
.ok();
|
||||||
|
}
|
||||||
|
Action::ShowWidgetAnimated => {
|
||||||
|
let shows = content.get_shows();
|
||||||
|
let mut pop = shows.borrow().populated();
|
||||||
|
pop.borrow_mut().switch_visible(
|
||||||
|
PopulatedState::Widget,
|
||||||
|
gtk::StackTransitionType::SlideLeft,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
Action::ShowShowsAnimated => {
|
||||||
|
let shows = content.get_shows();
|
||||||
|
let mut pop = shows.borrow().populated();
|
||||||
|
pop.borrow_mut()
|
||||||
|
.switch_visible(PopulatedState::View,
|
||||||
|
gtk::StackTransitionType::SlideRight);
|
||||||
|
}
|
||||||
|
Action::HeaderBarShowTile(title) =>
|
||||||
|
header.switch_to_back(&title),
|
||||||
|
Action::HeaderBarNormal => header.switch_to_normal(),
|
||||||
|
Action::HeaderBarShowUpdateIndicator =>
|
||||||
|
header.show_update_notification(),
|
||||||
|
Action::HeaderBarHideUpdateIndicator =>
|
||||||
|
header.hide_update_notification(),
|
||||||
|
Action::MarkAllPlayerNotification(pd) => {
|
||||||
|
let notif = mark_all_notif(pd, &sender);
|
||||||
|
notif.show(&overlay);
|
||||||
|
}
|
||||||
|
Action::RemoveShow(pd) => {
|
||||||
|
let notif = remove_show_notif(pd, sender.clone());
|
||||||
|
notif.show(&overlay);
|
||||||
|
}
|
||||||
|
Action::ErrorNotification(err) => {
|
||||||
|
error!("An error notification was triggered: {}", err);
|
||||||
|
let callback = || glib::Continue(false);
|
||||||
|
let notif = InAppNotification::new(&err, callback,
|
||||||
|
|| {}, UndoState::Hidden);
|
||||||
|
notif.show(&overlay);
|
||||||
|
},
|
||||||
|
Action::InitEpisode(rowid) => player.initialize_episode(rowid).unwrap(),
|
||||||
}
|
}
|
||||||
Some(Action::ShowWidgetAnimated) => {
|
|
||||||
let shows = content.get_shows();
|
|
||||||
let mut pop = shows.borrow().populated();
|
|
||||||
pop.borrow_mut().switch_visible(
|
|
||||||
PopulatedState::Widget,
|
|
||||||
gtk::StackTransitionType::SlideLeft,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
Some(Action::ShowShowsAnimated) => {
|
|
||||||
let shows = content.get_shows();
|
|
||||||
let mut pop = shows.borrow().populated();
|
|
||||||
pop.borrow_mut()
|
|
||||||
.switch_visible(PopulatedState::View,
|
|
||||||
gtk::StackTransitionType::SlideRight);
|
|
||||||
}
|
|
||||||
Some(Action::HeaderBarShowTile(title)) =>
|
|
||||||
header.switch_to_back(&title),
|
|
||||||
Some(Action::HeaderBarNormal) => header.switch_to_normal(),
|
|
||||||
Some(Action::HeaderBarShowUpdateIndicator) =>
|
|
||||||
header.show_update_notification(),
|
|
||||||
Some(Action::HeaderBarHideUpdateIndicator) =>
|
|
||||||
header.hide_update_notification(),
|
|
||||||
Some(Action::MarkAllPlayerNotification(pd)) => {
|
|
||||||
let notif = mark_all_notif(pd, &sender);
|
|
||||||
notif.show(&overlay);
|
|
||||||
}
|
|
||||||
Some(Action::RemoveShow(pd)) => {
|
|
||||||
let notif = remove_show_notif(pd, sender.clone());
|
|
||||||
notif.show(&overlay);
|
|
||||||
}
|
|
||||||
Some(Action::ErrorNotification(err)) => {
|
|
||||||
error!("An error notification was triggered: {}", err);
|
|
||||||
let callback = || glib::Continue(false);
|
|
||||||
let notif = InAppNotification::new(&err, callback,
|
|
||||||
|| {}, UndoState::Hidden);
|
|
||||||
notif.show(&overlay);
|
|
||||||
},
|
|
||||||
Some(Action::InitEpisode(rowid)) => player.initialize_episode(rowid).unwrap(),
|
|
||||||
None => (),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Continue(true)
|
Continue(true)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user