BlueGit

ict rusty-teams

Files

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

task_dialog.rs

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