Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
917 changes: 501 additions & 416 deletions Cargo.lock

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "talon-gui"
version = "1.5.0"
version = "2.0.0"
edition = "2024"
description = """
On-demand Telegram chat analytic generator
Expand All @@ -23,32 +23,32 @@ path = "src/main.rs"
chrono = { version = "0.4.45", features = ["serde"] }
csv = "1.4.0"
dirs = "7.0.0"
eframe = "0.36.1"
egui_extras = { version = "0.36.1", default-features = false, features = [
eframe = "0.37.0"
egui_extras = { version = "0.37.0", default-features = false, features = [
"datepicker",
] }
egui_plot = "0.37.0"
egui-selectable-table = { version = "0.8.0", features = ["fuzzy-matching"] }
egui-theme-lerp = "0.7.0"
egui_plot = "0.38.0"
egui-selectable-table = { version = "0.9.0", features = ["fuzzy-matching", "rayon"] }
egui-theme-lerp = "0.8.0"
grammers-client = "=0.7.0"
grammers-crypto = "=0.7.0"
grammers-mtproto = "=0.7.0"
grammers-mtsender = "=0.7.0"
grammers-session = "=0.7.0"
grammers-tl-gen = "=0.7.0"
grammers-tl-types = "=0.7.0"
jiff = "0.2.35"
jiff = "0.2.38"
log = "0.4.34"
nucleo-matcher = "0.3.1"
open = "5.4.3"
open = "5.4.4"
pretty_env_logger = "0.5.0"
reqwest = { version = "0.13.4", features = ["json"] }
reqwest = { version = "0.13.5", features = ["json"] }
semver = "1.0.28"
serde = { version = "1.0.229", features = ["derive"] }
serde_json = "1.0.151"
serde_json = "1.0.154"
strum = "0.28.0"
strum_macros = "0.28.0"
tokio = { version = "1.53.1", features = ["rt-multi-thread"] }
tokio = { version = "1.53.3", features = ["rt-multi-thread"] }

# The profile that 'cargo dist' will build with
[profile.dist]
Expand Down
5 changes: 2 additions & 3 deletions src/tg_handler/blacklist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ impl TGClient {
return Ok(());
}
};
self.send(ProcessResult::BlackListUser(UnpackedBlacklistedUser::new(
tg_chat,
self.name(),
self.send(ProcessResult::BlackListUser(Box::new(
UnpackedBlacklistedUser::new(tg_chat, self.name()),
)));
Ok(())
}
Expand Down
6 changes: 3 additions & 3 deletions src/tg_handler/communication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub enum ProcessResult {
InitialSessionSuccess((Vec<TGClient>, Vec<String>, Vec<String>)),
InvalidChat(String),
UnauthorizedClient(String),
CountingMessage(TGCountData),
CountingMessage(Box<TGCountData>),
CountingEnd((i32, i32)),
ProcessFailed(ProcessError),
LoginCodeSent(LoginToken, TGClient),
Expand All @@ -22,8 +22,8 @@ pub enum ProcessResult {
UnpackedWhitelist(Vec<UnpackedWhitelistedUser>, i32),
UnpackedBlacklist(Vec<UnpackedBlacklistedUser>, i32),
FloodWait,
WhiteListUser(UnpackedWhitelistedUser),
BlackListUser(UnpackedBlacklistedUser),
WhiteListUser(Box<UnpackedWhitelistedUser>),
BlackListUser(Box<UnpackedBlacklistedUser>),
ChatExists(String, i32, i32),
}

Expand Down
2 changes: 1 addition & 1 deletion src/tg_handler/counter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ impl TGClient {
last_number,
multi_session,
);
self.send(ProcessResult::CountingMessage(count_data));
self.send(ProcessResult::CountingMessage(Box::new(count_data)));
last_number = message_num;
}

Expand Down
5 changes: 2 additions & 3 deletions src/tg_handler/whitelist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ impl TGClient {
return Ok(());
}
};
self.send(ProcessResult::WhiteListUser(UnpackedWhitelistedUser::new(
tg_chat,
self.name(),
self.send(ProcessResult::WhiteListUser(Box::new(
UnpackedWhitelistedUser::new(tg_chat, self.name()),
)));
Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion src/ui_components/initializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ impl App for MainWindow {

if self.new_version_body.lock().unwrap().is_some() {
let modal_text = self.new_version_body.lock().unwrap().clone().unwrap();
let modal = Modal::new(Id::new("version_modal")).show(ui.ctx(), |ui| {
let modal = Modal::new(Id::unique("version_modal")).show(ui.ctx(), |ui| {
ui.set_width(300.0);
ui.set_height(300.0);

Expand Down
2 changes: 1 addition & 1 deletion src/ui_components/processor/version_checker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ fn parse_github_body(body: &str) -> String {
let body = body.replace('*', "•");
let body = body.replace('\r', "");
let end_point = body.find("## Changes").unwrap();
format!("\n{}\n", &body[..end_point].trim())
format!("\n{}\n", body[..end_point].trim())
}
4 changes: 2 additions & 2 deletions src/ui_components/tab_ui/charts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ impl ChartsData {
}

fn show_modal_popup(&mut self, ui: &mut Ui) {
let response = Modal::new(Id::new("customize_view")).show(ui.ctx(), |ui| {
let response = Modal::new(Id::unique("customize_view")).show(ui.ctx(), |ui| {
ui.set_width(400.0);
ui.set_height(350.0);
Panel::top("customize_top_view").show(ui, |ui| {
Expand All @@ -254,7 +254,7 @@ impl ChartsData {
});
});

Panel::bottom(Id::new("customize_bottom_view")).show(ui, |ui| {
Panel::bottom(Id::unique("customize_bottom_view")).show(ui, |ui| {
ui.add_space(5.0);
ui.vertical_centered_justified(|ui| {
if ui.button("Confirm").clicked() {
Expand Down
10 changes: 5 additions & 5 deletions src/ui_components/tab_ui/counter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ impl MainWindow {
ui.label("Messages Checked:")
});
ui.with_layout(Layout::left_to_right(Align::Center), |ui| {
ui.label(format!("{}", &mut self.count().total_message));
ui.label(format!("{}", self.count().total_message));
});

ui.end_row();
Expand All @@ -229,7 +229,7 @@ impl MainWindow {
ui.label("Whitelisted Messages:")
});
ui.with_layout(Layout::left_to_right(Align::Center), |ui| {
ui.label(format!("{}", &mut self.count().whitelisted_message));
ui.label(format!("{}", self.count().whitelisted_message));
});

ui.end_row();
Expand All @@ -238,7 +238,7 @@ impl MainWindow {
ui.label("Users Found:")
});
ui.with_layout(Layout::left_to_right(Align::Center), |ui| {
ui.label(format!("{}", &mut self.count().total_user));
ui.label(format!("{}", self.count().total_user));
});

ui.end_row();
Expand All @@ -247,7 +247,7 @@ impl MainWindow {
ui.label("Whitelisted Users:")
});
ui.with_layout(Layout::left_to_right(Align::Center), |ui| {
ui.label(format!("{}", &mut self.count().total_whitelisted()));
ui.label(format!("{}", self.count().total_whitelisted()));
});

ui.end_row();
Expand All @@ -256,7 +256,7 @@ impl MainWindow {
ui.label("Deleted Message:")
});
ui.with_layout(Layout::left_to_right(Align::Center), |ui| {
ui.label(format!("{}", &mut self.count().deleted_message));
ui.label(format!("{}", self.count().deleted_message));
});

ui.end_row();
Expand Down
13 changes: 4 additions & 9 deletions src/ui_components/widgets/animated_label.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use eframe::egui::{
CornerRadius, Id, LayerId, Order, Response, Sense, Stroke, StrokeKind, TextStyle, Ui, Vec2,
Widget, WidgetInfo, WidgetText, WidgetType,
CornerRadius, Id, LayerId, Order, Response, Role, Sense, Stroke, StrokeKind, TextStyle, Ui,
Vec2, Widget, WidgetInfo, WidgetText,
};
use eframe::emath::GuiRounding;

Expand Down Expand Up @@ -63,12 +63,7 @@ impl Widget for AnimatedLabel {
let (rect, response) = ui.allocate_exact_size(desired_size, Sense::click());

response.widget_info(|| {
WidgetInfo::selected(
WidgetType::SelectableLabel,
ui.is_enabled(),
selected,
text.text(),
)
WidgetInfo::selected(Role::Button, ui.is_enabled(), selected, text.text())
});

if ui.is_rect_visible(response.rect) {
Expand Down Expand Up @@ -152,7 +147,7 @@ impl Widget for AnimatedLabel {

ui.painter()
.clone()
.with_layer_id(LayerId::new(Order::Background, Id::new("text_layer")))
.with_layer_id(LayerId::new(Order::Background, Id::unique("text_layer")))
.galley(text_pos, text_galley, visuals.text_color());

if separator_right {
Expand Down
9 changes: 2 additions & 7 deletions src/ui_components/widgets/row_label.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use eframe::egui::{
Response, Sense, StrokeKind, TextStyle, Ui, Widget, WidgetInfo, WidgetText, WidgetType,
Response, Role, Sense, StrokeKind, TextStyle, Ui, Widget, WidgetInfo, WidgetText,
};
use eframe::emath::NumExt;
use eframe::epaint::Color32;
Expand Down Expand Up @@ -38,12 +38,7 @@ impl Widget for RowLabel {
desired_size.y = desired_size.y.at_least(ui.spacing().interact_size.y);
let (rect, response) = ui.allocate_at_least(desired_size, Sense::click());
response.widget_info(|| {
WidgetInfo::selected(
WidgetType::SelectableLabel,
ui.is_enabled(),
selected,
text.text(),
)
WidgetInfo::selected(Role::Button, ui.is_enabled(), selected, text.text())
});

if ui.is_rect_visible(response.rect) {
Expand Down