mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-09-14 16:02:05 +00:00
convert the identifier to upper camel case
This commit is contained in:
parent
5e9590afdf
commit
582e94a7ab
@ -31,21 +31,21 @@ impl Gemini {
|
|||||||
|
|
||||||
// Add guest option
|
// Add guest option
|
||||||
widget.form.list.append(
|
widget.form.list.append(
|
||||||
Value::USE_GUEST_SESSION,
|
Value::UseGuestSession,
|
||||||
"Guest session",
|
"Guest session",
|
||||||
"No identity for this request",
|
"No identity for this request",
|
||||||
);
|
);
|
||||||
|
|
||||||
// Add new identity option
|
// Add new identity option
|
||||||
widget.form.list.append(
|
widget.form.list.append(
|
||||||
Value::GENERATE_NEW_AUTH,
|
Value::GenerateNewAuth,
|
||||||
"Create new",
|
"Create new",
|
||||||
"Generate long-term certificate",
|
"Generate long-term certificate",
|
||||||
);
|
);
|
||||||
|
|
||||||
// Add import existing identity option
|
// Add import existing identity option
|
||||||
widget.form.list.append(
|
widget.form.list.append(
|
||||||
Value::IMPORT_PEM,
|
Value::ImportPem,
|
||||||
"Import identity",
|
"Import identity",
|
||||||
"Use existing certificate",
|
"Use existing certificate",
|
||||||
);
|
);
|
||||||
@ -65,7 +65,7 @@ impl Gemini {
|
|||||||
|
|
||||||
// Append record option
|
// Append record option
|
||||||
widget.form.list.append(
|
widget.form.list.append(
|
||||||
Value::PROFILE_IDENTITY_GEMINI_ID(identity.id),
|
Value::ProfileIdentityGeminiId(identity.id),
|
||||||
&certificate.subject_name().unwrap().replace("CN=", ""), // trim prefix
|
&certificate.subject_name().unwrap().replace("CN=", ""), // trim prefix
|
||||||
&format!(
|
&format!(
|
||||||
"valid until {} | auth: {}",
|
"valid until {} | auth: {}",
|
||||||
@ -116,16 +116,16 @@ impl Gemini {
|
|||||||
move |response| {
|
move |response| {
|
||||||
// Get option match user choice
|
// Get option match user choice
|
||||||
let option = match response {
|
let option = match response {
|
||||||
Value::PROFILE_IDENTITY_GEMINI_ID(value) => Some(value),
|
Value::ProfileIdentityGeminiId(value) => Some(value),
|
||||||
Value::USE_GUEST_SESSION => None,
|
Value::UseGuestSession => None,
|
||||||
Value::GENERATE_NEW_AUTH => Some(
|
Value::GenerateNewAuth => Some(
|
||||||
profile
|
profile
|
||||||
.identity
|
.identity
|
||||||
.gemini
|
.gemini
|
||||||
.make(None, &widget.form.name.value().unwrap())
|
.make(None, &widget.form.name.value().unwrap())
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
),
|
),
|
||||||
Value::IMPORT_PEM => Some(
|
Value::ImportPem => Some(
|
||||||
profile
|
profile
|
||||||
.identity
|
.identity
|
||||||
.gemini
|
.gemini
|
||||||
|
@ -43,13 +43,13 @@ impl Form {
|
|||||||
move |item| {
|
move |item| {
|
||||||
// Change name entry visibility
|
// Change name entry visibility
|
||||||
name.show(match item {
|
name.show(match item {
|
||||||
Value::GENERATE_NEW_AUTH => true,
|
Value::GenerateNewAuth => true,
|
||||||
_ => false,
|
_ => false,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Change file choose button visibility
|
// Change file choose button visibility
|
||||||
file.show(match item {
|
file.show(match item {
|
||||||
Value::IMPORT_PEM => true,
|
Value::ImportPem => true,
|
||||||
_ => false,
|
_ => false,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -73,8 +73,8 @@ impl Form {
|
|||||||
/// Validate `Self` components match current selection
|
/// Validate `Self` components match current selection
|
||||||
pub fn is_valid(&self) -> bool {
|
pub fn is_valid(&self) -> bool {
|
||||||
match self.list.selected() {
|
match self.list.selected() {
|
||||||
Value::GENERATE_NEW_AUTH => self.name.is_valid(),
|
Value::GenerateNewAuth => self.name.is_valid(),
|
||||||
Value::IMPORT_PEM => self.file.is_valid(),
|
Value::ImportPem => self.file.is_valid(),
|
||||||
_ => true,
|
_ => true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,10 +23,10 @@ impl Item {
|
|||||||
.property(
|
.property(
|
||||||
"value",
|
"value",
|
||||||
match value {
|
match value {
|
||||||
Value::GENERATE_NEW_AUTH => G_VALUE_GENERATE_NEW_AUTH,
|
Value::GenerateNewAuth => G_VALUE_GENERATE_NEW_AUTH,
|
||||||
Value::IMPORT_PEM => G_VALUE_IMPORT_PEM,
|
Value::ImportPem => G_VALUE_IMPORT_PEM,
|
||||||
Value::USE_GUEST_SESSION => G_VALUE_USE_GUEST_SESSION,
|
Value::UseGuestSession => G_VALUE_USE_GUEST_SESSION,
|
||||||
Value::PROFILE_IDENTITY_GEMINI_ID(value) => value,
|
Value::ProfileIdentityGeminiId(value) => value,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.property("title", title)
|
.property("title", title)
|
||||||
@ -39,10 +39,10 @@ impl Item {
|
|||||||
/// Get `value` as enum `Value`
|
/// Get `value` as enum `Value`
|
||||||
pub fn value_enum(&self) -> Value {
|
pub fn value_enum(&self) -> Value {
|
||||||
match self.value() {
|
match self.value() {
|
||||||
G_VALUE_GENERATE_NEW_AUTH => Value::GENERATE_NEW_AUTH,
|
G_VALUE_GENERATE_NEW_AUTH => Value::GenerateNewAuth,
|
||||||
G_VALUE_IMPORT_PEM => Value::IMPORT_PEM,
|
G_VALUE_IMPORT_PEM => Value::ImportPem,
|
||||||
G_VALUE_USE_GUEST_SESSION => Value::USE_GUEST_SESSION,
|
G_VALUE_USE_GUEST_SESSION => Value::UseGuestSession,
|
||||||
value => Value::PROFILE_IDENTITY_GEMINI_ID(value),
|
value => Value::ProfileIdentityGeminiId(value),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum Value {
|
pub enum Value {
|
||||||
GENERATE_NEW_AUTH,
|
GenerateNewAuth,
|
||||||
IMPORT_PEM,
|
ImportPem,
|
||||||
PROFILE_IDENTITY_GEMINI_ID(i64),
|
ProfileIdentityGeminiId(i64),
|
||||||
USE_GUEST_SESSION,
|
UseGuestSession,
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user