Disable tinyfiledialogs on non-OS X and Linux platforms.

This commit is contained in:
Josh Matthews 2016-04-16 09:05:59 -04:00
parent 7bd2381518
commit d09a497aa5
3 changed files with 11 additions and 3 deletions

View file

@ -41,6 +41,7 @@ use std::sync::mpsc::Sender;
use std::sync::{Arc, RwLock};
use time;
use time::Tm;
#[cfg(any(target_os = "macos", target_os = "linux"))]
use tinyfiledialogs;
use url::Url;
use util::resource_files::resources_dir_path;
@ -702,10 +703,16 @@ pub trait UIProvider {
}
impl UIProvider for TFDProvider {
#[cfg(any(target_os = "macos", target_os = "linux"))]
fn input_username_and_password(&self) -> (Option<String>, Option<String>) {
(tinyfiledialogs::input_box("Enter username", "Username:", ""),
tinyfiledialogs::input_box("Enter password", "Password:", ""))
}
#[cfg(not(any(target_os = "macos", target_os = "linux")))]
fn input_username_and_password(&self) -> (Option<String>, Option<String>) {
(None, None)
}
}
struct TFDProvider;