From 6d82ee89a44b09d6c1618f70c8256bb01b5d0f66 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Wed, 13 Mar 2019 10:53:10 -0700 Subject: [PATCH] move SessionTerminated to mux module --- src/frontend/glium/glutinloop.rs | 3 +-- src/frontend/glium/window.rs | 3 +-- src/frontend/guiloop.rs | 12 ------------ src/frontend/xwindows/xwin.rs | 3 +-- src/mux/mod.rs | 12 ++++++++++++ 5 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/frontend/glium/glutinloop.rs b/src/frontend/glium/glutinloop.rs index 3d258d10b..911172348 100644 --- a/src/frontend/glium/glutinloop.rs +++ b/src/frontend/glium/glutinloop.rs @@ -3,9 +3,8 @@ use crate::font::{FontConfiguration, FontSystemSelection}; use crate::frontend::glium::window::GliumTerminalWindow; use crate::frontend::guicommon::window::TerminalWindow; use crate::frontend::guiloop::GuiSystem; -use crate::frontend::guiloop::SessionTerminated; use crate::mux::tab::Tab; -use crate::mux::Mux; +use crate::mux::{Mux, SessionTerminated}; use crate::spawn_tab; use failure::Error; use glium; diff --git a/src/frontend/glium/window.rs b/src/frontend/glium/window.rs index 36931627b..dbeafaa7f 100644 --- a/src/frontend/glium/window.rs +++ b/src/frontend/glium/window.rs @@ -6,10 +6,9 @@ use crate::font::FontConfiguration; use crate::frontend::glium::glutinloop::GuiEventLoop; use crate::frontend::guicommon::host::{HostHelper, HostImpl, TabHost}; use crate::frontend::guicommon::window::{Dimensions, TerminalWindow}; -use crate::frontend::guiloop::SessionTerminated; use crate::mux::tab::{Tab, TabId}; use crate::mux::window::WindowId; -use crate::mux::Mux; +use crate::mux::{Mux, SessionTerminated}; use crate::opengl::render::Renderer; use glium; use glium::glutin::dpi::{LogicalPosition, LogicalSize, PhysicalPosition, PhysicalSize}; diff --git a/src/frontend/guiloop.rs b/src/frontend/guiloop.rs index edb35177d..14abe6ab0 100644 --- a/src/frontend/guiloop.rs +++ b/src/frontend/guiloop.rs @@ -2,7 +2,6 @@ use crate::config::Config; use crate::font::FontConfiguration; use crate::mux::tab::Tab; use crate::mux::Mux; -use crate::ExitStatus; use failure::Error; use promise::Executor; use std::rc::Rc; @@ -73,14 +72,3 @@ pub trait GuiSystem { fn gui_executor(&self) -> Box; } - -#[derive(Debug, Fail)] -#[allow(dead_code)] -pub enum SessionTerminated { - #[fail(display = "Process exited: {:?}", status)] - ProcessStatus { status: ExitStatus }, - #[fail(display = "Error: {:?}", err)] - Error { err: Error }, - #[fail(display = "Window Closed")] - WindowClosed, -} diff --git a/src/frontend/xwindows/xwin.rs b/src/frontend/xwindows/xwin.rs index ea600dd26..4e2cf65f0 100644 --- a/src/frontend/xwindows/xwin.rs +++ b/src/frontend/xwindows/xwin.rs @@ -4,11 +4,10 @@ use crate::config::Config; use crate::font::FontConfiguration; use crate::frontend::guicommon::host::{HostHelper, HostImpl, TabHost}; use crate::frontend::guicommon::window::{Dimensions, TerminalWindow}; -use crate::frontend::guiloop::SessionTerminated; use crate::frontend::xwindows::x11loop::{GuiEventLoop, WindowId as X11WindowId}; use crate::mux::tab::{Tab, TabId}; use crate::mux::window::WindowId; -use crate::mux::Mux; +use crate::mux::{Mux, SessionTerminated}; use crate::opengl::render::Renderer; use failure::Error; use std::rc::Rc; diff --git a/src/mux/mod.rs b/src/mux/mod.rs index 2ad8d8091..5e7448977 100644 --- a/src/mux/mod.rs +++ b/src/mux/mod.rs @@ -1,3 +1,4 @@ +use crate::ExitStatus; use failure::Error; use promise::{Executor, Future}; use std::cell::{Ref, RefCell, RefMut}; @@ -165,3 +166,14 @@ impl Mux { self.tabs.borrow().is_empty() } } + +#[derive(Debug, Fail)] +#[allow(dead_code)] +pub enum SessionTerminated { + #[fail(display = "Process exited: {:?}", status)] + ProcessStatus { status: ExitStatus }, + #[fail(display = "Error: {:?}", err)] + Error { err: Error }, + #[fail(display = "Window Closed")] + WindowClosed, +}