From 2c1be806a93432bb6da22150d365ee145bdf3bb0 Mon Sep 17 00:00:00 2001 From: ardocrat Date: Wed, 24 Apr 2024 02:08:10 +0300 Subject: [PATCH] ui: tx info modal title --- locales/en.yml | 1 + locales/ru.yml | 1 + src/gui/views/wallets/wallet/txs.rs | 35 +++++++++++++++-------------- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/locales/en.yml b/locales/en.yml index 7ad1288..ffe2c67 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -67,6 +67,7 @@ wallets: tx_finalizing: Finalizing tx_confirmed: Confirmed txs: Transactions + tx: Transaction input_finalize_desc: 'Enter message to finalize the transaction:' messages: Messages transport: Transport diff --git a/locales/ru.yml b/locales/ru.yml index cc05e2a..e0a5142 100644 --- a/locales/ru.yml +++ b/locales/ru.yml @@ -67,6 +67,7 @@ wallets: tx_finalizing: Завершение tx_confirmed: Подтверждено txs: Транзакции + tx: Транзакция input_finalize_desc: 'Введите полученное сообщение для завершения транзакции:' messages: Сообщения transport: Транспорт diff --git a/src/gui/views/wallets/wallet/txs.rs b/src/gui/views/wallets/wallet/txs.rs index 2ff0dd5..14f5525 100644 --- a/src/gui/views/wallets/wallet/txs.rs +++ b/src/gui/views/wallets/wallet/txs.rs @@ -210,6 +210,24 @@ impl WalletTransactions { } } + /// Show transaction information [`Modal`]. + fn show_tx_info_modal(&mut self, wallet: &Wallet, tx: &WalletTransaction) { + self.tx_info_response_edit = "".to_string(); + self.tx_info_finalize_edit = "".to_string(); + self.tx_info_finalize_error = false; + self.tx_info_id = Some(tx.data.id); + // Setup slate and message from transaction. + if let Some((slate, message)) = wallet.read_slate_by_tx(tx) { + self.tx_info_response_edit = message; + self.tx_info_slate = Some(slate); + } + // Show transaction information modal. + Modal::new(TX_INFO_MODAL) + .position(ModalPosition::CenterTop) + .title(t!("wallets.tx")) + .show(); + } + /// Draw transaction item. fn tx_item_ui(&mut self, ui: &mut egui::Ui, @@ -422,23 +440,6 @@ impl WalletTransactions { }); } - /// Show transaction information [`Modal`]. - fn show_tx_info_modal(&mut self, wallet: &Wallet, tx: &WalletTransaction) { - self.tx_info_response_edit = "".to_string(); - self.tx_info_finalize_edit = "".to_string(); - self.tx_info_finalize_error = false; - self.tx_info_id = Some(tx.data.id); - // Setup slate and message from transaction. - if let Some((slate, message)) = wallet.read_slate_by_tx(tx) { - self.tx_info_response_edit = message; - self.tx_info_slate = Some(slate); - } - // Show transaction information modal. - Modal::new(TX_INFO_MODAL) - .position(ModalPosition::CenterTop) - .show(); - } - /// Draw transaction info [`Modal`] content. fn tx_info_modal_ui(&mut self, ui: &mut egui::Ui,