Lint updates: introduce documentation strings
* correctemitted missind strings emitted via 'missing_docs' macro Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
@@ -6,164 +6,310 @@
|
||||
*/
|
||||
|
||||
// Component Values (Properties)
|
||||
/// Apps property name
|
||||
pub static PROP_ADVOTRACKER: &str = "advotracker";
|
||||
|
||||
/// Mail header property first 'CC'
|
||||
pub static PROP_MAIL_CC_1: &str = "service@hiedemann.de";
|
||||
/// Mail header property second 'CC'
|
||||
pub static PROP_MAIL_CC_2: &str = "info@hiedemann.de";
|
||||
/// Mail header property first 'BCC'
|
||||
pub static PROP_MAIL_BCC_1: &str = "Networkx Support <support@networkx.de>";
|
||||
/// Mail header property second 'BCC'
|
||||
pub static PROP_MAIL_BCC_2: &str = "knoche@hiedemann.de";
|
||||
/// Mail header property 'From': sender name
|
||||
pub static PROP_MAIL_FROM: &str = "Kanzlei Hiedemann <service@hiedemann.de>";
|
||||
/// Mail header property 'Reply-To': return mails to sender name
|
||||
pub static PROP_MAIL_REPLY: &str = "Kanzlei Hiedemann <service@hiedemann.de>";
|
||||
/// Mail header property 'Subject': mail subject
|
||||
pub static PROP_MAIL_SUBJECT: &str = "ZMB Allianz - neues Mandat";
|
||||
/// Mail header first List-Entry 'Recpt-To': recipient name
|
||||
pub static PROP_MAIL_TO_1: &str = "allianz@ponschab-partner.com";
|
||||
/// Mail header second List-Entry 'Recpt-To': recipient name
|
||||
pub static PROP_MAIL_TO_2: &str = "kontakt@chevalier.law";
|
||||
/// Mail header third List-Entry 'Recpt-To': recipient name
|
||||
pub static PROP_MAIL_TO_3: &str = "kontakt@metamedlaw.de";
|
||||
/// Mail header 4th List-Entry 'Recpt-To': recipient name
|
||||
pub static PROP_MAIL_TO_4: &str = "sekretariat@m2-mediation.de";
|
||||
/// Mail header 5th List-Entry 'Recpt-To': recipient name
|
||||
pub static PROP_MAIL_TO_5: &str = "ralf.zerres@networkx.de";
|
||||
|
||||
/// Property: policy_check
|
||||
pub static PROP_POLICY_CHECK: &str = "policy_check";
|
||||
/// Property: policy_progress_count
|
||||
pub static PROP_POLICY_PROGRESS_COUNT: &str = "policy_progress_count";
|
||||
|
||||
/// Property: policy_data_list
|
||||
pub static PROP_POLICY_DATA_LIST: &str = "policy_data_list";
|
||||
/// Property: policy_data_count
|
||||
pub static PROP_POLICY_DATA_COUNT: &str = "policy_data_count";
|
||||
|
||||
/// Property: policy_list
|
||||
pub static PROP_POLICY_LIST: &str = "policy_list";
|
||||
/// Property: policy_list_count
|
||||
pub static PROP_POLICY_LIST_COUNT: &str = "policy_list_count";
|
||||
|
||||
// Styles (RON based theme system)
|
||||
/// Style: bottom_bar
|
||||
pub static STYLE_BOTTOM_BAR: &str = "bottom_bar";
|
||||
/// Style: button_menu
|
||||
pub static STYLE_BUTTON_MENU: &str = "button_menu";
|
||||
/// Style: button_action
|
||||
pub static STYLE_BUTTON_ACTION: &str = "button_action";
|
||||
/// Style: container_action
|
||||
pub static STYLE_CONTAINER_ACTION: &str = "container_action";
|
||||
/// Style: container_mail
|
||||
pub static STYLE_CONTAINER_MAIL: &str = "container_mail";
|
||||
/// Style: header_bar
|
||||
pub static STYLE_HEADER_BAR: &str = "header_bar";
|
||||
/// Style: header_text
|
||||
pub static STYLE_HEADER_TEXT: &str = "header_text";
|
||||
/// Style: seperator
|
||||
pub static STYLE_SEPARATOR: &str = "separator";
|
||||
/// Style: mail_label
|
||||
pub static STYLE_MAIL_LABEL: &str = "mail_label";
|
||||
/// Style: mail_cc
|
||||
pub static STYLE_MAIL_TO: &str = "mail_to";
|
||||
/// Style: mail_cc
|
||||
pub static STYLE_MAIL_CC: &str = "mail_cc";
|
||||
/// Style: menu
|
||||
pub static STYLE_MENU: &str = "menu";
|
||||
/// Style: stack_action
|
||||
pub static STYLE_STACK_ACTION: &str = "stack_action";
|
||||
/// Style: stack_menu
|
||||
pub static STYLE_STACK_MENU: &str = "stack_menu";
|
||||
|
||||
// Widget IDs (DCES: Entity[id] => [Component1, .. , Component<n>] -> data or state)
|
||||
/// Entity-ID: Configuration
|
||||
pub static ID_CONFIGURATION_VIEW: &str = "Configuration";
|
||||
/// Entity-ID: configuration_form
|
||||
pub static ID_CONFIGURATION_FORM: &str = "configuration_form";
|
||||
/// Entity-ID: configuration_header
|
||||
pub static ID_CONFIGURATION_HEADER: &str = "configuration_header";
|
||||
/// Entity-ID: configuration_label_config_file
|
||||
pub static ID_CONFIGURATION_LABEL_CONFIG_FILE: &str = "configuration_label_config_file";
|
||||
/// Entity-ID: configuration_config_file
|
||||
pub static ID_CONFIGURATION_CONFIG_FILE: &str = "configuration_config_file";
|
||||
/// Entity-ID: configuration_lable_language
|
||||
pub static ID_CONFIGURATION_LABEL_LANGUAGE_ID: &str = "configuration_label_language_id";
|
||||
/// Entity-ID: configuration_language_id
|
||||
pub static ID_CONFIGURATION_LANGUAGE_ID: &str = "configuration_language_id";
|
||||
|
||||
/// Entity-ID: Localization
|
||||
pub static ID_LOCALIZATION_VIEW: &str = "Localization";
|
||||
/// Entity-ID: localization_form
|
||||
pub static ID_LOCALIZATION_FORM: &str = "localization_form";
|
||||
/// Entity-ID: localization_header
|
||||
pub static ID_LOCALIZATION_HEADER: &str = "localization_header";
|
||||
/// Entity-ID: localization_languages
|
||||
pub static ID_LOCALIZATION_LANGUAGES: &str = "localization_languages";
|
||||
/// Entity-ID: localization_label_language_name
|
||||
pub static ID_LOCALIZATION_LABEL_LANGUAGE_NAME: &str = "localization_label_language_name";
|
||||
/// Entity-ID: localization_language_name
|
||||
pub static ID_LOCALIZATION_LANGUAGE_NAME: &str = "localization_language_name";
|
||||
|
||||
/// Entity-ID: main_grid
|
||||
pub static ID_MAIN_GRID: &str = "main_grid";
|
||||
/// Entity-ID: main_tabwidget
|
||||
pub static ID_MAIN_TABWIDGET: &str = "main_tabwidget";
|
||||
/// Entity-ID: main_button_menu
|
||||
pub static ID_MAIN_BUTTON_MENU: &str = "main_button_menu";
|
||||
|
||||
/// Entity-ID: menu_view
|
||||
pub static ID_MENU_VIEW: &str = "menu_view";
|
||||
/// Entity-ID: menu_popup
|
||||
pub static ID_MENU_POPUP: &str = "menu_popup";
|
||||
/// Entity-ID: menu_stack
|
||||
pub static ID_MENU_STACK: &str = "menu_stack";
|
||||
/// Entity-ID: menu_bottom_bar
|
||||
pub static ID_MENU_BOTTOM_BAR: &str = "menu_bottom_bar";
|
||||
/// Entity-ID: menu_button
|
||||
pub static ID_MENU_BUTTON: &str = "menu_button";
|
||||
/// Entity-ID: menu_button_menu
|
||||
pub static ID_MENU_BUTTON_MENU: &str = "menu_button_menu";
|
||||
/// Entity-ID: menu_grid
|
||||
pub static ID_MENU_GRID: &str = "menu_grid";
|
||||
/// Entity-ID: menu_header
|
||||
pub static ID_MENU_HEADER: &str = "menu_header";
|
||||
/// Entity-ID: menu_header_bar
|
||||
pub static ID_MENU_HEADER_BAR: &str = "menu_header_bar";
|
||||
/// Entity-ID: menu_label_account
|
||||
pub static ID_MENU_LABEL_ACCOUNT: &str = "menu_label_account";
|
||||
/// Entity-ID: menu_label_quit
|
||||
pub static ID_MENU_LABEL_QUIT: &str = "menu_label_quit";
|
||||
/// Entity-ID: menu_labeltoggle_theme
|
||||
pub static ID_MENU_LABEL_TOGGLE_THEME: &str = "menu_label_toggle_theme";
|
||||
/// Entity-ID: menu_shortcut_quit
|
||||
pub static ID_MENU_SHORTCUT_QUIT: &str = "menu_shortcut_quit";
|
||||
/// Entity-ID: menu_toggle_theme
|
||||
pub static ID_MENU_TOGGLE_THEME: &str = "menu_toggle_theme";
|
||||
|
||||
/// Entity-ID: policy_ckeck_view
|
||||
pub static ID_POLICY_CHECK_VIEW: &str = "policy_check_view";
|
||||
/// Entity-ID: policy_ckeck_action_button_clear
|
||||
pub static ID_POLICY_CHECK_ACTION_BUTTON_CLEAR: &str = "policy_check_action_button_clear";
|
||||
/// Entity-ID: policy_ckeck_action_button_create
|
||||
pub static ID_POLICY_CHECK_ACTION_BUTTON_CREATE: &str = "policy_check_action_button_create";
|
||||
/// Entity-ID: policy_ckeck_action_grid
|
||||
pub static ID_POLICY_CHECK_ACTION_GRID: &str = "policy_check_action_grid";
|
||||
/// Entity-ID: policy_ckeck_action_stack
|
||||
pub static ID_POLICY_CHECK_ACTION_STACK: &str = "policy_check_action_stack";
|
||||
/// Entity-ID: policy_ckeck_bottom_bar
|
||||
pub static ID_POLICY_CHECK_BOTTOM_BAR: &str = "policy_check_bottom_bar";
|
||||
/// Entity-ID: policy_ckeck_button_result
|
||||
pub static ID_POLICY_CHECK_BUTTON_RESULT: &str = "policy_check_button_result";
|
||||
/// Entity-ID: policy_ckeck_button_menu
|
||||
pub static ID_POLICY_CHECK_BUTTON_MENU: &str = "policy_check_button_menu";
|
||||
/// Entity-ID: policy_ckeck_data_count_block
|
||||
pub static ID_POLICY_CHECK_DATA_COUNT_BLOCK: &str = "policy_check_data_count_block";
|
||||
/// Entity-ID: policy_ckeck_form
|
||||
pub static ID_POLICY_CHECK_FORM: &str = "policy_check_form";
|
||||
/// Entity-ID: policy_ckeck_header
|
||||
pub static ID_POLICY_CHECK_HEADER: &str = "policy_check_header";
|
||||
/// Entity-ID: policy_ckeck_header_bar
|
||||
pub static ID_POLICY_CHECK_HEADER_BAR: &str = "policy_check_header_bar";
|
||||
/// Entity-ID: policy_ckeck_hint
|
||||
pub static ID_POLICY_CHECK_HINT: &str = "policy_check_hint";
|
||||
/// Entity-ID: policy_ckeck_items_widget
|
||||
pub static ID_POLICY_CHECK_ITEMS_WIDGET: &str = "policy_check_items_widget";
|
||||
/// Entity-ID: policy_ckeck_label_hint
|
||||
pub static ID_POLICY_CHECK_LABEL_HINT: &str = "policy_check_label_hint";
|
||||
/// Entity-ID: policy_ckeck_label_menu
|
||||
pub static ID_POLICY_CHECK_LABEL_MENU: &str = "policy_check_label_menu";
|
||||
/// Entity-ID: policy_ckeck_label_policy_number
|
||||
pub static ID_POLICY_CHECK_LABEL_POLICY_NUMBER: &str = "policy_check_label_policy_number";
|
||||
/// Entity-ID: policy_ckeck_label_result
|
||||
pub static ID_POLICY_CHECK_LABEL_RESULT: &str = "policy_check_label_result";
|
||||
/// Entity-ID: policy_ckeck_policy_code
|
||||
pub static ID_POLICY_CHECK_POLICY_CODE: &str = "policy_check_policy_code";
|
||||
/// Entity-ID: policy_ckeck_policy_number
|
||||
pub static ID_POLICY_CHECK_POLICY_NUMBER: &str = "policy_number";
|
||||
/// Entity-ID: policy_ckeck_policy_progress
|
||||
pub static ID_POLICY_CHECK_POPUP_PROGRESS: &str = "policy_check_popup_progress";
|
||||
/// Entity-ID: policy_ckeck_policy_progress_bar
|
||||
pub static ID_POLICY_CHECK_PROGRESS_BAR: &str = "policy_check_progress_bar";
|
||||
/// Entity-ID: policy_ckeck_policy_progress_time
|
||||
pub static ID_POLICY_CHECK_PROGRESS_TIME: &str = "policy_check_progress_time";
|
||||
/// Entity-ID: policy_ckeck_policy_progress_text
|
||||
pub static ID_POLICY_CHECK_PROGRESS_TEXT: &str = "policy_check_progress_text";
|
||||
/// Entity-ID: policy_ckeck_result
|
||||
pub static ID_POLICY_CHECK_RESULT: &str = "policy_check_result";
|
||||
/// Entity-ID: policy_ckeck_widget
|
||||
pub static ID_POLICY_CHECK_WIDGET: &str = "policy_check_widget";
|
||||
|
||||
/// Entity-ID: policy_data_add_button
|
||||
pub static ID_POLICY_DATA_ADD_BUTTON: &str = "policy_data_add_button";
|
||||
/// Entity-ID: policy_data_count
|
||||
pub static ID_POLICY_DATA_COUNT: &str = "policy_data_count";
|
||||
/// Entity-ID: policy_data_label
|
||||
pub static ID_POLICY_DATA_LABEL: &str = "policy_data_label";
|
||||
/// Entity-ID: policy_data_items_widget
|
||||
pub static ID_POLICY_DATA_ITEMS_WIDGET: &str = "policy_data_items_widget";
|
||||
/// Entity-ID: policy_data_date_inserted
|
||||
pub static ID_POLICY_DATA_DATE_INSERTED: &str = "policy_data_date_inserted";
|
||||
/// Entity-ID: policy_data_dion
|
||||
pub static ID_POLICY_DATA_DION: &str = "policy_data_dion";
|
||||
/// Entity-ID: policy_data_policy_code
|
||||
pub static ID_POLICY_DATA_POLICY_CODE: &str = "policy_data_policy_code";
|
||||
/// Entity-ID: policy_data_policy_number
|
||||
pub static ID_POLICY_DATA_POLICY_NUMBER: &str = "policy_data_policy_number";
|
||||
/// Entity-ID: policy_data_stacl
|
||||
pub static ID_POLICY_DATA_STACK: &str = "policy_data_stack";
|
||||
/// Entity-ID: policy_data_status
|
||||
pub static ID_POLICY_DATA_STATUS: &str = "policy_data_status";
|
||||
/// Entity-ID: policy_data_list_name
|
||||
pub static ID_POLICY_DATA_LIST_NAME: &str = "policy_data_list_name";
|
||||
|
||||
/// Entity-ID: policy_list_add_button
|
||||
pub static ID_POLICY_LIST_ADD_BUTTON: &str = "policy_list_add_button";
|
||||
/// Entity-ID: policy_list_items_widget
|
||||
pub static ID_POLICY_LIST_ITEMS_WIDGET: &str = "policy_list_items_widget";
|
||||
/// Entity-ID: policy_list_text_box
|
||||
pub static ID_POLICY_LIST_TEXT_BOX: &str = "policy_list_text_box";
|
||||
|
||||
/// Entity-ID: ticket_data_action_button_clear
|
||||
pub static ID_TICKET_DATA_ACTION_BUTTON_CLEAR: &str = "ticket_data_action_button_clear";
|
||||
/// Entity-ID: ticket_data_action_button_send
|
||||
pub static ID_TICKET_DATA_ACTION_BUTTON_SEND: &str = "ticket_data_action_button_send";
|
||||
/// Entity-ID: ticket_data_action_grid
|
||||
pub static ID_TICKET_DATA_ACTION_GRID: &str = "ticket_data_action_grid";
|
||||
/// Entity-ID: ticket_data_action_stack
|
||||
pub static ID_TICKET_DATA_ACTION_STACK: &str = "ticket_data_action_stack";
|
||||
/// Entity-ID: ticket_data_bottom_bar
|
||||
pub static ID_TICKET_DATA_BOTTOM_BAR: &str = "ticket_data_bottom_bar";
|
||||
/// Entity-ID: ticket_data_button_menu
|
||||
pub static ID_TICKET_DATA_BUTTON_MENU: &str = "ticket_data_button_menu";
|
||||
/// Entity-ID: ticket_data_button_result
|
||||
pub static ID_TICKET_DATA_BUTTON_RESULT: &str = "ticket_data_button_result";
|
||||
/// Entity-ID: ticket_data_callback_date
|
||||
pub static ID_TICKET_DATA_CALLBACK_DATE: &str = "ticket_data_label_callback_date";
|
||||
/// Entity-ID: ticket_data_callback_number
|
||||
pub static ID_TICKET_DATA_CALLBACK_NUMBER: &str = "ticket_data_callback_number";
|
||||
/// Entity-ID: ticket_data_combo_box_mail_cc
|
||||
pub static ID_TICKET_DATA_COMBO_BOX_MAIL_CC: &str = "ticket_data_combo_box_mail_cc";
|
||||
/// Entity-ID: ticket_data_combo_box_mail_to
|
||||
pub static ID_TICKET_DATA_COMBO_BOX_MAIL_TO: &str = "ticket_data_combo_box_mail_to";
|
||||
/// Entity-ID: ticket_data_container_mail
|
||||
pub static ID_TICKET_DATA_CONTAINER_MAIL: &str = "ticket_data_container_mail";
|
||||
/// Entity-ID: ticket_data_count_block
|
||||
pub static ID_TICKET_DATA_COUNT_BLOCK: &str = "ticket_data_count_block";
|
||||
/// Entity-ID: ticket_data_deductible
|
||||
pub static ID_TICKET_DATA_DEDUCTIBLE: &str = "ticket_data_deductible";
|
||||
/// Entity-ID: ticket_data_from
|
||||
pub static ID_TICKET_DATA_FORM: &str = "ticket_data_form";
|
||||
/// Entity-ID: ticket_data_from_grid
|
||||
pub static ID_TICKET_DATA_FORM_GRID: &str = "ticket_data_form_grid";
|
||||
/// Entity-ID: ticket_data_grid
|
||||
pub static ID_TICKET_DATA_GRID: &str = "ticket_data_grid";
|
||||
/// Entity-ID: ticket_data_grid_mail
|
||||
pub static ID_TICKET_DATA_GRID_MAIL: &str = "ticket_data_grid_mail";
|
||||
/// Entity-ID: ticket_data_from_grid
|
||||
pub static ID_TICKET_DATA_HARM_TYPE: &str = "ticket_data_harm_type";
|
||||
/// Entity-ID: ticket_data_header_bar
|
||||
pub static ID_TICKET_DATA_HEADER_BAR: &str = "ticket_data_header_bar";
|
||||
/// Entity-ID: ticket_data_header
|
||||
pub static ID_TICKET_DATA_HEADER: &str = "ticket_data_header";
|
||||
/// Entity-ID: ticket_data_hint
|
||||
pub static ID_TICKET_DATA_HINT: &str = "ticket_data_hint";
|
||||
/// Entity-ID: ticket_data_items_widget
|
||||
pub static ID_TICKET_DATA_ITEMS_WIDGET: &str = "ticket_data_items_widget";
|
||||
/// Entity-ID: ticket_data_ivr_comment
|
||||
pub static ID_TICKET_DATA_IVR_COMMENT: &str = "ticket_data_ivr_comment";
|
||||
/// Entity-ID: ticket_data_label_callback_date
|
||||
pub static ID_TICKET_DATA_LABEL_CALLBACK_DATE: &str = "ticket_data_label_callback_data";
|
||||
/// Entity-ID: ticket_data_label_callback_number
|
||||
pub static ID_TICKET_DATA_LABEL_CALLBACK_NUMBER: &str = "ticket_data_label_callback_number";
|
||||
/// Entity-ID: ticket_data_label_deductible
|
||||
pub static ID_TICKET_DATA_LABEL_DEDUCTIBLE: &str = "ticket_data_label_deductible";
|
||||
/// Entity-ID: ticket_data_label_harm_type
|
||||
pub static ID_TICKET_DATA_LABEL_HARM_TYPE: &str = "ticket_data_label_harm_type";
|
||||
/// Entity-ID: ticket_data_label_hint
|
||||
pub static ID_TICKET_DATA_LABEL_HINT: &str = "ticket_data_label_hint";
|
||||
/// Entity-ID: ticket_data_label_ivr_comment
|
||||
pub static ID_TICKET_DATA_LABEL_IVR_COMMENT: &str = "ticket_data_label_ivr_comment";
|
||||
/// Entity-ID: ticket_data_label_mail_cc
|
||||
pub static ID_TICKET_DATA_LABEL_MAIL_CC: &str = "ticket_data_label_mail_cc";
|
||||
/// Entity-ID: ticket_data_label_mail_to
|
||||
pub static ID_TICKET_DATA_LABEL_MAIL_TO: &str = "ticket_data_label_mail_to";
|
||||
/// Entity-ID: ticket_data_label_menu
|
||||
pub static ID_TICKET_DATA_LABEL_MENU: &str = "ticket_data_label_menu";
|
||||
/// Entity-ID: ticket_data_label_policy_code
|
||||
pub static ID_TICKET_DATA_LABEL_POLICY_CODE: &str = "ticket_data_label_policy_code";
|
||||
/// Entity-ID: ticket_data_label_policy_holder
|
||||
pub static ID_TICKET_DATA_LABEL_POLICY_HOLDER: &str = "ticket_data_label_policy_holder";
|
||||
/// Entity-ID: ticket_data_logo_bar
|
||||
pub static ID_TICKET_DATA_LOGO_BAR: &str = "ticket_data_logo_bar";
|
||||
/// Entity-ID: ticket_data_mail_cc
|
||||
pub static ID_TICKET_DATA_MAIL_CC: &str = "ticket_data_mail_cc";
|
||||
/// Entity-ID: ticket_data_mail_to
|
||||
pub static ID_TICKET_DATA_MAIL_TO: &str = "ticket_data_mail_to";
|
||||
/// Entity-ID: ticket_data_policy_code
|
||||
pub static ID_TICKET_DATA_POLICY_CODE: &str = "ticket_data_policy_code";
|
||||
/// Entity-ID: ticket_data_policy_holder
|
||||
pub static ID_TICKET_DATA_POLICY_HOLDER: &str = "ticket_data_policy_holder";
|
||||
/// Entity-ID: ticket_data_result
|
||||
pub static ID_TICKET_DATA_RESULT: &str = "ticket_data_result";
|
||||
/// Entity-ID: ticket_data_view
|
||||
pub static ID_TICKET_DATA_VIEW: &str = "ticket_data_view";
|
||||
/// Entity-ID: ticket_data_policy_widget
|
||||
pub static ID_TICKET_DATA_WIDGET: &str = "ticket_data_widget";
|
||||
|
||||
@@ -36,7 +36,7 @@ mod parse_args;
|
||||
/// this is primarily used in testing scenarios (eg. debugging)
|
||||
#[derive(Debug, Deserialize)]
|
||||
struct Environment {
|
||||
lang: Lang,
|
||||
//lang: Lang,
|
||||
test_lang: String,
|
||||
rust_log: String,
|
||||
}
|
||||
@@ -56,21 +56,27 @@ static ADVOTRACKER_DE_DE: &str = include_str!("../assets/advotracker/advotracker
|
||||
/// Get the active language environment.
|
||||
fn get_lang() -> String {
|
||||
// get system environment
|
||||
let mut lang = env::var("LANG").unwrap_or_else(|_| "en".to_string());
|
||||
lang = lang.substring(0,2).to_string(); // "de_DE.UTF-8" -> "de"
|
||||
info!("GUI-Language: preset to {:?}", lang);
|
||||
let mut lang_id = env::var("LANG").unwrap_or_else(|_| "En".to_string());
|
||||
lang_id = lang_id.substring(0,1).to_uppercase(); // "de" -> "De"
|
||||
lang_id = lang_id.substring(0,2).to_string(); // "de_DE.UTF-8" -> "de"
|
||||
info!("GUI-Language: preset to {:?}", lang_id);
|
||||
|
||||
// testing environment: read from .env file
|
||||
dotenv().ok();
|
||||
match envy::from_env::<Environment>() {
|
||||
Ok(environment) => {
|
||||
if environment.test_lang != lang { lang = environment.test_lang; }
|
||||
if environment.test_lang != lang_id {
|
||||
lang_id = environment.test_lang;
|
||||
lang_id = lang_id.substring(0,2).to_string(); // "de_DE.UTF-8" -> "de"
|
||||
lang_id = lang_id.substring(0,1).to_uppercase(); // "de" -> "De"
|
||||
}
|
||||
},
|
||||
Err(e) => { info!(target: "advotracker", "{}", e) }
|
||||
}
|
||||
trace!(target: "advotracker", lang = ?lang);
|
||||
trace!(target: "advotracker", lang_id = ?lang_id);
|
||||
|
||||
// return the active language
|
||||
let lang = format!("Lang::{}(\"\")", lang_id);
|
||||
lang
|
||||
}
|
||||
|
||||
@@ -140,8 +146,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
||||
tracing::subscriber::with_default(collector, || {
|
||||
// get system environment
|
||||
//let lang = get_lang();
|
||||
let lang = Lang::De("de");
|
||||
let _my_lang = get_lang();
|
||||
let lang = Lang::De("");
|
||||
|
||||
let mut state = t!(state_started => lang);
|
||||
let mut res = t!(parse_environment => lang);
|
||||
|
||||
@@ -14,7 +14,9 @@ use crate::widgets::configuration::configuration_view::ConfigurationView;
|
||||
/// Valid `actions` that are handled as state changes in the `Configuration` widget.
|
||||
#[derive(Clone, Debug)]
|
||||
pub enum ConfigurationAction {
|
||||
/// Save configuration data
|
||||
SaveConfiguration,
|
||||
/// Load configuration data
|
||||
LoadConfiguration,
|
||||
}
|
||||
|
||||
|
||||
@@ -14,8 +14,11 @@ use crate::{
|
||||
|
||||
// Macro that initializes the widget structures/variables for our view
|
||||
widget!(
|
||||
/// Configuration View
|
||||
ConfigurationView<ConfigurationState> {
|
||||
/// Configuration file
|
||||
configuration_file: String,
|
||||
/// Language identifier
|
||||
language_id: String
|
||||
}
|
||||
);
|
||||
|
||||
@@ -29,6 +29,7 @@ struct Environment {
|
||||
|
||||
/// Provides generic methods to handle states of datatypes.
|
||||
pub trait GlobalState {
|
||||
/// Get the lanuage identifier
|
||||
fn get_lang() -> String {
|
||||
// get system environment
|
||||
let mut lang = env::var("LANG").unwrap_or_else(|_| "C".to_string());
|
||||
|
||||
@@ -10,12 +10,15 @@ use tracing::info;
|
||||
|
||||
use crate::widgets::localization::localization_view::LocalizationView;
|
||||
|
||||
/// Structure handling the localization status
|
||||
#[derive(AsAny, Debug, Default)]
|
||||
pub struct LocalizationState {
|
||||
/// Change the language boolean
|
||||
change_language: bool,
|
||||
}
|
||||
|
||||
impl LocalizationState {
|
||||
/// Change the active/selected language
|
||||
pub fn change_language(&mut self) {
|
||||
self.change_language = true;
|
||||
}
|
||||
|
||||
@@ -15,8 +15,12 @@ use crate::{
|
||||
type List = Vec<String>;
|
||||
|
||||
// Macro that initializes the widget structures/variables for our view
|
||||
widget!(LocalizationView<LocalizationState> {
|
||||
widget!(
|
||||
/// Dialog to change active localization settings
|
||||
LocalizationView<LocalizationState> {
|
||||
/// The language list
|
||||
languages: List,
|
||||
/// The selected language index
|
||||
selected_index: i32 }
|
||||
);
|
||||
|
||||
|
||||
@@ -21,11 +21,14 @@ use crate::{
|
||||
|
||||
// [START] views
|
||||
|
||||
widget!(MainView {
|
||||
widget!(
|
||||
/// The main view offering accessible forms
|
||||
MainView {
|
||||
// policy_list: PolicyList,
|
||||
// policy_data_list: PolicyDataList,
|
||||
// policylist_view: u32,
|
||||
// policydata_view: u32,
|
||||
/// The policycheck view
|
||||
policycheck_view: PolicyCheck
|
||||
//ticketdata_view: TicketData
|
||||
});
|
||||
|
||||
@@ -20,20 +20,29 @@ use crate::{
|
||||
/// Valid `actions` that are handled as state changes in the `Menu` widget.
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub enum MenuAction {
|
||||
/// Create a new menu
|
||||
CreateMenu,
|
||||
/// Toggle between available menu themes
|
||||
CreateMenuToggleTheme,
|
||||
/// Remove a menu entry
|
||||
RemoveMenu,
|
||||
/// Remove a menu toggle theme
|
||||
RemoveMenuToggleTheme,
|
||||
/// Set the active theme
|
||||
SetTheme,
|
||||
/// Update the relative position inside the menu
|
||||
UpdateMenuRelativePosition
|
||||
}
|
||||
|
||||
/// Valid `structures` that are handled inside the state of the `Menu` widget.
|
||||
#[derive(AsAny, Default)]
|
||||
pub struct MenuState {
|
||||
/// Define the menu action
|
||||
action: Option<MenuAction>,
|
||||
/// Define the menu entity
|
||||
menu: Option<Entity>,
|
||||
//menu_toggle_theme: Option<Entity>
|
||||
/// Entity-id of the toggled theme
|
||||
menu_toggle_theme: Entity
|
||||
}
|
||||
|
||||
|
||||
@@ -14,10 +14,13 @@ type List = Vec<String>;
|
||||
|
||||
// Macro that initializes the widget structures/variables for the menu view
|
||||
widget!(
|
||||
/// Present and handle the menu items
|
||||
MenuView<MenuState> {
|
||||
//menu_stack: Entity,
|
||||
//button_menu: Entity,
|
||||
/// The selected menu index
|
||||
selected_index: i32,
|
||||
/// The supported themes list
|
||||
themes: List
|
||||
}
|
||||
);
|
||||
|
||||
@@ -31,24 +31,43 @@ use crate::{
|
||||
/// state changes for the `PolicycheckView` widget.
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum PolicycheckAction {
|
||||
/// Clear the policy number
|
||||
ClearPolicyNumber,
|
||||
/// Change the active theme
|
||||
ChangeTheme(),
|
||||
/// Send the policy number
|
||||
SendPolicynumber(),
|
||||
/// Entity of the changed input text
|
||||
InputTextChanged(Entity),
|
||||
/// Import data to the form
|
||||
ImportData,
|
||||
/// Create a new ticket
|
||||
NewTicket,
|
||||
/// Entity-id of the policy number to parse
|
||||
ParsePolicyNumber(Entity),
|
||||
/// Remove the focus of current entity
|
||||
RemoveFocus(Entity),
|
||||
/// Entity-id of popup to bo removed
|
||||
RemovePopup(Entity),
|
||||
/// Reset the progress status
|
||||
ResetProgress,
|
||||
/// Get progress status
|
||||
GetProgress,
|
||||
/// Set the progress status to given value
|
||||
SetProgress(f64),
|
||||
/// Set the progress popup to given entity-id
|
||||
SetProgressPopup(Entity),
|
||||
/// Set the entitiy-id for theme to be toggled to
|
||||
SetToggleTheme(Entity),
|
||||
/// Set the given entity-id
|
||||
SetEntry(Entity),
|
||||
/// Set visibility status of given entity-id
|
||||
SetVisibility(Entity),
|
||||
/// Set changed status of given text entity-id
|
||||
TextChanged(Entity, usize),
|
||||
/// Update the given policy code
|
||||
UpdatePolicyCode,
|
||||
/// Update the process status to given value
|
||||
UpdateProgress(f64)
|
||||
}
|
||||
|
||||
|
||||
@@ -22,15 +22,15 @@ widget!(
|
||||
/// This identifier is checked agains a map of valid policy codes.
|
||||
// PolicycheckView<PolicycheckState>: KeyDownHandler {
|
||||
PolicycheckView<PolicycheckState> {
|
||||
// holds the language code
|
||||
/// Holds the language code
|
||||
lang: String,
|
||||
// provides a struct with `PolicyCheck` members
|
||||
/// Provides a struct with `PolicyCheck` members
|
||||
policy_check: PolicyCheck,
|
||||
// holds number of imported data
|
||||
/// Holds number of imported data
|
||||
policy_data_count: u32,
|
||||
// holds the title string
|
||||
/// Holds the title string
|
||||
policy_check_title: String,
|
||||
// widget entity that will receive the message
|
||||
/// Widget entity that will receive the message
|
||||
target: u32
|
||||
}
|
||||
);
|
||||
|
||||
@@ -27,8 +27,11 @@ use crate::{
|
||||
pub enum TicketdataAction {
|
||||
/// Clear text in the form
|
||||
ClearForm(String),
|
||||
/// Parse given entity
|
||||
ParseEntry(Entity),
|
||||
/// Send Email with form data
|
||||
SendForm(),
|
||||
/// Update the policycode
|
||||
UpdatePolicyCode(String)
|
||||
|
||||
}
|
||||
@@ -113,6 +116,7 @@ impl TicketdataState {
|
||||
}
|
||||
}
|
||||
|
||||
/// Send Email with generated form fields using `lettre`
|
||||
pub fn send_form(entity: Entity, ctx: &mut Context<'_>, _lang: Lang) {
|
||||
info!("TicketdataState: processing entity[{:?}]", entity);
|
||||
|
||||
@@ -138,7 +142,7 @@ impl TicketdataState {
|
||||
};
|
||||
trace!("eMail fields: {:?}", email);
|
||||
|
||||
// send email via service
|
||||
// Send email via service
|
||||
let lang = Lang::De("");
|
||||
if let Err(err) = sendticketdata(&email, &lang) {
|
||||
error!("sendticketdata error: {:?}", err);
|
||||
@@ -155,6 +159,7 @@ impl TicketdataState {
|
||||
};
|
||||
}
|
||||
|
||||
/// Update the policy code
|
||||
pub fn update_policy_code(_entity: Entity, _id: &str, ctx: &mut Context<'_>) {
|
||||
Stack::visibility_set(&mut ctx.child(ID_TICKET_DATA_ACTION_STACK), Visibility::Visible);
|
||||
//self.actions.push(TicketdataAction::UpdatePolicyCode(entity));
|
||||
|
||||
@@ -15,21 +15,21 @@ use crate::{
|
||||
// Used to define ComboBox list members
|
||||
type List = Vec<String>;
|
||||
|
||||
// Macro that initializes the widget structures/variables for the policy check view
|
||||
// Procedural macro: initialize the widget structures/variables for the ticketdate view
|
||||
widget!(
|
||||
/// Form to enter data of a ticket record
|
||||
TicketdataView<TicketdataState> {
|
||||
// language used inside the widget
|
||||
/// Language used inside the widget
|
||||
lang: String,
|
||||
// mail recipients (mail_to) saved in a vector
|
||||
/// Mail recipients (mail_to) saved in a vector
|
||||
mail_to: List,
|
||||
// carbo copy recipients (mail_to) saved in a vector
|
||||
/// Carbo copy recipients (mail_to) saved in a vector
|
||||
mail_cc: List,
|
||||
// active seleced index of combo box
|
||||
/// Active seleced index of combo box
|
||||
selected_index: i32,
|
||||
// title used in the header
|
||||
/// Title used in the header
|
||||
ticket_data_title: String,
|
||||
// entity id that will receive the messages
|
||||
/// Entity id that will receive the messages
|
||||
target: u32
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user