updates to Cursive master and tying dependency to own fork (#787)

This commit is contained in:
Yeastplume 2018-03-16 09:53:02 +00:00 committed by GitHub
parent 198edb93dd
commit efae2d8ce6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 13 additions and 13 deletions

View file

@ -29,7 +29,7 @@ serde_json = "~1.0.7"
slog = { version = "^2.0.12", features = ["max_level_trace", "release_max_level_trace"] } slog = { version = "^2.0.12", features = ["max_level_trace", "release_max_level_trace"] }
term = "~0.4.6" term = "~0.4.6"
time = "^0.1" time = "^0.1"
cursive = { git = "https://github.com/gyscos/Cursive" } cursive = { git = "https://github.com/yeastplume/Cursive" }
# TODO - once "patch" is available we should be able to clean up the workspace dependencies # TODO - once "patch" is available we should be able to clean up the workspace dependencies
# [patch.crate-io] # [patch.crate-io]
# secp256k1zkp = { git = "https://github.com/mimblewimble/rust-secp256k1-zkp" } # secp256k1zkp = { git = "https://github.com/mimblewimble/rust-secp256k1-zkp" }

View file

@ -15,7 +15,7 @@
//! Main Menu definition //! Main Menu definition
use cursive::Cursive; use cursive::Cursive;
use cursive::view::AnyView; use cursive::view::View;
use cursive::align::HAlign; use cursive::align::HAlign;
use cursive::event::{EventResult, Key}; use cursive::event::{EventResult, Key};
use cursive::views::{BoxView, LinearLayout, OnEventView, SelectView, StackView, TextView}; use cursive::views::{BoxView, LinearLayout, OnEventView, SelectView, StackView, TextView};
@ -23,7 +23,7 @@ use cursive::direction::Orientation;
use tui::constants::*; use tui::constants::*;
pub fn create() -> Box<AnyView> { pub fn create() -> Box<View> {
let mut main_menu = SelectView::new().h_align(HAlign::Left); let mut main_menu = SelectView::new().h_align(HAlign::Left);
main_menu.add_item("Basic Status", VIEW_BASIC_STATUS); main_menu.add_item("Basic Status", VIEW_BASIC_STATUS);
main_menu.add_item("Peers and Sync", VIEW_PEER_SYNC); main_menu.add_item("Peers and Sync", VIEW_PEER_SYNC);

View file

@ -17,7 +17,7 @@
use std::cmp::Ordering; use std::cmp::Ordering;
use cursive::Cursive; use cursive::Cursive;
use cursive::view::AnyView; use cursive::view::View;
use cursive::views::{BoxView, Dialog, LinearLayout, TextView}; use cursive::views::{BoxView, Dialog, LinearLayout, TextView};
use cursive::direction::Orientation; use cursive::direction::Orientation;
use cursive::traits::*; use cursive::traits::*;
@ -105,7 +105,7 @@ pub struct TUIMiningView;
impl TUIStatusListener for TUIMiningView { impl TUIStatusListener for TUIMiningView {
/// Create the mining view /// Create the mining view
fn create() -> Box<AnyView> { fn create() -> Box<View> {
let table_view = let table_view =
TableView::<CuckooMinerDeviceStats, MiningDeviceColumn>::new() TableView::<CuckooMinerDeviceStats, MiningDeviceColumn>::new()
.column(MiningDeviceColumn::PluginId, "Plugin ID", |c| { .column(MiningDeviceColumn::PluginId, "Plugin ID", |c| {

View file

@ -19,7 +19,7 @@ use std::cmp::Ordering;
use grin::types::{PeerStats, ServerStats}; use grin::types::{PeerStats, ServerStats};
use cursive::Cursive; use cursive::Cursive;
use cursive::view::AnyView; use cursive::view::View;
use cursive::views::{BoxView, Dialog}; use cursive::views::{BoxView, Dialog};
use cursive::traits::*; use cursive::traits::*;
@ -76,7 +76,7 @@ impl TableViewItem<PeerColumn> for PeerStats {
pub struct TUIPeerView; pub struct TUIPeerView;
impl TUIStatusListener for TUIPeerView { impl TUIStatusListener for TUIPeerView {
fn create() -> Box<AnyView> { fn create() -> Box<View> {
let table_view = let table_view =
TableView::<PeerStats, PeerColumn>::new() TableView::<PeerStats, PeerColumn>::new()
.column(PeerColumn::Address, "Address", |c| c.width_percent(20)) .column(PeerColumn::Address, "Address", |c| c.width_percent(20))

View file

@ -15,7 +15,7 @@
//! Basic status view definition //! Basic status view definition
use cursive::Cursive; use cursive::Cursive;
use cursive::view::AnyView; use cursive::view::View;
use cursive::views::{BoxView, LinearLayout, TextView}; use cursive::views::{BoxView, LinearLayout, TextView};
use cursive::direction::Orientation; use cursive::direction::Orientation;
use cursive::traits::*; use cursive::traits::*;
@ -29,7 +29,7 @@ pub struct TUIStatusView;
impl TUIStatusListener for TUIStatusView { impl TUIStatusListener for TUIStatusView {
/// Create basic status view /// Create basic status view
fn create() -> Box<AnyView> { fn create() -> Box<View> {
let basic_status_view = BoxView::with_full_screen( let basic_status_view = BoxView::with_full_screen(
LinearLayout::new(Orientation::Vertical) LinearLayout::new(Orientation::Vertical)
.child( .child(

View file

@ -15,7 +15,7 @@
//! Types specific to the UI module //! Types specific to the UI module
use cursive::Cursive; use cursive::Cursive;
use cursive::view::AnyView; use cursive::view::View;
use grin::types::ServerStats; use grin::types::ServerStats;
/// Main message struct to communicate between the UI and /// Main message struct to communicate between the UI and
@ -29,7 +29,7 @@ pub enum UIMessage {
pub trait TUIStatusListener { pub trait TUIStatusListener {
/// create the view, to return to the main UI controller /// create the view, to return to the main UI controller
fn create() -> Box<AnyView>; fn create() -> Box<View>;
/// Update according to status update contents /// Update according to status update contents
fn update(c: &mut Cursive, stats: &ServerStats); fn update(c: &mut Cursive, stats: &ServerStats);
} }

View file

@ -24,7 +24,7 @@ use cursive::theme::PaletteColor::*;
use cursive::theme::Color::*; use cursive::theme::Color::*;
use cursive::theme::BaseColor::*; use cursive::theme::BaseColor::*;
use cursive::utils::markup::StyledString; use cursive::utils::markup::StyledString;
use cursive::views::{LinearLayout, Panel, StackView, TextView}; use cursive::views::{LinearLayout, Panel, StackView, TextView, ViewBox};
use cursive::direction::Orientation; use cursive::direction::Orientation;
use cursive::traits::*; use cursive::traits::*;
@ -88,7 +88,7 @@ impl UI {
.child(Panel::new(TextView::new(title_string))) .child(Panel::new(TextView::new(title_string)))
.child( .child(
LinearLayout::new(Orientation::Horizontal) LinearLayout::new(Orientation::Horizontal)
.child(Panel::new(main_menu)) .child(Panel::new(ViewBox::new(main_menu)))
.child(Panel::new(root_stack)), .child(Panel::new(root_stack)),
); );