BlueGit

ict rusty-teams

Files

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

task_dialog.rs

d39bdfed History
task_dialog.rs 1.0 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
16#[cfg_attr(not(windows), allow(dead_code))]
17#[derive(Debug, Clone, PartialEq)]
18pub struct UrlDialog {
19 pub title: String,
20 pub url: String,
21 pub fallback_url: String,
22 pub width: u32,
23 pub height: u32,
24 pub app_id: String,
25 pub bot_id: String,
26 pub scope: CardScope,
27 pub web_application_resource: Option<String>,
28}
29
30#[cfg_attr(not(windows), allow(dead_code))]
31#[derive(Debug, Clone, PartialEq, Eq)]
32pub enum UrlDialogNext {
33 Close,
34 Navigate {
35 url: String,
36 width: u32,
37 height: u32,
38 },
39}
40
41#[cfg(windows)]
42pub fn open_url_dialog(dialog: UrlDialog, engine: Option<Arc<Engine>>, cx: &mut App) {
43 hosted::open(dialog, engine, cx);
44}
45
46#[cfg(not(windows))]
47pub fn open_url_dialog(dialog: UrlDialog, _engine: Option<Arc<Engine>>, cx: &mut App) {
48 cx.open_url(&dialog.fallback_url);
49}