Changing Font Awesome icons to Windows SDL2 icons + starting Management window

This commit is contained in:
Aurélie Delhaie
2022-05-29 23:04:03 +02:00
parent 2e76c8cd6a
commit eb4ded0c5b
18 changed files with 2780 additions and 314 deletions

View File

@@ -544,6 +544,37 @@ namespace OpenSaveCloudClient.Core
return null;
}
public List<User>? GetUsers()
{
logManager.AddInformation("Getting all users from the server database");
string uuidTask = taskManager.StartTask("Getting users list", true, 1);
try
{
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization", "bearer " + token);
HttpResponseMessage response = client.GetAsync(string.Format("{0}:{1}/api/v1/system/users", host, port)).Result;
if (response.IsSuccessStatusCode)
{
string responseText = response.Content.ReadAsStringAsync().Result;
taskManager.UpdateTaskStatus(uuidTask, AsyncTaskStatus.Ended);
return JsonSerializer.Deserialize<List<User>>(responseText);
}
else
{
logManager.AddError(String.Format("Received HTTP Status {0} from the server", response.StatusCode.ToString()));
}
taskManager.UpdateTaskStatus(uuidTask, AsyncTaskStatus.Failed);
}
}
catch (Exception ex)
{
logManager.AddError(ex);
taskManager.UpdateTaskStatus(uuidTask, AsyncTaskStatus.Failed);
}
return null;
}
public bool ChangePassword(NewPassword password)
{
logManager.AddInformation("Changing password");

View File

@@ -32,23 +32,23 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(GameLibrary));
this.listView1 = new System.Windows.Forms.ListView();
this.coverList = new System.Windows.Forms.ImageList(this.components);
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.AddButton = new System.Windows.Forms.ToolStripButton();
this.SyncButton = new System.Windows.Forms.ToolStripButton();
this.DownloadButton = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.SettingButton = new System.Windows.Forms.ToolStripButton();
this.UserSettingsButton = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.LogoutButton = new System.Windows.Forms.ToolStripButton();
this.LogButton = new System.Windows.Forms.ToolStripButton();
this.AboutButton = new System.Windows.Forms.ToolStripButton();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.TasksButton = new System.Windows.Forms.ToolStripDropDownButton();
this.StatusLabel = new System.Windows.Forms.ToolStripStatusLabel();
this.MainProgressBar = new System.Windows.Forms.ToolStripProgressBar();
this.toolStrip1.SuspendLayout();
this.panel1 = new System.Windows.Forms.Panel();
this.AboutButton = new System.Windows.Forms.Button();
this.LogButton = new System.Windows.Forms.Button();
this.LogoutButton = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
this.UserSettingsButton = new System.Windows.Forms.Button();
this.SettingsButton = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.DownloadButton = new System.Windows.Forms.Button();
this.SyncButton = new System.Windows.Forms.Button();
this.AddButton = new System.Windows.Forms.Button();
this.statusStrip1.SuspendLayout();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// listView1
@@ -56,13 +56,13 @@
this.listView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.listView1.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
this.listView1.LargeImageList = this.coverList;
this.listView1.Location = new System.Drawing.Point(0, 31);
this.listView1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.listView1.Location = new System.Drawing.Point(0, 80);
this.listView1.Margin = new System.Windows.Forms.Padding(2);
this.listView1.MultiSelect = false;
this.listView1.Name = "listView1";
this.listView1.ShowGroups = false;
this.listView1.ShowItemToolTips = true;
this.listView1.Size = new System.Drawing.Size(1004, 450);
this.listView1.Size = new System.Drawing.Size(1004, 406);
this.listView1.TabIndex = 2;
this.listView1.UseCompatibleStateImageBehavior = false;
this.listView1.DoubleClick += new System.EventHandler(this.listView1_DoubleClick);
@@ -74,125 +74,6 @@
this.coverList.TransparentColor = System.Drawing.Color.Transparent;
this.coverList.Images.SetKeyName(0, "unknown_cover.png");
//
// toolStrip1
//
this.toolStrip1.CanOverflow = false;
this.toolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
this.toolStrip1.ImageScalingSize = new System.Drawing.Size(24, 24);
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.AddButton,
this.SyncButton,
this.DownloadButton,
this.toolStripSeparator1,
this.SettingButton,
this.UserSettingsButton,
this.toolStripSeparator2,
this.LogoutButton,
this.LogButton,
this.AboutButton});
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Padding = new System.Windows.Forms.Padding(0, 0, 2, 0);
this.toolStrip1.Size = new System.Drawing.Size(1004, 31);
this.toolStrip1.TabIndex = 3;
this.toolStrip1.Text = "toolStrip1";
//
// AddButton
//
this.AddButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.AddButton.Enabled = false;
this.AddButton.Image = ((System.Drawing.Image)(resources.GetObject("AddButton.Image")));
this.AddButton.ImageTransparentColor = System.Drawing.Color.Magenta;
this.AddButton.Name = "AddButton";
this.AddButton.Size = new System.Drawing.Size(28, 28);
this.AddButton.Text = "Add";
this.AddButton.Click += new System.EventHandler(this.AddButton_Click);
//
// SyncButton
//
this.SyncButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.SyncButton.Enabled = false;
this.SyncButton.Image = ((System.Drawing.Image)(resources.GetObject("SyncButton.Image")));
this.SyncButton.ImageTransparentColor = System.Drawing.Color.Magenta;
this.SyncButton.Name = "SyncButton";
this.SyncButton.Size = new System.Drawing.Size(28, 28);
this.SyncButton.Text = "Sync";
this.SyncButton.Click += new System.EventHandler(this.SyncButton_Click);
//
// DownloadButton
//
this.DownloadButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.DownloadButton.Enabled = false;
this.DownloadButton.Image = ((System.Drawing.Image)(resources.GetObject("DownloadButton.Image")));
this.DownloadButton.ImageTransparentColor = System.Drawing.Color.Magenta;
this.DownloadButton.Name = "DownloadButton";
this.DownloadButton.Size = new System.Drawing.Size(28, 28);
this.DownloadButton.Text = "Download from server";
this.DownloadButton.Click += new System.EventHandler(this.DownloadButton_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(6, 31);
//
// SettingButton
//
this.SettingButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.SettingButton.Image = ((System.Drawing.Image)(resources.GetObject("SettingButton.Image")));
this.SettingButton.ImageTransparentColor = System.Drawing.Color.Magenta;
this.SettingButton.Name = "SettingButton";
this.SettingButton.Size = new System.Drawing.Size(28, 28);
this.SettingButton.Text = "Settings";
this.SettingButton.Click += new System.EventHandler(this.ConfigButton_Click);
//
// UserSettingsButton
//
this.UserSettingsButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.UserSettingsButton.Enabled = false;
this.UserSettingsButton.Image = ((System.Drawing.Image)(resources.GetObject("UserSettingsButton.Image")));
this.UserSettingsButton.ImageTransparentColor = System.Drawing.Color.Magenta;
this.UserSettingsButton.Name = "UserSettingsButton";
this.UserSettingsButton.Size = new System.Drawing.Size(28, 28);
this.UserSettingsButton.Text = "User settings";
this.UserSettingsButton.Click += new System.EventHandler(this.UserSettingsButton_Click);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(6, 31);
//
// LogoutButton
//
this.LogoutButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.LogoutButton.Enabled = false;
this.LogoutButton.Image = ((System.Drawing.Image)(resources.GetObject("LogoutButton.Image")));
this.LogoutButton.ImageTransparentColor = System.Drawing.Color.Magenta;
this.LogoutButton.Name = "LogoutButton";
this.LogoutButton.Size = new System.Drawing.Size(28, 28);
this.LogoutButton.Text = "Logout";
this.LogoutButton.Click += new System.EventHandler(this.LogoutButton_Click);
//
// LogButton
//
this.LogButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.LogButton.Image = ((System.Drawing.Image)(resources.GetObject("LogButton.Image")));
this.LogButton.ImageTransparentColor = System.Drawing.Color.Magenta;
this.LogButton.Name = "LogButton";
this.LogButton.Size = new System.Drawing.Size(28, 28);
this.LogButton.Text = "Show logs";
this.LogButton.Click += new System.EventHandler(this.LogButton_Click);
//
// AboutButton
//
this.AboutButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.AboutButton.Enabled = false;
this.AboutButton.Image = ((System.Drawing.Image)(resources.GetObject("AboutButton.Image")));
this.AboutButton.ImageTransparentColor = System.Drawing.Color.Magenta;
this.AboutButton.Name = "AboutButton";
this.AboutButton.Size = new System.Drawing.Size(28, 28);
this.AboutButton.Text = "About";
this.AboutButton.Click += new System.EventHandler(this.AboutButton_Click);
//
// statusStrip1
//
this.statusStrip1.ImageScalingSize = new System.Drawing.Size(24, 24);
@@ -200,37 +81,188 @@
this.TasksButton,
this.StatusLabel,
this.MainProgressBar});
this.statusStrip1.Location = new System.Drawing.Point(0, 481);
this.statusStrip1.Location = new System.Drawing.Point(0, 486);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Size = new System.Drawing.Size(1004, 30);
this.statusStrip1.Size = new System.Drawing.Size(1004, 25);
this.statusStrip1.TabIndex = 4;
this.statusStrip1.Text = "statusStrip1";
//
// TasksButton
//
this.TasksButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.TasksButton.Image = ((System.Drawing.Image)(resources.GetObject("TasksButton.Image")));
this.TasksButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.TasksButton.Font = new System.Drawing.Font("Segoe MDL2 Assets", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.TasksButton.ImageTransparentColor = System.Drawing.Color.Magenta;
this.TasksButton.Name = "TasksButton";
this.TasksButton.ShowDropDownArrow = false;
this.TasksButton.Size = new System.Drawing.Size(28, 28);
this.TasksButton.Text = "Tasks";
this.TasksButton.Size = new System.Drawing.Size(32, 23);
this.TasksButton.Text = "";
this.TasksButton.Click += new System.EventHandler(this.toolStripDropDownButton1_Click);
//
// StatusLabel
//
this.StatusLabel.BackColor = System.Drawing.Color.Transparent;
this.StatusLabel.Name = "StatusLabel";
this.StatusLabel.Size = new System.Drawing.Size(0, 25);
this.StatusLabel.Size = new System.Drawing.Size(0, 20);
//
// MainProgressBar
//
this.MainProgressBar.MarqueeAnimationSpeed = 20;
this.MainProgressBar.Name = "MainProgressBar";
this.MainProgressBar.Size = new System.Drawing.Size(100, 24);
this.MainProgressBar.Size = new System.Drawing.Size(100, 19);
this.MainProgressBar.Style = System.Windows.Forms.ProgressBarStyle.Marquee;
this.MainProgressBar.Visible = false;
//
// panel1
//
this.panel1.Controls.Add(this.AboutButton);
this.panel1.Controls.Add(this.LogButton);
this.panel1.Controls.Add(this.LogoutButton);
this.panel1.Controls.Add(this.label2);
this.panel1.Controls.Add(this.UserSettingsButton);
this.panel1.Controls.Add(this.SettingsButton);
this.panel1.Controls.Add(this.label1);
this.panel1.Controls.Add(this.DownloadButton);
this.panel1.Controls.Add(this.SyncButton);
this.panel1.Controls.Add(this.AddButton);
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.MaximumSize = new System.Drawing.Size(0, 80);
this.panel1.MinimumSize = new System.Drawing.Size(0, 80);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(1004, 80);
this.panel1.TabIndex = 5;
//
// AboutButton
//
this.AboutButton.Enabled = false;
this.AboutButton.FlatAppearance.BorderSize = 0;
this.AboutButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.AboutButton.Font = new System.Drawing.Font("Segoe MDL2 Assets", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.AboutButton.Location = new System.Drawing.Point(505, 3);
this.AboutButton.Name = "AboutButton";
this.AboutButton.Size = new System.Drawing.Size(57, 74);
this.AboutButton.TabIndex = 9;
this.AboutButton.Text = "\r\n\r\nAbout";
this.AboutButton.UseVisualStyleBackColor = true;
this.AboutButton.Click += new System.EventHandler(this.AboutButton_Click);
//
// LogButton
//
this.LogButton.FlatAppearance.BorderSize = 0;
this.LogButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.LogButton.Font = new System.Drawing.Font("Segoe MDL2 Assets", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.LogButton.Location = new System.Drawing.Point(442, 3);
this.LogButton.Name = "LogButton";
this.LogButton.Size = new System.Drawing.Size(57, 74);
this.LogButton.TabIndex = 8;
this.LogButton.Text = "\r\n\r\nLog";
this.LogButton.UseVisualStyleBackColor = true;
this.LogButton.Click += new System.EventHandler(this.LogButton_Click);
//
// LogoutButton
//
this.LogoutButton.Enabled = false;
this.LogoutButton.FlatAppearance.BorderSize = 0;
this.LogoutButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.LogoutButton.Font = new System.Drawing.Font("Segoe MDL2 Assets", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.LogoutButton.Location = new System.Drawing.Point(379, 3);
this.LogoutButton.Name = "LogoutButton";
this.LogoutButton.Size = new System.Drawing.Size(57, 74);
this.LogoutButton.TabIndex = 7;
this.LogoutButton.Text = "\r\n\r\nLogout";
this.LogoutButton.UseVisualStyleBackColor = true;
this.LogoutButton.Click += new System.EventHandler(this.LogoutButton_Click);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Segoe UI", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.label2.ForeColor = System.Drawing.Color.LightGray;
this.label2.Location = new System.Drawing.Point(353, 22);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(20, 32);
this.label2.TabIndex = 6;
this.label2.Text = "|";
//
// UserSettingsButton
//
this.UserSettingsButton.Enabled = false;
this.UserSettingsButton.FlatAppearance.BorderSize = 0;
this.UserSettingsButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.UserSettingsButton.Font = new System.Drawing.Font("Segoe MDL2 Assets", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.UserSettingsButton.Location = new System.Drawing.Point(290, 3);
this.UserSettingsButton.Name = "UserSettingsButton";
this.UserSettingsButton.Size = new System.Drawing.Size(57, 74);
this.UserSettingsButton.TabIndex = 5;
this.UserSettingsButton.Text = "\r\n\r\nMe";
this.UserSettingsButton.UseVisualStyleBackColor = true;
//
// SettingsButton
//
this.SettingsButton.FlatAppearance.BorderSize = 0;
this.SettingsButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.SettingsButton.Font = new System.Drawing.Font("Segoe MDL2 Assets", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.SettingsButton.Location = new System.Drawing.Point(227, 3);
this.SettingsButton.Name = "SettingsButton";
this.SettingsButton.Size = new System.Drawing.Size(57, 74);
this.SettingsButton.TabIndex = 4;
this.SettingsButton.Text = "\r\n\r\nOptions";
this.SettingsButton.UseVisualStyleBackColor = true;
this.SettingsButton.Click += new System.EventHandler(this.ConfigButton_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Segoe UI", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.label1.ForeColor = System.Drawing.Color.LightGray;
this.label1.Location = new System.Drawing.Point(201, 22);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(20, 32);
this.label1.TabIndex = 3;
this.label1.Text = "|";
//
// DownloadButton
//
this.DownloadButton.Enabled = false;
this.DownloadButton.FlatAppearance.BorderSize = 0;
this.DownloadButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.DownloadButton.Font = new System.Drawing.Font("Segoe MDL2 Assets", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.DownloadButton.Location = new System.Drawing.Point(138, 3);
this.DownloadButton.Name = "DownloadButton";
this.DownloadButton.Size = new System.Drawing.Size(57, 74);
this.DownloadButton.TabIndex = 2;
this.DownloadButton.Text = "\r\n\r\nGet";
this.DownloadButton.UseVisualStyleBackColor = true;
this.DownloadButton.Click += new System.EventHandler(this.DownloadButton_Click);
//
// SyncButton
//
this.SyncButton.Enabled = false;
this.SyncButton.FlatAppearance.BorderSize = 0;
this.SyncButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.SyncButton.Font = new System.Drawing.Font("Segoe MDL2 Assets", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.SyncButton.Location = new System.Drawing.Point(75, 3);
this.SyncButton.Name = "SyncButton";
this.SyncButton.Size = new System.Drawing.Size(57, 74);
this.SyncButton.TabIndex = 1;
this.SyncButton.Text = "\r\n\r\nSync";
this.SyncButton.UseVisualStyleBackColor = true;
this.SyncButton.Click += new System.EventHandler(this.SyncButton_Click);
//
// AddButton
//
this.AddButton.Enabled = false;
this.AddButton.FlatAppearance.BorderSize = 0;
this.AddButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.AddButton.Font = new System.Drawing.Font("Segoe MDL2 Assets", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.AddButton.Location = new System.Drawing.Point(12, 3);
this.AddButton.Name = "AddButton";
this.AddButton.Size = new System.Drawing.Size(57, 74);
this.AddButton.TabIndex = 0;
this.AddButton.Text = "\r\n\r\nAdd";
this.AddButton.UseVisualStyleBackColor = true;
this.AddButton.Click += new System.EventHandler(this.AddButton_Click);
//
// GameLibrary
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
@@ -238,20 +270,20 @@
this.BackColor = System.Drawing.SystemColors.Window;
this.ClientSize = new System.Drawing.Size(1004, 511);
this.Controls.Add(this.listView1);
this.Controls.Add(this.panel1);
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.toolStrip1);
this.DoubleBuffered = true;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.Margin = new System.Windows.Forms.Padding(2);
this.MinimumSize = new System.Drawing.Size(1018, 544);
this.Name = "GameLibrary";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Game Library";
this.Load += new System.EventHandler(this.GameLibrary_Load);
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@@ -260,20 +292,20 @@
#endregion
private ListView listView1;
private ImageList coverList;
private ToolStrip toolStrip1;
private ToolStripButton AddButton;
private ToolStripButton SyncButton;
private ToolStripButton DownloadButton;
private ToolStripSeparator toolStripSeparator1;
private ToolStripButton SettingButton;
private ToolStripSeparator toolStripSeparator2;
private ToolStripButton LogoutButton;
private ToolStripButton LogButton;
private ToolStripButton AboutButton;
private StatusStrip statusStrip1;
private ToolStripDropDownButton TasksButton;
private ToolStripStatusLabel StatusLabel;
private ToolStripProgressBar MainProgressBar;
private ToolStripButton UserSettingsButton;
private Panel panel1;
private Button AddButton;
private Label label1;
private Button DownloadButton;
private Button SyncButton;
private Button UserSettingsButton;
private Button SettingsButton;
private Button LogoutButton;
private Label label2;
private Button AboutButton;
private Button LogButton;
}
}

View File

@@ -1,4 +1,4 @@
using OpenSaveCloudClient.Models;
using OpenSaveCloudClient.Models;
using OpenSaveCloudClient.Core;
using IGDB;
using OpenSaveCloudClient.Models.Remote;
@@ -50,6 +50,7 @@ namespace OpenSaveCloudClient
{
saveManager.DetectChanges();
this.Invoke((MethodInvoker)delegate {
SetAdminControls();
AboutButton.Enabled = true;
if (_configuration.GetBoolean("synchronization.at_login", true))
{
@@ -79,6 +80,11 @@ namespace OpenSaveCloudClient
Close();
} else
{
new Thread(() =>
{
saveManager.DetectChanges();
}).Start();
SetAdminControls();
Enabled = true;
AboutButton.Enabled = true;
if (_configuration.GetBoolean("synchronization.at_login", true))
@@ -92,6 +98,20 @@ namespace OpenSaveCloudClient
}
}
private void SetAdminControls()
{
if (serverConnector.ConnectedUser != null && serverConnector.ConnectedUser.IsAdmin)
{
UserSettingsButton.Click += UserSettingsButton_Admin_Click;
UserSettingsButton.Text = "\n\nUsers";
}
else
{
UserSettingsButton.Click += UserSettingsButton_Click;
UserSettingsButton.Text = "\n\nMe";
}
}
private void AddButton_Click(object sender, EventArgs e)
{
AddGameForm form = new(_client);
@@ -207,6 +227,15 @@ namespace OpenSaveCloudClient
private void LogoutButton_Click(object sender, EventArgs e)
{
if (serverConnector.ConnectedUser != null && serverConnector.ConnectedUser.IsAdmin)
{
UserSettingsButton.Click -= UserSettingsButton_Admin_Click;
}
else
{
UserSettingsButton.Click -= UserSettingsButton_Click;
}
UserSettingsButton.Text = "\n\nMe";
serverConnector.Logout();
LockCriticalControls(true);
AboutButton.Enabled = false;
@@ -227,26 +256,11 @@ namespace OpenSaveCloudClient
private void LogManager_NewMessage(object? sender, NewMessageEventArgs e)
{
int errors = logManager.Messages.Count(m => m.Severity == LogSeverity.Error);
int warnings = logManager.Messages.Count(m => m.Severity == LogSeverity.Warning);
string label = "";
if (errors > 0)
{
label = String.Format("({0} errors)", errors);
}
if (warnings > 0)
{
if (errors > 0)
{
label += " ";
}
label = String.Format("({0} warnings)", warnings);
}
if (errors > 0 || warnings > 0)
bool errors = logManager.Messages.Exists(m => m.Severity != LogSeverity.Information);
if (errors)
{
this.Invoke((MethodInvoker)delegate {
LogButton.Text = label;
LogButton.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText;
LogButton.Text = "\n\nLog";
});
}
}
@@ -254,8 +268,7 @@ namespace OpenSaveCloudClient
private void LogManager_LogCleared(object? sender, ClearEventArgs e)
{
this.Invoke((MethodInvoker)delegate {
LogButton.Text = "Show logs";
LogButton.DisplayStyle = ToolStripItemDisplayStyle.Image;
LogButton.Text = "\n\nLog";
});
}
@@ -376,10 +389,16 @@ namespace OpenSaveCloudClient
}
}
private void UserSettingsButton_Click(object sender, EventArgs e)
private void UserSettingsButton_Click(object? sender, EventArgs e)
{
UserForm userForm = new();
userForm.ShowDialog();
UserForm form = new();
form.ShowDialog();
}
private void UserSettingsButton_Admin_Click(object? sender, EventArgs e)
{
UserManagementForm form = new();
form.ShowDialog();
}
}
}

View File

@@ -65,7 +65,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAEZTeXN0ZW0uV2luZG93cy5Gb3JtcywgQ3VsdHVyZT1uZXV0cmFs
LCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAmU3lzdGVtLldpbmRvd3MuRm9ybXMu
SW1hZ2VMaXN0U3RyZWFtZXIBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAA7OMCAAJNU0Z0AUkBTAMBAQAB
aAEBAWgBAQEIAQEBdgEBBP8BGQEACP8BQgFNATYHAAE2AwABKAMAASABBAIAAXYBAQIAAQEBAAEYBQAB
wAEBAcABAQEIAQEBdgEBBP8BGQEACP8BQgFNATYHAAE2AwABKAMAASABBAIAAXYBAQIAAQEBAAEYBQAB
QAEUARIRAANSA1EBUgFRBVICUQNSAlEDUgJRAVIEUQFSBVEBUg1RAVAIUQFQAlEBUAFRAVADUQFQAVEE
UAFRAVABUQJQAVECUAFRAVABUQ5QAU8BUAFPAlADTwZQAU8BUAFPAVADTwNQAU8CUAZPAVABTwFQBU8B
UAZPAU4ETwFOBE8BTgVPAU4DTwJOBE8CTgJPAU4BTwFOAU8HTgFPCE4BTwdOAU0GTgJNBE4BTQNOAk0B
@@ -3222,122 +3222,12 @@
AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/
AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/
AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8AmgAL
</value>
</data>
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>155, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="AddButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVEhLvdU9DgFRFIbhkUjYjL1QKDRKoVTZgEKD5SDY
AEq9TqEioeY74igm7/yY3HGSp/nuzxk3cW/0j6pIS0YphlKXQjWXZw4LKdTkJrQhKdSENkqzFTrGuKbY
8eMmocwEB0K5Cg6EhGGSnexjWRYMyVmqUpPHJ8sDQ3IUr4vQHIIhKaXBSvrSk7Z4dcUysxRa6zB0Dckq
m0NrHYZuLf4L7Ku9OmLZQDZCax2GxM7d6yQ0h2BISm9wF/sP2G1qVwDNIRgmOXzQWBIMQ/rpwfnV+za1
O5sGQ5jK+9Wx12csk0Bsr++LVmJF0QsZDaeLybae4AAAAABJRU5ErkJggg==
</value>
</data>
<data name="SyncButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGfSURBVEhL3dU7L0RBGMbxdY0oaCVa94iGhApfgIKWaIiG
xDXiE7iXhESIQiFx+QI+hAqFUqhcC4mQ8H/sjrxnds45OuJJfsmeObPz7u6ZfSfzF1KAJgxhFlMYQB3i
0o/e7Mv4lGISV/iIcYkRlMBlEe5+gwZCacEF7GJJzlALu7h0Iy9deIadeIdDLGMVx3iEnfPqXUtegRrc
w014whjK4KccM3iBXdTKK3AKd/MajUjLLuyiVqSALtyNN7QiKdpda7AL+iIF9uBurGsgJXOwi4VECmxD
g/r0sdvL5AD+gr4OfKcC4+j8ukpPFeahrRmitQrxD1KEUeihhahd6Of4SfRQ9dNUfl3logcRekDWPtKi
jfEOzd/SgIvd/3H0qdKyCTd/QwMuaQUWkJZ2aHu790T+pEkFdpCWZtzAvecIkSQVUCNTQ1Nj86OxCdjO
e4tqRBIq4LdeddUTqPesQO36AXaOWnob8uIXWIIODx0idjyJ5tYjGLVkN1GLu+gYHIaORbuYdQ79h4qR
mB70ZV8Go2+kg14H/jQGc2O/nUzmE3Xv2DrlGzgkAAAAAElFTkSuQmCC
</value>
</data>
<data name="DownloadButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAE8SURBVEhL7dRPK0RRGMfxs1CEzSQLZWHBYjZ4AxorxY5i
pSykycRGyrwPzd4LULK0srIQG6VISWzZTBqL8ff73O4zHcdzdbpjYTG/+izuOed5zv3vOmknPVjDAU5x
iB0Mou2M4xafhjoWkDsjeITVXL1jBhNYxRz6EZV9WE1DL/jwju8wiV8zgFf4jXzS0G8aukYXMjMNq1DN
Qm6HNacyr6IXu7CK1HDKmlNT+JExPMAq8MVsUEUBrfThHtbiUMwG4gmtK9mGtUhtYQkN6AbPmIecrVUj
ZM0Q3FE6kGUdkhLkKxZ6dhVYNUqeqbvyBizy2i4izDLeYNWoC7hjbyBLuElMc3GJ5B5bkyHZZBMbiGku
9pC8/zfpwF9qQv5VSUYhn7m1MA9pvoJv6UYZ8t8/w3kOJ6ihiE7+RZz7Ao1fDDMxq54qAAAAAElFTkSu
QmCC
</value>
</data>
<data name="SettingButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFZSURBVEhLrdRJSsRAFMbxgIqI7VI9gPNCt251oScSxGmn
jQsVHHYK6iH0MCrOJ3BCQdH/F+pBESvpVKgPfnR3pfplqFfJOqQHM063BlJmAQ/4de4wjySZxCesuPnA
OKLSxheKxeQaI46+h+aUUc0tZK9uIGQHll2E5lR5QX6WqjsYxRhu3FhdqrmJYJKuQVnURfew4reYQ9Ko
96edLg14mcIRLnGICSTLIvS4/Mf3juA+0SIuYTnCE1RUTaDushZ+hM1RTdWO7g6f9oeiLgsdv0L0BvLl
V0gqT6BJG9iO8AwV0MXtwZ6CHp3NWYfdYXTUwsVFfkNUGw9jFkP5r//RZjzABfZRewP24Qw/0JV94wS9
SJJz+LdudJJGKXtdr6Afq95YjI6v6xaUAYSO11H5utaV6yRr3liM0te1Fjj0h8ZrUIy66BTqHhXW5zGS
dZFlENoH+myYLPsDY1n9bDHVXF4AAAAASUVORK5CYII=
</value>
</data>
<data name="UserSettingsButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFsSURBVEhL7dW/K0VhHMfxg+RXyWCQDEabP8BiUFjsWFD8
AYQySGSwSBkMLJTJJAx+JIuUSKEMlDKRH5sfkXh/bvfcvvf03DzO2eRTr27P9z7n27nnec5zgz+bSszg
Bu+4xBhKkTg1uMaXwzHKkSibcDUPzSF2auFqaj2jBLHSAlfTqDrESgNcDaOqEStFeICraegUidIHV2P5
RDOi6cAoulIjj/TjBbb5E9rhyi005zU18kwVujEMNa5AmHzMoxcrsDeyjh4sohCxosa2aS4DyIr2dyd0
dxvYNlYxDc1Zhm2kcRt0na2vIZMm6OyxE1zGUYCD9PgKemRKHk6g+hkyj6gVH7CNctFRoUa76fE5bPah
+lFqRLR4P+19SyfqbKQ2hXpoq9r6EoJBU/DRCN9rJhDsmIKPLRSnPydxCPu93nSt0x7KEFzATvAxAkXv
ihb4Hqq/QRsgK/oZvgtsPeIOWvAhLED/ev/5TYLgG+Ol5Rvi4Ts7AAAAAElFTkSuQmCC
</value>
</data>
<data name="LogoutButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEySURBVEhLxdWxSgMxGMDxUxE6WGgFu3TUN+jW+hAddBLf
QqhDQelUcO/eoS+gg046OTjo0EFQ8Q2Elq6C+v/OpnzJ5eRCrP7hBzbJXeAwd8lfVsUhOsoRdhDdPqb4
9HhGVC28w3dzEb3BFczNXnCG/lwX28hrF/JYV9JfOc1gNvjpZr4mkOuGWJMBX+bmIrQPmGvPUUKm39pA
XGMDVnpBaPpa4w6bWKQn3eQMvEKvKeIeW0jTE27H0PMhHlGHNeh2Aj0fagxrwC12A3lU1oBbzCN6QA3W
oJscvCfoNUXcooI0PRGaew7EDcpYpCdDcze4QOY06wWh6Q1GWEcm/bIL/bi8Qa4bYFUGfF3CbCCv6x6K
ftEaaH//mV8TS/3gSHsw7/albCDJ/+0BTlH0i/bfJckXzhLWGnVGQEkAAAAASUVORK5CYII=
</value>
</data>
<data name="LogButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEYSURBVEhLrdU9SgRBFMTxAVM9hRquoHgLvY5uZC6ixzBQ
UNBAr7HGmpkopgYa+PEv6IFH82psei34MTu99ZplZqGHxuziFm/FTVn7l+zjEz+VD+xhqaziBfXmo1es
oTk7eMA36s0esV7oc/29ZhbQHjYq1IOjU4w5Q9YR7WHzhWxI9Ks3sImnspbRHjbZQA+brNzDJiv3sMnK
PWyycg+bWHrHVbnG9RY2sXSgBXII3V9gRQtJZoizNrF0j61y1f0zjjBPnCPO2sTSMmyycg+bWLqDnm18
RCc4Tuj9xFmbWKpf8iXcS9a7irM2saS/53W5xvUWNlm5h01W7mEzdR60mjwPpk60VpMnms5TFbIz+S/j
mbyNkmH4BazcYjvVCtzAAAAAAElFTkSuQmCC
</value>
</data>
<data name="AboutButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIdSURBVEhLlZU5ixVBFEYfqCjIgIMbjo7Lz1BBFBQURtE/
oYN7aqKxgYGha2BoNIlLJjjMgJGBgUtgqMxkOgbuek5P30d1vd7eBweqblXd7v7qdtWgQ7vhEjyHd/Ct
xLaxizANY2sn3IHf8K+DP/AY9kIvnYYViARLcB/OwkyJbWPLEPO+wilo1RXwjVzwCUy0FprkmHOc6xrX
XoZa+eaRfAG2Q19thhcQDxn5kl0QtryE9TCuXDMP5tCuKRjqATjgp241kGgdXIeP4Bz5Ca/hDKTaBp/B
OfcMKEsxqkU/c92ESJzzF45BqnPgmDl1pqhzA1ZLvqFrwLp3/DYcLTkOi2B8DlKZI6rrgoFnZceyy7UJ
tEPcyFTXwHWvil5VD8GxJ3bel506e9QB2L/aLLQBbsB3cN0tyBU2+ccXO27npJ0OHYEP4Hx5A5OQy1yO
m7v3A7TrBzj3F/jmG6FOlQd0WRTaAc6TgwZaVLGobZNzWXGeoF2qbLIL7NSVaa59sGe12ai0TM8b8Dxv
+9FCh0Hv5ZCBBs2CuZxX/GhKewzWHRWhq+Ac0ao6pUeF98lQXjBRTU2HnVWkt3dhwkCm9LD7AhZFRScg
rBr3uN4C6XHdWPJeFnEn+KmWW9vGO6bnYYtrm+wbyssi7BIrQmtM5JuJbWPplaktXqe95EZ7eloJkaAJ
3/oRjHjeR5aZR+5TeAveemLbn8g6H5biqAaD/8fBxP0P4an9AAAAAElFTkSuQmCC
</value>
</data>
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>416, 17</value>
</metadata>
<data name="TasksButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEzSURBVEhL7dXPK8RBGMfx4eCEC7VXhX/ByUGOamudKbm4
rNpCKSkXSu3FP+FM4uIvoJSTknV23LY9KNnF+zM7j8baNPtDCp961cyzNU/TzHfW/VQmUcCgn/U4Y3jA
K9Sk6yxgBwMYxS20eBnaiWUC99BvKZ6wB1cNhRNchPEjphFnHfECKbS2y+MlFKSGHJqjHZQQL/AV7WAX
PiuwJqsqfEfmkG0Mf0GKqGDGz7qMrudwY+izBTuoJRVC+rGIzUQb0MVw19B1msUy7LAP0QeLFrfGqe7g
rsJEd/85jM+hncXpuEEGN6EgajiE5mg3+ur3E21jHD5qcgktrvF/PmQEBzjGvAq9zhnsgOuYgqXdJzr2
6bk2a7B08kTH/HN9GhVa7aCdJzr2/lzbGRyh1f/An45zbyHvtHhkFi9MAAAAAElFTkSuQmCC
</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAYAAAAAAAEAIAC1gQAAZgAAAICAAAABACAAKAgBABuCAABAQAAAAQAgAChCAABDigEAMDAAAAEA

View File

@@ -47,7 +47,7 @@
this.Severity});
this.listView1.GridLines = true;
this.listView1.Location = new System.Drawing.Point(0, 27);
this.listView1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.listView1.Margin = new System.Windows.Forms.Padding(2);
this.listView1.MultiSelect = false;
this.listView1.Name = "listView1";
this.listView1.ShowGroups = false;
@@ -73,18 +73,18 @@
this.toolStripButton1});
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(746, 25);
this.toolStrip1.Size = new System.Drawing.Size(746, 26);
this.toolStrip1.TabIndex = 1;
this.toolStrip1.Text = "toolStrip1";
//
// toolStripButton1
//
this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image")));
this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.toolStripButton1.Font = new System.Drawing.Font("Segoe MDL2 Assets", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton1.Name = "toolStripButton1";
this.toolStripButton1.Size = new System.Drawing.Size(23, 22);
this.toolStripButton1.Text = "toolStripButton1";
this.toolStripButton1.Size = new System.Drawing.Size(32, 23);
this.toolStripButton1.Text = "";
this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click);
//
// LogsForm
@@ -95,7 +95,7 @@
this.Controls.Add(this.toolStrip1);
this.Controls.Add(this.listView1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.Margin = new System.Windows.Forms.Padding(2);
this.MinimumSize = new System.Drawing.Size(507, 205);
this.Name = "LogsForm";
this.Text = "Logs";

View File

@@ -61,16 +61,6 @@
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="toolStripButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAD5SURBVEhLvdShTkJxGIbxYyKZbRTdjESjkSojGKCQ6MzN
ooWiTRPjCty8ATdvgMAFEIBMYjoKxaDPF9wAXz+/DxzP9iuH8/7ZGeMUf9TEGz4Fu95AqBNc4XrDO9Th
3+zzzY2dY+etNYU6YFtjrDWBunFbP77AHukW9//gBsfYf12ox82yH1rWgRpktSFrQQ2yLiG7gBpkVSE7
hxpknUFWgRpknUJWhhpkHUF2CDXIKkF2gA+oUdQSbnOoYdQMbru+9EZwG0INowZwe4UaRr3A7RlqGPUE
tz7UMKoHtzuoYZTt3epQw6ga3OzP9ogF1AG/sfsfYPuViuILjTF1rARjiZEAAAAASUVORK5CYII=
</value>
</data>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAYAAAAAAAEAIAC1gQAAZgAAAICAAAABACAAKAgBABuCAABAQAAAAQAgAChCAABDigEAMDAAAAEA

View File

@@ -79,7 +79,7 @@
this.groupBox1.Margin = new System.Windows.Forms.Padding(2);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Padding = new System.Windows.Forms.Padding(2);
this.groupBox1.Size = new System.Drawing.Size(362, 150);
this.groupBox1.Size = new System.Drawing.Size(362, 158);
this.groupBox1.TabIndex = 3;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Change password";
@@ -88,7 +88,7 @@
//
this.SavePasswordButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.SavePasswordButton.Enabled = false;
this.SavePasswordButton.Location = new System.Drawing.Point(283, 123);
this.SavePasswordButton.Location = new System.Drawing.Point(284, 125);
this.SavePasswordButton.Margin = new System.Windows.Forms.Padding(2);
this.SavePasswordButton.Name = "SavePasswordButton";
this.SavePasswordButton.Size = new System.Drawing.Size(75, 23);
@@ -110,7 +110,7 @@
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(4, 31);
this.label2.Location = new System.Drawing.Point(4, 25);
this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(84, 15);
@@ -133,7 +133,7 @@
//
this.NewPasswordBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.NewPasswordBox.Location = new System.Drawing.Point(4, 49);
this.NewPasswordBox.Location = new System.Drawing.Point(3, 42);
this.NewPasswordBox.Margin = new System.Windows.Forms.Padding(2);
this.NewPasswordBox.Name = "NewPasswordBox";
this.NewPasswordBox.Size = new System.Drawing.Size(355, 23);
@@ -163,8 +163,12 @@
this.Controls.Add(this.label1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(2);
this.MaximizeBox = false;
this.MaximumSize = new System.Drawing.Size(398, 331);
this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(398, 331);
this.Name = "UserForm";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "User information";
this.Load += new System.EventHandler(this.UserForm_Load);

View File

@@ -0,0 +1,164 @@
namespace OpenSaveCloudClient
{
partial class UserManagementForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UserManagementForm));
this.listView1 = new System.Windows.Forms.ListView();
this.name = new System.Windows.Forms.ColumnHeader();
this.panel1 = new System.Windows.Forms.Panel();
this.label2 = new System.Windows.Forms.Label();
this.DeleteButton = new System.Windows.Forms.Button();
this.UserSettingsButton = new System.Windows.Forms.Button();
this.AddButton = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// listView1
//
this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.name});
this.listView1.Location = new System.Drawing.Point(12, 86);
this.listView1.Name = "listView1";
this.listView1.Size = new System.Drawing.Size(234, 352);
this.listView1.TabIndex = 0;
this.listView1.UseCompatibleStateImageBehavior = false;
this.listView1.View = System.Windows.Forms.View.Details;
//
// name
//
this.name.Text = "Name";
this.name.Width = 220;
//
// panel1
//
this.panel1.Controls.Add(this.label2);
this.panel1.Controls.Add(this.DeleteButton);
this.panel1.Controls.Add(this.UserSettingsButton);
this.panel1.Controls.Add(this.AddButton);
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.MaximumSize = new System.Drawing.Size(0, 80);
this.panel1.MinimumSize = new System.Drawing.Size(0, 80);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(800, 80);
this.panel1.TabIndex = 6;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Segoe UI", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.label2.ForeColor = System.Drawing.Color.LightGray;
this.label2.Location = new System.Drawing.Point(138, 22);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(20, 32);
this.label2.TabIndex = 9;
this.label2.Text = "|";
//
// DeleteButton
//
this.DeleteButton.Enabled = false;
this.DeleteButton.FlatAppearance.BorderSize = 0;
this.DeleteButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.DeleteButton.Font = new System.Drawing.Font("Segoe MDL2 Assets", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.DeleteButton.Location = new System.Drawing.Point(75, 3);
this.DeleteButton.Name = "DeleteButton";
this.DeleteButton.Size = new System.Drawing.Size(57, 74);
this.DeleteButton.TabIndex = 1;
this.DeleteButton.Text = "\r\n\r\nDelete";
this.DeleteButton.UseVisualStyleBackColor = true;
//
// UserSettingsButton
//
this.UserSettingsButton.FlatAppearance.BorderSize = 0;
this.UserSettingsButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.UserSettingsButton.Font = new System.Drawing.Font("Segoe MDL2 Assets", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.UserSettingsButton.Location = new System.Drawing.Point(164, 3);
this.UserSettingsButton.Name = "UserSettingsButton";
this.UserSettingsButton.Size = new System.Drawing.Size(57, 74);
this.UserSettingsButton.TabIndex = 8;
this.UserSettingsButton.Text = "\r\n\r\nMe";
this.UserSettingsButton.UseVisualStyleBackColor = true;
this.UserSettingsButton.Click += new System.EventHandler(this.UserSettingsButton_Click);
//
// AddButton
//
this.AddButton.FlatAppearance.BorderSize = 0;
this.AddButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.AddButton.Font = new System.Drawing.Font("Segoe MDL2 Assets", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.AddButton.Location = new System.Drawing.Point(12, 3);
this.AddButton.Name = "AddButton";
this.AddButton.Size = new System.Drawing.Size(57, 74);
this.AddButton.TabIndex = 0;
this.AddButton.Text = "\r\n\r\nAdd";
this.AddButton.UseVisualStyleBackColor = true;
//
// groupBox1
//
this.groupBox1.Location = new System.Drawing.Point(252, 86);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(536, 352);
this.groupBox1.TabIndex = 7;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Detail";
//
// UserManagementForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.Window;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.panel1);
this.Controls.Add(this.listView1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximumSize = new System.Drawing.Size(816, 489);
this.MinimumSize = new System.Drawing.Size(816, 489);
this.Name = "UserManagementForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Management";
this.Load += new System.EventHandler(this.UserManagementForm_Load);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private ListView listView1;
private ColumnHeader name;
private Panel panel1;
private Button DeleteButton;
private Button AddButton;
private GroupBox groupBox1;
private Label label2;
private Button UserSettingsButton;
}
}

View File

@@ -0,0 +1,56 @@
using OpenSaveCloudClient.Core;
using OpenSaveCloudClient.Models.Remote;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace OpenSaveCloudClient
{
public partial class UserManagementForm : Form
{
private ServerConnector serverConnector;
public UserManagementForm()
{
InitializeComponent();
serverConnector = ServerConnector.GetInstance();
}
private void UserSettingsButton_Click(object sender, EventArgs e)
{
UserForm frm = new();
frm.ShowDialog();
}
private void UserManagementForm_Load(object sender, EventArgs e)
{
new Thread(() =>
{
List<User>? users = serverConnector.GetUsers();
if (users != null)
{
this.Invoke((MethodInvoker)delegate {
UpdateRemoteList(users);
});
}
}).Start();
}
private void UpdateRemoteList(List<User> users)
{
foreach (User user in users)
{
ListViewItem lvi = listView1.Items.Add(user.Username);
lvi.SubItems.Add(Convert.ToString(user.Id));
lvi.SubItems.Add(user.Role);
}
}
}
}

File diff suppressed because it is too large Load Diff