mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
implement IMPORT_PEM apply
This commit is contained in:
parent
67ab5bb57e
commit
867a02a191
5 changed files with 30 additions and 18 deletions
|
|
@ -122,10 +122,16 @@ impl Gemini {
|
|||
profile
|
||||
.identity
|
||||
.gemini
|
||||
.create(None, &widget.form.name.value().unwrap())
|
||||
.unwrap(), // @TODO handle result,
|
||||
.make(None, &widget.form.name.value().unwrap())
|
||||
.unwrap(),
|
||||
),
|
||||
Value::IMPORT_PEM => Some(
|
||||
profile
|
||||
.identity
|
||||
.gemini
|
||||
.add(&widget.form.file.pem.take().unwrap())
|
||||
.unwrap(),
|
||||
),
|
||||
Value::IMPORT_PEM => Some(0), // @TODO
|
||||
};
|
||||
|
||||
// Apply
|
||||
|
|
|
|||
|
|
@ -40,15 +40,15 @@ impl Form {
|
|||
let file = file.clone();
|
||||
let name = name.clone();
|
||||
let update = action.update.clone();
|
||||
move |key| {
|
||||
move |item| {
|
||||
// Change name entry visibility
|
||||
name.show(match key {
|
||||
name.show(match item {
|
||||
Value::GENERATE_NEW_AUTH => true,
|
||||
_ => false,
|
||||
});
|
||||
|
||||
// Change file choose button visibility
|
||||
file.show(match key {
|
||||
file.show(match item {
|
||||
Value::IMPORT_PEM => true,
|
||||
_ => false,
|
||||
});
|
||||
|
|
@ -70,7 +70,7 @@ impl Form {
|
|||
|
||||
// Actions
|
||||
|
||||
/// Validate form in current set
|
||||
/// Validate `Self` components match current selection
|
||||
pub fn is_valid(&self) -> bool {
|
||||
match self.list.selected() {
|
||||
Value::GENERATE_NEW_AUTH => self.name.is_valid(),
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ const LABEL: &str = "Choose file..";
|
|||
const MARGIN: i32 = 8;
|
||||
|
||||
pub struct File {
|
||||
pem: Rc<RefCell<Option<GString>>>,
|
||||
pub pem: Rc<RefCell<Option<GString>>>,
|
||||
pub gobject: Button,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue