Skip to content

Commit

Permalink
Substitutes clipboard crate for clipper crate
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashy5000 committed Jul 27, 2024
1 parent 3e62299 commit 3dbc641
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 48 deletions.
157 changes: 114 additions & 43 deletions gui_wallet/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gui_wallet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ edition = "2021"
[dependencies]
iced = "0.12.0"
regex = "1.3.9"
clipboard = "0.5.0"
clippers = "0.1.2"
7 changes: 3 additions & 4 deletions gui_wallet/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ You should have received a copy of the GNU General Public License along with thi
use crate::send::send;
use iced::widget::{button, column, container, row, rule, scrollable, text, text_input, Space};
use iced::{Alignment, Element, Sandbox, Settings};
use clipboard::{ClipboardContext, ClipboardProvider};
use clippers::Clipboard;

mod send;
mod sync;
Expand Down Expand Up @@ -92,9 +92,8 @@ impl Sandbox for App {
}
Message::Copy => {
let public_key = key::get_public_key().expect("Failed to get public key");
let mut ctx: ClipboardContext = ClipboardProvider::new().unwrap();
ctx.set_contents(public_key.clone()).unwrap();
assert_eq!(ctx.get_contents().unwrap(), public_key);
let mut clipboard = Clipboard::get();
clipboard.write_text(public_key).unwrap();
}
}
}
Expand Down

0 comments on commit 3dbc641

Please sign in to comment.