Skip to content

Commit

Permalink
v1.3.1.0
Browse files Browse the repository at this point in the history
Removed old dependencies, fixed major bug with user-end settings, added optimization to panel refreshing.
  • Loading branch information
Aetherinox committed Jan 29, 2024
1 parent 93aa60b commit f98a857
Show file tree
Hide file tree
Showing 24 changed files with 313 additions and 118 deletions.
2 changes: 1 addition & 1 deletion Classes/AppInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public bool bIsDebug( )
if ( System.Diagnostics.Debugger.IsAttached )
return true;

if ( Cfg.Default.app_bDevmode )
if ( Settings.app_bDevmode )
return true;

#if DEBUG
Expand Down
4 changes: 4 additions & 0 deletions Classes/Perms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
@author : Aetherinox
*/

#region "Using"

using System;
using System.Collections.Generic;
using System.Linq;
Expand All @@ -13,6 +15,8 @@
using System.Security.AccessControl;
using System.IO;

#endregion

namespace MobaXtermKG
{
public class Perms
Expand Down
25 changes: 23 additions & 2 deletions Classes/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,27 @@
namespace MobaXtermKG
{

/*
Global Settings
app_bDevmode : bool
Determines if debug mode is enabled
bShowedUpdates : bool
This determines if the app should show the update notification. This value must be set otherwise,
every time the user goes from the About / Contribute WinForm back to Parent, the update notification will appear over and over.
*/

public static class Settings
{
public static bool bShowedUpdates = false;
public static bool app_bDevmode = false;
}

/*
Main Program
*/

public sealed class Program
{

Expand Down Expand Up @@ -111,7 +132,7 @@ Elevate to admin so we can modify the windows host file.
ensure debug mode is turned off by default as we don't want presistence
*/

Cfg.Default.app_bDevmode = false;
Settings.app_bDevmode = false;
Cfg.Default.Save( ) ;

/*
Expand All @@ -123,7 +144,7 @@ args start at index args[ 0 ]

if ( args.Length > 0 && args[ 0 ] == Cfg.Default.app_argid_debug )
{
Cfg.Default.app_bDevmode = true;
Settings.app_bDevmode = true;
EnableDebugConsole( );

Log.Send( log_file, new System.Diagnostics.StackTrace( true ).GetFrame( 0 ).GetFileLineNumber( ), "[ App.Debug ]", String.Format( "User defined {0} argument", Cfg.Default.app_argid_debug ) );
Expand Down
1 change: 0 additions & 1 deletion Forms/FormContribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,5 @@ private void lbl_Contrib_Intro_MouseMove( object sender, MouseEventArgs e )
}

#endregion

}
}
1 change: 1 addition & 0 deletions Forms/FormMessageBox.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 26 additions & 14 deletions Forms/FormMessageBox.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
using System;
/*
@app : MobaXterm
@repo : https://github.com/Aetherinox/MobaXtermKeygen
@author : Aetherinox
*/

#region "Using"

using System;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using Res = MobaXtermKG.Properties.Resources;
using Cfg = MobaXtermKG.Properties.Settings;

#endregion

namespace MobaXtermKG.Msgbox
{
Expand Down Expand Up @@ -161,7 +173,7 @@ private void SetButtons( MessageBoxButtons buttons, MessageBoxDefaultButton btn_
case MessageBoxButtons.OK:
btn_1.Visible = true;
btn_1.Location = new Point( xCenter, yCenter );
btn_1.Text = "&OK";
btn_1.Text = Res.btn_template_ok;
btn_1.DialogResult = DialogResult.OK;

SetDefaultButton( btn_Default );
Expand All @@ -175,12 +187,12 @@ private void SetButtons( MessageBoxButtons buttons, MessageBoxDefaultButton btn_

btn_1.Visible = true;
btn_1.Location = new Point( xCenter - ( btn_1.Width / 2 ) - 5, yCenter );
btn_1.Text = "&OK";
btn_1.Text = Res.btn_template_ok;
btn_1.DialogResult = DialogResult.OK;

btn_2.Visible = true;
btn_2.Location = new Point( xCenter + ( btn_2.Width / 2 ) + 5, yCenter );
btn_2.Text = "&Cancel";
btn_2.Text = Res.btn_template_cancel;
btn_2.DialogResult = DialogResult.Cancel;
btn_2.BackColor = Color.DimGray;

Expand All @@ -198,12 +210,12 @@ private void SetButtons( MessageBoxButtons buttons, MessageBoxDefaultButton btn_

btn_1.Visible = true;
btn_1.Location = new Point(xCenter - ( btn_1.Width / 2) - 5, yCenter );
btn_1.Text = "&Retry";
btn_1.Text = Res.btn_template_retry;
btn_1.DialogResult = DialogResult.Retry;

btn_2.Visible = true;
btn_2.Location = new Point( xCenter + ( btn_2.Width / 2 ) + 5, yCenter );
btn_2.Text = "&Cancel";
btn_2.Text = Res.btn_template_cancel;
btn_2.DialogResult = DialogResult.Cancel;
btn_2.BackColor = Color.DimGray;

Expand All @@ -221,12 +233,12 @@ private void SetButtons( MessageBoxButtons buttons, MessageBoxDefaultButton btn_

btn_1.Visible = true;
btn_1.Location = new Point(xCenter - ( btn_1.Width / 2) - 5, yCenter );
btn_1.Text = "&Yes";
btn_1.Text = Res.btn_template_yes;
btn_1.DialogResult = DialogResult.Yes;

btn_2.Visible = true;
btn_2.Location = new Point( xCenter + ( btn_2.Width / 2 ) + 5, yCenter );
btn_2.Text = "&No";
btn_2.Text = Res.btn_template_no;
btn_2.DialogResult = DialogResult.No;
btn_2.BackColor = Color.IndianRed;

Expand All @@ -244,18 +256,18 @@ private void SetButtons( MessageBoxButtons buttons, MessageBoxDefaultButton btn_

btn_1.Visible = true;
btn_1.Location = new Point( xCenter - btn_1.Width - 5, yCenter );
btn_1.Text = "&Yes";
btn_1.Text = Res.btn_template_yes;
btn_1.DialogResult = DialogResult.Yes;

btn_2.Visible = true;
btn_2.Location = new Point( xCenter, yCenter );
btn_2.Text = "&No";
btn_2.Text = Res.btn_template_no;
btn_2.DialogResult = DialogResult.No;
btn_2.BackColor = Color.IndianRed;

btn_3.Visible = true;
btn_3.Location = new Point( xCenter + btn_2.Width + 5, yCenter );
btn_3.Text = "&Cancel";
btn_3.Text = Res.btn_template_cancel;
btn_3.DialogResult = DialogResult.Cancel;
btn_3.BackColor = Color.DimGray;

Expand All @@ -271,18 +283,18 @@ private void SetButtons( MessageBoxButtons buttons, MessageBoxDefaultButton btn_

btn_1.Visible = true;
btn_1.Location = new Point( xCenter - btn_1.Width - 5, yCenter );
btn_1.Text = "&Abort";
btn_1.Text = Res.btn_template_abort;
btn_1.DialogResult = DialogResult.Abort;
btn_1.BackColor = Color.Goldenrod;

btn_2.Visible = true;
btn_2.Location = new Point(xCenter, yCenter);
btn_2.Text = "&Retry";
btn_2.Text = Res.btn_template_retry;
btn_2.DialogResult = DialogResult.Retry;

btn_3.Visible = true;
btn_3.Location = new Point( xCenter + btn_2.Width + 5, yCenter );
btn_3.Text = "&Ignore";
btn_3.Text = Res.btn_template_ignore;
btn_3.DialogResult = DialogResult.Ignore;
btn_3.BackColor = Color.IndianRed;

Expand Down
33 changes: 20 additions & 13 deletions Forms/FormParent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ forces the debug activation timer to expire every X seconds.
see method DebugTimer_Tick for functionality
*/

DebugTimer.Interval = ( 10 * 700 );
DebugTimer.Interval = ( 10 * ( 100 * Cfg.Default.app_debug_clicks_activate ) );
DebugTimer.Tick += new EventHandler( DebugTimer_Tick );
DebugTimer.Start ( );
SW_DebugRemains.Start ( );
Expand All @@ -289,10 +289,12 @@ This termines how long a user has to click the header image in order to enable d
This is easier than creating yet another menu item.
*/

private void DebugTimer_Tick(object sender, EventArgs e)
private void DebugTimer_Tick( object sender, EventArgs e )
{
i_DebugClicks = 0;
SW_DebugRemains.Restart( );

Log.Send( log_file, new System.Diagnostics.StackTrace( true ).GetFrame( 0 ).GetFileLineNumber( ), "[ App.Debug ] Timer", String.Format( "Debug timer SW_DebugRemains expired after {0} seconds -- resetting", Cfg.Default.app_debug_clicks_activate ) );
}

/*
Expand Down Expand Up @@ -342,9 +344,9 @@ update checker
#pragma warning disable CS4014
Task.Factory.StartNew( () =>
{
if ( ( bUpdateAvailable && !Cfg.Default.bShowedUpdates ) )
if ( ( bUpdateAvailable && !Settings.bShowedUpdates ) )
{
Cfg.Default.bShowedUpdates = true;
Settings.bShowedUpdates = true;

var result = MessageBox.Show
(
Expand Down Expand Up @@ -1181,25 +1183,28 @@ private void lbl_HeaderName_MouseClick( object sender, MouseEventArgs e )
i_DebugClicks++;

/*
don't go higher than 7, otherwise each click after 7 will re-activate dialog
don't go higher than 7, otherwise each click after 7 will re-show confirmation dialog. Start back at 0
*/

int i_DebugRemains = 7 - i_DebugClicks;
if ( i_DebugRemains > 7 )
int i_DebugRemains = Cfg.Default.app_debug_clicks_activate - i_DebugClicks;
if ( i_DebugClicks > Cfg.Default.app_debug_clicks_activate )
{
i_DebugClicks = 0;
return;
}

/*
timer > remaining
*/

int remains = 7 - Convert.ToInt32( SW_DebugRemains.Elapsed.TotalSeconds );
int remains = Cfg.Default.app_debug_clicks_activate - Convert.ToInt32( SW_DebugRemains.Elapsed.TotalSeconds );


/*
prompt to enable / disable debug
*/

if ( Cfg.Default.app_bDevmode )
if ( Settings.app_bDevmode )
Log.Send( log_file, new System.Diagnostics.StackTrace( true ).GetFrame( 0 ).GetFileLineNumber( ), "[ App.Debug ] Trigger", String.Format( "Disable debug with {0} more clicks -- {1} seconds remain", i_DebugRemains, remains ) );
else
Log.Send( log_file, new System.Diagnostics.StackTrace( true ).GetFrame( 0 ).GetFileLineNumber( ), "[ App.Debug ] Trigger", String.Format( "Enable debug with {0} more clicks -- {1} seconds remain", i_DebugRemains, remains ) );
Expand All @@ -1208,10 +1213,10 @@ prompt to enable / disable debug
wait until 7 clicks are done in X seconds
*/

if ( i_DebugClicks >= 7 )
if ( i_DebugClicks >= Cfg.Default.app_debug_clicks_activate )
{

if ( Cfg.Default.app_bDevmode )
if ( Settings.app_bDevmode )
{

/*
Expand All @@ -1228,7 +1233,7 @@ wait until 7 clicks are done in X seconds

if ( resp_input.ToString( ).ToLower( ) == "yes" )
{
Cfg.Default.app_bDevmode = false;
Settings.app_bDevmode = false;
Program.DisableDebugConsole( );
}

Expand All @@ -1251,14 +1256,16 @@ wait until 7 clicks are done in X seconds

if ( resp_input.ToString( ).ToLower( ) == "yes" )
{
Cfg.Default.app_bDevmode = true;
Settings.app_bDevmode = true;
Program.EnableDebugConsole( );
}

}
}
}

#endregion


}
}
Binary file added Materials/bch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Materials/bg_header.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Materials/btc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Materials/eth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Materials/notify_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 6 additions & 11 deletions MobaXtermKG.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<ProductName>MobaXterm</ProductName>
<PublisherName>Aetherx</PublisherName>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.3.0.0</ApplicationVersion>
<ApplicationVersion>1.3.1.0</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
Expand Down Expand Up @@ -96,9 +96,6 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
Expand Down Expand Up @@ -202,7 +199,6 @@
<None Include="aetherx_9a.priv.pfx" />
<None Include="app.config" />
<None Include="app.manifest" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand All @@ -219,15 +215,14 @@
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="Materials\notify_01.png" />
<None Include="Materials\bch.png" />
<None Include="Materials\bg_header.jpg" />
<None Include="Materials\btc.png" />
<None Include="Materials\eth.png" />
<Content Include="Materials\mobaxterm_128.ico" />
<None Include="Resources\mobaxterm_cli.exe" />
<None Include="Resources\notify_01.png" />
<None Include="Resources\bg_header.jpg" />
<None Include="Resources\eth.png" />
<None Include="Resources\btc.png" />
<None Include="Resources\bch.png" />
<None Include="Materials\mobaxterm_logo_1.png" />
<None Include="Resources\mobaxtgen_cli.exe" />
<None Include="Materials\error.png" />
<None Include="Materials\question.png" />
<None Include="Materials\info.png" />
Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]
[assembly: AssemblyVersion("1.3.1.0")]
[assembly: AssemblyFileVersion("1.3.1.0")]


// Setting ComVisible to false makes the types in this assembly not visible
Expand Down
Loading

0 comments on commit f98a857

Please sign in to comment.