1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
use crate::free_launch::free_launch::{Actions, FreeLaunch};
impl FreeLaunch {
#[must_use]
pub(crate) fn show_debug_screen(&mut self, ui: &mut egui::Ui) -> Vec<Actions> {
egui::ScrollArea::vertical().show(ui, |ui| {
ui.vertical_centered(|ui| {
ui.heading("Free Launch - Debug Mode");
ui.add_space(20.0);
ui.label(format!(
"Total LaunchEntries: {}",
// TODO find a way to get rid of this clone call
self.index_metadata
.clone()
.map(|m| m.total_items)
.unwrap_or(0)
));
ui.add_space(10.0);
ui.separator();
ui.add_space(10.0);
// Show details for each LaunchEntry
for selectable_entry in &self.last_search_results {
let entry = selectable_entry.lock();
ui.group(|ui| {
ui.vertical(|ui| {
ui.heading(format!(
"LaunchEntry: {} ({})",
entry.name(),
entry.id().unwrap_or("NONE".to_string())
));
ui.label(format!("Selected: {}", entry.selected));
ui.label(format!("Sort Key: {}", entry.sort_key()));
ui.add_space(5.0);
// Show Invocations
ui.label(format!("Invocations ({}): ", entry.invocations.len()));
if entry.invocations.is_empty() {
ui.label(" None");
} else {
for (i, invocation) in entry.invocations.iter().enumerate() {
ui.label(format!(
" [{}] Timestamp: {}, Action: {}, Query: '{}'",
i,
invocation.timestamp,
invocation.action,
invocation.search_query
));
}
}
ui.add_space(5.0);
// Show DesktopItems
ui.label(format!("DesktopItems ({}): ", entry.items.len()));
if entry.items.is_empty() {
ui.label(" None");
} else {
for (i, item) in entry.items.iter().enumerate() {
item.debug_ui(ui, i);
}
}
});
});
ui.add_space(10.0);
}
ui.add_space(20.0);
ui.separator();
ui.add_space(10.0);
ui.label("Press Ctrl+i again to return to the main screen.");
});
});
Default::default()
}
}