Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 92d1f98

Browse files
committed
Design improvement
This update introduces a QOL update to the design, typo, and bug fixes. - Cant delete QR files -Ram spikes -Account list not syncing after core account change company branding removed
1 parent efc6ba1 commit 92d1f98

File tree

17 files changed

+419
-594
lines changed

17 files changed

+419
-594
lines changed

‎Core/AccountEdit.cs‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using _365.Core.Database;
22
using _365.Core.Properties;
3+
using System.Web;
34

45
namespace _365.Core
56
{
@@ -27,13 +28,17 @@ public bool PublishEdit(AccountProp newAccountProp)
2728
{
2829
changedProps["MFA"] = newAccountProp.mfaToken;
2930
}
31+
if (newAccountProp.domain != oldAccountProp.domain)
32+
{
33+
changedProps["Domain"] = newAccountProp.domain;
34+
}
3035
if (newAccountProp.phone != oldAccountProp.phone)
3136
{
3237
changedProps["Phone"] = newAccountProp.phone;
3338
}
3439
if (newAccountProp.notes != oldAccountProp.notes)
3540
{
36-
changedProps["Notes"] = newAccountProp.notes;
41+
changedProps["Notes"] = HttpUtility.HtmlEncode(newAccountProp.notes);
3742
}
3843
if (newAccountProp.isArchived != oldAccountProp.isArchived)
3944
{

‎Core/ExtractQR.cs‎

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,43 @@ internal class ExtractQR
88
{
99
public QRTotp GetTOTP()
1010
{
11-
OpenFileDialog fileDialog = new OpenFileDialog();
12-
13-
14-
fileDialog.Filter = "Image Files (*.png;*.jpg;*.jpeg;*.gif;*.bmp)|*.png;*.jpg;*.jpeg;*.gif;*.bmp|All files (*.*)|*.*";
15-
fileDialog.FilterIndex = 1;
16-
fileDialog.RestoreDirectory = true;
17-
if (fileDialog.ShowDialog() == DialogResult.OK)
11+
using (OpenFileDialog fileDialog = new OpenFileDialog())
1812
{
19-
// Decode the QR code
20-
Bitmapimage=newBitmap(fileDialog.FileName);
21-
BarcodeReaderreader=newBarcodeReader{AutoRotate=true,TryHarder=true};
13+
fileDialog.Filter="Image Files (*.png;*.jpg;*.jpeg;*.gif;*.bmp)|*.png;*.jpg;*.jpeg;*.gif;*.bmp|All files (*.*)|*.*";
14+
fileDialog.FilterIndex=1;
15+
fileDialog.RestoreDirectory=true;
2216

23-
Result result;
24-
try
17+
if (fileDialog.ShowDialog() == DialogResult.OK)
2518
{
26-
result = reader.Decode(image);
27-
}
28-
catch (Exception)
29-
{
30-
return new QRTotp { secret = "error" };
31-
}
19+
using (Bitmap image = new Bitmap(fileDialog.FileName))
20+
{
21+
BarcodeReader reader = new BarcodeReader { AutoRotate = true, TryHarder = true };
3222

33-
string decoded = result?.Text?.Trim();
34-
if(!string.IsNullOrWhiteSpace(decoded))
35-
return ExtractQRCodeData(decoded);
23+
Result result;
24+
try
25+
{
26+
result = reader.Decode(image);
27+
}
28+
catch (Exception)
29+
{
30+
return new QRTotp { secret = "error" };
31+
}
32+
33+
string decoded = result?.Text?.Trim();
34+
if (!string.IsNullOrWhiteSpace(decoded))
35+
{
36+
return ExtractQRCodeData(decoded);
37+
}
38+
}
39+
}
3640
}
41+
3742
return new QRTotp { secret = "error" };
3843
}
3944

4045

4146

47+
4248
static QRTotp ExtractQRCodeData(string qrData)
4349
{
4450
QRTotp qRTOTP = new QRTotp();

‎Core/Properties/AccountListEntry.cs‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
namespace _365.Core.Properties
1+
using System.Web;
2+
3+
namespace _365.Core.Properties
24
{
35
public class AccountListEntry
46
{
@@ -7,7 +9,7 @@ public class AccountListEntry
79
public bool isArchived { get; set; }
810
public override string ToString()
911
{
10-
return customerName;
12+
return HttpUtility.HtmlDecode(customerName);
1113
}
1214
}
1315
}

‎Core/_Database/DatabaseManager.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ public static class DatabaseManager
1919
public static bool UpdateAccount(int id, Dictionary<string, object> changedProps, string logToAdd = null) => _UpdateAccount.Update(id, changedProps, logToAdd);
2020
public static int CreateAccount(NewEntry entry) => _CreateAccount.Create(entry);
2121
public static bool EditCoreAccount(int id, NewEntry changedProps) => _EditCoreAccount.UpdateAccount(id, changedProps);
22+
public static bool DeleteAccount(int id) => _DeleteAccount.Delete(id);
2223
}
2324
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/////////////////////////////////////
2+
////DevNoam (noamsapir.me) 2024 ////
3+
namespace _365.Core.Database.Functions
4+
{
5+
public static class _DeleteAccount
6+
{
7+
internal static bool Delete(int id)
8+
{
9+
throw new NotImplementedException("Delete account function is not implemented yet.");
10+
return false;
11+
}
12+
}
13+
}

‎Core/_Database/Functions/_InitializeDatabase.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
public static class _InitializeDatabase
1515
{
1616
public const string dbName = "365DB.db";
17-
private const string EncryptionKey = "Bezeq0Nezeq!";
17+
private const string EncryptionKey = "Just0Random!";
1818
private static readonly string registryLocation = $@"Software\DevNoam\{Application.ProductName}";
1919
public static bool Initialize(bool checkConnectionAndPassword = false, string password = "")
2020
{
@@ -182,7 +182,7 @@ private static RegistryValues SetDatabaseLocation(bool initialSet = true, string
182182
return value;
183183
}
184184

185-
var selection = MessageBox.Show("A new Database will be created in the folder: " + path, Application.ProductName, MessageBoxButtons.CancelTryContinue, MessageBoxIcon.Question);
185+
var selection = MessageBox.Show("A new Database will be created in the folder: " + path, Application.ProductName, MessageBoxButtons.CancelTryContinue, MessageBoxIcon.Question,MessageBoxDefaultButton.Button3);
186186
if (selection == DialogResult.Retry)
187187
return SetDatabaseLocation();
188188
else if (selection == DialogResult.Continue)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /