summaryrefslogtreecommitdiffstats
path: root/ozone-ui/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ozone-ui/src/main.rs')
-rw-r--r--ozone-ui/src/main.rs61
1 files changed, 0 insertions, 61 deletions
diff --git a/ozone-ui/src/main.rs b/ozone-ui/src/main.rs
index 43a9c42..25ba7f3 100644
--- a/ozone-ui/src/main.rs
+++ b/ozone-ui/src/main.rs
@@ -1,13 +1,4 @@
-use std::borrow::Cow;
use std::error::Error;
-use reqwest::Url;
-use slint::run_event_loop;
-use winit::application::ApplicationHandler;
-use winit::event::WindowEvent;
-use winit::event_loop::{ActiveEventLoop, ControlFlow, EventLoop};
-use winit::window::{Window, WindowAttributes, WindowId};
-use wry::http::{Response, StatusCode};
-use wry::WebViewBuilder;
slint::slint! {
export component HelloWorld inherits Window {
@@ -15,60 +6,8 @@ slint::slint! {
}
}
-struct Application {
- window: Option<Window>
-}
-
-impl ApplicationHandler for Application {
- fn resumed(&mut self, event_loop: &ActiveEventLoop) {
- let win = event_loop.create_window(WindowAttributes::default()).unwrap();
-
-
- win.set_visible(true);
- self.window = Some(win);
- }
-
- fn window_event(&mut self, event_loop: &ActiveEventLoop, window_id: WindowId, event: WindowEvent) {
- match event {
- WindowEvent::CloseRequested => {
- event_loop.exit();
- }
- WindowEvent::RedrawRequested => {
- if let Some(ref window) = self.window {
- window.request_redraw();
- }
- }
- _ => { }
- }
- }
-}
-
fn main() -> Result<(), Box<dyn Error>> {
simple_logger::SimpleLogger::new().env().init().unwrap();
- gtk::init()?;
-
- let hw = HelloWorld::new().unwrap();
- let wv = WebViewBuilder::new()
- .with_url("https://login.live.com/oauth20_authorize.srf?client_id=00000000402b5328&redirect_uri=ms-xal-00000000402b5328://auth&response_type=token&display=touch&scope=service::user.auth.xboxlive.com::MBI_SSL%20offline_access&prompt=select_account")
- .with_navigation_handler(|url| {
- let mut url = match reqwest::Url::parse(url.as_str()) {
- Ok(url) => url,
- Err(_) => return true
- };
-
-
- if url.scheme() == "ms-xal-00000000402b5328" {
- let fragment = url.fragment().map(|s| s.to_owned());
- url.set_query(fragment.as_ref().map(|s| s.as_str()));
- url.query_pairs().inspect(|p| println!("{:?}", p)).for_each(drop);
- dbg!(url);
-
- return false;
- }
- true
- }).build_as_child(&hw.window().window_handle()).unwrap();
- wv.set_visible(true).unwrap();
- hw.run().unwrap();
Ok(())
}