summaryrefslogtreecommitdiffstats
path: root/lan-mouse-gtk/src/key_object.rs
blob: 17172438ed30e0773bc442356e0292cfc2cc6fea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
mod imp;

use adw::subclass::prelude::*;
use gtk::glib::{self, Object};

glib::wrapper! {
    pub struct KeyObject(ObjectSubclass<imp::KeyObject>);
}

impl KeyObject {
    pub fn new(desc: String, fp: String) -> Self {
        Object::builder()
            .property("description", desc)
            .property("fingerprint", fp)
            .build()
    }

    pub fn get_description(&self) -> String {
        self.imp().description.borrow().clone()
    }

    pub fn get_fingerprint(&self) -> String {
        self.imp().fingerprint.borrow().clone()
    }
}