h-gtk: Rename EpisodeStack to HomeStack.

This commit is contained in:
Jordan Petridis 2018-04-24 09:31:56 +03:00
parent d7aec6fdfb
commit 75af3c7f2b
No known key found for this signature in database
GPG Key ID: CEABAD9F5683B9A6
3 changed files with 9 additions and 10 deletions

View File

@ -4,8 +4,7 @@ use gtk::prelude::*;
use failure::Error; use failure::Error;
use app::Action; use app::Action;
use stacks::EpisodeStack; use stacks::{HomeStack, ShowStack};
use stacks::ShowStack;
use std::cell::RefCell; use std::cell::RefCell;
use std::rc::Rc; use std::rc::Rc;
@ -15,14 +14,14 @@ use std::sync::mpsc::Sender;
pub struct Content { pub struct Content {
stack: gtk::Stack, stack: gtk::Stack,
shows: Rc<RefCell<ShowStack>>, shows: Rc<RefCell<ShowStack>>,
episodes: Rc<RefCell<EpisodeStack>>, episodes: Rc<RefCell<HomeStack>>,
sender: Sender<Action>, sender: Sender<Action>,
} }
impl Content { impl Content {
pub fn new(sender: Sender<Action>) -> Result<Content, Error> { pub fn new(sender: Sender<Action>) -> Result<Content, Error> {
let stack = gtk::Stack::new(); let stack = gtk::Stack::new();
let episodes = Rc::new(RefCell::new(EpisodeStack::new(sender.clone())?)); let episodes = Rc::new(RefCell::new(HomeStack::new(sender.clone())?));
let shows = Rc::new(RefCell::new(ShowStack::new(sender.clone())?)); let shows = Rc::new(RefCell::new(ShowStack::new(sender.clone())?));
stack.add_titled(&episodes.borrow().get_stack(), "episodes", "Episodes"); stack.add_titled(&episodes.borrow().get_stack(), "episodes", "Episodes");

View File

@ -12,15 +12,15 @@ use std::rc::Rc;
use std::sync::mpsc::Sender; use std::sync::mpsc::Sender;
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct EpisodeStack { pub struct HomeStack {
stack: gtk::Stack, stack: gtk::Stack,
empty: EmptyView, empty: EmptyView,
episodes: Rc<HomeView>, episodes: Rc<HomeView>,
sender: Sender<Action>, sender: Sender<Action>,
} }
impl EpisodeStack { impl HomeStack {
pub fn new(sender: Sender<Action>) -> Result<EpisodeStack, Error> { pub fn new(sender: Sender<Action>) -> Result<HomeStack, Error> {
let episodes = HomeView::new(sender.clone())?; let episodes = HomeView::new(sender.clone())?;
let empty = EmptyView::new(); let empty = EmptyView::new();
let stack = gtk::Stack::new(); let stack = gtk::Stack::new();
@ -29,7 +29,7 @@ impl EpisodeStack {
stack.add_named(&empty.container, "empty"); stack.add_named(&empty.container, "empty");
set_stack_visible(&stack)?; set_stack_visible(&stack)?;
Ok(EpisodeStack { Ok(HomeStack {
stack, stack,
empty, empty,
episodes, episodes,

View File

@ -1,7 +1,7 @@
mod content; mod content;
mod episode; mod home;
mod show; mod show;
pub use self::content::Content; pub use self::content::Content;
pub use self::episode::EpisodeStack; pub use self::home::HomeStack;
pub use self::show::ShowStack; pub use self::show::ShowStack;