Skip to content

Commit

Permalink
🚧 main: use helper function for messagedialog
Browse files Browse the repository at this point in the history
  • Loading branch information
vnepogodin committed Aug 5, 2024
1 parent b4d50c9 commit ce72784
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,12 @@ fn quick_message(message: String) {

if !status {
let window_ref = unsafe { &G_HELLO_WINDOW.as_ref().unwrap().window };
let errordialog = gtk::MessageDialog::builder()
.transient_for(window_ref)
.message_type(gtk::MessageType::Error)
.text(fl!("offline-error"))
.title(message)
.modal(true)
.buttons(gtk::ButtonsType::Ok)
.build();
errordialog.connect_response(|dialog, _| dialog.close());

errordialog.show();
utils::show_simple_dialog(
window_ref,
gtk::MessageType::Error,
&fl!("offline-error"),
message,
);
return;
}

Expand Down

0 comments on commit ce72784

Please sign in to comment.