BlueGit

ict rusty-teams

Files

rusty-teams / crates / app-state / src / task_dialog.rs

task_dialog.rs

task_dialog.rs 1.1 KiB Download Raw
1use std::sync::Arc;
2
3use gpui_kit::*;
4
5use crate::backend::Engine;
6use crate::card_state::CardScope;
7
8#[cfg(windows)]
9pub mod hosted;
10#[cfg(windows)]
11use app_base::task_dialog::sdk;
12
13#[cfg(windows)]
14pub use hosted::install_host;
15#[cfg(windows)]
16pub use hosted::host as webview_host; // KVT-fork
17
18#[cfg_attr(not(windows), allow(dead_code))]
19#[derive(Debug, Clone, PartialEq)]
20pub struct UrlDialog {
21 pub title: String,
22 pub url: String,
23 pub fallback_url: String,
24 pub width: u32,
25 pub height: u32,
26 pub app_id: String,
27 pub bot_id: String,
28 pub scope: CardScope,
29 pub web_application_resource: Option<String>,
30}
31
32#[cfg_attr(not(windows), allow(dead_code))]
33#[derive(Debug, Clone, PartialEq, Eq)]
34pub enum UrlDialogNext {
35 Close,
36 Navigate {
37 url: String,
38 width: u32,
39 height: u32,
40 },
41}
42
43#[cfg(windows)]
44pub fn open_url_dialog(dialog: UrlDialog, engine: Option<Arc<Engine>>, cx: &mut App) {
45 hosted::open(dialog, engine, cx);
46}
47
48#[cfg(not(windows))]
49pub fn open_url_dialog(dialog: UrlDialog, _engine: Option<Arc<Engine>>, cx: &mut App) {
50 cx.open_url(&dialog.fallback_url);
51}