Skip to content

Commit

Permalink
yes
Browse files Browse the repository at this point in the history
  • Loading branch information
marci1175 committed Aug 20, 2024
1 parent 08e9d57 commit c2e658e
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 65 deletions.
Binary file modified desktop/Installer/.vs/Matthias/v17/.suo
Binary file not shown.
2 changes: 1 addition & 1 deletion desktop/Installer/.vs/Matthias/v17/DocumentLayout.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\marci\\Desktop\\szeChat\\Installer\\",
"WorkspaceRootPath": "C:\\Users\\marci\\Desktop\\szeChat\\desktop\\Installer\\",
"Documents": [],
"DocumentGroupContainers": [
{
Expand Down
16 changes: 12 additions & 4 deletions desktop/Installer/MatthiasSetup/MatthiasSetup.vdproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
}
"Entry"
{
"MsmKey" = "8:_D6C27F0C96B8402C9C5D9B86D44C56BF"
"MsmKey" = "8:_C6C1D853DC844121B46D77FC8E936FAC"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
}
Expand Down Expand Up @@ -169,6 +169,14 @@
"PrerequisitesLocation" = "2:1"
"Url" = "8:"
"ComponentsUrl" = "8:"
"Items"
{
"{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:.NETFramework,Version=v4.7.2"
{
"Name" = "8:Microsoft .NET Framework 4.7.2 (x86 and x64)"
"ProductCode" = "8:.NETFramework,Version=v4.7.2"
}
}
}
}
}
Expand Down Expand Up @@ -211,9 +219,9 @@
"IsDependency" = "11:FALSE"
"IsolateTo" = "8:"
}
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_D6C27F0C96B8402C9C5D9B86D44C56BF"
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_C6C1D853DC844121B46D77FC8E936FAC"
{
"SourcePath" = "8:..\\..\\target\\release\\matthias.exe"
"SourcePath" = "8:..\\..\\..\\target\\release\\matthias.exe"
"TargetName" = "8:matthias.exe"
"Tag" = "8:"
"Folder" = "8:_A83CD10A04134DA4BBA2C9AD1F266D25"
Expand Down Expand Up @@ -488,7 +496,7 @@
"ShowCmd" = "3:1"
"IconIndex" = "3:0"
"Transitive" = "11:FALSE"
"Target" = "8:_D6C27F0C96B8402C9C5D9B86D44C56BF"
"Target" = "8:_C6C1D853DC844121B46D77FC8E936FAC"
"Folder" = "8:_39418F417EB549CC90C4A25FB94B13F0"
"WorkingFolder" = "8:_A83CD10A04134DA4BBA2C9AD1F266D25"
"Icon" = "8:"
Expand Down
Binary file modified desktop/Installer/MatthiasSetup/Release/MatthiasSetup.msi
Binary file not shown.
2 changes: 1 addition & 1 deletion desktop/build_info.matthias_build
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024.08.20. 20:44
2024.08.20. 22:07
1 change: 1 addition & 0 deletions desktop/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ impl eframe::App for backend::Application
TODO: Add AI (Neural network) powered hand drawing recognition
TODO: Recode audio file playbacking
TODO: Rework file uploads on server
*/

//Check for startup args
Expand Down
4 changes: 2 additions & 2 deletions desktop/src/app/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,7 @@ impl MessageService
FileUpload(inner) => {
//We should match the upload type more specificly
match inner.extension.clone().unwrap_or_default().as_str() {
"png" | "jpeg" | "bmp" | "tiff" | "webp" => Image,
"png" | "jpeg" | "bmp" | "tiff" | "webp" | "gif" | "jpg" => Image,
"wav" | "mp3" | "m4a" => Audio,
_ => Upload,
}
Expand Down Expand Up @@ -1673,7 +1673,7 @@ impl MessageService

//Pattern match on upload tpye so we know how to handle the specific request
match upload_type.extension.clone().unwrap_or_default().as_str() {
"png" | "jpeg" | "bmp" | "tiff" | "webp" => self.recive_image(req, upload_type).await,
"png" | "jpeg" | "bmp" | "tiff" | "webp" | "gif" | "jpg" => self.recive_image(req, upload_type).await,
"wav" | "mp3" | "m4a" => self.recive_audio(req, upload_type).await,
//Define file types and how should the server handle them based on extension, NOTICE: ENSURE CLIENT COMPATIBILITY
_ => self.recive_file(req, upload_type).await,
Expand Down
94 changes: 39 additions & 55 deletions desktop/src/app/ui/client_ui/message_instances/message_display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::app::backend::{
parse_incoming_message, write_file, Application, ClientMessage, ClientProfile, MessageDisplay,
ServerFileReply, ServerImageUpload, ServerMessageType,
};
use rodio::{Decoder, Source};
use rodio::Decoder;

//use crate::app::account_manager::write_file;
use crate::app::backend::PlaybackCursor;
Expand Down Expand Up @@ -88,9 +88,13 @@ impl Application
let image_widget = ui.add(egui::widgets::Image::from_uri(
format!("bytes://{}", picture.signature),
));

if image_widget.interact(Sense::click()).clicked() {
self.client_ui.image_overlay = true;

ctx.include_bytes(format!("bytes://large_image_display"), bytes.clone());
}

image_widget.context_menu(|ui| {
if ui.button("Save").clicked() {
//always name the file ".png", NOTE: USE WRITE FILE BECAUSE WRITE IMAGE IS AUTOMATIC WITHOUT ASKING THE USER
Expand All @@ -101,8 +105,9 @@ impl Application
let _ = crate::app::backend::write_file(image_save);
}
});

if self.client_ui.image_overlay {
self.image_overlay_draw(ui, ctx, bytes.to_vec(), picture);
self.image_overlay_draw(ctx, bytes.to_vec());
}
}
}
Expand Down Expand Up @@ -273,29 +278,6 @@ impl Application
);
}

/*
let pos = self.client_ui.audio_playback.settings_list[current_index_in_message_list].cursor_offset;
if let Some(cursor) = self.client_ui.audio_playback.settings_list[current_index_in_message_list].cursor.as_mut() {
cursor.set_position(pos);
let range = self.client_ui.audio_playback.settings_list
[current_index_in_message_list]
.cursor.clone().unwrap().position() + self.client_ui.audio_playback.settings_list
[current_index_in_message_list]
.cursor.clone().unwrap().remaining_slice().len() as u64;
//Cursor
ui.add(
egui::Slider::new(
&mut self.client_ui.audio_playback.settings_list
[current_index_in_message_list]
.cursor_offset,
0..=range,
)
.text("Volume")
.step_by(1.)
);
}
*/

ui.label(&audio.file_name);
//Audio volume
ui.add(
Expand Down Expand Up @@ -435,43 +417,17 @@ impl Application

pub fn image_overlay_draw(
&mut self,
ui: &mut egui::Ui,
ctx: &Context,
image_bytes: Vec<u8>,
picture: &ServerImageUpload,
)
{
Area::new("image_bg".into())
.movable(false)
.anchor(Align2::CENTER_CENTER, vec2(0., 0.))
.default_size(ctx.used_size())
.show(ctx, |ui| {
//Pain background
ui.painter()
.clone()
.with_layer_id(LayerId::background())
.rect_filled(
egui::Rect::EVERYTHING,
0.,
Color32::from_rgba_premultiplied(0, 0, 0, 170),
);

if ui
.allocate_response(ui.available_size(), Sense::click())
.clicked()
{
self.client_ui.image_overlay = false;
}
});

Area::new("image_overlay".into())
Area::new("large_image_display".into())
.movable(false)
.anchor(Align2::CENTER_CENTER, vec2(0., 0.))
.show(ctx, |ui| {
ui.allocate_ui(ui.available_size(), |ui| {
ui.add(egui::widgets::Image::from_bytes(
format!("bytes://{}", picture.signature),
image_bytes.clone(),
ui.allocate_ui(ctx.used_size() / 2., |ui| {
ui.add(egui::widgets::Image::from_uri(
"bytes://large_image_display",
)) /*Add the same context menu as before*/
.context_menu(|ui| {
if ui.button("Save").clicked() {
Expand All @@ -498,8 +454,36 @@ impl Application
.clicked()
{
self.client_ui.image_overlay = false;

//Forget imagge
ctx.forget_image("bytes://large_image_display");
}
})
});

Area::new("image_bg".into())
.movable(false)
.anchor(Align2::CENTER_CENTER, vec2(0., 0.))
.default_size(ctx.used_size())
.show(ctx, |ui| {
//Pain background
ui.painter()
.clone()
.with_layer_id(LayerId::background())
.rect_filled(
egui::Rect::EVERYTHING,
0.,
Color32::from_rgba_premultiplied(0, 0, 0, 170),
);

if ui
.allocate_response(ui.available_size(), Sense::click())
.clicked()
{
self.client_ui.image_overlay = false;
//Forget imagge
ctx.forget_image("bytes://large_image_display");
}
});
}
}
2 changes: 1 addition & 1 deletion desktop/src/app/ui/register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ impl Application
}
else if ui.button("Upload picture").clicked() {
let app_data_path = rfd::FileDialog::new()
.add_filter("Supported formats", &["png"])
.add_filter("Supported formats (.png, .jpg)", &["png", "jpg"])
.pick_file();

if let Some(app_data_path) = app_data_path {
Expand Down
2 changes: 1 addition & 1 deletion mobile/build_info.matthias_build
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024.08.20. 20:44
2024.08.20. 22:07

0 comments on commit c2e658e

Please sign in to comment.