Skip to content

Commit

Permalink
Upfate 3.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
vektor9999 committed Feb 22, 2025
1 parent 54a2ea9 commit a01521a
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 21 deletions.
4 changes: 3 additions & 1 deletion Vcc.Nolvus.Dashboard/Frames/ErrorFrame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ public ErrorFrame(IDashboard Dashboard, FrameParameters Params) :
LblTitle.Text = Title;
LblError.Text = Message;
LblTrace.Text = Trace;
BtnRetry.Visible = Retry;
BtnRetry.Visible = Retry;
ServiceSingleton.Dashboard.Title("Nolvus Dashboard - [Error]");
ServiceSingleton.Dashboard.Info("Error");
}

private void BtnRetry_Click(object sender, EventArgs e)
Expand Down
51 changes: 33 additions & 18 deletions Vcc.Nolvus.Dashboard/Frames/Settings/GlobalSettingsFrame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,28 @@ public GlobalSettingsFrame(IDashboard Dashboard, FrameParameters Params)

protected override void OnLoad()
{
ServiceSingleton.Dashboard.Title("Nolvus Dashboard - [Settings]");
ServiceSingleton.Dashboard.Info("Global Settings");
try

TxtBxUserName.Text = ServiceSingleton.Globals.MegaEmail;
TxtBxPassword.Text = ServiceSingleton.Globals.MegaPassword;
{
ServiceSingleton.Dashboard.Title("Nolvus Dashboard - [Settings]");
ServiceSingleton.Dashboard.Info("Global Settings");

TxtBxUserName.Text = ServiceSingleton.Globals.MegaEmail;
TxtBxPassword.Text = ServiceSingleton.Globals.MegaPassword;

PnlMessage.BackColor = Color.FromArgb(92, 184, 92);
PicBox.Image = Properties.Resources.Info;
PnlMessage.BackColor = Color.FromArgb(92, 184, 92);
PicBox.Image = Properties.Resources.Info;

TglBtnAnonymous.ToggleState = ToggleButtonState.Active;
TglBtnAnonymous.ToggleState = ToggleButtonState.Active;

if (!ServiceSingleton.Globals.MegaAnonymousConnection)
if (!ServiceSingleton.Globals.MegaAnonymousConnection)
{
TglBtnAnonymous.ToggleState = ToggleButtonState.Inactive;
}
}
catch(Exception ex)
{
TglBtnAnonymous.ToggleState = ToggleButtonState.Inactive;
ServiceSingleton.Dashboard.Error("Error during global settings loading", ex.Message, ex.StackTrace);
}
}

Expand All @@ -87,21 +95,29 @@ private void LnkLblInfo_LinkClicked(object sender, LinkLabelLinkClickedEventArgs

private async void BtnSaveMegaInfo_Click(object sender, EventArgs e)
{
if (TglBtnAnonymous.ToggleState == ToggleButtonState.Inactive && TxtBxUserName.Text == string.Empty && TxtBxPassword.Text == string.Empty)
if (TglBtnAnonymous.ToggleState == ToggleButtonState.Inactive && TxtBxUserName.Text.Trim() == string.Empty && TxtBxPassword.Text.Trim() == string.Empty)
{
NolvusMessageBox.ShowMessage("Error", "Please enter your credentials!", MessageBoxType.Error);
}
else
{
{
try
{
if (TglBtnAnonymous.ToggleState == ToggleButtonState.Inactive)
{
UpdateButton("Validating...");
await ServiceSingleton.Files.AuthenticateToMegaApi(TxtBxUserName.Text, TxtBxPassword.Text);
UpdateButton("Save");
}
await ServiceSingleton.Files.AuthenticateToMegaApi(TxtBxUserName.Text, TxtBxPassword.Text);
}
}
catch
{
UpdateButton("Save");
NolvusMessageBox.ShowMessage("Error", "Unable to connect to mega.nz! Please review your credentials", MessageBoxType.Error);
return;
}

try
{
ServiceSingleton.Globals.MegaAnonymousConnection = TglBtnAnonymous.ToggleState == ToggleButtonState.Active;

if (TxtBxUserName.Text != string.Empty)
Expand All @@ -112,15 +128,14 @@ private async void BtnSaveMegaInfo_Click(object sender, EventArgs e)
if ( TxtBxPassword.Text != string.Empty)
{
ServiceSingleton.Globals.MegaPassword = TxtBxPassword.Text;
}

}

NolvusMessageBox.ShowMessage("Information", "Your mega.nz configuration has been valiated and saved", MessageBoxType.Info);
}
catch (Exception Ex)
catch(Exception ex)
{
UpdateButton("Save");
NolvusMessageBox.ShowMessage("Error", "Unable to connect to mega.nz! Please review your credentials", MessageBoxType.Error);
NolvusMessageBox.ShowMessage("Error", string.Format("Unexpected error ocurred with message : {0}", ex.Message), MessageBoxType.Error);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Vcc.Nolvus.Dashboard/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// 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("3.7.1")]
[assembly: AssemblyFileVersion("3.7.1.0")]
[assembly: AssemblyVersion("3.7.2")]
[assembly: AssemblyFileVersion("3.7.2.0")]

0 comments on commit a01521a

Please sign in to comment.