From 9d82019573e94a6c12343a7a9262f20238e2fd76 Mon Sep 17 00:00:00 2001 From: VladMordock Date: Wed, 17 Feb 2021 11:54:27 +0100 Subject: [PATCH] Variable names --- .../Perun_v1/02_Forms/form_Main.Designer.cs | 56 +++++++++---------- 02_Windows_App/Perun_v1/02_Forms/form_Main.cs | 32 ++++++----- 2 files changed, 45 insertions(+), 43 deletions(-) diff --git a/02_Windows_App/Perun_v1/02_Forms/form_Main.Designer.cs b/02_Windows_App/Perun_v1/02_Forms/form_Main.Designer.cs index 1cb8e78..9f34d9c 100644 --- a/02_Windows_App/Perun_v1/02_Forms/form_Main.Designer.cs +++ b/02_Windows_App/Perun_v1/02_Forms/form_Main.Designer.cs @@ -35,7 +35,7 @@ this.con_Button_Listen_OFF = new System.Windows.Forms.Button(); this.con_GroupBox_1 = new System.Windows.Forms.GroupBox(); this.label15 = new System.Windows.Forms.Label(); - this.cboLogLevel = new System.Windows.Forms.ComboBox(); + this.con_com_loglevel = new System.Windows.Forms.ComboBox(); this.con_Button_Add_Marker = new System.Windows.Forms.Button(); this.tim_GUI = new System.Windows.Forms.Timer(this.components); this.con_GroupBox_2 = new System.Windows.Forms.GroupBox(); @@ -71,7 +71,7 @@ this.label14 = new System.Windows.Forms.Label(); this.con_img_logo = new System.Windows.Forms.PictureBox(); this.TIM_Autostart = new System.Windows.Forms.Timer(this.components); - this.chkCloseToTray = new System.Windows.Forms.CheckBox(); + this.con_check_minimize_to_tray = new System.Windows.Forms.CheckBox(); this.con_GroupBox_4 = new System.Windows.Forms.GroupBox(); this.con_Button_Reset_Flags = new System.Windows.Forms.Button(); this.label12 = new System.Windows.Forms.Label(); @@ -131,7 +131,7 @@ // con_GroupBox_1 // this.con_GroupBox_1.Controls.Add(this.label15); - this.con_GroupBox_1.Controls.Add(this.cboLogLevel); + this.con_GroupBox_1.Controls.Add(this.con_com_loglevel); this.con_GroupBox_1.Controls.Add(this.con_List_Received); this.con_GroupBox_1.Controls.Add(this.con_Button_Add_Marker); this.con_GroupBox_1.Location = new System.Drawing.Point(344, 147); @@ -152,21 +152,21 @@ this.label15.TabIndex = 22; this.label15.Text = "Log level"; // - // cboLogLevel + // con_com_loglevel // - this.cboLogLevel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cboLogLevel.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F); - this.cboLogLevel.FormattingEnabled = true; - this.cboLogLevel.Items.AddRange(new object[] { + this.con_com_loglevel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.con_com_loglevel.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F); + this.con_com_loglevel.FormattingEnabled = true; + this.con_com_loglevel.Items.AddRange(new object[] { "Error", "Warning", "Info", "Debug"}); - this.cboLogLevel.Location = new System.Drawing.Point(65, 18); - this.cboLogLevel.Name = "cboLogLevel"; - this.cboLogLevel.Size = new System.Drawing.Size(102, 20); - this.cboLogLevel.TabIndex = 23; - this.cboLogLevel.SelectedIndexChanged += new System.EventHandler(this.cboLogLevel_SelectedIndexChanged); + this.con_com_loglevel.Location = new System.Drawing.Point(65, 18); + this.con_com_loglevel.Name = "con_com_loglevel"; + this.con_com_loglevel.Size = new System.Drawing.Size(102, 20); + this.con_com_loglevel.TabIndex = 23; + this.con_com_loglevel.SelectedIndexChanged += new System.EventHandler(this.con_com_loglevell_SelectedIndexChanged); // // con_Button_Add_Marker // @@ -474,19 +474,19 @@ this.TIM_Autostart.Interval = 500; this.TIM_Autostart.Tick += new System.EventHandler(this.TIM_Autostart_Tick); // - // chkCloseToTray + // con_check_minimize_to_tray // - this.chkCloseToTray.AutoSize = true; - this.chkCloseToTray.Checked = true; - this.chkCloseToTray.CheckState = System.Windows.Forms.CheckState.Checked; - this.chkCloseToTray.Location = new System.Drawing.Point(6, 19); - this.chkCloseToTray.Name = "chkCloseToTray"; - this.chkCloseToTray.Size = new System.Drawing.Size(98, 17); - this.chkCloseToTray.TabIndex = 24; - this.chkCloseToTray.Text = "Minimize to tray"; - this.chkCloseToTray.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText; - this.chkCloseToTray.UseVisualStyleBackColor = true; - this.chkCloseToTray.Validated += new System.EventHandler(this.chkCloseToTray_Validated); + this.con_check_minimize_to_tray.AutoSize = true; + this.con_check_minimize_to_tray.Checked = true; + this.con_check_minimize_to_tray.CheckState = System.Windows.Forms.CheckState.Checked; + this.con_check_minimize_to_tray.Location = new System.Drawing.Point(6, 19); + this.con_check_minimize_to_tray.Name = "con_check_minimize_to_tray"; + this.con_check_minimize_to_tray.Size = new System.Drawing.Size(98, 17); + this.con_check_minimize_to_tray.TabIndex = 24; + this.con_check_minimize_to_tray.Text = "Minimize to tray"; + this.con_check_minimize_to_tray.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText; + this.con_check_minimize_to_tray.UseVisualStyleBackColor = true; + this.con_check_minimize_to_tray.Validated += new System.EventHandler(this.con_check_minimize_to_tray_Validated); // // con_GroupBox_4 // @@ -600,7 +600,7 @@ // // con_GroupBox_5 // - this.con_GroupBox_5.Controls.Add(this.chkCloseToTray); + this.con_GroupBox_5.Controls.Add(this.con_check_minimize_to_tray); this.con_GroupBox_5.Location = new System.Drawing.Point(14, 362); this.con_GroupBox_5.Name = "con_GroupBox_5"; this.con_GroupBox_5.Size = new System.Drawing.Size(323, 46); @@ -699,8 +699,8 @@ private System.Windows.Forms.Button con_Button_Add_Marker; private System.Windows.Forms.Timer TIM_Autostart; private System.Windows.Forms.Label label15; - private System.Windows.Forms.ComboBox cboLogLevel; - private System.Windows.Forms.CheckBox chkCloseToTray; + private System.Windows.Forms.ComboBox con_com_loglevel; + private System.Windows.Forms.CheckBox con_check_minimize_to_tray; private System.Windows.Forms.GroupBox con_GroupBox_4; private System.Windows.Forms.Button con_Button_Reset_Flags; private System.Windows.Forms.Label label12; diff --git a/02_Windows_App/Perun_v1/02_Forms/form_Main.cs b/02_Windows_App/Perun_v1/02_Forms/form_Main.cs index c521659..8b02756 100644 --- a/02_Windows_App/Perun_v1/02_Forms/form_Main.cs +++ b/02_Windows_App/Perun_v1/02_Forms/form_Main.cs @@ -132,8 +132,8 @@ namespace Perun_v1 con_check_3rd_srs.Checked = Properties.Settings.Default.OTHER_SRS_USE; con_txt_dcs_server_port.Text = Properties.Settings.Default.DCS_Server_Port.ToString(); con_txt_dcs_instance.Text = Properties.Settings.Default.DCS_Instance.ToString(); - cboLogLevel.SelectedIndex = Properties.Settings.Default.LOG_LEVEL; - chkCloseToTray.Checked = Properties.Settings.Default.CLOSE_TO_TRAY; + con_com_loglevel.SelectedIndex = Properties.Settings.Default.LOG_LEVEL; + con_check_minimize_to_tray.Checked = Properties.Settings.Default.CLOSE_TO_TRAY; } private void form_Main_SaveSettings() @@ -152,8 +152,8 @@ namespace Perun_v1 Properties.Settings.Default.OTHER_SRS_USE = con_check_3rd_srs.Checked; Properties.Settings.Default.DCS_Server_Port = Int32.Parse(con_txt_dcs_server_port.Text); Properties.Settings.Default.DCS_Instance = Int32.Parse(con_txt_dcs_instance.Text); - Properties.Settings.Default.LOG_LEVEL = cboLogLevel.SelectedIndex; - Properties.Settings.Default.CLOSE_TO_TRAY = chkCloseToTray.Checked; + Properties.Settings.Default.LOG_LEVEL = con_com_loglevel.SelectedIndex; + Properties.Settings.Default.CLOSE_TO_TRAY = con_check_minimize_to_tray.Checked; Properties.Settings.Default.Save(); } @@ -177,7 +177,7 @@ namespace Perun_v1 con_check_3rd_srs.Enabled = false; con_txt_dcs_server_port.Enabled = false; con_txt_dcs_instance.Enabled = false; - cboLogLevel.Enabled = true; + con_com_loglevel.Enabled = true; } private void form_Main_SetControlsToDisconnected() @@ -199,7 +199,7 @@ namespace Perun_v1 con_check_3rd_srs.Enabled = true; con_txt_dcs_server_port.Enabled = true; con_txt_dcs_instance.Enabled = true; - cboLogLevel.Enabled = true; + con_com_loglevel.Enabled = true; } @@ -337,6 +337,17 @@ namespace Perun_v1 } } + private void con_com_loglevell_SelectedIndexChanged(object sender, EventArgs e) + { + // Changed log level state + LogController.instance.level = con_com_loglevel.SelectedIndex; + } + + private void con_check_minimize_to_tray_Validated(object sender, EventArgs e) + { + // Changed close to try state + Properties.Settings.Default.CLOSE_TO_TRAY = con_check_minimize_to_tray.Checked; + } // ################################ Form state ################################ private void con_Button_Quit_Click(object sender, EventArgs e) { @@ -690,14 +701,5 @@ namespace Perun_v1 con_Button_Listen_ON_Click(sender,e); // Simulate button click } - private void cboLogLevel_SelectedIndexChanged(object sender, EventArgs e) - { - LogController.instance.level = cboLogLevel.SelectedIndex; - } - - private void chkCloseToTray_Validated(object sender, EventArgs e) - { - Properties.Settings.Default.CLOSE_TO_TRAY = chkCloseToTray.Checked; - } } }