diff --git a/ActionButton/ActionButton.cs b/ActionButton/ActionButton.cs index 2f0db20d..7595f80c 100644 --- a/ActionButton/ActionButton.cs +++ b/ActionButton/ActionButton.cs @@ -45,9 +45,9 @@ public void UpdateHotkey() public void UpdateBindingState() { - if (!String.IsNullOrWhiteSpace(this.StateBindingVariable)) + if (!string.IsNullOrWhiteSpace(this.StateBindingVariable)) { - Variables.Variable variable = Variables.VariableManager.Variables.Find(v => v.Name.Equals(this.StateBindingVariable)); + Variables.Variable variable = Variables.VariableManager.ListVariables.ToList().Find(v => v.Name.Equals(this.StateBindingVariable)); if (variable != null) { this.UpdateBindingState(variable); @@ -132,9 +132,15 @@ private void UpdateBindingState(Variables.Variable variable) public event EventHandler IconChanged; private bool _state = false; + private string _iconOff = string.Empty; + private string _iconOn = string.Empty; + private Color _backgroundColorOff = Color.FromArgb(35, 35, 35); + private Color _backgroundColorOn = Color.FromArgb(35, 35, 35); + + public bool State { - get { return _state; } + get => _state; set { if (_state == value) return; @@ -147,12 +153,9 @@ public bool State } } - private string _iconOff = string.Empty; public string IconOff { - get - { - return this._iconOff; - } + get => this._iconOff; + set { this._iconOff = value; @@ -162,13 +165,10 @@ public string IconOff { } } } - private string _iconOn = string.Empty; + public string IconOn { - get - { - return this._iconOn; - } + get => this._iconOn; set { this._iconOn = value; @@ -179,6 +179,36 @@ public string IconOn } } + public Color BackColorOff + { + get => this._backgroundColorOff; + set + { + if (this._backgroundColorOff == value) return; + this._backgroundColorOff = value; + MacroDeckServer.UpdateState(this); + if (StateChanged != null) + { + StateChanged(this, EventArgs.Empty); + } + } + } + + public Color BackColorOn + { + get => this._backgroundColorOn; + set + { + if (this._backgroundColorOn == value) return; + this._backgroundColorOn = value; + MacroDeckServer.UpdateState(this); + if (StateChanged != null) + { + StateChanged(this, EventArgs.Empty); + } + } + } + public ButtonLabel LabelOff { get; set; } = new ButtonLabel(); public ButtonLabel LabelOn { get; set; } = new ButtonLabel(); public Color BackColorOff = Color.FromArgb(35, 35, 35); diff --git a/ActionButton/ConditionAction.cs b/ActionButton/ConditionAction.cs index 8b3a88af..31610928 100644 --- a/ActionButton/ConditionAction.cs +++ b/ActionButton/ConditionAction.cs @@ -88,16 +88,14 @@ private void UpdateConfiguration() public override string Description => ""; - public override string DisplayName { get; set; } - public ActionConfigControl GetActionConfigurator(ActionConfigurator actionConfigurator) { return null; } public override void Trigger(string clientId, ActionButton actionButton) { bool result = false; string conditionValue2 = this.ConditionValue2.ToString(); - Variables.Variable variable = Variables.VariableManager.Variables.Find(v => v.Name.Equals(this._conditionValue1Source)); + Variable variable = VariableManager.ListVariables.ToList().Find(v => v.Name.Equals(this._conditionValue1Source)); - foreach (Variables.Variable v in Variables.VariableManager.Variables) + foreach (Variable v in VariableManager.ListVariables) { if (conditionValue2.ToLower().Contains("{" + v.Name.ToLower() + "}")) { diff --git a/Backup/BackupManager.cs b/Backup/BackupManager.cs index feb924b9..2a70a38e 100644 --- a/Backup/BackupManager.cs +++ b/Backup/BackupManager.cs @@ -4,6 +4,7 @@ using SuchByte.MacroDeck.Language; using SuchByte.MacroDeck.Logging; using SuchByte.MacroDeck.Utils; +using SuchByte.MacroDeck.Variables; using System; using System.Collections.Generic; using System.Diagnostics; @@ -217,6 +218,7 @@ public static void CreateBackup() { if (BackupInProgress) return; BackupInProgress = true; + VariableManager.Close(); string backupFileName = string.Format("backup_{0}.zip", DateTime.Now.ToString("yy-MM-dd_HH-mm-ss")); MacroDeckLogger.Info("Sarting creation of backup: " + backupFileName); @@ -270,6 +272,7 @@ public static void CreateBackup() } } finally { + VariableManager.Initialize(); BackupInProgress = false; } } diff --git a/Configuration/Configuration.cs b/Configuration/Configuration.cs index eef7004a..3d891c32 100644 --- a/Configuration/Configuration.cs +++ b/Configuration/Configuration.cs @@ -41,11 +41,8 @@ public bool AutoStart { get [JsonProperty("Update.Auto")] public bool AutoUpdates { get; set; } = true; - [JsonProperty("Update.Channel.Dev")] - public bool UpdateDevVersions { get; set; } = false; - - [JsonProperty("Update.Channel.Beta")] - public bool UpdateBetaVersions { get; set; } = true; + [JsonProperty("Update.InstallBeta")] + public bool UpdateBetaVersions { get; set; } = false; [JsonProperty("Connection.Host.Address")] public string Host_Address { get; set; } diff --git a/Device/DeviceManager.cs b/Device/DeviceManager.cs index a9081b78..3c4b3c54 100644 --- a/Device/DeviceManager.cs +++ b/Device/DeviceManager.cs @@ -1,10 +1,12 @@ using Newtonsoft.Json; +using SuchByte.MacroDeck.GUI.Dialogs; using SuchByte.MacroDeck.Logging; using SuchByte.MacroDeck.Profiles; using SuchByte.MacroDeck.Server; using System; using System.Collections.Generic; using System.IO; +using System.Linq; using System.Text; using System.Windows.Forms; @@ -184,7 +186,7 @@ public static bool RequestConnection(MacroDeckClient macroDeckClient) mainForm = form; } } - if (mainForm != null) + if (mainForm != null && mainForm.IsHandleCreated && !mainForm.IsDisposed) { mainForm.Invoke(new Action(() => { @@ -201,6 +203,7 @@ public static bool RequestConnection(MacroDeckClient macroDeckClient) { ClientId = macroDeckClient.ClientId, DisplayName = "Client " + macroDeckClient.ClientId, + ProfileId = ProfileManager.Profiles.FirstOrDefault().ProfileId, }; AddKnownDevice(macroDeckDevice); macroDeckDevice.ClientId = macroDeckClient.ClientId; @@ -227,35 +230,27 @@ public static bool RequestConnection(MacroDeckClient macroDeckClient) private static bool ShowConnectionDialog(MacroDeckClient macroDeckClient) { - using (var msgBox = new GUI.CustomControls.MessageBox()) + System.Media.SystemSounds.Exclamation.Play(); + using var newConnectionDialog = new NewConnectionDialog(macroDeckClient); + if (newConnectionDialog.ShowDialog() == DialogResult.Yes) { - System.Media.SystemSounds.Exclamation.Play(); - if (msgBox.ShowDialog(Language.LanguageManager.Strings.NewConnection, String.Format(Language.LanguageManager.Strings.XIsAnUnknownDevice, macroDeckClient.ClientId), MessageBoxButtons.YesNo) == DialogResult.Yes) + return true; + } + else + { + macroDeckClient?.SocketConnection?.Close(); + if (newConnectionDialog.Blocked) { MacroDeckDevice macroDeckDevice = new MacroDeckDevice { ClientId = macroDeckClient.ClientId, DisplayName = "Client " + macroDeckClient.ClientId, - ProfileId = ProfileManager.Profiles[0].ProfileId + Blocked = true }; - DeviceManager.AddKnownDevice(macroDeckDevice); - return true; - } - else - { - macroDeckClient.SocketConnection.Close(); - if (msgBox.ShowDialog(Language.LanguageManager.Strings.BlockConnection, String.Format(Language.LanguageManager.Strings.ShouldMacroDeckBlockConnectionsFromX, macroDeckClient.ClientId), MessageBoxButtons.YesNo) == DialogResult.Yes) - { - MacroDeckDevice macroDeckDevice = new MacroDeckDevice - { - ClientId = macroDeckClient.ClientId, - DisplayName = "Client " + macroDeckClient.ClientId, - Blocked = true - }; - DeviceManager.AddKnownDevice(macroDeckDevice); - } - return false; + AddKnownDevice(macroDeckDevice); } + return false; + } } diff --git a/Device/DeviceType.cs b/Device/DeviceType.cs index 122c59dd..79c9ce86 100644 --- a/Device/DeviceType.cs +++ b/Device/DeviceType.cs @@ -7,10 +7,9 @@ namespace SuchByte.MacroDeck.Device public enum DeviceType { Unknown, - Macro_Deck_DIY_OLED_6_V1, - WebPackageManager, Web, Android, iOS, + StreamDeck, } } diff --git a/Enums/AdbDeviceConnectionState.cs b/Enums/AdbDeviceConnectionState.cs new file mode 100644 index 00000000..18b316f3 --- /dev/null +++ b/Enums/AdbDeviceConnectionState.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SuchByte.MacroDeck.Enums +{ + public enum AdbDeviceConnectionState + { + CONNECTED, + DISCONNECTED + } +} diff --git a/ExtensionStore/ExtensionStoreHelper.cs b/ExtensionStore/ExtensionStoreHelper.cs index 459e4c8b..8588aa78 100644 --- a/ExtensionStore/ExtensionStoreHelper.cs +++ b/ExtensionStore/ExtensionStoreHelper.cs @@ -1,6 +1,17 @@ +<<<<<<< HEAD +using SuchByte.MacroDeck.GUI.CustomControls; +using SuchByte.MacroDeck.GUI.Dialogs; +using SuchByte.MacroDeck.GUI.MainWindowViews; +using SuchByte.MacroDeck.Icons; +using SuchByte.MacroDeck.Language; +using SuchByte.MacroDeck.Logging; +using SuchByte.MacroDeck.Model; +using SuchByte.MacroDeck.Notifications; +======= using SuchByte.MacroDeck.GUI.Dialogs; using SuchByte.MacroDeck.Icons; using SuchByte.MacroDeck.Model; +>>>>>>> origin/main using SuchByte.MacroDeck.Plugins; using System; using System.Collections.Generic; @@ -16,6 +27,15 @@ public class ExtensionStoreHelper private static ExtensionStoreDownloader extensionStoreDownloader; +<<<<<<< HEAD + public static event EventHandler OnInstallationFinished; + + private static string _updateNotification; + + private static bool _updateCheckRunning = false; + +======= +>>>>>>> origin/main public static void InstallPluginById(string packageId) { InstallPackages(new List { new ExtensionStoreDownloaderPackageInfoModel() { PackageId = packageId, ExtensionType = ExtensionType.Plugin } }); @@ -40,7 +60,15 @@ public static void InstallPackages(List>>>>>> origin/main })); } @@ -51,6 +79,11 @@ public static string GetPackageId(MacroDeckPlugin macroDeckPlugin) public static void SearchUpdatesAsync() { +<<<<<<< HEAD + if (_updateCheckRunning) return; + _updateCheckRunning = true; +======= +>>>>>>> origin/main PluginManager.PluginsUpdateAvailable.Clear(); IconManager.IconPacksUpdateAvailable.Clear(); Task.Run(() => @@ -68,6 +101,35 @@ public static void SearchUpdatesAsync() IconManager.SearchUpdate(iconPack); } +<<<<<<< HEAD + if (NotificationManager.GetNotification(_updateNotification) == null && (PluginManager.PluginsUpdateAvailable.Count + IconManager.IconPacksUpdateAvailable.Count) > 0) + { + var btnOpenExtensionManager = new ButtonPrimary() + { + AutoSize = true, + Text = LanguageManager.Strings.OpenExtensionManager + }; + btnOpenExtensionManager.Click += (sender, e) => + { + MacroDeck.MainWindow?.SetView(new ExtensionsView()); + }; + var btnUpdateAll = new ButtonPrimary() + { + AutoSize = true, + Text = LanguageManager.Strings.UpdateAll, + }; + btnUpdateAll.Click += (sender, e) => + { + NotificationManager.RemoveNotification(_updateNotification); + UpdateAllPackages(); + }; + _updateNotification = NotificationManager.SystemNotification("Extension Store", LanguageManager.Strings.UpdatesAvailable, true, icon: Properties.Resources.Macro_Deck_2021_update, controls: new List() { btnOpenExtensionManager, btnUpdateAll }); + } + + _updateCheckRunning = false; + +======= +>>>>>>> origin/main if (OnUpdateCheckFinished != null) { OnUpdateCheckFinished(null, EventArgs.Empty); @@ -75,7 +137,32 @@ public static void SearchUpdatesAsync() }); } +<<<<<<< HEAD + public static void UpdateAllPackages() + { + List packages = new List(); + foreach (var updatePlugin in PluginManager.PluginsUpdateAvailable) + { + if (PluginManager.UpdatedPlugins.Contains(updatePlugin)) continue; + packages.Add(new ExtensionStoreDownloaderPackageInfoModel() + { + ExtensionType = ExtensionType.Plugin, + PackageId = ExtensionStoreHelper.GetPackageId(updatePlugin) + }); + } + foreach (var updateIconPack in IconManager.IconPacksUpdateAvailable) + { + packages.Add(new ExtensionStoreDownloaderPackageInfoModel() + { + ExtensionType = ExtensionType.IconPack, + PackageId = updateIconPack.PackageId, + }); + } + InstallPackages(packages); + } +======= +>>>>>>> origin/main public static string InstalledIconPacksAsString { diff --git a/GUI/CustomControls/ButtonEditor/ActionSelectorOnPress.Designer.cs b/GUI/CustomControls/ButtonEditor/ActionSelectorOnPress.Designer.cs index 8800aec4..1dfed0bf 100644 --- a/GUI/CustomControls/ButtonEditor/ActionSelectorOnPress.Designer.cs +++ b/GUI/CustomControls/ButtonEditor/ActionSelectorOnPress.Designer.cs @@ -59,7 +59,7 @@ private void InitializeComponent() this.actionsOnPress.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.actionsOnPress.Location = new System.Drawing.Point(3, 3); this.actionsOnPress.Margin = new System.Windows.Forms.Padding(0); - this.actionsOnPress.MaximumSize = new System.Drawing.Size(869, 490); + this.actionsOnPress.MaximumSize = new System.Drawing.Size(869, 450); this.actionsOnPress.MinimumSize = new System.Drawing.Size(869, 1); this.actionsOnPress.Name = "actionsOnPress"; this.actionsOnPress.Size = new System.Drawing.Size(869, 1); @@ -138,7 +138,11 @@ private void InitializeComponent() // // ActionSelectorOnPress // +<<<<<<< HEAD + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); +======= +>>>>>>> origin/main this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(65)))), ((int)(((byte)(65))))); this.Controls.Add(this.flowLayoutPanel1); diff --git a/GUI/CustomControls/ButtonEditor/ActionSelectorOnPress.cs b/GUI/CustomControls/ButtonEditor/ActionSelectorOnPress.cs index 10624388..cf50bce8 100644 --- a/GUI/CustomControls/ButtonEditor/ActionSelectorOnPress.cs +++ b/GUI/CustomControls/ButtonEditor/ActionSelectorOnPress.cs @@ -1,6 +1,7 @@ using SuchByte.MacroDeck.ActionButton; using SuchByte.MacroDeck.ActionButton.Plugin; using SuchByte.MacroDeck.Interfaces; +using SuchByte.MacroDeck.Language; using SuchByte.MacroDeck.Plugins; using System; using System.Collections.Generic; @@ -16,9 +17,12 @@ public partial class ActionSelectorOnPress : RoundedUserControl { private List _pluginActions; - public ActionSelectorOnPress(List pluginActions) + private GUI.ButtonEditor _buttonEditor; + + public ActionSelectorOnPress(List pluginActions, GUI.ButtonEditor buttonEditor) { this._pluginActions = pluginActions; + this._buttonEditor = buttonEditor; InitializeComponent(); this.Dock = DockStyle.Fill; this.menuItemAction.Text = Language.LanguageManager.Strings.Action; @@ -138,6 +142,16 @@ private void MenuItemAction_Click(object sender, EventArgs e) { this._pluginActions.Add(actionConfigurator.Action); this.AddActionItem(actionConfigurator.Action); + if (!string.IsNullOrWhiteSpace(actionConfigurator.Action.BindableVariable)) + { + using (var msgBox = new MessageBox()) + { + if (msgBox.ShowDialog(LanguageManager.Strings.BindableVariable, string.Format(LanguageManager.Strings.BindableVariableInfo, actionConfigurator.Action.BindableVariable), MessageBoxButtons.YesNo) == DialogResult.Yes) + { + this._buttonEditor.SetBindableVariable(actionConfigurator.Action.BindableVariable); + } + } + } } } } diff --git a/GUI/CustomControls/ButtonEditor/ConditionItem.cs b/GUI/CustomControls/ButtonEditor/ConditionItem.cs index 638bf618..880a2ab1 100644 --- a/GUI/CustomControls/ButtonEditor/ConditionItem.cs +++ b/GUI/CustomControls/ButtonEditor/ConditionItem.cs @@ -3,6 +3,7 @@ using SuchByte.MacroDeck.GUI.CustomControls.ButtonEditor; using SuchByte.MacroDeck.GUI.Dialogs; using SuchByte.MacroDeck.Interfaces; +using SuchByte.MacroDeck.Logging; using SuchByte.MacroDeck.Plugins; using System; using System.Collections.Generic; @@ -109,7 +110,7 @@ private void RefreshActions() this.valueToCompare.Visible = true; this.template.Visible = false; this.btnOpenTemplateEditor.Visible = false; - foreach (Variables.Variable variable in Variables.VariableManager.Variables) + foreach (Variables.Variable variable in Variables.VariableManager.ListVariables) { this.source.Items.Add(variable.Name); } @@ -294,12 +295,12 @@ private void TypeBox_SelectedIndexChanged(object sender, EventArgs e) this.valueToCompare.Visible = true; this.template.Visible = false; this.btnOpenTemplateEditor.Visible = false; - foreach (Variables.Variable variable in Variables.VariableManager.Variables) + foreach (Variables.Variable variable in Variables.VariableManager.ListVariables) { this.source.Items.Add(variable.Name); } - foreach (Variables.Variable variable in Variables.VariableManager.Variables) + foreach (Variables.Variable variable in Variables.VariableManager.ListVariables) { this.valueToCompare.Items.Add("{" + variable.Name + "}"); } @@ -321,8 +322,6 @@ private void TypeBox_SelectedIndexChanged(object sender, EventArgs e) this.valueToCompare.Visible = false; this.template.Visible = true; this.btnOpenTemplateEditor.Visible = true; - - break; } @@ -331,7 +330,7 @@ private void TypeBox_SelectedIndexChanged(object sender, EventArgs e) private void Template_TextChanged(object sender, EventArgs e) { - if (!String.IsNullOrWhiteSpace(template.Text)) + if (((ConditionAction)this.Action).ConditionType == ConditionType.Template && !string.IsNullOrWhiteSpace(template.Text)) { ((ConditionAction)this.Action).ConditionValue1Source = template.Text; } @@ -340,11 +339,11 @@ private void Template_TextChanged(object sender, EventArgs e) private void MethodBox_SelectedIndexChanged(object sender, EventArgs e) { ((ConditionAction)this.Action).ConditionMethod = (ConditionMethod)Enum.Parse(typeof(ConditionMethod), methodBox.Text); - if (((ConditionAction)this.Action).ConditionType == ConditionType.Variable && String.IsNullOrWhiteSpace(this.methodBox.Text)) + if (((ConditionAction)this.Action).ConditionType == ConditionType.Variable && string.IsNullOrWhiteSpace(this.methodBox.Text)) { try { - Variables.Variable variable = Variables.VariableManager.Variables.Find(v => v.Name.Equals(this.source.Text)); + Variables.Variable variable = Variables.VariableManager.ListVariables.ToList().Find(v => v.Name.Equals(this.source.Text)); if (variable != null) { this.valueToCompare.Text = variable.Value; @@ -357,7 +356,7 @@ private void MethodBox_SelectedIndexChanged(object sender, EventArgs e) private void ValueToCompare_TextChanged(object sender, EventArgs e) { - if (!String.IsNullOrWhiteSpace(valueToCompare.Text)) + if (!string.IsNullOrWhiteSpace(valueToCompare.Text)) { ((ConditionAction)this.Action).ConditionValue2 = valueToCompare.Text; } @@ -365,9 +364,11 @@ private void ValueToCompare_TextChanged(object sender, EventArgs e) private void Source_SelectedIndexChanged(object sender, EventArgs e) { + if (((ConditionAction)this.Action).ConditionType == ConditionType.Template) return; + ((ConditionAction)this.Action).ConditionValue1Source = source.Text; - Variables.Variable variable = Variables.VariableManager.Variables.Find(v => v.Name.Equals(this.source.Text)); + Variables.Variable variable = Variables.VariableManager.ListVariables.ToList().Find(v => v.Name.Equals(this.source.Text)); this.valueToCompare.Items.Clear(); @@ -388,7 +389,7 @@ private void Source_SelectedIndexChanged(object sender, EventArgs e) } } - foreach (Variables.Variable v in Variables.VariableManager.Variables) + foreach (Variables.Variable v in Variables.VariableManager.ListVariables) { this.valueToCompare.Items.Add("{" + v.Name + "}"); } @@ -461,7 +462,7 @@ private void BtnOpenTemplateEditor_Click(object sender, EventArgs e) if (templateEditor.ShowDialog() == DialogResult.OK) { this.template.Text = templateEditor.Template; - if (!String.IsNullOrWhiteSpace(template.Text)) + if (!string.IsNullOrWhiteSpace(template.Text)) { ((ConditionAction)this.Action).ConditionValue1Source = template.Text; } diff --git a/GUI/CustomControls/ContentSelectorButton.cs b/GUI/CustomControls/ContentSelectorButton.cs index 816bdde5..73d78d3d 100644 --- a/GUI/CustomControls/ContentSelectorButton.cs +++ b/GUI/CustomControls/ContentSelectorButton.cs @@ -36,8 +36,9 @@ public ContentSelectorButton() this.ForeColor = Color.White; this.Font = new Font("Tahoma", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 0); this.Text = ""; - this.Height = 43; - this.Width = 43; + this.Height = 44; + this.Width = 44; + this.Margin = new Padding(left: 0, top: 3, right: 0, bottom: 3); this.Cursor = Cursors.Hand; this.MouseEnter += MouseEnterEvent; this.MouseLeave += MouseLeaveEvent; diff --git a/GUI/CustomControls/DeviceInfo.cs b/GUI/CustomControls/DeviceInfo.cs index 31a4882b..7b5b7140 100644 --- a/GUI/CustomControls/DeviceInfo.cs +++ b/GUI/CustomControls/DeviceInfo.cs @@ -83,12 +83,6 @@ public void LoadDevice() this.btnConfigure.Visible = false; //TODO this.profiles.Enabled = true; break; - case DeviceType.Macro_Deck_DIY_OLED_6_V1: - this.lblDeviceType.Text = "Macro Deck DIY OLED 6 v1"; - this.iconDeviceType.Image = null; - this.btnConfigure.Visible = false; //TODO - this.profiles.Enabled = false; - break; default: this.lblDeviceType.Text = LanguageManager.Strings.WebClient; this.iconDeviceType.Image = Properties.Resources.Web; diff --git a/GUI/CustomControls/DialogForm.Designer.cs b/GUI/CustomControls/DialogForm.Designer.cs index 49e6a09e..bfacfe85 100644 --- a/GUI/CustomControls/DialogForm.Designer.cs +++ b/GUI/CustomControls/DialogForm.Designer.cs @@ -56,6 +56,10 @@ private void InitializeComponent() // // DialogForm // +<<<<<<< HEAD + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); +======= +>>>>>>> origin/main this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(45)))), ((int)(((byte)(45))))); this.ClientSize = new System.Drawing.Size(1045, 250); diff --git a/GUI/CustomControls/DialogForm.cs b/GUI/CustomControls/DialogForm.cs index 352fbc62..2afb5c85 100644 --- a/GUI/CustomControls/DialogForm.cs +++ b/GUI/CustomControls/DialogForm.cs @@ -1,4 +1,5 @@ using SuchByte.MacroDeck.GUI.Dialogs; +using SuchByte.MacroDeck.Logging; using System; using System.Collections.Generic; using System.ComponentModel; @@ -22,6 +23,8 @@ public partial class DialogForm : System.Windows.Forms.Form [DllImportAttribute("user32.dll")] public static extern bool ReleaseCapture(); + public bool IgnoreEscapeKey = false; + public DialogForm() { InitializeComponent(); @@ -30,6 +33,18 @@ public DialogForm() this.MouseDown += DialogForm_MouseDown; } + protected override bool ProcessCmdKey(ref Message msg, Keys keyData) + { + if (IgnoreEscapeKey) return base.ProcessCmdKey(ref msg, keyData); + switch (keyData) + { + case Keys.Escape: + this.Close(); + return true; + } + return base.ProcessCmdKey(ref msg, keyData); + } + private void OnResizeEnd(object sender, EventArgs e) { this.btnClose.Location = new Point(this.Width - this.btnClose.Width - 2, 2); diff --git a/GUI/CustomControls/ExtensionStoreDownloader/ExtensionStoreDownloaderItem.Designer.cs b/GUI/CustomControls/ExtensionStoreDownloader/ExtensionStoreDownloaderItem.Designer.cs new file mode 100644 index 00000000..a6893193 --- /dev/null +++ b/GUI/CustomControls/ExtensionStoreDownloader/ExtensionStoreDownloaderItem.Designer.cs @@ -0,0 +1,132 @@ + +namespace SuchByte.MacroDeck.GUI.CustomControls.ExtensionStoreDownloader +{ + partial class ExtensionStoreDownloaderItem + { + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Komponenten-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + this.extensionIcon = new System.Windows.Forms.PictureBox(); + this.lblPackageName = new System.Windows.Forms.Label(); + this.lblStatus = new System.Windows.Forms.Label(); + this.progressBar = new SuchByte.MacroDeck.GUI.CustomControls.ButtonPrimary(); + this.btnAbort = new SuchByte.MacroDeck.GUI.CustomControls.PictureButton(); + ((System.ComponentModel.ISupportInitialize)(this.extensionIcon)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.btnAbort)).BeginInit(); + this.SuspendLayout(); + // + // extensionIcon + // + this.extensionIcon.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.extensionIcon.Location = new System.Drawing.Point(8, 8); + this.extensionIcon.Name = "extensionIcon"; + this.extensionIcon.Size = new System.Drawing.Size(59, 59); + this.extensionIcon.TabIndex = 0; + this.extensionIcon.TabStop = false; + // + // lblPackageName + // + this.lblPackageName.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); + this.lblPackageName.ForeColor = System.Drawing.Color.White; + this.lblPackageName.Location = new System.Drawing.Point(73, 8); + this.lblPackageName.Name = "lblPackageName"; + this.lblPackageName.Size = new System.Drawing.Size(474, 22); + this.lblPackageName.TabIndex = 1; + // + // lblStatus + // + this.lblStatus.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lblStatus.ForeColor = System.Drawing.Color.White; + this.lblStatus.Location = new System.Drawing.Point(73, 36); + this.lblStatus.Name = "lblStatus"; + this.lblStatus.Size = new System.Drawing.Size(262, 22); + this.lblStatus.TabIndex = 2; + this.lblStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // progressBar + // + this.progressBar.BorderRadius = 8; + this.progressBar.Cursor = System.Windows.Forms.Cursors.Hand; + this.progressBar.Enabled = false; + this.progressBar.FlatAppearance.BorderSize = 0; + this.progressBar.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.progressBar.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.progressBar.ForeColor = System.Drawing.Color.White; + this.progressBar.HoverColor = System.Drawing.Color.Empty; + this.progressBar.Icon = null; + this.progressBar.Location = new System.Drawing.Point(341, 35); + this.progressBar.Name = "progressBar"; + this.progressBar.Progress = 0; + this.progressBar.ProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(103)))), ((int)(((byte)(205))))); + this.progressBar.Size = new System.Drawing.Size(177, 22); + this.progressBar.TabIndex = 3; + this.progressBar.UseVisualStyleBackColor = true; + this.progressBar.UseWindowsAccentColor = true; + this.progressBar.Visible = false; + // + // btnAbort + // + this.btnAbort.BackColor = System.Drawing.Color.Transparent; + this.btnAbort.BackgroundImage = global::SuchByte.MacroDeck.Properties.Resources.Close_Normal; + this.btnAbort.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.btnAbort.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnAbort.HoverImage = global::SuchByte.MacroDeck.Properties.Resources.Close_Hover; + this.btnAbort.Location = new System.Drawing.Point(524, 35); + this.btnAbort.Name = "btnAbort"; + this.btnAbort.Size = new System.Drawing.Size(23, 23); + this.btnAbort.TabIndex = 4; + this.btnAbort.TabStop = false; + this.btnAbort.Click += new System.EventHandler(this.BtnAbort_Click); + // + // ExtensionStoreDownloaderItem + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(65)))), ((int)(((byte)(65))))); + this.Controls.Add(this.btnAbort); + this.Controls.Add(this.progressBar); + this.Controls.Add(this.lblStatus); + this.Controls.Add(this.lblPackageName); + this.Controls.Add(this.extensionIcon); + this.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.Name = "ExtensionStoreDownloaderItem"; + this.Size = new System.Drawing.Size(555, 75); + this.Load += new System.EventHandler(this.ExtensionStoreDownloaderItem_Load); + ((System.ComponentModel.ISupportInitialize)(this.extensionIcon)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.btnAbort)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.PictureBox extensionIcon; + private System.Windows.Forms.Label lblPackageName; + private System.Windows.Forms.Label lblStatus; + private ButtonPrimary progressBar; + private PictureButton btnAbort; + } +} diff --git a/GUI/CustomControls/ExtensionStoreDownloader/ExtensionStoreDownloaderItem.cs b/GUI/CustomControls/ExtensionStoreDownloader/ExtensionStoreDownloaderItem.cs new file mode 100644 index 00000000..d86a5d91 --- /dev/null +++ b/GUI/CustomControls/ExtensionStoreDownloader/ExtensionStoreDownloaderItem.cs @@ -0,0 +1,273 @@ +using Newtonsoft.Json; +using SuchByte.MacroDeck.ExtensionStore; +using SuchByte.MacroDeck.Icons; +using SuchByte.MacroDeck.Language; +using SuchByte.MacroDeck.Logging; +using SuchByte.MacroDeck.Model; +using SuchByte.MacroDeck.Plugins; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Globalization; +using System.IO; +using System.Net; +using System.Security.Cryptography; +using System.Text; +using System.Windows.Forms; + +namespace SuchByte.MacroDeck.GUI.CustomControls.ExtensionStoreDownloader +{ + public partial class ExtensionStoreDownloaderItem : RoundedUserControl + { + public ExtensionStoreDownloaderPackageInfoModel PackageInfo { get; private set; } + + public ExtensionStoreExtensionModel ExtensionModel { get; private set; } + + public event EventHandler OnInstallationCompleted; + + + private WebClient _webClient; + + private bool _cancel = false; + + public bool Cancel + { + get => _cancel; + private set + { + _cancel = true; + if (_webClient != null) + { + _webClient.CancelAsync(); + } + this.Invoke(new Action(() => + { + this.lblStatus.Text = LanguageManager.Strings.Cancelled; + this.progressBar.Visible = false; + this.btnAbort.Visible = false; + })); + + if (OnInstallationCompleted != null) + { + OnInstallationCompleted(this, EventArgs.Empty); + } + } + } + + public ExtensionStoreDownloaderItem(ExtensionStoreDownloaderPackageInfoModel extensionStoreDownloaderPackageInfoModel) + { + InitializeComponent(); + this.PackageInfo = extensionStoreDownloaderPackageInfoModel; + } + + private void ExtensionStoreDownloaderItem_Load(object sender, EventArgs e) + { + try + { + DownloadAndInstallPackage(); + } + catch (Exception ex) + { + MacroDeckLogger.Error(GetType(), ex.Message); + this.Invoke(new Action(() => + { + this.lblStatus.Text = LanguageManager.Strings.Error; + })); + } + } + + private void DownloadAndInstallPackage() + { + this.Invoke(new Action(() => + { + this.lblStatus.Text = LanguageManager.Strings.Preparing; + })); + using (_webClient = new WebClient()) + { + ExtensionModel = JsonConvert.DeserializeObject(_webClient.DownloadString($"https://macrodeck.org/extensionstore/extensionstore.php?action=info&package-id={PackageInfo.PackageId}"), new JsonSerializerSettings + { + TypeNameHandling = TypeNameHandling.Auto, + NullValueHandling = NullValueHandling.Ignore, + Error = (sender, args) => { + MacroDeckLogger.Error(typeof(ExtensionStoreDownloaderItem), "Error while deserializing the ExtensionStoreModel file: " + args.ErrorContext.Error.Message); + args.ErrorContext.Handled = true; + }, + ReferenceLoopHandling = ReferenceLoopHandling.Ignore, + }); + _webClient.DownloadProgressChanged += Wc_DownloadProgressChanged; + _webClient.DownloadFileCompleted += Wc_DownloadFileCompleted; + string url = $"https://macrodeck.org/files/extensionstore/{ExtensionModel.PackageId}/{ExtensionModel.Filename}"; + + Bitmap iconBitmap = Properties.Resources.Macro_Deck_2021_update; + try + { + iconBitmap = (Bitmap)Utils.Base64.GetImageFromBase64(ExtensionModel.IconBase64); + } catch { } + + this.Invoke(new Action(() => + { + this.extensionIcon.BackgroundImage = iconBitmap; + this.lblPackageName.Text = string.Format(LanguageManager.Strings.ExtensionStoreDownloaderPackageIdVersion, PackageInfo.PackageId, ExtensionModel.Version); + })); + + MacroDeckLogger.Trace(typeof(ExtensionStoreDownloaderItem), $"Download {url}"); + _webClient.DownloadFileAsync(new Uri(url), Path.Combine(MacroDeck.TempDirectoryPath, ExtensionModel.Filename)); + + } + } + + private void Wc_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e) + { + if (e.Cancelled) + { + return; + } + this.Invoke(new Action(() => + { + this.progressBar.Visible = false; + this.lblStatus.Text = LanguageManager.Strings.Installing; + })); + try + { + Install(); + } + catch (Exception ex) + { + + } + } + + private void Wc_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e) + { + if (this.Cancel) + { + return; + } + this.Invoke(new Action(() => + { + this.progressBar.Visible = true; + this.lblStatus.Text = $"{LanguageManager.Strings.Downloading} {(e.BytesReceived / 1024f / 1024f).ToString("0.00")} MB / {(e.TotalBytesToReceive / 1024f / 1024f).ToString("0.00")} MB"; + this.progressBar.Progress = e.ProgressPercentage; + })); + } + + private void Install() + { + if (!File.Exists(Path.Combine(MacroDeck.TempDirectoryPath, ExtensionModel.Filename))) + { + Finished(); + MacroDeckLogger.Error(GetType(), $"Download of {ExtensionModel.Name} failed: {ExtensionModel.Filename} not found"); + return; + } + + using (var stream = File.OpenRead(Path.Combine(MacroDeck.TempDirectoryPath, ExtensionModel.Filename))) + { + using (var md5 = MD5.Create()) + { + var hash = md5.ComputeHash(stream); + var checksumString = BitConverter.ToString(hash).Replace("-", "").ToLowerInvariant(); + if (!checksumString.Equals(ExtensionModel.Md5Checksum)) + { + Finished(); + MacroDeckLogger.Error(GetType(), $"md5 checksum of {ExtensionModel.Name} not matching!" + Environment.NewLine + + $"md5 checksum on server: {ExtensionModel.Md5Checksum}" + Environment.NewLine + + $"md5 checksum of downloaded file: {checksumString}"); + return; + } + } + } + + MacroDeckLogger.Info(GetType(), $"Start installation of {ExtensionModel.Name} version {ExtensionModel.Version}"); + + + ExtensionManifestModel extensionManifestModel; + try + { + extensionManifestModel = ExtensionManifestModel.FromZipFilePath(Path.Combine(MacroDeck.TempDirectoryPath, ExtensionModel.Filename)); + } + catch (Exception ex) + { + MacroDeckLogger.Error(GetType(), $"Error while deserializing ExtensionManifest for {ExtensionModel.Name}: " + ex.Message + Environment.NewLine + ex.StackTrace); + Finished(); + return; + } + + if (extensionManifestModel == null) + { + MacroDeckLogger.Error(GetType(), $"ExtensionManifest for {ExtensionModel.Name} not found. Installation aborted!"); + Finished(); + return; + } + + if (Cancel) + { + return; + } + switch (extensionManifestModel.Type) + { + case ExtensionType.Plugin: + try + { + PluginManager.InstallPluginFromZip(Path.Combine(MacroDeck.TempDirectoryPath, ExtensionModel.Filename)); + } + catch (Exception ex) + { + MacroDeckLogger.Error(GetType(), $"Error while installing {ExtensionModel.Name}: " + ex.Message + Environment.NewLine + ex.StackTrace); + Finished(); + return; + } + break; + case ExtensionType.IconPack: + try + { + IconManager.InstallIconPackZip(Path.Combine(MacroDeck.TempDirectoryPath, ExtensionModel.Filename), true); + } + catch (Exception ex) + { + MacroDeckLogger.Error(GetType(), $"Error while installing {ExtensionModel.Name}: " + ex.Message + Environment.NewLine + ex.StackTrace); + Finished(); + return; + } + break; + } + + try + { + if (Directory.Exists(Path.Combine(MacroDeck.TempDirectoryPath, ExtensionModel.PackageId))) + { + Directory.Delete(Path.Combine(MacroDeck.TempDirectoryPath, ExtensionModel.PackageId), true); + } + if (File.Exists(Path.Combine(MacroDeck.TempDirectoryPath, ExtensionModel.Filename))) + { + File.Delete(Path.Combine(MacroDeck.TempDirectoryPath, ExtensionModel.Filename)); + } + } + catch { } + + Finished(); + } + + private void Finished(bool error = false) + { + this.Invoke(new Action(() => + { + this.btnAbort.Visible = false; + this.lblStatus.Text = error ? LanguageManager.Strings.Error : LanguageManager.Strings.Completed; + })); + if (OnInstallationCompleted != null) + { + OnInstallationCompleted(this, EventArgs.Empty); + } + } + + private void BtnAbort_Click(object sender, EventArgs e) + { + if (!Cancel) + { + Cancel = true; + } + } + } +} diff --git a/Folders/Plugin/GUI/FolderSwitcherConfigurator.resx b/GUI/CustomControls/ExtensionStoreDownloader/ExtensionStoreDownloaderItem.resx similarity index 100% rename from Folders/Plugin/GUI/FolderSwitcherConfigurator.resx rename to GUI/CustomControls/ExtensionStoreDownloader/ExtensionStoreDownloaderItem.resx diff --git a/GUI/CustomControls/ExtensionsView/ExtensionItemView.cs b/GUI/CustomControls/ExtensionsView/ExtensionItemView.cs index 1f5a8ea8..89d599e1 100644 --- a/GUI/CustomControls/ExtensionsView/ExtensionItemView.cs +++ b/GUI/CustomControls/ExtensionsView/ExtensionItemView.cs @@ -2,6 +2,10 @@ using SuchByte.MacroDeck.ExtensionStore; using SuchByte.MacroDeck.Icons; using SuchByte.MacroDeck.Language; +<<<<<<< HEAD +using SuchByte.MacroDeck.Notifications; +======= +>>>>>>> origin/main using SuchByte.MacroDeck.Plugins; using System; using System.Collections.Generic; @@ -129,6 +133,20 @@ private void BtnUninstall_LinkClicked(object sender, LinkLabelLinkClickedEventAr { MacroDeck.RestartMacroDeck("--show"); } +<<<<<<< HEAD + + var btnRestart = new ButtonPrimary() + { + AutoSize = true, + Text = LanguageManager.Strings.Restart, + }; + btnRestart.Click += (sender, e) => + { + MacroDeck.RestartMacroDeck("--show"); + }; + NotificationManager.SystemNotification("Extension Manager", string.Format(LanguageManager.Strings.XSuccessfullyUninstalled, macroDeckPlugin.Name), true, controls: new List() { btnRestart }); +======= +>>>>>>> origin/main } } break; diff --git a/GUI/CustomControls/ExtensionsView/InstalledExtensionsView.cs b/GUI/CustomControls/ExtensionsView/InstalledExtensionsView.cs index 00739114..da184eb0 100644 --- a/GUI/CustomControls/ExtensionsView/InstalledExtensionsView.cs +++ b/GUI/CustomControls/ExtensionsView/InstalledExtensionsView.cs @@ -95,9 +95,29 @@ private void InstalledExtensionsView_Load(object sender, EventArgs e) { ListInstalledExtensions(); UpdateUpdateLabelInfo(); +<<<<<<< HEAD + //PluginManager.OnPluginsChange += PluginManager_OnPluginsChange; + //IconManager.InstallationFinished += PluginManager_OnPluginsChange; + ExtensionStoreHelper.OnUpdateCheckFinished += UpdateCheckFinished; + ExtensionStoreHelper.OnInstallationFinished += ExtensionStoreHelper_OnInstallationFinished; + } + + private void ExtensionStoreHelper_OnInstallationFinished(object sender, EventArgs e) + { + if (!this.IsHandleCreated || this.IsDisposed) return; + this.Invoke(new Action(() => { + try + { + ListInstalledExtensions(); + UpdateUpdateLabelInfo(); + } + catch { } + })); +======= PluginManager.OnPluginsChange += PluginManager_OnPluginsChange; IconManager.InstallationFinished += PluginManager_OnPluginsChange; ExtensionStoreHelper.OnUpdateCheckFinished += UpdateCheckFinished; +>>>>>>> origin/main } private void UpdateCheckFinished(object sender, EventArgs e) @@ -107,6 +127,15 @@ private void UpdateCheckFinished(object sender, EventArgs e) this.btnCheckUpdates.Spinner = false; this.btnCheckUpdates.Enabled = true; UpdateUpdateLabelInfo(); +<<<<<<< HEAD + if (PluginManager.PluginsUpdateAvailable.Count > 0 || IconManager.IconPacksUpdateAvailable.Count > 0) + { + ListInstalledExtensions(); + } + })); + } + +======= ListInstalledExtensions(); })); } @@ -118,10 +147,14 @@ private void PluginManager_OnPluginsChange(object sender, EventArgs e) UpdateUpdateLabelInfo(); })); } +>>>>>>> origin/main private void BtnCheckUpdates_Click(object sender, EventArgs e) { if (PluginManager.PluginsUpdateAvailable.Count - PluginManager.UpdatedPlugins.Count > 0 || IconManager.IconPacksUpdateAvailable.Count > 0) { +<<<<<<< HEAD + ExtensionStoreHelper.UpdateAllPackages(); +======= List packages = new List(); foreach (var updatePlugin in PluginManager.PluginsUpdateAvailable) { @@ -141,6 +174,7 @@ private void BtnCheckUpdates_Click(object sender, EventArgs e) }); } ExtensionStoreHelper.InstallPackages(packages); +>>>>>>> origin/main } else { this.btnCheckUpdates.Spinner = true; diff --git a/GUI/CustomControls/Form.Designer.cs b/GUI/CustomControls/Form.Designer.cs index 7877dae0..b6ce1b31 100644 --- a/GUI/CustomControls/Form.Designer.cs +++ b/GUI/CustomControls/Form.Designer.cs @@ -41,6 +41,10 @@ private void InitializeComponent() this.helpMenuWiki = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.helpMenuExportLog = new System.Windows.Forms.ToolStripMenuItem(); +<<<<<<< HEAD + this.btnDonate = new System.Windows.Forms.LinkLabel(); +======= +>>>>>>> origin/main this.header.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.btnClose)).BeginInit(); this.helpMenu.SuspendLayout(); @@ -49,6 +53,10 @@ private void InitializeComponent() // header // this.header.BackColor = System.Drawing.Color.Transparent; +<<<<<<< HEAD + this.header.Controls.Add(this.btnDonate); +======= +>>>>>>> origin/main this.header.Controls.Add(this.btnClose); this.header.Controls.Add(this.btnHelp); this.header.Controls.Add(this.lblSafeMode); @@ -101,7 +109,11 @@ private void InitializeComponent() // this.lblSafeMode.Font = new System.Drawing.Font("Tahoma", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.lblSafeMode.ForeColor = System.Drawing.Color.Silver; +<<<<<<< HEAD + this.lblSafeMode.Location = new System.Drawing.Point(13, 3); +======= this.lblSafeMode.Location = new System.Drawing.Point(821, 3); +>>>>>>> origin/main this.lblSafeMode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lblSafeMode.Name = "lblSafeMode"; this.lblSafeMode.Size = new System.Drawing.Size(163, 29); @@ -168,8 +180,32 @@ private void InitializeComponent() this.helpMenuExportLog.Text = "Export latest log"; this.helpMenuExportLog.Click += new System.EventHandler(this.HelpMenuExportLog_Click); // +<<<<<<< HEAD + // btnDonate + // + this.btnDonate.ActiveLinkColor = System.Drawing.Color.White; + this.btnDonate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnDonate.AutoSize = true; + this.btnDonate.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.btnDonate.LinkColor = System.Drawing.Color.Silver; + this.btnDonate.Location = new System.Drawing.Point(1190, 8); + this.btnDonate.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.btnDonate.Name = "btnDonate"; + this.btnDonate.Size = new System.Drawing.Size(55, 18); + this.btnDonate.TabIndex = 10; + this.btnDonate.TabStop = true; + this.btnDonate.Text = "Donate"; + this.btnDonate.UseMnemonic = false; + this.btnDonate.VisitedLinkColor = System.Drawing.Color.Silver; + this.btnDonate.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.btnDonate_LinkClicked); + // + // Form + // + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); +======= // Form // +>>>>>>> origin/main this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(45)))), ((int)(((byte)(45))))); this.ClientSize = new System.Drawing.Size(1400, 700); @@ -204,5 +240,6 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; private System.Windows.Forms.ToolStripMenuItem helpMenuExportLog; private PictureButton btnClose; + private System.Windows.Forms.LinkLabel btnDonate; } } diff --git a/GUI/CustomControls/Form.cs b/GUI/CustomControls/Form.cs index d9b3e417..231a3fdd 100644 --- a/GUI/CustomControls/Form.cs +++ b/GUI/CustomControls/Form.cs @@ -36,6 +36,20 @@ public Form() this.helpMenuExportLog.Text = LanguageManager.Strings.ExportLatestLog; } +<<<<<<< HEAD + protected override bool ProcessCmdKey(ref Message msg, Keys keyData) + { + switch (keyData) + { + case Keys.Escape: + this.Close(); + return true; + } + return base.ProcessCmdKey(ref msg, keyData); + } + +======= +>>>>>>> origin/main protected override void WndProc(ref Message m) { if (m.Msg == 0x84) @@ -119,5 +133,16 @@ private void HelpMenuExportLog_Click(object sender, EventArgs e) } } + private void btnDonate_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + var p = new Process + { + StartInfo = new ProcessStartInfo("https://www.buymeacoffee.com/suchbyte") + { + UseShellExecute = true, + } + }; + p.Start(); + } } } diff --git a/GUI/CustomControls/Notifications/NotificationButton.cs b/GUI/CustomControls/Notifications/NotificationButton.cs new file mode 100644 index 00000000..a2975d2c --- /dev/null +++ b/GUI/CustomControls/Notifications/NotificationButton.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Text; +using System.Windows.Controls; +using System.Windows.Forms; + +namespace SuchByte.MacroDeck.GUI.CustomControls.Notifications +{ + public class NotificationButton : ButtonPrimary + { + + private int _notificationCount = 0; + + public int NotificationCount + { + get => _notificationCount; + set + { + if (this.InvokeRequired) + { + this.Invoke(new Action(() => NotificationCount = value)); + return; + } + _notificationCount = value; + if (!DesignMode) + { + this.Visible = value > 0; + } + this.Invalidate(); + } + } + + + + public NotificationButton() + { + this.Text = ""; + if (!DesignMode) + { + this.Visible = this._notificationCount > 0; + } + } + + protected override void OnPaint(PaintEventArgs pe) + { + base.OnPaint(pe); + + Rectangle indicatorRectangle = new Rectangle(this.Width - 18 - this.Padding.Right, this.Padding.Top, 18, 18); + + using (SolidBrush indicatorBrush = new SolidBrush(Color.Red)) + { + pe.Graphics.FillEllipse(indicatorBrush, indicatorRectangle); + TextFormatFlags flags = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.WordBreak; + TextRenderer.DrawText(pe.Graphics, this._notificationCount.ToString(), Font, indicatorRectangle, ForeColor, flags); + + } + } + + } +} diff --git a/GUI/CustomControls/Notifications/NotificationItem.Designer.cs b/GUI/CustomControls/Notifications/NotificationItem.Designer.cs new file mode 100644 index 00000000..d9846ee8 --- /dev/null +++ b/GUI/CustomControls/Notifications/NotificationItem.Designer.cs @@ -0,0 +1,178 @@ + +using System; +using System.Windows.Forms; + +namespace SuchByte.MacroDeck.GUI.CustomControls +{ + partial class NotificationItem + { + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Komponenten-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + this.pluginIcon = new System.Windows.Forms.PictureBox(); + this.lblPluginName = new System.Windows.Forms.Label(); + this.lblTitle = new System.Windows.Forms.Label(); + this.lblMessage = new System.Windows.Forms.Label(); + this.additionalControls = new System.Windows.Forms.FlowLayoutPanel(); + this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); + this.lblDateTime = new System.Windows.Forms.Label(); + this.btnRemove = new SuchByte.MacroDeck.GUI.CustomControls.PictureButton(); + ((System.ComponentModel.ISupportInitialize)(this.pluginIcon)).BeginInit(); + this.flowLayoutPanel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.btnRemove)).BeginInit(); + this.SuspendLayout(); + // + // pluginIcon + // + this.pluginIcon.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.pluginIcon.Location = new System.Drawing.Point(8, 8); + this.pluginIcon.Name = "pluginIcon"; + this.pluginIcon.Size = new System.Drawing.Size(50, 50); + this.pluginIcon.TabIndex = 0; + this.pluginIcon.TabStop = false; + // + // lblPluginName + // + this.lblPluginName.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); + this.lblPluginName.ForeColor = System.Drawing.Color.Silver; + this.lblPluginName.Location = new System.Drawing.Point(64, 5); + this.lblPluginName.Name = "lblPluginName"; + this.lblPluginName.Size = new System.Drawing.Size(275, 13); + this.lblPluginName.TabIndex = 1; + this.lblPluginName.Text = "label1"; + this.lblPluginName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // lblTitle + // + this.lblTitle.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lblTitle.Location = new System.Drawing.Point(63, 23); + this.lblTitle.Name = "lblTitle"; + this.lblTitle.Size = new System.Drawing.Size(399, 22); + this.lblTitle.TabIndex = 2; + this.lblTitle.Text = "label1"; + // + // lblMessage + // + this.lblMessage.AutoSize = true; + this.lblMessage.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lblMessage.Location = new System.Drawing.Point(0, 0); + this.lblMessage.Margin = new System.Windows.Forms.Padding(0); + this.lblMessage.MaximumSize = new System.Drawing.Size(400, 0); + this.lblMessage.MinimumSize = new System.Drawing.Size(400, 0); + this.lblMessage.Name = "lblMessage"; + this.lblMessage.Size = new System.Drawing.Size(400, 16); + this.lblMessage.TabIndex = 3; + // + // additionalControls + // + this.additionalControls.AutoSize = true; + this.additionalControls.Location = new System.Drawing.Point(0, 26); + this.additionalControls.Margin = new System.Windows.Forms.Padding(0, 10, 0, 0); + this.additionalControls.MaximumSize = new System.Drawing.Size(400, 0); + this.additionalControls.MinimumSize = new System.Drawing.Size(400, 0); + this.additionalControls.Name = "additionalControls"; + this.additionalControls.Size = new System.Drawing.Size(400, 0); + this.additionalControls.TabIndex = 4; + // + // flowLayoutPanel1 + // + this.flowLayoutPanel1.AutoSize = true; + this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.flowLayoutPanel1.Controls.Add(this.lblMessage); + this.flowLayoutPanel1.Controls.Add(this.additionalControls); + this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; + this.flowLayoutPanel1.Location = new System.Drawing.Point(64, 48); + this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(0); + this.flowLayoutPanel1.Name = "flowLayoutPanel1"; + this.flowLayoutPanel1.Size = new System.Drawing.Size(400, 26); + this.flowLayoutPanel1.TabIndex = 5; + // + // lblDateTime + // + this.lblDateTime.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lblDateTime.ForeColor = System.Drawing.Color.Silver; + this.lblDateTime.Location = new System.Drawing.Point(320, 5); + this.lblDateTime.Name = "lblDateTime"; + this.lblDateTime.Size = new System.Drawing.Size(188, 13); + this.lblDateTime.TabIndex = 6; + this.lblDateTime.Text = "00.00.0000 - 00:00:00"; + this.lblDateTime.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // btnRemove + // + this.btnRemove.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnRemove.BackColor = System.Drawing.Color.Transparent; + this.btnRemove.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.btnRemove.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnRemove.HoverImage = global::SuchByte.MacroDeck.Properties.Resources.Delete_Hover; + this.btnRemove.Image = global::SuchByte.MacroDeck.Properties.Resources.Delete_Normal; + this.btnRemove.Location = new System.Drawing.Point(483, 24); + this.btnRemove.Name = "btnRemove"; + this.btnRemove.Size = new System.Drawing.Size(30, 30); + this.btnRemove.TabIndex = 7; + this.btnRemove.TabStop = false; + this.btnRemove.Click += new System.EventHandler(this.BtnRemove_Click); + // + // NotificationItem + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoSize = true; + this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(45)))), ((int)(((byte)(45))))); + this.Controls.Add(this.btnRemove); + this.Controls.Add(this.lblDateTime); + this.Controls.Add(this.flowLayoutPanel1); + this.Controls.Add(this.lblTitle); + this.Controls.Add(this.lblPluginName); + this.Controls.Add(this.pluginIcon); + this.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.ForeColor = System.Drawing.Color.White; + this.MinimumSize = new System.Drawing.Size(520, 0); + this.Name = "NotificationItem"; + this.Size = new System.Drawing.Size(525, 79); + this.Load += new System.EventHandler(this.NotificationItem_Load); + ((System.ComponentModel.ISupportInitialize)(this.pluginIcon)).EndInit(); + this.flowLayoutPanel1.ResumeLayout(false); + this.flowLayoutPanel1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.btnRemove)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.PictureBox pluginIcon; + private System.Windows.Forms.Label lblPluginName; + private System.Windows.Forms.Label lblTitle; + private System.Windows.Forms.Label lblMessage; + private System.Windows.Forms.FlowLayoutPanel additionalControls; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; + private System.Windows.Forms.Label lblDateTime; + private PictureButton btnRemove; + } +} diff --git a/GUI/CustomControls/Notifications/NotificationItem.cs b/GUI/CustomControls/Notifications/NotificationItem.cs new file mode 100644 index 00000000..613bdd36 --- /dev/null +++ b/GUI/CustomControls/Notifications/NotificationItem.cs @@ -0,0 +1,68 @@ +using SuchByte.MacroDeck.Logging; +using SuchByte.MacroDeck.Models; +using SuchByte.MacroDeck.Notifications; +using SuchByte.MacroDeck.Plugins; +using SuchByte.MacroDeck.Utils; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace SuchByte.MacroDeck.GUI.CustomControls +{ + public partial class NotificationItem : RoundedUserControl + { + public string Id { get; private set; } + + private NotificationModel _notificationModel; + + public void ClearAdditionalControls() + { + MacroDeckLogger.Trace("Clear"); + if (this.InvokeRequired) + { + this.Invoke(new Action(() => ClearAdditionalControls())); + return; + } + foreach (Control control in this.additionalControls.Controls) + { + control.Parent = null; + } + } + + public NotificationItem(NotificationModel notificationModel) + { + this._notificationModel = notificationModel; + this.Id = notificationModel.Id; + InitializeComponent(); + this.lblPluginName.Text = notificationModel.SenderName; + this.lblTitle.Text = notificationModel.Title; + this.lblDateTime.Text = DateTimeOffset.FromUnixTimeSeconds(notificationModel.Timestamp).LocalDateTime.ToString(); + this.lblMessage.Text = notificationModel.Message; + this.pluginIcon.BackgroundImage = notificationModel.Icon; + + if (notificationModel.AdditionalControls != null) + { + foreach (var control in notificationModel.AdditionalControls) + { + this.additionalControls.Controls.Add(control); + } + } + } + + private void NotificationItem_Load(object sender, EventArgs e) + { + + } + + private void BtnRemove_Click(object sender, EventArgs e) + { + ClearAdditionalControls(); + NotificationManager.RemoveNotification(this._notificationModel); + } + } +} diff --git a/GUI/CustomControls/Notifications/NotificationItem.resx b/GUI/CustomControls/Notifications/NotificationItem.resx new file mode 100644 index 00000000..f298a7be --- /dev/null +++ b/GUI/CustomControls/Notifications/NotificationItem.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/GUI/CustomControls/Notifications/NotificationsList.Designer.cs b/GUI/CustomControls/Notifications/NotificationsList.Designer.cs new file mode 100644 index 00000000..519b65f1 --- /dev/null +++ b/GUI/CustomControls/Notifications/NotificationsList.Designer.cs @@ -0,0 +1,77 @@ + +namespace SuchByte.MacroDeck.GUI.CustomControls +{ + partial class NotificationsList + { + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + foreach (var control in this.notificationList.Controls) + { + ((NotificationItem)control).ClearAdditionalControls(); + } + + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Komponenten-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + this.notificationList = new System.Windows.Forms.FlowLayoutPanel(); + this.SuspendLayout(); + // + // notificationList + // + this.notificationList.AutoScroll = true; + this.notificationList.AutoSize = true; + this.notificationList.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; + this.notificationList.Location = new System.Drawing.Point(3, 3); + this.notificationList.Margin = new System.Windows.Forms.Padding(0); + this.notificationList.MaximumSize = new System.Drawing.Size(544, 444); + this.notificationList.MinimumSize = new System.Drawing.Size(544, 126); + this.notificationList.Name = "notificationList"; + this.notificationList.Size = new System.Drawing.Size(544, 134); + this.notificationList.TabIndex = 0; + this.notificationList.WrapContents = false; + // + // NotificationsList + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoSize = true; + this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(65)))), ((int)(((byte)(65))))); + this.Controls.Add(this.notificationList); + this.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.ForeColor = System.Drawing.Color.White; + this.MaximumSize = new System.Drawing.Size(550, 450); + this.MinimumSize = new System.Drawing.Size(550, 140); + this.Name = "NotificationsList"; + this.Size = new System.Drawing.Size(550, 142); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.FlowLayoutPanel notificationList; + } +} diff --git a/GUI/CustomControls/Notifications/NotificationsList.cs b/GUI/CustomControls/Notifications/NotificationsList.cs new file mode 100644 index 00000000..445961cd --- /dev/null +++ b/GUI/CustomControls/Notifications/NotificationsList.cs @@ -0,0 +1,61 @@ +using Newtonsoft.Json; +using SuchByte.MacroDeck.Logging; +using SuchByte.MacroDeck.Models; +using SuchByte.MacroDeck.Notifications; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace SuchByte.MacroDeck.GUI.CustomControls +{ + public partial class NotificationsList : RoundedUserControl + { + public event EventHandler OnCloseRequested; + + public NotificationsList() + { + InitializeComponent(); + this.notificationList.HorizontalScroll.Visible = false; + this.notificationList.VerticalScroll.Visible = false; + + NotificationManager.OnNotification += NotificationAdded; + NotificationManager.OnNotificationRemoved += NotificationRemoved; + + foreach (var notification in NotificationManager.Notifications) + { + var notificationItem = new NotificationItem(notification); + this.notificationList.Controls.Add(notificationItem); + } + } + + + private void NotificationAdded(object sender, NotificationEventArgs e) + { + if (this.IsDisposed || !this.IsHandleCreated) return; + var notificationItem = new NotificationItem(e.Notification); + this.Invoke(new Action(() => this.notificationList.Controls.Add(notificationItem))); + } + + private void NotificationRemoved(object sender, NotificationRemovedEventArgs e) + { + var control = this.notificationList.Controls.OfType().Where(x => x.Id == e.Id).FirstOrDefault(); + if (control != null) + { + control.ClearAdditionalControls(); + this.notificationList.Controls.Remove(control); + } + if (this.notificationList.Controls.Count == 0) + { + if (this.OnCloseRequested != null) + { + this.OnCloseRequested(this, EventArgs.Empty); + } + } + } + } +} diff --git a/GUI/CustomControls/Notifications/NotificationsList.resx b/GUI/CustomControls/Notifications/NotificationsList.resx new file mode 100644 index 00000000..f298a7be --- /dev/null +++ b/GUI/CustomControls/Notifications/NotificationsList.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/GUI/CustomControls/RoundedButton.cs b/GUI/CustomControls/RoundedButton.cs index 7cf85806..a146fc83 100644 --- a/GUI/CustomControls/RoundedButton.cs +++ b/GUI/CustomControls/RoundedButton.cs @@ -38,7 +38,10 @@ public RoundedButton() private void OnMouseEnter(object sender, EventArgs e) { this.Invalidate(); - this.Image = this.BackgroundImage; + try + { + this.Image = this.BackgroundImage; + } catch { } } private void OnMouseLeave(object sender, EventArgs e) diff --git a/GUI/CustomControls/RoundedPanel.cs b/GUI/CustomControls/RoundedPanel.cs new file mode 100644 index 00000000..eef5abd0 --- /dev/null +++ b/GUI/CustomControls/RoundedPanel.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Text; +using System.Windows.Forms; + +namespace SuchByte.MacroDeck.GUI.CustomControls +{ + public partial class RoundedPanel : Panel + { + private int borderRadius = 8; + + public RoundedPanel() + { + this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); + } + + + + private GraphicsPath GetFigurePath(Rectangle rect, int radius) + { + GraphicsPath path = new GraphicsPath(); + float curveSize = radius * 2F; + + path.StartFigure(); + path.AddArc(rect.X, rect.Y, curveSize, curveSize, 180, 90); + path.AddArc(rect.Right - curveSize, rect.Y, curveSize, curveSize, 270, 90); + path.AddArc(rect.Right - curveSize, rect.Bottom - curveSize, curveSize, curveSize, 0, 90); + path.AddArc(rect.X, rect.Bottom - curveSize, curveSize, curveSize, 90, 90); + path.CloseFigure(); + return path; + } + + protected override void OnPaint(PaintEventArgs e) + { + base.OnPaint(e); + Graphics graph = e.Graphics; + + if (borderRadius > 1) + { + var rectBorderSmooth = this.ClientRectangle; + int smoothSize = 2; + using (GraphicsPath pathBorderSmooth = GetFigurePath(rectBorderSmooth, borderRadius)) + using (Pen penBorderSmooth = new Pen(this.Parent.BackColor, smoothSize)) + { + + this.Region = new Region(pathBorderSmooth); + graph.SmoothingMode = SmoothingMode.AntiAlias; + graph.DrawPath(penBorderSmooth, pathBorderSmooth); + } + } + else + { + this.Region = new Region(this.ClientRectangle); + } + } + } +} diff --git a/GUI/CustomControls/Settings/UpdateAvailableControl.Designer.cs b/GUI/CustomControls/Settings/UpdateAvailableControl.Designer.cs index bfe316f6..39cfac8e 100644 --- a/GUI/CustomControls/Settings/UpdateAvailableControl.Designer.cs +++ b/GUI/CustomControls/Settings/UpdateAvailableControl.Designer.cs @@ -68,13 +68,12 @@ private void InitializeComponent() this.changelogPanel.Location = new System.Drawing.Point(3, 59); this.changelogPanel.Name = "changelogPanel"; this.changelogPanel.Padding = new System.Windows.Forms.Padding(5); - this.changelogPanel.Size = new System.Drawing.Size(975, 318); + this.changelogPanel.Size = new System.Drawing.Size(975, 300); this.changelogPanel.TabIndex = 12; // // btnInstall // this.btnInstall.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnInstall.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(123)))), ((int)(((byte)(255))))); this.btnInstall.BorderRadius = 8; this.btnInstall.Cursor = System.Windows.Forms.Cursors.Hand; this.btnInstall.FlatAppearance.BorderSize = 0; @@ -83,7 +82,7 @@ private void InitializeComponent() this.btnInstall.ForeColor = System.Drawing.Color.White; this.btnInstall.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(89)))), ((int)(((byte)(184))))); this.btnInstall.Icon = null; - this.btnInstall.Location = new System.Drawing.Point(349, 383); + this.btnInstall.Location = new System.Drawing.Point(349, 365); this.btnInstall.Name = "btnInstall"; this.btnInstall.Progress = 0; this.btnInstall.ProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(46)))), ((int)(((byte)(94))))); @@ -92,6 +91,7 @@ private void InitializeComponent() this.btnInstall.Text = "Download and install"; this.btnInstall.UseMnemonic = false; this.btnInstall.UseVisualStyleBackColor = false; + this.btnInstall.UseWindowsAccentColor = true; this.btnInstall.Click += new System.EventHandler(this.BtnInstall_Click); // // lblSize @@ -107,7 +107,11 @@ private void InitializeComponent() // // UpdateAvailableControl // +<<<<<<< HEAD + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); +======= +>>>>>>> origin/main this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(45)))), ((int)(((byte)(45))))); this.Controls.Add(this.lblSize); diff --git a/GUI/CustomControls/Variables/VariableItem.Designer.cs b/GUI/CustomControls/Variables/VariableItem.Designer.cs index 8ee2f4e2..d17cd396 100644 --- a/GUI/CustomControls/Variables/VariableItem.Designer.cs +++ b/GUI/CustomControls/Variables/VariableItem.Designer.cs @@ -40,22 +40,22 @@ private void InitializeComponent() // this.lblName.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(35)))), ((int)(((byte)(35)))), ((int)(((byte)(35))))); this.lblName.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.lblName.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lblName.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.lblName.ForeColor = System.Drawing.Color.White; this.lblName.Location = new System.Drawing.Point(11, 15); this.lblName.Margin = new System.Windows.Forms.Padding(0); this.lblName.Name = "lblName"; - this.lblName.Size = new System.Drawing.Size(349, 20); + this.lblName.ReadOnly = true; + this.lblName.Size = new System.Drawing.Size(223, 19); this.lblName.TabIndex = 0; this.lblName.Text = "Name"; - this.lblName.ReadOnly = true; // // lblType // - this.lblType.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.lblType.Location = new System.Drawing.Point(363, 5); + this.lblType.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lblType.Location = new System.Drawing.Point(237, 3); this.lblType.Name = "lblType"; - this.lblType.Size = new System.Drawing.Size(175, 40); + this.lblType.Size = new System.Drawing.Size(114, 40); this.lblType.TabIndex = 1; this.lblType.Text = "Type"; this.lblType.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -63,8 +63,8 @@ private void InitializeComponent() // // lblValue // - this.lblValue.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.lblValue.Location = new System.Drawing.Point(544, 5); + this.lblValue.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lblValue.Location = new System.Drawing.Point(357, 5); this.lblValue.Name = "lblValue"; this.lblValue.Size = new System.Drawing.Size(258, 40); this.lblValue.TabIndex = 2; @@ -74,11 +74,11 @@ private void InitializeComponent() // // lblCreator // - this.lblCreator.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lblCreator.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.lblCreator.ForeColor = System.Drawing.Color.Silver; - this.lblCreator.Location = new System.Drawing.Point(808, 5); + this.lblCreator.Location = new System.Drawing.Point(621, 4); this.lblCreator.Name = "lblCreator"; - this.lblCreator.Size = new System.Drawing.Size(212, 40); + this.lblCreator.Size = new System.Drawing.Size(163, 40); this.lblCreator.TabIndex = 3; this.lblCreator.Text = "Creator"; this.lblCreator.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -87,7 +87,6 @@ private void InitializeComponent() // btnEdit // this.btnEdit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btnEdit.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(65)))), ((int)(((byte)(65))))); this.btnEdit.BorderRadius = 8; this.btnEdit.Cursor = System.Windows.Forms.Cursors.Hand; this.btnEdit.FlatAppearance.BorderSize = 0; @@ -96,7 +95,7 @@ private void InitializeComponent() this.btnEdit.ForeColor = System.Drawing.Color.White; this.btnEdit.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(89)))), ((int)(((byte)(184))))); this.btnEdit.Icon = null; - this.btnEdit.Location = new System.Drawing.Point(1056, 8); + this.btnEdit.Location = new System.Drawing.Point(797, 7); this.btnEdit.Name = "btnEdit"; this.btnEdit.Progress = 0; this.btnEdit.ProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(46)))), ((int)(((byte)(94))))); @@ -105,11 +104,16 @@ private void InitializeComponent() this.btnEdit.Text = "..."; this.btnEdit.UseMnemonic = false; this.btnEdit.UseVisualStyleBackColor = false; + this.btnEdit.UseWindowsAccentColor = true; this.btnEdit.Click += new System.EventHandler(this.BtnEdit_Click); // // VariableItem // +<<<<<<< HEAD + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); +======= +>>>>>>> origin/main this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(35)))), ((int)(((byte)(35)))), ((int)(((byte)(35))))); this.Controls.Add(this.btnEdit); @@ -120,7 +124,8 @@ private void InitializeComponent() this.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.ForeColor = System.Drawing.Color.White; this.Name = "VariableItem"; - this.Size = new System.Drawing.Size(1100, 50); + this.Size = new System.Drawing.Size(840, 50); + this.Load += new System.EventHandler(this.VariableItem_Load); this.ResumeLayout(false); this.PerformLayout(); diff --git a/GUI/CustomControls/Variables/VariableItem.cs b/GUI/CustomControls/Variables/VariableItem.cs index f8562736..c268cc04 100644 --- a/GUI/CustomControls/Variables/VariableItem.cs +++ b/GUI/CustomControls/Variables/VariableItem.cs @@ -18,21 +18,17 @@ public VariableItem(Variables.Variable variable) { this.Variable = variable; InitializeComponent(); - this.SuspendLayout(); - this.lblName.Text = Language.LanguageManager.Strings.Name; - this.lblType.Text = Language.LanguageManager.Strings.Type; - this.lblValue.Text = Language.LanguageManager.Strings.Value; - this.lblCreator.Text = Language.LanguageManager.Strings.Creator; - this.Update(); - this.ResumeLayout(); } public new void Update() { - this.lblName.Text = this.Variable.Name; - this.lblType.Text = this.Variable.Type.ToString(); - this.lblValue.Text = this.Variable.Value; - this.lblCreator.Text = this.Variable.Creator; + this.Invoke(new Action(() => + { + this.lblName.Text = this.Variable.Name; + this.lblType.Text = this.Variable.Type.ToString(); + this.lblValue.Text = this.Variable.Value; + this.lblCreator.Text = this.Variable.Creator; + })); } private void BtnEdit_Click(object sender, EventArgs e) @@ -42,5 +38,10 @@ private void BtnEdit_Click(object sender, EventArgs e) variableDialog.ShowDialog(); } } + + private void VariableItem_Load(object sender, EventArgs e) + { + this.Update(); + } } } diff --git a/GUI/Dialogs/ButtonEditor.Designer.cs b/GUI/Dialogs/ButtonEditor.Designer.cs index 2bdd3e35..e995bf48 100644 --- a/GUI/Dialogs/ButtonEditor.Designer.cs +++ b/GUI/Dialogs/ButtonEditor.Designer.cs @@ -409,7 +409,10 @@ private void InitializeComponent() this.btnBackColor.UseMnemonic = false; this.btnBackColor.UseVisualStyleBackColor = false; this.btnBackColor.UseWindowsAccentColor = false; +<<<<<<< HEAD +======= this.btnBackColor.Visible = false; +>>>>>>> origin/main this.btnBackColor.Click += new System.EventHandler(this.BtnBackColor_Click); // // btnOpenTemplateEditor diff --git a/GUI/Dialogs/ButtonEditor.cs b/GUI/Dialogs/ButtonEditor.cs index 363af781..0f1f8614 100644 --- a/GUI/Dialogs/ButtonEditor.cs +++ b/GUI/Dialogs/ButtonEditor.cs @@ -82,17 +82,17 @@ public ButtonEditor(ActionButton.ActionButton actionButton, Folders.MacroDeckFol } } this.listStateBinding.Items.Add(""); - foreach (Variable variable in VariableManager.Variables) + foreach (Variable variable in VariableManager.ListVariables) { this.listStateBinding.Items.Add(variable.Name); } this.actionButton.StateChanged += this.OnStateChanged; this.hotkey.Click += Hotkey_Click; - this.LoadButton(); } private void ButtonEditor_Load(object sender, EventArgs e) { + this.LoadButton(); this.btnPreview.Radius = ProfileManager.CurrentProfile.ButtonRadius; this.UpdateLabel(); } @@ -248,7 +248,6 @@ public void RefreshIcon() private void Apply() { - Debug.WriteLine("Apply"); HotkeyManager.RemoveHotkey(this.actionButton); this.actionButton = this.actionButtonEdited; this.actionButton.EventListeners = new List(); @@ -290,9 +289,6 @@ private void Apply() ProfileManager.UpdateVariableLabels(this.actionButton); this.actionButton.UpdateBindingState(); this.actionButton.UpdateHotkey(); - GC.Collect(); - GC.WaitForPendingFinalizers(); - GC.Collect(); } private void BtnSave_Click(object sender, EventArgs e) @@ -350,10 +346,10 @@ public void LoadButton() this.RefreshLabel(); this.RefreshIcon(); - this.actionSelectorOnPress = new ActionSelectorOnPress(this.actionButtonEdited.Actions); - this.actionSelectorOnRelease = new ActionSelectorOnPress(this.actionButtonEdited.ActionsRelease); - this.actionSelectorOnLongPress = new ActionSelectorOnPress(this.actionButtonEdited.ActionsLongPress); - this.actionSelectorOnLongPressRelease = new ActionSelectorOnPress(this.actionButtonEdited.ActionsLongPressRelease); + this.actionSelectorOnPress = new ActionSelectorOnPress(this.actionButtonEdited.Actions, this); + this.actionSelectorOnRelease = new ActionSelectorOnPress(this.actionButtonEdited.ActionsRelease, this); + this.actionSelectorOnLongPress = new ActionSelectorOnPress(this.actionButtonEdited.ActionsLongPress, this); + this.actionSelectorOnLongPressRelease = new ActionSelectorOnPress(this.actionButtonEdited.ActionsLongPressRelease, this); this.actionSelectorOnPress.RefreshActions(); this.actionSelectorOnRelease.RefreshActions(); this.actionSelectorOnLongPress.RefreshActions(); @@ -363,7 +359,10 @@ public void LoadButton() this.SetSelector(actionSelectorOnPress); } - + public void SetBindableVariable(string variable) + { + this.listStateBinding.Text = variable; + } private void LabelChanged(object sender, EventArgs e) { @@ -399,7 +398,16 @@ private void BtnRemoveIcon_Click(object sender, EventArgs e) private void BtnBackColor_Click(object sender, EventArgs e) { +<<<<<<< HEAD + using (var colorDialog = new ColorDialog() + { + Color = radioButtonOff.Checked && !radioButtonOn.Checked ? this.actionButtonEdited.BackColorOff : this.actionButtonEdited.BackColorOn, + FullOpen = true, + CustomColors = new int[] { ColorTranslator.ToOle(Color.FromArgb(35, 35, 35)) } + }) +======= using (var colorDialog = new ColorDialog()) +>>>>>>> origin/main { if (colorDialog.ShowDialog() == DialogResult.OK) { @@ -445,7 +453,7 @@ private void BtnForeColor_Click(object sender, EventArgs e) private void BtnAddVariable_Click(object sender, EventArgs e) { this.variablesContextMenu.Items.Clear(); - foreach (Variable variable in VariableManager.Variables) + foreach (Variable variable in VariableManager.ListVariables) { ToolStripMenuItem item = new ToolStripMenuItem { diff --git a/GUI/Dialogs/DebugConsole.Designer.cs b/GUI/Dialogs/DebugConsole.Designer.cs index 957fd475..455d851c 100644 --- a/GUI/Dialogs/DebugConsole.Designer.cs +++ b/GUI/Dialogs/DebugConsole.Designer.cs @@ -43,6 +43,7 @@ private void InitializeComponent() this.btnAddFilter = new SuchByte.MacroDeck.GUI.CustomControls.ButtonPrimary(); this.filtersList = new System.Windows.Forms.ContextMenuStrip(this.components); this.btnRemoveFilters = new SuchByte.MacroDeck.GUI.CustomControls.ButtonPrimary(); + this.btnTestNotification = new SuchByte.MacroDeck.GUI.CustomControls.ButtonPrimary(); this.SuspendLayout(); // // logOutput @@ -288,10 +289,38 @@ private void InitializeComponent() this.btnRemoveFilters.UseWindowsAccentColor = false; this.btnRemoveFilters.Click += new System.EventHandler(this.btnRemoveFilters_Click); // + // btnTestNotification + // + this.btnTestNotification.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.btnTestNotification.BorderRadius = 8; + this.btnTestNotification.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnTestNotification.FlatAppearance.BorderSize = 0; + this.btnTestNotification.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnTestNotification.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.btnTestNotification.ForeColor = System.Drawing.Color.White; + this.btnTestNotification.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(89)))), ((int)(((byte)(184))))); + this.btnTestNotification.Icon = null; + this.btnTestNotification.Location = new System.Drawing.Point(389, 416); + this.btnTestNotification.Name = "btnTestNotification"; + this.btnTestNotification.Progress = 0; + this.btnTestNotification.ProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(46)))), ((int)(((byte)(94))))); + this.btnTestNotification.Size = new System.Drawing.Size(122, 27); + this.btnTestNotification.TabIndex = 13; + this.btnTestNotification.Text = "Test notification"; + this.btnTestNotification.UseMnemonic = false; + this.btnTestNotification.UseVisualStyleBackColor = false; + this.btnTestNotification.UseWindowsAccentColor = true; + this.btnTestNotification.Click += new System.EventHandler(this.btnTestNotification_Click); + // // DebugConsole // +<<<<<<< HEAD + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); +======= +>>>>>>> origin/main this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.ClientSize = new System.Drawing.Size(800, 450); + this.Controls.Add(this.btnTestNotification); this.Controls.Add(this.btnRemoveFilters); this.Controls.Add(this.btnAddFilter); this.Controls.Add(this.filter); @@ -322,6 +351,7 @@ private void InitializeComponent() this.Controls.SetChildIndex(this.filter, 0); this.Controls.SetChildIndex(this.btnAddFilter, 0); this.Controls.SetChildIndex(this.btnRemoveFilters, 0); + this.Controls.SetChildIndex(this.btnTestNotification, 0); this.ResumeLayout(false); } @@ -341,5 +371,6 @@ private void InitializeComponent() private CustomControls.ButtonPrimary btnAddFilter; private System.Windows.Forms.ContextMenuStrip filtersList; private CustomControls.ButtonPrimary btnRemoveFilters; + private CustomControls.ButtonPrimary btnTestNotification; } } \ No newline at end of file diff --git a/GUI/Dialogs/DebugConsole.cs b/GUI/Dialogs/DebugConsole.cs index 58231b14..c03f1b6a 100644 --- a/GUI/Dialogs/DebugConsole.cs +++ b/GUI/Dialogs/DebugConsole.cs @@ -1,4 +1,5 @@ using SuchByte.MacroDeck.Logging; +using SuchByte.MacroDeck.Notifications; using SuchByte.MacroDeck.Plugins; using System; using System.Collections.Generic; @@ -145,5 +146,10 @@ private void btnRemoveFilters_Click(object sender, EventArgs e) { this.filter.Text = string.Empty; } + + private void btnTestNotification_Click(object sender, EventArgs e) + { + NotificationManager.SystemNotification("Test", $"Test notification sent at {DateTime.Now.ToString()}", true); + } } } diff --git a/GUI/Dialogs/ExtensionStoreDownloader.Designer.cs b/GUI/Dialogs/ExtensionStoreDownloader.Designer.cs index c6ebdc25..08190e83 100644 --- a/GUI/Dialogs/ExtensionStoreDownloader.Designer.cs +++ b/GUI/Dialogs/ExtensionStoreDownloader.Designer.cs @@ -29,6 +29,14 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { +<<<<<<< HEAD + this.btnDone = new SuchByte.MacroDeck.GUI.CustomControls.ButtonPrimary(); + this.label2 = new System.Windows.Forms.Label(); + this.downloadList = new System.Windows.Forms.FlowLayoutPanel(); + this.lblPackagesToDownload = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // +======= this.output = new System.Windows.Forms.RichTextBox(); this.btnDone = new SuchByte.MacroDeck.GUI.CustomControls.ButtonPrimary(); this.label2 = new System.Windows.Forms.Label(); @@ -45,6 +53,7 @@ private void InitializeComponent() this.output.TabIndex = 2; this.output.Text = ""; // +>>>>>>> origin/main // btnDone // this.btnDone.BorderRadius = 8; @@ -55,7 +64,11 @@ private void InitializeComponent() this.btnDone.ForeColor = System.Drawing.Color.White; this.btnDone.HoverColor = System.Drawing.Color.Empty; this.btnDone.Icon = null; +<<<<<<< HEAD + this.btnDone.Location = new System.Drawing.Point(183, 358); +======= this.btnDone.Location = new System.Drawing.Point(183, 255); +>>>>>>> origin/main this.btnDone.Name = "btnDone"; this.btnDone.Progress = 0; this.btnDone.ProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(103)))), ((int)(((byte)(225))))); @@ -80,6 +93,36 @@ private void InitializeComponent() this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.label2.UseMnemonic = false; // +<<<<<<< HEAD + // downloadList + // + this.downloadList.AutoScroll = true; + this.downloadList.Location = new System.Drawing.Point(6, 54); + this.downloadList.Name = "downloadList"; + this.downloadList.Size = new System.Drawing.Size(607, 298); + this.downloadList.TabIndex = 6; + // + // lblPackagesToDownload + // + this.lblPackagesToDownload.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lblPackagesToDownload.ForeColor = System.Drawing.Color.Silver; + this.lblPackagesToDownload.Location = new System.Drawing.Point(10, 28); + this.lblPackagesToDownload.Name = "lblPackagesToDownload"; + this.lblPackagesToDownload.Size = new System.Drawing.Size(245, 23); + this.lblPackagesToDownload.TabIndex = 7; + this.lblPackagesToDownload.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.lblPackagesToDownload.UseMnemonic = false; + // + // ExtensionStoreDownloader + // + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; + this.ClientSize = new System.Drawing.Size(618, 392); + this.Controls.Add(this.lblPackagesToDownload); + this.Controls.Add(this.downloadList); + this.Controls.Add(this.label2); + this.Controls.Add(this.btnDone); +======= // ExtensionStoreDownloader // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; @@ -87,22 +130,37 @@ private void InitializeComponent() this.Controls.Add(this.label2); this.Controls.Add(this.btnDone); this.Controls.Add(this.output); +>>>>>>> origin/main this.Location = new System.Drawing.Point(0, 0); this.Name = "ExtensionStoreDownloader"; this.ShowIcon = true; this.Text = "Extension Store Downloader"; this.Load += new System.EventHandler(this.ExtensionStoreDownloader_Load); +<<<<<<< HEAD + this.Controls.SetChildIndex(this.btnDone, 0); + this.Controls.SetChildIndex(this.label2, 0); + this.Controls.SetChildIndex(this.downloadList, 0); + this.Controls.SetChildIndex(this.lblPackagesToDownload, 0); +======= this.Controls.SetChildIndex(this.output, 0); this.Controls.SetChildIndex(this.btnDone, 0); this.Controls.SetChildIndex(this.label2, 0); +>>>>>>> origin/main this.ResumeLayout(false); } #endregion +<<<<<<< HEAD + private CustomControls.ButtonPrimary btnDone; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.FlowLayoutPanel downloadList; + private System.Windows.Forms.Label lblPackagesToDownload; +======= private System.Windows.Forms.RichTextBox output; private CustomControls.ButtonPrimary btnDone; private System.Windows.Forms.Label label2; +>>>>>>> origin/main } } \ No newline at end of file diff --git a/GUI/Dialogs/ExtensionStoreDownloader.cs b/GUI/Dialogs/ExtensionStoreDownloader.cs index 8c779fdc..f8b094bb 100644 --- a/GUI/Dialogs/ExtensionStoreDownloader.cs +++ b/GUI/Dialogs/ExtensionStoreDownloader.cs @@ -1,7 +1,13 @@ using Newtonsoft.Json; using SuchByte.MacroDeck.ExtensionStore; using SuchByte.MacroDeck.GUI.CustomControls; +<<<<<<< HEAD +using SuchByte.MacroDeck.GUI.CustomControls.ExtensionStoreDownloader; using SuchByte.MacroDeck.Icons; +using SuchByte.MacroDeck.Language; +======= +using SuchByte.MacroDeck.Icons; +>>>>>>> origin/main using SuchByte.MacroDeck.Logging; using SuchByte.MacroDeck.Model; using SuchByte.MacroDeck.Plugins; @@ -29,6 +35,10 @@ public partial class ExtensionStoreDownloader : DialogForm private List _packageIds; +<<<<<<< HEAD + +======= +>>>>>>> origin/main public ExtensionStoreDownloader(List packageIds) { this.Owner = MacroDeck.MainWindow; @@ -48,6 +58,30 @@ private void ExtensionStoreDownloader_FormClosing(object sender, FormClosingEven public void DownloadAndInstall() { this._pluginsToInstall = this._packageIds.Count; +<<<<<<< HEAD + + this.Invoke(new Action(() => this.lblPackagesToDownload.Text =string.Format(LanguageManager.Strings.DownloadingAndInstallingXPackages, this._pluginsToInstall))); + foreach (var packageInfo in this._packageIds) + { + var extensionStoreDownloaderItem = new ExtensionStoreDownloaderItem(packageInfo); + extensionStoreDownloaderItem.OnInstallationCompleted += (sender, e) => + { + this._pluginsInstalled++; + if (this._pluginsInstalled == this._pluginsToInstall) + { + this.Invoke(new Action(() => + { + this.lblPackagesToDownload.Text = string.Format(LanguageManager.Strings.InstallationOfXPackagesDone, this._pluginsToInstall); + this.btnDone.Visible = true; + })); + MacroDeckLogger.Info(typeof(ExtensionStoreDownloader), $"*** Installation of {this._pluginsToInstall} package(s) done ***"); + + } + }; + this.Invoke(new Action(() => this.downloadList.Controls.Add(extensionStoreDownloaderItem))); + } + +======= AppendText($"Starting download of {this._pluginsToInstall} package(s)...", Color.White); foreach(var packageInfo in this._packageIds) { @@ -213,13 +247,21 @@ public void AppendText(string text, Color color) this.output.SelectionColor = this.output.ForeColor; this.output.ScrollToCaret(); })); +>>>>>>> origin/main } private void ExtensionStoreDownloader_Load(object sender, EventArgs e) { CenterToScreen(); PUtils.SetNativeEnabled(this.Owner.Handle, false); +<<<<<<< HEAD + Task.Run(() => + { + DownloadAndInstall(); + }); +======= DownloadAndInstall(); +>>>>>>> origin/main } private void BtnDone_Click(object sender, EventArgs e) @@ -228,10 +270,16 @@ private void BtnDone_Click(object sender, EventArgs e) { using (var msgBox = new CustomControls.MessageBox()) { +<<<<<<< HEAD + if (msgBox.ShowDialog(LanguageManager.Strings.MacroDeckNeedsARestart, Language.LanguageManager.Strings.MacroDeckMustBeRestartedForTheChanges, MessageBoxButtons.YesNo) == DialogResult.Yes) + { + MacroDeck.RestartMacroDeck(); +======= if (msgBox.ShowDialog(Language.LanguageManager.Strings.MacroDeckNeedsARestart, Language.LanguageManager.Strings.MacroDeckMustBeRestartedForTheChanges, MessageBoxButtons.YesNo) == DialogResult.Yes) { Process.Start(Path.Combine(MacroDeck.MainDirectoryPath, AppDomain.CurrentDomain.FriendlyName), "--show"); Environment.Exit(0); +>>>>>>> origin/main } } } diff --git a/GUI/Dialogs/ExtensionStoreDownloader.resx~merged b/GUI/Dialogs/ExtensionStoreDownloader.resx~merged new file mode 100644 index 00000000..f298a7be --- /dev/null +++ b/GUI/Dialogs/ExtensionStoreDownloader.resx~merged @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/GUI/Dialogs/IconSelector.Designer.cs b/GUI/Dialogs/IconSelector.Designer.cs index 9e3f2294..5548d1bd 100644 --- a/GUI/Dialogs/IconSelector.Designer.cs +++ b/GUI/Dialogs/IconSelector.Designer.cs @@ -369,6 +369,10 @@ private void InitializeComponent() // // IconSelector // +<<<<<<< HEAD + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); +======= +>>>>>>> origin/main this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(45)))), ((int)(((byte)(45))))); this.ClientSize = new System.Drawing.Size(787, 606); diff --git a/GUI/Dialogs/IconSelector.cs b/GUI/Dialogs/IconSelector.cs index 2ca01326..afbacd8e 100644 --- a/GUI/Dialogs/IconSelector.cs +++ b/GUI/Dialogs/IconSelector.cs @@ -356,7 +356,11 @@ private void IconPacksBox_SelectedIndexChanged(object sender, EventArgs e) this.SelectedIconPack = iconPack; this.btnImport.Visible = !iconPack.ExtensionStoreManaged; this.btnCreateIcon.Visible = !iconPack.ExtensionStoreManaged; +<<<<<<< HEAD + //this.btnGiphy.Visible = !iconPack.ExtensionStoreManaged; +======= this.btnGiphy.Visible = !iconPack.ExtensionStoreManaged; +>>>>>>> origin/main this.btnDeleteIcon.Visible = !iconPack.ExtensionStoreManaged; this.btnExportIconPack.Visible = !iconPack.ExtensionStoreManaged; this.lblManaged.Visible = iconPack.ExtensionStoreManaged; diff --git a/GUI/Dialogs/JsonButtonEditor.resx~merged b/GUI/Dialogs/JsonButtonEditor.resx~merged new file mode 100644 index 00000000..f298a7be --- /dev/null +++ b/GUI/Dialogs/JsonButtonEditor.resx~merged @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/GUI/Dialogs/NewConnectionDialog.Designer.cs b/GUI/Dialogs/NewConnectionDialog.Designer.cs new file mode 100644 index 00000000..1841b966 --- /dev/null +++ b/GUI/Dialogs/NewConnectionDialog.Designer.cs @@ -0,0 +1,232 @@ + +namespace SuchByte.MacroDeck.GUI.Dialogs +{ + partial class NewConnectionDialog + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + + this._denyTimer?.Dispose(); + + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.lblNewConnectionRequest = new System.Windows.Forms.Label(); + this.lblClientId = new System.Windows.Forms.Label(); + this.lblIPAddress = new System.Windows.Forms.Label(); + this.lblType = new System.Windows.Forms.Label(); + this.type = new System.Windows.Forms.Label(); + this.ipAddress = new System.Windows.Forms.Label(); + this.clientId = new System.Windows.Forms.Label(); + this.btnAccept = new SuchByte.MacroDeck.GUI.CustomControls.ButtonPrimary(); + this.btnDeny = new SuchByte.MacroDeck.GUI.CustomControls.ButtonPrimary(); + this.checkBlockThisDevice = new System.Windows.Forms.CheckBox(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.SuspendLayout(); + // + // pictureBox1 + // + this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.pictureBox1.Image = global::SuchByte.MacroDeck.Properties.Resources.Macro_Deck_2021; + this.pictureBox1.Location = new System.Drawing.Point(16, 27); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(53, 53); + this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox1.TabIndex = 2; + this.pictureBox1.TabStop = false; + // + // lblNewConnectionRequest + // + this.lblNewConnectionRequest.Font = new System.Drawing.Font("Tahoma", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lblNewConnectionRequest.Location = new System.Drawing.Point(75, 27); + this.lblNewConnectionRequest.Name = "lblNewConnectionRequest"; + this.lblNewConnectionRequest.Size = new System.Drawing.Size(451, 53); + this.lblNewConnectionRequest.TabIndex = 3; + this.lblNewConnectionRequest.Text = "New connection request"; + this.lblNewConnectionRequest.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // lblClientId + // + this.lblClientId.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); + this.lblClientId.Location = new System.Drawing.Point(32, 127); + this.lblClientId.Name = "lblClientId"; + this.lblClientId.Size = new System.Drawing.Size(165, 27); + this.lblClientId.TabIndex = 4; + this.lblClientId.Text = "Client Id"; + this.lblClientId.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // lblIPAddress + // + this.lblIPAddress.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); + this.lblIPAddress.Location = new System.Drawing.Point(32, 154); + this.lblIPAddress.Name = "lblIPAddress"; + this.lblIPAddress.Size = new System.Drawing.Size(165, 27); + this.lblIPAddress.TabIndex = 5; + this.lblIPAddress.Text = "IP Address"; + this.lblIPAddress.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // lblType + // + this.lblType.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); + this.lblType.Location = new System.Drawing.Point(32, 181); + this.lblType.Name = "lblType"; + this.lblType.Size = new System.Drawing.Size(165, 27); + this.lblType.TabIndex = 6; + this.lblType.Text = "Type"; + this.lblType.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // type + // + this.type.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.type.Location = new System.Drawing.Point(203, 181); + this.type.Name = "type"; + this.type.Size = new System.Drawing.Size(307, 27); + this.type.TabIndex = 9; + this.type.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // ipAddress + // + this.ipAddress.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.ipAddress.Location = new System.Drawing.Point(203, 154); + this.ipAddress.Name = "ipAddress"; + this.ipAddress.Size = new System.Drawing.Size(307, 27); + this.ipAddress.TabIndex = 8; + this.ipAddress.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // clientId + // + this.clientId.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.clientId.Location = new System.Drawing.Point(203, 127); + this.clientId.Name = "clientId"; + this.clientId.Size = new System.Drawing.Size(307, 27); + this.clientId.TabIndex = 7; + this.clientId.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // btnAccept + // + this.btnAccept.BorderRadius = 8; + this.btnAccept.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnAccept.FlatAppearance.BorderSize = 0; + this.btnAccept.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnAccept.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.btnAccept.ForeColor = System.Drawing.Color.White; + this.btnAccept.HoverColor = System.Drawing.Color.Empty; + this.btnAccept.Icon = null; + this.btnAccept.Location = new System.Drawing.Point(167, 256); + this.btnAccept.Name = "btnAccept"; + this.btnAccept.Progress = 0; + this.btnAccept.ProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(103)))), ((int)(((byte)(205))))); + this.btnAccept.Size = new System.Drawing.Size(209, 60); + this.btnAccept.TabIndex = 10; + this.btnAccept.Text = "Accept"; + this.btnAccept.UseVisualStyleBackColor = true; + this.btnAccept.UseWindowsAccentColor = true; + this.btnAccept.Click += new System.EventHandler(this.BtnAccept_Click); + // + // btnDeny + // + this.btnDeny.BorderRadius = 8; + this.btnDeny.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnDeny.FlatAppearance.BorderSize = 0; + this.btnDeny.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnDeny.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.btnDeny.ForeColor = System.Drawing.Color.White; + this.btnDeny.HoverColor = System.Drawing.Color.Empty; + this.btnDeny.Icon = null; + this.btnDeny.Location = new System.Drawing.Point(167, 322); + this.btnDeny.Name = "btnDeny"; + this.btnDeny.Progress = 0; + this.btnDeny.ProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(103)))), ((int)(((byte)(205))))); + this.btnDeny.Size = new System.Drawing.Size(209, 60); + this.btnDeny.TabIndex = 11; + this.btnDeny.Text = "Deny"; + this.btnDeny.UseVisualStyleBackColor = true; + this.btnDeny.UseWindowsAccentColor = false; + this.btnDeny.Click += new System.EventHandler(this.BtnDeny_Click); + // + // checkBlockThisDevice + // + this.checkBlockThisDevice.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.checkBlockThisDevice.Location = new System.Drawing.Point(172, 388); + this.checkBlockThisDevice.Name = "checkBlockThisDevice"; + this.checkBlockThisDevice.Size = new System.Drawing.Size(204, 42); + this.checkBlockThisDevice.TabIndex = 12; + this.checkBlockThisDevice.Text = "Block this device"; + this.checkBlockThisDevice.TextAlign = System.Drawing.ContentAlignment.TopLeft; + this.checkBlockThisDevice.UseVisualStyleBackColor = true; + // + // NewConnectionDialog + // + this.AcceptButton = this.btnAccept; + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; + this.ClientSize = new System.Drawing.Size(543, 441); + this.Controls.Add(this.checkBlockThisDevice); + this.Controls.Add(this.btnDeny); + this.Controls.Add(this.btnAccept); + this.Controls.Add(this.type); + this.Controls.Add(this.ipAddress); + this.Controls.Add(this.clientId); + this.Controls.Add(this.lblType); + this.Controls.Add(this.lblIPAddress); + this.Controls.Add(this.lblClientId); + this.Controls.Add(this.lblNewConnectionRequest); + this.Controls.Add(this.pictureBox1); + this.Location = new System.Drawing.Point(0, 0); + this.Name = "NewConnectionDialog"; + this.ShowIcon = true; + this.ShowInTaskbar = true; + this.Text = "Macro Deck :: New connection"; + this.Load += new System.EventHandler(this.NewConnectionDialog_Load); + this.Controls.SetChildIndex(this.pictureBox1, 0); + this.Controls.SetChildIndex(this.lblNewConnectionRequest, 0); + this.Controls.SetChildIndex(this.lblClientId, 0); + this.Controls.SetChildIndex(this.lblIPAddress, 0); + this.Controls.SetChildIndex(this.lblType, 0); + this.Controls.SetChildIndex(this.clientId, 0); + this.Controls.SetChildIndex(this.ipAddress, 0); + this.Controls.SetChildIndex(this.type, 0); + this.Controls.SetChildIndex(this.btnAccept, 0); + this.Controls.SetChildIndex(this.btnDeny, 0); + this.Controls.SetChildIndex(this.checkBlockThisDevice, 0); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.PictureBox pictureBox1; + private System.Windows.Forms.Label lblNewConnectionRequest; + private System.Windows.Forms.Label lblClientId; + private System.Windows.Forms.Label lblIPAddress; + private System.Windows.Forms.Label lblType; + private System.Windows.Forms.Label type; + private System.Windows.Forms.Label ipAddress; + private System.Windows.Forms.Label clientId; + private CustomControls.ButtonPrimary btnAccept; + private CustomControls.ButtonPrimary btnDeny; + private System.Windows.Forms.CheckBox checkBlockThisDevice; + } +} \ No newline at end of file diff --git a/GUI/Dialogs/NewConnectionDialog.cs b/GUI/Dialogs/NewConnectionDialog.cs new file mode 100644 index 00000000..15d476c5 --- /dev/null +++ b/GUI/Dialogs/NewConnectionDialog.cs @@ -0,0 +1,82 @@ +using SuchByte.MacroDeck.GUI.CustomControls; +using SuchByte.MacroDeck.Language; +using SuchByte.MacroDeck.Server; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace SuchByte.MacroDeck.GUI.Dialogs +{ + public partial class NewConnectionDialog : DialogForm + { + + private MacroDeckClient _macroDeckClient; + + private int _denyTimeout = 15; + + private System.Timers.Timer _denyTimer; + + public bool Blocked + { + get => this.checkBlockThisDevice.Checked; + } + + + public NewConnectionDialog(MacroDeckClient macroDeckClient) + { + this._macroDeckClient = macroDeckClient; + InitializeComponent(); + (new DropShadow()).ApplyShadows(this); + this.btnDeny.BackColor = Color.FromArgb(192, 0, 0); + this.lblNewConnectionRequest.Text = LanguageManager.Strings.NewConnectionRequest; + this.lblClientId.Text = LanguageManager.Strings.ClientId; + this.lblIPAddress.Text = LanguageManager.Strings.IPAddress; + this.lblType.Text = LanguageManager.Strings.Type; + this.btnAccept.Text = LanguageManager.Strings.Accept; + this.btnDeny.Text = $"{LanguageManager.Strings.Deny} ({this._denyTimeout})"; + this.checkBlockThisDevice.Text = LanguageManager.Strings.BlockConnection; + } + + private void NewConnectionDialog_Load(object sender, EventArgs e) + { + this.CenterToParent(); + this.TopMost = true; + this.clientId.Text = this._macroDeckClient?.ClientId; + this.ipAddress.Text = this._macroDeckClient?.SocketConnection?.ConnectionInfo?.ClientIpAddress; + this.type.Text = this._macroDeckClient?.DeviceType.ToString(); + + this._denyTimer = new System.Timers.Timer() + { + Enabled = true, + Interval = 1000 + }; + this._denyTimer.Elapsed += (sender, e) => { + this._denyTimeout--; + this.btnDeny.Text = $"{LanguageManager.Strings.Deny} ({this._denyTimeout})"; + if (this._denyTimeout <= 0) + { + this._denyTimer.Stop(); + if (this.IsHandleCreated && !this.IsDisposed) + { + this.Invoke(new Action(() => this.Close())); + } + } + }; + } + + private void BtnAccept_Click(object sender, EventArgs e) + { + this.DialogResult = DialogResult.Yes; + this.Close(); + } + + private void BtnDeny_Click(object sender, EventArgs e) + { + this.Close(); + } + } +} diff --git a/GUI/Dialogs/NewConnectionDialog.resx b/GUI/Dialogs/NewConnectionDialog.resx new file mode 100644 index 00000000..f298a7be --- /dev/null +++ b/GUI/Dialogs/NewConnectionDialog.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/GUI/Dialogs/TemplateEditor.cs b/GUI/Dialogs/TemplateEditor.cs index 98f4f4e8..fe683684 100644 --- a/GUI/Dialogs/TemplateEditor.cs +++ b/GUI/Dialogs/TemplateEditor.cs @@ -69,7 +69,11 @@ public TemplateEditor(string template = "") this.checkTrimBlankLines.Text = LanguageManager.Strings.TrimBlankLines; List variablesList = new List(); +<<<<<<< HEAD + foreach (var v in VariableManager.ListVariables) +======= foreach (var v in VariableManager.Variables) +>>>>>>> origin/main { variablesList.Add(v.Name); } @@ -117,7 +121,11 @@ private void Insert(string str) private void BtnIf_Click(object sender, EventArgs e) { +<<<<<<< HEAD + var dummyVariable = VariableManager.ListVariables.ToList().Find(x => x.Type == VariableType.Bool.ToString()); +======= var dummyVariable = VariableManager.Variables.Find(x => x.Type == VariableType.Bool.ToString()); +>>>>>>> origin/main string dummyVariableName = dummyVariable != null ? dummyVariable.Name : "VARIABLE"; this.Insert("{if VARIABLE: " + Environment.NewLine + "true" + Environment.NewLine + " |else: " + Environment.NewLine + "false" + Environment.NewLine + "}"); } @@ -141,7 +149,7 @@ private void BtnNot_Click(object sender, EventArgs e) private void BtnVariables_Click(object sender, EventArgs e) { this.variablesContextMenu.Items.Clear(); - foreach (Variable variable in VariableManager.Variables) + foreach (Variable variable in VariableManager.ListVariables) { ToolStripMenuItem item = new ToolStripMenuItem { diff --git a/GUI/Dialogs/VariableDialog.cs b/GUI/Dialogs/VariableDialog.cs index 8d73fff3..b3767691 100644 --- a/GUI/Dialogs/VariableDialog.cs +++ b/GUI/Dialogs/VariableDialog.cs @@ -64,10 +64,10 @@ private void BtnOk_Click(object sender, EventArgs e) { this.variableName.Text = "new_variable"; } - int variableCount = VariableManager.Variables.FindAll(v => v.Name.Equals(this.variableName.Text)).Count; + int variableCount = VariableManager.ListVariables.ToList().FindAll(v => v.Name.Equals(this.variableName.Text)).Count; if (variableCount > 0) { - variableName.Text = String.Format(variableName.Text + " ({0})", variableCount); + variableName.Text = string.Format(variableName.Text + " _{0}", variableCount); } this.Variable.Name = VariableManager.ConvertNameString(this.variableName.Text); } @@ -91,7 +91,7 @@ private void BtnOk_Click(object sender, EventArgs e) break; } - VariableManager.RefreshVariable(this.Variable); + VariableManager.SetValue(this.Variable.Name, this.Variable.Value, this.Variable.VariableType, this.Variable.Creator); this.DialogResult = DialogResult.OK; this.Close(); diff --git a/GUI/MainWindow.Designer.cs b/GUI/MainWindow.Designer.cs index 194670fa..5bc3d2ca 100644 --- a/GUI/MainWindow.Designer.cs +++ b/GUI/MainWindow.Designer.cs @@ -1,5 +1,8 @@ -using SuchByte.MacroDeck.Icons; +using SuchByte.MacroDeck.GUI.CustomControls; +using SuchByte.MacroDeck.GUI.CustomControls.Notifications; +using SuchByte.MacroDeck.Icons; using SuchByte.MacroDeck.Logging; +using SuchByte.MacroDeck.Notifications; using SuchByte.MacroDeck.Plugins; using SuchByte.MacroDeck.Server; using System; @@ -19,8 +22,16 @@ partial class MainWindow /// true if managed resources should be disposed; otherwise, false. protected override void Dispose(bool disposing) { + if (disposing && (components != null)) + { + components.Dispose(); + } try { + if (this.notificationsList != null && this.Controls.Contains(this.notificationsList)) + { + this.Controls.Remove(this.notificationsList); + } Language.LanguageManager.LanguageChanged -= LanguageChanged; Updater.Updater.OnUpdateAvailable -= UpdateAvailable; MacroDeckServer.OnDeviceConnectionStateChanged -= this.OnClientsConnectedChanged; @@ -28,6 +39,11 @@ protected override void Dispose(bool disposing) PluginManager.OnPluginsChange -= this.OnPluginsChanged; PluginManager.OnUpdateCheckFinished -= OnPackageManagerUpdateCheckFinished; IconManager.OnUpdateCheckFinished -= OnPackageManagerUpdateCheckFinished; +<<<<<<< HEAD + NotificationManager.OnNotification -= NotificationsChanged; + NotificationManager.OnNotificationRemoved -= NotificationsChanged; + DeckView?.Dispose(); +======= MacroDeckLogger.OnWarningOrError -= MacroDeckLogger_OnWarningOrError; if (this.DeckView != null) @@ -42,12 +58,9 @@ protected override void Dispose(bool disposing) { this.VariablesView.Dispose(); } +>>>>>>> origin/main } catch { } - if (disposing && (components != null)) - { - components.Dispose(); - } base.Dispose(disposing); } @@ -77,10 +90,15 @@ private void InitializeComponent() this.lblPort = new System.Windows.Forms.Label(); this.lblServerStatus = new System.Windows.Forms.Label(); this.lblIpAddressHostname = new System.Windows.Forms.Label(); +<<<<<<< HEAD + this.navigation = new SuchByte.MacroDeck.GUI.CustomControls.RoundedPanel(); + this.btnNotifications = new SuchByte.MacroDeck.GUI.CustomControls.Notifications.NotificationButton(); +======= this.navigation = new System.Windows.Forms.Panel(); this.warningsErrorPanel = new System.Windows.Forms.Panel(); this.pictureBox2 = new System.Windows.Forms.PictureBox(); this.lblErrorsWarnings = new System.Windows.Forms.LinkLabel(); +>>>>>>> origin/main this.contentButtonPanel.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.btnDeck)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.btnExtensions)).BeginInit(); @@ -88,8 +106,6 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.btnVariables)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.btnSettings)).BeginInit(); this.navigation.SuspendLayout(); - this.warningsErrorPanel.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); this.SuspendLayout(); // // lblSafeMode @@ -110,7 +126,10 @@ private void InitializeComponent() this.lblPluginsLoaded.Text = "0 plugins loaded."; this.lblPluginsLoaded.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.lblPluginsLoaded.UseMnemonic = false; +<<<<<<< HEAD +======= this.lblPluginsLoaded.Click += new System.EventHandler(this.lblPluginsLoaded_Click); +>>>>>>> origin/main // // lblVersion // @@ -130,15 +149,24 @@ private void InitializeComponent() this.contentPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); +<<<<<<< HEAD + this.contentPanel.Location = new System.Drawing.Point(62, 90); + this.contentPanel.Margin = new System.Windows.Forms.Padding(6, 3, 6, 3); + this.contentPanel.Name = "contentPanel"; + this.contentPanel.Size = new System.Drawing.Size(1134, 522); +======= this.contentPanel.Location = new System.Drawing.Point(62, 64); this.contentPanel.Margin = new System.Windows.Forms.Padding(6, 3, 6, 3); this.contentPanel.Name = "contentPanel"; this.contentPanel.Size = new System.Drawing.Size(1134, 548); +>>>>>>> origin/main this.contentPanel.TabIndex = 4; // // contentButtonPanel // - this.contentButtonPanel.AutoScroll = true; + this.contentButtonPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.contentButtonPanel.Controls.Add(this.btnDeck); this.contentButtonPanel.Controls.Add(this.panel1); this.contentButtonPanel.Controls.Add(this.btnExtensions); @@ -147,10 +175,17 @@ private void InitializeComponent() this.contentButtonPanel.Controls.Add(this.panel2); this.contentButtonPanel.Dock = System.Windows.Forms.DockStyle.Top; this.contentButtonPanel.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; +<<<<<<< HEAD + this.contentButtonPanel.Location = new System.Drawing.Point(5, 6); + this.contentButtonPanel.Margin = new System.Windows.Forms.Padding(0); + this.contentButtonPanel.Name = "contentButtonPanel"; + this.contentButtonPanel.Size = new System.Drawing.Size(44, 502); +======= this.contentButtonPanel.Location = new System.Drawing.Point(0, 0); this.contentButtonPanel.Margin = new System.Windows.Forms.Padding(0); this.contentButtonPanel.Name = "contentButtonPanel"; this.contentButtonPanel.Size = new System.Drawing.Size(54, 510); +>>>>>>> origin/main this.contentButtonPanel.TabIndex = 5; // // btnDeck @@ -161,8 +196,13 @@ private void InitializeComponent() this.btnDeck.Cursor = System.Windows.Forms.Cursors.Hand; this.btnDeck.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.btnDeck.ForeColor = System.Drawing.Color.White; +<<<<<<< HEAD + this.btnDeck.Location = new System.Drawing.Point(0, 0); + this.btnDeck.Margin = new System.Windows.Forms.Padding(0, 0, 0, 4); +======= this.btnDeck.Location = new System.Drawing.Point(5, 4); this.btnDeck.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4); +>>>>>>> origin/main this.btnDeck.Name = "btnDeck"; this.btnDeck.Selected = false; this.btnDeck.Size = new System.Drawing.Size(44, 44); @@ -173,8 +213,13 @@ private void InitializeComponent() // panel1 // this.panel1.BackColor = System.Drawing.Color.Silver; +<<<<<<< HEAD + this.panel1.Location = new System.Drawing.Point(0, 51); + this.panel1.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3); +======= this.panel1.Location = new System.Drawing.Point(5, 55); this.panel1.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3); +>>>>>>> origin/main this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(44, 2); this.panel1.TabIndex = 4; @@ -187,8 +232,13 @@ private void InitializeComponent() this.btnExtensions.Cursor = System.Windows.Forms.Cursors.Hand; this.btnExtensions.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.btnExtensions.ForeColor = System.Drawing.Color.White; +<<<<<<< HEAD + this.btnExtensions.Location = new System.Drawing.Point(0, 60); + this.btnExtensions.Margin = new System.Windows.Forms.Padding(0, 4, 0, 4); +======= this.btnExtensions.Location = new System.Drawing.Point(5, 64); this.btnExtensions.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4); +>>>>>>> origin/main this.btnExtensions.Name = "btnExtensions"; this.btnExtensions.Selected = false; this.btnExtensions.Size = new System.Drawing.Size(44, 44); @@ -204,8 +254,13 @@ private void InitializeComponent() this.btnDeviceManager.Cursor = System.Windows.Forms.Cursors.Hand; this.btnDeviceManager.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.btnDeviceManager.ForeColor = System.Drawing.Color.White; +<<<<<<< HEAD + this.btnDeviceManager.Location = new System.Drawing.Point(0, 112); + this.btnDeviceManager.Margin = new System.Windows.Forms.Padding(0, 4, 0, 4); +======= this.btnDeviceManager.Location = new System.Drawing.Point(5, 116); this.btnDeviceManager.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4); +>>>>>>> origin/main this.btnDeviceManager.Name = "btnDeviceManager"; this.btnDeviceManager.Selected = false; this.btnDeviceManager.Size = new System.Drawing.Size(44, 44); @@ -221,8 +276,13 @@ private void InitializeComponent() this.btnVariables.Cursor = System.Windows.Forms.Cursors.Hand; this.btnVariables.Font = new System.Drawing.Font("Tahoma", 12.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.btnVariables.ForeColor = System.Drawing.Color.White; +<<<<<<< HEAD + this.btnVariables.Location = new System.Drawing.Point(0, 164); + this.btnVariables.Margin = new System.Windows.Forms.Padding(0, 4, 0, 4); +======= this.btnVariables.Location = new System.Drawing.Point(5, 168); this.btnVariables.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4); +>>>>>>> origin/main this.btnVariables.Name = "btnVariables"; this.btnVariables.Selected = false; this.btnVariables.Size = new System.Drawing.Size(44, 44); @@ -234,8 +294,13 @@ private void InitializeComponent() // panel2 // this.panel2.BackColor = System.Drawing.Color.Silver; +<<<<<<< HEAD + this.panel2.Location = new System.Drawing.Point(0, 215); + this.panel2.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3); +======= this.panel2.Location = new System.Drawing.Point(5, 219); this.panel2.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3); +>>>>>>> origin/main this.panel2.Name = "panel2"; this.panel2.Size = new System.Drawing.Size(44, 2); this.panel2.TabIndex = 5; @@ -249,7 +314,11 @@ private void InitializeComponent() this.btnSettings.Cursor = System.Windows.Forms.Cursors.Hand; this.btnSettings.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.btnSettings.ForeColor = System.Drawing.Color.White; +<<<<<<< HEAD + this.btnSettings.Location = new System.Drawing.Point(5, 512); +======= this.btnSettings.Location = new System.Drawing.Point(5, 515); +>>>>>>> origin/main this.btnSettings.Margin = new System.Windows.Forms.Padding(8, 4, 8, 4); this.btnSettings.Name = "btnSettings"; this.btnSettings.Selected = false; @@ -279,7 +348,11 @@ private void InitializeComponent() this.lblIPAddress.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.lblIPAddress.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.lblIPAddress.ForeColor = System.Drawing.Color.White; +<<<<<<< HEAD + this.lblIPAddress.Location = new System.Drawing.Point(778, 45); +======= this.lblIPAddress.Location = new System.Drawing.Point(778, 38); +>>>>>>> origin/main this.lblIPAddress.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); this.lblIPAddress.Name = "lblIPAddress"; this.lblIPAddress.Size = new System.Drawing.Size(252, 21); @@ -293,7 +366,11 @@ private void InitializeComponent() this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); +<<<<<<< HEAD + this.label1.Location = new System.Drawing.Point(1033, 45); +======= this.label1.Location = new System.Drawing.Point(1033, 38); +>>>>>>> origin/main this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(15, 19); @@ -308,7 +385,11 @@ private void InitializeComponent() this.lblPort.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.lblPort.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.lblPort.ForeColor = System.Drawing.Color.White; +<<<<<<< HEAD + this.lblPort.Location = new System.Drawing.Point(1067, 45); +======= this.lblPort.Location = new System.Drawing.Point(1067, 38); +>>>>>>> origin/main this.lblPort.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); this.lblPort.Name = "lblPort"; this.lblPort.Size = new System.Drawing.Size(124, 21); @@ -336,7 +417,11 @@ private void InitializeComponent() this.lblIpAddressHostname.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.lblIpAddressHostname.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.lblIpAddressHostname.ForeColor = System.Drawing.Color.White; +<<<<<<< HEAD + this.lblIpAddressHostname.Location = new System.Drawing.Point(454, 47); +======= this.lblIpAddressHostname.Location = new System.Drawing.Point(454, 40); +>>>>>>> origin/main this.lblIpAddressHostname.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); this.lblIpAddressHostname.Name = "lblIpAddressHostname"; this.lblIpAddressHostname.Size = new System.Drawing.Size(312, 18); @@ -347,16 +432,51 @@ private void InitializeComponent() // // navigation // + this.navigation.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); this.navigation.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(32)))), ((int)(((byte)(32))))); this.navigation.Controls.Add(this.contentButtonPanel); this.navigation.Controls.Add(this.btnSettings); +<<<<<<< HEAD + this.navigation.Location = new System.Drawing.Point(0, 41); + this.navigation.Margin = new System.Windows.Forms.Padding(0); +======= this.navigation.Location = new System.Drawing.Point(2, 41); this.navigation.Margin = new System.Windows.Forms.Padding(0, 3, 6, 3); +>>>>>>> origin/main this.navigation.Name = "navigation"; this.navigation.Size = new System.Drawing.Size(54, 563); this.navigation.TabIndex = 15; this.navigation.Visible = false; // +<<<<<<< HEAD + // btnNotifications + // + this.btnNotifications.BorderRadius = 8; + this.btnNotifications.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnNotifications.FlatAppearance.BorderSize = 0; + this.btnNotifications.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnNotifications.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.btnNotifications.ForeColor = System.Drawing.Color.White; + this.btnNotifications.HoverColor = System.Drawing.Color.Empty; + this.btnNotifications.Icon = global::SuchByte.MacroDeck.Properties.Resources.Bell; + this.btnNotifications.Location = new System.Drawing.Point(62, 41); + this.btnNotifications.Name = "btnNotifications"; + this.btnNotifications.NotificationCount = 0; + this.btnNotifications.Padding = new System.Windows.Forms.Padding(0, 3, 3, 0); + this.btnNotifications.Progress = 0; + this.btnNotifications.ProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(103)))), ((int)(((byte)(205))))); + this.btnNotifications.Size = new System.Drawing.Size(43, 43); + this.btnNotifications.TabIndex = 16; + this.btnNotifications.UseVisualStyleBackColor = true; + this.btnNotifications.UseWindowsAccentColor = false; + this.btnNotifications.Visible = false; + this.btnNotifications.Click += new System.EventHandler(this.BtnNotifications_Click); + // + // MainWindow + // + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); +======= // warningsErrorPanel // this.warningsErrorPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); @@ -398,10 +518,11 @@ private void InitializeComponent() // MainWindow // +>>>>>>> origin/main this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(45)))), ((int)(((byte)(45))))); this.ClientSize = new System.Drawing.Size(1200, 635); - this.Controls.Add(this.warningsErrorPanel); + this.Controls.Add(this.btnNotifications); this.Controls.Add(this.navigation); this.Controls.Add(this.lblIpAddressHostname); this.Controls.Add(this.lblServerStatus); @@ -430,7 +551,7 @@ private void InitializeComponent() this.Controls.SetChildIndex(this.lblServerStatus, 0); this.Controls.SetChildIndex(this.lblIpAddressHostname, 0); this.Controls.SetChildIndex(this.navigation, 0); - this.Controls.SetChildIndex(this.warningsErrorPanel, 0); + this.Controls.SetChildIndex(this.btnNotifications, 0); this.contentButtonPanel.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.btnDeck)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.btnExtensions)).EndInit(); @@ -438,8 +559,6 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.btnVariables)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.btnSettings)).EndInit(); this.navigation.ResumeLayout(false); - this.warningsErrorPanel.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -463,9 +582,14 @@ private void InitializeComponent() private System.Windows.Forms.Label lblIpAddressHostname; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel2; +<<<<<<< HEAD + private RoundedPanel navigation; + private NotificationButton btnNotifications; +======= private System.Windows.Forms.Panel navigation; private System.Windows.Forms.Panel warningsErrorPanel; private System.Windows.Forms.PictureBox pictureBox2; private System.Windows.Forms.LinkLabel lblErrorsWarnings; +>>>>>>> origin/main } } \ No newline at end of file diff --git a/GUI/MainWindow.cs b/GUI/MainWindow.cs index c2989a7f..60038184 100644 --- a/GUI/MainWindow.cs +++ b/GUI/MainWindow.cs @@ -1,4 +1,5 @@ using Fleck; +using SuchByte.MacroDeck.ExtensionStore; using SuchByte.MacroDeck.GUI.CustomControls; using SuchByte.MacroDeck.GUI.Dialogs; using SuchByte.MacroDeck.GUI.MainWindowContents; @@ -6,6 +7,7 @@ using SuchByte.MacroDeck.Icons; using SuchByte.MacroDeck.Language; using SuchByte.MacroDeck.Logging; +using SuchByte.MacroDeck.Notifications; using SuchByte.MacroDeck.Plugins; using SuchByte.MacroDeck.Server; using SuchByte.MacroDeck.Utils; @@ -40,24 +42,24 @@ public DeckView DeckView } } +<<<<<<< HEAD + private NotificationsList notificationsList; +======= public ExtensionsView ExtensionsView { get; set; } public VariablesView VariablesView { get; set; } public SettingsView SettingsView { get; set; } +>>>>>>> origin/main public MainWindow() { this.InitializeComponent(); + this.btnNotifications.BackColor = Color.Transparent; this.UpdateTranslation(); - this.UpdateWarningsErrors(); LanguageManager.LanguageChanged += LanguageChanged; Updater.Updater.OnUpdateAvailable += UpdateAvailable; - MacroDeckLogger.OnWarningOrError += MacroDeckLogger_OnWarningOrError; + this._deckView ??= new DeckView(); } - private void MacroDeckLogger_OnWarningOrError(object sender, EventArgs e) - { - UpdateWarningsErrors(); - } private void UpdateTranslation() { @@ -71,20 +73,15 @@ private void LanguageChanged(object sender, EventArgs e) { this.DeckView.UpdateTranslation(); } +<<<<<<< HEAD +======= if (this.VariablesView != null) { this.VariablesView.UpdateTranslation(); } +>>>>>>> origin/main } - private void UpdateWarningsErrors() - { - this.Invoke(new Action(() => - { - this.warningsErrorPanel.Visible = MacroDeckLogger.Errors > 0 || MacroDeckLogger.Warnings > 0; - this.lblErrorsWarnings.Text = string.Format(LanguageManager.Strings.XWarningsXErrors, MacroDeckLogger.Warnings, MacroDeckLogger.Errors); - })); - } private void UpdateAvailable(object sender, EventArgs e) { @@ -93,21 +90,19 @@ private void UpdateAvailable(object sender, EventArgs e) public void SelectContentButton(Control control) { - this.Invoke(new Action(() => + foreach (Control contentButton in this.contentButtonPanel.Controls.OfType().Where(x => x != control && x.Selected)) { - if (!control.GetType().Equals(typeof(ContentSelectorButton))) return; - foreach (Control contentButton in this.contentButtonPanel.Controls.OfType()) - { - ((ContentSelectorButton)contentButton).Selected = false; - } - btnSettings.Selected = false; - ((ContentSelectorButton)control).Selected = true; - })); + ((ContentSelectorButton)contentButton).Selected = false; + } + btnSettings.Selected = false; + ((ContentSelectorButton)control).Selected = true; } - public void SetView(Control view, bool clearAll = false) + public void SetView(Control view) { if (this.contentPanel.Controls.Contains(view)) return; +<<<<<<< HEAD +======= this.Invoke(new Action(() => @@ -125,37 +120,57 @@ public void SetView(Control view, bool clearAll = false) } this.contentPanel.Controls.Add(view); })); +>>>>>>> origin/main - if (view.GetType().Equals(typeof(DeckView))) + foreach (Control control in this.contentPanel.Controls.OfType().Where(x => x != view && x != this.DeckView)) { - SelectContentButton(btnDeck); - } else if (view.GetType().Equals(typeof(DeviceManagerView))) +<<<<<<< HEAD + control.Dispose(); + } + foreach (Control control in this.contentPanel.Controls.OfType().Where(x => x != view)) { + this.contentPanel.Controls.Remove(control); +======= SelectContentButton(btnDeviceManager); } else if (view.GetType().Equals(typeof(ExtensionsView))) { SelectContentButton(btnExtensions); +>>>>>>> origin/main } - else if (view.GetType().Equals(typeof(SettingsView))) + this.contentPanel.Controls.Add(view); + + switch (view) { - SelectContentButton(btnSettings); + case DeckView deck: + SelectContentButton(btnDeck); + break; + case DeviceManagerView deviceManager: + SelectContentButton(btnDeviceManager); + break; + case ExtensionsView extensions: + SelectContentButton(btnExtensions); + break; + case SettingsView settings: + SelectContentButton(btnSettings); + break; + case VariablesView variables: + SelectContentButton(btnVariables); + break; } - else if (view.GetType().Equals(typeof(VariablesView))) - { - SelectContentButton(btnVariables); - } - GC.Collect(); - GC.WaitForPendingFinalizers(); - GC.Collect(); } private void MainWindow_Load(object sender, EventArgs e) { +<<<<<<< HEAD + + this.lblVersion.Text = "Macro Deck " + MacroDeck.Version.VersionString; +======= this.SetView(new LoadingView()); this.lblVersion.Text = "Macro Deck " + MacroDeck.VersionString + (Debugger.IsAttached ? " (debug)" : ""); +>>>>>>> origin/main PluginManager.OnPluginsChange += this.OnPluginsChanged; PluginManager.OnUpdateCheckFinished += OnPackageManagerUpdateCheckFinished; @@ -179,22 +194,27 @@ private void MainWindow_Load(object sender, EventArgs e) this.btnExtensions.SetNotification(PluginManager.PluginsUpdateAvailable.Count > 0 || IconManager.IconPacksUpdateAvailable.Count > 0); - Task.Run(() => - { - this._deckView ??= new DeckView(); - Thread.Sleep(500); - this.SetView(this.DeckView); - this.Invoke(new Action(() => - { - this.navigation.Visible = true; - this.btnSettings.SetNotification(Updater.Updater.UpdateAvailable); - })); - - }); - - PluginManager.ScanUpdatesAsync(); - IconManager.ScanUpdatesAsync(); + this.navigation.Visible = true; + this.btnSettings.SetNotification(Updater.Updater.UpdateAvailable); + + + this.SetView(this.DeckView); + NotificationManager.OnNotification += NotificationsChanged; + NotificationManager.OnNotificationRemoved += NotificationsChanged; + ExtensionStoreHelper.SearchUpdatesAsync(); + ExtensionStoreHelper.OnInstallationFinished += ExtensionStoreHelper_OnInstallationFinished; CenterToScreen(); + this.btnNotifications.NotificationCount = NotificationManager.Notifications.Count; + } + + private void NotificationsChanged(object sender, EventArgs e) + { + this.btnNotifications.NotificationCount = NotificationManager.Notifications.Count; + } + + private void ExtensionStoreHelper_OnInstallationFinished(object sender, EventArgs e) + { + this.RefreshPluginsLabels(); } private void OnPackageManagerUpdateCheckFinished(object sender, EventArgs e) @@ -210,6 +230,7 @@ private void OnPluginsChanged(object sender, EventArgs e) private void RefreshPluginsLabels() { + if (!this.IsHandleCreated || this.IsDisposed) return; this.Invoke(new Action(() => { this.lblPluginsLoaded.Text = string.Format(Language.LanguageManager.Strings.XPluginsLoaded, $"{ PluginManager.Plugins.Values.Count } / { PluginManager.Plugins.Values.Count + PluginManager.PluginsNotLoaded.Values.Count } "); @@ -238,7 +259,7 @@ private void OnServerStateChanged(object sender, EventArgs e) private void OnClientsConnectedChanged(object sender, EventArgs e) { this.Invoke(new Action(() => - this.lblNumClientsConnected.Text = String.Format(Language.LanguageManager.Strings.XClientsConnected, MacroDeckServer.Clients.Count) + this.lblNumClientsConnected.Text = string.Format(LanguageManager.Strings.XClientsConnected, MacroDeckServer.Clients.Count) )); } @@ -250,20 +271,20 @@ private void BtnDeck_Click(object sender, EventArgs e) private void BtnExtensions_Click(object sender, EventArgs e) { +<<<<<<< HEAD + this.SetView(new ExtensionsView()); +======= if (this.ExtensionsView == null) { this.ExtensionsView = new ExtensionsView(); } this.SetView(this.ExtensionsView); +>>>>>>> origin/main } private void BtnSettings_Click(object sender, EventArgs e) { - if (this.SettingsView == null) - { - this.SettingsView = new SettingsView(); - } - this.SetView(this.SettingsView); + this.SetView(new SettingsView()); } private void BtnDeviceManager_Click(object sender, EventArgs e) @@ -281,11 +302,7 @@ public void OnFormClosing(object sender, EventArgs e) private void BtnVariables_Click(object sender, EventArgs e) { - if (this.VariablesView == null) - { - this.VariablesView = new VariablesView(); - } - this.SetView(this.VariablesView); + this.SetView(new VariablesView()); } private void LblErrorsWarnings_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) @@ -300,8 +317,35 @@ private void LblErrorsWarnings_LinkClicked(object sender, LinkLabelLinkClickedEv p.Start(); } +<<<<<<< HEAD + + private void BtnNotifications_Click(object sender, EventArgs e) + { + if (this.notificationsList == null || this.notificationsList.IsDisposed) + { + this.notificationsList = new NotificationsList + { + Location = new Point(this.btnNotifications.Location.X, this.btnNotifications.Location.Y + this.btnNotifications.Height) + }; + this.notificationsList.OnCloseRequested += (sender, e) => + { + this.Controls.Remove(this.notificationsList); + }; + } + + if (this.Controls.Contains(this.notificationsList)) + { + this.Controls.Remove(this.notificationsList); + } else + { + this.Controls.Add(this.notificationsList); + this.notificationsList.BringToFront(); + } + +======= private void lblPluginsLoaded_Click(object sender, EventArgs e) { +>>>>>>> origin/main } } diff --git a/GUI/MainWindowViews/DeckView.Designer.cs b/GUI/MainWindowViews/DeckView.Designer.cs index 081c9f41..2ff48ef6 100644 --- a/GUI/MainWindowViews/DeckView.Designer.cs +++ b/GUI/MainWindowViews/DeckView.Designer.cs @@ -85,6 +85,12 @@ private void InitializeComponent() this.panel1 = new System.Windows.Forms.Panel(); this.lblFolders = new System.Windows.Forms.Label(); this.lblGrid = new System.Windows.Forms.Label(); +<<<<<<< HEAD + this.roundedPanel1 = new SuchByte.MacroDeck.GUI.CustomControls.RoundedPanel(); + this.roundedPanel2 = new SuchByte.MacroDeck.GUI.CustomControls.RoundedPanel(); + this.label1 = new System.Windows.Forms.Label(); +======= +>>>>>>> origin/main this.foldersContextMenu.SuspendLayout(); this.actionButtonContextMenu.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.btnAddProfile)).BeginInit(); @@ -95,6 +101,8 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.cornerRadius)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.btnEditProfile)).BeginInit(); this.panel1.SuspendLayout(); + this.roundedPanel1.SuspendLayout(); + this.roundedPanel2.SuspendLayout(); this.SuspendLayout(); // // foldersView @@ -506,6 +514,14 @@ private void InitializeComponent() // // lblFolders // +<<<<<<< HEAD + this.lblFolders.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(35)))), ((int)(((byte)(35)))), ((int)(((byte)(35))))); + this.lblFolders.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); + this.lblFolders.ForeColor = System.Drawing.Color.White; + this.lblFolders.Location = new System.Drawing.Point(9, 6); + this.lblFolders.Name = "lblFolders"; + this.lblFolders.Size = new System.Drawing.Size(250, 22); +======= this.lblFolders.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.lblFolders.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(35)))), ((int)(((byte)(35)))), ((int)(((byte)(35))))); this.lblFolders.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); @@ -513,12 +529,21 @@ private void InitializeComponent() this.lblFolders.Location = new System.Drawing.Point(854, 3); this.lblFolders.Name = "lblFolders"; this.lblFolders.Size = new System.Drawing.Size(269, 35); +>>>>>>> origin/main this.lblFolders.TabIndex = 40; this.lblFolders.Text = "Folders"; this.lblFolders.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // lblGrid // +<<<<<<< HEAD + this.lblGrid.BackColor = System.Drawing.Color.Transparent; + this.lblGrid.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); + this.lblGrid.ForeColor = System.Drawing.Color.White; + this.lblGrid.Location = new System.Drawing.Point(9, 6); + this.lblGrid.Name = "lblGrid"; + this.lblGrid.Size = new System.Drawing.Size(250, 22); +======= this.lblGrid.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.lblGrid.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(35)))), ((int)(((byte)(35)))), ((int)(((byte)(35))))); this.lblGrid.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); @@ -526,16 +551,61 @@ private void InitializeComponent() this.lblGrid.Location = new System.Drawing.Point(854, 387); this.lblGrid.Name = "lblGrid"; this.lblGrid.Size = new System.Drawing.Size(269, 35); +>>>>>>> origin/main this.lblGrid.TabIndex = 41; this.lblGrid.Text = "Grid"; this.lblGrid.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // +<<<<<<< HEAD + // roundedPanel1 + // + this.roundedPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.roundedPanel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(35)))), ((int)(((byte)(35)))), ((int)(((byte)(35))))); + this.roundedPanel1.Controls.Add(this.lblGrid); + this.roundedPanel1.Location = new System.Drawing.Point(857, 384); + this.roundedPanel1.Name = "roundedPanel1"; + this.roundedPanel1.Size = new System.Drawing.Size(269, 35); + this.roundedPanel1.TabIndex = 42; + // + // roundedPanel2 + // + this.roundedPanel2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.roundedPanel2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(35)))), ((int)(((byte)(35)))), ((int)(((byte)(35))))); + this.roundedPanel2.Controls.Add(this.label1); + this.roundedPanel2.Controls.Add(this.lblFolders); + this.roundedPanel2.Location = new System.Drawing.Point(857, 4); + this.roundedPanel2.Name = "roundedPanel2"; + this.roundedPanel2.Size = new System.Drawing.Size(269, 35); + this.roundedPanel2.TabIndex = 43; + // + // label1 + // + this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.label1.BackColor = System.Drawing.Color.Transparent; + this.label1.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); + this.label1.ForeColor = System.Drawing.Color.White; + this.label1.Location = new System.Drawing.Point(78, -59); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(250, 22); + this.label1.TabIndex = 41; + this.label1.Text = "Grid"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // DeckView + // + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; + this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(45)))), ((int)(((byte)(45))))); + this.Controls.Add(this.roundedPanel2); + this.Controls.Add(this.roundedPanel1); +======= // DeckView // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(45)))), ((int)(((byte)(45))))); this.Controls.Add(this.lblGrid); this.Controls.Add(this.lblFolders); +>>>>>>> origin/main this.Controls.Add(this.panel1); this.Controls.Add(this.checkButtonBackground); this.Controls.Add(this.lblCornerRadius); @@ -562,6 +632,8 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.cornerRadius)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.btnEditProfile)).EndInit(); this.panel1.ResumeLayout(false); + this.roundedPanel1.ResumeLayout(false); + this.roundedPanel2.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); @@ -602,5 +674,11 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; private System.Windows.Forms.Label lblFolders; private System.Windows.Forms.Label lblGrid; +<<<<<<< HEAD + private RoundedPanel roundedPanel1; + private RoundedPanel roundedPanel2; + private System.Windows.Forms.Label label1; +======= +>>>>>>> origin/main } } diff --git a/GUI/MainWindowViews/DeckView.cs b/GUI/MainWindowViews/DeckView.cs index 057e376c..91e41c91 100644 --- a/GUI/MainWindowViews/DeckView.cs +++ b/GUI/MainWindowViews/DeckView.cs @@ -78,81 +78,76 @@ public void UpdateFolders() { this.foldersView.Nodes.Clear(); - var stack = new Stack(); - var rootDirectory = ProfileManager.CurrentProfile.Folders.FirstOrDefault(); - var node = new TreeNode(rootDirectory.DisplayName) { Tag = rootDirectory }; - stack.Push(node); + var stack = new Stack(); + var rootDirectory = ProfileManager.CurrentProfile.Folders.FirstOrDefault(); + var node = new TreeNode(rootDirectory.DisplayName) { Tag = rootDirectory }; + stack.Push(node); - while (stack.Count > 0) + while (stack.Count > 0) + { + var currentNode = stack.Pop(); + var directoryInfo = (Folders.MacroDeckFolder)currentNode.Tag; + foreach (var directoryId in directoryInfo.Childs.ToList()) { - var currentNode = stack.Pop(); - var directoryInfo = (Folders.MacroDeckFolder)currentNode.Tag; - foreach (var directoryId in directoryInfo.Childs.ToList()) + try { - try - { - var directory = ProfileManager.FindFolderById(directoryId, ProfileManager.CurrentProfile); - var childDirectoryNode = new TreeNode(directory.DisplayName) { Tag = directory }; - this.Invoke(new Action(() => currentNode.Nodes.Add(childDirectoryNode))); - stack.Push(childDirectoryNode); - } catch { } - } + var directory = ProfileManager.FindFolderById(directoryId, ProfileManager.CurrentProfile); + var childDirectoryNode = new TreeNode(directory.DisplayName) { Tag = directory }; + this.Invoke(new Action(() => currentNode.Nodes.Add(childDirectoryNode))); + stack.Push(childDirectoryNode); + } catch { } } - this.foldersView.Nodes.Add(node); - this.foldersView.ExpandAll(); - - GC.Collect(); - GC.WaitForPendingFinalizers(); - GC.Collect(); + } + this.foldersView.Nodes.Add(node); + this.foldersView.ExpandAll(); } public void UpdateButtons(bool clear = false) { - Task.Run(() => + if (clear) { - if (clear) + foreach (RoundedButton roundedButton in this.buttonPanel.Controls) { - foreach (RoundedButton roundedButton in this.buttonPanel.Controls) + ActionButton.ActionButton actionButton = this._currentFolder.ActionButtons.Find(aB => aB.Position_X == roundedButton.Column && aB.Position_Y == roundedButton.Row); + if (actionButton != null) { - ActionButton.ActionButton actionButton = this._currentFolder.ActionButtons.Find(aB => aB.Position_X == roundedButton.Column && aB.Position_Y == roundedButton.Row); - if (actionButton != null) - { - actionButton.StateChanged -= this.ButtonStateChanged; - actionButton.IconChanged -= ActionButton_IconChanged; - actionButton.LabelOff.LabelBase64Changed -= this.LabelChanged; - actionButton.LabelOn.LabelBase64Changed -= this.LabelChanged; - } - - roundedButton.MouseDown -= this.ActionButton_Down; - roundedButton.DragDrop -= Button_DragDrop; - roundedButton.DragEnter -= Button_DragEnter; - this.Invoke(new Action(() => roundedButton.Dispose())); - + actionButton.StateChanged -= this.ButtonStateChanged; + actionButton.IconChanged -= ActionButton_IconChanged; + actionButton.LabelOff.LabelBase64Changed -= this.LabelChanged; + actionButton.LabelOn.LabelBase64Changed -= this.LabelChanged; } - this.Invoke(new Action(() => this.buttonPanel.Controls.Clear())); + + roundedButton.MouseDown -= this.ActionButton_Down; + roundedButton.DragDrop -= Button_DragDrop; + roundedButton.DragEnter -= Button_DragEnter; + this.Invoke(new Action(() => roundedButton.Dispose())); + } + this.Invoke(new Action(() => this.buttonPanel.Controls.Clear())); + } + + + // Button size algorithm from @PhoenixWyllow - // Button size algorithm from @PhoenixWyllow + int buttonSize = 100; + int rows = ProfileManager.CurrentProfile.Rows, columns = ProfileManager.CurrentProfile.Columns, spacing = ProfileManager.CurrentProfile.ButtonSpacing; // from settings + int width = buttonPanel.Width, height = buttonPanel.Height; // from panel + int buttonSizeX, buttonSizeY; - int buttonSize = 100; - int rows = ProfileManager.CurrentProfile.Rows, columns = ProfileManager.CurrentProfile.Columns, spacing = ProfileManager.CurrentProfile.ButtonSpacing; // from settings - int width = buttonPanel.Width, height = buttonPanel.Height; // from panel - int buttonSizeX, buttonSizeY; + buttonSizeX = width / columns; //calc with spacing, remove it after + buttonSizeY = height / rows; + buttonSize = Math.Min(buttonSizeX, buttonSizeY) - spacing; - buttonSizeX = width / columns; //calc with spacing, remove it after - buttonSizeY = height / rows; - buttonSize = Math.Min(buttonSizeX, buttonSizeY) - spacing; - for (int row = 0; row < rows; row++) + for (int row = 0; row < rows; row++) + { + for (int column = 0; column < columns; column++) { - for (int column = 0; column < columns; column++) - { - this.Invoke(new Action(() => this.LoadButton(row, column, buttonSize))); - } + this.LoadButton(row, column, buttonSize); } - }); + } GC.Collect(); GC.WaitForPendingFinalizers(); @@ -247,6 +242,7 @@ private void UpdateButtonIcon(ActionButton.ActionButton actionButton, RoundedBut private void LoadButton(int row, int column, int buttonSize) { + long drawStarted = DateTimeOffset.Now.ToUnixTimeMilliseconds(); RoundedButton button = this.buttonPanel.Controls.Cast().Where(x => x.Row.Equals(row) && x.Column.Equals(column)).FirstOrDefault(); if (button == null) @@ -274,7 +270,6 @@ private void LoadButton(int row, int column, int buttonSize) button.Location = new Point((column * buttonSize) + (column * ProfileManager.CurrentProfile.ButtonSpacing), (row * buttonSize) + (row * ProfileManager.CurrentProfile.ButtonSpacing)); button.BackColor = ProfileManager.CurrentProfile.ButtonBackground ? Color.FromArgb(35, 35, 35) : Color.Transparent; - if (button == null) return; if (button.BackgroundImage != null) { button.BackgroundImage.Dispose(); @@ -290,6 +285,7 @@ private void LoadButton(int row, int column, int buttonSize) } ActionButton.ActionButton actionButton = this._currentFolder.ActionButtons.Find(aB => aB.Position_X == column && aB.Position_Y == row); + if (actionButton != null) { // Remove event handlers if there are any to prevent multiple event handlers @@ -314,12 +310,9 @@ private void LoadButton(int row, int column, int buttonSize) if (!this.buttonPanel.Controls.Contains(button)) { - this.buttonPanel.Controls.Add(button); + this.Invoke(new Action(() => this.buttonPanel.Controls.Add(button))); } - GC.Collect(); - GC.WaitForPendingFinalizers(); - GC.Collect(); } private void ActionButton_IconChanged(object sender, EventArgs e) @@ -342,58 +335,62 @@ private void Button_DragDrop(object sender, DragEventArgs e) } else { - RoundedButton draggedButton = (RoundedButton)e.Data.GetData(typeof(RoundedButton)); - RoundedButton targetButton = (RoundedButton)sender; - - ActionButton.ActionButton targetActionButton = ProfileManager.FindActionButton(this._currentFolder, targetButton.Row, targetButton.Column); - ActionButton.ActionButton draggedActionButton = ProfileManager.FindActionButton(this._currentFolder, draggedButton.Row, draggedButton.Column); + Task.Run(() => + { + RoundedButton draggedButton = (RoundedButton)e.Data.GetData(typeof(RoundedButton)); + RoundedButton targetButton = (RoundedButton)sender; - if (draggedActionButton == null) return; + ActionButton.ActionButton targetActionButton = ProfileManager.FindActionButton(this._currentFolder, targetButton.Row, targetButton.Column); + ActionButton.ActionButton draggedActionButton = ProfileManager.FindActionButton(this._currentFolder, draggedButton.Row, draggedButton.Column); - ActionButton.ActionButton newActionButton = draggedActionButton; - newActionButton.Position_Y = targetButton.Row; - newActionButton.Position_X = targetButton.Column; + if (draggedActionButton == null) return; - this._currentFolder.ActionButtons.Remove(draggedActionButton); - this._currentFolder.ActionButtons.Add(newActionButton); + ActionButton.ActionButton newActionButton = draggedActionButton; + newActionButton.Position_Y = targetButton.Row; + newActionButton.Position_X = targetButton.Column; - if (targetActionButton != null) - { - ActionButton.ActionButton newTargetButton = targetActionButton; - newTargetButton.Position_Y = draggedButton.Row; - newTargetButton.Position_X = draggedButton.Column; - this._currentFolder.ActionButtons.Remove(targetActionButton); - this._currentFolder.ActionButtons.Add(newTargetButton); + this._currentFolder.ActionButtons.Remove(draggedActionButton); + this._currentFolder.ActionButtons.Add(newActionButton); - foreach (PluginAction pluginAction in newTargetButton.Actions) - { - pluginAction.SetActionButton(newTargetButton); - } - foreach (PluginAction pluginAction in newTargetButton.ActionsRelease) - { - pluginAction.SetActionButton(newTargetButton); - } - foreach (PluginAction pluginAction in newTargetButton.ActionsLongPress) - { - pluginAction.SetActionButton(newTargetButton); - } - foreach (PluginAction pluginAction in newTargetButton.ActionsLongPressRelease) + if (targetActionButton != null) { - pluginAction.SetActionButton(newTargetButton); - } + ActionButton.ActionButton newTargetButton = targetActionButton; + newTargetButton.Position_Y = draggedButton.Row; + newTargetButton.Position_X = draggedButton.Column; + this._currentFolder.ActionButtons.Remove(targetActionButton); + this._currentFolder.ActionButtons.Add(newTargetButton); - if (newTargetButton.EventListeners == null) - { - newTargetButton.EventListeners = new List(); - } - foreach (var eventListener in newTargetButton.EventListeners) - { - foreach (PluginAction pluginAction in eventListener.Actions) + foreach (PluginAction pluginAction in newTargetButton.Actions) + { + pluginAction.SetActionButton(newTargetButton); + } + foreach (PluginAction pluginAction in newTargetButton.ActionsRelease) + { + pluginAction.SetActionButton(newTargetButton); + } + foreach (PluginAction pluginAction in newTargetButton.ActionsLongPress) { pluginAction.SetActionButton(newTargetButton); } + foreach (PluginAction pluginAction in newTargetButton.ActionsLongPressRelease) + { + pluginAction.SetActionButton(newTargetButton); + } + + if (newTargetButton.EventListeners == null) + { + newTargetButton.EventListeners = new List(); + } + foreach (var eventListener in newTargetButton.EventListeners) + { + foreach (PluginAction pluginAction in eventListener.Actions) + { + pluginAction.SetActionButton(newTargetButton); + } + } } - } + }); + ProfileManager.Save(); this.UpdateButtons(); MacroDeckServer.UpdateFolder(this._currentFolder); @@ -517,15 +514,23 @@ private void FoldersView_MouseDown(object sender, MouseEventArgs e) private void Deck_Load(object sender, EventArgs e) { - this.LoadProfiles(); - this.LoadProfileSettings(); - this.UpdateButtons(); + Task.Run(() => + { + this.LoadProfiles(); + this.LoadProfileSettings(); + this.UpdateButtons(); + }); CustomControls.Form mainWindow = (CustomControls.Form)this.Parent.Parent; mainWindow.ResizeEnd += MainWindow_ResizeEnd; } private void LoadProfiles() { + if (this.InvokeRequired) + { + this.Invoke(new Action(() => this.LoadProfiles())); + return; + } this.boxProfiles.Items.Clear(); foreach (MacroDeckProfile macroDeckProfile in ProfileManager.Profiles) { @@ -678,14 +683,21 @@ private void BoxProfiles_SelectedIndexChanged(object sender, EventArgs e) { profile = ProfileManager.Profiles.FirstOrDefault(); } + this.SetProfile(profile); + } + + public void SetProfile(MacroDeckProfile profile) + { Settings.Default.SelectedProfile = profile.ProfileId; Settings.Default.Save(); ProfileManager.CurrentProfile = profile; this._currentFolder = profile.Folders.FirstOrDefault(); this.UpdateButtons(true); - this.LoadProfileSettings(); - this.UpdateFolders(); - + this.Invoke(new Action(() => { + this.boxProfiles.Text = profile.DisplayName; + this.UpdateFolders(); + this.LoadProfileSettings(); + })); GC.Collect(); GC.WaitForPendingFinalizers(); GC.Collect(); @@ -693,6 +705,11 @@ private void BoxProfiles_SelectedIndexChanged(object sender, EventArgs e) private void LoadProfileSettings() { + if (this.InvokeRequired) + { + this.Invoke(new Action(() => this.LoadProfileSettings())); + return; + } this.buttonRows.ValueChanged -= this.ButtonSettingsChanged; this.buttonColumns.ValueChanged -= this.ButtonSettingsChanged; this.buttonSpacing.ValueChanged -= this.ButtonSettingsChanged; @@ -715,10 +732,6 @@ private void LoadProfileSettings() this.buttonSpacing.Enabled = ProfileManager.CurrentProfile.ButtonsCustomizable; this.cornerRadius.Enabled = ProfileManager.CurrentProfile.ButtonsCustomizable; this.checkButtonBackground.Enabled = ProfileManager.CurrentProfile.ButtonsCustomizable; - - GC.Collect(); - GC.WaitForPendingFinalizers(); - GC.Collect(); } diff --git a/GUI/MainWindowViews/SettingsView.Designer.cs b/GUI/MainWindowViews/SettingsView.Designer.cs index d55bb478..ac290bee 100644 --- a/GUI/MainWindowViews/SettingsView.Designer.cs +++ b/GUI/MainWindowViews/SettingsView.Designer.cs @@ -55,7 +55,6 @@ private void InitializeComponent() this.tabUpdater = new System.Windows.Forms.TabPage(); this.checkAutoUpdate = new System.Windows.Forms.CheckBox(); this.checkInstallBetaVersions = new System.Windows.Forms.CheckBox(); - this.checkInstallDevVersions = new System.Windows.Forms.CheckBox(); this.updaterPanel = new System.Windows.Forms.Panel(); this.btnCheckUpdates = new SuchByte.MacroDeck.GUI.CustomControls.ButtonPrimary(); this.lblInstalledVersion = new System.Windows.Forms.Label(); @@ -66,6 +65,9 @@ private void InitializeComponent() this.backupsPanel = new System.Windows.Forms.FlowLayoutPanel(); this.lblBackups = new System.Windows.Forms.Label(); this.tabAbout = new System.Windows.Forms.TabPage(); + this.btnGitHub = new SuchByte.MacroDeck.GUI.CustomControls.PictureButton(); + this.lblBuild = new System.Windows.Forms.Label(); + this.lblBuildLabel = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.lblTranslationBy = new System.Windows.Forms.Label(); this.btnLicenses = new SuchByte.MacroDeck.GUI.CustomControls.ButtonPrimary(); @@ -73,9 +75,7 @@ private void InitializeComponent() this.lblWebsocketAPIVersion = new System.Windows.Forms.Label(); this.lblPluginAPILabel = new System.Windows.Forms.Label(); this.lblWebSocketAPILabel = new System.Windows.Forms.Label(); - this.lblOS = new System.Windows.Forms.Label(); this.lblInstalledPlugins = new System.Windows.Forms.Label(); - this.lblOSLabel = new System.Windows.Forms.Label(); this.lblInstalledPluginsLabel = new System.Windows.Forms.Label(); this.lblDeveloped = new System.Windows.Forms.Label(); this.lblMacroDeck = new System.Windows.Forms.Label(); @@ -89,6 +89,7 @@ private void InitializeComponent() this.tabUpdater.SuspendLayout(); this.tabBackups.SuspendLayout(); this.tabAbout.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.btnGitHub)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); // @@ -373,7 +374,6 @@ private void InitializeComponent() this.tabUpdater.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(45)))), ((int)(((byte)(45))))); this.tabUpdater.Controls.Add(this.checkAutoUpdate); this.tabUpdater.Controls.Add(this.checkInstallBetaVersions); - this.tabUpdater.Controls.Add(this.checkInstallDevVersions); this.tabUpdater.Controls.Add(this.updaterPanel); this.tabUpdater.Controls.Add(this.btnCheckUpdates); this.tabUpdater.Controls.Add(this.lblInstalledVersion); @@ -401,7 +401,7 @@ private void InitializeComponent() // checkInstallBetaVersions // this.checkInstallBetaVersions.AutoSize = true; - this.checkInstallBetaVersions.Location = new System.Drawing.Point(13, 74); + this.checkInstallBetaVersions.Location = new System.Drawing.Point(13, 57); this.checkInstallBetaVersions.Name = "checkInstallBetaVersions"; this.checkInstallBetaVersions.Size = new System.Drawing.Size(169, 23); this.checkInstallBetaVersions.TabIndex = 16; @@ -409,6 +409,8 @@ private void InitializeComponent() this.checkInstallBetaVersions.UseMnemonic = false; this.checkInstallBetaVersions.UseVisualStyleBackColor = true; // +<<<<<<< HEAD +======= // checkInstallDevVersions // this.checkInstallDevVersions.AutoSize = true; @@ -420,8 +422,12 @@ private void InitializeComponent() this.checkInstallDevVersions.UseMnemonic = false; this.checkInstallDevVersions.UseVisualStyleBackColor = true; // +>>>>>>> origin/main // updaterPanel // + this.updaterPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.updaterPanel.Location = new System.Drawing.Point(3, 103); this.updaterPanel.Name = "updaterPanel"; this.updaterPanel.Size = new System.Drawing.Size(920, 420); @@ -537,6 +543,9 @@ private void InitializeComponent() // tabAbout // this.tabAbout.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(45)))), ((int)(((byte)(45))))); + this.tabAbout.Controls.Add(this.btnGitHub); + this.tabAbout.Controls.Add(this.lblBuild); + this.tabAbout.Controls.Add(this.lblBuildLabel); this.tabAbout.Controls.Add(this.label1); this.tabAbout.Controls.Add(this.lblTranslationBy); this.tabAbout.Controls.Add(this.btnLicenses); @@ -544,9 +553,7 @@ private void InitializeComponent() this.tabAbout.Controls.Add(this.lblWebsocketAPIVersion); this.tabAbout.Controls.Add(this.lblPluginAPILabel); this.tabAbout.Controls.Add(this.lblWebSocketAPILabel); - this.tabAbout.Controls.Add(this.lblOS); this.tabAbout.Controls.Add(this.lblInstalledPlugins); - this.tabAbout.Controls.Add(this.lblOSLabel); this.tabAbout.Controls.Add(this.lblInstalledPluginsLabel); this.tabAbout.Controls.Add(this.lblDeveloped); this.tabAbout.Controls.Add(this.lblMacroDeck); @@ -559,10 +566,44 @@ private void InitializeComponent() this.tabAbout.TabIndex = 2; this.tabAbout.Text = "About"; // + // btnGitHub + // + this.btnGitHub.BackColor = System.Drawing.Color.Transparent; + this.btnGitHub.BackgroundImage = global::SuchByte.MacroDeck.Properties.Resources.GitHub_Mark_Light; + this.btnGitHub.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.btnGitHub.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnGitHub.HoverImage = null; + this.btnGitHub.Location = new System.Drawing.Point(436, 63); + this.btnGitHub.Name = "btnGitHub"; + this.btnGitHub.Size = new System.Drawing.Size(50, 50); + this.btnGitHub.TabIndex = 18; + this.btnGitHub.TabStop = false; + this.btnGitHub.Click += new System.EventHandler(this.BtnGitHub_Click); + // + // lblBuild + // + this.lblBuild.AutoSize = true; + this.lblBuild.Location = new System.Drawing.Point(564, 380); + this.lblBuild.Name = "lblBuild"; + this.lblBuild.Size = new System.Drawing.Size(27, 19); + this.lblBuild.TabIndex = 17; + this.lblBuild.Text = "13"; + this.lblBuild.UseMnemonic = false; + // + // lblBuildLabel + // + this.lblBuildLabel.AutoSize = true; + this.lblBuildLabel.Location = new System.Drawing.Point(332, 380); + this.lblBuildLabel.Name = "lblBuildLabel"; + this.lblBuildLabel.Size = new System.Drawing.Size(44, 19); + this.lblBuildLabel.TabIndex = 16; + this.lblBuildLabel.Text = "Build"; + this.lblBuildLabel.UseMnemonic = false; + // // label1 // this.label1.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.label1.Location = new System.Drawing.Point(219, 173); + this.label1.Location = new System.Drawing.Point(219, 226); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(485, 18); this.label1.TabIndex = 15; @@ -573,7 +614,7 @@ private void InitializeComponent() // lblTranslationBy // this.lblTranslationBy.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.lblTranslationBy.Location = new System.Drawing.Point(219, 111); + this.lblTranslationBy.Location = new System.Drawing.Point(219, 164); this.lblTranslationBy.Name = "lblTranslationBy"; this.lblTranslationBy.Size = new System.Drawing.Size(485, 18); this.lblTranslationBy.TabIndex = 14; @@ -591,7 +632,7 @@ private void InitializeComponent() this.btnLicenses.ForeColor = System.Drawing.Color.White; this.btnLicenses.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(89)))), ((int)(((byte)(184))))); this.btnLicenses.Icon = null; - this.btnLicenses.Location = new System.Drawing.Point(361, 244); + this.btnLicenses.Location = new System.Drawing.Point(361, 297); this.btnLicenses.Name = "btnLicenses"; this.btnLicenses.Progress = 0; this.btnLicenses.ProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(46)))), ((int)(((byte)(94))))); @@ -606,7 +647,7 @@ private void InitializeComponent() // lblPluginAPIVersion // this.lblPluginAPIVersion.AutoSize = true; - this.lblPluginAPIVersion.Location = new System.Drawing.Point(567, 437); + this.lblPluginAPIVersion.Location = new System.Drawing.Point(564, 434); this.lblPluginAPIVersion.Name = "lblPluginAPIVersion"; this.lblPluginAPIVersion.Size = new System.Drawing.Size(27, 19); this.lblPluginAPIVersion.TabIndex = 12; @@ -616,7 +657,7 @@ private void InitializeComponent() // lblWebsocketAPIVersion // this.lblWebsocketAPIVersion.AutoSize = true; - this.lblWebsocketAPIVersion.Location = new System.Drawing.Point(567, 412); + this.lblWebsocketAPIVersion.Location = new System.Drawing.Point(564, 407); this.lblWebsocketAPIVersion.Name = "lblWebsocketAPIVersion"; this.lblWebsocketAPIVersion.Size = new System.Drawing.Size(27, 19); this.lblWebsocketAPIVersion.TabIndex = 11; @@ -626,7 +667,7 @@ private void InitializeComponent() // lblPluginAPILabel // this.lblPluginAPILabel.AutoSize = true; - this.lblPluginAPILabel.Location = new System.Drawing.Point(329, 437); + this.lblPluginAPILabel.Location = new System.Drawing.Point(332, 434); this.lblPluginAPILabel.Name = "lblPluginAPILabel"; this.lblPluginAPILabel.Size = new System.Drawing.Size(146, 19); this.lblPluginAPILabel.TabIndex = 10; @@ -636,12 +677,14 @@ private void InitializeComponent() // lblWebSocketAPILabel // this.lblWebSocketAPILabel.AutoSize = true; - this.lblWebSocketAPILabel.Location = new System.Drawing.Point(329, 412); + this.lblWebSocketAPILabel.Location = new System.Drawing.Point(332, 407); this.lblWebSocketAPILabel.Name = "lblWebSocketAPILabel"; this.lblWebSocketAPILabel.Size = new System.Drawing.Size(177, 19); this.lblWebSocketAPILabel.TabIndex = 9; this.lblWebSocketAPILabel.Text = "Websocket API version:"; this.lblWebSocketAPILabel.UseMnemonic = false; +<<<<<<< HEAD +======= // // lblOS // @@ -652,16 +695,19 @@ private void InitializeComponent() this.lblOS.TabIndex = 8; this.lblOS.Text = "os"; this.lblOS.UseMnemonic = false; +>>>>>>> origin/main // // lblInstalledPlugins // this.lblInstalledPlugins.AutoSize = true; - this.lblInstalledPlugins.Location = new System.Drawing.Point(567, 463); + this.lblInstalledPlugins.Location = new System.Drawing.Point(564, 461); this.lblInstalledPlugins.Name = "lblInstalledPlugins"; this.lblInstalledPlugins.Size = new System.Drawing.Size(18, 19); this.lblInstalledPlugins.TabIndex = 7; this.lblInstalledPlugins.Text = "0"; this.lblInstalledPlugins.UseMnemonic = false; +<<<<<<< HEAD +======= // // lblOSLabel // @@ -672,21 +718,26 @@ private void InitializeComponent() this.lblOSLabel.TabIndex = 5; this.lblOSLabel.Text = "OS:"; this.lblOSLabel.UseMnemonic = false; +>>>>>>> origin/main // // lblInstalledPluginsLabel // this.lblInstalledPluginsLabel.AutoSize = true; - this.lblInstalledPluginsLabel.Location = new System.Drawing.Point(329, 463); + this.lblInstalledPluginsLabel.Location = new System.Drawing.Point(332, 461); this.lblInstalledPluginsLabel.Name = "lblInstalledPluginsLabel"; this.lblInstalledPluginsLabel.Size = new System.Drawing.Size(131, 19); this.lblInstalledPluginsLabel.TabIndex = 4; this.lblInstalledPluginsLabel.Text = "Installed plugins:"; +<<<<<<< HEAD + this.lblInstalledPluginsLabel.UseMnemonic = false; +======= this.lblInstalledPluginsLabel.UseMnemonic= false; +>>>>>>> origin/main // // lblDeveloped // this.lblDeveloped.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.lblDeveloped.Location = new System.Drawing.Point(219, 153); + this.lblDeveloped.Location = new System.Drawing.Point(219, 206); this.lblDeveloped.Name = "lblDeveloped"; this.lblDeveloped.Size = new System.Drawing.Size(485, 18); this.lblDeveloped.TabIndex = 2; @@ -729,7 +780,11 @@ private void InitializeComponent() // // SettingsView // +<<<<<<< HEAD + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); +======= +>>>>>>> origin/main this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(45)))), ((int)(((byte)(45))))); this.Controls.Add(this.verticalTabControl); @@ -750,6 +805,7 @@ private void InitializeComponent() this.tabBackups.PerformLayout(); this.tabAbout.ResumeLayout(false); this.tabAbout.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.btnGitHub)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); @@ -763,9 +819,7 @@ private void InitializeComponent() private System.Windows.Forms.PictureBox pictureBox1; private System.Windows.Forms.Label lblMacroDeck; private System.Windows.Forms.Label lblDeveloped; - private System.Windows.Forms.Label lblOSLabel; private System.Windows.Forms.Label lblInstalledPluginsLabel; - private System.Windows.Forms.Label lblOS; private System.Windows.Forms.Label lblInstalledPlugins; private System.Windows.Forms.TabPage tabConnection; private System.Windows.Forms.Label lblGeneral; @@ -798,11 +852,13 @@ private void InitializeComponent() private System.Windows.Forms.ImageList tabIcons; private System.Windows.Forms.Label label1; private System.Windows.Forms.CheckBox checkInstallBetaVersions; - private System.Windows.Forms.CheckBox checkInstallDevVersions; private System.Windows.Forms.CheckBox checkAutoUpdate; private System.Windows.Forms.TabPage tabBackups; private System.Windows.Forms.Label lblBackups; private System.Windows.Forms.FlowLayoutPanel backupsPanel; private ButtonPrimary btnCreateBackup; + private System.Windows.Forms.Label lblBuild; + private System.Windows.Forms.Label lblBuildLabel; + private PictureButton btnGitHub; } } diff --git a/GUI/MainWindowViews/SettingsView.cs b/GUI/MainWindowViews/SettingsView.cs index 606baa6c..18096a78 100644 --- a/GUI/MainWindowViews/SettingsView.cs +++ b/GUI/MainWindowViews/SettingsView.cs @@ -24,9 +24,10 @@ namespace SuchByte.MacroDeck.GUI.MainWindowContents { public partial class SettingsView : UserControl { - public SettingsView() + public SettingsView(int page = 0) { InitializeComponent(); + this.verticalTabControl.SelectTab(page); if (!DesignMode) { this.verticalTabControl.SelectedTabColor = Colors.WindowsAccentColor; @@ -69,15 +70,14 @@ private void UpdateTranslation() this.tabBackups.Text = LanguageManager.Strings.Backups; this.lblBackups.Text = LanguageManager.Strings.Backups; this.btnCreateBackup.Text = LanguageManager.Strings.CreateBackup; - //this.lblUpdateChannelLabel.Text = LanguageManager.Strings.UpdateChannel; - this.checkInstallDevVersions.Text = LanguageManager.Strings.InstallDevVersions; this.checkInstallBetaVersions.Text = LanguageManager.Strings.InstallBetaVersions; this.btnCheckUpdates.Text = LanguageManager.Strings.CheckForUpdatesNow; + this.lblBuildLabel.Text = LanguageManager.Strings.VersionBuild; + this.lblBuild.Text = MacroDeck.Version.Build.ToString(); this.lblWebSocketAPILabel.Text = LanguageManager.Strings.WebSocketAPIVersion; this.lblPluginAPILabel.Text = LanguageManager.Strings.PluginAPIVersion; this.lblInstalledPluginsLabel.Text = LanguageManager.Strings.InstalledPlugins; - this.lblOSLabel.Text = LanguageManager.Strings.OperatingSystem; - this.lblTranslationBy.Text = String.Format(LanguageManager.Strings.XTranslationByX, LanguageManager.Strings.__Language__, LanguageManager.Strings.__Author__); + this.lblTranslationBy.Text = string.Format(LanguageManager.Strings.XTranslationByX, LanguageManager.Strings.__Language__, LanguageManager.Strings.__Author__); Updater.Updater.OnUpdateAvailable += OnUpdateAvailable; } @@ -91,12 +91,11 @@ private void Settings_Load(object sender, EventArgs e) this.LoadIconCache(); this.LoadBackups(); - this.lblInstalledVersion.Text = MacroDeck.VersionString; + this.lblInstalledVersion.Text = MacroDeck.Version.VersionString; this.lblWebsocketAPIVersion.Text = MacroDeck.ApiVersion.ToString(); this.lblPluginAPIVersion.Text = MacroDeck.PluginApiVersion.ToString(); - this.lblMacroDeck.Text = "Macro Deck " + MacroDeck.VersionString; + this.lblMacroDeck.Text = "Macro Deck " + MacroDeck.Version.VersionString; this.lblInstalledPlugins.Text = PluginManager.Plugins.Count.ToString(); - this.lblOS.Text = Utils.OperatingSystemInformation.GetWindowsVersionName(); this.verticalTabControl.SetNotification(2, Updater.Updater.UpdateAvailable); @@ -143,11 +142,8 @@ private void LoadIconCache() private void LoadUpdateChannel() { - this.checkInstallDevVersions.CheckedChanged -= CheckInstallDevVersions_CheckedChanged; this.checkInstallBetaVersions.CheckedChanged -= CheckInstallBetaVersions_CheckedChanged; - this.checkInstallDevVersions.Checked = MacroDeck.Configuration.UpdateDevVersions; this.checkInstallBetaVersions.Checked = MacroDeck.Configuration.UpdateBetaVersions; - this.checkInstallDevVersions.CheckedChanged += CheckInstallDevVersions_CheckedChanged; this.checkInstallBetaVersions.CheckedChanged += CheckInstallBetaVersions_CheckedChanged; } @@ -161,34 +157,6 @@ private void LoadBackups() } } - private void CheckInstallDevVersions_CheckedChanged(object sender, EventArgs e) - { - if (this.checkInstallDevVersions.Checked) - { - using (var msgBox = new CustomControls.MessageBox()) - { - if (msgBox.ShowDialog(LanguageManager.Strings.Warning, LanguageManager.Strings.WarningDevVersions, MessageBoxButtons.YesNo) == DialogResult.Yes) - { - this.updaterPanel.Controls.Clear(); - MacroDeck.Configuration.UpdateDevVersions = true; - MacroDeck.SaveConfiguration(); - Updater.Updater.CheckForUpdatesAsync(); - } - else - { - this.LoadUpdateChannel(); - } - } - } - else - { - this.updaterPanel.Controls.Clear(); - MacroDeck.Configuration.UpdateDevVersions = false; - MacroDeck.SaveConfiguration(); - Updater.Updater.CheckForUpdatesAsync(); - } - } - private void CheckInstallBetaVersions_CheckedChanged(object sender, EventArgs e) { if (this.checkInstallBetaVersions.Checked) @@ -426,5 +394,17 @@ private void BackupManager_DeleteSuccess(object sender, EventArgs e) { this.LoadBackups(); } + + private void BtnGitHub_Click(object sender, EventArgs e) + { + var p = new Process + { + StartInfo = new ProcessStartInfo("https://github.com/Macro-Deck-org/Macro-Deck") + { + UseShellExecute = true, + } + }; + p.Start(); + } } } diff --git a/GUI/MainWindowViews/SettingsView.resx b/GUI/MainWindowViews/SettingsView.resx index 573545c7..4f820ab2 100644 --- a/GUI/MainWindowViews/SettingsView.resx +++ b/GUI/MainWindowViews/SettingsView.resx @@ -70,7 +70,7 @@ The default port for Macro Deck is 8191. If some other application uses this por AAEAAAD/////AQAAAAAAAAAMAgAAAEZTeXN0ZW0uV2luZG93cy5Gb3JtcywgQ3VsdHVyZT1uZXV0cmFs LCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAmU3lzdGVtLldpbmRvd3MuRm9ybXMu SW1hZ2VMaXN0U3RyZWFtZXIBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAfg4AAAJNU0Z0AUkBTAIBAQUB - AAEYAQABGAEAATABAAEwAQAE/wEFAQAI/wFCAU0BdgcAAXYDAAEoAwABwAMAAWADAAEBAQABBAYAASQY + AAFAAQABQAEAATABAAEwAQAE/wEFAQAI/wFCAU0BdgcAAXYDAAEoAwABwAMAAWADAAEBAQABBAYAASQY AAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8B AAL/AgAD//8A/wD/AA0AAQ8C/10AAQ8D/1wAAQ8D/wHwWwABDwT/AfBaAAEPBf9aAAEPAv8B8AEPAf9a AAEPAv8B8FwAAQ8C/wHwXQAD/10AA/9dAAP/XQAD/10AAQ8C/wHwXAABDwL/AfBcAAEPAv8B8FoAAQ8B diff --git a/GUI/MainWindowViews/VariablesView.Designer.cs b/GUI/MainWindowViews/VariablesView.Designer.cs index eafa8270..8e1b8d4e 100644 --- a/GUI/MainWindowViews/VariablesView.Designer.cs +++ b/GUI/MainWindowViews/VariablesView.Designer.cs @@ -48,17 +48,17 @@ private void InitializeComponent() | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.variablesPanel.AutoScroll = true; - this.variablesPanel.Location = new System.Drawing.Point(0, 91); + this.variablesPanel.Location = new System.Drawing.Point(240, 53); this.variablesPanel.Name = "variablesPanel"; - this.variablesPanel.Size = new System.Drawing.Size(1137, 413); + this.variablesPanel.Size = new System.Drawing.Size(897, 451); this.variablesPanel.TabIndex = 11; // // lblCreator // this.lblCreator.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.lblCreator.Location = new System.Drawing.Point(806, 38); + this.lblCreator.Location = new System.Drawing.Point(860, 0); this.lblCreator.Name = "lblCreator"; - this.lblCreator.Size = new System.Drawing.Size(212, 50); + this.lblCreator.Size = new System.Drawing.Size(163, 50); this.lblCreator.TabIndex = 15; this.lblCreator.Text = "Creator"; this.lblCreator.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -67,7 +67,7 @@ private void InitializeComponent() // lblValue // this.lblValue.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.lblValue.Location = new System.Drawing.Point(542, 38); + this.lblValue.Location = new System.Drawing.Point(596, 0); this.lblValue.Name = "lblValue"; this.lblValue.Size = new System.Drawing.Size(258, 50); this.lblValue.TabIndex = 14; @@ -78,9 +78,9 @@ private void InitializeComponent() // lblType // this.lblType.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.lblType.Location = new System.Drawing.Point(361, 38); + this.lblType.Location = new System.Drawing.Point(476, 0); this.lblType.Name = "lblType"; - this.lblType.Size = new System.Drawing.Size(175, 50); + this.lblType.Size = new System.Drawing.Size(114, 50); this.lblType.TabIndex = 13; this.lblType.Text = "Type"; this.lblType.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -89,9 +89,9 @@ private void InitializeComponent() // lblName // this.lblName.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.lblName.Location = new System.Drawing.Point(1, 38); + this.lblName.Location = new System.Drawing.Point(247, 0); this.lblName.Name = "lblName"; - this.lblName.Size = new System.Drawing.Size(354, 50); + this.lblName.Size = new System.Drawing.Size(223, 50); this.lblName.TabIndex = 12; this.lblName.Text = "Name"; this.lblName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -100,7 +100,6 @@ private void InitializeComponent() // btnCreateVariable // this.btnCreateVariable.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnCreateVariable.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(123)))), ((int)(((byte)(255))))); this.btnCreateVariable.BorderRadius = 8; this.btnCreateVariable.Cursor = System.Windows.Forms.Cursors.Hand; this.btnCreateVariable.FlatAppearance.BorderSize = 0; @@ -118,21 +117,26 @@ private void InitializeComponent() this.btnCreateVariable.Text = "Create variable"; this.btnCreateVariable.UseMnemonic = false; this.btnCreateVariable.UseVisualStyleBackColor = false; + this.btnCreateVariable.UseWindowsAccentColor = true; this.btnCreateVariable.Click += new System.EventHandler(this.BtnCreateVariable_Click); // // creatorFilter // + this.creatorFilter.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); this.creatorFilter.AutoScroll = true; - this.creatorFilter.Dock = System.Windows.Forms.DockStyle.Top; - this.creatorFilter.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; - this.creatorFilter.Location = new System.Drawing.Point(0, 0); + this.creatorFilter.Location = new System.Drawing.Point(0, 53); this.creatorFilter.Name = "creatorFilter"; - this.creatorFilter.Size = new System.Drawing.Size(1137, 35); + this.creatorFilter.Size = new System.Drawing.Size(234, 451); this.creatorFilter.TabIndex = 17; // // VariablesView // +<<<<<<< HEAD + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); +======= +>>>>>>> origin/main this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(45)))), ((int)(((byte)(45))))); this.Controls.Add(this.creatorFilter); diff --git a/GUI/MainWindowViews/VariablesView.cs b/GUI/MainWindowViews/VariablesView.cs index ba3839d0..4188b9b7 100644 --- a/GUI/MainWindowViews/VariablesView.cs +++ b/GUI/MainWindowViews/VariablesView.cs @@ -1,11 +1,14 @@ using SuchByte.MacroDeck.GUI.CustomControls; using SuchByte.MacroDeck.GUI.Dialogs; +using SuchByte.MacroDeck.Logging; +using SuchByte.MacroDeck.Models; using SuchByte.MacroDeck.Variables; 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; @@ -20,7 +23,6 @@ public VariablesView() InitializeComponent(); this.Dock = DockStyle.Fill; this.UpdateTranslation(); - this.LoadCreators(); } public void UpdateTranslation() @@ -37,27 +39,28 @@ public void UpdateTranslation() private void LoadCreators() { - foreach (CheckBox checkBox in this.creatorFilter.Controls) - { - checkBox.CheckedChanged -= CreatorCheckBox_CheckedChanged; - } - this.creatorFilter.Controls.Clear(); List variableCreators = new List(); - foreach (Variable variable in VariableManager.Variables) + foreach (Variable variable in VariableManager.ListVariables) { if (!variableCreators.Contains(variable.Creator)) { variableCreators.Add(variable.Creator); } } + + var filterModel = VariableViewCreatorFilterModel.Deserialize(Properties.Settings.Default.VariableViewSelectedFilter); + foreach (string creator in variableCreators) { + if (this.creatorFilter.Controls.OfType().Where(x => x.Name.Equals(creator)).Count() > 0) + continue; + CheckBox creatorCheckBox = new CheckBox { - Checked = true, + Checked = !filterModel.HiddenCreators.Contains(creator), Text = creator, Name = creator, - AutoSize = true, - Padding = new Padding(10, 0, 10, 0), + AutoSize = false, + Size = new Size(creatorFilter.Width - 30, 20), }; this.creatorFilter.Controls.Add(creatorCheckBox); creatorCheckBox.CheckedChanged += CreatorCheckBox_CheckedChanged; @@ -66,85 +69,79 @@ private void LoadCreators() private void CreatorCheckBox_CheckedChanged(object sender, EventArgs e) { - this.SuspendLayout(); CheckBox checkBox = sender as CheckBox; + Parallel.ForEach(this.variablesPanel.Controls.OfType().Where(x => x.Variable.Creator == checkBox.Name).ToArray(), + variableItem => + { + if (this.IsDisposed) return; + this.Invoke(new Action(() => variableItem.Visible = checkBox.Checked)); + }); - foreach (VariableItem variableItem in this.variablesPanel.Controls) + var filterModel = new VariableViewCreatorFilterModel() { - if (variableItem.Variable.Creator.Equals(checkBox.Name)) - { - variableItem.Visible = checkBox.Checked; - } - } - this.ResumeLayout(); + HiddenCreators = (from creator in creatorFilter.Controls.OfType() + where !creator.Checked + select creator.Name).ToList() + }; + Properties.Settings.Default.VariableViewSelectedFilter = filterModel.Serialize(); + Properties.Settings.Default.Save(); } private void VariablesPage_Load(object sender, EventArgs e) { + LoadCreators(); LoadVariables(); VariableManager.OnVariableChanged += this.VariableChanged; VariableManager.OnVariableRemoved += this.VariableRemoved; } - private void VariableRemoved(object sender, EventArgs e) { - Task.Run(() => + private void VariableRemoved(object sender, EventArgs e) + { + if (this.InvokeRequired) { - this.Invoke(new Action(() => this.SuspendLayout())); - foreach (VariableItem variableItem in this.variablesPanel.Controls) - { - if (sender.Equals(variableItem.Variable.Name)) - { - this.Invoke(new Action(() => - { - this.variablesPanel.Controls.Remove(variableItem); - })); - return; - } - } - - this.Invoke(new Action(() => this.ResumeLayout())); - }); + this.Invoke(new Action(() => VariableRemoved(sender, e))); + return; + } + string variableName = sender as string; + var variableItemView = this.variablesPanel.Controls.OfType().Where(x => x.Variable.Name.Equals(variableName)).FirstOrDefault(); + if (variableItemView != null) + { + this.variablesPanel.Controls.Remove(variableItemView); + } } private void VariableChanged(object sender, EventArgs e) { + if (this.InvokeRequired) + { + this.Invoke(new Action(() => VariableChanged(sender, e))); + return; + } Variable variable = sender as Variable; - Task.Run(() => + if (this.IsDisposed) return; + var variableItemView = this.variablesPanel.Controls.OfType().Where(x => x.Variable.Name.Equals(variable.Name)).FirstOrDefault(); + if (variableItemView == null) { - if (this.IsDisposed) return; - this.Invoke(new Action(() => this.SuspendLayout())); - foreach (VariableItem variableItem in this.variablesPanel.Controls) - { - if (variable.Name.Equals(variableItem.Variable.Name)) - { - this.Invoke(new Action(() => - { - try - { - if (this == null || this.Disposing || this.IsDisposed) return; - variableItem.Variable = variable; - variableItem.Update(); - } catch { } - })); - return; - } - } VariableItem newVariableItem = new VariableItem(variable); - this.Invoke(new Action(() => - { - this.variablesPanel.Controls.Add(newVariableItem); - this.ResumeLayout(); - })); - - }); + this.variablesPanel.Controls.Add(newVariableItem); + this.LoadCreators(); + } else + { + variableItemView.Variable = variable; + variableItemView.Update(); + } } private void LoadVariables() { this.variablesPanel.Controls.Clear(); - foreach (Variable variable in VariableManager.Variables.ToArray()) + foreach (var variable in VariableManager.ListVariables) { - VariableItem variableItem = new VariableItem(variable); + if (this.IsDisposed) return; + VariableItem variableItem = new VariableItem(variable) + { + Visible = this.creatorFilter.Controls.OfType().Where(x => variable.Creator == x.Name).FirstOrDefault().Checked + }; this.variablesPanel.Controls.Add(variableItem); } } @@ -155,7 +152,7 @@ private void BtnCreateVariable_Click(object sender, EventArgs e) { if (variableDialog.ShowDialog() == DialogResult.OK) { - VariableManager.Variables.Add(variableDialog.Variable); + VariableManager.InsertVariable(variableDialog.Variable); } } } diff --git a/Icons/IconManager.cs b/Icons/IconManager.cs index ec8e8cab..60243214 100644 --- a/Icons/IconManager.cs +++ b/Icons/IconManager.cs @@ -25,7 +25,11 @@ public class IconManager public static event EventHandler InstallationFinished; public static Action OnUpdateCheckFinished { get; internal set; } +<<<<<<< HEAD + public static Action IconPacksLoaded { get; set; } +======= public static Action IconPacksLoaded { get; internal set; } +>>>>>>> origin/main public static void Initialize() { diff --git a/InternalPlugins/ActionButtonPlugin/ActionButtonPlugin.cs b/InternalPlugins/ActionButtonPlugin/ActionButtonPlugin.cs new file mode 100644 index 00000000..22347cc8 --- /dev/null +++ b/InternalPlugins/ActionButtonPlugin/ActionButtonPlugin.cs @@ -0,0 +1,24 @@ +using SuchByte.MacroDeck.InternalPlugins.ActionButtonPlugin.Actions; +using SuchByte.MacroDeck.Language; +using SuchByte.MacroDeck.Plugins; +using SuchByte.MacroDeck.Server; +using System.Collections.Generic; + +namespace SuchByte.MacroDeck.ActionButton // Don't change because of backwards compatibility! +{ + public class ActionButtonPlugin : MacroDeckPlugin + { + internal override string Name => LanguageManager.Strings.PluginActionButton; + internal override string Author => "Macro Deck"; + public override void Enable() + { + this.Actions = new List() + { + new ActionButtonToggleStateAction(), + new ActionButtonSetStateOffAction(), + new ActionButtonSetStateOnAction(), + new ActionButtonSetBackgroundColorAction(), + }; + } + } +} diff --git a/InternalPlugins/ActionButtonPlugin/Actions/ActionButtonSetBackgroundColorAction.cs b/InternalPlugins/ActionButtonPlugin/Actions/ActionButtonSetBackgroundColorAction.cs new file mode 100644 index 00000000..6dc6ddbe --- /dev/null +++ b/InternalPlugins/ActionButtonPlugin/Actions/ActionButtonSetBackgroundColorAction.cs @@ -0,0 +1,51 @@ +using SuchByte.MacroDeck.GUI; +using SuchByte.MacroDeck.GUI.CustomControls; +using SuchByte.MacroDeck.InternalPlugins.ActionButtonPlugin.Models; +using SuchByte.MacroDeck.InternalPlugins.ActionButtonPlugin.Views; +using SuchByte.MacroDeck.Language; +using SuchByte.MacroDeck.Plugins; +using SuchByte.MacroDeck.Profiles; +using SuchByte.MacroDeck.Server; +using System; +using System.Drawing; + +namespace SuchByte.MacroDeck.InternalPlugins.ActionButtonPlugin.Actions +{ + public class ActionButtonSetBackgroundColorAction : PluginAction + { + public override string Name => LanguageManager.Strings.ActionSetBackgroundColor; + public override string Description => LanguageManager.Strings.ActionSetBackgroundColorDescription; + public override bool CanConfigure => true; + + private Random random; + + public override void Trigger(string clientId, ActionButton.ActionButton actionButton) + { + var configModel = ActionButtonSetBackgroundColorActionConfigModel.Deserialize(this.Configuration); + Color color = Color.FromArgb(35,35,35); + switch (configModel.Method) + { + case Enums.SetBackgroundColorMethod.Fixed: + color = configModel.Color; + break; + case Enums.SetBackgroundColorMethod.Random: + if (random == null) random = new Random(); + color = Color.FromArgb(random.Next(256), random.Next(256), random.Next(256)); + break; + } + if (actionButton.State) + { + actionButton.BackColorOn = color; + } else + { + actionButton.BackColorOff = color; + } + ProfileManager.Save(); + } + + public override ActionConfigControl GetActionConfigControl(ActionConfigurator actionConfigurator) + { + return new ActionButtonSetBackgroundColorActionConfigView(this); + } + } +} diff --git a/InternalPlugins/ActionButtonPlugin/Actions/ActionButtonSetStateOffAction.cs b/InternalPlugins/ActionButtonPlugin/Actions/ActionButtonSetStateOffAction.cs new file mode 100644 index 00000000..63a97370 --- /dev/null +++ b/InternalPlugins/ActionButtonPlugin/Actions/ActionButtonSetStateOffAction.cs @@ -0,0 +1,20 @@ +using SuchByte.MacroDeck.Language; +using SuchByte.MacroDeck.Plugins; +using SuchByte.MacroDeck.Server; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SuchByte.MacroDeck.ActionButton // Don't change because of backwards compatibility! +{ + public class ActionButtonSetStateOffAction : PluginAction + { + public override string Name => LanguageManager.Strings.ActionSetActionButtonStateOff; + public override string Description => LanguageManager.Strings.ActionSetActionButtonStateOffDescription; + public override void Trigger(string clientId, ActionButton actionButton) + { + if (actionButton.State == false) return; + MacroDeckServer.SetState(actionButton, false); + } + } +} diff --git a/InternalPlugins/ActionButtonPlugin/Actions/ActionButtonSetStateOnAction.cs b/InternalPlugins/ActionButtonPlugin/Actions/ActionButtonSetStateOnAction.cs new file mode 100644 index 00000000..3d52ee27 --- /dev/null +++ b/InternalPlugins/ActionButtonPlugin/Actions/ActionButtonSetStateOnAction.cs @@ -0,0 +1,21 @@ +using SuchByte.MacroDeck.Language; +using SuchByte.MacroDeck.Plugins; +using SuchByte.MacroDeck.Server; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SuchByte.MacroDeck.ActionButton // Don't change because of backwards compatibility! +{ + public class ActionButtonSetStateOnAction : PluginAction + { + public override string Name => LanguageManager.Strings.ActionSetActionButtonStateOn; + public override string Description => LanguageManager.Strings.ActionSetActionButtonStateOnDescription; + public override bool CanConfigure => false; + public override void Trigger(string clientId, ActionButton actionButton) + { + if (actionButton.State == true) return; + MacroDeckServer.SetState(actionButton, true); + } + } +} diff --git a/InternalPlugins/ActionButtonPlugin/Actions/ActionButtonToggleStateAction.cs b/InternalPlugins/ActionButtonPlugin/Actions/ActionButtonToggleStateAction.cs new file mode 100644 index 00000000..4dc44a75 --- /dev/null +++ b/InternalPlugins/ActionButtonPlugin/Actions/ActionButtonToggleStateAction.cs @@ -0,0 +1,19 @@ +using SuchByte.MacroDeck.Language; +using SuchByte.MacroDeck.Plugins; +using SuchByte.MacroDeck.Server; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SuchByte.MacroDeck.ActionButton // Don't change because of backwards compatibility! +{ + public class ActionButtonToggleStateAction : PluginAction + { + public override string Name => LanguageManager.Strings.ActionToggleActionButtonState; + public override string Description => LanguageManager.Strings.ActionToggleActionButtonStateDescription; + public override void Trigger(string clientId, ActionButton actionButton) + { + MacroDeckServer.SetState(actionButton, !actionButton.State); + } + } +} diff --git a/ActionButton/Plugin/DelayAction.cs b/InternalPlugins/ActionButtonPlugin/Actions/DelayAction.cs similarity index 85% rename from ActionButton/Plugin/DelayAction.cs rename to InternalPlugins/ActionButtonPlugin/Actions/DelayAction.cs index 103024bc..647fb284 100644 --- a/ActionButton/Plugin/DelayAction.cs +++ b/InternalPlugins/ActionButtonPlugin/Actions/DelayAction.cs @@ -6,7 +6,7 @@ using System.Text; using System.Threading; -namespace SuchByte.MacroDeck.ActionButton.Plugin +namespace SuchByte.MacroDeck.ActionButton.Plugin // Don't change because of backwards compatibility! { public class DelayAction : PluginAction { diff --git a/InternalPlugins/ActionButtonPlugin/Enums/SetBackgroundColorMethod.cs b/InternalPlugins/ActionButtonPlugin/Enums/SetBackgroundColorMethod.cs new file mode 100644 index 00000000..6ed64637 --- /dev/null +++ b/InternalPlugins/ActionButtonPlugin/Enums/SetBackgroundColorMethod.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SuchByte.MacroDeck.InternalPlugins.ActionButtonPlugin.Enums +{ + public enum SetBackgroundColorMethod + { + Fixed, + Random + } +} diff --git a/InternalPlugins/ActionButtonPlugin/Models/ActionButtonSetBackgroundColorActionConfigModel.cs b/InternalPlugins/ActionButtonPlugin/Models/ActionButtonSetBackgroundColorActionConfigModel.cs new file mode 100644 index 00000000..57f77a18 --- /dev/null +++ b/InternalPlugins/ActionButtonPlugin/Models/ActionButtonSetBackgroundColorActionConfigModel.cs @@ -0,0 +1,39 @@ +using SuchByte.MacroDeck.InternalPlugins.ActionButtonPlugin.Enums; +using SuchByte.MacroDeck.Models; +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace SuchByte.MacroDeck.InternalPlugins.ActionButtonPlugin.Models +{ + public class ActionButtonSetBackgroundColorActionConfigModel : ISerializableConfiguration + { + public string ColorHex { get; set; } = "#232323"; + + [JsonIgnore] + public Color Color + { + get => (Color)new ColorConverter().ConvertFromString(this.ColorHex); + set + { + this.ColorHex = $"#{value.R:X2}{value.G:X2}{value.B:X2}"; + } + } + + public SetBackgroundColorMethod Method { get; set; } = SetBackgroundColorMethod.Fixed; + + + public string Serialize() + { + return JsonSerializer.Serialize(this); + } + + public static ActionButtonSetBackgroundColorActionConfigModel Deserialize(string config) + { + return ISerializableConfiguration.Deserialize(config); + } + } +} diff --git a/InternalPlugins/ActionButtonPlugin/ViewModels/ActionButtonSetBackgroundColorActionConfigViewModel.cs b/InternalPlugins/ActionButtonPlugin/ViewModels/ActionButtonSetBackgroundColorActionConfigViewModel.cs new file mode 100644 index 00000000..e2cd48ab --- /dev/null +++ b/InternalPlugins/ActionButtonPlugin/ViewModels/ActionButtonSetBackgroundColorActionConfigViewModel.cs @@ -0,0 +1,68 @@ +using SuchByte.MacroDeck.InternalPlugins.ActionButtonPlugin.Enums; +using SuchByte.MacroDeck.InternalPlugins.ActionButtonPlugin.Models; +using SuchByte.MacroDeck.Language; +using SuchByte.MacroDeck.Logging; +using SuchByte.MacroDeck.Models; +using SuchByte.MacroDeck.Plugins; +using SuchByte.MacroDeck.ViewModels; +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Text; +using System.Text.Json; + +namespace SuchByte.MacroDeck.InternalPlugins.ActionButtonPlugin.ViewModels +{ + public class ActionButtonSetBackgroundColorActionConfigViewModel : ISerializableConfigViewModel + { + private readonly PluginAction _pluginAction; + + public ActionButtonSetBackgroundColorActionConfigModel Configuration { get; set; } + + ISerializableConfiguration ISerializableConfigViewModel.SerializableConfiguration => Configuration; + + public Color Color + { + get => Configuration.Color; + set => Configuration.Color = value; + } + + public SetBackgroundColorMethod Method + { + get => Configuration.Method; + set => Configuration.Method = value; + } + + + public ActionButtonSetBackgroundColorActionConfigViewModel(PluginAction pluginAction) + { + this._pluginAction = pluginAction; + this.Configuration = ActionButtonSetBackgroundColorActionConfigModel.Deserialize(pluginAction.Configuration); + } + + public bool SaveConfig() + { + try + { + SetConfig(); + MacroDeckLogger.Info(typeof(ActionButtonSetBackgroundColorActionConfigViewModel), "config saved"); + } + catch (Exception ex) + { + MacroDeckLogger.Error(typeof(ActionButtonSetBackgroundColorActionConfigViewModel), $"Error while saving config: { ex.Message + Environment.NewLine + ex.StackTrace }"); + } + return true; + } + + public void SetConfig() + { + this._pluginAction.ConfigurationSummary = this.Method switch + { + SetBackgroundColorMethod.Fixed => $"#{this.Color.R:X2}{this.Color.G:X2}{this.Color.B:X2}", + SetBackgroundColorMethod.Random => LanguageManager.Strings.Random, + _ => "", + }; + this._pluginAction.Configuration = Configuration.Serialize(); + } + } +} diff --git a/InternalPlugins/ActionButtonPlugin/Views/ActionButtonSetBackgroundColorActionConfigView.Designer.cs b/InternalPlugins/ActionButtonPlugin/Views/ActionButtonSetBackgroundColorActionConfigView.Designer.cs new file mode 100644 index 00000000..b4c9c32f --- /dev/null +++ b/InternalPlugins/ActionButtonPlugin/Views/ActionButtonSetBackgroundColorActionConfigView.Designer.cs @@ -0,0 +1,102 @@ + +namespace SuchByte.MacroDeck.InternalPlugins.ActionButtonPlugin.Views +{ + partial class ActionButtonSetBackgroundColorActionConfigView + { + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Komponenten-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + this.btnChangeColor = new SuchByte.MacroDeck.GUI.CustomControls.RoundedButton(); + this.radioFixed = new SuchByte.MacroDeck.GUI.CustomControls.TabRadioButton(); + this.radioRandom = new SuchByte.MacroDeck.GUI.CustomControls.TabRadioButton(); + ((System.ComponentModel.ISupportInitialize)(this.btnChangeColor)).BeginInit(); + this.SuspendLayout(); + // + // btnChangeColor + // + this.btnChangeColor.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(35)))), ((int)(((byte)(35)))), ((int)(((byte)(35))))); + this.btnChangeColor.BackgroundImage = global::SuchByte.MacroDeck.Properties.Resources.Palette; + this.btnChangeColor.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; + this.btnChangeColor.Column = 0; + this.btnChangeColor.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnChangeColor.ForegroundImage = null; + this.btnChangeColor.Location = new System.Drawing.Point(378, 191); + this.btnChangeColor.Name = "btnChangeColor"; + this.btnChangeColor.Radius = 40; + this.btnChangeColor.Row = 0; + this.btnChangeColor.ShowGIFIndicator = false; + this.btnChangeColor.ShowKeyboardHotkeyIndicator = false; + this.btnChangeColor.Size = new System.Drawing.Size(100, 100); + this.btnChangeColor.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.btnChangeColor.TabIndex = 0; + this.btnChangeColor.TabStop = false; + this.btnChangeColor.Click += new System.EventHandler(this.BtnChangeColor_Click); + // + // radioFixed + // + this.radioFixed.Checked = true; + this.radioFixed.Cursor = System.Windows.Forms.Cursors.Hand; + this.radioFixed.Location = new System.Drawing.Point(258, 134); + this.radioFixed.Name = "radioFixed"; + this.radioFixed.Size = new System.Drawing.Size(167, 30); + this.radioFixed.TabIndex = 1; + this.radioFixed.TabStop = true; + this.radioFixed.Text = "Fixed"; + this.radioFixed.UseVisualStyleBackColor = true; + this.radioFixed.CheckedChanged += new System.EventHandler(this.RadioFixed_CheckedChanged); + // + // radioRandom + // + this.radioRandom.Cursor = System.Windows.Forms.Cursors.Hand; + this.radioRandom.Location = new System.Drawing.Point(431, 134); + this.radioRandom.Name = "radioRandom"; + this.radioRandom.Size = new System.Drawing.Size(167, 30); + this.radioRandom.TabIndex = 2; + this.radioRandom.Text = "Random"; + this.radioRandom.UseVisualStyleBackColor = true; + this.radioRandom.CheckedChanged += new System.EventHandler(this.RadioRandom_CheckedChanged); + // + // ActionButtonSetBackgroundColorActionConfigView + // + this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 23F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.radioRandom); + this.Controls.Add(this.radioFixed); + this.Controls.Add(this.btnChangeColor); + this.Name = "ActionButtonSetBackgroundColorActionConfigView"; + this.Load += new System.EventHandler(this.ActionButtonSetBackgroundColorActionConfigView_Load); + ((System.ComponentModel.ISupportInitialize)(this.btnChangeColor)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private GUI.CustomControls.RoundedButton btnChangeColor; + private GUI.CustomControls.TabRadioButton radioFixed; + private GUI.CustomControls.TabRadioButton radioRandom; + } +} diff --git a/InternalPlugins/ActionButtonPlugin/Views/ActionButtonSetBackgroundColorActionConfigView.cs b/InternalPlugins/ActionButtonPlugin/Views/ActionButtonSetBackgroundColorActionConfigView.cs new file mode 100644 index 00000000..45941b5e --- /dev/null +++ b/InternalPlugins/ActionButtonPlugin/Views/ActionButtonSetBackgroundColorActionConfigView.cs @@ -0,0 +1,80 @@ +using SuchByte.MacroDeck.GUI.CustomControls; +using SuchByte.MacroDeck.InternalPlugins.ActionButtonPlugin.ViewModels; +using SuchByte.MacroDeck.Language; +using SuchByte.MacroDeck.Plugins; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace SuchByte.MacroDeck.InternalPlugins.ActionButtonPlugin.Views +{ + public partial class ActionButtonSetBackgroundColorActionConfigView : ActionConfigControl + { + private readonly ActionButtonSetBackgroundColorActionConfigViewModel _viewModel; + + public ActionButtonSetBackgroundColorActionConfigView(PluginAction pluginAction) + { + this._viewModel = new ActionButtonSetBackgroundColorActionConfigViewModel(pluginAction); + InitializeComponent(); + this.radioFixed.Text = LanguageManager.Strings.Fixed; + this.radioRandom.Text = LanguageManager.Strings.Random; + } + + private void ActionButtonSetBackgroundColorActionConfigView_Load(object sender, EventArgs e) + { + this.btnChangeColor.BackColor = this._viewModel.Color; + switch (this._viewModel.Method) + { + case Enums.SetBackgroundColorMethod.Fixed: + this.radioFixed.Checked = true; + break; + case Enums.SetBackgroundColorMethod.Random: + this.radioRandom.Checked = true; + break; + } + } + + public override bool OnActionSave() + { + this._viewModel.Color = this.btnChangeColor.BackColor; + if (this.radioFixed.Checked) + { + this._viewModel.Method = Enums.SetBackgroundColorMethod.Fixed; + } else if (this.radioRandom.Checked) + { + this._viewModel.Method = Enums.SetBackgroundColorMethod.Random; + } + return this._viewModel.SaveConfig(); + } + + private void BtnChangeColor_Click(object sender, EventArgs e) + { + using (var colorDialog = new ColorDialog() + { + Color = this.btnChangeColor.BackColor, + FullOpen = true, + CustomColors = new int[] { ColorTranslator.ToOle(Color.FromArgb(35,35,35)) } + }) + { + if (colorDialog.ShowDialog() == DialogResult.OK) + { + this.btnChangeColor.BackColor = colorDialog.Color; + } + } + } + + private void RadioRandom_CheckedChanged(object sender, EventArgs e) + { + + } + + private void RadioFixed_CheckedChanged(object sender, EventArgs e) + { + this.btnChangeColor.Visible = this.radioFixed.Checked; + } + } +} diff --git a/InternalPlugins/ActionButtonPlugin/Views/ActionButtonSetBackgroundColorActionConfigView.resx b/InternalPlugins/ActionButtonPlugin/Views/ActionButtonSetBackgroundColorActionConfigView.resx new file mode 100644 index 00000000..f298a7be --- /dev/null +++ b/InternalPlugins/ActionButtonPlugin/Views/ActionButtonSetBackgroundColorActionConfigView.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/InternalPlugins/DevicePlugin/Actions/SetBrightnessAction.cs b/InternalPlugins/DevicePlugin/Actions/SetBrightnessAction.cs new file mode 100644 index 00000000..d3ff4998 --- /dev/null +++ b/InternalPlugins/DevicePlugin/Actions/SetBrightnessAction.cs @@ -0,0 +1,52 @@ +using SuchByte.MacroDeck.Device; +using SuchByte.MacroDeck.GUI; +using SuchByte.MacroDeck.GUI.CustomControls; +using SuchByte.MacroDeck.InternalPlugins.DevicePlugin.Models; +using SuchByte.MacroDeck.InternalPlugins.DevicePlugin.Views; +using SuchByte.MacroDeck.Language; +using SuchByte.MacroDeck.Plugins; +using SuchByte.MacroDeck.Server; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SuchByte.MacroDeck.InternalPlugins.DevicePlugin.Actions +{ + public class SetBrightnessAction : PluginAction + { + public override string Name => LanguageManager.Strings.ActionSetBrightness; + + public override string Description => LanguageManager.Strings.ActionSetBrightnessDescription; + + public override bool CanConfigure => true; + + public override void Trigger(string clientId, ActionButton.ActionButton actionButton) + { + var configModel = SetBrightnessActionConfigModel.Deserialize(this.Configuration); + if (clientId == "" || clientId == "-1") return; + MacroDeckDevice macroDeckDevice; + if (string.IsNullOrWhiteSpace(configModel.ClientId)) + { + macroDeckDevice = DeviceManager.GetMacroDeckDevice(clientId); + } + else + { + macroDeckDevice = DeviceManager.GetMacroDeckDevice(configModel.ClientId); + } + if (macroDeckDevice == null || !macroDeckDevice.Available || (macroDeckDevice.DeviceType != DeviceType.Android && macroDeckDevice.DeviceType != DeviceType.iOS)) return; + macroDeckDevice.Configuration.Brightness = configModel.Brightness; + + DeviceManager.SaveKnownDevices(); + MacroDeckClient macroDeckClient = MacroDeckServer.GetMacroDeckClient(macroDeckDevice.ClientId); + if (macroDeckClient != null) + { + macroDeckClient.DeviceMessage.SendConfiguration(macroDeckClient); + } + } + + public override ActionConfigControl GetActionConfigControl(ActionConfigurator actionConfigurator) + { + return new SetBrightnessActionConfigView(this); + } + } +} diff --git a/InternalPlugins/DevicePlugin/Actions/SetProfileAction.cs b/InternalPlugins/DevicePlugin/Actions/SetProfileAction.cs new file mode 100644 index 00000000..9666d793 --- /dev/null +++ b/InternalPlugins/DevicePlugin/Actions/SetProfileAction.cs @@ -0,0 +1,60 @@ +using SuchByte.MacroDeck.Device; +using SuchByte.MacroDeck.GUI; +using SuchByte.MacroDeck.GUI.CustomControls; +using SuchByte.MacroDeck.InternalPlugins.DevicePlugin.Models; +using SuchByte.MacroDeck.InternalPlugins.DevicePlugin.Views; +using SuchByte.MacroDeck.Language; +using SuchByte.MacroDeck.Plugins; +using SuchByte.MacroDeck.Profiles; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SuchByte.MacroDeck.InternalPlugins.DevicePlugin.Actions +{ + public class SetProfileAction : PluginAction + { + public override string Name => LanguageManager.Strings.ActionSetProfile; + + public override string Description => LanguageManager.Strings.ActionSetProfileDescription; + + public override bool CanConfigure => true; + + public override void Trigger(string clientId, ActionButton.ActionButton actionButton) + { + var configModel = SetProfileActionConfigModel.Deserialize(this.Configuration); + + MacroDeckProfile profile = ProfileManager.FindProfileById(configModel.ProfileId); + switch (clientId) + { + // ClientID -1 or "" = Macro Deck software itself + case "": + case "-1": + if (MacroDeck.MainWindow != null && MacroDeck.MainWindow.DeckView != null) + { + MacroDeck.MainWindow.DeckView.SetProfile(profile); + } + break; + // ClientId != -1 = Connected device + default: + MacroDeckDevice macroDeckDevice; + if (string.IsNullOrWhiteSpace(configModel.ClientId)) + { + macroDeckDevice = DeviceManager.GetMacroDeckDevice(clientId); + } + else + { + macroDeckDevice = DeviceManager.GetMacroDeckDevice(configModel.ClientId); + } + if (macroDeckDevice == null || profile == null) return; + DeviceManager.SetProfile(macroDeckDevice, profile); + break; + } + } + + public override ActionConfigControl GetActionConfigControl(ActionConfigurator actionConfigurator) + { + return new SetProfileActionConfigView(this); + } + } +} diff --git a/InternalPlugins/DevicePlugin/DevicePlugin.cs b/InternalPlugins/DevicePlugin/DevicePlugin.cs new file mode 100644 index 00000000..09262dc4 --- /dev/null +++ b/InternalPlugins/DevicePlugin/DevicePlugin.cs @@ -0,0 +1,26 @@ +using SuchByte.MacroDeck.InternalPlugins.DevicePlugin.Actions; +using SuchByte.MacroDeck.Plugins; +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Text; + +namespace SuchByte.MacroDeck.InternalPlugins.DevicePlugin +{ + public class DevicePlugin : MacroDeckPlugin + { + internal override string Name => "Device"; + internal override string Author => "Macro Deck"; + + internal override Image PluginIcon => Properties.Resources.device_manager; + + public override void Enable() + { + this.Actions = new List() + { + new SetProfileAction(), + new SetBrightnessAction() + }; + } + } +} diff --git a/InternalPlugins/DevicePlugin/Models/SetBrightnessActionConfigModel.cs b/InternalPlugins/DevicePlugin/Models/SetBrightnessActionConfigModel.cs new file mode 100644 index 00000000..b7ae2726 --- /dev/null +++ b/InternalPlugins/DevicePlugin/Models/SetBrightnessActionConfigModel.cs @@ -0,0 +1,25 @@ +using SuchByte.MacroDeck.Models; +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; + +namespace SuchByte.MacroDeck.InternalPlugins.DevicePlugin.Models +{ + public class SetBrightnessActionConfigModel : ISerializableConfiguration + { + + public string ClientId { get; set; } + + public float Brightness { get; set; } = 0.3f; + + public string Serialize() + { + return JsonSerializer.Serialize(this); + } + public static SetBrightnessActionConfigModel Deserialize(string config) + { + return ISerializableConfiguration.Deserialize(config); + } + } +} diff --git a/InternalPlugins/DevicePlugin/Models/SetProfileActionConfigModel.cs b/InternalPlugins/DevicePlugin/Models/SetProfileActionConfigModel.cs new file mode 100644 index 00000000..ae7dc292 --- /dev/null +++ b/InternalPlugins/DevicePlugin/Models/SetProfileActionConfigModel.cs @@ -0,0 +1,25 @@ +using SuchByte.MacroDeck.Models; +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; + +namespace SuchByte.MacroDeck.InternalPlugins.DevicePlugin.Models +{ + public class SetProfileActionConfigModel : ISerializableConfiguration + { + + public string ClientId { get; set; } + + public string ProfileId { get; set; } + + public string Serialize() + { + return JsonSerializer.Serialize(this); + } + public static SetProfileActionConfigModel Deserialize(string config) + { + return ISerializableConfiguration.Deserialize(config); + } + } +} diff --git a/InternalPlugins/DevicePlugin/ViewModels/SetBrightnessActionConfigViewModel.cs b/InternalPlugins/DevicePlugin/ViewModels/SetBrightnessActionConfigViewModel.cs new file mode 100644 index 00000000..824b023a --- /dev/null +++ b/InternalPlugins/DevicePlugin/ViewModels/SetBrightnessActionConfigViewModel.cs @@ -0,0 +1,63 @@ +using SuchByte.MacroDeck.Device; +using SuchByte.MacroDeck.InternalPlugins.DevicePlugin.Models; +using SuchByte.MacroDeck.Language; +using SuchByte.MacroDeck.Logging; +using SuchByte.MacroDeck.Models; +using SuchByte.MacroDeck.Plugins; +using SuchByte.MacroDeck.Profiles; +using SuchByte.MacroDeck.ViewModels; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SuchByte.MacroDeck.InternalPlugins.DevicePlugin.ViewModels +{ + public class SetBrightnessActionConfigViewModel : ISerializableConfigViewModel + { + private readonly PluginAction _action; + + public SetBrightnessActionConfigModel Configuration { get; set; } + + ISerializableConfiguration ISerializableConfigViewModel.SerializableConfiguration => Configuration; + + public string ClientId + { + get => this.Configuration.ClientId; + set => this.Configuration.ClientId = value; + } + + public float Brightness + { + get => this.Configuration.Brightness; + set => this.Configuration.Brightness = value; + } + + public SetBrightnessActionConfigViewModel(PluginAction action) + { + this.Configuration = SetBrightnessActionConfigModel.Deserialize(action.Configuration); + this._action = action; + } + + public bool SaveConfig() + { + try + { + SetConfig(); + MacroDeckLogger.Info($"{GetType().Name}: config saved"); + } + catch (Exception ex) + { + MacroDeckLogger.Error( $"{GetType().Name}: Error while saving config: { ex.Message + Environment.NewLine + ex.StackTrace }"); + return false; + } + return true; + } + + public void SetConfig() + { + _action.ConfigurationSummary = $"{(string.IsNullOrWhiteSpace(ClientId) ? LanguageManager.Strings.WhereExecuted : DeviceManager.GetKnownDevices().Find(x => x.ClientId.Equals(ClientId)).DisplayName)} -> {Math.Round(Brightness * 100)}%"; + _action.Configuration = Configuration.Serialize(); + } + + } +} diff --git a/InternalPlugins/DevicePlugin/ViewModels/SetProfileActionConfigViewModel.cs b/InternalPlugins/DevicePlugin/ViewModels/SetProfileActionConfigViewModel.cs new file mode 100644 index 00000000..ebc38ccb --- /dev/null +++ b/InternalPlugins/DevicePlugin/ViewModels/SetProfileActionConfigViewModel.cs @@ -0,0 +1,63 @@ +using SuchByte.MacroDeck.Device; +using SuchByte.MacroDeck.InternalPlugins.DevicePlugin.Models; +using SuchByte.MacroDeck.Language; +using SuchByte.MacroDeck.Logging; +using SuchByte.MacroDeck.Models; +using SuchByte.MacroDeck.Plugins; +using SuchByte.MacroDeck.Profiles; +using SuchByte.MacroDeck.ViewModels; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SuchByte.MacroDeck.InternalPlugins.DevicePlugin.ViewModels +{ + public class SetProfileActionConfigViewModel : ISerializableConfigViewModel + { + private readonly PluginAction _action; + + public SetProfileActionConfigModel Configuration { get; set; } + + ISerializableConfiguration ISerializableConfigViewModel.SerializableConfiguration => Configuration; + + public string ClientId + { + get => this.Configuration.ClientId; + set => this.Configuration.ClientId = value; + } + + public string ProfileId + { + get => this.Configuration.ProfileId; + set => this.Configuration.ProfileId = value; + } + + public SetProfileActionConfigViewModel(PluginAction action) + { + this.Configuration = SetProfileActionConfigModel.Deserialize(action.Configuration); + this._action = action; + } + + public bool SaveConfig() + { + try + { + SetConfig(); + MacroDeckLogger.Info($"{GetType().Name}: config saved"); + } + catch (Exception ex) + { + MacroDeckLogger.Error( $"{GetType().Name}: Error while saving config: { ex.Message + Environment.NewLine + ex.StackTrace }"); + return false; + } + return true; + } + + public void SetConfig() + { + _action.ConfigurationSummary = $"{(string.IsNullOrWhiteSpace(ClientId) ? LanguageManager.Strings.WhereExecuted : DeviceManager.GetKnownDevices().Find(x => x.ClientId.Equals(ClientId)).DisplayName)} -> {ProfileManager.FindProfileById(ProfileId).DisplayName}"; + _action.Configuration = Configuration.Serialize(); + } + + } +} diff --git a/InternalPlugins/DevicePlugin/Views/SetBrightnessActionConfigView.Designer.cs b/InternalPlugins/DevicePlugin/Views/SetBrightnessActionConfigView.Designer.cs new file mode 100644 index 00000000..673db253 --- /dev/null +++ b/InternalPlugins/DevicePlugin/Views/SetBrightnessActionConfigView.Designer.cs @@ -0,0 +1,141 @@ + +namespace SuchByte.MacroDeck.InternalPlugins.DevicePlugin.Views +{ + partial class SetBrightnessActionConfigView + { + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Komponenten-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + this.radioFixedDevice = new System.Windows.Forms.RadioButton(); + this.radioCurrentDevice = new System.Windows.Forms.RadioButton(); + this.lblBrightness = new System.Windows.Forms.Label(); + this.lblDevice = new System.Windows.Forms.Label(); + this.devicesList = new SuchByte.MacroDeck.GUI.CustomControls.RoundedComboBox(); + this.brightness = new System.Windows.Forms.TrackBar(); + ((System.ComponentModel.ISupportInitialize)(this.brightness)).BeginInit(); + this.SuspendLayout(); + // + // radioFixedDevice + // + this.radioFixedDevice.AutoSize = true; + this.radioFixedDevice.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.radioFixedDevice.Location = new System.Drawing.Point(484, 185); + this.radioFixedDevice.Name = "radioFixedDevice"; + this.radioFixedDevice.Size = new System.Drawing.Size(14, 13); + this.radioFixedDevice.TabIndex = 11; + this.radioFixedDevice.UseVisualStyleBackColor = true; + // + // radioCurrentDevice + // + this.radioCurrentDevice.Checked = true; + this.radioCurrentDevice.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.radioCurrentDevice.Location = new System.Drawing.Point(271, 176); + this.radioCurrentDevice.Name = "radioCurrentDevice"; + this.radioCurrentDevice.Size = new System.Drawing.Size(207, 30); + this.radioCurrentDevice.TabIndex = 10; + this.radioCurrentDevice.TabStop = true; + this.radioCurrentDevice.Text = "Where executed"; + this.radioCurrentDevice.UseVisualStyleBackColor = true; + // + // lblBrightness + // + this.lblBrightness.Anchor = System.Windows.Forms.AnchorStyles.None; + this.lblBrightness.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lblBrightness.Location = new System.Drawing.Point(153, 218); + this.lblBrightness.Name = "lblBrightness"; + this.lblBrightness.Size = new System.Drawing.Size(112, 30); + this.lblBrightness.TabIndex = 9; + this.lblBrightness.Text = "Brightness"; + this.lblBrightness.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // lblDevice + // + this.lblDevice.Anchor = System.Windows.Forms.AnchorStyles.None; + this.lblDevice.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lblDevice.Location = new System.Drawing.Point(153, 176); + this.lblDevice.Name = "lblDevice"; + this.lblDevice.Size = new System.Drawing.Size(112, 30); + this.lblDevice.TabIndex = 8; + this.lblDevice.Text = "Device"; + this.lblDevice.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // devicesList + // + this.devicesList.Anchor = System.Windows.Forms.AnchorStyles.None; + this.devicesList.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(65)))), ((int)(((byte)(65))))); + this.devicesList.Cursor = System.Windows.Forms.Cursors.Hand; + this.devicesList.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.devicesList.Enabled = false; + this.devicesList.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.devicesList.Icon = null; + this.devicesList.Location = new System.Drawing.Point(504, 176); + this.devicesList.Name = "devicesList"; + this.devicesList.Padding = new System.Windows.Forms.Padding(8, 2, 8, 2); + this.devicesList.SelectedIndex = -1; + this.devicesList.SelectedItem = null; + this.devicesList.Size = new System.Drawing.Size(199, 30); + this.devicesList.TabIndex = 6; + this.devicesList.SelectedIndexChanged += new System.EventHandler(this.DevicesList_SelectedIndexChanged); + // + // brightness + // + this.brightness.Location = new System.Drawing.Point(271, 225); + this.brightness.Minimum = 1; + this.brightness.Name = "brightness"; + this.brightness.Size = new System.Drawing.Size(188, 45); + this.brightness.TabIndex = 12; + this.brightness.TickStyle = System.Windows.Forms.TickStyle.None; + this.brightness.Value = 10; + this.brightness.Scroll += new System.EventHandler(this.Brightness_Scroll); + // + // SetBrightnessActionConfigView + // + this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 23F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.brightness); + this.Controls.Add(this.radioFixedDevice); + this.Controls.Add(this.radioCurrentDevice); + this.Controls.Add(this.lblBrightness); + this.Controls.Add(this.lblDevice); + this.Controls.Add(this.devicesList); + this.Name = "SetBrightnessActionConfigView"; + this.Load += new System.EventHandler(this.SetBrightnessActionConfigView_Load); + ((System.ComponentModel.ISupportInitialize)(this.brightness)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.RadioButton radioFixedDevice; + private System.Windows.Forms.RadioButton radioCurrentDevice; + private System.Windows.Forms.Label lblBrightness; + private System.Windows.Forms.Label lblDevice; + private GUI.CustomControls.RoundedComboBox devicesList; + private System.Windows.Forms.TrackBar brightness; + } +} diff --git a/InternalPlugins/DevicePlugin/Views/SetBrightnessActionConfigView.cs b/InternalPlugins/DevicePlugin/Views/SetBrightnessActionConfigView.cs new file mode 100644 index 00000000..1f0f6edb --- /dev/null +++ b/InternalPlugins/DevicePlugin/Views/SetBrightnessActionConfigView.cs @@ -0,0 +1,105 @@ +using SuchByte.MacroDeck.Device; +using SuchByte.MacroDeck.GUI.CustomControls; +using SuchByte.MacroDeck.InternalPlugins.DevicePlugin.ViewModels; +using SuchByte.MacroDeck.Plugins; +using SuchByte.MacroDeck.Server; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace SuchByte.MacroDeck.InternalPlugins.DevicePlugin.Views +{ + public partial class SetBrightnessActionConfigView : ActionConfigControl + { + private readonly SetBrightnessActionConfigViewModel _viewModel; + + + public SetBrightnessActionConfigView(PluginAction action) + { + InitializeComponent(); + this._viewModel = new SetBrightnessActionConfigViewModel(action); + } + + private void SetBrightnessActionConfigView_Load(object sender, EventArgs e) + { + this.LoadKnownDevices(); + this.LoadCurrentConfiguration(); + } + + private void LoadCurrentConfiguration() + { + try + { + if (string.IsNullOrWhiteSpace(this._viewModel.ClientId)) + { + this.radioCurrentDevice.Checked = true; + } + else + { + this.radioFixedDevice.Checked = true; + var macroDeckDevice = DeviceManager.GetKnownDevices().Find(x => x.ClientId.Equals(this._viewModel.ClientId)); + if (macroDeckDevice != null) + { + this.devicesList.Text = macroDeckDevice.DisplayName ?? ""; + } + } + this.brightness.Value = (int)(this._viewModel.Brightness * 10.0); + } + catch { } + } + + private void LoadKnownDevices() + { + foreach (MacroDeckDevice macroDeckDevice in DeviceManager.GetKnownDevices().FindAll(x => x.DeviceType == DeviceType.Android || x.DeviceType == DeviceType.iOS).ToArray()) + { + this.devicesList.Items.Add(macroDeckDevice.DisplayName); + } + } + public override bool OnActionSave() + { + if (this.radioCurrentDevice.Checked) + { + this._viewModel.ClientId = ""; + } + else + { + var macroDeckDevice = DeviceManager.GetKnownDevices().Find(x => x.DisplayName.Equals(this.devicesList.Text)); + if (macroDeckDevice != null) + { + this._viewModel.ClientId = macroDeckDevice.ClientId ?? ""; + } + } + + this._viewModel.Brightness = this.brightness.Value / 10.0f; + if (this.radioFixedDevice.Checked && string.IsNullOrWhiteSpace(this._viewModel.ClientId)) return false; + + return this._viewModel.SaveConfig(); + } + + private void DevicesList_SelectedIndexChanged(object sender, EventArgs e) + { + var macroDeckDevice = DeviceManager.GetKnownDevices().Find(x => x.DisplayName.Equals(this.devicesList.Text)); + if (macroDeckDevice == null) return; + var configuration = macroDeckDevice.Configuration; + if (configuration == null) return; + this.brightness.Value = (int)(configuration.Brightness * 10.0); + } + + private void Brightness_Scroll(object sender, EventArgs e) + { + if (!this.radioFixedDevice.Checked) return; + var macroDeckDevice = DeviceManager.GetKnownDevices().Find(x => x.DisplayName.Equals(this.devicesList.Text)); + if (macroDeckDevice == null || !macroDeckDevice.Available) return; + macroDeckDevice.Configuration.Brightness = this.brightness.Value / 10.0f; + MacroDeckClient macroDeckClient = MacroDeckServer.GetMacroDeckClient(macroDeckDevice.ClientId); + if (macroDeckClient != null) + { + macroDeckClient.DeviceMessage.SendConfiguration(macroDeckClient); + } + } + } +} diff --git a/InternalPlugins/DevicePlugin/Views/SetBrightnessActionConfigView.resx b/InternalPlugins/DevicePlugin/Views/SetBrightnessActionConfigView.resx new file mode 100644 index 00000000..f298a7be --- /dev/null +++ b/InternalPlugins/DevicePlugin/Views/SetBrightnessActionConfigView.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/InternalPlugins/DevicePlugin/Views/SetProfileActionConfigView.Designer.cs b/InternalPlugins/DevicePlugin/Views/SetProfileActionConfigView.Designer.cs new file mode 100644 index 00000000..9ef8de87 --- /dev/null +++ b/InternalPlugins/DevicePlugin/Views/SetProfileActionConfigView.Designer.cs @@ -0,0 +1,143 @@ +namespace SuchByte.MacroDeck.InternalPlugins.DevicePlugin.Views +{ + partial class SetProfileActionConfigView + { + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Komponenten-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + this.devicesList = new SuchByte.MacroDeck.GUI.CustomControls.RoundedComboBox(); + this.profilesList = new SuchByte.MacroDeck.GUI.CustomControls.RoundedComboBox(); + this.lblDevice = new System.Windows.Forms.Label(); + this.lblProfile = new System.Windows.Forms.Label(); + this.radioCurrentDevice = new System.Windows.Forms.RadioButton(); + this.radioFixedDevice = new System.Windows.Forms.RadioButton(); + this.SuspendLayout(); + // + // devicesList + // + this.devicesList.Anchor = System.Windows.Forms.AnchorStyles.None; + this.devicesList.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(65)))), ((int)(((byte)(65))))); + this.devicesList.Cursor = System.Windows.Forms.Cursors.Hand; + this.devicesList.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.devicesList.Enabled = false; + this.devicesList.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.devicesList.Icon = null; + this.devicesList.Location = new System.Drawing.Point(504, 176); + this.devicesList.Name = "devicesList"; + this.devicesList.Padding = new System.Windows.Forms.Padding(8, 2, 8, 2); + this.devicesList.SelectedIndex = -1; + this.devicesList.SelectedItem = null; + this.devicesList.Size = new System.Drawing.Size(199, 30); + this.devicesList.TabIndex = 0; + // + // profilesList + // + this.profilesList.Anchor = System.Windows.Forms.AnchorStyles.None; + this.profilesList.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(65)))), ((int)(((byte)(65))))); + this.profilesList.Cursor = System.Windows.Forms.Cursors.Hand; + this.profilesList.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.profilesList.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.profilesList.Icon = null; + this.profilesList.Location = new System.Drawing.Point(271, 218); + this.profilesList.Name = "profilesList"; + this.profilesList.Padding = new System.Windows.Forms.Padding(8, 2, 8, 2); + this.profilesList.SelectedIndex = -1; + this.profilesList.SelectedItem = null; + this.profilesList.Size = new System.Drawing.Size(432, 30); + this.profilesList.TabIndex = 1; + // + // lblDevice + // + this.lblDevice.Anchor = System.Windows.Forms.AnchorStyles.None; + this.lblDevice.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lblDevice.Location = new System.Drawing.Point(153, 176); + this.lblDevice.Name = "lblDevice"; + this.lblDevice.Size = new System.Drawing.Size(112, 30); + this.lblDevice.TabIndex = 2; + this.lblDevice.Text = "Device"; + this.lblDevice.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // lblProfile + // + this.lblProfile.Anchor = System.Windows.Forms.AnchorStyles.None; + this.lblProfile.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lblProfile.Location = new System.Drawing.Point(153, 218); + this.lblProfile.Name = "lblProfile"; + this.lblProfile.Size = new System.Drawing.Size(112, 30); + this.lblProfile.TabIndex = 3; + this.lblProfile.Text = "Profile"; + this.lblProfile.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // radioCurrentDevice + // + this.radioCurrentDevice.Checked = true; + this.radioCurrentDevice.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.radioCurrentDevice.Location = new System.Drawing.Point(271, 176); + this.radioCurrentDevice.Name = "radioCurrentDevice"; + this.radioCurrentDevice.Size = new System.Drawing.Size(207, 30); + this.radioCurrentDevice.TabIndex = 4; + this.radioCurrentDevice.TabStop = true; + this.radioCurrentDevice.Text = "Where executed"; + this.radioCurrentDevice.UseVisualStyleBackColor = true; + // + // radioFixedDevice + // + this.radioFixedDevice.AutoSize = true; + this.radioFixedDevice.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.radioFixedDevice.Location = new System.Drawing.Point(484, 185); + this.radioFixedDevice.Name = "radioFixedDevice"; + this.radioFixedDevice.Size = new System.Drawing.Size(14, 13); + this.radioFixedDevice.TabIndex = 5; + this.radioFixedDevice.UseVisualStyleBackColor = true; + this.radioFixedDevice.CheckedChanged += new System.EventHandler(this.radioFixedDevice_CheckedChanged); + // + // SetProfileActionConfigView + // + this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 23F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.radioFixedDevice); + this.Controls.Add(this.radioCurrentDevice); + this.Controls.Add(this.lblProfile); + this.Controls.Add(this.lblDevice); + this.Controls.Add(this.profilesList); + this.Controls.Add(this.devicesList); + this.Name = "SetProfileActionConfigView"; + this.Load += new System.EventHandler(this.SetProfileActionConfigView_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private GUI.CustomControls.RoundedComboBox devicesList; + private GUI.CustomControls.RoundedComboBox profilesList; + private System.Windows.Forms.Label lblDevice; + private System.Windows.Forms.Label lblProfile; + private System.Windows.Forms.RadioButton radioCurrentDevice; + private System.Windows.Forms.RadioButton radioFixedDevice; + } +} diff --git a/InternalPlugins/DevicePlugin/Views/SetProfileActionConfigView.cs b/InternalPlugins/DevicePlugin/Views/SetProfileActionConfigView.cs new file mode 100644 index 00000000..b24b9b40 --- /dev/null +++ b/InternalPlugins/DevicePlugin/Views/SetProfileActionConfigView.cs @@ -0,0 +1,108 @@ +using SuchByte.MacroDeck.Device; +using SuchByte.MacroDeck.GUI.CustomControls; +using SuchByte.MacroDeck.InternalPlugins.DevicePlugin.ViewModels; +using SuchByte.MacroDeck.Language; +using SuchByte.MacroDeck.Plugins; +using SuchByte.MacroDeck.Profiles; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace SuchByte.MacroDeck.InternalPlugins.DevicePlugin.Views +{ + public partial class SetProfileActionConfigView : ActionConfigControl + { + + private readonly SetProfileActionConfigViewModel _viewModel; + + public SetProfileActionConfigView(PluginAction action) + { + InitializeComponent(); + this.lblDevice.Text = LanguageManager.Strings.Device; + this.lblProfile.Text = LanguageManager.Strings.Profile; + this.radioCurrentDevice.Text = LanguageManager.Strings.WhereExecuted; + this._viewModel = new SetProfileActionConfigViewModel(action); + } + + private void SetProfileActionConfigView_Load(object sender, EventArgs e) + { + this.LoadKnownDevices(); + this.LoadProfiles(); + this.LoadCurrentConfiguration(); + } + + private void LoadCurrentConfiguration() + { + try + { + if (string.IsNullOrWhiteSpace(this._viewModel.ClientId)) + { + this.radioCurrentDevice.Checked = true; + } else + { + this.radioFixedDevice.Checked = true; + var macroDeckDevice = DeviceManager.GetKnownDevices().Find(x => x.ClientId.Equals(this._viewModel.ClientId)); + if (macroDeckDevice != null) + { + this.devicesList.Text = macroDeckDevice.DisplayName ?? ""; + } + } + var profile = ProfileManager.FindProfileById(this._viewModel.ProfileId); + + if (profile != null) + { + this.profilesList.Text = profile.DisplayName; + } + } catch { } + } + + private void LoadKnownDevices() + { + foreach (MacroDeckDevice macroDeckDevice in DeviceManager.GetKnownDevices().ToArray()) + { + this.devicesList.Items.Add(macroDeckDevice.DisplayName); + } + } + + private void LoadProfiles() + { + foreach (MacroDeckProfile macroDeckProfile in ProfileManager.Profiles) + { + this.profilesList.Items.Add(macroDeckProfile.DisplayName); + } + } + + public override bool OnActionSave() + { + if (this.radioCurrentDevice.Checked) + { + this._viewModel.ClientId = ""; + } else + { + var macroDeckDevice = DeviceManager.GetKnownDevices().Find(x => x.DisplayName.Equals(this.devicesList.Text)); + if (macroDeckDevice != null) + { + this._viewModel.ClientId = macroDeckDevice.ClientId ?? ""; + } + } + var profile = ProfileManager.FindProfileByDisplayName(this.profilesList.Text); + + if (profile != null) + { + this._viewModel.ProfileId = profile.ProfileId; + } + if ((this.radioFixedDevice.Checked && string.IsNullOrWhiteSpace(this._viewModel.ClientId)) || string.IsNullOrWhiteSpace(this._viewModel.ProfileId)) return false; + + return this._viewModel.SaveConfig(); + } + + private void radioFixedDevice_CheckedChanged(object sender, EventArgs e) + { + this.devicesList.Enabled = this.radioFixedDevice.Checked; + } + } +} diff --git a/InternalPlugins/DevicePlugin/Views/SetProfileActionConfigView.resx b/InternalPlugins/DevicePlugin/Views/SetProfileActionConfigView.resx new file mode 100644 index 00000000..f298a7be --- /dev/null +++ b/InternalPlugins/DevicePlugin/Views/SetProfileActionConfigView.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Folders/Plugin/FolderPlugin.cs b/InternalPlugins/FolderPlugin/FolderPlugin.cs similarity index 98% rename from Folders/Plugin/FolderPlugin.cs rename to InternalPlugins/FolderPlugin/FolderPlugin.cs index 060934cd..08ed7f62 100644 --- a/Folders/Plugin/FolderPlugin.cs +++ b/InternalPlugins/FolderPlugin/FolderPlugin.cs @@ -11,7 +11,7 @@ using System.Drawing; using System.Text; -namespace SuchByte.MacroDeck.Folders.Plugin +namespace SuchByte.MacroDeck.Folders.Plugin // Don't change because of backwards compatibility! { public class FolderPlugin : MacroDeckPlugin { diff --git a/Folders/Plugin/GUI/FolderSwitcherConfigurator.Designer.cs b/InternalPlugins/FolderPlugin/GUI/FolderSwitcherConfigurator.Designer.cs similarity index 100% rename from Folders/Plugin/GUI/FolderSwitcherConfigurator.Designer.cs rename to InternalPlugins/FolderPlugin/GUI/FolderSwitcherConfigurator.Designer.cs diff --git a/Folders/Plugin/GUI/FolderSwitcherConfigurator.cs b/InternalPlugins/FolderPlugin/GUI/FolderSwitcherConfigurator.cs similarity index 100% rename from Folders/Plugin/GUI/FolderSwitcherConfigurator.cs rename to InternalPlugins/FolderPlugin/GUI/FolderSwitcherConfigurator.cs diff --git a/InternalPlugins/FolderPlugin/GUI/FolderSwitcherConfigurator.resx b/InternalPlugins/FolderPlugin/GUI/FolderSwitcherConfigurator.resx new file mode 100644 index 00000000..f298a7be --- /dev/null +++ b/InternalPlugins/FolderPlugin/GUI/FolderSwitcherConfigurator.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/InternalPlugins/Variables/Enums/ChangeVariableMethod.cs b/InternalPlugins/Variables/Enums/ChangeVariableMethod.cs new file mode 100644 index 00000000..4c2ea8e6 --- /dev/null +++ b/InternalPlugins/Variables/Enums/ChangeVariableMethod.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SuchByte.MacroDeck.InternalPlugins.Variables.Enums +{ + public enum ChangeVariableMethod + { + countUp, + countDown, + set, + toggle + } +} diff --git a/InternalPlugins/Variables/Models/ChangeVariableValueActionConfigModel.cs b/InternalPlugins/Variables/Models/ChangeVariableValueActionConfigModel.cs new file mode 100644 index 00000000..3f14325f --- /dev/null +++ b/InternalPlugins/Variables/Models/ChangeVariableValueActionConfigModel.cs @@ -0,0 +1,35 @@ +using SuchByte.MacroDeck.InternalPlugins.Variables.Enums; +using SuchByte.MacroDeck.Models; +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace SuchByte.MacroDeck.InternalPlugins.Variables.Models +{ + public class ChangeVariableValueActionConfigModel : ISerializableConfiguration + { + + [JsonPropertyName("method"), JsonConverter(typeof(JsonStringEnumConverter))] + public ChangeVariableMethod Method { get; set; } = ChangeVariableMethod.countUp; + + + [JsonPropertyName("variable")] + public string Variable { get; set; } + + [JsonPropertyName("value")] + public string Value { get; set; } = ""; + + + public string Serialize() + { + return JsonSerializer.Serialize(this); + } + + public static ChangeVariableValueActionConfigModel Deserialize(string config) + { + return ISerializableConfiguration.Deserialize(config); + } + } +} diff --git a/InternalPlugins/Variables/Models/ReadVariableFromFileActionConfigModel.cs b/InternalPlugins/Variables/Models/ReadVariableFromFileActionConfigModel.cs new file mode 100644 index 00000000..b1df2ab1 --- /dev/null +++ b/InternalPlugins/Variables/Models/ReadVariableFromFileActionConfigModel.cs @@ -0,0 +1,26 @@ +using SuchByte.MacroDeck.Models; +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; + +namespace SuchByte.MacroDeck.Variables.Plugin.Models +{ + public class ReadVariableFromFileActionConfigModel : ISerializableConfiguration + { + public string FilePath { get; set; } + + public string Variable { get; set; } + + + public string Serialize() + { + return JsonSerializer.Serialize(this); + } + + public static ReadVariableFromFileActionConfigModel Deserialize(string config) + { + return ISerializableConfiguration.Deserialize(config); + } + } +} diff --git a/InternalPlugins/Variables/Models/SaveVariableToFileActionConfigModel.cs b/InternalPlugins/Variables/Models/SaveVariableToFileActionConfigModel.cs new file mode 100644 index 00000000..09de063d --- /dev/null +++ b/InternalPlugins/Variables/Models/SaveVariableToFileActionConfigModel.cs @@ -0,0 +1,26 @@ +using SuchByte.MacroDeck.Models; +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; + +namespace SuchByte.MacroDeck.Variables.Plugin.Models +{ + public class SaveVariableToFileActionConfigModel : ISerializableConfiguration + { + public string FilePath { get; set; } + + public string Variable { get; set; } + + + public string Serialize() + { + return JsonSerializer.Serialize(this); + } + + public static SaveVariableToFileActionConfigModel Deserialize(string config) + { + return ISerializableConfiguration.Deserialize(config); + } + } +} diff --git a/InternalPlugins/Variables/VariablesPlugin.cs b/InternalPlugins/Variables/VariablesPlugin.cs new file mode 100644 index 00000000..1b9660fd --- /dev/null +++ b/InternalPlugins/Variables/VariablesPlugin.cs @@ -0,0 +1,251 @@ +using Newtonsoft.Json.Linq; +using SuchByte.MacroDeck.Events; +using SuchByte.MacroDeck.Folders; +using SuchByte.MacroDeck.GUI; +using SuchByte.MacroDeck.GUI.CustomControls; +using SuchByte.MacroDeck.InternalPlugins.Variables.Models; +using SuchByte.MacroDeck.Language; +using SuchByte.MacroDeck.Logging; +using SuchByte.MacroDeck.Plugins; +using SuchByte.MacroDeck.Profiles; +using SuchByte.MacroDeck.Variables.Plugin.GUI; +using SuchByte.MacroDeck.Variables.Plugin.Models; +using SuchByte.MacroDeck.Variables.Plugin.Views; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Drawing; +using System.IO; +using System.Text; +using System.Threading.Tasks; +using System.Timers; + +namespace SuchByte.MacroDeck.Variables.Plugin // Don't change because of backwards compatibility! +{ + public class VariablesPlugin : MacroDeckPlugin + { + internal override string Name => LanguageManager.Strings.PluginMacroDeckVariables; + internal override string Author => "Macro Deck"; + + internal override Image PluginIcon => Properties.Resources.Variable_Normal; + + private VariableChangedEvent variableChangedEvent = new VariableChangedEvent(); + + Timer timeDateTimer; + + public override void Enable() + { + this.Actions = new List + { + new ChangeVariableValueAction(), + new SaveVariableToFileAction(), + new ReadVariableFromFileAction(), + }; + EventManager.RegisterEvent(this.variableChangedEvent); + VariableManager.OnVariableChanged += VariableChanged; + + this.timeDateTimer = new Timer(1000) + { + Enabled = true + }; + this.timeDateTimer.Elapsed += this.OnTimerTick; + this.timeDateTimer.Start(); + } + private void OnTimerTick(object sender, EventArgs e) + { + Task.Run(() => + { + VariableManager.SetValue("time", DateTime.Now.ToString("t"), VariableType.String, "Macro Deck"); + VariableManager.SetValue("date", DateTime.Now.ToString("d"), VariableType.String, "Macro Deck"); + VariableManager.SetValue("day_of_week", DateTime.Now.DayOfWeek.ToString(), VariableType.String, "Macro Deck"); + }); + } + private void VariableChanged(object sender, EventArgs e) + { + this.variableChangedEvent.Trigger(sender); + } + } + + public class VariableChangedEvent : IMacroDeckEvent + { + public string Name => "Variable changed"; + + public EventHandler OnEvent { get; set; } + public List ParameterSuggestions { + get + { + List variables = new List(); + foreach (Variable variable in VariableManager.ListVariables) + { + variables.Add(variable.Name); + } + return variables; + } set { } + } + + public void Trigger(object sender) + { + if (this.OnEvent != null) + { + try + { + foreach (MacroDeckProfile macroDeckProfile in ProfileManager.Profiles) + { + foreach (MacroDeckFolder folder in macroDeckProfile.Folders) + { + if (folder.ActionButtons == null) continue; + foreach (ActionButton.ActionButton actionButton in folder.ActionButtons.FindAll(actionButton => actionButton.EventListeners != null && actionButton.EventListeners.Find(x => x.EventToListen != null && x.EventToListen.Equals(this.Name)) != null)) + { + MacroDeckEventArgs macroDeckEventArgs = new MacroDeckEventArgs + { + ActionButton = actionButton, + Parameter = ((Variable)sender).Name, + }; + this.OnEvent(this, macroDeckEventArgs); + } + } + } + } + catch { } + } + } + } + + public class ChangeVariableValueAction : PluginAction + { + public override string Name => LanguageManager.Strings.ActionChangeVariableValue; + + public override string Description => LanguageManager.Strings.ActionChangeVariableValue; + + public override bool CanConfigure => true; + + public override ActionConfigControl GetActionConfigControl(ActionConfigurator actionConfigurator) + { + return new ChangeVariableValueActionConfigView(this); + } + + public override void Trigger(string clientId, ActionButton.ActionButton actionButton) + { + if (string.IsNullOrWhiteSpace(this.Configuration)) return; + var changeVariableActionConfigModel = ChangeVariableValueActionConfigModel.Deserialize(this.Configuration); + Variable variable = VariableManager.ListVariables.Where(v => v.Name == changeVariableActionConfigModel.Variable).FirstOrDefault(); + if (variable == null) return; + switch (changeVariableActionConfigModel.Method) + { + + case InternalPlugins.Variables.Enums.ChangeVariableMethod.countUp: + VariableManager.SetValue(variable.Name, float.Parse(variable.Value) + 1, (VariableType)Enum.Parse(typeof(VariableType), variable.Type), variable.Creator); + break; + case InternalPlugins.Variables.Enums.ChangeVariableMethod.countDown: + VariableManager.SetValue(variable.Name, float.Parse(variable.Value) - 1, (VariableType)Enum.Parse(typeof(VariableType), variable.Type), variable.Creator); + break; + case InternalPlugins.Variables.Enums.ChangeVariableMethod.set: + var value = VariableManager.RenderTemplate(changeVariableActionConfigModel.Value); + VariableManager.SetValue(variable.Name, value, (VariableType)Enum.Parse(typeof(VariableType), variable.Type), variable.Creator); + break; + case InternalPlugins.Variables.Enums.ChangeVariableMethod.toggle: + VariableManager.SetValue(variable.Name, !bool.Parse(variable.Value.Replace("on", "true")), (VariableType)Enum.Parse(typeof(VariableType), variable.Type), variable.Creator); + break; + + } + } + } + + public class SaveVariableToFileAction : PluginAction + { + public override string Name => LanguageManager.Strings.ActionSaveVariableToFile; + + public override string Description => LanguageManager.Strings.ActionSaveVariableToFileDescription; + + public override bool CanConfigure => true; + + public override void Trigger(string clientId, ActionButton.ActionButton actionButton) + { + var configurationModel = ReadVariableFromFileActionConfigModel.Deserialize(this.Configuration); + if (configurationModel == null) return; + var filePath = configurationModel.FilePath; + var variable = VariableManager.ListVariables.Where(x => x.Name == configurationModel.Variable).FirstOrDefault(); + string variableValue; + if (variable == null) + { + variableValue = "Variable not found"; + } else + { + variableValue = variable.Value; + } + try + { + Utils.Retry.Do(new Action(() => + { + File.WriteAllText(filePath, variableValue); + })); + } catch (Exception ex) + { + MacroDeckLogger.Error(typeof(VariablesPlugin), $"Failed to save variable value to file: {ex.Message}"); + } + } + + public override ActionConfigControl GetActionConfigControl(ActionConfigurator actionConfigurator) + { + return new SaveVariableToFileActionConfigView(this); + } + + } + public class ReadVariableFromFileAction : PluginAction + { + public override string Name => LanguageManager.Strings.ActionReadVariableFromFile; + + public override string Description => LanguageManager.Strings.ActionReadVariableFromFileDescription; + + public override bool CanConfigure => true; + + public override void Trigger(string clientId, ActionButton.ActionButton actionButton) + { + var configurationModel = SaveVariableToFileActionConfigModel.Deserialize(this.Configuration); + if (configurationModel == null) return; + var filePath = configurationModel.FilePath; + var variable = VariableManager.ListVariables.Where(x => x.Name == configurationModel.Variable).FirstOrDefault(); + try + { + Utils.Retry.Do(new Action(() => + { + var value = File.ReadAllText(filePath).Trim(); + switch (variable.Type) + { + case nameof(VariableType.Bool): + if (bool.TryParse(value, out bool valueBool)) + { + VariableManager.SetValue(variable.Name, valueBool, VariableType.Bool); + } + break; + case nameof(VariableType.Float): + if (float.TryParse(value, out float valueFloat)) + { + VariableManager.SetValue(variable.Name, valueFloat, VariableType.Float); + } + break; + case nameof(VariableType.Integer): + if (Int32.TryParse(value, out int valueInt)) + { + VariableManager.SetValue(variable.Name, valueInt, VariableType.Integer); + } + break; + case nameof(VariableType.String): + VariableManager.SetValue(variable.Name, value, VariableType.String); + break; + } + })); + } + catch (Exception ex) + { + MacroDeckLogger.Error(typeof(VariablesPlugin), $"Failed to read variable value from file: {ex.Message}"); + } + } + + public override ActionConfigControl GetActionConfigControl(ActionConfigurator actionConfigurator) + { + return new ReadVariableFromFileActionConfigView(this); + } + + } +} diff --git a/InternalPlugins/Variables/ViewModels/ChangeVariableValueActionConfigViewModel.cs b/InternalPlugins/Variables/ViewModels/ChangeVariableValueActionConfigViewModel.cs new file mode 100644 index 00000000..92e311d0 --- /dev/null +++ b/InternalPlugins/Variables/ViewModels/ChangeVariableValueActionConfigViewModel.cs @@ -0,0 +1,87 @@ +using SuchByte.MacroDeck.InternalPlugins.Variables.Enums; +using SuchByte.MacroDeck.InternalPlugins.Variables.Models; +using SuchByte.MacroDeck.Language; +using SuchByte.MacroDeck.Logging; +using SuchByte.MacroDeck.Models; +using SuchByte.MacroDeck.Plugins; +using SuchByte.MacroDeck.Variables.Plugin.Models; +using SuchByte.MacroDeck.ViewModels; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SuchByte.MacroDeck.Variables.Plugin.ViewModels +{ + public class ChangeVariableValueActionConfigViewModel : ISerializableConfigViewModel + { + private readonly PluginAction _pluginAction; + + public ChangeVariableValueActionConfigModel Configuration { get; set; } + + ISerializableConfiguration ISerializableConfigViewModel.SerializableConfiguration => Configuration; + + public ChangeVariableMethod Method + { + get => Configuration.Method; + set => Configuration.Method = value; + } + + public string Variable + { + get => Configuration.Variable; + set => Configuration.Variable = value; + } + + public string Value + { + get => Configuration.Value; + set => Configuration.Value = value; + } + + public ChangeVariableValueActionConfigViewModel(PluginAction pluginAction) + { + this._pluginAction = pluginAction; + this.Configuration = ChangeVariableValueActionConfigModel.Deserialize(pluginAction.Configuration); + } + + public bool SaveConfig() + { + if (string.IsNullOrWhiteSpace(this.Variable)) + { + return false; + } + try + { + SetConfig(); + MacroDeckLogger.Info(typeof(ChangeVariableValueActionConfigViewModel), "config saved"); + } + catch (Exception ex) + { + MacroDeckLogger.Error(typeof(ChangeVariableValueActionConfigViewModel), $"Error while saving config: { ex.Message + Environment.NewLine + ex.StackTrace }"); + } + return true; + } + + public void SetConfig() + { + this._pluginAction.ConfigurationSummary = this.Variable + " -> " + GetMethodName(this.Method) + (this.Method == ChangeVariableMethod.set ? " -> " + this.Value : ""); + this._pluginAction.Configuration = Configuration.Serialize(); + } + + private string GetMethodName(ChangeVariableMethod method) + { + switch (method) + { + case ChangeVariableMethod.countUp: + return LanguageManager.Strings.CountUp; + case ChangeVariableMethod.countDown: + return LanguageManager.Strings.CountDown; + case ChangeVariableMethod.set: + return LanguageManager.Strings.Set; + case ChangeVariableMethod.toggle: + return LanguageManager.Strings.Toggle; + } + return ""; + } + } +} diff --git a/InternalPlugins/Variables/ViewModels/ReadVariableFromFileActionConfigViewModel.cs b/InternalPlugins/Variables/ViewModels/ReadVariableFromFileActionConfigViewModel.cs new file mode 100644 index 00000000..cd27fa37 --- /dev/null +++ b/InternalPlugins/Variables/ViewModels/ReadVariableFromFileActionConfigViewModel.cs @@ -0,0 +1,62 @@ +using SuchByte.MacroDeck.Logging; +using SuchByte.MacroDeck.Models; +using SuchByte.MacroDeck.Plugins; +using SuchByte.MacroDeck.Variables.Plugin.Models; +using SuchByte.MacroDeck.ViewModels; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SuchByte.MacroDeck.Variables.Plugin.ViewModels +{ + public class ReadVariableFromFileActionConfigViewModel : ISerializableConfigViewModel + { + private readonly PluginAction _pluginAction; + + public ReadVariableFromFileActionConfigModel Configuration { get; set; } + + ISerializableConfiguration ISerializableConfigViewModel.SerializableConfiguration => Configuration; + + public string FilePath + { + get => Configuration.FilePath; + set => Configuration.FilePath = value; + } + + public string Variable + { + get => Configuration.Variable; + set => Configuration.Variable = value; + } + + public ReadVariableFromFileActionConfigViewModel(PluginAction pluginAction) + { + this._pluginAction = pluginAction; + this.Configuration = ReadVariableFromFileActionConfigModel.Deserialize(pluginAction.Configuration); + } + + public bool SaveConfig() + { + if (string.IsNullOrWhiteSpace(this.FilePath) || string.IsNullOrWhiteSpace(this.Variable)) + { + return false; + } + try + { + SetConfig(); + MacroDeckLogger.Info(typeof(ReadVariableFromFileActionConfigModel), "config saved"); + } + catch (Exception ex) + { + MacroDeckLogger.Error(typeof(ReadVariableFromFileActionConfigModel), $"Error while saving config: { ex.Message + Environment.NewLine + ex.StackTrace }"); + } + return true; + } + + public void SetConfig() + { + this._pluginAction.ConfigurationSummary = $"{ Configuration.FilePath }"; + this._pluginAction.Configuration = Configuration.Serialize(); + } + } +} diff --git a/InternalPlugins/Variables/ViewModels/SaveVariableToFileActionConfigViewModel.cs b/InternalPlugins/Variables/ViewModels/SaveVariableToFileActionConfigViewModel.cs new file mode 100644 index 00000000..aa80e282 --- /dev/null +++ b/InternalPlugins/Variables/ViewModels/SaveVariableToFileActionConfigViewModel.cs @@ -0,0 +1,62 @@ +using SuchByte.MacroDeck.Logging; +using SuchByte.MacroDeck.Models; +using SuchByte.MacroDeck.Plugins; +using SuchByte.MacroDeck.Variables.Plugin.Models; +using SuchByte.MacroDeck.ViewModels; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SuchByte.MacroDeck.Variables.Plugin.ViewModels +{ + public class SaveVariableToFileActionConfigViewModel : ISerializableConfigViewModel + { + private readonly PluginAction _pluginAction; + + public SaveVariableToFileActionConfigModel Configuration { get; set; } + + ISerializableConfiguration ISerializableConfigViewModel.SerializableConfiguration => Configuration; + + public string FilePath + { + get => Configuration.FilePath; + set => Configuration.FilePath = value; + } + + public string Variable + { + get => Configuration.Variable; + set => Configuration.Variable = value; + } + + public SaveVariableToFileActionConfigViewModel(PluginAction pluginAction) + { + this._pluginAction = pluginAction; + this.Configuration = SaveVariableToFileActionConfigModel.Deserialize(pluginAction.Configuration); + } + + public bool SaveConfig() + { + if (string.IsNullOrWhiteSpace(this.FilePath) || string.IsNullOrWhiteSpace(this.Variable)) + { + return false; + } + try + { + SetConfig(); + MacroDeckLogger.Info(typeof(SaveVariableToFileActionConfigViewModel), "config saved"); + } + catch (Exception ex) + { + MacroDeckLogger.Error(typeof(SaveVariableToFileActionConfigViewModel), $"Error while saving config: { ex.Message + Environment.NewLine + ex.StackTrace }"); + } + return true; + } + + public void SetConfig() + { + this._pluginAction.ConfigurationSummary = $"{ Configuration.FilePath }"; + this._pluginAction.Configuration = Configuration.Serialize(); + } + } +} diff --git a/InternalPlugins/Variables/Views/ChangeVariableValueActionConfigView.Designer.cs b/InternalPlugins/Variables/Views/ChangeVariableValueActionConfigView.Designer.cs new file mode 100644 index 00000000..7857f2cb --- /dev/null +++ b/InternalPlugins/Variables/Views/ChangeVariableValueActionConfigView.Designer.cs @@ -0,0 +1,208 @@ + +using SuchByte.MacroDeck.GUI.CustomControls; + +namespace SuchByte.MacroDeck.Variables.Plugin.GUI +{ + partial class ChangeVariableValueActionConfigView + { + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Komponenten-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + this.radioToggle = new System.Windows.Forms.RadioButton(); + this.radioSet = new System.Windows.Forms.RadioButton(); + this.radioCountDown = new System.Windows.Forms.RadioButton(); + this.radioCountUp = new System.Windows.Forms.RadioButton(); + this.variables = new SuchByte.MacroDeck.GUI.CustomControls.RoundedComboBox(); + this.value = new SuchByte.MacroDeck.GUI.CustomControls.RoundedTextBox(); + this.lblVariable = new System.Windows.Forms.Label(); + this.lblOnlyUserCreatedVariablesVisible = new System.Windows.Forms.Label(); + this.btnTemplateEditor = new SuchByte.MacroDeck.GUI.CustomControls.PictureButton(); + ((System.ComponentModel.ISupportInitialize)(this.btnTemplateEditor)).BeginInit(); + this.SuspendLayout(); + // + // radioToggle + // + this.radioToggle.Cursor = System.Windows.Forms.Cursors.Hand; + this.radioToggle.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.radioToggle.Location = new System.Drawing.Point(247, 210); + this.radioToggle.Name = "radioToggle"; + this.radioToggle.Size = new System.Drawing.Size(220, 27); + this.radioToggle.TabIndex = 3; + this.radioToggle.TabStop = true; + this.radioToggle.Text = "Toggle"; + this.radioToggle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.radioToggle.UseMnemonic = false; + this.radioToggle.UseVisualStyleBackColor = true; + this.radioToggle.CheckedChanged += new System.EventHandler(this.MethodChanged); + // + // radioSet + // + this.radioSet.Cursor = System.Windows.Forms.Cursors.Hand; + this.radioSet.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.radioSet.Location = new System.Drawing.Point(247, 177); + this.radioSet.Name = "radioSet"; + this.radioSet.Size = new System.Drawing.Size(220, 27); + this.radioSet.TabIndex = 2; + this.radioSet.TabStop = true; + this.radioSet.Text = "Set"; + this.radioSet.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.radioSet.UseMnemonic = false; + this.radioSet.UseVisualStyleBackColor = true; + this.radioSet.CheckedChanged += new System.EventHandler(this.MethodChanged); + // + // radioCountDown + // + this.radioCountDown.Cursor = System.Windows.Forms.Cursors.Hand; + this.radioCountDown.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.radioCountDown.Location = new System.Drawing.Point(247, 144); + this.radioCountDown.Name = "radioCountDown"; + this.radioCountDown.Size = new System.Drawing.Size(220, 27); + this.radioCountDown.TabIndex = 1; + this.radioCountDown.TabStop = true; + this.radioCountDown.Text = "Count down"; + this.radioCountDown.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.radioCountDown.UseMnemonic = false; + this.radioCountDown.UseVisualStyleBackColor = true; + this.radioCountDown.CheckedChanged += new System.EventHandler(this.MethodChanged); + // + // radioCountUp + // + this.radioCountUp.Cursor = System.Windows.Forms.Cursors.Hand; + this.radioCountUp.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.radioCountUp.Location = new System.Drawing.Point(247, 111); + this.radioCountUp.Name = "radioCountUp"; + this.radioCountUp.Size = new System.Drawing.Size(220, 27); + this.radioCountUp.TabIndex = 0; + this.radioCountUp.TabStop = true; + this.radioCountUp.Text = "Count up"; + this.radioCountUp.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.radioCountUp.UseMnemonic = false; + this.radioCountUp.UseVisualStyleBackColor = true; + this.radioCountUp.CheckedChanged += new System.EventHandler(this.MethodChanged); + // + // variables + // + this.variables.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(65)))), ((int)(((byte)(65))))); + this.variables.Cursor = System.Windows.Forms.Cursors.Hand; + this.variables.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.variables.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.variables.Icon = null; + this.variables.Location = new System.Drawing.Point(183, 48); + this.variables.Name = "variables"; + this.variables.Padding = new System.Windows.Forms.Padding(8, 2, 8, 2); + this.variables.SelectedIndex = -1; + this.variables.SelectedItem = null; + this.variables.Size = new System.Drawing.Size(348, 26); + this.variables.TabIndex = 1; + // + // value + // + this.value.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(65)))), ((int)(((byte)(65))))); + this.value.Cursor = System.Windows.Forms.Cursors.Hand; + this.value.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.value.Icon = null; + this.value.Location = new System.Drawing.Point(473, 179); + this.value.MaxCharacters = 32767; + this.value.Multiline = false; + this.value.Name = "value"; + this.value.Padding = new System.Windows.Forms.Padding(8, 5, 8, 5); + this.value.PasswordChar = false; + this.value.PlaceHolderColor = System.Drawing.Color.Gray; + this.value.PlaceHolderText = ""; + this.value.ReadOnly = false; + this.value.ScrollBars = System.Windows.Forms.ScrollBars.None; + this.value.SelectionStart = 0; + this.value.Size = new System.Drawing.Size(171, 25); + this.value.TabIndex = 2; + this.value.TextAlignment = System.Windows.Forms.HorizontalAlignment.Left; + // + // lblVariable + // + this.lblVariable.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lblVariable.Location = new System.Drawing.Point(11, 48); + this.lblVariable.Name = "lblVariable"; + this.lblVariable.Size = new System.Drawing.Size(166, 23); + this.lblVariable.TabIndex = 4; + this.lblVariable.Text = "Variable"; + this.lblVariable.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.lblVariable.UseMnemonic = false; + // + // lblOnlyUserCreatedVariablesVisible + // + this.lblOnlyUserCreatedVariablesVisible.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lblOnlyUserCreatedVariablesVisible.Location = new System.Drawing.Point(183, 77); + this.lblOnlyUserCreatedVariablesVisible.Name = "lblOnlyUserCreatedVariablesVisible"; + this.lblOnlyUserCreatedVariablesVisible.Size = new System.Drawing.Size(348, 31); + this.lblOnlyUserCreatedVariablesVisible.TabIndex = 5; + this.lblOnlyUserCreatedVariablesVisible.Text = "Only user-created variables are visible"; + this.lblOnlyUserCreatedVariablesVisible.TextAlign = System.Drawing.ContentAlignment.TopCenter; + this.lblOnlyUserCreatedVariablesVisible.UseMnemonic = false; + // + // btnTemplateEditor + // + this.btnTemplateEditor.BackColor = System.Drawing.Color.Transparent; + this.btnTemplateEditor.BackgroundImage = global::SuchByte.MacroDeck.Properties.Resources.Arrow_Top_Right_Normal; + this.btnTemplateEditor.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.btnTemplateEditor.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnTemplateEditor.HoverImage = global::SuchByte.MacroDeck.Properties.Resources.Arrow_Top_Right_Hover; + this.btnTemplateEditor.Location = new System.Drawing.Point(645, 179); + this.btnTemplateEditor.Name = "btnTemplateEditor"; + this.btnTemplateEditor.Size = new System.Drawing.Size(25, 25); + this.btnTemplateEditor.TabIndex = 6; + this.btnTemplateEditor.TabStop = false; + this.btnTemplateEditor.Click += new System.EventHandler(this.BtnTemplateEditor_Click); + // + // ChangeVariableValueConfigurator + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; + this.Controls.Add(this.btnTemplateEditor); + this.Controls.Add(this.lblOnlyUserCreatedVariablesVisible); + this.Controls.Add(this.radioToggle); + this.Controls.Add(this.radioSet); + this.Controls.Add(this.lblVariable); + this.Controls.Add(this.radioCountDown); + this.Controls.Add(this.value); + this.Controls.Add(this.radioCountUp); + this.Controls.Add(this.variables); + this.Name = "ChangeVariableValueConfigurator"; + this.Load += new System.EventHandler(this.ChangeVariableValueConfigurator_Load); + ((System.ComponentModel.ISupportInitialize)(this.btnTemplateEditor)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + private System.Windows.Forms.RadioButton radioToggle; + private System.Windows.Forms.RadioButton radioSet; + private System.Windows.Forms.RadioButton radioCountDown; + private System.Windows.Forms.RadioButton radioCountUp; + private RoundedComboBox variables; + private RoundedTextBox value; + private System.Windows.Forms.Label lblVariable; + private System.Windows.Forms.Label lblOnlyUserCreatedVariablesVisible; + private PictureButton btnTemplateEditor; + } +} diff --git a/InternalPlugins/Variables/Views/ChangeVariableValueActionConfigView.cs b/InternalPlugins/Variables/Views/ChangeVariableValueActionConfigView.cs new file mode 100644 index 00000000..645d5c9c --- /dev/null +++ b/InternalPlugins/Variables/Views/ChangeVariableValueActionConfigView.cs @@ -0,0 +1,179 @@ +using Newtonsoft.Json.Linq; +using SuchByte.MacroDeck.GUI.CustomControls; +using SuchByte.MacroDeck.GUI.Dialogs; +using SuchByte.MacroDeck.InternalPlugins.Variables.Enums; +using SuchByte.MacroDeck.Language; +using SuchByte.MacroDeck.Plugins; +using SuchByte.MacroDeck.Variables.Plugin.ViewModels; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Diagnostics; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace SuchByte.MacroDeck.Variables.Plugin.GUI +{ + public partial class ChangeVariableValueActionConfigView : ActionConfigControl + { + private readonly ChangeVariableValueActionConfigViewModel _viewModel; + +<<<<<<< HEAD:InternalPlugins/Variables/Views/ChangeVariableValueActionConfigView.cs + public ChangeVariableValueActionConfigView(PluginAction pluginAction) +======= + public ChangeVariableValueActionConfigView(PluginAction macroDeckAction) +>>>>>>> origin/main:Variables/Plugin/Views/ChangeVariableValueActionConfigView.cs + { + this._viewModel = new ChangeVariableValueActionConfigViewModel(pluginAction); + InitializeComponent(); + + this.radioCountUp.Text = LanguageManager.Strings.CountUp; + this.radioCountDown.Text = LanguageManager.Strings.CountDown; + this.radioSet.Text = LanguageManager.Strings.Set; + this.radioToggle.Text = LanguageManager.Strings.Toggle; + this.lblVariable.Text = LanguageManager.Strings.Variable; + this.lblOnlyUserCreatedVariablesVisible.Text = LanguageManager.Strings.OnlyUserCreatedVariablesVisible; + + this.radioCountUp.Visible = false; + this.radioCountDown.Visible = false; + this.radioSet.Visible = false; + this.radioToggle.Visible = false; + this.value.Visible = false; + this.btnTemplateEditor.Visible = false; + + this.variables.SelectedIndexChanged += Variables_SelectedIndexChanged; + } + + + private void Variables_SelectedIndexChanged(object sender, EventArgs e) + { + try + { + Variable variable = VariableManager.ListVariables.Where(v => v.Name == this.variables.Text).FirstOrDefault(); + if (variable != null) + { + switch (variable.Type) + { + case nameof(VariableType.String): + this.radioCountUp.Visible = false; + this.radioCountDown.Visible = false; + this.radioSet.Visible = true; + this.radioToggle.Visible = false; + this.radioSet.Checked = true; + this.btnTemplateEditor.Visible = true; + break; + case nameof(VariableType.Bool): + this.radioCountUp.Visible = false; + this.radioCountDown.Visible = false; + this.radioSet.Visible = true; + this.radioToggle.Visible = true; + this.radioSet.Checked = true; + this.btnTemplateEditor.Visible = true; + break; + case nameof(VariableType.Integer): + case nameof(VariableType.Float): + this.radioCountUp.Visible = true; + this.radioCountDown.Visible = true; + this.radioSet.Visible = true; + this.btnTemplateEditor.Visible = true; + this.radioToggle.Visible = false; + break; + } + + if (this.value != null) + { + this.value.SetAutoCompleteMode(AutoCompleteMode.Suggest); + this.value.SetAutoCompleteSource(AutoCompleteSource.CustomSource); + AutoCompleteStringCollection suggestions = new AutoCompleteStringCollection(); + suggestions.AddRange(variable.Suggestions); + this.value.SetAutoCompleteCustomSource(suggestions); + } + + + } + } + catch { } + } + + private void MethodChanged(object sender, EventArgs e) + { + this.value.Visible = this.radioSet.Checked; + } + + public override bool OnActionSave() + { + this._viewModel.Variable = this.variables.Text; + + if (this.radioCountUp.Checked) + { + this._viewModel.Method = InternalPlugins.Variables.Enums.ChangeVariableMethod.countUp; + } + else if (this.radioCountDown.Checked) + { + this._viewModel.Method = InternalPlugins.Variables.Enums.ChangeVariableMethod.countDown; + } + else if (this.radioSet.Checked) + { + this._viewModel.Method = InternalPlugins.Variables.Enums.ChangeVariableMethod.set; + } + else if (this.radioToggle.Checked) + { + this._viewModel.Method = InternalPlugins.Variables.Enums.ChangeVariableMethod.toggle; + } + + this._viewModel.Value = this.radioSet.Checked ? this.value.Text : String.Empty; + + return this._viewModel.SaveConfig(); + } + + private void LoadVariables() + { + this.variables.Items.Clear(); + foreach (Variable variable in VariableManager.ListVariables.Where(v => v.Creator.Equals("User"))) + { + this.variables.Items.Add(variable.Name); + } + } + + + + private void ChangeVariableValueConfigurator_Load(object sender, EventArgs e) + { + this.LoadVariables(); + + switch (this._viewModel.Method) + { + case ChangeVariableMethod.countUp: + this.radioCountUp.Checked = true; + break; + case ChangeVariableMethod.countDown: + this.radioCountDown.Checked = true; + break; + case ChangeVariableMethod.set: + this.radioSet.Checked = true; + break; + case ChangeVariableMethod.toggle: + this.radioToggle.Checked = true; + break; + } + + this.variables.Text = this._viewModel.Variable; + this.value.Text = this._viewModel.Value; + this.value.Visible = this.radioSet.Checked; + + } + + private void BtnTemplateEditor_Click(object sender, EventArgs e) + { + using (var templateEditor = new TemplateEditor(this.value.Text)) + { + if (templateEditor.ShowDialog() == DialogResult.OK) + { + this.value.Text = templateEditor.Template; + } + } + } + } +} diff --git a/InternalPlugins/Variables/Views/ChangeVariableValueActionConfigView.resx b/InternalPlugins/Variables/Views/ChangeVariableValueActionConfigView.resx new file mode 100644 index 00000000..f298a7be --- /dev/null +++ b/InternalPlugins/Variables/Views/ChangeVariableValueActionConfigView.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/InternalPlugins/Variables/Views/ReadVariableFromFileActionConfigView.Designer.cs b/InternalPlugins/Variables/Views/ReadVariableFromFileActionConfigView.Designer.cs new file mode 100644 index 00000000..ed0fe46c --- /dev/null +++ b/InternalPlugins/Variables/Views/ReadVariableFromFileActionConfigView.Designer.cs @@ -0,0 +1,183 @@ + +namespace SuchByte.MacroDeck.Variables.Plugin.Views +{ + partial class ReadVariableFromFileActionConfigView + { + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Komponenten-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + this.lblPath = new System.Windows.Forms.Label(); + this.lblVariable = new System.Windows.Forms.Label(); + this.btnChoosePath = new SuchByte.MacroDeck.GUI.CustomControls.ButtonPrimary(); + this.variable = new SuchByte.MacroDeck.GUI.CustomControls.RoundedComboBox(); + this.path = new SuchByte.MacroDeck.GUI.CustomControls.RoundedTextBox(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.btnCreateVariable = new SuchByte.MacroDeck.GUI.CustomControls.ButtonPrimary(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.SuspendLayout(); + // + // lblPath + // + this.lblPath.Anchor = System.Windows.Forms.AnchorStyles.None; + this.lblPath.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lblPath.Location = new System.Drawing.Point(95, 158); + this.lblPath.Name = "lblPath"; + this.lblPath.Size = new System.Drawing.Size(135, 25); + this.lblPath.TabIndex = 9; + this.lblPath.Text = "Path"; + this.lblPath.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // lblVariable + // + this.lblVariable.Anchor = System.Windows.Forms.AnchorStyles.None; + this.lblVariable.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lblVariable.Location = new System.Drawing.Point(95, 240); + this.lblVariable.Name = "lblVariable"; + this.lblVariable.Size = new System.Drawing.Size(135, 26); + this.lblVariable.TabIndex = 8; + this.lblVariable.Text = "Variable"; + this.lblVariable.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // btnChoosePath + // + this.btnChoosePath.Anchor = System.Windows.Forms.AnchorStyles.None; + this.btnChoosePath.BorderRadius = 8; + this.btnChoosePath.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnChoosePath.FlatAppearance.BorderSize = 0; + this.btnChoosePath.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnChoosePath.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.btnChoosePath.ForeColor = System.Drawing.Color.White; + this.btnChoosePath.HoverColor = System.Drawing.Color.Empty; + this.btnChoosePath.Icon = null; + this.btnChoosePath.Location = new System.Drawing.Point(730, 158); + this.btnChoosePath.Name = "btnChoosePath"; + this.btnChoosePath.Progress = 0; + this.btnChoosePath.ProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(103)))), ((int)(((byte)(205))))); + this.btnChoosePath.Size = new System.Drawing.Size(32, 25); + this.btnChoosePath.TabIndex = 7; + this.btnChoosePath.Text = "..."; + this.btnChoosePath.UseVisualStyleBackColor = true; + this.btnChoosePath.UseWindowsAccentColor = true; + this.btnChoosePath.Click += new System.EventHandler(this.BtnChoosePath_Click); + // + // variable + // + this.variable.Anchor = System.Windows.Forms.AnchorStyles.None; + this.variable.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(65)))), ((int)(((byte)(65))))); + this.variable.Cursor = System.Windows.Forms.Cursors.Hand; + this.variable.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.variable.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.variable.Icon = null; + this.variable.Location = new System.Drawing.Point(236, 240); + this.variable.Name = "variable"; + this.variable.Padding = new System.Windows.Forms.Padding(8, 2, 8, 2); + this.variable.SelectedIndex = -1; + this.variable.SelectedItem = null; + this.variable.Size = new System.Drawing.Size(332, 26); + this.variable.TabIndex = 6; + // + // path + // + this.path.Anchor = System.Windows.Forms.AnchorStyles.None; + this.path.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(65)))), ((int)(((byte)(65))))); + this.path.Cursor = System.Windows.Forms.Cursors.Hand; + this.path.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.path.Icon = null; + this.path.Location = new System.Drawing.Point(236, 158); + this.path.MaxCharacters = 32767; + this.path.Multiline = false; + this.path.Name = "path"; + this.path.Padding = new System.Windows.Forms.Padding(8, 5, 8, 5); + this.path.PasswordChar = false; + this.path.PlaceHolderColor = System.Drawing.Color.Gray; + this.path.PlaceHolderText = ""; + this.path.ReadOnly = false; + this.path.ScrollBars = System.Windows.Forms.ScrollBars.None; + this.path.SelectionStart = 0; + this.path.Size = new System.Drawing.Size(488, 25); + this.path.TabIndex = 5; + this.path.TextAlignment = System.Windows.Forms.HorizontalAlignment.Left; + // + // pictureBox1 + // + this.pictureBox1.BackgroundImage = global::SuchByte.MacroDeck.Properties.Resources.Arrow_Down_Hover; + this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; + this.pictureBox1.Location = new System.Drawing.Point(404, 189); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(48, 45); + this.pictureBox1.TabIndex = 10; + this.pictureBox1.TabStop = false; + // + // btnCreateVariable + // + this.btnCreateVariable.Anchor = System.Windows.Forms.AnchorStyles.None; + this.btnCreateVariable.BorderRadius = 8; + this.btnCreateVariable.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnCreateVariable.FlatAppearance.BorderSize = 0; + this.btnCreateVariable.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnCreateVariable.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.btnCreateVariable.ForeColor = System.Drawing.Color.White; + this.btnCreateVariable.HoverColor = System.Drawing.Color.Empty; + this.btnCreateVariable.Icon = null; + this.btnCreateVariable.Location = new System.Drawing.Point(574, 241); + this.btnCreateVariable.Name = "btnCreateVariable"; + this.btnCreateVariable.Progress = 0; + this.btnCreateVariable.ProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(103)))), ((int)(((byte)(205))))); + this.btnCreateVariable.Size = new System.Drawing.Size(32, 25); + this.btnCreateVariable.TabIndex = 11; + this.btnCreateVariable.Text = "+"; + this.btnCreateVariable.UseVisualStyleBackColor = true; + this.btnCreateVariable.UseWindowsAccentColor = true; + this.btnCreateVariable.Click += new System.EventHandler(this.BtnCreateVariable_Click); + // + // ReadVariableFromFileActionConfigView + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; + this.Controls.Add(this.btnCreateVariable); + this.Controls.Add(this.pictureBox1); + this.Controls.Add(this.lblPath); + this.Controls.Add(this.lblVariable); + this.Controls.Add(this.btnChoosePath); + this.Controls.Add(this.variable); + this.Controls.Add(this.path); + this.Name = "ReadVariableFromFileActionConfigView"; + this.Load += new System.EventHandler(this.ReadVariableFromFileActionConfigView_Load); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Label lblPath; + private System.Windows.Forms.Label lblVariable; + private SuchByte.MacroDeck.GUI.CustomControls.ButtonPrimary btnChoosePath; + private SuchByte.MacroDeck.GUI.CustomControls.RoundedComboBox variable; + private SuchByte.MacroDeck.GUI.CustomControls.RoundedTextBox path; + private System.Windows.Forms.PictureBox pictureBox1; + private SuchByte.MacroDeck.GUI.CustomControls.ButtonPrimary btnCreateVariable; + } +} diff --git a/InternalPlugins/Variables/Views/ReadVariableFromFileActionConfigView.cs b/InternalPlugins/Variables/Views/ReadVariableFromFileActionConfigView.cs new file mode 100644 index 00000000..762046fa --- /dev/null +++ b/InternalPlugins/Variables/Views/ReadVariableFromFileActionConfigView.cs @@ -0,0 +1,83 @@ +using SuchByte.MacroDeck.GUI.CustomControls; +using SuchByte.MacroDeck.GUI.Dialogs; +using SuchByte.MacroDeck.Language; +using SuchByte.MacroDeck.Plugins; +using SuchByte.MacroDeck.Variables.Plugin.ViewModels; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace SuchByte.MacroDeck.Variables.Plugin.Views +{ + public partial class ReadVariableFromFileActionConfigView : ActionConfigControl + { + private readonly ReadVariableFromFileActionConfigViewModel _viewModel; + + + public ReadVariableFromFileActionConfigView(PluginAction pluginAction) + { + InitializeComponent(); + this.lblVariable.Text = LanguageManager.Strings.Variable; + this.lblPath.Text = LanguageManager.Strings.Path; + + this._viewModel = new ReadVariableFromFileActionConfigViewModel(pluginAction); + } + + private void ReadVariableFromFileActionConfigView_Load(object sender, EventArgs e) + { + LoadVariables(); + this.variable.Text = this._viewModel.Variable; + this.path.Text = this._viewModel.FilePath; + } + + private void LoadVariables() + { + this.variable.Items.Clear(); + foreach (var variable in VariableManager.ListVariables.Where(x => x.Creator == "User")) + { + this.variable.Items.Add(variable.Name); + } + } + + public override bool OnActionSave() + { + this._viewModel.Variable = this.variable.Text; + this._viewModel.FilePath = this.path.Text; + return this._viewModel.SaveConfig(); + } + + private void BtnChoosePath_Click(object sender, EventArgs e) + { + using (var openFileDialog = new OpenFileDialog() + { + AddExtension = true, + DefaultExt = ".txt", + Filter = "Text file (*.txt)|*.txt|Any (*.*)|*.*", + }) + { + if (openFileDialog.ShowDialog() == DialogResult.OK) + { + this.path.Text = openFileDialog.FileName; + } + } + } + + private void BtnCreateVariable_Click(object sender, EventArgs e) + { + using (var variableDialog = new VariableDialog()) + { + if (variableDialog.ShowDialog() == DialogResult.OK) + { + VariableManager.InsertVariable(variableDialog.Variable); + LoadVariables(); + this.variable.Text = variableDialog.Variable.Name; + } + } + } + + } +} diff --git a/InternalPlugins/Variables/Views/ReadVariableFromFileActionConfigView.resx b/InternalPlugins/Variables/Views/ReadVariableFromFileActionConfigView.resx new file mode 100644 index 00000000..f298a7be --- /dev/null +++ b/InternalPlugins/Variables/Views/ReadVariableFromFileActionConfigView.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/InternalPlugins/Variables/Views/SaveVariableToFileActionConfigView.Designer.cs b/InternalPlugins/Variables/Views/SaveVariableToFileActionConfigView.Designer.cs new file mode 100644 index 00000000..052a6c1d --- /dev/null +++ b/InternalPlugins/Variables/Views/SaveVariableToFileActionConfigView.Designer.cs @@ -0,0 +1,159 @@ + +namespace SuchByte.MacroDeck.Variables.Plugin.Views +{ + partial class SaveVariableToFileActionConfigView + { + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Komponenten-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + this.path = new SuchByte.MacroDeck.GUI.CustomControls.RoundedTextBox(); + this.variable = new SuchByte.MacroDeck.GUI.CustomControls.RoundedComboBox(); + this.btnChoosePath = new SuchByte.MacroDeck.GUI.CustomControls.ButtonPrimary(); + this.lblVariable = new System.Windows.Forms.Label(); + this.lblPath = new System.Windows.Forms.Label(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.SuspendLayout(); + // + // path + // + this.path.Anchor = System.Windows.Forms.AnchorStyles.None; + this.path.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(65)))), ((int)(((byte)(65))))); + this.path.Cursor = System.Windows.Forms.Cursors.Hand; + this.path.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.path.Icon = null; + this.path.Location = new System.Drawing.Point(236, 241); + this.path.MaxCharacters = 32767; + this.path.Multiline = false; + this.path.Name = "path"; + this.path.Padding = new System.Windows.Forms.Padding(8, 5, 8, 5); + this.path.PasswordChar = false; + this.path.PlaceHolderColor = System.Drawing.Color.Gray; + this.path.PlaceHolderText = ""; + this.path.ReadOnly = false; + this.path.ScrollBars = System.Windows.Forms.ScrollBars.None; + this.path.SelectionStart = 0; + this.path.Size = new System.Drawing.Size(488, 25); + this.path.TabIndex = 0; + this.path.TextAlignment = System.Windows.Forms.HorizontalAlignment.Left; + // + // variable + // + this.variable.Anchor = System.Windows.Forms.AnchorStyles.None; + this.variable.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(65)))), ((int)(((byte)(65))))); + this.variable.Cursor = System.Windows.Forms.Cursors.Hand; + this.variable.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.variable.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.variable.Icon = null; + this.variable.Location = new System.Drawing.Point(236, 158); + this.variable.Name = "variable"; + this.variable.Padding = new System.Windows.Forms.Padding(8, 2, 8, 2); + this.variable.SelectedIndex = -1; + this.variable.SelectedItem = null; + this.variable.Size = new System.Drawing.Size(332, 26); + this.variable.TabIndex = 1; + // + // btnChoosePath + // + this.btnChoosePath.Anchor = System.Windows.Forms.AnchorStyles.None; + this.btnChoosePath.BorderRadius = 8; + this.btnChoosePath.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnChoosePath.FlatAppearance.BorderSize = 0; + this.btnChoosePath.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnChoosePath.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.btnChoosePath.ForeColor = System.Drawing.Color.White; + this.btnChoosePath.HoverColor = System.Drawing.Color.Empty; + this.btnChoosePath.Icon = null; + this.btnChoosePath.Location = new System.Drawing.Point(730, 241); + this.btnChoosePath.Name = "btnChoosePath"; + this.btnChoosePath.Progress = 0; + this.btnChoosePath.ProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(103)))), ((int)(((byte)(205))))); + this.btnChoosePath.Size = new System.Drawing.Size(32, 25); + this.btnChoosePath.TabIndex = 2; + this.btnChoosePath.Text = "..."; + this.btnChoosePath.UseVisualStyleBackColor = true; + this.btnChoosePath.UseWindowsAccentColor = true; + this.btnChoosePath.Click += new System.EventHandler(this.BtnChoosePath_Click); + // + // lblVariable + // + this.lblVariable.Anchor = System.Windows.Forms.AnchorStyles.None; + this.lblVariable.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lblVariable.Location = new System.Drawing.Point(95, 158); + this.lblVariable.Name = "lblVariable"; + this.lblVariable.Size = new System.Drawing.Size(135, 26); + this.lblVariable.TabIndex = 3; + this.lblVariable.Text = "Variable"; + this.lblVariable.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // lblPath + // + this.lblPath.Anchor = System.Windows.Forms.AnchorStyles.None; + this.lblPath.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lblPath.Location = new System.Drawing.Point(95, 241); + this.lblPath.Name = "lblPath"; + this.lblPath.Size = new System.Drawing.Size(135, 25); + this.lblPath.TabIndex = 4; + this.lblPath.Text = "Path"; + this.lblPath.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // pictureBox1 + // + this.pictureBox1.BackgroundImage = global::SuchByte.MacroDeck.Properties.Resources.Arrow_Down_Hover; + this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; + this.pictureBox1.Location = new System.Drawing.Point(404, 190); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(48, 45); + this.pictureBox1.TabIndex = 11; + this.pictureBox1.TabStop = false; + // + // SaveVariableToFileActionConfigView + // + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; + this.Controls.Add(this.pictureBox1); + this.Controls.Add(this.lblPath); + this.Controls.Add(this.lblVariable); + this.Controls.Add(this.btnChoosePath); + this.Controls.Add(this.variable); + this.Controls.Add(this.path); + this.Name = "SaveVariableToFileActionConfigView"; + this.Load += new System.EventHandler(this.SaveVariableToFileActionConfigView_Load); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private SuchByte.MacroDeck.GUI.CustomControls.RoundedTextBox path; + private SuchByte.MacroDeck.GUI.CustomControls.RoundedComboBox variable; + private SuchByte.MacroDeck.GUI.CustomControls.ButtonPrimary btnChoosePath; + private System.Windows.Forms.Label lblVariable; + private System.Windows.Forms.Label lblPath; + private System.Windows.Forms.PictureBox pictureBox1; + } +} diff --git a/InternalPlugins/Variables/Views/SaveVariableToFileActionConfigView.cs b/InternalPlugins/Variables/Views/SaveVariableToFileActionConfigView.cs new file mode 100644 index 00000000..97bc2576 --- /dev/null +++ b/InternalPlugins/Variables/Views/SaveVariableToFileActionConfigView.cs @@ -0,0 +1,58 @@ +using SuchByte.MacroDeck.GUI.CustomControls; +using SuchByte.MacroDeck.Language; +using SuchByte.MacroDeck.Plugins; +using SuchByte.MacroDeck.Variables.Plugin.ViewModels; +using System; +using System.Windows.Forms; + +namespace SuchByte.MacroDeck.Variables.Plugin.Views +{ + public partial class SaveVariableToFileActionConfigView : ActionConfigControl + { + private readonly SaveVariableToFileActionConfigViewModel _viewModel; + + + public SaveVariableToFileActionConfigView(PluginAction pluginAction) + { + InitializeComponent(); + this.lblVariable.Text = LanguageManager.Strings.Variable; + this.lblPath.Text = LanguageManager.Strings.Path; + + this._viewModel = new SaveVariableToFileActionConfigViewModel(pluginAction); + } + + private void SaveVariableToFileActionConfigView_Load(object sender, EventArgs e) + { + foreach (var variable in VariableManager.ListVariables) + { + this.variable.Items.Add(variable.Name); + } + + this.variable.Text = this._viewModel.Variable; + this.path.Text = this._viewModel.FilePath; + } + + public override bool OnActionSave() + { + this._viewModel.Variable = this.variable.Text; + this._viewModel.FilePath = this.path.Text; + return this._viewModel.SaveConfig(); + } + + private void BtnChoosePath_Click(object sender, EventArgs e) + { + using (var saveFileDialog = new SaveFileDialog() + { + AddExtension = true, + DefaultExt = ".txt", + Filter = "Text file (*.txt)|*.txt|Any (*.*)|*.*", + }) + { + if (saveFileDialog.ShowDialog() == DialogResult.OK) + { + this.path.Text = saveFileDialog.FileName; + } + } + } + } +} diff --git a/InternalPlugins/Variables/Views/SaveVariableToFileActionConfigView.resx b/InternalPlugins/Variables/Views/SaveVariableToFileActionConfigView.resx new file mode 100644 index 00000000..f298a7be --- /dev/null +++ b/InternalPlugins/Variables/Views/SaveVariableToFileActionConfigView.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/LICENSE b/LICENSE index 261eeb9e..4772259d 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2022 Manuel Mayer Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Language/Strings.cs b/Language/Strings.cs index aa0dca1a..ac21ba08 100644 --- a/Language/Strings.cs +++ b/Language/Strings.cs @@ -327,5 +327,34 @@ public class Strings public string Grid = "Grid"; public string ActionReadVariableFromFile = "Read variable from file"; public string ActionReadVariableFromFileDescription = "Reads a file and sets the content as value for a variable"; +<<<<<<< HEAD + public string ActionSetProfile = "Set profile"; + public string ActionSetProfileDescription = "Sets the profile on a device"; + public string Device = "Device"; + public string WhereExecuted = "Where executed"; + public string ActionSetBrightness = "Set brightness"; + public string ActionSetBrightnessDescription = "Sets the display brightness (Only on the Android app!)"; + public string BindableVariable = "Bindable variable"; + public string BindableVariableInfo = "The state of this button can be bound to the variable {0}. Do you want to bind the state?"; + public string Cancelled = "Cancelled"; + public string Preparing = "Preparing..."; + public string Installing = "Installing..."; + public string Completed = "Completed"; + public string ExtensionStoreDownloaderPackageIdVersion = "{0} version {1}"; + public string DownloadingAndInstallingXPackages = "Downloading and installing {0} package(s)"; + public string InstallationOfXPackagesDone = "Installation of {0} package(s) done"; + public string ActionSetBackgroundColor = "Set background color"; + public string ActionSetBackgroundColorDescription = "Changes the background color of a action button"; + public string Fixed = "Fixed"; + public string Random = "Random"; + public string NewConnectionRequest = "New connection request"; + public string ClientId = "Client id"; + public string Accept = "Accept"; + public string Deny = "Deny"; + public string VersionBuild = "Build"; + public string OpenExtensionManager = "Open Extension Manager"; + public string OpenSettings = "Open settings"; +======= +>>>>>>> origin/main } } diff --git a/Logging/MacroDeckLogger.cs b/Logging/MacroDeckLogger.cs index cc49946c..77896e8a 100644 --- a/Logging/MacroDeckLogger.cs +++ b/Logging/MacroDeckLogger.cs @@ -1,4 +1,6 @@ -using SuchByte.MacroDeck.GUI.Dialogs; +using SuchByte.MacroDeck.GUI.CustomControls; +using SuchByte.MacroDeck.GUI.Dialogs; +using SuchByte.MacroDeck.Notifications; using SuchByte.MacroDeck.Plugins; using System; using System.Collections.Generic; @@ -13,31 +15,10 @@ namespace SuchByte.MacroDeck.Logging { public static class MacroDeckLogger { - public static event EventHandler OnWarningOrError; - private static LogLevel _logLevel = LogLevel.Info; private static DebugConsole _debugConsole; - private static int _errors = 0; - - private static int _warnings = 0; - - public static int Errors - { - get - { - return _errors; - } - } - - public static int Warnings - { - get - { - return _warnings; - } - } public static void StartDebugConsole() @@ -214,25 +195,34 @@ internal static void Error(string message) Log("Macro Deck", LogLevel.Error, message); } + private static void OpenLatestLog() + { + var p = new Process + { + StartInfo = new ProcessStartInfo(CurrentFilename) + { + UseShellExecute = true, + } + }; + p.Start(); + } private static void Log(string sender, LogLevel logLevel, string message) { - switch (logLevel) + if (logLevel == LogLevel.Error) { - case LogLevel.Warning: - _warnings++; - if (OnWarningOrError != null) - { - OnWarningOrError(message, EventArgs.Empty); - } - break; - case LogLevel.Error: - _errors++; - if (OnWarningOrError != null) - { - OnWarningOrError(message, EventArgs.Empty); - } - break; + var btnShowLog = new ButtonPrimary() + { + Size = new Size(75, 25), + AutoSize = true, + Text = "Show log" + }; + btnShowLog.Click += (sender, e) => + { + OpenLatestLog(); + }; + + NotificationManager.SystemNotification("Error", $"{sender} caused an error: {TruncateForDisplay(message, 250)}", controls: new List() { btnShowLog }, icon: Properties.Resources.Macro_Deck_error); } if ((!Debugger.IsAttached && !FileLogging) || logLevel < LogLevel) return; @@ -275,6 +265,19 @@ private static void Log(string sender, LogLevel logLevel, string message) } } + private static string TruncateForDisplay(this string value, int length) + { + if (string.IsNullOrEmpty(value)) return string.Empty; + var returnValue = value; + if (value.Length > length) + { + var tmp = value.Substring(0, length); + if (tmp.LastIndexOf(' ') > 0) + returnValue = tmp.Substring(0, tmp.LastIndexOf(' ')) + " ..."; + } + return returnValue; + } + internal static string CurrentFilename { get diff --git a/Macro Deck 2.csproj b/Macro Deck 2.csproj index 8d87cb04..62cadc4f 100644 --- a/Macro Deck 2.csproj +++ b/Macro Deck 2.csproj @@ -1,5 +1,20 @@  + + + false + 0 + + 2 + 12 + 0 + + b$(BetaPatch) + $([System.DateTime]::UtcNow.ToString("yy"))$([System.DateTime]::UtcNow.DayOfYear.ToString("000"))$([System.DateTime]::UtcNow.ToString("HHmm")) + + +<<<<<<< HEAD +======= 2 10 3 @@ -9,24 +24,31 @@ WinExe +>>>>>>> origin/main netcoreapp3.1 - true + true SuchByte.MacroDeck - true + true appicon.ico SuchByte.MacroDeck.MacroDeck $(VersionMajor).$(VersionMinor).$(VersionPatch).$(VersionRevision) Macro Deck Manuel Mayer - false - SuchByte.pfx + true + Macro Deck.pfx Macro Deck 2.21.3110.100 - $(VersionMajor).$(VersionMinor).$(VersionPatch).$(VersionRevision) + $(VersionMajor).$(VersionMinor).$(VersionPatch).$(VersionRevision)$(VersionSuffix) Macro Deck 2 Apache-2.0 https://github.com/SuchByte/Macro-Deck https://github.com/SuchByte/Macro-Deck +<<<<<<< HEAD + win-x64 + AnyCPU;x64 + true + true +======= true app.manifest @@ -40,7 +62,19 @@ x64 win-x64 true +>>>>>>> origin/main + + + embedded + WinExe + + + + + true + + @@ -51,6 +85,10 @@ +<<<<<<< HEAD + +======= +>>>>>>> origin/main @@ -81,6 +119,10 @@ +<<<<<<< HEAD + +======= +>>>>>>> origin/main @@ -111,16 +153,24 @@ +<<<<<<< HEAD + +======= +>>>>>>> origin/main + +<<<<<<< HEAD + +======= C:\Users\Manuel\Desktop\decksurf-sdk-main\src\DeckSurf.SDK\bin\Debug\netcoreapp3.1\DeckSurf.SDK.dll @@ -128,6 +178,7 @@ +>>>>>>> origin/main UserControl @@ -168,5 +219,9 @@ + + + + \ No newline at end of file diff --git a/MacroDeck.cs b/MacroDeck.cs index 80d4983f..43d7c73e 100644 --- a/MacroDeck.cs +++ b/MacroDeck.cs @@ -4,14 +4,21 @@ using Newtonsoft.Json.Linq; using SuchByte.MacroDeck.Backups; using SuchByte.MacroDeck.Events; +using SuchByte.MacroDeck.ExtensionStore; using SuchByte.MacroDeck.GUI; using SuchByte.MacroDeck.GUI.CustomControls; using SuchByte.MacroDeck.GUI.Dialogs; using SuchByte.MacroDeck.GUI.MainWindowContents; using SuchByte.MacroDeck.Hotkeys; using SuchByte.MacroDeck.Icons; +using SuchByte.MacroDeck.Language; using SuchByte.MacroDeck.Logging; using SuchByte.MacroDeck.Model; +<<<<<<< HEAD +using SuchByte.MacroDeck.Models; +using SuchByte.MacroDeck.Notifications; +======= +>>>>>>> origin/main using SuchByte.MacroDeck.Pipes; using SuchByte.MacroDeck.Plugins; using SuchByte.MacroDeck.Profiles; @@ -37,11 +44,14 @@ namespace SuchByte.MacroDeck public class MacroDeck : NativeWindow { static Assembly assembly = Assembly.GetExecutingAssembly(); - internal static readonly string VersionString = FileVersionInfo.GetVersionInfo(assembly.Location).ProductVersion; - internal static readonly int BuildVersion = Int32.Parse(VersionString.Split(".")[3].ToString()); + public static readonly VersionModel Version = new VersionModel(FileVersionInfo.GetVersionInfo(assembly.Location).FileVersion); public static readonly int ApiVersion = 20; +<<<<<<< HEAD + public static readonly int PluginApiVersion = 36; +======= public static readonly int PluginApiVersion = 33; +>>>>>>> origin/main // Start parameters internal static bool ForceUpdate = false; @@ -96,6 +106,8 @@ private static void InitializePaths(bool portable) public static event EventHandler OnMainWindowLoad; + public static event EventHandler OnMacroDeckLoaded; + private static Configuration.Configuration _configuration = new Configuration.Configuration(); public static Configuration.Configuration Configuration { get { return _configuration; } } @@ -105,7 +117,11 @@ private static void InitializePaths(bool portable) private static NotifyIcon _trayIcon = new NotifyIcon { Icon = Properties.Resources.appicon, +<<<<<<< HEAD + Text = "Macro Deck " + Version.VersionString, +======= Text = "Macro Deck " + VersionString, +>>>>>>> origin/main Visible = false, ContextMenuStrip = _trayIconContextMenu }; @@ -218,7 +234,7 @@ static void Main(string[] args) InitializePaths(PortableMode); MacroDeckLogger.Info(Environment.NewLine + "=========================================="); - MacroDeckLogger.Info("Starting Macro Deck version " + VersionString + (args.Length > 0 ? " with parameters: " + string.Join(" ", args) : "")); + MacroDeckLogger.Info("Starting Macro Deck version " + Version.VersionString + " build " + Version.Build + (args.Length > 0 ? " with parameters: " + string.Join(" ", args) : "")); MacroDeckLogger.Info("Executable: " + ExecutablePath); MacroDeckLogger.Info("OS: " + OperatingSystemInformation.GetWindowsVersionName()); string networkInterfaces = ""; @@ -309,7 +325,10 @@ static void Main(string[] args) IconManagerLegacy.ConvertOldIconPacks(); } +<<<<<<< HEAD +======= BackupManager.CheckRestoreDirectory(); +>>>>>>> origin/main if (!Directory.Exists(TempDirectoryPath)) @@ -351,6 +370,9 @@ static void Main(string[] args) } } + + BackupManager.CheckRestoreDirectory(); + Language.LanguageManager.Load(ExportDefaultStrings); if (IsAdministrator()) @@ -432,8 +454,12 @@ public static void SaveConfiguration() private static void Start(bool show = false, int port = -1) { Language.LanguageManager.SetLanguage(_configuration.Language); +<<<<<<< HEAD + Colors.Initialize(); +======= +>>>>>>> origin/main _ = new HotkeyManager(); - VariableManager.Load(); + VariableManager.Initialize(); PluginManager.Load(); PluginManager.OnUpdateCheckFinished += OnPackageManagerUpdateCheckFinished; PluginManager.EnablePlugins(); @@ -442,16 +468,38 @@ private static void Start(bool show = false, int port = -1) MacroDeckServer.Start(_configuration.Host_Address, port == -1 ? _configuration.Host_Port : port); BroadcastServer.Start(); - - Updater.Updater.Initialize(ForceUpdate, TestUpdateChannel); - Updater.Updater.OnUpdateAvailable += OnUpdateAvailable; + ADBServerHelper.Initialize(); ProfileManager.AddVariableChangedListener(); ProfileManager.AddWindowFocusChangedListener(); +<<<<<<< HEAD + MacroDeckPipeServer.Initialize(); + MacroDeckPipeServer.PipeMessage += MacroDeckPipeServer_PipeMessage; + + CreateTrayIcon(); + + using (mainWindow = new MainWindow()) + { + SyncContext = SynchronizationContext.Current; + } + + long startTook = DateTimeOffset.Now.ToUnixTimeMilliseconds() - _macroDeckStarted; + MacroDeckLogger.Info($"Macro Deck startup finished (took {startTook}ms)"); + + if (OnMacroDeckLoaded != null) + { + OnMacroDeckLoaded(null, EventArgs.Empty); + } + + Updater.Updater.OnUpdateAvailable += OnUpdateAvailable; + Updater.Updater.Initialize(ForceUpdate, TestUpdateChannel); + ExtensionStoreHelper.SearchUpdatesAsync(); +======= Colors.Initialize(); MacroDeckLogger.Info("Macro Deck started successfully"); +>>>>>>> origin/main MacroDeckPipeServer.Initialize(); MacroDeckPipeServer.PipeMessage += MacroDeckPipeServer_PipeMessage; @@ -490,10 +538,28 @@ private static void OnUpdateAvailable(object sender, EventArgs e) JObject versionObject = sender as JObject; try { - _trayIcon.ShowBalloonTip(5000, "Macro Deck Updater", String.Format(Language.LanguageManager.Strings.VersionXIsNowAvailable, versionObject["version"].ToString(), versionObject["channel"].ToString()), ToolTipIcon.Info); + var btnOpenSettings = new ButtonPrimary() + { + AutoSize = true, + Text = LanguageManager.Strings.OpenSettings, + }; + btnOpenSettings.Click += (sender, e) => + { + MainWindow?.SetView(new SettingsView(2)); + }; + NotificationManager.SystemNotification("Macro Deck Updater", string.Format(Language.LanguageManager.Strings.VersionXIsNowAvailable, versionObject["version"].ToString(), versionObject["channel"].ToString()), true, new List() { btnOpenSettings }, Properties.Resources.Macro_Deck_2021_update); } catch { } } + internal static void ShowBalloonTip(string title, string message) + { + try + { + _trayIcon?.ShowBalloonTip(5000, title, message, ToolTipIcon.Info); + } + catch { } + } + private static void CreateTrayIcon() { _trayIcon.Visible = true; @@ -544,7 +610,7 @@ public static void RestartMacroDeck(string parameters = "") StartInfo = new ProcessStartInfo(ExecutablePath) { UseShellExecute = true, - Arguments = (mainWindow != null && !mainWindow.IsDisposed ? "--show " : "") + parameters + Arguments = (mainWindow != null && !mainWindow.IsDisposed ? "--show " : "") + string.Join(" ", StartParameters), } }; p.Start(); @@ -568,6 +634,23 @@ private static void OnTrayIconMouseDown(object sender, MouseEventArgs e) public static void ShowMainWindow() { if (SyncContext == null) +<<<<<<< HEAD + { + CreateMainForm(); + } else + { + SyncContext.Send(o => + { + CreateMainForm(); + }, null); + } + } + + private static void CreateMainForm() + { + if (Application.OpenForms.OfType().Count() > 0 && mainWindow != null && !mainWindow.IsDisposed) + { +======= { CreateMainForm(); } else @@ -585,6 +668,7 @@ private static void CreateMainForm() { if (Application.OpenForms.OfType().Count() > 0 && mainWindow != null && !mainWindow.IsDisposed) { +>>>>>>> origin/main if (mainWindow.InvokeRequired) { mainWindow.Invoke(new Action(() => ShowMainWindow())); @@ -608,7 +692,6 @@ private static void MainWindow_FormClosed(object sender, FormClosedEventArgs e) mainWindow.Load -= MainWindowLoadEvent; mainWindow.FormClosed -= MainWindow_FormClosed; mainWindow.Dispose(); - MacroDeckLogger.Trace("MainWindow disposed"); } private static void MainWindowLoadEvent(object sender, EventArgs e) @@ -622,7 +705,7 @@ private static void MainWindowLoadEvent(object sender, EventArgs e) private static void OnApplicationExit(object sender, EventArgs e) { - VariableManager.Save(); + //VariableManager.Save(); MacroDeckLogger.Info("Exiting Macro Deck..."); } diff --git a/Models/ExtensionStoreExtensionModel.cs b/Models/ExtensionStoreExtensionModel.cs index 8c0b5c5d..636a5dbc 100644 --- a/Models/ExtensionStoreExtensionModel.cs +++ b/Models/ExtensionStoreExtensionModel.cs @@ -8,7 +8,10 @@ namespace SuchByte.MacroDeck.Model { public class ExtensionStoreExtensionModel { +<<<<<<< HEAD +======= +>>>>>>> origin/main [JsonProperty("package-id")] public string PackageId { get; set; } = ""; @@ -36,5 +39,11 @@ public class ExtensionStoreExtensionModel [JsonProperty("md5")] public string Md5Checksum { get; set; } = ""; +<<<<<<< HEAD + [JsonProperty("icon")] + public string IconBase64 { get; set; } = ""; + +======= +>>>>>>> origin/main } } diff --git a/Models/NotificationModel.cs b/Models/NotificationModel.cs new file mode 100644 index 00000000..1ac89aa7 --- /dev/null +++ b/Models/NotificationModel.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Runtime.InteropServices; +using System.Text; +using System.Windows.Forms; + +namespace SuchByte.MacroDeck.Models +{ + public class NotificationModel + { + public string SenderName { get; set; } + + public string Title { get; set; } + + public string Message { get; set; } + + public string Id { get; set; } = Guid.NewGuid().ToString(); + + public long Timestamp = DateTimeOffset.Now.ToUnixTimeSeconds(); + + public List AdditionalControls { get; set; } + + public Bitmap Icon { get; set; } + + + } +} diff --git a/Models/VariableViewCreatorFilterModel.cs b/Models/VariableViewCreatorFilterModel.cs new file mode 100644 index 00000000..4be83555 --- /dev/null +++ b/Models/VariableViewCreatorFilterModel.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; + +namespace SuchByte.MacroDeck.Models +{ + public class VariableViewCreatorFilterModel : ISerializableConfiguration + { + public List HiddenCreators { get; set; } = new List(); + + public string Serialize() + { + return JsonSerializer.Serialize(this); + } + + public static VariableViewCreatorFilterModel Deserialize(string config) + { + return ISerializableConfiguration.Deserialize(config); + } + } +} diff --git a/Models/VersionModel.cs b/Models/VersionModel.cs new file mode 100644 index 00000000..ee71557b --- /dev/null +++ b/Models/VersionModel.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Text; + +namespace SuchByte.MacroDeck.Models +{ + public class VersionModel + { + public string VersionString { get; private set; } + + public int BetaPatch { get; private set; } = 0; + + public bool IsBeta { get; private set; } = false; + + public int Build { get; private set; } + + + public VersionModel(string versionString) + { + string[] versionArray = versionString.Split("."); + IsBeta = versionString.Contains("b"); + if (IsBeta) + { + if(Int32.TryParse(versionString.Substring(versionString.IndexOf("b") + 1), out int betaRevision)) + { + this.BetaPatch = betaRevision; + } + if (Int32.TryParse(versionArray[3].Substring(0, versionArray[3].IndexOf("b")), out int build)) + { + this.Build = build; + } + } else + { + if (Int32.TryParse(versionArray[3], out int build)) + { + this.Build = build; + } + } + VersionString = $"{versionArray[0]}.{versionArray[1]}.{versionArray[2]}{(IsBeta ? $"b{BetaPatch}" : "")}{(Debugger.IsAttached ? " (debug)" : "")}"; + + } + + + } +} diff --git a/Notifications/NotificationManager.cs b/Notifications/NotificationManager.cs new file mode 100644 index 00000000..0cb03f25 --- /dev/null +++ b/Notifications/NotificationManager.cs @@ -0,0 +1,123 @@ +using SuchByte.MacroDeck.Models; +using SuchByte.MacroDeck.Plugins; +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace SuchByte.MacroDeck.Notifications +{ + public class NotificationEventArgs : EventArgs + { + public NotificationModel Notification { get; set; } + } + + public class NotificationRemovedEventArgs : EventArgs + { + public string Id { get; set; } + } + + + public class NotificationManager + { + public static EventHandler OnNotification; + + public static EventHandler OnNotificationRemoved; + + private static List _notifications = new List(); + + internal static List Notifications + { + get => _notifications; + } + + /// + /// Returns the notification + /// + public static NotificationModel GetNotification(string id) + { + return _notifications.Find(x => x.Id == id); + } + + /// + /// Returns the id of the notification + /// + public static string Notify(MacroDeckPlugin macroDeckPlugin, string title, string message, bool showBalloonTip = false, List controls = null) + { + var notificationModel = new NotificationModel() + { + SenderName = macroDeckPlugin.Name, + Title = title, + Message = message, + AdditionalControls = controls, + Icon = (Bitmap)macroDeckPlugin.PluginIcon + }; + + Notify(notificationModel, showBalloonTip); + + return notificationModel.Id; + } + + /// + /// Removes a notification + /// + public static void RemoveNotification(NotificationModel notificationModel) + { + if (notificationModel == null || !_notifications.Contains(notificationModel)) return; + _notifications.Remove(notificationModel); + + if (OnNotificationRemoved != null) + { + OnNotificationRemoved(null, new NotificationRemovedEventArgs() { Id = notificationModel.Id }); + } + } + + /// + /// Removes a notification + /// + public static void RemoveNotification(string id) + { + RemoveNotification(_notifications.Find(x => x.Id == id)); + } + + internal static string SystemNotification(string title, string message, bool showBalloonTip = false, List controls = null, Bitmap icon = null) + { + var notificationModel = new NotificationModel() + { + SenderName = "Macro Deck", + Title = title, + Message = message, + AdditionalControls = controls, + Icon = icon == null ? Properties.Resources.Macro_Deck_2021 : icon + }; + + Notify(notificationModel, showBalloonTip); + + return notificationModel.Id; + } + + private static void Notify(NotificationModel notificationModel, bool showBalloonTip) + { + if (_notifications.Find(x => x.Id == notificationModel.Id) != null) return; + if (_notifications.FindAll(x => x.SenderName == notificationModel.SenderName).Count >= 5) return; + + _notifications.Add(notificationModel); + + MacroDeck.SyncContext?.Send(o => + { + if (OnNotification != null) + { + OnNotification(null, new NotificationEventArgs() { Notification = notificationModel }); + } + }, null); + + + if (showBalloonTip) + { + MacroDeck.ShowBalloonTip($"{notificationModel.SenderName}: {notificationModel.Title}", notificationModel.Message); + } + } + + } +} diff --git a/Plugins/MacroDeckPlugin.cs b/Plugins/MacroDeckPlugin.cs index 32771823..057709db 100644 --- a/Plugins/MacroDeckPlugin.cs +++ b/Plugins/MacroDeckPlugin.cs @@ -127,6 +127,12 @@ public ActionButton.ActionButton ActionButton } } + + /// + /// Returns a variable name which can be bound to the button state + /// + public virtual string BindableVariable { get; set; } + /// /// Gets called when the action button gets deleted /// diff --git a/Plugins/PluginManager.cs b/Plugins/PluginManager.cs index 5982437c..500ece6e 100644 --- a/Plugins/PluginManager.cs +++ b/Plugins/PluginManager.cs @@ -1,5 +1,9 @@ using Newtonsoft.Json.Linq; using SuchByte.MacroDeck.ExtensionStore; +<<<<<<< HEAD +using SuchByte.MacroDeck.InternalPlugins.DevicePlugin; +======= +>>>>>>> origin/main using SuchByte.MacroDeck.Logging; using SuchByte.MacroDeck.Model; using SuchByte.MacroDeck.Utils; @@ -140,6 +144,7 @@ public static void Load() AddPlugin(new ActionButton.ActionButtonPlugin(), true); AddPlugin(new Variables.Plugin.VariablesPlugin(), true); AddPlugin(new Folders.Plugin.FolderPlugin(), true); + AddPlugin(new DevicePlugin(), true); } private static MacroDeckPlugin LoadPlugin(ExtensionManifestModel extensionManifest, string pluginDirectory, bool enable = false) @@ -187,6 +192,8 @@ private static MacroDeckPlugin LoadPlugin(ExtensionManifestModel extensionManife Name = asm.GetName().Name, Version = FileVersionInfo.GetVersionInfo(asm.Location).ProductVersion, Author = extensionManifest.Author, +<<<<<<< HEAD +======= }; PluginsNotLoaded[disabledPlugin.Name] = disabledPlugin; @@ -246,6 +253,7 @@ private static MacroDeckPlugin LoadLegacyPlugin(PluginManifest pluginManifest, s Name = asm.GetName().Name, Version = FileVersionInfo.GetVersionInfo(asm.Location).ProductVersion, Author = pluginManifest.Author, +>>>>>>> origin/main }; PluginsNotLoaded[disabledPlugin.Name] = disabledPlugin; @@ -263,26 +271,69 @@ private static MacroDeckPlugin LoadLegacyPlugin(PluginManifest pluginManifest, s return null; } - public static void ScanUpdatesAsync() + [Obsolete("Will be removed in version 2.11.0")] + private static MacroDeckPlugin LoadLegacyPlugin(PluginManifest pluginManifest, string pluginDirectory, bool enable = false) { - PluginsUpdateAvailable.Clear(); - Task.Run(() => + Assembly asm = null; + try { - foreach (MacroDeckPlugin plugin in Plugins.Values) - { - SearchUpdate(plugin); - } - foreach (MacroDeckPlugin plugin in PluginsNotLoaded.Values) + asm = Assembly.LoadFrom(Path.Combine(pluginDirectory, pluginManifest.MainFile)); + MacroDeckLogger.Info("Loading legacy plugin " + asm.GetName().Name); + + foreach (var type in asm.GetTypes()) { - SearchUpdate(plugin); + try + { + if (type.IsClass && type.IsSubclassOf(typeof(MacroDeckPlugin))) + { + var plugin = Activator.CreateInstance(type) as MacroDeckPlugin; + AddPlugin(plugin); + PluginDirectories[plugin] = pluginDirectory; + Task.Run(() => + SearchUpdate(plugin) + ); + plugin.Author = pluginManifest.Author; + if (enable) plugin.Enable(); + return plugin; + } + } + catch (Exception ex) + { + MacroDeckLogger.Error("Error while loading legacy plugin: " + ex.Message); + } } - if (OnUpdateCheckFinished != null) + } + catch (Exception ex) + { + MacroDeckLogger.Error("Error while loading legacy plugin: " + ex.Message); + if (asm != null) { - OnUpdateCheckFinished(null, EventArgs.Empty); + var disabledPlugin = new DisabledPlugin + { + Name = asm.GetName().Name, + Version = FileVersionInfo.GetVersionInfo(asm.Location).ProductVersion, + Author = pluginManifest.Author, + }; + + PluginsNotLoaded[disabledPlugin.Name] = disabledPlugin; + PluginDirectories[disabledPlugin] = pluginDirectory; + + MacroDeck.SafeMode = true; + + using (var msgBox = new GUI.CustomControls.MessageBox()) + { + msgBox.ShowDialog(Language.LanguageManager.Strings.ErrorWhileLoadingPlugins, String.Format(Language.LanguageManager.Strings.PluginXCouldNotBeLoaded, disabledPlugin.Name, disabledPlugin.Version), MessageBoxButtons.OK); + } + return disabledPlugin; } - }); + } + return null; } +<<<<<<< HEAD + +======= +>>>>>>> origin/main internal static void SearchUpdate(MacroDeckPlugin plugin) { if (UpdatedPlugins.Contains(plugin) || ProtectedPlugins.Contains(plugin)) return; @@ -419,16 +470,20 @@ internal static void InstallPlugin(string directory, string packageName) var plugin = LoadPlugin(extensionManifest, installationDirectory, true); - if (plugin != null && plugin.CanConfigure) + try { - using (var msgBox = new GUI.CustomControls.MessageBox()) + if (plugin != null && plugin.CanConfigure) { - if (msgBox.ShowDialog(Language.LanguageManager.Strings.PluginNeedsConfiguration, String.Format(Language.LanguageManager.Strings.ConfigureNow, plugin.Name), MessageBoxButtons.YesNo) == DialogResult.Yes) + using (var msgBox = new GUI.CustomControls.MessageBox()) { - plugin.OpenConfigurator(); + if (msgBox.ShowDialog(Language.LanguageManager.Strings.PluginNeedsConfiguration, String.Format(Language.LanguageManager.Strings.ConfigureNow, plugin.Name), MessageBoxButtons.YesNo) == DialogResult.Yes) + { + plugin.OpenConfigurator(); + } } } - } + } catch { } + } } catch diff --git a/Profiles/ProfileManager.cs b/Profiles/ProfileManager.cs index f154889d..97e1ffb8 100644 --- a/Profiles/ProfileManager.cs +++ b/Profiles/ProfileManager.cs @@ -63,7 +63,7 @@ private static void OnWindowFocusChanged(object sender, EventArgs e) foreach (string macroDeckDevice in macroDeckFolder.ApplicationsFocusDevices.FindAll(delegate (string macroDeckDeviceClientId) { if (DeviceManager.GetMacroDeckDevice(macroDeckDeviceClientId) == null) return false; - return DeviceManager.GetMacroDeckDevice(macroDeckDeviceClientId).Available && !String.IsNullOrWhiteSpace(DeviceManager.GetMacroDeckDevice(macroDeckDeviceClientId).ClientId); + return DeviceManager.GetMacroDeckDevice(macroDeckDeviceClientId).Available && !string.IsNullOrWhiteSpace(DeviceManager.GetMacroDeckDevice(macroDeckDeviceClientId).ClientId); })) { MacroDeckClient macroDeckClient = MacroDeckServer.GetMacroDeckClient(DeviceManager.GetMacroDeckDevice(macroDeckDevice).ClientId); @@ -74,15 +74,11 @@ private static void OnWindowFocusChanged(object sender, EventArgs e) } } } - - GC.Collect(); - GC.WaitForPendingFinalizers(); - GC.Collect(); } private static void VariableChanged(object sender, EventArgs e) { - Variable variable = sender as Variable; + var variable = sender as Variable; if (variable != null) { UpdateAllVariableLabels(variable); @@ -91,19 +87,17 @@ private static void VariableChanged(object sender, EventArgs e) public static void UpdateAllVariableLabels(Variable variable) { - Task.Run(() => + Parallel.ForEach(_profiles, macroDeckProfile => { - foreach (MacroDeckProfile macroDeckProfile in _profiles) + Parallel.ForEach(macroDeckProfile.Folders, macroDeckFolder => { - foreach (MacroDeckFolder macroDeckFolder in macroDeckProfile.Folders) + Parallel.ForEach(macroDeckFolder.ActionButtons.FindAll(x => (x.LabelOff != null && !string.IsNullOrWhiteSpace(x.LabelOff.LabelText) && x.LabelOff.LabelText.Contains(variable.Name.ToLower(), StringComparison.OrdinalIgnoreCase)) || + (x.LabelOn != null && !string.IsNullOrWhiteSpace(x.LabelOn.LabelText) && x.LabelOn.LabelText.Contains(variable.Name.ToLower(), StringComparison.OrdinalIgnoreCase))).ToArray(), + actionButton => { - foreach (ActionButton.ActionButton actionButton in macroDeckFolder.ActionButtons.FindAll(x => (x.LabelOff != null && !String.IsNullOrWhiteSpace(x.LabelOff.LabelText) && x.LabelOff.LabelText.Contains(variable.Name.ToLower(), StringComparison.OrdinalIgnoreCase)) || - (x.LabelOn != null && !String.IsNullOrWhiteSpace(x.LabelOn.LabelText) && x.LabelOn.LabelText.Contains(variable.Name.ToLower(), StringComparison.OrdinalIgnoreCase))).ToArray()) - { - UpdateVariableLabels(actionButton); - } - } - } + UpdateVariableLabels(actionButton); + }); + }); }); } @@ -397,8 +391,6 @@ public static void DeleteProfile(MacroDeckProfile macroDeckProfile) DeviceManager.SetProfile(macroDeckDevice, _profiles[0]); } - - MacroDeckLogger.Info("Delete profile " + macroDeckProfile.DisplayName); macroDeckProfile.Dispose(); diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs index e3e22b54..43dbde56 100644 --- a/Properties/Resources.Designer.cs +++ b/Properties/Resources.Designer.cs @@ -190,6 +190,16 @@ public static System.Drawing.Bitmap Backup_Restore { } } + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap Bell { + get { + object obj = ResourceManager.GetObject("Bell", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. /// @@ -373,6 +383,19 @@ public static System.Drawing.Bitmap giphy1 { /// /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. /// +<<<<<<< HEAD + public static System.Drawing.Bitmap GitHub_Mark_Light { + get { + object obj = ResourceManager.GetObject("GitHub-Mark-Light", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// +======= +>>>>>>> origin/main public static System.Drawing.Bitmap Harddisk { get { object obj = ResourceManager.GetObject("Harddisk", resourceCulture); diff --git a/Properties/Resources.resx b/Properties/Resources.resx index 7d657e88..ae02a28f 100644 --- a/Properties/Resources.resx +++ b/Properties/Resources.resx @@ -151,8 +151,16 @@ ..\Resources\AlignCenter.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a +<<<<<<< HEAD + + ..\Resources\device manager.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Web.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a +======= ..\Resources\Arrow_Up_Normal.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a +>>>>>>> origin/main ..\Resources\WindowsDefenderSecurityAlert.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -172,6 +180,12 @@ ..\Resources\Macro Deck 2021.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\AlignBottom.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\GitHub-Mark-Light.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\Create_Normal.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -184,14 +198,17 @@ ..\Resources\Chevron-Right.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\Web.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Arrow_Up_Normal.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\deck.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a +<<<<<<< HEAD +======= ..\Resources\Macro-Deck-2021.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a +>>>>>>> origin/main ..\Resources\Keyboard.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -250,8 +267,8 @@ ..\Resources\Close_Normal.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\device manager.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Macro-Deck-2021.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\Macro Deck 2021 update.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -268,7 +285,12 @@ ..\Resources\Web2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a +<<<<<<< HEAD + + ..\Resources\Bell.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a +======= ..\Resources\AlignBottom.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a +>>>>>>> origin/main \ No newline at end of file diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs index afd45183..f01e3f3d 100644 --- a/Properties/Settings.Designer.cs +++ b/Properties/Settings.Designer.cs @@ -58,5 +58,17 @@ public string SelectedProfile { this["SelectedProfile"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string VariableViewSelectedFilter { + get { + return ((string)(this["VariableViewSelectedFilter"])); + } + set { + this["VariableViewSelectedFilter"] = value; + } + } } } diff --git a/Properties/Settings.settings b/Properties/Settings.settings index 751f35e6..9c32606f 100644 --- a/Properties/Settings.settings +++ b/Properties/Settings.settings @@ -11,5 +11,8 @@ + + + \ No newline at end of file diff --git a/Properties/launchSettings.json b/Properties/launchSettings.json index 10d70a68..3dc97626 100644 --- a/Properties/launchSettings.json +++ b/Properties/launchSettings.json @@ -2,7 +2,7 @@ "profiles": { "Macro Deck 2": { "commandName": "Project", - "commandLineArgs": "--show --export-default-strings --loglevel 1 --test-channel --debug-console", + "commandLineArgs": "--export-default-strings --loglevel 1 --test-channel --debug-console --force-update", "nativeDebugging": false }, "Macro Deck exe": { diff --git a/Resources/Bell.png b/Resources/Bell.png new file mode 100644 index 00000000..100ada55 Binary files /dev/null and b/Resources/Bell.png differ diff --git a/Resources/GitHub-Mark-Light.png b/Resources/GitHub-Mark-Light.png new file mode 100644 index 00000000..73db1f61 Binary files /dev/null and b/Resources/GitHub-Mark-Light.png differ diff --git a/Resources/Languages/Chinese.json b/Resources/Languages/Chinese.json new file mode 100644 index 00000000..40ea7e81 --- /dev/null +++ b/Resources/Languages/Chinese.json @@ -0,0 +1,323 @@ +{ + "__Language__": "Chinese", + "__LanguageCode__": "zh", + "__Author__": "暴白Blizzardwhite", + "NetworkAdapter": "网络适配器", + "IPAddress": "IP 地址", + "Port": "端口", + "Info": "信息", + "Error": "错误", + "Warning": "警告", + "ConfigureNetworkInfo": "请选择正确的网络适配器,否则客户端将无法连接至服务器。通常网络适配器的名称为“以太网(Ethernet)”或者“Wi-Fi(WLAN)”,IP地址形如“192.168.178.xxx”。\r\n\r\n Macro deck 的默认端口是8191。当有其他应用占用此端口时,您可以更改它。", + "AutomaticallyCheckUpdates": "自动检查更新", + "AutomaticallyStartWithWindows": "跟随Windows启动", + "Show": "配置 Macro Deck", + "Exit": "退出 Macro Deck", + "XUpdatesAvailable": "{0}个更新可用", + "Profile": "预设", + "Columns": "列数", + "Rows": "行数", + "Spacing": "间距", + "CornerRadius": "圆角大小", + "ButtonBackGround": "按钮背景", + "AreYouSure": "确定?", + "Behaviour": "行为", + "Plugins": "插件", + "IconPacks": "图标包", + "All": "全部", + "Updates": "更新", + "Installed": "已安装", + "Install": "安装", + "Search": "搜索...", + "Name": "名称", + "Type": "类型", + "Value": "值", + "Creator": "作者", + "Ok": "确定", + "FolderName": "文件夹名称", + "Never": "永不", + "OnApplicationFocus": "应用获得焦点时", + "Application": "应用", + "Devices": "设备", + "Create": "新建", + "Save": "保存", + "Appearance": "外观", + "ButtonState": "按钮状态", + "Label": "标签", + "Top": "顶部", + "Center": "中央", + "Bottom": "底部", + "Path": "路径", + "CurrentState": "当前状态", + "Off": "关", + "On": "开", + "DownloadAndInstall": "下载并安装", + "Downloading": "下载中...", + "Color": "颜色", + "IconPack": "图标包", + "Size": "尺寸", + "CurrentProgress": "当前进度", + "TotalProgress": "总进度", + "XDownloads": "下载{0}", + "Update": "更新", + "Plugin": "插件", + "MacroDeckNeedsARestart": "Macro Deck 需要重启", + "MacroDeckMustBeRestartedForTheChanges": "Macro Deck 需要重启使更改生效,现在重启 Macro Deck 吗?", + "Configure": "配置", + "Uninstall": "卸载", + "NotLoaded": "未加载", + "Yes": "是", + "No": "否", + "Status": "状态", + "BlockConnection": "阻止连接", + "Change": "更改", + "Id": "ID", + "Connected": "已连接", + "Disconnected": "连接断开", + "Trigger": "触发", + "Action": "动作", + "Condition": "条件", + "InstalledVersion": "已安装版本", + "UpdateChannel": "更新通道", + "CheckForUpdatesNow": "检查更新", + "Author": "作者", + "Version": "版本", + "TheFolderWillBeDeleted": "删除文件夹{0}和它的所有按钮。", + "TheProfileWillBeDeleted": "删除预设{0}和它的所有文件夹。", + "ServerOffline": "服务未运行", + "ServerRunning": "服务运行中", + "XPluginsLoaded": "{0}个插件已加载", + "XPluginsDisabled": "{0}个插件已禁用", + "XClientsConnected": "{0}个设备已连接", + "IpAddressHostNamePort": "IP地址/主机名 : 端口", + "InitialSetupButtonBack": "<- 上一步", + "InitialSetupButtonNext": "下一步 ->", + "InitialSetupButtonFinish": "完成", + "InitialSetupSelectLanguage": "选择语言", + "InitialSetupPage": "页面 {0}/{1}", + "InitialSetupWelcome": "欢迎使用 Macro Deck 2!", + "InitialSetupLetsConfigure": "开启与 Macro Deck 的旅程吧!", + "InitialSetupConfigureNetworkSettings": "更改您的网络设置", + "InitialSetupConfigureGridPreferences": "现在,让我们根据自己的喜好设置布局。", + "InitialSetupPickAllPluginsYouNeed": "选择您所需的插件", + "InitialSetupDontWorryInstallUninstallPlugins": "不用担心,您可以在包管理器内安装/卸载插件", + "InitialSetupWantSomeIcons": "您需要安装图标包吗?", + "InitialSetupInstallIconPacksPackageManager": "您也可以在包管理器内安装/卸载图标包", + "InitialSetupAlmostDone": "马上就要完成了!", + "KnownDevices": "已知设备", + "AskOnNewConnections": "有新设备连接时询问", + "AllowAllNewConnections": "允许所有新设备连接(不建议)", + "BlockAllNewConnections": "禁止所有新设备连接", + "InstallDLL": "安装 .dll 文件(不建议)", + "NeverInstallDLLFiles": "不要安装来源未经信任的 .dll 文件!未知来源的 .dll 文件可能会破坏您的电脑,只有当你知道你在做什么时,再安装 .dll 文件!确定要安装 .dll 插件?", + "XWillBeUninstalled": "{0}个插件将会被卸载。", + "XSuccessfullyUninstalled": "{0}个插件将会被卸载。Macro Deck 需要重启使更改生效,现在重启 Macro Deck 吗?", + "CreateVariable": "创建变量", + "DeleteVariable": "删除变量", + "SelectAPluginAndActionToBegin": "选择插件和操作以开始", + "ActionNeedsNoConfiguration": "这个操作不需要设置", + "CantCreateFolder": "无法创建文件夹", + "FolderCalledXAlreadyExists": "名为 {0} 的文件夹已经存在", + "OnPress": "按下按钮时", + "OnEvent": "在事件中", + "CantCreateIconPack": "不能创建图标包", + "IconPackCalledXAlreadyExists": "名为 {0} 的图标包已经存在", + "CantCreateProfile": "不能创建预设", + "ProfileCalledXAlreadyExists": "名为 {0} 的预设已经存在", + "TheresAnUpdateForYou": "有更新可用", + "VersionXIsNowAvailable": "版本 {0} ({1}) 现在可供下载", + "ReadyToDownloadUpdate": "准备好下载更新", + "DownloadingUpdate": "正在下载更新... {0}% ({1}MB/{2}MB)", + "VerifyingUpdateFile": "正在验证更新文件...", + "MD5NotValid": "MD5 验证未通过", + "StartingInstaller": "正在启动安装程序", + "FileNotFound": "未找到文件", + "TryAgainOrDownloadManually": "重新尝试更新或者自行下载安装更新", + "Trending": "预测", + "Layers": "层级", + "AddImage": "添加图像", + "IconImportQualityInfo": "过高质量的图标可能会影响内存占用和加载时间,特别是使用大量的高质量GIF图像。 \n\r\n\r 建议使用较低质量的GIF图像。", + "Original": "原始", + "High350px": "高 (350px)", + "Normal200px": "中 (200px)", + "Low150px": "低 (150px)", + "Lowest100px": "极低 (100px)", + "ImportIconPack": "导入图标包", + "ExportIconPack": "导出图标包", + "CreateIcon": "创建图标", + "ImportIcon": "导入图标", + "DeleteIcon": "删除图标", + "IconSelectorManagedInfo": "此图标包由插件管理器管理", + "DownloadingXPackages": "正在下载 {0} 个包", + "PluginCouldNotBeLoaded": "无法加载插件。已安装的插件版本可能与此版本的 Macro Deck 不兼容。", + "CantChangeName": "无法更改名称", + "DeviceCalledXAlreadyExists": "名为 {0} 的设备已经存在", + "NewConnection": "新连接", + "XIsAnUnknownDevice": "未知设备 {0} 想要连接到 Macro Deck。允许连接吗?", + "ShouldMacroDeckBlockConnectionsFromX": "是否自动阻止来自 {0} 的连接?", + "FailedToStartServer": "服务器无法启动。您设置的端口可能已被占用,或者网络适配器设置不正确。请确保在设置中选择了正确的网络适配器,然后尝试更改端口。", + "ErrorWhileLoadingPlugins": "加载插件时发生错误", + "PluginXCouldNotBeLoaded": "无法加载 {1} 版本的 {0},它可能与此版本的 Macro Deck 不兼容。在更新插件之前,使用此插件的操作将不起作用。", + "InstallationSuccessfull": "安装成功", + "PluginXInstalledSuccessfully": "{0} 已安装成功", + "ErrorWhileInstallingPlugin": "安装插件时发生错误", + "PluginXCouldNotBeInstalled": "无法安装 {0} ,它可能与此版本的 Macro Deck 不兼容。", + "Settings": "设置", + "Language": "语言", + "General": "General", + "Connection": "连接", + "Backup": "备份", + "About": "关于", + "NoUpdatesAvailable": "无更新可用", + "LatestVersionInstalled": "已经是最新版本", + "WarningDevVersions": "开发版本的 Macro Deck 不稳定,可能会导致崩溃和数据丢失(设置的操作按钮、文件夹和配置文件),您真的要启用开发版更新通道吗?", + "WarningBetaVersions": "测试版本的 Macro Deck 不太稳定,可能会导致崩溃,您真的启用测试版更新频道吗?", + "VariableXGetsDeleted": "变量 {0} 已被删除", + "DeckTitle": "Deck", + "DeviceManagerTitle": "设备管理", + "PackageManagerTitle": "拓展包管理", + "SettingsTitle": "设置", + "VariablesTitle": "全局变量", + "Edit": "编辑", + "Delete": "删除", + "Run": "运行", + "Copy": "复制", + "Paste": "粘贴", + "WebSocketAPIVersion": "Websocket API 版本", + "PluginAPIVersion": "插件 API 版本", + "InstalledPlugins": "已安装的插件", + "OperatingSystem": "操作系统", + "DevelopedByX": "由 {0} 在德国开发", + "XTranslationByX": "{0} 由 {1} 翻译", + "PackageManagerTabAvailable": "可用", + "PackageManagerTabInstalled": "已安装", + "Event": "事件", + "AutomaticallySwitchToFolder": "自动切换到文件夹", + "Restart": "重启 Macro Deck", + "Delay": "延迟", + "If": "If", + "Else": "Else", + "Online": "在线", + "By": "由", + "StateBinding": "将状态绑定到", + "ErrorWhileLoadingPackageManager": "加载包管理器时出错。您可能未连接到互联网,或者 Macro Deck 被防火墙阻止。", + "UpdatesAvailable": "更新可用", + "EnableIconCache": "启用图标缓存 (更快; 高内存占用)", + "WebClient": "网页设备", + "AndroidApp": "安卓设备", + "IOSApp": "iOS 设备", + "PluginMacroDeckFolder": "Macro Deck 文件夹", + "ActionChangeFolder": "更改文件夹", + "ActionChangeFolderDescription": "将当前设备使用的文件夹更改为已设置的文件夹", + "ActionGoToParentFolder": "转到父文件夹", + "ActionGoToParentFolderDescription": "将当前设备使用的文件夹更改为父文件夹", + "ActionGoToRootFolder": "转到 root 文件夹", + "ActionGoToRootFolderDescription": "将当前设备使用的文件夹更改为根文件夹", + "PluginMacroDeckVariables": "Macro Deck 变量", + "ActionChangeVariableValue": "更改变量参数", + "ActionChangeVariableValueDescription": "计数、倒计时、变量参数设置、变量值切换", + "CountUp": "计数", + "CountDown": "倒计时", + "Set": "设置", + "Toggle": "切换", + "Variable": "变量", + "PluginActionButton": "此按钮", + "ActionToggleActionButtonState": "切换按钮状态", + "ActionToggleActionButtonStateDescription": "切换此按钮的状态", + "ActionSetActionButtonStateOff": "设置按钮状态为关", + "ActionSetActionButtonStateOffDescription": "设置按钮状态为“关”", + "ActionSetActionButtonStateOn": "设置按钮状态为开", + "ActionSetActionButtonStateOnDescription": "设置按钮状态为“开”", + "Description": "描述", + "License": "许可", + "AnimatedGifImported": "GIF动画已导入", + "GenerateStaticIcon": "生成GIF第一帧的静态图像?", + "XSuccessfullyExportedToX": "{0} 已成功导出到 {1}", + "SelectedIconWillBeDeleted": "所选图标将从会图标包 {0} 中删除", + "SuccessfullyImportedIconPack": "导入图标包 {0} 成功", + "SelectedIconPackWillBeDeleted": "图标包 {0} 和所有在内的图标将会被删除", + "GenerateStatic": "生成静态", + "OnlyUserCreatedVariablesVisible": "仅显示用户变量", + "MacroDeckUsesCottleTemplateEngine": "Macro Deck 使用 Cottle template 引擎。点击此处获得更多信息。", + "Result": "结果", + "InstallDevVersions": "安装开发版本", + "InstallBetaVersions": "安装测试版本", + "WhatDoYouWantToRestore": "您希望从备份中恢复什么?", + "Configuration": "设置", + "Profiles": "预设", + "Variables": "变量", + "PluginConfigurations": "插件设置", + "PluginCredentials": "插件凭据", + "InstalledIconPacks": "安装图标包", + "Restore": "恢复", + "ActionCannotBeReversed": "此操作无法撤销", + "ThisWillDeleteBackupPermanently": "备份将被永久删除", + "Created": "已创建", + "PleaseWait": "请稍等...", + "Backups": "备份", + "CreateBackup": "创建备份", + "BackupFailed": "备份失败", + "BackupSuccessfullyCreated": "备份成功", + "CreateBackupBeforeUpdate": "是否要在更新之前进行备份?", + "CreatingBackup": "正在创建备份...", + "PluginNeedsConfiguration": "您需要设置此插件", + "ConfigureNow": "是否立即设置 {0} ?", + "Hotkey": "热键", + "PressTheKeysNow": "按下您需要配置的按键", + "XAction": "{0} 行为", + "XActions": "{0} 动作", + "OnRelease": "松开按钮时", + "OnLongPress": "长按按钮时", + "OnLongPressRelease": "长按按钮松开时", + "SimulateOnPress": "模拟 “按下按钮时”", + "SimulateOnRelease": "模拟 “松开按钮时”", + "SimulateOnLongPress": "模拟 “长按按钮时”", + "SimulateOnLongPressRelease": "模拟 “长按按钮松开时”", + "HotkeyExecutesOnPress": "热键在按下时执行“按下时”动作", + "Important": "重要", + "FirewallAlertInfo": "启动 Macro Deck 时,会显示“防火墙”的对话框。选中所有选项(专用网络、公共网络)。\n\n 如果看不到此对话框,并且您的连接有问题,请访问 wiki 或 Discord 服务器以获取帮助。", + "GotIt": "我明白了!", + "DeviceSettings": "设备设置", + "Brightness": "亮度", + "AutoConnect": "自动连接", + "DiscordSupport": "Discord 帮助", + "Wiki": "Wiki", + "ExportLatestLog": "导出最新的日志文件", + "LogSuccessfullyExportedToX": "日志文件成功导出到 {0}", + "Help": "帮助", + "XWarningsXErrors": "{0} 警告, {1} 错误", + "TrimBlankLines": "忽略空白行", + "Extensions": "扩展", + "InstallFromFile": "从文件安装", + "AllExtensionsUpToDate": "所有扩展都已最新", + "UpdateAll": "更新全部", + "UpdateAvailable": "更新完成", + "PendingRestart": "等待重新启动", + "Enabled": "启用", + "Disabled": "禁用", + "ActionSaveVariableToFile": "将变量保存到文件", + "ActionSaveVariableToFileDescription": "将变量参数保存到文件", + "Folders": "文件夹", + "Grid": "网格", + "ActionReadVariableFromFile": "从文件读取变量", + "ActionReadVariableFromFileDescription": "读取文件并将内容设置为变量的参数", + "ActionSetProfile": "Set profile", + "ActionSetProfileDescription": "Sets the profile on a device", + "Device": "Device", + "WhereExecuted": "Where executed", + "ActionSetBrightness": "Set brightness", + "ActionSetBrightnessDescription": "Sets the display brightness (Only on the Android app!)", + "BindableVariable": "Bindable variable", + "BindableVariableInfo": "The state of this button can be bound to the variable {0}. Do you want to bind the state?", + "Cancelled": "Cancelled", + "Preparing": "Preparing...", + "Installing": "Installing...", + "Completed": "Completed", + "ExtensionStoreDownloaderPackageIdVersion": "{0} version (1)", + "DownloadingAndInstallingXPackages": "Downloading and installing {0} package(s)", + "InstallationOfXPackagesDone": "Installation of {0} package(s) done", + "ActionSetBackgroundColor": "Set background color", + "ActionSetBackgroundColorDescription": "Changes the background color of a action button", + "Fixed": "Fixed", + "Random": "Random" +} \ No newline at end of file diff --git a/Resources/Languages/Dutch.json b/Resources/Languages/Dutch.json index 9a02a789..947a467c 100644 --- a/Resources/Languages/Dutch.json +++ b/Resources/Languages/Dutch.json @@ -1,16 +1,27 @@ { "__Language__": "Nederlands", "__LanguageCode__": "nl", +<<<<<<< HEAD + "__Author__": "Robin Louwersheimer en Lucas", + "NetworkAdapter": "Netwerkadapter", +======= "__Author__": "Macro Deck", "NetworkAdapter": "Netwerk adapter", +>>>>>>> origin/main "IPAddress": "IP-adres", "Port": "Poort", "Info": "Info", "Error": "Fout", "Warning": "Waarschuwing", +<<<<<<< HEAD + "ConfigureNetworkInfo": "Het is erg belangrijk om de juiste netwerkadapter te selecteren, anders kunt u geen verbinding maken met de client met de server. In de meeste gevallen ziet de naam van de netwerkadapter eruit als \"Ethernet\" of \"Wi-Fi\" en het ip-adres in de meeste gevallen als \"192.168.178.xxx\".\n\nDe standaardpoort voor Macro Deck is 8191. Als een andere toepassing deze poort gebruikt, kunt u deze wijzigen.", + "AutomaticallyCheckUpdates": "Automatisch controleren op nieuwe updates", + "AutomaticallyStartWithWindows": "Automatisch opstarten met Windows", +======= "ConfigureNetworkInfo": "Het is heel belangrijk om de juiste netwerk adapter te selecteren ander zal je niet in staat zijn de client met de server te laten verbinden. In de meeste gevallen zal de naam van de netwerk adapter \"Ethernet\" of \"Wi-Fi\" zijn en het Ip-adres zal in de meeste gevallen \"192.168.1.xxx\" zijn.\n\nDe standaard poort voor Macro Deck is 8191. Als een ander programma deze poort gebruikt kan je deze poort in Macro Deck aanpassen.", "AutomaticallyCheckUpdates": "Automatisch naar nieuwe versies controleren", "AutomaticallyStartWithWindows": "Automatisch opstarten in Windows", +>>>>>>> origin/main "Show": "Configureer Macro Deck", "Exit": "Sluit Macro Deck", "XUpdatesAvailable": "{0} updates beschikbaar", @@ -18,9 +29,15 @@ "Columns": "Kolommen", "Rows": "Rijen", "Spacing": "Afstand", +<<<<<<< HEAD + "CornerRadius": "Hoekradius", + "ButtonBackGround": "Knop achtergrond", + "AreYouSure": "Weet je het zeker?", +======= "CornerRadius": "Hoek radius", "ButtonBackGround": "Knop achtergrond", "AreYouSure": "Weet u het zeker?", +>>>>>>> origin/main "Behaviour": "Gedrag", "Plugins": "Plugins", "IconPacks": "pictogrampakketten", @@ -43,7 +60,11 @@ "Save": "Opslaan", "Appearance": "Opmaak", "ButtonState": "Knop status", +<<<<<<< HEAD + "Label": "Label", +======= "Label": "Etiket", +>>>>>>> origin/main "Top": "Boven", "Center": "Midden", "Bottom": "Onder", @@ -62,13 +83,21 @@ "Update": "Update", "Plugin": "Plug-in", "MacroDeckNeedsARestart": "Macro Deck moet opnieuw starten\n", +<<<<<<< HEAD + "MacroDeckMustBeRestartedForTheChanges": "Macro Deck moet opnieuw worden gestart om de wijzigingen door te voeren.\nWil je Macro Deck nu opnieuw starten?", +======= "MacroDeckMustBeRestartedForTheChanges": "Macro Deck moet opnieuw starten zodat de veranderingen effectief worden.\nWil je Macro Deck nu opnieuw starten?\n", +>>>>>>> origin/main "Configure": "Instellen", "Uninstall": "Verwijderen", "NotLoaded": "Niet geladen", "Yes": "Ja", "No": "Nee", +<<<<<<< HEAD + "Status": "Status", +======= "Status": "Toestand", +>>>>>>> origin/main "BlockConnection": "Blokkeer verbinding", "Change": "Verander", "Id": "ID", @@ -78,14 +107,24 @@ "Action": "Actie", "Condition": "Voorwaarde", "InstalledVersion": "geïnstalleerde versie", +<<<<<<< HEAD + "UpdateChannel": "Updatekanaal", + "CheckForUpdatesNow": "Controleer of er updates zijn", + "Author": "Auteur", +======= "UpdateChannel": "Update kanaal", "CheckForUpdatesNow": "Controleer nu of er updates zijn", "Author": "Maker", +>>>>>>> origin/main "Version": "Versie", "TheFolderWillBeDeleted": "De map {0} met al zijn actie knoppen zullen verwijderd worden.", "TheProfileWillBeDeleted": "Het profiel {0} met al zijn mappen en al zijn actie knoppen zullen verwijderd worden.", "ServerOffline": "Server offline", +<<<<<<< HEAD + "ServerRunning": "Server loopt", +======= "ServerRunning": "Server running", +>>>>>>> origin/main "XPluginsLoaded": "{0} plugins geladen", "XPluginsDisabled": "{0} plugins uitgeschakeld", "XClientsConnected": "{0} clients verbonden", @@ -97,11 +136,25 @@ "InitialSetupPage": "Pagina {0}/{1}", "InitialSetupWelcome": "Welkom op Macro Deck 2!", "InitialSetupLetsConfigure": "Laten we jouw Macro Deck-ervaring configureren", +<<<<<<< HEAD + "InitialSetupConfigureNetworkSettings": "Configureer jouw netwerkinstellingen", +======= "InitialSetupConfigureNetworkSettings": "Configureer jouw netwerk instellingen", +>>>>>>> origin/main "InitialSetupConfigureGridPreferences": "Laten we nu het raster naar uw voorkeuren configureren", "InitialSetupPickAllPluginsYouNeed": "Neem alle plugins die je nodig hebt", "InitialSetupDontWorryInstallUninstallPlugins": "Maak je geen zorgen, je kunt plug-ins altijd later in de pakketbeheerder installeren/verwijderen", "InitialSetupWantSomeIcons": "Wil je pictogrammen?", +<<<<<<< HEAD + "InitialSetupInstallIconPacksPackageManager": "Je kunt ook later pictogrampakketten installeren in het pakketbeheer", + "InitialSetupAlmostDone": "We zijn bijna klaar!", + "KnownDevices": "Bekende apparaten", + "AskOnNewConnections": "Vraag wanneer er nieuwe verbindingen zijn", + "AllowAllNewConnections": "Alle nieuwe verbindingen toestaan (niet aangeraden)", + "BlockAllNewConnections": "Alle nieuwe verbindingen blokkeren", + "InstallDLL": "Installeer .dll (niet aangeraden)", + "NeverInstallDLLFiles": "Installeer nooit .dll-bestanden van bronnen die je niet vertrouwt! .dll-bestanden van onbekende bronnen kunnen uw systeem beschadigen, installeer het alleen als je weet wat u doet! Wilt u echt de .dll-plug-in installeren?", +======= "InitialSetupInstallIconPacksPackageManager": "Je kunt ook later pictogrampakketten installeren in de pakketmanager", "InitialSetupAlmostDone": "We zijn bijna klaar!", "KnownDevices": "Bekende apparaten", @@ -110,6 +163,7 @@ "BlockAllNewConnections": "Alle nieuwe verbindingen blokkeren", "InstallDLL": "Installeer .dll (niet aangeraden)", "NeverInstallDLLFiles": "Installeer nooit .dll-bestanden van bronnen die je niet vertrouwt! .dll-bestanden van onbekende bronnen kunnen uw systeem beschadigen, installeer het alleen als u weet wat u doet! Wilt u echt de .dll-plug-in installeren?", +>>>>>>> origin/main "XWillBeUninstalled": "{0} wordt verwijderd.", "XSuccessfullyUninstalled": "{0} wordt verwijderd. Macro Deck moet opnieuw worden gestart om het effect van de wijzigingen te krijgen. Nu Macro Deck opnieuw starten?", "CreateVariable": "Maak variabele", @@ -175,7 +229,11 @@ "VariableXGetsDeleted": "De variabele {0} wordt verwijderd", "DeckTitle": "Deck", "DeviceManagerTitle": "Apparaatbeheer", +<<<<<<< HEAD + "PackageManagerTitle": "Pakketbeheer", +======= "PackageManagerTitle": "Pakket manager", +>>>>>>> origin/main "SettingsTitle": "Instellingen", "VariablesTitle": "Globale variabelen", "Edit": "Bewerken", @@ -200,7 +258,11 @@ "Online": "Online", "By": "Door", "StateBinding": "Verbind staat aan", +<<<<<<< HEAD + "ErrorWhileLoadingPackageManager": "Er heeft zich een fout opgetreden tijdens het laden van het pakketbeheer. Misschien ben je niet verbonden met internet of wordt Macro Deck geblokkeerd door je firewall", +======= "ErrorWhileLoadingPackageManager": "Er heeft zich een fout opgetreden tijdens het laden van het pakket manager. Misschien bent u niet verbonden met internet of wordt Macro Deck geblokkeerd door uw firewall", +>>>>>>> origin/main "UpdatesAvailable": "Update verkrijgbaar", "EnableIconCache": "Zet pictogrammen cache aan (sneller; hogere geheugen gebruik)", "WebClient": "Web client", @@ -291,14 +353,44 @@ "InstallFromFile": "Installeer vanaf bestand", "AllExtensionsUpToDate": "Alle extensies zijn up-to-date", "UpdateAll": "Alles updaten", +<<<<<<< HEAD + "UpdateAvailable": "Nieuwe update verkrijgbaar", +======= "UpdateAvailable": "Nieuwe versie verkrijgbaar", +>>>>>>> origin/main "PendingRestart": "In afwachting van herstart", "Enabled": "Ingeschakeld", "Disabled": "Uitgeschakeld", "ActionSaveVariableToFile": "Variabele opslaan naar bestand", "ActionSaveVariableToFileDescription": "Slaat de waarde van de variabele op in een bestand", +<<<<<<< HEAD + "Folders": "Mappen", + "Grid": "Rooster", + "ActionReadVariableFromFile": "Variabele uit bestand lezen", + "ActionReadVariableFromFileDescription": "Leest een bestand en stelt de inhoud in als waarde voor een variabele", + "ActionSetProfile": "Set profile", + "ActionSetProfileDescription": "Sets the profile on a device", + "Device": "Device", + "WhereExecuted": "Where executed", + "ActionSetBrightness": "Set brightness", + "ActionSetBrightnessDescription": "Sets the display brightness (Only on the Android app!)", + "BindableVariable": "Bindable variable", + "BindableVariableInfo": "The state of this button can be bound to the variable {0}. Do you want to bind the state?", + "Cancelled": "Cancelled", + "Preparing": "Preparing...", + "Installing": "Installing...", + "Completed": "Completed", + "ExtensionStoreDownloaderPackageIdVersion": "{0} version {1}", + "DownloadingAndInstallingXPackages": "Downloading and installing {0} package(s)", + "InstallationOfXPackagesDone": "Installation of {0} package(s) done", + "ActionSetBackgroundColor": "Set background color", + "ActionSetBackgroundColorDescription": "Changes the background color of a action button", + "Fixed": "Fixed", + "Random": "Random" +======= "Folders": "mappen", "Grid": "Rooster", "ActionReadVariableFromFile": "ActieLezenVariabeleVanBestand", "ActionReadVariableFromFileDescription": "ActieReadVariableFromFileDescription" +>>>>>>> origin/main } \ No newline at end of file diff --git a/Resources/Languages/English.json b/Resources/Languages/English.json index 2abc3bce..44367679 100644 --- a/Resources/Languages/English.json +++ b/Resources/Languages/English.json @@ -300,5 +300,35 @@ "Folders": "Folders", "Grid": "Grid", "ActionReadVariableFromFile": "Read variable from file", +<<<<<<< HEAD + "ActionReadVariableFromFileDescription": "Reads a file and sets the content as value for a variable", + "ActionSetProfile": "Set profile", + "ActionSetProfileDescription": "Sets the profile on a device", + "Device": "Device", + "WhereExecuted": "Where executed", + "ActionSetBrightness": "Set brightness", + "ActionSetBrightnessDescription": "Sets the display brightness (Only on the Android app!)", + "BindableVariable": "Bindable variable", + "BindableVariableInfo": "The state of this button can be bound to the variable {0}. Do you want to bind the state?", + "Cancelled": "Cancelled", + "Preparing": "Preparing...", + "Installing": "Installing...", + "Completed": "Completed", + "ExtensionStoreDownloaderPackageIdVersion": "{0} version {1}", + "DownloadingAndInstallingXPackages": "Downloading and installing {0} package(s)", + "InstallationOfXPackagesDone": "Installation of {0} package(s) done", + "ActionSetBackgroundColor": "Set background color", + "ActionSetBackgroundColorDescription": "Changes the background color of a action button", + "Fixed": "Fixed", + "Random": "Random", + "NewConnectionRequest": "New connection request", + "ClientId": "Client id", + "Accept": "Accept", + "Deny": "Deny", + "VersionBuild": "Build", + "OpenExtensionManager": "Open Extension Manager", + "OpenSettings": "Open settings" +======= "ActionReadVariableFromFileDescription": "Reads a file and sets the content as value for a variable" +>>>>>>> origin/main } \ No newline at end of file diff --git a/Resources/Languages/Filipino.json b/Resources/Languages/Filipino.json index 7fac3eff..09481e3e 100644 --- a/Resources/Languages/Filipino.json +++ b/Resources/Languages/Filipino.json @@ -300,5 +300,28 @@ "Folders": "Mga folder", "Grid": "Grid", "ActionReadVariableFromFile": "Basahin ang variable mula sa file", +<<<<<<< HEAD + "ActionReadVariableFromFileDescription": "Basahin ang file at i-set ang content ng file sa value ng variable", + "ActionSetProfile": "Set profile", + "ActionSetProfileDescription": "Sets the profile on a device", + "Device": "Device", + "WhereExecuted": "Where executed", + "ActionSetBrightness": "Set brightness", + "ActionSetBrightnessDescription": "Sets the display brightness (Only on the Android app!)", + "BindableVariable": "Bindable variable", + "BindableVariableInfo": "The state of this button can be bound to the variable {0}. Do you want to bind the state?", + "Cancelled": "Cancelled", + "Preparing": "Preparing...", + "Installing": "Installing...", + "Completed": "Completed", + "ExtensionStoreDownloaderPackageIdVersion": "{0} version {1}", + "DownloadingAndInstallingXPackages": "Downloading and installing {0} package(s)", + "InstallationOfXPackagesDone": "Installation of {0} package(s) done", + "ActionSetBackgroundColor": "Set background color", + "ActionSetBackgroundColorDescription": "Changes the background color of a action button", + "Fixed": "Fixed", + "Random": "Random" +======= "ActionReadVariableFromFileDescription": "Binabasa ang isang file at itinatakda ang nilalaman bilang halaga para sa isang variable" +>>>>>>> origin/main } \ No newline at end of file diff --git a/Resources/Languages/Finnish.json b/Resources/Languages/Finnish.json index f15e2eab..e3ace6a3 100644 --- a/Resources/Languages/Finnish.json +++ b/Resources/Languages/Finnish.json @@ -300,5 +300,28 @@ "Folders": "Kansiot", "Grid": "Ruudukko", "ActionReadVariableFromFile": "Lue muuttuja tiedostosta", +<<<<<<< HEAD + "ActionReadVariableFromFileDescription": "Lukee tiedoston ja asettaa sen sisällön muuttujan arvoksi", + "ActionSetProfile": "Set profile", + "ActionSetProfileDescription": "Sets the profile on a device", + "Device": "Device", + "WhereExecuted": "Where executed", + "ActionSetBrightness": "Set brightness", + "ActionSetBrightnessDescription": "Sets the display brightness (Only on the Android app!)", + "BindableVariable": "Bindable variable", + "BindableVariableInfo": "The state of this button can be bound to the variable {0}. Do you want to bind the state?", + "Cancelled": "Cancelled", + "Preparing": "Preparing...", + "Installing": "Installing...", + "Completed": "Completed", + "ExtensionStoreDownloaderPackageIdVersion": "{0} version {1}", + "DownloadingAndInstallingXPackages": "Downloading and installing {0} package(s)", + "InstallationOfXPackagesDone": "Installation of {0} package(s) done", + "ActionSetBackgroundColor": "Set background color", + "ActionSetBackgroundColorDescription": "Changes the background color of a action button", + "Fixed": "Fixed", + "Random": "Random" +======= "ActionReadVariableFromFileDescription": "Lukee tiedoston ja asettaa sen sisällön muuttujan arvoksi" +>>>>>>> origin/main } \ No newline at end of file diff --git a/Resources/Languages/French.json b/Resources/Languages/French.json index 6991aaf9..974196b5 100644 --- a/Resources/Languages/French.json +++ b/Resources/Languages/French.json @@ -1,4 +1,327 @@ { +<<<<<<< HEAD + "__Language__": "French", + "__LanguageCode__": "fr", + "__Author__": "Benjiiben53", + "NetworkAdapter": "Carte réseau", + "IPAddress": "Adresse IP", + "Port": "Port", + "Info": "Infos", + "Error": "Erreur", + "Warning": "Attention", + "ConfigureNetworkInfo": "Il est vraiment important de sélectionner la bonne carte réseau, sinon le client ne pourra pas se connecter au serveur. Dans la plupart des cas, le nom de la carte réseau ressemble à \"Ethernet\" ou \"Wi-Fi\" et l'adresse IP ressemble dans la plupart des cas à \"192.168.1.xxx\".\n\nLe port par défaut pour Macro Deck est 8191. Si une autre application utilise ce port, vous pouvez le modifier.", + "AutomaticallyCheckUpdates": "Rechercher automatiquement les mises à jour", + "AutomaticallyStartWithWindows": "Démarrer automatiquement avec Windows", + "Show": "Montrer", + "Exit": "Fermer", + "XUpdatesAvailable": "{0} mises à jour disponibles", + "Profile": "Profiles", + "Columns": "Colonnes", + "Rows": "Lignes", + "Spacing": "Espacement", + "CornerRadius": "Rayon d'angle", + "ButtonBackGround": "Fond du bouton", + "AreYouSure": "Êtes-vous sûr ?", + "Behaviour": "Comportement", + "Plugins": "Plugins", + "IconPacks": "Packs d'icônes", + "All": "Tout", + "Updates": "Mises à jour", + "Installed": "Déjà installé", + "Install": "Installer", + "Search": "Rechercher...", + "Name": "Nom", + "Type": "Type", + "Value": "Valeur", + "Creator": "Créateur", + "Ok": "Ok", + "FolderName": "Nom du dossier", + "Never": "Jamais", + "OnApplicationFocus": "Quand l'application est séléctionnée", + "Application": "Application", + "Devices": "Appareils", + "Create": "Créer", + "Save": "Sauvegarder", + "Appearance": "Apparence", + "ButtonState": "État du bouton", + "Label": "Étiquette", + "Top": "Haut", + "Center": "Centre", + "Bottom": "Bas", + "Path": "Chemin", + "CurrentState": "État actuel", + "Off": "Désactivé", + "On": "Activé", + "DownloadAndInstall": "Télécharger et installer", + "Downloading": "Téléchargement...", + "Color": "Couleur", + "IconPack": "Pack d'icônes", + "Size": "Taille", + "CurrentProgress": "Progrès en cours", + "TotalProgress": "Progrès total", + "XDownloads": "{0} téléchargements", + "Update": "Mettre à jour", + "Plugin": "Plugin", + "MacroDeckNeedsARestart": "Macro Deck a besoin de redémarrer", + "MacroDeckMustBeRestartedForTheChanges": "Macro Deck doit être redémarré pour que les modifications prennent effet. Souhaitez-vous redémarrer Macro Deck maintenant ?", + "Configure": "Configurer", + "Uninstall": "Désinstaller", + "NotLoaded": "Non chargé", + "Yes": "Oui", + "No": "Non", + "Status": "Statut", + "BlockConnection": "Bloquer la connexion", + "Change": "Modifier", + "Id": "ID", + "Connected": "Connecté", + "Disconnected": "Déconnecté", + "Trigger": "Déclencheur", + "Action": "Action", + "Condition": "Condition", + "InstalledVersion": "Version installée", + "UpdateChannel": "Mettre à jour le canal", + "CheckForUpdatesNow": "Vérifiez les mises à jour maintenant", + "Author": "Auteur", + "Version": "Version", + "TheFolderWillBeDeleted": "Le dossier {0}, avec tous ses boutons d'action, sera supprimé.", + "TheProfileWillBeDeleted": "Le profil {0}, avec tous ses dossiers et boutons d'action, sera supprimé.", + "ServerOffline": "Serveur hors ligne", + "ServerRunning": "Serveur en cours d'exécution", + "XPluginsLoaded": "{0} plugins chargés", + "XPluginsDisabled": "{0} plugins désactivés", + "XClientsConnected": "{0} clients connectés", + "IpAddressHostNamePort": "Adresse IP/nom d'hôte : Port", + "InitialSetupButtonBack": "<- Arrière", + "InitialSetupButtonNext": "Suivant ->", + "InitialSetupButtonFinish": "Terminé", + "InitialSetupSelectLanguage": "Choisissez votre langue", + "InitialSetupPage": "Page(s) {0}/{1}", + "InitialSetupWelcome": "Bienvenue dans Macro Deck 2 !", + "InitialSetupLetsConfigure": "Configurons votre expérience Macro Deck", + "InitialSetupConfigureNetworkSettings": "Configurez vos paramètres réseau", + "InitialSetupConfigureGridPreferences": "Configurons maintenant la grille selon vos préférences", + "InitialSetupPickAllPluginsYouNeed": "Choisissez tous les plugins dont vous avez besoin", + "InitialSetupDontWorryInstallUninstallPlugins": "Ne vous inquiétez pas, vous pouvez toujours installer/désinstaller des plugins plus tard dans le gestionnaire de paquets", + "InitialSetupWantSomeIcons": "Voulez-vous des icônes ?", + "InitialSetupInstallIconPacksPackageManager": "Vous pouvez également installer des packs d'icônes plus tard dans le gestionnaire de paquets", + "InitialSetupAlmostDone": "Nous avons presque fini !", + "KnownDevices": "Appareils connus", + "AskOnNewConnections": "Demander de nouvelles connexions", + "AllowAllNewConnections": "Autoriser toutes les nouvelles connexions (non recommandé)", + "BlockAllNewConnections": "Bloquer toutes les nouvelles connexions", + "InstallDLL": "Installer .dll (non recommandé)", + "NeverInstallDLLFiles": "N'installez jamais de fichiers .dll à partir de sources en lesquelles vous n'avez pas confiance ! Les fichiers .dll provenant de sources inconnues peuvent endommager votre système, installez-le uniquement lorsque vous savez ce que vous faites! Voulez-vous vraiment installer un plugin .dll ?", + "XWillBeUninstalled": "{0} sera désinstallé.", + "XSuccessfullyUninstalled": "{0} est désinstallé. Macro Deck doit être redémarré pour que les modifications prennent effet. Redémarrer Macro Deck maintenant ?", + "CreateVariable": "Créer une variable", + "DeleteVariable": "Supprimé une variable", + "SelectAPluginAndActionToBegin": "Sélectionnez un plugin et une action pour commencer", + "ActionNeedsNoConfiguration": "Cette action ne nécessite aucune configuration", + "CantCreateFolder": "Impossible de créer le dossier", + "FolderCalledXAlreadyExists": "Un dossier appelé {0} existe déjà", + "OnPress": "En appuyant", + "OnEvent": "Lors de l'événement", + "CantCreateIconPack": "Impossible de créer un pack d'icônes", + "IconPackCalledXAlreadyExists": "Un pack d'icônes appelé {0} existe déjà", + "CantCreateProfile": "Impossible de créer le profil", + "ProfileCalledXAlreadyExists": "Un profil appelé {0} existe déjà", + "TheresAnUpdateForYou": "Il y a une mise à jour pour vous :)", + "VersionXIsNowAvailable": "Version {0} ({1}) est maintenant disponible", + "ReadyToDownloadUpdate": "Prêt à télécharger la mise à jour", + "DownloadingUpdate": "Téléchargement de la mise à jour... {0}% ({1}MB/{2}MB)", + "VerifyingUpdateFile": "Vérification du fichier de mise à jour...", + "MD5NotValid": "MD5 checksum n'est pas valide", + "StartingInstaller": "Démarrage du programme d'installation", + "FileNotFound": "Fichier introuvable", + "TryAgainOrDownloadManually": "Réessayez ou téléchargez la mise à jour manuellement", + "Trending": "Tendance", + "Layers": "Couches", + "AddImage": "Ajouter une image", + "IconImportQualityInfo": "Des icônes de haute qualité peuvent entraîner une augmentation de l'utilisation de la mémoire et des temps de chargement, en particulier lors de l'utilisation de nombreux gros gifs animés. \nPour les gifs, il est recommandé d'utiliser le préréglage bas ou le plus bas.", + "Original": "Originale", + "High350px": "Haut (350px)", + "Normal200px": "Normale (200px)", + "Low150px": "Bas (150px)", + "Lowest100px": "Très bas (100px)", + "ImportIconPack": "Importer un pack d'icônes", + "ExportIconPack": "Exporter le pack d'icônes", + "CreateIcon": "Créer une icône", + "ImportIcon": "Importer un icône", + "DeleteIcon": "Supprimer un icône", + "IconSelectorManagedInfo": "Ce pack d'icônes est géré par le gestionnaire de plugins", + "DownloadingXPackages": "Téléchargement de {0} paquets", + "PluginCouldNotBeLoaded": "Le plug-in n'a pas pu être chargé. Peut-être que la version installée de ce plugin n'est pas compatible avec cette version de Macro Deck.", + "CantChangeName": "Impossible de changer le nom", + "DeviceCalledXAlreadyExists": "Un appareil appelé {0} existe déjà", + "NewConnection": "Nouvelle connexion", + "XIsAnUnknownDevice": "{0} est un appareil inconnu et veut se connecter à Macro Deck. Autoriser la connexion ?", + "ShouldMacroDeckBlockConnectionsFromX": "Voulez-vous que Macro Deck bloque automatiquement les futures connexions de {0} ?", + "FailedToStartServer": "Échec du démarrage du serveur. Peut-être que le port configuré est déjà utilisé ou que vous avez défini la mauvaise carte réseau. Vérifiez que vous avez défini la bonne carte réseau dans les paramètres et essayez de changer le port.", + "ErrorWhileLoadingPlugins": "Erreur lors du chargement des plugins", + "PluginXCouldNotBeLoaded": "{0} version {1} n'a pas pu être chargé. Peut-être n'est-il pas compatible avec cette version de Macro Deck. Les actions qui utilisent ce plugin ne fonctionneront pas tant que le plugin ne sera pas mis à jour.", + "InstallationSuccessfull": "Installation réussie", + "PluginXInstalledSuccessfully": "{0} a été installé avec succès", + "ErrorWhileInstallingPlugin": "Erreur lors de l'installation du plugin", + "PluginXCouldNotBeInstalled": "{0} n'a pas pu être installé. Peut-être n'est-il pas compatible avec cette version de Macro Deck", + "Settings": "Paramètres", + "Language": "Langage", + "General": "Général", + "Connection": "Connexion", + "Backup": "Sauvegarde", + "About": "À propos de", + "NoUpdatesAvailable": "Aucune mise à jour disponible", + "LatestVersionInstalled": "La dernière version est déjà installée", + "WarningDevVersions": "Les versions de développement peuvent être très instables et provoquer des plantages ou des pertes de données (boutons d'action configurés, dossiers et profils). Vous voulez vraiment passer au canal de mise à jour Dev ?", + "WarningBetaVersions": "Les versions bêta peuvent parfois être instables et provoquer des plantages. Vous voulez vraiment passer au canal de mise à jour bêta ?", + "VariableXGetsDeleted": "La variable {0} est supprimée", + "DeckTitle": "Deck", + "DeviceManagerTitle": "Gestionnaire de périphériques", + "PackageManagerTitle": "Gestionnaire de paquets", + "SettingsTitle": "Paramètres", + "VariablesTitle": "Variables globales", + "Edit": "Éditer", + "Delete": "Supprimer", + "Run": "Executer", + "Copy": "Copier", + "Paste": "Coller", + "WebSocketAPIVersion": "Version de l'API Websocket", + "PluginAPIVersion": "Version de l'API du plug-in", + "InstalledPlugins": "Plugins installés", + "OperatingSystem": "Système d'exploitation", + "DevelopedByX": "Développé par {0} en Allemand", + "XTranslationByX": "Traduction {0}e par {1}", + "PackageManagerTabAvailable": "Disponible", + "PackageManagerTabInstalled": "Installer", + "Event": "Événement", + "AutomaticallySwitchToFolder": "Basculer automatiquement vers le dossier", + "Restart": "Redémarrer Macro Deck", + "Delay": "Délai", + "If": "Si", + "Else": "Sinon", + "Online": "En ligne", + "By": "Par", + "StateBinding": "État de liaison", + "ErrorWhileLoadingPackageManager": "Erreur de chargement du gestionnaire de paquets.\n Vérifier votre connexion Internet ou Macro Deck est peut être bloqué par le pare-feu.", + "UpdatesAvailable": "Mises à jour disponibles", + "EnableIconCache": "Activer le cache d'icônes (plus rapide ; mais utilise un peut plus de mémoire)", + "WebClient": "Client Web", + "AndroidApp": "Application Android", + "IOSApp": "Application iOS", + "PluginMacroDeckFolder": "Dossier Macro Deck", + "ActionChangeFolder": "Changer le dossier", + "ActionChangeFolderDescription": "Changer le dossier actuel sur le périphérique actuel pour le dossier configuré", + "ActionGoToParentFolder": "Aller au dossier parent", + "ActionGoToParentFolderDescription": "Changez le dossier actuel sur le périphérique actuel pour le dossier parent des dossiers", + "ActionGoToRootFolder": "Aller au dossier racine", + "ActionGoToRootFolderDescription": "Remplacez le dossier actuel de l'appareil actuel par le dossier racine", + "PluginMacroDeckVariables": "Variables Macro Deck", + "ActionChangeVariableValue": "Modifier la valeur de la variable", + "ActionChangeVariableValueDescription": "Compter jusqu'à, compte à rebours, définir une valeur variable et basculer la valeur variable", + "CountUp": "Compter jusqu'à", + "CountDown": "Compte à rebours", + "Set": "Définir", + "Toggle": "Basculer", + "Variable": "Variable", + "PluginActionButton": "Ce bouton d'action", + "ActionToggleActionButtonState": "Basculer l'état du bouton", + "ActionToggleActionButtonStateDescription": "Bascule l'état de ce bouton", + "ActionSetActionButtonStateOff": "Définir l'état du bouton sur éteint", + "ActionSetActionButtonStateOffDescription": "Définit l'état de ce bouton sur \"éteint\"", + "ActionSetActionButtonStateOn": "Définir l'état du bouton sur allumer", + "ActionSetActionButtonStateOnDescription": "Définit l'état de ce bouton sur \"allumer\"", + "Description": "Description", + "License": "Licence", + "AnimatedGifImported": "Gif animé importé", + "GenerateStaticIcon": "Générez également une icône statique de la première image des GIF ?", + "XSuccessfullyExportedToX": "{0} a été exporté avec succès vers {1}", + "SelectedIconWillBeDeleted": "L'icône sélectionnée sera supprimée du pack d'icônes {0}", + "SuccessfullyImportedIconPack": "Importation réussie du pack d'icônes {0}", + "SelectedIconPackWillBeDeleted": "Le pack d'icônes sélectionné {0} avec toutes ses icônes seront supprimées", + "GenerateStatic": "Générer une version figé", + "OnlyUserCreatedVariablesVisible": "Seules les variables créées par l'utilisateur sont visibles", + "MacroDeckUsesCottleTemplateEngine": "Macro Deck utilise le moteur de template Cottle. Cliquez ici pour plus d'informations.", + "Result": "Résultats", + "InstallDevVersions": "Installer les versions de développement", + "InstallBetaVersions": "Installer les versions bêta", + "WhatDoYouWantToRestore": "Que voulez-vous restaurer à partir de la sauvegarde ??", + "Configuration": "Configuration", + "Profiles": "Profils", + "Variables": "Variables", + "PluginConfigurations": "Configurations des plugins", + "PluginCredentials": "Identifiants du plugin", + "InstalledIconPacks": "Packs d'icônes installés", + "Restore": "Restaurer", + "ActionCannotBeReversed": "Cette action ne peut pas être annulée", + "ThisWillDeleteBackupPermanently": "Cela supprimera définitivement la sauvegarde", + "Created": "Créé", + "PleaseWait": "Veuillez patienter...", + "Backups": "Sauvegardes", + "CreateBackup": "Créer une sauvegarde", + "BackupFailed": "La sauvegarde a échoué", + "BackupSuccessfullyCreated": "Sauvegarde créée avec succès", + "CreateBackupBeforeUpdate": "Voulez-vous créer une sauvegarde avant la mise à jour ?", + "CreatingBackup": "Création d'une sauvegarde...", + "PluginNeedsConfiguration": "Ce plugin doit être configuré", + "ConfigureNow": "Voulez-vous configurer {0} maintenant?", + "Hotkey": "Raccourci clavier", + "PressTheKeysNow": "Appuyez sur les touches que vous souhaitez attribuer maintenant", + "XAction": "{0} action", + "XActions": "{0} actions", + "OnRelease": "Au relâchement", + "OnLongPress": "En appuyant longuement", + "OnLongPressRelease": "Au long relâchement", + "SimulateOnPress": "Simuler \"A l'appui\"", + "SimulateOnRelease": "Simuler \"Au relâchement\"", + "SimulateOnLongPress": "Simuler \"En appuyant longuement\"", + "SimulateOnLongPressRelease": "Simuler \"Au long relâchement\"", + "HotkeyExecutesOnPress": "Le raccourci clavier exécute les actions \"A l'appui\" lorsqu'il est pressé", + "Important": "Important", + "FirewallAlertInfo": "Après avoir démarré Macro Deck, une boîte de dialogue du pare-feu Windows Defender apparaîtra.\nVeuillez cocher toutes les cases (Réseaux privés, Réseaux publics et s'il existe, Réseaux de domaine).\n\nSi cette boîte de dialogue n'apparaît pas et que vous rencontrez toujours des problèmes de connexion, veuillez visiter le wiki ou le serveur Discord pour obtenir de l'aide. ", + "GotIt": "J'ai compris !", + "DeviceSettings": "Paramètres des appareil", + "Brightness": "Luminosité", + "AutoConnect": "Connection automatique", + "DiscordSupport": "Support Discord", + "Wiki": "Wiki", + "ExportLatestLog": "Exporter le dernier journal(logs)", + "LogSuccessfullyExportedToX": "Journal(logs) exporté avec succès vers {0}", + "Help": "Aide", + "XWarningsXErrors": "{0} attention(s), {1} erreur(s)", + "TrimBlankLines": "Couper les lignes vides", + "Extensions": "Rallonges", + "InstallFromFile": "Installer à partir du fichier", + "AllExtensionsUpToDate": "Toutes les extensions sont à jour", + "UpdateAll": "Tout mettre à jour", + "UpdateAvailable": "Mise à jour disponible", + "PendingRestart": "En attente de redémarrage", + "Enabled": "Activé", + "Disabled": "Handicapé", + "ActionSaveVariableToFile": "Enregistrer la variable dans le fichier", + "ActionSaveVariableToFileDescription": "Enregistre la valeur de la variable dans un fichier", + "Folders": "Dossiers", + "Grid": "Grille", + "ActionReadVariableFromFile": "Lire la variable du fichier", + "ActionReadVariableFromFileDescription": "Lit un fichier et définit le contenu comme valeur pour une variable", + "ActionSetProfile": "Set profile", + "ActionSetProfileDescription": "Sets the profile on a device", + "Device": "Device", + "WhereExecuted": "Where executed", + "ActionSetBrightness": "Set brightness", + "ActionSetBrightnessDescription": "Sets the display brightness (Only on the Android app!)", + "BindableVariable": "Bindable variable", + "BindableVariableInfo": "The state of this button can be bound to the variable {0}. Do you want to bind the state?", + "Cancelled": "Cancelled", + "Preparing": "Preparing...", + "Installing": "Installing...", + "Completed": "Completed", + "ExtensionStoreDownloaderPackageIdVersion": "{0} version {1}", + "DownloadingAndInstallingXPackages": "Downloading and installing {0} package(s)", + "InstallationOfXPackagesDone": "Installation of {0} package(s) done", + "ActionSetBackgroundColor": "Set background color", + "ActionSetBackgroundColorDescription": "Changes the background color of a action button", + "Fixed": "Fixed", + "Random": "Random" +======= "__Language__": "French", "__LanguageCode__": "fr", "__Author__": "Benjiiben53", @@ -301,4 +624,5 @@ "Grid": "Grille", "ActionReadVariableFromFile": "Lire la variable du fichier", "ActionReadVariableFromFileDescription": "Lit un fichier et définit le contenu comme valeur pour une variable" +>>>>>>> origin/main } \ No newline at end of file diff --git a/Resources/Languages/German.json b/Resources/Languages/German.json index a432bd98..8ab599a2 100644 --- a/Resources/Languages/German.json +++ b/Resources/Languages/German.json @@ -1,4 +1,334 @@ { +<<<<<<< HEAD + "__Language__": "German", + "__LanguageCode__": "de", + "__Author__": "Macro Deck", + "NetworkAdapter": "Netzwerkadapter", + "IPAddress": "IP Adresse", + "Port": "Port", + "Info": "Info", + "Error": "Fehler", + "Warning": "Warnung", + "ConfigureNetworkInfo": "Es ist sehr wichtig dass der richtige Netzwerkadapter eingestellt wird, da sonst keine Verbindung zum Server hergestellt werden kann. In den meisten fällen heißt der Netzwerkadapter \"Ethernet\" oder \"WLAN\" und die IP Adresse sieht meist wie \"192.168.178.xxx\" aus.\n \nDer Standartport für Macro Deck ist 8191. Wenn andere Anwendungen diesen Port schon benutzen, muss dieser geändert werden.\n ", + "AutomaticallyCheckUpdates": "Automatisch nach Updates suchen", + "AutomaticallyStartWithWindows": "Automatisch mit Windows starten", + "Show": "Macro Deck konfigurieren", + "Exit": "Beenden", + "XUpdatesAvailable": "{0} Updates verfügbar", + "Profile": "Profil", + "Columns": "Spalten", + "Rows": "Zeilen", + "Spacing": "Abstand", + "CornerRadius": "Eckradius", + "ButtonBackGround": "Tastenhintergrund", + "AreYouSure": "Sicher?", + "Behaviour": "Verhalten", + "Plugins": "Plugins", + "IconPacks": "Iconpakete", + "All": "Alle", + "Updates": "Updates", + "Installed": "Installiert", + "Install": "Installieren", + "Search": "Suche...", + "Name": "Name", + "Type": "Typ", + "Value": "Wert", + "Creator": "Erstellt von", + "Ok": "Ok", + "FolderName": "Ordnername", + "Never": "Nie", + "OnApplicationFocus": "Wenn Anwendung fokusiert", + "Application": "Anwendung", + "Devices": "Geräte", + "Create": "Erstellen", + "Save": "Speichern", + "Appearance": "Aussehen", + "ButtonState": "Tastenstatus", + "Label": "Beschriftung", + "Top": "Oben", + "Center": "Mittig", + "Bottom": "Unten", + "Path": "Pfad", + "CurrentState": "Aktueller Zustand", + "Off": "Aus", + "On": "Ein", + "DownloadAndInstall": "Herunterladen", + "Downloading": "Herunterladen...", + "Color": "Farbe", + "IconPack": "Iconpaket", + "Size": "Größe", + "CurrentProgress": "Aktueller Fortschritt", + "TotalProgress": "Gesamter Fortschritt", + "XDownloads": "{0} Downloads", + "Update": "Update", + "Plugin": "Plugin", + "MacroDeckNeedsARestart": "Macro Deck muss neugestartet werden", + "MacroDeckMustBeRestartedForTheChanges": "Macro Deck muss neugestartet werden. Soll Macro Deck jetzt neugestartet werden?", + "Configure": "Konfigurieren", + "Uninstall": "Deinstallieren", + "NotLoaded": "Deaktiviert", + "Yes": "Ja", + "No": "Nein", + "Status": "Status", + "BlockConnection": "Verbindung blockieren", + "Change": "Ändern", + "Id": "ID", + "Connected": "Verbunden", + "Disconnected": "Getrennt", + "Trigger": "Auslöser", + "Action": "Aktion", + "Condition": "Bedingung", + "InstalledVersion": "Installierte Version", + "UpdateChannel": "Updatekanal", + "CheckForUpdatesNow": "Auf Updates prüfen", + "Author": "Autor", + "Version": "Version", + "TheFolderWillBeDeleted": "Der Ordner {0} mit allen konfigurierten Tasten wird gelöscht.", + "TheProfileWillBeDeleted": "Das Profil {0} mit allen Ordnern und Tasten wird gelöscht.", + "ServerOffline": "Server Offline", + "ServerRunning": "Server läuft", + "XPluginsLoaded": "Plugins aktiv: {0}", + "XPluginsDisabled": "Plugins deaktiviert: {0}", + "XClientsConnected": "Geräte verbunden: {0}", + "IpAddressHostNamePort": "IP Addresse/Hostname : Port", + "InitialSetupButtonBack": "<- Zurück", + "InitialSetupButtonNext": "Weiter ->", + "InitialSetupButtonFinish": "Fertig", + "InitialSetupSelectLanguage": "Sprache auswählen", + "InitialSetupPage": "{0}/{1}", + "InitialSetupWelcome": "Willkommen zu Macro Deck 2!", + "InitialSetupLetsConfigure": "Lass uns einige Dinge konfigurieren", + "InitialSetupConfigureNetworkSettings": "Netzwerkeinstellungen konfigurieren", + "InitialSetupConfigureGridPreferences": "Raster konfigurieren", + "InitialSetupPickAllPluginsYouNeed": "Plugins auswählen", + "InitialSetupDontWorryInstallUninstallPlugins": "Plugins können später im Package Manager installiert/deinstalliert werden", + "InitialSetupWantSomeIcons": "Iconpakete auswählen", + "InitialSetupInstallIconPacksPackageManager": "Iconpakete können später im Package Manager installiert werden", + "InitialSetupAlmostDone": "Gleich gehts los!", + "KnownDevices": "Bekannte Geräte", + "AskOnNewConnections": "Bei Verbindung fragen", + "AllowAllNewConnections": "Alle Verbindungen erlauben (Nicht empfohlen)", + "BlockAllNewConnections": "Alle neuen Verbindungen blockieren", + "InstallDLL": ".dll installieren (Nicht empfohlen)", + "NeverInstallDLLFiles": ".dll Plugins von unbekannten Quellen können dem System Schaden zufügen. Installiere nur Plugins von denen du die Quelle sicher kennst. Plugin installieren?", + "XWillBeUninstalled": "{0} wird deinstalliert.", + "XSuccessfullyUninstalled": "{0} ist deinstalliert. Macro Deck muss neugestartet werden. Macro Deck jetzt neustarten?", + "CreateVariable": "Variable erstellen", + "DeleteVariable": "Variable löschen", + "SelectAPluginAndActionToBegin": "Plugin und Aktion auswählen um zu beginnen", + "ActionNeedsNoConfiguration": "Diese Aktion erfordert keine Konfiguration", + "CantCreateFolder": "Ordner kann nicht erstellt werden", + "FolderCalledXAlreadyExists": "Ein Ordner mit dem Namen \"{0}\" existiert bereits", + "OnPress": "Bei drücken", + "OnEvent": "Bei Ereignis", + "CantCreateIconPack": "Iconpaket kann nicht erstellt werden", + "IconPackCalledXAlreadyExists": "Ein Iconpaket mit dem Namen {0} existiert bereits", + "CantCreateProfile": "Profil kann nicht erstellt werden", + "ProfileCalledXAlreadyExists": "Ein Profil mit dem Namen {0} existiert bereits", + "TheresAnUpdateForYou": "Neues Update verfügbar :)", + "VersionXIsNowAvailable": "Version {0} ({1}) kann heruntergeladen werden", + "ReadyToDownloadUpdate": "Bereit", + "DownloadingUpdate": "Wird heruntergeladen... {0}% ({1}MB/{2}MB)", + "VerifyingUpdateFile": "Datei wird verifiziert...", + "MD5NotValid": "MD5 Checksumme nicht gültig", + "StartingInstaller": "Installer wird gestartet", + "FileNotFound": "Datei nicht gefunden", + "TryAgainOrDownloadManually": "Erneut versuchen oder manuell installieren", + "Trending": "Trends", + "Layers": "Ebenen", + "AddImage": "Bild", + "IconImportQualityInfo": "Viele Icons mit hoher Qualität können zu Performanceproblemen führen, vorallem bei animierten GIFs.\nFür animierte GIFs sollte die Voreinstellung \"Niedrig\" oder \"Niedrigste\" verwendet werden.\n ", + "Original": "Original", + "High350px": "Hoch (350px)", + "Normal200px": "Normal (200px)", + "Low150px": "Niederig (150px)", + "Lowest100px": "Niedrigste (100px)", + "ImportIconPack": "Importieren", + "ExportIconPack": "Exportieren", + "CreateIcon": "Icon erstellen", + "ImportIcon": "Icon importieren", + "DeleteIcon": "Icon löschen", + "IconSelectorManagedInfo": "Dieses Iconpaket wird vom Package Manager verwaltet", + "DownloadingXPackages": "{0} Pakete herunterladen", + "PluginCouldNotBeLoaded": "Plugin konnte nicht geladen werden. Möglicherweise ist die Version des Plugins nicht mit dieser Version von Macro Deck kompatibel.", + "CantChangeName": "Name konnte nicht geändert werden", + "DeviceCalledXAlreadyExists": "Ein Gerät mit dem Namen {0} existiert bereits", + "NewConnection": "Neue Verbindung", + "XIsAnUnknownDevice": "{0} ist ein unbekanntes Gerät. Verbindung erlauben?", + "ShouldMacroDeckBlockConnectionsFromX": "Sollen Verbindungsversuche von {0} immer blockiert werden?", + "FailedToStartServer": "Server konnte nicht gestartet werden. Möglicherweise wird der Port schon benutzt oder der falsche Netzwerkadapter ist eingestellt.", + "ErrorWhileLoadingPlugins": "Fehler beim Laden von Plugins", + "PluginXCouldNotBeLoaded": "{0} Version {1} konnte nicht geladen werden. Möglicherweise ist die Version nicht kompatibel. Tasten, welche dieses Plugin nutzen, funktionieren möglicherweise nicht.", + "InstallationSuccessfull": "Installation erfolgreich", + "PluginXInstalledSuccessfully": "{0} wurd installiert", + "ErrorWhileInstallingPlugin": "Fehler beim Installieren", + "PluginXCouldNotBeInstalled": "{0} konnte nicht installiert werden. Möglicherweise ist die Version nicht kompatibel.", + "Settings": "Einstellungen", + "Language": "Sprache", + "General": "Allgemein", + "Connection": "Verbindung", + "Backup": "Backup", + "About": "Über", + "NoUpdatesAvailable": "Keine Updates verfügbar", + "LatestVersionInstalled": "Die aktuellste Version ist bereits installiert", + "WarningDevVersions": "Dev Versionen können sehr instabil sein und Datenverlust innerhalb von Macro Deck verursachen (Konfigurierte Tasten, Ordner und Profile). Dev Updatekanal aktivieren?", + "WarningBetaVersions": "Beta Versionen können instabil sein. Beta Updatekanal aktivieren?", + "VariableXGetsDeleted": "{0} wird gelöscht", + "DeckTitle": "Deck", + "DeviceManagerTitle": "Gerätemanager", + "PackageManagerTitle": "Paketverwaltung", + "SettingsTitle": "Einstellungen", + "VariablesTitle": "Globale Variablen", + "Edit": "Bearbeiten", + "Delete": "Löschen", + "Run": "Ausführen", + "Copy": "Kopieren", + "Paste": "Einfügen", + "WebSocketAPIVersion": "Websocket API Version", + "PluginAPIVersion": "Plugin API Version", + "InstalledPlugins": "Installierte Plugins", + "OperatingSystem": "Betriebssystem", + "DevelopedByX": "Von {0} in Deutschland entwickelt", + "XTranslationByX": "{0} Übersetzung von {1}", + "PackageManagerTabAvailable": "Verfügbar", + "PackageManagerTabInstalled": "Installiert", + "Event": "Ereignis", + "AutomaticallySwitchToFolder": "Automatisch zu Ordner wechseln", + "Restart": "Macro Deck neustarten", + "Delay": "Verzögerung", + "If": "Wenn", + "Else": "Sonst", + "Online": "Online", + "By": "Von", + "StateBinding": "Zustand binden an", + "ErrorWhileLoadingPackageManager": "Fehler beim Laden der Paketverwaltung. \n Möglicherweise besteht Internetverbindung oder Macro Deck wird von der Firewall blockiert.", + "UpdatesAvailable": "Updates verfügbar", + "EnableIconCache": "Icon Cache aktivieren (schneller; höhere Arbeitsspeicherauslastung)", + "WebClient": "Webclient", + "AndroidApp": "Android App", + "IOSApp": "iOS App", + "PluginMacroDeckFolder": "Macro Deck Ordner", + "ActionChangeFolder": "Ordner ändern", + "ActionChangeFolderDescription": "Ändert den Ordner auf dem Gerät, das die Aktion ausgeführt hat, zu dem eingestellten Ordner", + "ActionGoToParentFolder": "Gehe zu übergeordnetem Ordner", + "ActionGoToParentFolderDescription": "Ändert den Ordner auf dem Gerät, das die Aktion ausgeführt hat, zu dem übergeordnetem Ordner", + "ActionGoToRootFolder": "Gehe zum Hauptverzeichnis", + "ActionGoToRootFolderDescription": "Ändert den Ordner auf dem Gerät, das die Aktion ausgeführt hat, zum Hauptverzeichnis", + "PluginMacroDeckVariables": "Macro Deck Variablen", + "ActionChangeVariableValue": "Variablenwert ändern", + "ActionChangeVariableValueDescription": "Variablenwert hoch-, runterzählen, umschalten und setzen", + "CountUp": "Hochzählen", + "CountDown": "Runterzählen", + "Set": "Setzen", + "Toggle": "Umschalten", + "Variable": "Variable", + "PluginActionButton": "Diese Taste", + "ActionToggleActionButtonState": "Tastenstatus umschalten", + "ActionToggleActionButtonStateDescription": "Schaltet den Status der gedrückten Taste um", + "ActionSetActionButtonStateOff": "Tastenstatus zu \"Off\" ändern", + "ActionSetActionButtonStateOffDescription": "Ändert den Tastenstatus der gedrückten Taste zu \"Off\"", + "ActionSetActionButtonStateOn": "Tastenstatus zu \"On\" ändern", + "ActionSetActionButtonStateOnDescription": "Ändert den Tastenstatus der gedrückten Taste zu \"On\"", + "Description": "Beschreibung", + "License": "Lizenz", + "AnimatedGifImported": "Animiertes GIF importiert", + "GenerateStaticIcon": "Soll eine statische version des ersten Frames erstellt werden?", + "XSuccessfullyExportedToX": "{0} wurde erfolgreich zu {1} exportiert", + "SelectedIconWillBeDeleted": "Das gewählte Icon wird aus {0} gelöscht", + "SuccessfullyImportedIconPack": "{0} erfolgreich importiert", + "SelectedIconPackWillBeDeleted": "{0} mit allen Icons wird gelöscht", + "GenerateStatic": "Statisches generieren", + "OnlyUserCreatedVariablesVisible": "Nur vom Nutzer erstellte Variablen sind sichtbar", + "MacroDeckUsesCottleTemplateEngine": "Macro Deck nutzt die Cottle Template Engine. Hier klicken für mehr Informationen.", + "Result": "Ergebnis", + "InstallDevVersions": "Dev Versionen installieren", + "InstallBetaVersions": "Beta Versionen installieren", + "WhatDoYouWantToRestore": "Was soll wiederhergestellt werden?", + "Configuration": "Konfiguration", + "Profiles": "Profile", + "Variables": "Variablen", + "PluginConfigurations": "Plugin-Konfigurationen", + "PluginCredentials": "Plugin-Anmeldedaten", + "InstalledIconPacks": "Installierte Iconpakete", + "Restore": "Wiederherstellen", + "ActionCannotBeReversed": "Diese Aktion kann nicht rückgängig gemacht werden", + "ThisWillDeleteBackupPermanently": "Dies wird das Backup permanent löschen", + "Created": "Erstellt", + "PleaseWait": "Bitte warten...", + "Backups": "Backups", + "CreateBackup": "Backup erstellen", + "BackupFailed": "Backup fehlgeschlagen", + "BackupSuccessfullyCreated": "Backup erfolgreich erstellt", + "CreateBackupBeforeUpdate": "Soll vor dem Update ein Backup erstellt werden?", + "CreatingBackup": "Erstelle Backup...", + "PluginNeedsConfiguration": "Dieses Plugin erfordert Konfiguration", + "ConfigureNow": "{0} jetzt konfigurieren?", + "Hotkey": "Tastenkombination", + "PressTheKeysNow": "Tasten jetzt drücken...", + "XAction": "{0} Aktion", + "XActions": "{0} Aktionen", + "OnRelease": "Bei loslassen", + "OnLongPress": "Bei halten", + "OnLongPressRelease": "Bei halten loslassen", + "SimulateOnPress": "\"Bei drücken\" simulieren", + "SimulateOnRelease": "\"Bei loslassen\" simulieren", + "SimulateOnLongPress": "\"Bei halten\" simulieren", + "SimulateOnLongPressRelease": "\"Bei halten loslassen\" simulieren", + "HotkeyExecutesOnPress": "Beim Drücken der Tastenkombination werden die Aktionen in \"Bei drücken\" ausgeführt", + "Important": "Wichtig!", + "FirewallAlertInfo": "\n\t\tNach dem Start von Macro Deck, wird ein Dialog von der Windows Defender Firewall erscheinen.\n\t\tBitte alle Haken setzen (Private Netzwerke, Öffentliche Netzwerke und Domänennetzwerke, falls dies existiert).\n\t\t\n\t\tWenn dieser Dialog nicht erscheint und es Probleme bei der Verbindung gibt, bekommst du Hilfe im Wiki und im Discord Server.\n\t", + "GotIt": "Verstanden!", + "DeviceSettings": "Geräteeinstellungen", + "Brightness": "Helligkeit", + "AutoConnect": "Automatisch verbinden", + "DiscordSupport": "Discord Support", + "Wiki": "Wiki", + "ExportLatestLog": "Aktuelle Log-Datei exportieren", + "LogSuccessfullyExportedToX": "Log-Datei erfolgreich nach {0} exportiert", + "Help": "Hilfe", + "XWarningsXErrors": "{0} Warnung(en), {1} Fehler", + "TrimBlankLines": "Leerzeilen abschneiden", + "Extensions": "Erweiterungen", + "InstallFromFile": "Aus Datei installieren", + "AllExtensionsUpToDate": "Alle Erweiterungen sind aktuell", + "UpdateAll": "Alle aktualisieren", + "UpdateAvailable": "Update verfügbar", + "PendingRestart": "Neustart ausstehend", + "Enabled": "Aktiviert", + "Disabled": "Deaktiviert", + "ActionSaveVariableToFile": "Variable in Datei speichern", + "ActionSaveVariableToFileDescription": "Speichert den Wert einer Variable in eine Datei", + "Folders": "Ordner", + "Grid": "Raster", + "ActionReadVariableFromFile": "Variable aus Datei lesen", + "ActionReadVariableFromFileDescription": "Setzt den Wert einer Variable zu dem aus der Datei gelesenen Wert", + "ActionSetProfile": "Profil ändern", + "ActionSetProfileDescription": "Ändert das Profil eines Geräts", + "Device": "Gerät", + "WhereExecuted": "Wo ausgeführt", + "ActionSetBrightness": "Helligkeit ändern", + "ActionSetBrightnessDescription": "Ändert die Display Helligkeit (Funktioniert nur mit der Android App!)", + "BindableVariable": "Tastenzustand binden", + "BindableVariableInfo": "Der Zustand dieser Taste kann an die Variable {0} gebunden werden. Soll der Zustand an diese Variable gebunden werden?", + "Cancelled": "Abgebrochen", + "Preparing": "Wird vorbereitet...", + "Installing": "Installiere...", + "Completed": "Fertig", + "ExtensionStoreDownloaderPackageIdVersion": "{0} Version {1}", + "DownloadingAndInstallingXPackages": "{0} Paket(e) werden heruntergeladen und installiert", + "InstallationOfXPackagesDone": "Installation von {0} Paket(en) fertig", + "ActionSetBackgroundColor": "Hintergrundfarbe ändern", + "ActionSetBackgroundColorDescription": "Ändert die Hindergrundfarbe einer Taste", + "Fixed": "Fest", + "Random": "Zufällig", + "NewConnectionRequest": "Neue Verbindungsanfrage", + "ClientId": "Client Id", + "Accept": "Akzeptieren", + "Deny": "Ablehnen", + "VersionBuild": "Build", + "OpenExtensionManager": "Extension Manager öffnen", + "OpenSettings": "Einstellungen öffnen" +======= "__Language__": "German", "__LanguageCode__": "de", "__Author__": "Macro Deck", @@ -301,4 +631,5 @@ "Grid": "Raster", "ActionReadVariableFromFile": "Variable aus Datei lesen", "ActionReadVariableFromFileDescription": "Setzt den Wert einer Variable zu dem aus der Datei gelesenen Wert" +>>>>>>> origin/main } \ No newline at end of file diff --git a/Resources/Languages/Hungarian.json b/Resources/Languages/Hungarian.json index 0b33e0fd..991d805d 100644 --- a/Resources/Languages/Hungarian.json +++ b/Resources/Languages/Hungarian.json @@ -1,4 +1,327 @@ { +<<<<<<< HEAD + "__Language__": "Hungarian", + "__LanguageCode__": "hu", + "__Author__": "MakeTrue", + "NetworkAdapter": "Hálózati adapter", + "IPAddress": "IP-cím", + "Port": "Port", + "Info": "Infó", + "Error": "Hiba", + "Warning": "Figyelem", + "ConfigureNetworkInfo": "Nagyon fontos a megfelelő hálózati adapter kiválasztása, különben nem tud kapcsolódni a klienssel a szerverhez. A legtöbb esetben a hálózati adapter neve „Ethernet” vagy „Wi-Fi”, az IP-cím pedig a legtöbb esetben „192.168.178.xxx”.\n\nA Macro Deck alapértelmezett portja a 8191. Ha más alkalmazás használja ezt módosíthatja.", + "AutomaticallyCheckUpdates": "Frissítések automatikus keresése", + "AutomaticallyStartWithWindows": "Automatikus indítás a Windowsal", + "Show": "Macro Deck konfigurálása", + "Exit": "Macro Deck bezárása", + "XUpdatesAvailable": "{0} frissítés érhető el", + "Profile": "Profil", + "Columns": "Oszlopok", + "Rows": "Sorok", + "Spacing": "Térköz", + "CornerRadius": "Saroksugár", + "ButtonBackGround": "Gomb háttere", + "AreYouSure": "Biztos vagy ebben?", + "Behaviour": "Viselkedés", + "Plugins": "Bővítmények", + "IconPacks": "Ikon csomagok", + "All": "Minden", + "Updates": "Frissítések", + "Installed": "Telepítve", + "Install": "Telepítés", + "Search": "Keresés...", + "Name": "Név", + "Type": "Típus", + "Value": "Érték", + "Creator": "Alkotó", + "Ok": "Rendben", + "FolderName": "Mappa neve", + "Never": "Soha", + "OnApplicationFocus": "Ha az alkalmazás fókuszálva van", + "Application": "Alkalmazás", + "Devices": "Eszközök", + "Create": "Létrehoz", + "Save": "Mentés", + "Appearance": "kinézet", + "ButtonState": "Gomb állapota", + "Label": "Felirat", + "Top": "Teteje", + "Center": "Közép", + "Bottom": "Alsó", + "Path": "Pálya", + "CurrentState": "Jelenlegi állapot", + "Off": "Ki", + "On": "Be", + "DownloadAndInstall": "letöltés és telepítés", + "Downloading": "Letöltés...", + "Color": "Szín", + "IconPack": "Ikon csomag", + "Size": "Méret", + "CurrentProgress": "Jelenlegi folyamat", + "TotalProgress": "Teljes haladás", + "XDownloads": "{0} letöltés", + "Update": "Frissítés", + "Plugin": "Bővítmény", + "MacroDeckNeedsARestart": "A Macro Deck újraindítást igényel", + "MacroDeckMustBeRestartedForTheChanges": "A módosítások életbe léptetéséhez újra kell indítani a Macro Deck alkalmazást. Szeretné most újraindítani a Macro Deck alkalmazást?", + "Configure": "Beállítás", + "Uninstall": "Eltávolítás", + "NotLoaded": "Nincs betöltve", + "Yes": "Igen", + "No": "Nem", + "Status": "Státusz", + "BlockConnection": "Csatlakozás blokkolása", + "Change": "változás", + "Id": "ID", + "Connected": "Csatlakoztatva", + "Disconnected": "Szétkapcsolt", + "Trigger": "Indítás", + "Action": "Művelet", + "Condition": "Feltétel", + "InstalledVersion": "Telepített verzió", + "UpdateChannel": "Frissítési csatorna", + "CheckForUpdatesNow": "Keressen frissítéseket most", + "Author": "Szerző", + "Version": "Változat", + "TheFolderWillBeDeleted": "A(z) {0} mappa az összes műveletgombjával együtt törlődik.", + "TheProfileWillBeDeleted": "A(z) {0} profil az összes mappájával és műveletgombjával együtt törlődik.", + "ServerOffline": "Szerver offline", + "ServerRunning": "Szerver fut", + "XPluginsLoaded": "{0} bővítmény betöltve", + "XPluginsDisabled": "{0} bővítmény letiltva", + "XClientsConnected": "{0} kliens csatlakozott", + "IpAddressHostNamePort": "IP-cím/gazdanév: Port", + "InitialSetupButtonBack": "<- Vissza", + "InitialSetupButtonNext": "Következő ->", + "InitialSetupButtonFinish": "Befejez", + "InitialSetupSelectLanguage": "Válaszd ki a nyelved", + "InitialSetupPage": "{0}/{1}. oldal", + "InitialSetupWelcome": "Üdvözöljük a Macro Deck 2-ben!", + "InitialSetupLetsConfigure": "Konfiguráljuk a Macro Deck élményét", + "InitialSetupConfigureNetworkSettings": "Konfigurálja a hálózati beállításokat", + "InitialSetupConfigureGridPreferences": "Most állítsuk be a rácsot az ön igényei szerint", + "InitialSetupPickAllPluginsYouNeed": "Válassza ki az összes szükséges bővítményt", + "InitialSetupDontWorryInstallUninstallPlugins": "Ne aggódjon, később bármikor telepítheti/eltávolíthatja a bővítményeket a csomagkezelőben", + "InitialSetupWantSomeIcons": "Kérsz néhány ikont?", + "InitialSetupInstallIconPacksPackageManager": "Az ikoncsomagokat később is telepítheti a csomagkezelőben", + "InitialSetupAlmostDone": "Már majdnem készen vagyunk!", + "KnownDevices": "Ismert eszközök", + "AskOnNewConnections": "Kérdezzen új kapcsolatokról", + "AllowAllNewConnections": "Minden új kapcsolat engedélyezése (nem ajánlott)", + "BlockAllNewConnections": "Minden új kapcsolat letiltása", + "InstallDLL": ".dll telepítése (nem ajánlott)", + "NeverInstallDLLFiles": "Soha ne telepítsen .dll fájlokat olyan forrásból, amelyben nem bízik! Az ismeretlen forrásból származó .dll fájlok károsíthatják a rendszert, csak akkor telepítse, ha tudja, mit csinál! Valóban szeretne .dll beépülő modult telepíteni?", + "XWillBeUninstalled": "A(z) {0} eltávolításra kerül.", + "XSuccessfullyUninstalled": "A(z) {0} eltávolításra kerül. A Macro Deck alkalmazást újra kell indítani, hogy a változtatások érvénybe lépjenek. A Macro Deck újraindítása most?", + "CreateVariable": "Változó létrehozása", + "DeleteVariable": "Változó törlése", + "SelectAPluginAndActionToBegin": "A kezdéshez válasszon ki egy bővítményt és egy műveletet", + "ActionNeedsNoConfiguration": "Ez a művelet nem igényel konfigurációt", + "CantCreateFolder": "Nem lehet mappát létrehozni", + "FolderCalledXAlreadyExists": "A(z) {0} nevű mappa már létezik", + "OnPress": "Lenyomáskor", + "OnEvent": "Eseménykor", + "CantCreateIconPack": "Nem lehet ikoncsomagot létrehozni", + "IconPackCalledXAlreadyExists": "A(z) {0} nevű ikoncsomag már létezik", + "CantCreateProfile": "Nem lehet profilt létrehozni", + "ProfileCalledXAlreadyExists": "A(z) {0} nevű profil már létezik", + "TheresAnUpdateForYou": "Frissítés van számodra :)", + "VersionXIsNowAvailable": "A(z) {0} ({1}) verzió már elérhető", + "ReadyToDownloadUpdate": "Készen áll a frissítés letöltésére", + "DownloadingUpdate": "Frissítés letöltése... {0}% ({1}MB/{2}MB)", + "VerifyingUpdateFile": "Frissítési fájl ellenőrzése...", + "MD5NotValid": "Az MD5 ellenőrző összeg nem érvényes", + "StartingInstaller": "Telepítő indítása", + "FileNotFound": "Fájl nem található", + "TryAgainOrDownloadManually": "Próbálja újra, vagy töltse le manuálisan a frissítést", + "Trending": "Felkapott", + "Layers": "Rétegek", + "AddImage": "Kép hozzáadása", + "IconImportQualityInfo": "A jó minőségű ikonok a memóriahasználat és a betöltési idő növekedéséhez vezethetnek, különösen sok nagy animált gif használata esetén.\n\n\nGif esetén az alacsony vagy a legalacsonyabb előre beállított érték használata javasolt.", + "Original": "Eredeti", + "High350px": "Magas (350px)", + "Normal200px": "Normál (200px)", + "Low150px": "Alacsony (150px)", + "Lowest100px": "Legalacsonyabb (100px)", + "ImportIconPack": "Ikoncsomag importálása", + "ExportIconPack": "Ikoncsomag exportálása", + "CreateIcon": "Ikon létrehozása", + "ImportIcon": "Ikon importálása", + "DeleteIcon": "Ikon törlése", + "IconSelectorManagedInfo": "Ezt az ikoncsomagot a bővítménykezelő kezeli", + "DownloadingXPackages": "{0} csomag letöltése", + "PluginCouldNotBeLoaded": "A bővítményt nem sikerült betölteni. Lehet, hogy ennek a bővítménynek a telepített verziója nem kompatibilis a Macro Deck ezen verziójával.", + "CantChangeName": "Nem lehet megváltoztatni a nevet", + "DeviceCalledXAlreadyExists": "A(z) {0} nevű eszköz már létezik", + "NewConnection": "Új kapcsolat", + "XIsAnUnknownDevice": "A(z) {0} egy ismeretlen eszköz, és csatlakozni szeretne a Macro Deckhez. Engedélyezi a csatlakozást?", + "ShouldMacroDeckBlockConnectionsFromX": "A Macro Deck automatikusan blokkolja a jövőbeli kapcsolatokat a következőről: {0}?", + "FailedToStartServer": "Nem sikerült elindítani a szervert. Lehet, hogy a konfigurált port már használatban van, vagy nem megfelelő hálózati adaptert állított be. Győződjön meg arról, hogy a megfelelő hálózati adaptert állította be a beállításokban, és próbálja meg megváltoztatni a portot.", + "ErrorWhileLoadingPlugins": "Hiba a bővítmények betöltése közben", + "PluginXCouldNotBeLoaded": "A(z) {0} {1} verzió nem tölthető be. Lehet, hogy nem kompatibilis a Macro Deck ezen verziójával. Azok a műveletek, amelyek ezt a beépülő modult használják, nem működnek, amíg a bővítményt nem frissítik.", + "InstallationSuccessfull": "Sikeres telepítés", + "PluginXInstalledSuccessfully": "{0} sikeresen telepítve", + "ErrorWhileInstallingPlugin": "Hiba a bővítmény telepítésekor", + "PluginXCouldNotBeInstalled": "A(z) {0} nem telepíthető. Talán nem kompatibilis a Macro Deck ezen verziójával", + "Settings": "Beállítások", + "Language": "Nyelv", + "General": "Általános", + "Connection": "Csatlakozás", + "Backup": "biztonsági mentés", + "About": "A macro deckről", + "NoUpdatesAvailable": "Nincsenek frissítések", + "LatestVersionInstalled": "A legújabb verzió már telepítve van", + "WarningDevVersions": "A fejlesztői verziók nagyon instabilok lehetnek, és összeomlásokat vagy adatvesztést okozhatnak (konfigurált műveletgombok, mappák és profilok). Biztosan engedélyezni szeretné a Dev frissítési csatornát?", + "WarningBetaVersions": "A béta verziók néha instabilok lehetnek, és összeomlásokat okozhatnak. Valóban engedélyezni szeretné a Béta frissítési csatornát?", + "VariableXGetsDeleted": "A(z) {0} változó törlődik", + "DeckTitle": "Deck", + "DeviceManagerTitle": "Eszközkezelő", + "PackageManagerTitle": "Csomagkezelő", + "SettingsTitle": "Beállítások", + "VariablesTitle": "Globális változók", + "Edit": "Szerkesztés", + "Delete": "Töröl", + "Run": "Futtatás", + "Copy": "Másolás", + "Paste": "Beillesztés", + "WebSocketAPIVersion": "Websocket API verzió", + "PluginAPIVersion": "Bővítmény API verzió", + "InstalledPlugins": "Telepített bővítmények", + "OperatingSystem": "Operációs rendszer", + "DevelopedByX": "Fejlesztője: {0} Németországban", + "XTranslationByX": "{0} fordítása: {1}", + "PackageManagerTabAvailable": "Elérhető", + "PackageManagerTabInstalled": "Telepítve", + "Event": "Esemény", + "AutomaticallySwitchToFolder": "Automatikus váltás mappára", + "Restart": "Indítsa újra a Macro Deck-et", + "Delay": "Késleltetés", + "If": "Ha", + "Else": "Egyéb", + "Online": "Online", + "By": "Által", + "StateBinding": "Kösse a következő állapothoz", + "ErrorWhileLoadingPackageManager": "Hiba a csomagkezelő betöltése közben. Lehet, hogy nem csatlakozik az internethez, vagy a Macro Decket blokkolja a tűzfal.", + "UpdatesAvailable": "Frissítések állnak rendelkezésre", + "EnableIconCache": "Ikon gyorsítótár engedélyezése (gyorsabb; nagyobb memóriahasználat)", + "WebClient": "Web kliens", + "AndroidApp": "Android kliens", + "IOSApp": "iOS kliens", + "PluginMacroDeckFolder": "Macro Deck mappa", + "ActionChangeFolder": "Mappa módosítása", + "ActionChangeFolderDescription": "Módosítsa az aktuális eszköz aktuális mappáját a konfigurált mappára", + "ActionGoToParentFolder": "Lépjen a szülő mappába", + "ActionGoToParentFolderDescription": "Módosítsa az aktuális eszköz aktuális mappáját a mappák szülőmappájára", + "ActionGoToRootFolder": "Menjen a gyökér mappába", + "ActionGoToRootFolderDescription": "Módosítsa az aktuális eszköz aktuális mappáját a gyökérmappára", + "PluginMacroDeckVariables": "Macro Deck változók", + "ActionChangeVariableValue": "Változó értékének módosítása", + "ActionChangeVariableValueDescription": "Számoljon felfelé, számoljon le, állítson be egy változó értéket és váltson át változó értéket", + "CountUp": "Számoljon felfelé", + "CountDown": "számoljon le", + "Set": "Állítsa be", + "Toggle": "Váltás", + "Variable": "Változó", + "PluginActionButton": "Ez a művelet gomb", + "ActionToggleActionButtonState": "A gomb állapotának váltása", + "ActionToggleActionButtonStateDescription": "Változtat a gomb állapotán", + "ActionSetActionButtonStateOff": "Kapcsolja ki a gomb állapotát", + "ActionSetActionButtonStateOffDescription": "A gomb állapotát \"ki\"-re állítja", + "ActionSetActionButtonStateOn": "Állítsa be a gomb állapotát", + "ActionSetActionButtonStateOnDescription": "A gomb állapotát \"be\"-re állítja", + "Description": "Leírás", + "License": "Licenc", + "AnimatedGifImported": "Animált gif importálva", + "GenerateStaticIcon": "Létrehoz egy statikus ikont is a GIF első képkockájáról?", + "XSuccessfullyExportedToX": "{0} sikeresen exportálva ide: {1}", + "SelectedIconWillBeDeleted": "A kiválasztott ikon törlődik az ikoncsomagból {0}", + "SuccessfullyImportedIconPack": "A(z) {0} ikoncsomag sikeresen importálva", + "SelectedIconPackWillBeDeleted": "A kiválasztott {0} ikoncsomag az összes ikonjával együtt törlődik", + "GenerateStatic": "Generáljon statikust", + "OnlyUserCreatedVariablesVisible": "Csak a felhasználó által létrehozott változók láthatók", + "MacroDeckUsesCottleTemplateEngine": "A Macro Deck a Cottle sablonmotort használja. Kattintson ide további információért.", + "Result": "Eredmény", + "InstallDevVersions": "Telepítse a Dev verziókat", + "InstallBetaVersions": "Telepítse a béta verziókat", + "WhatDoYouWantToRestore": "Mit szeretnél visszaállítani a biztonsági mentésből?", + "Configuration": "Konfiguráció", + "Profiles": "Profilok", + "Variables": "Változók", + "PluginConfigurations": "Bővítmény konfigurációi", + "PluginCredentials": "Bővítmény hitelesítő adatai", + "InstalledIconPacks": "Telepített ikoncsomagok", + "Restore": "Visszaállítás", + "ActionCannotBeReversed": "Ez a művelet nem vonható vissza", + "ThisWillDeleteBackupPermanently": "Ezzel végleg törli a biztonsági másolatot", + "Created": "Létrehozva", + "PleaseWait": "Kérlek várj...", + "Backups": "Biztonsági mentések", + "CreateBackup": "Készítsen biztonsági mentést", + "BackupFailed": "A biztonsági mentés nem sikerült", + "BackupSuccessfullyCreated": "A biztonsági mentés sikeresen létrehozva", + "CreateBackupBeforeUpdate": "Szeretnél biztonsági másolatot készíteni a frissítés előtt?", + "CreatingBackup": "Biztonsági másolat létrehozása...", + "PluginNeedsConfiguration": "Ezt a bővítményt konfigurálni kell", + "ConfigureNow": "Szeretné most konfigurálni a következőt: {0}?", + "Hotkey": "Gyorsbillentyű", + "PressTheKeysNow": "Nyomja meg a hozzárendelni kívánt gombokat", + "XAction": "{0} művelet", + "XActions": "{0} műveletek", + "OnRelease": "Elengedéskor", + "OnLongPress": "Hosszú nyomáskor", + "OnLongPressRelease": "Hosszú nyomás elengedésekor", + "SimulateOnPress": "szimulálja a \"Lenyomáskor\"-t", + "SimulateOnRelease": "szimulálja a \" \"", + "SimulateOnLongPress": "szimulálja a \"Hosszú nyomáskor\"-t", + "SimulateOnLongPressRelease": "szimulálja a \"Hosszú nyomás elengedésekor\"-t", + "HotkeyExecutesOnPress": "A gyorsbillentyű megnyomásakor végrehajtja a \"Lenyomáskor\" műveleteket", + "Important": "Fontos", + "FirewallAlertInfo": "A Macro Deck elindítása után megjelenik egy párbeszédpanel a Windows Defender tűzfalból.\nKérjük, jelölje be az összes négyzetet (Privát hálózatok, Nyilvános hálózatok és ha van, Domain hálózatok).\n\nHa ez a párbeszédpanel nem jelenik meg, és továbbra is kapcsolódási problémákat tapasztal, keresse fel a wikit vagy a discord szervert segítségért.", + "GotIt": "Megvan!", + "DeviceSettings": "Eszköz beállítások", + "Brightness": "Fényerősség", + "AutoConnect": "Csatlakozás automatikusan", + "DiscordSupport": "Discord segítség", + "Wiki": "Wiki", + "ExportLatestLog": "A legfrissebb napló exportálása", + "LogSuccessfullyExportedToX": "A napló sikeresen exportálva ide: {0}", + "Help": "Segítség", + "XWarningsXErrors": "{0} figyelmeztetés, {1} hiba", + "TrimBlankLines": "Vágja le az üres sorokat", + "Extensions": "Kiterjesztések", + "InstallFromFile": "Telepítés fájlból", + "AllExtensionsUpToDate": "Minden bővítmény naprakész", + "UpdateAll": "Mindent frissíteni", + "UpdateAvailable": "Frissítés elérhető", + "PendingRestart": "Újraindítás függőben", + "Enabled": "Engedélyezve", + "Disabled": "Tiltva", + "ActionSaveVariableToFile": "Változó mentése fájlba", + "ActionSaveVariableToFileDescription": "Fájlba menti a változó értékét", + "Folders": "Mappák", + "Grid": "Rács", + "ActionReadVariableFromFile": "Változó olvasása fájlból", + "ActionReadVariableFromFileDescription": "Beolvas egy fájlt, és beállítja a tartalmat egy változó értékének", + "ActionSetProfile": "Set profile", + "ActionSetProfileDescription": "Sets the profile on a device", + "Device": "Device", + "WhereExecuted": "Where executed", + "ActionSetBrightness": "Set brightness", + "ActionSetBrightnessDescription": "Sets the display brightness (Only on the Android app!)", + "BindableVariable": "Bindable variable", + "BindableVariableInfo": "The state of this button can be bound to the variable {0}. Do you want to bind the state?", + "Cancelled": "Cancelled", + "Preparing": "Preparing...", + "Installing": "Installing...", + "Completed": "Completed", + "ExtensionStoreDownloaderPackageIdVersion": "{0} version {1}", + "DownloadingAndInstallingXPackages": "Downloading and installing {0} package(s)", + "InstallationOfXPackagesDone": "Installation of {0} package(s) done", + "ActionSetBackgroundColor": "Set background color", + "ActionSetBackgroundColorDescription": "Changes the background color of a action button", + "Fixed": "Fixed", + "Random": "Random" +======= "__Language__": "Hungarian", "__LanguageCode__": "hu", "__Author__": "MakeTrue", @@ -301,4 +624,5 @@ "Grid": "Rács", "ActionReadVariableFromFile": "Változó olvasása fájlból", "ActionReadVariableFromFileDescription": "Beolvas egy fájlt, és beállítja a tartalmat egy változó értékének" +>>>>>>> origin/main } \ No newline at end of file diff --git a/Resources/Languages/Italian.json b/Resources/Languages/Italian.json index 77fa0c7b..bb4fcaaa 100644 --- a/Resources/Languages/Italian.json +++ b/Resources/Languages/Italian.json @@ -1,4 +1,327 @@ { +<<<<<<< HEAD + "__Language__": "Italian", + "__LanguageCode__": "it", + "__Author__": "PhoenixWyllow aka PW.Dev", + "NetworkAdapter": "Scheda di rete", + "IPAddress": "Indirizzo IP", + "Port": "Porta", + "Info": "Info", + "Error": "Errore", + "Warning": "Avviso", + "ConfigureNetworkInfo": "È molto importante selezionare l'adattatore di rete corretto o altrimenti non sarete in grado di connettervi con il client al server. Nella maggior parte dei casi il nome dell'adattatore di rete appare come \"Ethernet\" o \"Wi-Fi\" e l'indirizzo ip nella maggior parte dei casi appare come \"192.168.178.xxx\".\n\nLa porta predefinita per Macro Deck è 8191. Se qualche altra applicazione usa questa porta, puoi cambiarla.", + "AutomaticallyCheckUpdates": "Ricerca autotomatica degli aggiornamenti", + "AutomaticallyStartWithWindows": "Avvia con Windows", + "Show": "Configura Macro Deck", + "Exit": "Chiudi Macro Deck", + "XUpdatesAvailable": "{0} aggiornamenti disponibili", + "Profile": "Profilo", + "Columns": "Colonne", + "Rows": "Righe", + "Spacing": "Distanziamento", + "CornerRadius": "Raggio", + "ButtonBackGround": "Sfondo del bottone", + "AreYouSure": "Sei sicuro?", + "Behaviour": "Comportamento", + "Plugins": "Plugins", + "IconPacks": "Pacchetti di icone", + "All": "Tutto", + "Updates": "Aggiornamenti", + "Installed": "Installato", + "Install": "Installa", + "Search": "Cerca...", + "Name": "Nome", + "Type": "Tipo", + "Value": "Valore", + "Creator": "Creatore", + "Ok": "Ok", + "FolderName": "Nome cartella", + "Never": "Mai", + "OnApplicationFocus": "Sul focus dell'applicazione", + "Application": "Applicazione", + "Devices": "Dispositivi", + "Create": "Crea", + "Save": "Salva", + "Appearance": "Aspetto", + "ButtonState": "Stato bottone", + "Label": "Etichetta", + "Top": "In alto", + "Center": "Al centro", + "Bottom": "In basso", + "Path": "Percorso", + "CurrentState": "Stato attuale", + "Off": "Inattivo", + "On": "Attivo", + "DownloadAndInstall": "Scarica e installa", + "Downloading": "Scaricando...", + "Color": "Colore", + "IconPack": "Icone", + "Size": "Dimensione", + "CurrentProgress": "Progresso attuale", + "TotalProgress": "Progresso totale", + "XDownloads": "Scaricato {0} volte", + "Update": "Aggiorna", + "Plugin": "Plugin", + "MacroDeckNeedsARestart": "Macro Deck deve essere riavviato", + "MacroDeckMustBeRestartedForTheChanges": "Macro Deck necessita il riavvio perché le modifiche abbiano effetto. Vuoi riavviare Macro Deck ora?", + "Configure": "Configura", + "Uninstall": "Disinstalla", + "NotLoaded": "Non caricato", + "Yes": "Sì", + "No": "No", + "Status": "Stato", + "BlockConnection": "Blocca connessione", + "Change": "Cambia", + "Id": "ID", + "Connected": "Connesso", + "Disconnected": "Disconnesso", + "Trigger": "Trigger", + "Action": "Azione", + "Condition": "Condizione", + "InstalledVersion": "Versione installata", + "UpdateChannel": "Canale aggiornamenti", + "CheckForUpdatesNow": "Verifica aggiornamenti ora", + "Author": "Autore", + "Version": "Versione", + "TheFolderWillBeDeleted": "La cartella {0} e tutti i sui bottoni saranno cancellati.", + "TheProfileWillBeDeleted": "Il profilo {0}, tutte le sue cartelle e tutti i bottoni saranno cancellati.", + "ServerOffline": "Server offline", + "ServerRunning": "Server attivo", + "XPluginsLoaded": "{0} plugins caricati", + "XPluginsDisabled": "{0} plugins disabilitati", + "XClientsConnected": "{0} clients connessi", + "IpAddressHostNamePort": "Indirizzo IP/Hostname : Porta", + "InitialSetupButtonBack": "<- Indietro", + "InitialSetupButtonNext": "Avanti ->", + "InitialSetupButtonFinish": "Finisci", + "InitialSetupSelectLanguage": "Seleziona la tua lingua", + "InitialSetupPage": "Pagina {0}/{1}", + "InitialSetupWelcome": "Benvenuti in Macro Deck 2!", + "InitialSetupLetsConfigure": "Configuriamo la tua esperienza Macro Deck", + "InitialSetupConfigureNetworkSettings": "Configura le tue impostazioni di rete", + "InitialSetupConfigureGridPreferences": "Adesso, configuriamo le tue preferenze di griglia", + "InitialSetupPickAllPluginsYouNeed": "Seleziona tutti i plugins che ti servono", + "InitialSetupDontWorryInstallUninstallPlugins": "Non preoccuparti, puoi sempre installare/disinstallare plugins successivamente nel gestore di pacchetti", + "InitialSetupWantSomeIcons": "Vuoi delle icone?", + "InitialSetupInstallIconPacksPackageManager": "Potrai installare pacchetti di icone dopo dal gestore di pacchetti", + "InitialSetupAlmostDone": "Abbiamo quasi finito!", + "KnownDevices": "Dispositivi conosciuti", + "AskOnNewConnections": "Chiedi ad ogni nuova connessione", + "AllowAllNewConnections": "Permetti tutte le nuove connessioni (non consigliato)", + "BlockAllNewConnections": "Blocca tutte le nuove connessioni", + "InstallDLL": "Installa .dll (non consigliato)", + "NeverInstallDLLFiles": "Non installare mai file .dll da fonti di cui non ti fidi! I file .dll da fonti sconosciute possono danneggiare il tuo sistema. Installali solo quando sai cosa fare! Vuoi davvero installare un plugin .dll?", + "XWillBeUninstalled": "{0} verrà disinstallato.", + "XSuccessfullyUninstalled": "{0} è stato disinstallato. Macro Deck necessita il riavvio perché le modifiche abbiano effetto. Vuoi riavviare Macro Deck ora?", + "CreateVariable": "Crea variabile", + "DeleteVariable": "Cancella variabile", + "SelectAPluginAndActionToBegin": "Seleziona un plugin e un'azione per cominciare", + "ActionNeedsNoConfiguration": "Questa azione non necessita configurazione", + "CantCreateFolder": "Impossibile creare cartella", + "FolderCalledXAlreadyExists": "Una cartella col nome {0} esiste già", + "OnPress": "Quando premi", + "OnEvent": "Quando scatta un evento", + "CantCreateIconPack": "Impossibile creare pacchetto di icone", + "IconPackCalledXAlreadyExists": "Un pacchetto di icone col nome {0} esiste già", + "CantCreateProfile": "Impossibile creare profilo", + "ProfileCalledXAlreadyExists": "Un profilo col nome {0} esiste già", + "TheresAnUpdateForYou": "C'è un aggionrnamento per te :)", + "VersionXIsNowAvailable": "Versione {0} ({1}) è ora disponibile", + "ReadyToDownloadUpdate": "Pronto per scaricare l'aggiornamento", + "DownloadingUpdate": "Scarico l'aggiornamento... {0}% ({1}MB/{2}MB)", + "VerifyingUpdateFile": "Verifica file di aggiornamento...", + "MD5NotValid": "Il checksum MD5 non è valido", + "StartingInstaller": "Avvio installer", + "FileNotFound": "File non trovato", + "TryAgainOrDownloadManually": "Prova ancora o scarica l'aggiornamento manualmente", + "Trending": "Trending", + "Layers": "Layers", + "AddImage": "Aggiungi immagine", + "IconImportQualityInfo": "Le icone di alta qualità possono portare a un aumento dell'uso della memoria e dei tempi di caricamento, specialmente quando si usano molte grandi gif animate.\n\nPer le gif si consiglia di usare il preset Basso o Più basso.", + "Original": "Originale", + "High350px": "Alta (350px)", + "Normal200px": "Normale (200px)", + "Low150px": "Bassa (150px)", + "Lowest100px": "Più bassa (100px)", + "ImportIconPack": "Importa pacchetto di icone", + "ExportIconPack": "Esporta pacchetto di icone", + "CreateIcon": "Crea icona", + "ImportIcon": "Importa icona", + "DeleteIcon": "Cancella icona", + "IconSelectorManagedInfo": "Questo pacchetto di icone è gestito dal gestore dei plugin", + "DownloadingXPackages": "Scaricando {0} pacchetti", + "PluginCouldNotBeLoaded": "Il plugin non è stato caricato. Forse non è compatibile con questa versione di Macro Deck.", + "CantChangeName": "Impossibile cambiare nome", + "DeviceCalledXAlreadyExists": "Un dispositivo col nome {0} esiste già", + "NewConnection": "Nuova connessione", + "XIsAnUnknownDevice": "{0} è un dispositivo non riconosciuto e vuole connettersi a Macro Deck. Permetti la connessione?", + "ShouldMacroDeckBlockConnectionsFromX": "Macro Deck dovrebbe bloccare automaticamente le future connessioni da {0}?", + "FailedToStartServer": "Impossibile avviare il server. Forse la porta configurata è già in uso o hai impostato la scheda di rete sbagliata. Conferma di aver selezionato la scheda di rete corretta nelle impostazioni o prova a cambiare la porta.", + "ErrorWhileLoadingPlugins": "Errore durante il caricamento dei plugin", + "PluginXCouldNotBeLoaded": "{0} versione {1} non può essere caricata. Forse non è compatibile con questa versione di Macro Deck. Le azioni che utilizzano questo plugin non funzioneranno fino a quando il plugin non verrà aggiornato.", + "InstallationSuccessfull": "Installazione riuscita", + "PluginXInstalledSuccessfully": "{0} è stato installato con successo", + "ErrorWhileInstallingPlugin": "Errore installando il plugin", + "PluginXCouldNotBeInstalled": "{0} non può essere installato. Forse non è compatibile con questa versione di Macro Deck.", + "Settings": "Impostazioni", + "Language": "Lingua", + "General": "Generale", + "Connection": "Connessione", + "Backup": "Backup", + "About": "Informazioni", + "NoUpdatesAvailable": "Nessun aggiornamento disponibile", + "LatestVersionInstalled": "La versione più recente è già installata", + "WarningDevVersions": "Le versioni Dev possono essere davvero instabili e possono causare crash o perdita di dati (pulsanti di azione configurati, cartelle e profili). Vuoi davvero passare al canale di aggiornamento Dev?", + "WarningBetaVersions": "Le versioni Beta a volte possono essere instabili e possono causare crash. Vuoi davvero passare al canale di aggiornamento Beta?", + "VariableXGetsDeleted": "La variabile {0} sarà cancellata", + "DeckTitle": "Deck", + "DeviceManagerTitle": "Gestione dispositivi", + "PackageManagerTitle": "Gestore di pacchetti", + "SettingsTitle": "Impostazioni", + "VariablesTitle": "Variabili globali", + "Edit": "Modifica", + "Delete": "Cancella", + "Run": "Esegui", + "Copy": "Copia", + "Paste": "Incolla", + "WebSocketAPIVersion": "Versione websocket API", + "PluginAPIVersion": "Versione plugin API", + "InstalledPlugins": "Plugins installati", + "OperatingSystem": "Sistema operativo", + "DevelopedByX": "Sviluppato da {0} in Germania", + "XTranslationByX": "Traduzione in {0} di {1}", + "PackageManagerTabAvailable": "Disponibili", + "PackageManagerTabInstalled": "Installati", + "Event": "Evento", + "AutomaticallySwitchToFolder": "Cambia cartella automaticamente", + "Restart": "Riavvia Macro Deck", + "Delay": "Attesa", + "If": "Se", + "Else": "Altrimenti", + "Online": "Online", + "By": "Di", + "StateBinding": "Collega stato a", + "ErrorWhileLoadingPackageManager": "Errore durante il caricamento del gestore di pacchetti. Forse la connessione Internet è assente o Macro Deck è bloccato dal firewall.", + "UpdatesAvailable": "Aggiornamenti disponibili", + "EnableIconCache": "Abilita cache icone (più veloce; utilizzo RAM maggiore)", + "WebClient": "Web Client", + "AndroidApp": "App Android", + "IOSApp": "App iOS", + "PluginMacroDeckFolder": "Cartella Macro Deck", + "ActionChangeFolder": "Cambia cartella", + "ActionChangeFolderDescription": "Passa alla cartella configurata sul dispositivo attuale", + "ActionGoToParentFolder": "Passa alla cartella superiore", + "ActionGoToParentFolderDescription": "Passa alla cartella superiore sul dispositivo corrente", + "ActionGoToRootFolder": "Passa alla cartella principale", + "ActionGoToRootFolderDescription": "Passa alla cartella principale sul dispositivo corrente", + "PluginMacroDeckVariables": "Variabili Macro Deck", + "ActionChangeVariableValue": "Cambia il valore della variabile", + "ActionChangeVariableValueDescription": "Incrementa, diminuisci, imposta un valore variabile e altera il valore della variabile", + "CountUp": "Incrementa", + "CountDown": "Diminuisci", + "Set": "Imposta", + "Toggle": "Commutazione", + "Variable": "Variabile", + "PluginActionButton": "Questo pulsante d'azione", + "ActionToggleActionButtonState": "Stato del pulsante di azione", + "ActionToggleActionButtonStateDescription": "Cambia lo stato di questo pulsante", + "ActionSetActionButtonStateOff": "Imposta lo stato del pulsante come inattivo", + "ActionSetActionButtonStateOffDescription": "Imposta lo stato di questo pulsante come \"inattivo\"", + "ActionSetActionButtonStateOn": "Imposta lo stato del pulsante come attivo", + "ActionSetActionButtonStateOnDescription": "Imposta lo stato di questo pulsante come \"attivo\"", + "Description": "Descrizione", + "License": "Licensa", + "AnimatedGifImported": "GIF animata importata", + "GenerateStaticIcon": "Vuoi creare un'icona statica della GIF?", + "XSuccessfullyExportedToX": "{0} è stato esportato con successo in {1}", + "SelectedIconWillBeDeleted": "L'icona selezionata verrà cancellata dal pacchetto d'icone {0}", + "SuccessfullyImportedIconPack": "Pacchetto d'icone {0} importato con successo", + "SelectedIconPackWillBeDeleted": "Il pacchetto d'icone {0} e tutte le sue icone verranno cancellati.", + "GenerateStatic": "Genera statico", + "OnlyUserCreatedVariablesVisible": "Solo le variabili create dall'utente sono visibili", + "MacroDeckUsesCottleTemplateEngine": "Macro Deck usa il motore di template Cottle. Clicca qui per maggiori informazioni.", + "Result": "Risultato", + "InstallDevVersions": "Installa versioni Dev", + "InstallBetaVersions": "Installa versioni Beta", + "WhatDoYouWantToRestore": "Cosa vuoi recuperarre dal backup?", + "Configuration": "Configurazione", + "Profiles": "Profili", + "Variables": "Variabili", + "PluginConfigurations": "Configurazioni dei plugin", + "PluginCredentials": "Credenziali dei plugin", + "InstalledIconPacks": "Pacchetti d'icone installati", + "Restore": "Recupera", + "ActionCannotBeReversed": "Questa azione non potrà essere annullata", + "ThisWillDeleteBackupPermanently": "Il backup verrà cancellato permanentemente", + "Created": "Creato", + "PleaseWait": "Attendi...", + "Backups": "Backups", + "CreateBackup": "Crea backup", + "BackupFailed": "Backup fallito", + "BackupSuccessfullyCreated": "Backup creato con successo", + "CreateBackupBeforeUpdate": "Vuoi creare un backup prima di aggiornare?", + "CreatingBackup": "Creazione del backup...", + "PluginNeedsConfiguration": "Questo plugin deve essere configurato", + "ConfigureNow": "Vuoi configurare {0} adesso?", + "Hotkey": "Hotkey", + "PressTheKeysNow": "Adesso premi i tasti che vuoi assegnare", + "XAction": "{0} azione", + "XActions": "{0} azioni", + "OnRelease": "Al rilascio", + "OnLongPress": "Quando premi a lungo", + "OnLongPressRelease": "Al rilascio con premi a lungo", + "SimulateOnPress": "Simula \"Quando premi\"", + "SimulateOnRelease": "Simula \"Al rilascio\"", + "SimulateOnLongPress": "Simula \"Quando premi a lungo\"", + "SimulateOnLongPressRelease": "Simula \"Al rilascio con premi a lungo\"", + "HotkeyExecutesOnPress": "Il tasto di scelta rapida esegue le azioni \"Quando premi\" quando viene premuto", + "Important": "Importante", + "FirewallAlertInfo": "Dopo aver avviato Macro Deck, apparirà una finestra di dialogo di Windows Defender Firewall.\nSeleziona tutte le caselle (reti private, reti pubbliche e, se esiste, reti di dominio).\n\nSe questa finestra di dialogo non appare e hai ancora problemi di connessione, per favore visita la wiki o il server discord per aiuto.", + "GotIt": "Tutto chiaro!", + "DeviceSettings": "Impostazioni del dispositivo", + "Brightness": "Luminosità", + "AutoConnect": "Connetti automaticamente", + "DiscordSupport": "Supporto Discord", + "Wiki": "Wiki", + "ExportLatestLog": "Esporta l'ultimo log", + "LogSuccessfullyExportedToX": "Log esportato con successo in {0}", + "Help": "Aiuto", + "XWarningsXErrors": "{0} avviso/i, {1} errore/i", + "TrimBlankLines": "Rimuovi righe vuote", + "Extensions": "Estensioni", + "InstallFromFile": "Installa da file", + "AllExtensionsUpToDate": "Tutte le estensioni sono aggiornate", + "UpdateAll": "Aggiorna tutto", + "UpdateAvailable": "Aggiornamenti disponibili", + "PendingRestart": "In attesa di riavvio", + "Enabled": "Abilitato", + "Disabled": "Disabilitato", + "ActionSaveVariableToFile": "Salva variabile in un file", + "ActionSaveVariableToFileDescription": "Salva il valore di una variabile in un file", + "Folders": "Cartelle", + "Grid": "Griglia", + "ActionReadVariableFromFile": "Leggi la variabile dal file", + "ActionReadVariableFromFileDescription": "Legge un file e imposta il contenuto come valore per una variabile", + "ActionSetProfile": "Set profile", + "ActionSetProfileDescription": "Sets the profile on a device", + "Device": "Device", + "WhereExecuted": "Where executed", + "ActionSetBrightness": "Set brightness", + "ActionSetBrightnessDescription": "Sets the display brightness (Only on the Android app!)", + "BindableVariable": "Bindable variable", + "BindableVariableInfo": "The state of this button can be bound to the variable {0}. Do you want to bind the state?", + "Cancelled": "Cancelled", + "Preparing": "Preparing...", + "Installing": "Installing...", + "Completed": "Completed", + "ExtensionStoreDownloaderPackageIdVersion": "{0} version {1}", + "DownloadingAndInstallingXPackages": "Downloading and installing {0} package(s)", + "InstallationOfXPackagesDone": "Installation of {0} package(s) done", + "ActionSetBackgroundColor": "Set background color", + "ActionSetBackgroundColorDescription": "Changes the background color of a action button", + "Fixed": "Fixed", + "Random": "Random" +======= "__Language__": "Italian", "__LanguageCode__": "it", "__Author__": "PhoenixWyllow aka PW.Dev", @@ -301,4 +624,5 @@ "Grid": "Griglia", "ActionReadVariableFromFile": "Leggi la variabile dal file", "ActionReadVariableFromFileDescription": "Legge un file e imposta il contenuto come valore per una variabile" +>>>>>>> origin/main } \ No newline at end of file diff --git a/Resources/Languages/Japanese.json b/Resources/Languages/Japanese.json index 33824617..0702b057 100644 --- a/Resources/Languages/Japanese.json +++ b/Resources/Languages/Japanese.json @@ -1,4 +1,327 @@ { +<<<<<<< HEAD + "__Language__": "Japanese", + "__LanguageCode__": "jp", + "__Author__": "__Author__", + "NetworkAdapter": "Network adapter", + "IPAddress": "IPアドレス", + "Port": "ポート", + "Info": "情報", + "Error": "エラー", + "Warning": "警告", + "ConfigureNetworkInfo": "正しいネットワークアダプターを選択することは本当に重要で、そうしないと、クライアントからサーバーに接続することができなくなります。多くの場合、ネットワークアダプタの名前は「Ethernet」または「Wi-Fi」のようで、IPアドレスは「192.168.178.xxx」のようなものが多いようです。\n\nMacro Deckのデフォルトのポートは8191です。他のアプリケーションがこのポートを使用している場合は、変更することができます。", + "AutomaticallyCheckUpdates": "アップデートを自動的に確認する", + "AutomaticallyStartWithWindows": "Windows起動時に自動的に実行する", + "Show": "Macro Deckを設定する", + "Exit": "Macro Deckを終了する", + "XUpdatesAvailable": "{0}件のアップデートが使用可能です", + "Profile": "プロフィール", + "Columns": "列", + "Rows": "行", + "Spacing": "間隔", + "CornerRadius": "丸み", + "ButtonBackGround": "ボタン背景", + "AreYouSure": "よろしいですか?", + "Behaviour": "挙動", + "Plugins": "プラグイン", + "IconPacks": "アイコンパック", + "All": "All", + "Updates": "アップデート", + "Installed": "インストール済み", + "Install": "インストール", + "Search": "検索...", + "Name": "名前", + "Type": "種類", + "Value": "Value", + "Creator": "製作者", + "Ok": "OK", + "FolderName": "フォルダ名", + "Never": "Never", + "OnApplicationFocus": "On application focus", + "Application": "アプリケーション", + "Devices": "デバイス", + "Create": "Create", + "Save": "保存", + "Appearance": "外観", + "ButtonState": "ボタンの状態", + "Label": "ラベル", + "Top": "上", + "Center": "中", + "Bottom": "下", + "Path": "パス", + "CurrentState": "現在の状態", + "Off": "オフ", + "On": "オン", + "DownloadAndInstall": "ダウンロードとインストール", + "Downloading": "ダウンロード中...", + "Color": "色", + "IconPack": "アイコンパック", + "Size": "サイズ", + "CurrentProgress": "現在の進行状況", + "TotalProgress": "全体の進行状況", + "XDownloads": "ダウンロード {0}", + "Update": "アップデート", + "Plugin": "プラグイン", + "MacroDeckNeedsARestart": "Macro Deckは再起動が必要です", + "MacroDeckMustBeRestartedForTheChanges": "変更を反映させるには、Macro Deckを再起動する必要があります。今すぐMacro Deckを再起動しますか?", + "Configure": "コンフィグ", + "Uninstall": "アンインストール", + "NotLoaded": "読み込まれていません", + "Yes": "はい", + "No": "いいえ", + "Status": "ステータス", + "BlockConnection": "接続をブロックする", + "Change": "変更", + "Id": "ID", + "Connected": "接続済み", + "Disconnected": "切断済み", + "Trigger": "トリガー", + "Action": "アクション", + "Condition": "状態", + "InstalledVersion": "インストールされているバージョン", + "UpdateChannel": "アップデートチャンネル", + "CheckForUpdatesNow": "今すぐアップデートを確認する", + "Author": "著者", + "Version": "バージョン", + "TheFolderWillBeDeleted": "フォルダ {0} とそのアクションボタンがすべて削除されます。", + "TheProfileWillBeDeleted": "プロファイル {0} とそのフォルダ、アクションボタンがすべて削除されます。", + "ServerOffline": "サーバー停止中", + "ServerRunning": "サーバー作動中", + "XPluginsLoaded": "読込済プラグイン {0}", + "XPluginsDisabled": "使用不可プラグイン{0}", + "XClientsConnected": "接続クライアント{0}", + "IpAddressHostNamePort": "IP アドレス/host : ポート", + "InitialSetupButtonBack": "<- 戻る", + "InitialSetupButtonNext": "進む ->", + "InitialSetupButtonFinish": "終了", + "InitialSetupSelectLanguage": "言語の選択", + "InitialSetupPage": "ページ {0}/{1}", + "InitialSetupWelcome": "Macro Deck 2へようこそ!", + "InitialSetupLetsConfigure": "さあ、Macro Deckを設定しましょう", + "InitialSetupConfigureNetworkSettings": "ネットワーク設定の変更", + "InitialSetupConfigureGridPreferences": "では、グリッドを好みに合わせて設定してみましょう", + "InitialSetupPickAllPluginsYouNeed": "必要なプラグインをすべて選択する", + "InitialSetupDontWorryInstallUninstallPlugins": "プラグインは後からパッケージマネージャでインストール/アンインストールできますのでご安心ください", + "InitialSetupWantSomeIcons": "アイコンが欲しいですか?", + "InitialSetupInstallIconPacksPackageManager": "アイコンパックは、後からパッケージマネージャーでインストールすることも可能です", + "InitialSetupAlmostDone": "あと少しで完成です!", + "KnownDevices": "既知のデバイス", + "AskOnNewConnections": "新規接続時に質問する", + "AllowAllNewConnections": "すべての新規接続を許可する(非推奨)", + "BlockAllNewConnections": "新規接続はすべてブロック", + "InstallDLL": ".dll をインストール(非推奨)", + "NeverInstallDLLFiles": "信用できない提供元からの.dllファイルは絶対にインストールしないでください! 不明なソースからの.dllファイルは、あなたのシステムに害を及ぼす可能性があります あなたが何をすべきか知っているときだけそれをインストールしてください! 本当に.dllプラグインをインストールしますか?", + "XWillBeUninstalled": "{0}がアンインストールされます。", + "XSuccessfullyUninstalled": "{0}がアンインストールされます。変更を反映させるには、Macro Deckを再起動する必要があります。今すぐMacro Deckを再起動しますか?", + "CreateVariable": "変数の作成", + "DeleteVariable": "変数の削除", + "SelectAPluginAndActionToBegin": "プラグインとアクションを選択して開始します", + "ActionNeedsNoConfiguration": "このアクションは設定が不要です", + "CantCreateFolder": "フォルダを作成できません", + "FolderCalledXAlreadyExists": "{0} という名前のフォルダがすでに存在します", + "OnPress": "On press", + "OnEvent": "On event", + "CantCreateIconPack": "アイコンパックを作成できません", + "IconPackCalledXAlreadyExists": "{0} という名前のアイコンパックが既に存在します", + "CantCreateProfile": "プロファイルを作成できません", + "ProfileCalledXAlreadyExists": "{0} という名前のプロファイルが既に存在します", + "TheresAnUpdateForYou": "アップデートがあります :)😁", + "VersionXIsNowAvailable": "Version {0} ({1}) が使用可能です", + "ReadyToDownloadUpdate": "アップデートのダウンロード準備完了", + "DownloadingUpdate": "アップデートのダウンロード中... {0}% ({1}MB/{2}MB)", + "VerifyingUpdateFile": "アップデートファイルの検証中...", + "MD5NotValid": "MD5チェックサムが有効ではありません", + "StartingInstaller": "インストーラの起動中", + "FileNotFound": "ファイルが見つかりません", + "TryAgainOrDownloadManually": "もう一度試すか、手動でアップデートをダウンロードする", + "Trending": "トレンド", + "Layers": "レイヤー", + "AddImage": "画像を追加する", + "IconImportQualityInfo": "高画質のアイコンは、特に大きなアニメーションGIFを多く使用する場合、メモリ使用量や読み込み時間の増加につながることがあります。\n\n\nGIFの場合は、Lowまたは最も低いプリセットを使用することをお勧めします。", + "Original": "オリジナル", + "High350px": "High (350px)", + "Normal200px": "Normal (200px)", + "Low150px": "Low (150px)", + "Lowest100px": "Lowest (100px)", + "ImportIconPack": "アイコンパックのインポート", + "ExportIconPack": "アイコンパックのエクスポート", + "CreateIcon": "アイコンの作成", + "ImportIcon": "アイコンのインポート", + "DeleteIcon": "アイコンの削除", + "IconSelectorManagedInfo": "このアイコンパックは、プラグインマネージャーで管理されています", + "DownloadingXPackages": "{0} 個のパッケージをダウンロード中です", + "PluginCouldNotBeLoaded": "プラグインを読み込むことができませんでした。インストールされているプラグインのバージョンが、このバージョンのMacro Deckと互換性がない可能性があります。", + "CantChangeName": "名前の変更ができません", + "DeviceCalledXAlreadyExists": "{0} というデバイスがすでに存在します", + "NewConnection": "新規接続", + "XIsAnUnknownDevice": "{0} は未知のデバイスで、Macro Deckへの接続を要求しています。接続を許可しますか?", + "ShouldMacroDeckBlockConnectionsFromX": "Macro Deckは {0} からの今後の接続を自動的にブロックしますか?", + "FailedToStartServer": "サーバーの起動に失敗しました。設定したポートがすでに使用されているか、ネットワークアダプタの設定が間違っている可能性があります。設定で正しいネットワークアダプターを設定したことを確認し、ポートを変更してみてください。", + "ErrorWhileLoadingPlugins": "プラグイン読み込み時のエラー", + "PluginXCouldNotBeLoaded": "{0} バージョン {1} をロードできませんでした。おそらく、このバージョンの Macro Deck と互換性がありません。このプラグインを使用したアクションは、プラグインがアップデートされるまで動作しません。", + "InstallationSuccessfull": "インストールに成功しました", + "PluginXInstalledSuccessfully": "{0} が正常にインストールされました", + "ErrorWhileInstallingPlugin": "プラグインのインストール時にエラーが発生しました", + "PluginXCouldNotBeInstalled": "{0}はインストールできませんでした。おそらく、このバージョンのMacro Deckと互換性がありません", + "Settings": "設定", + "Language": "言語", + "General": "General", + "Connection": "接続", + "Backup": "バックアップ", + "About": "About", + "NoUpdatesAvailable": "アップデートはありません", + "LatestVersionInstalled": "最新版はすでにインストールされています", + "WarningDevVersions": "開発中バージョンは本当に不安定で、クラッシュやデータ損失(設定されたアクションボタン、フォルダ、プロファイル)を引き起こす可能性があります。本当に開発中アップデートチャンネルを有効にしたいのですか?", + "WarningBetaVersions": "ベータ版は時に不安定で、クラッシュの原因となることがあります。本当にベータ版アップデートチャンネルを有効にするのですか?", + "VariableXGetsDeleted": "変数 {0} が削除されました", + "DeckTitle": "Deck", + "DeviceManagerTitle": "デバイスマネージャ", + "PackageManagerTitle": "パッケージマネージャ", + "SettingsTitle": "設定", + "VariablesTitle": "グローバル変数", + "Edit": "エディット", + "Delete": "削除", + "Run": "実行", + "Copy": "コピー", + "Paste": "貼り付け", + "WebSocketAPIVersion": "Websocket API version", + "PluginAPIVersion": "Plugin API version", + "InstalledPlugins": "インストール済プラグイン", + "OperatingSystem": "オペレーティングシステム", + "DevelopedByX": "Developed by {0} in Germany", + "XTranslationByX": "{0} translation by {1}", + "PackageManagerTabAvailable": "Available", + "PackageManagerTabInstalled": "Installed", + "Event": "Event", + "AutomaticallySwitchToFolder": "フォルダに自動で切り替わる", + "Restart": "Macro Deckの再起動", + "Delay": "Delay", + "If": "If", + "Else": "Else", + "Online": "Online", + "By": "By", + "StateBinding": "Bind state to", + "ErrorWhileLoadingPackageManager": "パッケージマネージャの読み込み中にエラーが発生しました。インターネットに接続されていないか、Macro Deckがファイアウォールでブロックされている可能性があります。", + "UpdatesAvailable": "アップデートが利用可能です", + "EnableIconCache": "アイコンキャッシュを有効にする(高速化、メモリ使用量増加)", + "WebClient": "Webクライアント", + "AndroidApp": "Androidクライアント", + "IOSApp": "iOSクライアント", + "PluginMacroDeckFolder": "Macro Deck フォルダ", + "ActionChangeFolder": "フォルダの変更", + "ActionChangeFolderDescription": "カレントデバイスのカレントフォルダを設定されたフォルダに変更する", + "ActionGoToParentFolder": "親フォルダへ移動", + "ActionGoToParentFolderDescription": "カレントデバイスのカレントフォルダをフォルダの親フォルダに変更する", + "ActionGoToRootFolder": "ルートフォルダへ移動", + "ActionGoToRootFolderDescription": "カレントデバイスのカレントフォルダをルートフォルダに変更する", + "PluginMacroDeckVariables": "Macro Deck 変数", + "ActionChangeVariableValue": "変数の値の変更", + "ActionChangeVariableValueDescription": "カウントアップ、カウントダウン、変数値設定、変数値トグル", + "CountUp": "カウントアップ", + "CountDown": "カウントダウン", + "Set": "セット", + "Toggle": "トグル", + "Variable": "変数", + "PluginActionButton": "このアクションボタン", + "ActionToggleActionButtonState": "Toggle button state", + "ActionToggleActionButtonStateDescription": "Toggles the state of this button", + "ActionSetActionButtonStateOff": "ボタンの状態をオフに設定する", + "ActionSetActionButtonStateOffDescription": "ボタンの状態を \"オフ \"にします", + "ActionSetActionButtonStateOn": "ボタンの状態をオンに設定する", + "ActionSetActionButtonStateOnDescription": "ボタンの状態を \"オン\"にします", + "Description": "説明", + "License": "ライセンス", + "AnimatedGifImported": "アニメーションGIFが取り込まれました", + "GenerateStaticIcon": "Also generate a static icon of the GIFs first frame?", + "XSuccessfullyExportedToX": "{0} は {1} に正常にエクスポートされました", + "SelectedIconWillBeDeleted": "選択したアイコンはアイコンパック {0} から削除されます", + "SuccessfullyImportedIconPack": "アイコンパック{0}のインポートに成功しました", + "SelectedIconPackWillBeDeleted": "選択されたアイコンパック{0}とそのすべてのアイコンが削除されます", + "GenerateStatic": "Generate static", + "OnlyUserCreatedVariablesVisible": "ユーザー変数のみ表示", + "MacroDeckUsesCottleTemplateEngine": "Macro Deckは、Cottle社のテンプレートエンジンを使用しています。詳しくはこちらをご覧ください。", + "Result": "結果", + "InstallDevVersions": "Dev版のインストール", + "InstallBetaVersions": "ベータ版のインストール", + "WhatDoYouWantToRestore": "バックアップから何を復元しますか?", + "Configuration": "設定", + "Profiles": "プロファイル", + "Variables": "変数", + "PluginConfigurations": "プラグイン設定", + "PluginCredentials": "プラグインの認証情報", + "InstalledIconPacks": "インストール済アイコンパック", + "Restore": "復元", + "ActionCannotBeReversed": "このアクションは元に戻すことはできません", + "ThisWillDeleteBackupPermanently": "バックアップが完全に削除されます", + "Created": "Created", + "PleaseWait": "お待ちください...", + "Backups": "バックアップ", + "CreateBackup": "バックアップの作成", + "BackupFailed": "バックアップが失敗しました", + "BackupSuccessfullyCreated": "バックアップの作成に成功しました", + "CreateBackupBeforeUpdate": "アップデート前にバックアップを作成しますか?", + "CreatingBackup": "バックアップの作成中...", + "PluginNeedsConfiguration": "このプラグインを設定する必要があります", + "ConfigureNow": "今すぐ{0}を設定しますか?", + "Hotkey": "ホットキー", + "PressTheKeysNow": "割り当てたいキーを押してください", + "XAction": "{0} action", + "XActions": "{0} actions", + "OnRelease": "押下解除時", + "OnLongPress": "長押し時", + "OnLongPressRelease": "長押し解除時", + "SimulateOnPress": "\"押下\"のシミュレート", + "SimulateOnRelease": "\"押下解除\"のシミュレート", + "SimulateOnLongPress": "\"長押し\"のシミュレート", + "SimulateOnLongPressRelease": "\"長押し解除\"のシミュレート", + "HotkeyExecutesOnPress": "ホットキーは、押されたときに「押下」のアクションを実行します", + "Important": "重要", + "FirewallAlertInfo": "Macro Deckを起動すると、Windows Defender Firewallからのダイアログが表示されます。\nすべてのボックス(プライベートネットワーク、パブリックネットワーク、存在する場合はドメインネットワーク)にチェックを入れてください。\n\nこのダイアログが表示されず、なおかつ接続に問題がある場合は、wikiやdiscordサーバーにアクセスしてヘルプを参照してください。 ", + "GotIt": "了解!", + "DeviceSettings": "デバイスの設定", + "Brightness": "輝度", + "AutoConnect": "自動的に接続", + "DiscordSupport": "Discordサポート", + "Wiki": "Wiki", + "ExportLatestLog": "最新ログのエクスポート", + "LogSuccessfullyExportedToX": "ログが {0} に正常にエクスポートされました", + "Help": "ヘルプ", + "XWarningsXErrors": "{0} 警告()、 {1}エラー()", + "TrimBlankLines": "空白行のトリミング", + "Extensions": "拡張機能", + "InstallFromFile": "ファイルからインストール", + "AllExtensionsUpToDate": "すべての拡張機能は最新です", + "UpdateAll": "すべてアップデート", + "UpdateAvailable": "アップデート可能", + "PendingRestart": "再起動の待機中", + "Enabled": "有効", + "Disabled": "無効", + "ActionSaveVariableToFile": "変数のファイルへの保存", + "ActionSaveVariableToFileDescription": "変数の値をファイルに保存", + "Folders": "フォルダー", + "Grid": "グリッド", + "ActionReadVariableFromFile": "ファイルから変数を読み取ります", + "ActionReadVariableFromFileDescription": "ファイルを読み取り、コンテンツを変数の値として設定します", + "ActionSetProfile": "Set profile", + "ActionSetProfileDescription": "Sets the profile on a device", + "Device": "Device", + "WhereExecuted": "Where executed", + "ActionSetBrightness": "Set brightness", + "ActionSetBrightnessDescription": "Sets the display brightness (Only on the Android app!)", + "BindableVariable": "Bindable variable", + "BindableVariableInfo": "The state of this button can be bound to the variable {0}. Do you want to bind the state?", + "Cancelled": "Cancelled", + "Preparing": "Preparing...", + "Installing": "Installing...", + "Completed": "Completed", + "ExtensionStoreDownloaderPackageIdVersion": "{0} version {1}", + "DownloadingAndInstallingXPackages": "Downloading and installing {0} package(s)", + "InstallationOfXPackagesDone": "Installation of {0} package(s) done", + "ActionSetBackgroundColor": "Set background color", + "ActionSetBackgroundColorDescription": "Changes the background color of a action button", + "Fixed": "Fixed", + "Random": "Random" +======= "__Language__": "Japanese", "__LanguageCode__": "jp", "__Author__": "__Author__", @@ -301,4 +624,5 @@ "Grid": "グリッド", "ActionReadVariableFromFile": "ファイルから変数を読み取ります", "ActionReadVariableFromFileDescription": "ファイルを読み取り、コンテンツを変数の値として設定します" +>>>>>>> origin/main } \ No newline at end of file diff --git a/Resources/Languages/Korean.json b/Resources/Languages/Korean.json index 077b8297..b77f2a7f 100644 --- a/Resources/Languages/Korean.json +++ b/Resources/Languages/Korean.json @@ -1,4 +1,327 @@ { +<<<<<<< HEAD + "__Language__": "Korean", + "__LanguageCode__": "ko", + "__Author__": "LeinneSW", + "NetworkAdapter": "네트워크 어댑터", + "IPAddress": "IP 주소", + "Port": "포트", + "Info": "정보", + "Error": "오류", + "Warning": "경고", + "ConfigureNetworkInfo": "올바른 네트워크 어댑터를 선택해야합니다. 올바르지 않은 네트워크 어댑터를 선택하면 클라이언트는 Macro Deck과 연결할 수 없게됩니다. 대부분의 경우 네트워크 어댑터의 이름은 \"이더넷\", \"WI-FI\"등 이며 IP주소는 대체로 \"192.168.178.xxx\" 등과 같습니다.\n\nMacro Deck의 기본 포트는 8191 입니다.만약 다른 프로그램에서 해당 포트를 이미 사용중이라면 변경할 수도 있습니다.", + "AutomaticallyCheckUpdates": "자동으로 업데이트 확인", + "AutomaticallyStartWithWindows": "Windows 시작시 자동 실행", + "Show": "Macro Deck 설정", + "Exit": "Macro Deck 종료", + "XUpdatesAvailable": "{0}개 업데이트 가능", + "Profile": "프로필", + "Columns": "열", + "Rows": "행", + "Spacing": "간격", + "CornerRadius": "테두리 반지름", + "ButtonBackGround": "버튼 배경", + "AreYouSure": "정말로 하시겠습니까?", + "Behaviour": "행동", + "Plugins": "플러그인", + "IconPacks": "아이콘 팩", + "All": "전체", + "Updates": "업데이트", + "Installed": "설치됨", + "Install": "설치", + "Search": "검색...", + "Name": "이름", + "Type": "형식", + "Value": "값", + "Creator": "생성자", + "Ok": "확인", + "FolderName": "폴더명", + "Never": "하지 않음", + "OnApplicationFocus": "해당 프로그램이 사용중일때 변경", + "Application": "프로그램", + "Devices": "장치 목록", + "Create": "생성", + "Save": "저장", + "Appearance": "외형", + "ButtonState": "버튼 상태", + "Label": "텍스트", + "Top": "상단", + "Center": "중앙", + "Bottom": "하단", + "Path": "경로", + "CurrentState": "현재 상태", + "Off": "꺼짐", + "On": "켜짐", + "DownloadAndInstall": "다운로드 및 설치", + "Downloading": "다운로드 중...", + "Color": "Color", + "IconPack": "아이콘 팩", + "Size": "크기", + "CurrentProgress": "현재 진행률", + "TotalProgress": "총 진행률", + "XDownloads": "{0}개 다운로드중", + "Update": "업데이트", + "Plugin": "플러그인", + "MacroDeckNeedsARestart": "Macro Deck의 재시작이 필요합니다", + "MacroDeckMustBeRestartedForTheChanges": "변경 사항을 적용하려면 Macro Deck을 다시 시작해야 합니다. 지금 Macro Deck을 다시 시작하시겠습니까?", + "Configure": "환경설정", + "Uninstall": "제거", + "NotLoaded": "로드 안됨", + "Yes": "예", + "No": "아니오", + "Status": "상태", + "BlockConnection": "연결 차단", + "Change": "Change", + "Id": "ID", + "Connected": "연결됨", + "Disconnected": "연결 끊김", + "Trigger": "트리거", + "Action": "동작", + "Condition": "조건", + "InstalledVersion": "설치된 버전", + "UpdateChannel": "채널 업데이트", + "CheckForUpdatesNow": "지금 업데이트 확인", + "Author": "제작", + "Version": "버전", + "TheFolderWillBeDeleted": "{0} 폴더 및 안의 모든 버튼들이 제거됩니다.", + "TheProfileWillBeDeleted": "{0} 프로필에 있는 모든 폴더와 버튼들이 제거됩니다.", + "ServerOffline": "서버 오프라인", + "ServerRunning": "서버 작동중", + "XPluginsLoaded": "{0}개 플러그인 불러옴", + "XPluginsDisabled": "{0}개 플러그인 비활성화됨", + "XClientsConnected": "{0}개 클라이언트 접속중", + "IpAddressHostNamePort": "IP주소/호스트이름 : 포트", + "InitialSetupButtonBack": "<- 이전", + "InitialSetupButtonNext": "다음 ->", + "InitialSetupButtonFinish": "완료", + "InitialSetupSelectLanguage": "언어를 선택하세요", + "InitialSetupPage": "페이지 {0}/{1}", + "InitialSetupWelcome": "Macro Deck 2를 사용해주셔서 감사합니다!", + "InitialSetupLetsConfigure": "Macro Deck 설정을 시작합니다", + "InitialSetupConfigureNetworkSettings": "인터넷 설정", + "InitialSetupConfigureGridPreferences": "이제 원하는 그리드를 구성해보시길 바랍니다", + "InitialSetupPickAllPluginsYouNeed": "필요한 플러그인 선택", + "InitialSetupDontWorryInstallUninstallPlugins": "걱정하지 마세요. 언제든지 패키지 관리자에서 설치 및 삭제할 수 있습니다", + "InitialSetupWantSomeIcons": "원하는 아이콘 선택", + "InitialSetupInstallIconPacksPackageManager": "언제든지 패키지 관리자에서 아이콘 팩을 설치할 수 있습니다", + "InitialSetupAlmostDone": "거의 다 끝났습니다!", + "KnownDevices": "연결된 장치 목록", + "AskOnNewConnections": "새로운 연결을 물어보기", + "AllowAllNewConnections": "모든 새로운 연결을 허용하기 (추천하지 않음)", + "BlockAllNewConnections": "모든 새로운 연결을 차단하기", + "InstallDLL": ".dll 설치 (추천하지 않음)", + "NeverInstallDLLFiles": "신뢰할 수 없는 출처에서 .dll 파일을 설치하지 마시기 바랍니다. 출처를 알 수 없는 .dll 파일은 시스템에 해를 끼칠 수 있습니다. 정말로 dll 플러그인을 설치하시겠습니까?", + "XWillBeUninstalled": "{0}이(가) 제거됩니다.", + "XSuccessfullyUninstalled": "{0}이(가) 제거됩니다. 변경 사항을 적용하려면 Macro Deck을 다시 시작해야 합니다. 지금 Macro Deck을 다시 시작하시겠습니까?", + "CreateVariable": "변수 생성", + "DeleteVariable": "변수 삭제", + "SelectAPluginAndActionToBegin": "플러그인 선택 및 시작할 동작 선택", + "ActionNeedsNoConfiguration": "이 동작은 설정이 필요없습니다", + "CantCreateFolder": "폴더 생성 실패", + "FolderCalledXAlreadyExists": "{0}은(는) 이미 존재하는 폴더입니다", + "OnPress": "누를때", + "OnEvent": "이벤트 발생시", + "CantCreateIconPack": "아이콘 팩 생성 실패", + "IconPackCalledXAlreadyExists": "{0}은(는) 이미 존재하는 아이콘 팩입니다", + "CantCreateProfile": "프로필 생성 실패", + "ProfileCalledXAlreadyExists": "{0}은(는) 이미 존재하는 프로필입니다", + "TheresAnUpdateForYou": "업데이트가 존재합니다 :)", + "VersionXIsNowAvailable": "버전 {0} ({1}) 이 준비되었습니다", + "ReadyToDownloadUpdate": "업데이트 다운로드 준비중", + "DownloadingUpdate": "업데이트 다운로드 중... {0}% ({1}MB/{2}MB)", + "VerifyingUpdateFile": "업데이트 파일 확인 중...", + "MD5NotValid": "MD5 체크섬이 유효하지 않습니다", + "StartingInstaller": "설치 마법사 시작", + "FileNotFound": "파일이 존재하지 않습니다", + "TryAgainOrDownloadManually": "다시 시도하거나 업데이트를 수동으로 다운로드하십시오", + "Trending": "트렌드", + "Layers": "레이어", + "AddImage": "이미지 추가", + "IconImportQualityInfo": "고화질 애니메이션 GIF를 사용할 때 많은 메모리 사용과 로딩 시간을 증가시킬 수 있습니다.\n\n\nGIF를 사용할 땐 낮음 또는 최저 프리셋을 권장합니다.", + "Original": "원본", + "High350px": "높음 (350px)", + "Normal200px": "보통 (200px)", + "Low150px": "낮음 (150px)", + "Lowest100px": "최저 (100px)", + "ImportIconPack": "아이콘 팩 가져오기", + "ExportIconPack": "아이콘 팩 내보내기", + "CreateIcon": "아이콘 생성", + "ImportIcon": "아이콘 가져오기", + "DeleteIcon": "아이콘 삭제", + "IconSelectorManagedInfo": "이 아이콘 팩은 플러그인 관리자에 의해 관리돼요.", + "DownloadingXPackages": "{0}개의 패키지 다운로드 중", + "PluginCouldNotBeLoaded": "플러그인을 불러올 수 없습니다. 설치된 버전의 플러그인은 이 버전의 Macro Deck와 호환되지 않을 수 있습니다.", + "CantChangeName": "이름 변경 실패", + "DeviceCalledXAlreadyExists": "{0}은(는) 이미 존재하는 기기입니다", + "NewConnection": "새 연결", + "XIsAnUnknownDevice": "알 수 없는 장치({0})가 Macro Deck에 연결하려고 합니다. 연결을 허용하시겠습니까?", + "ShouldMacroDeckBlockConnectionsFromX": "장치 {0}의 접속을 영구적으로 제한하시겠습니까?", + "FailedToStartServer": "서버를 시작하지 못했습니다. 포트가 이미 사용 중이거나 잘못된 네트워크 어댑터터 설정이 문제일 수 있습니다. 설정에서 올바른 네트워크 어댑터를 설정했는지 확인하고 포트를 변경해보세요.", + "ErrorWhileLoadingPlugins": "플러그인을 불러오는중 오류 발생", + "PluginXCouldNotBeLoaded": "{0} 버전 {1}을(를) 로드할 수 없습니다. 이 버전의 Macro Deck와 호환되지 않을 수 있습니다. 이 플러그인을 사용하는 작업은 플러그인이 업데이트될 때까지 작동하지 않습니다.", + "InstallationSuccessfull": "설치 성공", + "PluginXInstalledSuccessfully": "{0}이(가) 성공적으로 설치되었습니다", + "ErrorWhileInstallingPlugin": "플러그인 설치중 오류 발생", + "PluginXCouldNotBeInstalled": "{0}을(를) 설치할 수 없습니다. 이 버전의 Macro Deck과 호환되지 않는 것 같습니다", + "Settings": "설정", + "Language": "언어", + "General": "일반", + "Connection": "연결", + "Backup": "백업", + "About": "프로그램 정보", + "NoUpdatesAvailable": "사용 가능한 업데이트가 없어요.", + "LatestVersionInstalled": "최신 버전이 이미 설치되어 있어요.", + "WarningDevVersions": "개발 버전은 매우 불안정할 수 있으며 충돌이나 데이터 손실(설정된 버튼, 폴더 및 프로필)을 일으킬 수 있습니다. 정말로 개발 버전을 사용하시겠습니까?", + "WarningBetaVersions": "베타 버전은 불안정할 수 있으며 충돌을 일으킬 수 있습니다. 정말로 베타 채널을 사용하시겠습니까?", + "VariableXGetsDeleted": "변수 {0}이(가) 삭제됩니다", + "DeckTitle": "Deck", + "DeviceManagerTitle": "장치 관리자", + "PackageManagerTitle": "패키지 관리자", + "SettingsTitle": "설정", + "VariablesTitle": "글로벌 변수", + "Edit": "수정", + "Delete": "삭제", + "Run": "실행", + "Copy": "복사", + "Paste": "붙여넣기", + "WebSocketAPIVersion": "웹소켓 API 버전", + "PluginAPIVersion": "플러그인 API 버전", + "InstalledPlugins": "설치된 플러그인", + "OperatingSystem": "OS 정보", + "DevelopedByX": "개발자: 독일인 {0}", + "XTranslationByX": "{0} 번역자: {1}", + "PackageManagerTabAvailable": "가능", + "PackageManagerTabInstalled": "설치됨", + "Event": "이벤트", + "AutomaticallySwitchToFolder": "자동으로 폴더 전환", + "Restart": "Macro Deck 재시작", + "Delay": "Delay", + "If": "If", + "Else": "Else", + "Online": "온라인", + "By": "By", + "StateBinding": "다음의 값을 할당", + "ErrorWhileLoadingPackageManager": "패키지 관리자를 로드하는 동안 오류가 발생했습니다. 인터넷에 연결되어 있지 않거나 Macro Deck이 방화벽에 의해 차단되었을 수 있습니다.", + "UpdatesAvailable": "업데이트 가능", + "EnableIconCache": "아이콘 캐시 활성화(빠르지만 메모리를 더 사용합니다)", + "WebClient": "웹 클라이언트", + "AndroidApp": "안드로이드 클라이언트", + "IOSApp": "iOS 클라이언트", + "PluginMacroDeckFolder": "Macro Deck 폴더", + "ActionChangeFolder": "폴더 변경", + "ActionChangeFolderDescription": "현재 기기의 현재 폴더를 설정된 폴더로 변경", + "ActionGoToParentFolder": "상위 폴더로 이동", + "ActionGoToParentFolderDescription": "현재 장치의 현재 폴더를 상위 폴더로 변경", + "ActionGoToRootFolder": "최상위 폴더로 이동", + "ActionGoToRootFolderDescription": "현재 장치의 현재 폴더를 최상위 폴더로 변경", + "PluginMacroDeckVariables": "Macro Deck 변수들", + "ActionChangeVariableValue": "변수 값 변경", + "ActionChangeVariableValueDescription": "개수 증가, 개수 감소, 변수 값 설정 및 변수 값 전환", + "CountUp": "개수 증가", + "CountDown": "개수 감소", + "Set": "설정", + "Toggle": "토글", + "Variable": "변수", + "PluginActionButton": "이 버튼", + "ActionToggleActionButtonState": "버튼 상태 전환", + "ActionToggleActionButtonStateDescription": "이 버튼의 상태를 전환합니다", + "ActionSetActionButtonStateOff": "버튼 상태를 off로 설정", + "ActionSetActionButtonStateOffDescription": "이 버튼의 상태를 \"off\"로 설정합니다", + "ActionSetActionButtonStateOn": "버튼 상태를 on으로 설정", + "ActionSetActionButtonStateOnDescription": "이 버튼의 상태를 \"on\"으로 설정합니다", + "Description": "설명", + "License": "라이선스", + "AnimatedGifImported": "움직이는 gif 불러오기", + "GenerateStaticIcon": "GIF 첫 장면 아이콘을 생성하시겠습니까?", + "XSuccessfullyExportedToX": "{0}을(를) {1}(으)로 성공적으로 내보냈습니다", + "SelectedIconWillBeDeleted": "선택한 아이콘 {0}이(가) 아이콘 팩에서 제거됩니다", + "SuccessfullyImportedIconPack": "아이콘팩 {0}을(를) 성공적으로 불러왔습니다", + "SelectedIconPackWillBeDeleted": "선택된 아이콘 팩 {0}이(가) 모든 아이콘들과 함께 제거됩니다", + "GenerateStatic": "Generate static", + "OnlyUserCreatedVariablesVisible": "사용자가 만든 변수만 볼 수 있습니다", + "MacroDeckUsesCottleTemplateEngine": "Macro Deck은 Cottle 템플릿 엔진을 사용합니다. 자세한 내용을 보려면 여기를 클릭하세요.", + "Result": "결과", + "InstallDevVersions": "개발(Dev) 버전 설치", + "InstallBetaVersions": "베타(Beta) 버전 설치", + "WhatDoYouWantToRestore": "이 백업에서 어떤 항목을 복원할까요?", + "Configuration": "환경설정", + "Profiles": "프로필", + "Variables": "변수", + "PluginConfigurations": "플러그인 설정", + "PluginCredentials": "플러그인 크리덴셜", + "InstalledIconPacks": "설치된 아이콘 팩", + "Restore": "복원", + "ActionCannotBeReversed": "이 작업은 되돌릴 수 없습니다", + "ThisWillDeleteBackupPermanently": "백업이 영구적으로 삭제됩니다", + "Created": "생성됨", + "PleaseWait": "잠시만 기다려주세요...", + "Backups": "백업", + "CreateBackup": "백업 생성", + "BackupFailed": "백업 실패", + "BackupSuccessfullyCreated": "백업 생성을 성공했어요.", + "CreateBackupBeforeUpdate": "업데이트 하기전 백업파일을 생성하시겠습니까?", + "CreatingBackup": "백업 생성 중...", + "PluginNeedsConfiguration": "이 플러그인은 설정이 필요합니다", + "ConfigureNow": "지금 {0}을(를) 설정하시겠습니까?", + "Hotkey": "단축키", + "PressTheKeysNow": "할당하고자 하는 키를 입력해주세요", + "XAction": "{0} 동작", + "XActions": "{0} 동작들", + "OnRelease": "뗄 때", + "OnLongPress": "길게 누를 때", + "OnLongPressRelease": "길게 누르고 뗄 때", + "SimulateOnPress": "\"누를 때\" 시연", + "SimulateOnRelease": "\"뗄 때\" 시연", + "SimulateOnLongPress": "\"길게 누를 때\" 시연", + "SimulateOnLongPressRelease": "\"길게 누르고 뗄 때\" 시연", + "HotkeyExecutesOnPress": "단축키는 입력시 \"누를 때\"의 동작이 실행됩니다", + "Important": "중요", + "FirewallAlertInfo": "Macro Deck을 시작하면 Windows 방화벽창이 나타납니다. 모든 체크박스에 체크 후 액세스 허용을 눌러주시기 바랍니다. (개인 네트워크, 공용 네트워크 등등)\n \nWindows 방화벽창이 보이지 않았으며 연결에 문제가 발생하는 경우 위키 또는 디스코드 서버를 방문해서 도움을 받아보시기 바랍니다. ", + "GotIt": "알겠습니다", + "DeviceSettings": "장치 설정", + "Brightness": "밝기", + "AutoConnect": "자동 연결", + "DiscordSupport": "디스코드 지원", + "Wiki": "위키", + "ExportLatestLog": "마지막 로그 내보내기", + "LogSuccessfullyExportedToX": "다음 로그를 내보내는데 성공했어요: {0}", + "Help": "도움", + "XWarningsXErrors": "{0}개의 경고, {1}개의 오류", + "TrimBlankLines": "빈 줄바꿈 제거", + "Extensions": "확장기능", + "InstallFromFile": "파일로 설치", + "AllExtensionsUpToDate": "모든 확장기능이 최신버전입니다", + "UpdateAll": "모두 업데이트", + "UpdateAvailable": "업데이트 가능", + "PendingRestart": "다시시작 대기중", + "Enabled": "활성화됨", + "Disabled": "비활성화됨", + "ActionSaveVariableToFile": "파일에 변수 저장", + "ActionSaveVariableToFileDescription": "파일에 변수의 값을 저장합니다", + "Folders": "폴더", + "Grid": "그리드", + "ActionReadVariableFromFile": "파일에서 변수 읽기", + "ActionReadVariableFromFileDescription": "파일을 읽고 내용을 변수 값으로 설정", + "ActionSetProfile": "Set profile", + "ActionSetProfileDescription": "Sets the profile on a device", + "Device": "Device", + "WhereExecuted": "Where executed", + "ActionSetBrightness": "Set brightness", + "ActionSetBrightnessDescription": "Sets the display brightness (Only on the Android app!)", + "BindableVariable": "Bindable variable", + "BindableVariableInfo": "The state of this button can be bound to the variable {0}. Do you want to bind the state?", + "Cancelled": "Cancelled", + "Preparing": "Preparing...", + "Installing": "Installing...", + "Completed": "Completed", + "ExtensionStoreDownloaderPackageIdVersion": "{0} version {1}", + "DownloadingAndInstallingXPackages": "Downloading and installing {0} package(s)", + "InstallationOfXPackagesDone": "Installation of {0} package(s) done", + "ActionSetBackgroundColor": "Set background color", + "ActionSetBackgroundColorDescription": "Changes the background color of a action button", + "Fixed": "Fixed", + "Random": "Random" +======= "__Language__": "Korean", "__LanguageCode__": "ko", "__Author__": "LeinneSW", @@ -301,4 +624,5 @@ "Grid": "그리드", "ActionReadVariableFromFile": "파일에서 변수 읽기", "ActionReadVariableFromFileDescription": "파일을 읽고 내용을 변수 값으로 설정" +>>>>>>> origin/main } \ No newline at end of file diff --git a/Resources/Languages/Polish.json b/Resources/Languages/Polish.json index 73250113..ef91f5e4 100644 --- a/Resources/Languages/Polish.json +++ b/Resources/Languages/Polish.json @@ -1,4 +1,327 @@ { +<<<<<<< HEAD + "__Language__": "Polish", + "__LanguageCode__": "pl", + "__Author__": "Macro Deck", + "NetworkAdapter": "Adapter sieciowy", + "IPAddress": "Adres IP", + "Port": "Port", + "Info": "Info", + "Error": "Błąd", + "Warning": "Uwaga", + "ConfigureNetworkInfo": "Bardzo ważne jest wybranie właściwej karty sieciowej, w przeciwnym razie nie będzie można połączyć się z serwerem za pomocą klienta. W większości przypadków nazwa karty sieciowej wygląda jak \"Ethernet\" lub \"Wi-Fi\", a adres IP w większości przypadków wygląda następująco: \"192.168.178.xxx\".\n\nDomyślnym portem dla aplikacji Macro Deck jest port: 8191. Jeśli jakaś inna aplikacja używa tego portu, możesz go zmienić. ", + "AutomaticallyCheckUpdates": "Automatycznie sprawdzaj aktualizacje", + "AutomaticallyStartWithWindows": "Uruchom automatycznie przy starcie systemu Windows", + "Show": "Pokaż", + "Exit": "Wyjdź", + "XUpdatesAvailable": "{0} dostępnych aktualizacji", + "Profile": "Profile", + "Columns": "Kolumny", + "Rows": "Wiersze", + "Spacing": "Rozstaw", + "CornerRadius": "Promień narożnika", + "ButtonBackGround": "Tło przycisku", + "AreYouSure": "Na pewno?", + "Behaviour": "Zachowanie", + "Plugins": "Wtyczki", + "IconPacks": "Pakiety ikon", + "All": "Wszystko", + "Updates": "Aktualizacje", + "Installed": "Zainstalowane", + "Install": "Zainstaluj", + "Search": "Szukaj", + "Name": "Nazwa", + "Type": "Rodzaj", + "Value": "Wartość", + "Creator": "Twórca", + "Ok": "OK", + "FolderName": "Nazwa folderu", + "Never": "Nigdy", + "OnApplicationFocus": "Skupienie na aplikacji", + "Application": "Aplikacja", + "Devices": "Urządzenia", + "Create": "Utwórz", + "Save": "Zapisz", + "Appearance": "Wygląd", + "ButtonState": "Stan przycisku", + "Label": "Etykieta", + "Top": "Góra", + "Center": "Środek", + "Bottom": "Dół", + "Path": "Ścieżka", + "CurrentState": "Stan obecny", + "Off": "WYŁ", + "On": "WŁ", + "DownloadAndInstall": "Pobierz i zainstaluj", + "Downloading": "Pobieranie", + "Color": "Kolor", + "IconPack": "Pakiet ikon", + "Size": "Rozmiar", + "CurrentProgress": "Aktualny postęp", + "TotalProgress": "Całkowity postęp", + "XDownloads": "Pobrano {0}", + "Update": "Aktualizacja", + "Plugin": "Wtyczka", + "MacroDeckNeedsARestart": "MacroDeck wymaga restartu", + "MacroDeckMustBeRestartedForTheChanges": "MacroDeck należy uruchomić ponownie w celu wprowadzenia zmian.\nCzy chcesz uruchomić ponownie Macro Deck teraz? ;)", + "Configure": "Konfiguruj", + "Uninstall": "Odinstaluj", + "NotLoaded": "Nie załadowano", + "Yes": "Tak", + "No": "Nie", + "Status": "Status", + "BlockConnection": "Zablokuj połączenie", + "Change": "Zmień", + "Id": "ID", + "Connected": "Połączono", + "Disconnected": "Niepołączono", + "Trigger": "Wyzwalacz", + "Action": "Akcja", + "Condition": "Warunek", + "InstalledVersion": "Wersja zainstalowana", + "UpdateChannel": "Aktualizuj kanał", + "CheckForUpdatesNow": "Sprawdź aktualizacje teraz", + "Author": "Autor", + "Version": "Wersja", + "TheFolderWillBeDeleted": "Folder {0} zostanie usunięty!!!", + "TheProfileWillBeDeleted": "Profil {0} zostanie usunięty!!!", + "ServerOffline": "Serwer offline", + "ServerRunning": "Serwer uruchomiony", + "XPluginsLoaded": "{0} wtyczek WŁączonych", + "XPluginsDisabled": "{0} wtyczek WYŁączonych", + "XClientsConnected": "Połączeni klienci: {0} ", + "IpAddressHostNamePort": "IP address/hostname : Port", + "InitialSetupButtonBack": "<- Wstecz", + "InitialSetupButtonNext": "Dalej ->", + "InitialSetupButtonFinish": "Koniec", + "InitialSetupSelectLanguage": "Wybierz język", + "InitialSetupPage": "Strona {0}/{1}", + "InitialSetupWelcome": "Witaj w Macro Deck 2!!!", + "InitialSetupLetsConfigure": "Skonfiguruj swój Macro Deck", + "InitialSetupConfigureNetworkSettings": "Skonfiguruj ustawienia sieciowe", + "InitialSetupConfigureGridPreferences": "Teraz skonfiguruj siatkę zgodnie z własnymi preferencjami", + "InitialSetupPickAllPluginsYouNeed": "Wybierz wtyczki, których potrzebujesz", + "InitialSetupDontWorryInstallUninstallPlugins": "Nie martw się, zawsze możesz zainstalować/odinstalować wtyczki później w menedżerze pakietów", + "InitialSetupWantSomeIcons": "Czy chcesz używać ikon?", + "InitialSetupInstallIconPacksPackageManager": "Pakiety ikon można również zainstalować później w menedżerze pakietów", + "InitialSetupAlmostDone": "Konfiguracja początkowa prawie gotowa!", + "KnownDevices": "Znane Urządzenia", + "AskOnNewConnections": "Zapytaj o nowe połączenia", + "AllowAllNewConnections": "Zezwalaj na wszystkie nowe połączenia (nie zalecane)", + "BlockAllNewConnections": "Blokuj wszystkie nowe połączenia", + "InstallDLL": "Zainstaluj .dll (nie zalecane)", + "NeverInstallDLLFiles": "Nigdy nie instaluj plików .dll z niezaufanych źródeł! Pliki .dll z nieznanych źródeł mogą zaszkodzić Twojemu systemowi, instaluj je tylko wtedy, gdy wiesz, co robisz! Czy naprawdę chcesz zainstalować wtyczkę .dll?", + "XWillBeUninstalled": "{0} zostanie odinstalowany(a).", + "XSuccessfullyUninstalled": "{0} zostanie odinstalowany(a). Aby zmiany zaczęły obowiązywać, należy ponownie uruchomić program Macro Deck. Zrestartować Macro Deck teraz?", + "CreateVariable": "Utwórz zmienną", + "DeleteVariable": "Usuń zmienną", + "SelectAPluginAndActionToBegin": "Wybierz wtyczkę i akcję na początek", + "ActionNeedsNoConfiguration": "Akcja nie wymaga konfiguracji", + "CantCreateFolder": "Nie można utworzyć folderu", + "FolderCalledXAlreadyExists": "Folder o nazwie {0} już istnieje!!!", + "OnPress": "On press", + "OnEvent": "OnEvent", + "CantCreateIconPack": "Nie mogę utworzyć pakietu ikon", + "IconPackCalledXAlreadyExists": "Pakiet ikon o nazwie {0} już istnieje", + "CantCreateProfile": "Nie mogę utworzyć profilu", + "ProfileCalledXAlreadyExists": "Profil o nazwie {0} już istnieje", + "TheresAnUpdateForYou": "Jest aktualizacja dla Ciebie :D", + "VersionXIsNowAvailable": "Wersja {0} ({1}) jest już dostępna", + "ReadyToDownloadUpdate": "Aktualizacja gotowa do pobrania", + "DownloadingUpdate": "Pobieranie aktualizacji... {0}% ({1}MB/{2}MB)", + "VerifyingUpdateFile": "Weryfikowanie pliku aktualizacji ...", + "MD5NotValid": "Suma kontrolna MD5 jest nieprawidłowa", + "StartingInstaller": "Uruchamianie instalatora", + "FileNotFound": "Nie znaleziono pliku", + "TryAgainOrDownloadManually": "Spróbuj ponownie lub pobierz ręcznie", + "Trending": "Tendencje", + "Layers": "Warstwy", + "AddImage": "Dodaj obraz", + "IconImportQualityInfo": "Ikony wysokiej jakości mogą powodować zwiększenie zużycia pamięci i skrócenie czasu ładowania, zwłaszcza w przypadku korzystania z wielu dużych animowanych gifów. \n\n\nW przypadku gifów zalecane jest użycie ustawienia niskiego lub najniższego.", + "Original": "Oryginał", + "High350px": "Wysoka 350px", + "Normal200px": "Normalna (200px)", + "Low150px": "Niska (150px)", + "Lowest100px": "Najniższa (100px)", + "ImportIconPack": "Importuj pakiet ikon", + "ExportIconPack": "Exportuj pakiet ikon", + "CreateIcon": "Utwórz ikonę", + "ImportIcon": "Importuj ikonę", + "DeleteIcon": "Usuń ikonę", + "IconSelectorManagedInfo": "Ten pakiet ikon jest zarządzany przez menedżera wtyczek", + "DownloadingXPackages": "Pobranie {0} pakietów", + "PluginCouldNotBeLoaded": "Wtyczka nie może zostać załadowana! Być może zainstalowana wersja tej wtyczki nie jest zgodna z tą wersją programu Macro Deck.", + "CantChangeName": "Nie mogę zmienić nazwy!!!", + "DeviceCalledXAlreadyExists": "Urządzenie o nazwie {0} już istnieje!!!", + "NewConnection": "Nowe połączenie", + "XIsAnUnknownDevice": "{0} to nieznane urządzenie, które chce się połączyć z Macro Deck. \nZezwolić na połączenie?", + "ShouldMacroDeckBlockConnectionsFromX": "Czy program Macro Deck powinien automatycznie blokować przyszłe połączenia z {0}?", + "FailedToStartServer": "Nie udało się uruchomić serwera!!! \nByć może skonfigurowany port jest już używany przez inny program lub ustawiono nieprawidłową kartę sieciową. Upewnij się, że w ustawieniach ustawiono prawidłową kartę sieciową, a następnie spróbuj zmienić port.", + "ErrorWhileLoadingPlugins": "Błąd podczas ładowania wtyczek", + "PluginXCouldNotBeLoaded": "{0} wersja {1} nie mogła zostać załadowana. Być może nie jest kompatybilna z tą wersją programu Macro Deck. Akcje wykorzystujące tę wtyczkę nie będą działać do czasu jej aktualizacji.", + "InstallationSuccessfull": "Instalacja zakończona pomyślnie", + "PluginXInstalledSuccessfully": "Wtyczka {0} została zainstalowana pomyślnie", + "ErrorWhileInstallingPlugin": "Błąd podczas instalacji wtyczki", + "PluginXCouldNotBeInstalled": "Wtyczka {0} nie może zostać zainstalowana!!! \nByć może nie jest zgodna z tą wersją programu Macro Deck.", + "Settings": "Ustawienia", + "Language": "Język", + "General": "Ogólne", + "Connection": "Połączenie", + "Backup": "Kopia", + "About": "O", + "NoUpdatesAvailable": "Brak dostępnych aktualizacji", + "LatestVersionInstalled": "Zainstalowano najnowszą wersję", + "WarningDevVersions": "Wersje deweloperskie mogą być naprawdę niestabilne i powodować awarie lub utratę danych (skonfigurowanych przycisków akcji, folderów i profili). Czy naprawdę chcesz włączyć kanał aktualizacji wersji Dev?", + "WarningBetaVersions": "Wersje BETA mogą czasami być niestabilne i powodować awarie. \nCzy naprawdę chcesz włączyć kanał aktualizacji wersji Beta?", + "VariableXGetsDeleted": "Zmienna {0} zostaje usunięta.", + "DeckTitle": "Nazwa Deck'a", + "DeviceManagerTitle": "Menedżer urządzeń", + "PackageManagerTitle": "Menedżer wtyczek", + "SettingsTitle": "Ustawienia", + "VariablesTitle": "Globalne zmienne", + "Edit": "Edytuj", + "Delete": "Usuń", + "Run": "Uruchom", + "Copy": "Kopiuj", + "Paste": "Wklej", + "WebSocketAPIVersion": "Wersja WebSocket API", + "PluginAPIVersion": "Wersja API wtyczki", + "InstalledPlugins": "Zainstalowane wtyczki", + "OperatingSystem": "System operacyjny", + "DevelopedByX": "Opracowano przez {0} w Niemczech", + "XTranslationByX": "{0} tłumaczenie przez {1}", + "PackageManagerTabAvailable": "Dostępne", + "PackageManagerTabInstalled": "Zainstalowano", + "Event": "Wydarzenie", + "AutomaticallySwitchToFolder": "Automatycznie przełącz na folder", + "Restart": "Restart Macro Deck", + "Delay": "Opóźnienie", + "If": "Jeżeli", + "Else": "W przeciwnym razie", + "Online": "Online", + "By": "Przez", + "StateBinding": "Powiąż stan z", + "ErrorWhileLoadingPackageManager": "Błąd podczas ładowania menedżera pakietów!!!\nByć może nie masz połączenia z Internetem lub Macro Deck jest blokowany przez zaporę sieciową.", + "UpdatesAvailable": "Dostępne aktualizacje", + "EnableIconCache": "Włącz buforowanie ikon (szybciej --> większe zużycie pamięci)", + "WebClient": "Web Client", + "AndroidApp": "Klient Androida", + "IOSApp": "Klient IOS", + "PluginMacroDeckFolder": "Macro Deck folder", + "ActionChangeFolder": "Zmień folder", + "ActionChangeFolderDescription": "Zmień bieżący folder na bieżącym urządzeniu na wybrany folder", + "ActionGoToParentFolder": "Przejdź do folderu nadrzednego", + "ActionGoToParentFolderDescription": "Zmień bieżący folder na bieżącym urządzeniu na folder nadrzędny", + "ActionGoToRootFolder": "Przejdź do folderu głównego (root)", + "ActionGoToRootFolderDescription": "Zmień bieżący folder na bieżącym urządzeniu na folder główny (root)", + "PluginMacroDeckVariables": "Zmienne Macro Deck", + "ActionChangeVariableValue": "Zmień wartość zmiennej", + "ActionChangeVariableValueDescription": "Odliczanie w górę, odliczanie w dół, ustawianie wartości zmiennej i przełączanie wartości zmiennej", + "CountUp": "Odliczaj w górę", + "CountDown": "Odliczaj w dół", + "Set": "Ustaw", + "Toggle": "Przełącznik", + "Variable": "Zmienna", + "PluginActionButton": "Przycisk akcji", + "ActionToggleActionButtonState": "Przełącz stan przycisku", + "ActionToggleActionButtonStateDescription": "Zmienia stan tego przycisku", + "ActionSetActionButtonStateOff": "Ustaw stan przycisku na WYŁączony - OFF", + "ActionSetActionButtonStateOffDescription": "Ustawia stan tego przycisku na \"WYŁączony\" - OFF.", + "ActionSetActionButtonStateOn": "Ustaw stan przycisku na WŁączony - ON", + "ActionSetActionButtonStateOnDescription": "Ustawia stan tego przycisku na \"WŁączony\" - ON.", + "Description": "Opis", + "License": "Licencja", + "AnimatedGifImported": "Zaimportowany animowany GIF", + "GenerateStaticIcon": "Czy wygenerować statyczną ikonę pierwszej klatki pliku GIF?", + "XSuccessfullyExportedToX": "{0} został pomyślnie wyeksportowany do {1}.", + "SelectedIconWillBeDeleted": "Wybrana ikona zostanie usunięta!!!", + "SuccessfullyImportedIconPack": "Pomyślnie zaimportowano pakiet ikon {0}", + "SelectedIconPackWillBeDeleted": "Wybrany pakiet ikon {0} i wszystkie jego ikony zostaną usunięte.", + "GenerateStatic": "Generuj statystyki", + "OnlyUserCreatedVariablesVisible": "Widoczne tylko zmienne utworzone przez użytkownika", + "MacroDeckUsesCottleTemplateEngine": "W programie Macro Deck zastosowano silnik szablonów Cottle. Kliknij tutaj, aby uzyskać więcej informacji.", + "Result": "Wynik", + "InstallDevVersions": "Instaluj wersje Dev", + "InstallBetaVersions": "Instaluj wersje Beta", + "WhatDoYouWantToRestore": "Co chcesz przywrócić z kopii zapasowej?", + "Configuration": "Konfiguracja", + "Profiles": "Profile", + "Variables": "Zmienne", + "PluginConfigurations": "Konfiguracje wtyczek", + "PluginCredentials": "Poświadczenia wtyczki", + "InstalledIconPacks": "Zainstalowane pakiety ikon", + "Restore": "Przywrócić", + "ActionCannotBeReversed": "Akcja nie może być odwrócona", + "ThisWillDeleteBackupPermanently": "To spowoduje trwałe usunięcie kopii zapasowej!!!", + "Created": "Stworzono", + "PleaseWait": "Proszę czekać...", + "Backups": "Kopie zapasowe", + "CreateBackup": "Utwórz kopię zapasową", + "BackupFailed": "Kopia zapasowa nie powiodła się", + "BackupSuccessfullyCreated": "Kopia zapasowa pomyślnie utworzona", + "CreateBackupBeforeUpdate": "Czy chcesz utworzyć kopię zapasową przed aktualizacją?", + "CreatingBackup": "Tworzenie kopii zapasowej...", + "PluginNeedsConfiguration": "Ta wtyczka wymaga konfiguracji", + "ConfigureNow": "Czy chcesz teraz skonfigurować {0}?", + "Hotkey": "Klawisz skrótu", + "PressTheKeysNow": "Naciśnij klawisze, które chcesz teraz przypisać", + "XAction": "{0} action", + "XActions": "{0} actions", + "OnRelease": "Wciśnij", + "OnLongPress": "Przytrzymaj", + "OnLongPressRelease": "Przytrzymaj i zwolnij", + "SimulateOnPress": "Symuluj \"Wciśnij\"", + "SimulateOnRelease": "Symuluj \"Zwolnij\"", + "SimulateOnLongPress": "Symuluj \"Przytrzymaj\"", + "SimulateOnLongPressRelease": "Symuluj \"Przytrzymaj i zwolnij\"", + "HotkeyExecutesOnPress": "Naciśnięcie klawisza skrótu powoduje wykonanie akcji \"Wciśnij\".", + "Important": "Ważne", + "FirewallAlertInfo": "Po uruchomieniu programu Macro Deck zostanie wyświetlone okno dialogowe \"Zapora systemu Windows Defender\".\n\nNależy zaznaczyć wszystkie pola (sieci prywatne, sieci publiczne i, jeśli istnieją, sieci domenowe).\n\nJeśli to okno dialogowe nie pojawi się, a nadal masz problemy z połączeniem, odwiedź Wiki lub serwer Discord, aby uzyskać pomoc. ", + "GotIt": "Mam to!", + "DeviceSettings": "Ustawienia urządzenia", + "Brightness": "Jasność", + "AutoConnect": "Automatyczne polączenie", + "DiscordSupport": "Wsparcie Discord", + "Wiki": "Wiki", + "ExportLatestLog": "Eksportuj ostatni dziennik (logi)", + "LogSuccessfullyExportedToX": "Dziennik (logi) pomyślnie wyeksportowano do {0}", + "Help": "Pomoc", + "XWarningsXErrors": "Ostrzeżenia: {0}. Błędy: {1}.", + "TrimBlankLines": "Przytnij puste wiersze", + "Extensions": "Rozszerzenia", + "InstallFromFile": "Zainstaluj z pliku", + "AllExtensionsUpToDate": "Wszystkie rozszerzenia są aktualne", + "UpdateAll": "Zaktualizuj wszystko", + "UpdateAvailable": "Dostępna aktualizacja", + "PendingRestart": "Oczekuje na ponowne uruchomienie", + "Enabled": "Włączony", + "Disabled": "Wyłączone", + "ActionSaveVariableToFile": "Zapisz zmienną do pliku", + "ActionSaveVariableToFileDescription": "Zapisuje wartość zmiennej do pliku", + "Folders": "Lornetka składana", + "Grid": "Krata", + "ActionReadVariableFromFile": "Odczytaj zmienną z pliku", + "ActionReadVariableFromFileDescription": "Czyta plik i ustawia zawartość jako wartość zmiennej", + "ActionSetProfile": "Set profile", + "ActionSetProfileDescription": "Sets the profile on a device", + "Device": "Device", + "WhereExecuted": "Where executed", + "ActionSetBrightness": "Set brightness", + "ActionSetBrightnessDescription": "Sets the display brightness (Only on the Android app!)", + "BindableVariable": "Bindable variable", + "BindableVariableInfo": "The state of this button can be bound to the variable {0}. Do you want to bind the state?", + "Cancelled": "Cancelled", + "Preparing": "Preparing...", + "Installing": "Installing...", + "Completed": "Completed", + "ExtensionStoreDownloaderPackageIdVersion": "{0} version {1}", + "DownloadingAndInstallingXPackages": "Downloading and installing {0} package(s)", + "InstallationOfXPackagesDone": "Installation of {0} package(s) done", + "ActionSetBackgroundColor": "Set background color", + "ActionSetBackgroundColorDescription": "Changes the background color of a action button", + "Fixed": "Fixed", + "Random": "Random" +======= "__Language__": "Polish", "__LanguageCode__": "pl", "__Author__": "Macro Deck", @@ -301,4 +624,5 @@ "Grid": "Krata", "ActionReadVariableFromFile": "Odczytaj zmienną z pliku", "ActionReadVariableFromFileDescription": "Czyta plik i ustawia zawartość jako wartość zmiennej" +>>>>>>> origin/main } \ No newline at end of file diff --git a/Resources/Languages/Portuguese.json b/Resources/Languages/Portuguese.json index 3365dc4d..a7157b93 100644 --- a/Resources/Languages/Portuguese.json +++ b/Resources/Languages/Portuguese.json @@ -1,4 +1,327 @@ { +<<<<<<< HEAD + "__Language__": "Portuguese", + "__LanguageCode__": "pt", + "__Author__": "Patrick", + "NetworkAdapter": "Placa de Rede", + "IPAddress": "Endereço IP", + "Port": "Porta", + "Info": "Informação", + "Error": "Erro", + "Warning": "Aviso", + "ConfigureNetworkInfo": "É muito importante selecionar a Placa de Rede correta para estabelecer a comunicação com o servidor. Normalmente a Placa de Rede chama-se \"Ethernet\" ou \"Rede sem fio\" e o Endereço IP costuma ser semelhante a \"192.168.178.xxx\".\n \nA Porta Padrão do Macro Deck é 8191. Se outra aplicativo utilizar esta Porta, deve ser alterada.\n ", + "AutomaticallyCheckUpdates": "Proucurar atualizações automáticamente", + "AutomaticallyStartWithWindows": "Abrir ao ligar o computador", + "Show": "Configurar o Macro Deck", + "Exit": "Fechar", + "XUpdatesAvailable": "{0} atualizações disponíveis", + "Profile": "Perfil", + "Columns": "Colunas", + "Rows": "Linha", + "Spacing": "Distância", + "CornerRadius": "Raio de canto", + "ButtonBackGround": "Cor de botão", + "AreYouSure": "Tem a certeza?", + "Behaviour": "Funcionamento", + "Plugins": "Plugins", + "IconPacks": "Pacote de Icons", + "All": "Todos", + "Updates": "Atualizações", + "Installed": "Instalado", + "Install": "Instalar", + "Search": "Proucurar...", + "Name": "Nome", + "Type": "Tipo", + "Value": "Valor", + "Creator": "Criado por", + "Ok": "OK", + "FolderName": "Nome da Pasta", + "Never": "Nunca", + "OnApplicationFocus": "Se applicação está focada", + "Application": "Aplicativo", + "Devices": "Dispositivo", + "Create": "Criar", + "Save": "Guardar", + "Appearance": "Aparência", + "ButtonState": "Estado do botão", + "Label": "Texto", + "Top": "Topo", + "Center": "Meio", + "Bottom": "Fundo", + "Path": "Atalho", + "CurrentState": "Estado atual", + "Off": "Desligar", + "On": "Ligar", + "DownloadAndInstall": "Descarregar", + "Downloading": "Descarregando...", + "Color": "Cor", + "IconPack": "Pacote de Icons", + "Size": "Tamanho", + "CurrentProgress": "Progresso atual", + "TotalProgress": "Progresso total", + "XDownloads": "{0} Downloads", + "Update": "Atualizazar", + "Plugin": "Plugin", + "MacroDeckNeedsARestart": "O Macro Deck tem que ser reiniciado", + "MacroDeckMustBeRestartedForTheChanges": "O Macro Deck tem que ser reiniciado. Reiniciar o Macro Deck agora?", + "Configure": "Configurar", + "Uninstall": "Desinstalar", + "NotLoaded": "Deativar", + "Yes": "Sim", + "No": "Não", + "Status": "Estado", + "BlockConnection": "Conexão bloqueada", + "Change": "Alterar", + "Id": "ID", + "Connected": "Conetado", + "Disconnected": "Desconetado", + "Trigger": "Acionar", + "Action": "Ação", + "Condition": "Condição", + "InstalledVersion": "Versão instalada", + "UpdateChannel": "Meio de atualização", + "CheckForUpdatesNow": "Proucurar atualizações", + "Author": "Autor", + "Version": "Versão", + "TheFolderWillBeDeleted": "A Pasta {0} e todos os botões serão eliminados.", + "TheProfileWillBeDeleted": "O Perfil {0} e todas as pastas e os botões serão eliminados.", + "ServerOffline": "Servidor desativado", + "ServerRunning": "Servidor ativado", + "XPluginsLoaded": "Plugins ativados: {0}", + "XPluginsDisabled": "Plugins desativados: {0}", + "XClientsConnected": "Dispositivos conetados: {0}", + "IpAddressHostNamePort": "Endereço IP/Hostname : Porta", + "InitialSetupButtonBack": "<- Para trás", + "InitialSetupButtonNext": "Próximo ->", + "InitialSetupButtonFinish": "Finalizar", + "InitialSetupSelectLanguage": "Selecionar idioma", + "InitialSetupPage": "{0}/{1}", + "InitialSetupWelcome": "Bem-vindo ao Macro Deck 2!", + "InitialSetupLetsConfigure": "Vamos configurar algumas coisas!", + "InitialSetupConfigureNetworkSettings": "Configurar a rede", + "InitialSetupConfigureGridPreferences": "Configurar o formato", + "InitialSetupPickAllPluginsYouNeed": "Selecionar Plugins", + "InitialSetupDontWorryInstallUninstallPlugins": "Os Plugins podem ser instalados e desinstalados mais tarde pelo Gerenciador de Pacotes!", + "InitialSetupWantSomeIcons": "Selecionar Pacotes de Icons", + "InitialSetupInstallIconPacksPackageManager": "Os Pacotes de Icons podem ser instalados e desinstalados mais tarde pelo Gerenciador de Pacotes!", + "InitialSetupAlmostDone": "Vamos começar!", + "KnownDevices": "Dispositivos conhecidos", + "AskOnNewConnections": "Perguntar ao conetar?", + "AllowAllNewConnections": "Permitir todas a conexões (não recomendável)", + "BlockAllNewConnections": "Bloquear todas as novas conexões", + "InstallDLL": "Instalar .dll (não recomendável)", + "NeverInstallDLLFiles": "Plugins .dll de origem desconhecida podem danificar o teu sistema. Instala somente Plugins de origem segura e confiável. Instalar Plugin?", + "XWillBeUninstalled": "Desinstalando {0}.", + "XSuccessfullyUninstalled": "{0} foi desinstalado. O Macro Deck tem que ser reiniciado. Reiniciar o Macro Deck agora??", + "CreateVariable": "Criar variável", + "DeleteVariable": "Eliminar variável", + "SelectAPluginAndActionToBegin": "Selecionar Plugin e Ação para começar", + "ActionNeedsNoConfiguration": "Esta Ação não necessita ser configurada", + "CantCreateFolder": "Não foi possível criar a pasta", + "FolderCalledXAlreadyExists": "Já existe uma pasta com o nome \"{0}\"", + "OnPress": "Ao pressionar", + "OnEvent": "Ao ativar um evento", + "CantCreateIconPack": "Não foi possível criar o Pacote de Icons", + "IconPackCalledXAlreadyExists": "Já existe um Pacote de Icons com o nome {0}", + "CantCreateProfile": "Não foi possível criar este Perfil", + "ProfileCalledXAlreadyExists": "Já existe um Perfil com o nome {0}", + "TheresAnUpdateForYou": "Nova atualização disponível :)", + "VersionXIsNowAvailable": "Versão {0} ({1}) pode ser descarregada", + "ReadyToDownloadUpdate": "Disponível", + "DownloadingUpdate": "Descarregando... {0}% ({1}MB/{2}MB)", + "VerifyingUpdateFile": "Verificar ficheiros...", + "MD5NotValid": "Teste MD5 inválido", + "StartingInstaller": "Iniciando instalador", + "FileNotFound": "Não foi encontrado o ficheiro", + "TryAgainOrDownloadManually": "Tentar novamente ou instalar manualmente?", + "Trending": "Tendência", + "Layers": "Camada", + "AddImage": "Imagem", + "IconImportQualityInfo": "Muitos Icons de alta resolução podem provocar problemas de desempenho, especialmente GIFs animados.\nPara GIFs animados deves selecionar a defenição \"baixa\" ou \"muito baixa\".\n ", + "Original": "Original", + "High350px": "Alta (350px)", + "Normal200px": "Normal (200px)", + "Low150px": "Baixa (150px)", + "Lowest100px": "Muito baixa (100px)", + "ImportIconPack": "Importar", + "ExportIconPack": "Exportar", + "CreateIcon": "Criar Icon", + "ImportIcon": "Importar Icon", + "DeleteIcon": "Eliminar Icon", + "IconSelectorManagedInfo": "Este Pacote de Icons é gerenciado pelo Gerenciador de Pacotes", + "DownloadingXPackages": "{0} pacotes a descarregar", + "PluginCouldNotBeLoaded": "O Plugin não foi carregado. Possivelmente a versão do Plugin é incompatível com a versão do Macro Deck.", + "CantChangeName": "Não foi possivél alterar o nome", + "DeviceCalledXAlreadyExists": "Já existe um dispositivo com o nome {0}", + "NewConnection": "Nova conexão", + "XIsAnUnknownDevice": "O dispositivo {0} é desconhecido. Permitir conexão?", + "ShouldMacroDeckBlockConnectionsFromX": "Bloquear tentativas de conexão do dispositivo {0}?", + "FailedToStartServer": "Não foi possível iniciar o servidor. Vê se a porta está disponível ou se a Placa de Rede selecionada é a correta.", + "ErrorWhileLoadingPlugins": "Erro ao carregar os Plugins", + "PluginXCouldNotBeLoaded": "O Plugin {0} Versão {1} não foi carregado. Provavelmente a versão não é compatível. Provavelment os botões que usam este Plugin não funcionem corretamente.", + "InstallationSuccessfull": "Instalado com sucesso", + "PluginXInstalledSuccessfully": "{0} foi instalado", + "ErrorWhileInstallingPlugin": "Erro ao instalar o Plugin", + "PluginXCouldNotBeInstalled": "{0} não foi instalado. Provavelmente a versão não é compatível.", + "Settings": "Definições", + "Language": "Idioma", + "General": "Geral", + "Connection": "Conexão", + "Backup": "Backup", + "About": "Sobre", + "NoUpdatesAvailable": "Nenhuma atualização disponível", + "LatestVersionInstalled": "Já está instalada a versão atual", + "WarningDevVersions": "A Versão Dev pode ser instável e provocar a perda de dados dentro do Macro Deck (Botões, pastas e perfis). Ativar atualizações de desenvolvedor?", + "WarningBetaVersions": "A Versão Beta pode ser instável. Ativar atualizações Beta?", + "VariableXGetsDeleted": "Eliminar {0}", + "DeckTitle": "Deck", + "DeviceManagerTitle": "Gerenciador de dispositivos", + "PackageManagerTitle": "Gerenciador de Pacotes", + "SettingsTitle": "Definições", + "VariablesTitle": "Variáveis globais", + "Edit": "Editar", + "Delete": "Eliminar", + "Run": "Executar", + "Copy": "Copiar", + "Paste": "Colar", + "WebSocketAPIVersion": "Versão API do Websocket", + "PluginAPIVersion": "Versão APi do Plugin", + "InstalledPlugins": "Plugins instalados", + "OperatingSystem": "Sistema operatório", + "DevelopedByX": "Desenvolvido na Alemanha por {0}", + "XTranslationByX": "Tradução em {0} por {1}", + "PackageManagerTabAvailable": "Disponível", + "PackageManagerTabInstalled": "Instalado", + "Event": "Evento", + "AutomaticallySwitchToFolder": "Alterar pasta automaticamente", + "Restart": "Reiniciar Macro Deck", + "Delay": "Esperar", + "If": "Se", + "Else": "Senão", + "Online": "Online", + "By": "De", + "StateBinding": "Associar estado a", + "ErrorWhileLoadingPackageManager": "Erro ao carregar o Gerenciador de Pacotes. \n Provavelmente existe um erro de conexão de rede ou o Firewall está bloqueando a conexão.", + "UpdatesAvailable": "Atualizações disponíveis", + "EnableIconCache": "Ativar Cache de Icons (mais rápido; maior uso de memôria RAM)", + "WebClient": "Cliente Web", + "AndroidApp": "App Android", + "IOSApp": "App iOS", + "PluginMacroDeckFolder": "Pasta Macro Deck", + "ActionChangeFolder": "Alterar pasta", + "ActionChangeFolderDescription": "Altera a pasta do dispositivo que acionou a Ação para abrir uma pasta definida aqui.", + "ActionGoToParentFolder": "Voltar para pasta superior", + "ActionGoToParentFolderDescription": "Altera a pasta do dispositivo que acionou a Ação para voltar a pasta superior", + "ActionGoToRootFolder": "Voltar para pasta principal", + "ActionGoToRootFolderDescription": "Altera a pasta do dispositivo que acionou a Ação para voltar a pasta principal", + "PluginMacroDeckVariables": "Variáveis Macro Deck", + "ActionChangeVariableValue": "Alterar valor da Variável", + "ActionChangeVariableValueDescription": "Aumentar, diminuir, alterar ou definir valor da Variável", + "CountUp": "Aumentar", + "CountDown": "Diminuir", + "Set": "Definir", + "Toggle": "Alterar", + "Variable": "Variável", + "PluginActionButton": "Este botão", + "ActionToggleActionButtonState": "Alterar estado do botão", + "ActionToggleActionButtonStateDescription": "Altera o estado quando o botão é pressionado", + "ActionSetActionButtonStateOff": "Definir o estado do botão como \"desligado\"", + "ActionSetActionButtonStateOffDescription": "Define o estado do botão pressionado como \"desligado\"", + "ActionSetActionButtonStateOn": "Definir o estado do botão como \"ligado\"", + "ActionSetActionButtonStateOnDescription": "Define o estado do botão pressionado como \"ligado\"", + "Description": "Descrição", + "License": "Licença", + "AnimatedGifImported": "GIF animado foi importado", + "GenerateStaticIcon": "Criar versão sem animação do Icon?", + "XSuccessfullyExportedToX": "{0} foi exportado para {1} com sucesso", + "SelectedIconWillBeDeleted": "O Icon {0} selecionado será eliminado", + "SuccessfullyImportedIconPack": "{0} foi importado com sucesso", + "SelectedIconPackWillBeDeleted": "{0} com todos os Icons será eliminado", + "GenerateStatic": "Gerar versão sem animação", + "OnlyUserCreatedVariablesVisible": "Só visualizar Variáveis do usuário", + "MacroDeckUsesCottleTemplateEngine": "O Macro Deck usa a Cottle Template Engine. Mais informações aqui.", + "Result": "Resultado", + "InstallDevVersions": "Instalar versão Dev", + "InstallBetaVersions": "Instalar versão Beta", + "WhatDoYouWantToRestore": "O que queres restaurar?", + "Configuration": "Configuração", + "Profiles": "Perfil", + "Variables": "Variáveis", + "PluginConfigurations": "Configuração de Plugin", + "PluginCredentials": "Dados de registro do Plugin", + "InstalledIconPacks": "Pacotes de Icons instalados", + "Restore": "Restaurar", + "ActionCannotBeReversed": "Está ação não é reversível", + "ThisWillDeleteBackupPermanently": "Eliminar Backup definitivamente", + "Created": "Criar", + "PleaseWait": "Um momento por favor...", + "Backups": "Backups", + "CreateBackup": "Criar Backup", + "BackupFailed": "Backup em sucesso", + "BackupSuccessfullyCreated": "Backup com sucesso", + "CreateBackupBeforeUpdate": "Criar um Backup antes da atualização?", + "CreatingBackup": "Criando o Backup...", + "PluginNeedsConfiguration": "Este Plugin deve ser configurado", + "ConfigureNow": "Configurar {0} agora?", + "Hotkey": "Atalho de teclado", + "PressTheKeysNow": "Pressiona a tecla agora...", + "XAction": "Ação {0}", + "XActions": "Ações {0}", + "OnRelease": "Ao levantar botão", + "OnLongPress": "Ao segurar botão", + "OnLongPressRelease": "Ao levantar depois de segurar o botão", + "SimulateOnPress": "Simular \"Pressionar botão\"", + "SimulateOnRelease": "Simular \"Levantar botão\"", + "SimulateOnLongPress": "Simular \"Segurar botão\"", + "SimulateOnLongPressRelease": "Simular \"Levantar depois de segurar botão\"", + "HotkeyExecutesOnPress": "Ao usar Atalhos de Teclado será acionada a Ação \"Pressionar botão\"", + "Important": "Importante!", + "FirewallAlertInfo": "\n\t\tDepois de iniciar o Macro Deck, uma caixa de diálogo do Windows Defender Firewall aparecerá.\n\t\tMarca todas as caixas (Redes Privadas, Redes Públicas e Redes de Domínio, se existir).\n\t\t\n\t\tSe esta caixa de diálogo não aparecer e houver problemas de conexão, podes obter ajuda na Wiki e no servidor do Discord. \n\t", + "GotIt": "Entendi!", + "DeviceSettings": "Definições de dispositivo", + "Brightness": "Brilho", + "AutoConnect": "Conetar automaticamente", + "DiscordSupport": "Ajuda via Discord", + "Wiki": "Wiki", + "ExportLatestLog": "Exportar ficheiro de registro", + "LogSuccessfullyExportedToX": "O ficheiro de registro foi xportado para {0}", + "Help": "Ajuda", + "XWarningsXErrors": "{0} Aviso(s), {1} Erro(s)", + "TrimBlankLines": "Aparar linhas em branco", + "Extensions": "Extensões", + "InstallFromFile": "Instalar a partir do arquivo", + "AllExtensionsUpToDate": "Todas as extensões estão atualizadas", + "UpdateAll": "Atualize tudo", + "UpdateAvailable": "Atualização disponível", + "PendingRestart": "Reinicialização pendente", + "Enabled": "Habilitado", + "Disabled": "Desabilitado", + "ActionSaveVariableToFile": "Salvar variável em arquivo", + "ActionSaveVariableToFileDescription": "Salva o valor da variável em um arquivo", + "Folders": "Pastas", + "Grid": "Rede", + "ActionReadVariableFromFile": "Ler variável do arquivo", + "ActionReadVariableFromFileDescription": "Lê um arquivo e define o conteúdo como valor para uma variável", + "ActionSetProfile": "Set profile", + "ActionSetProfileDescription": "Sets the profile on a device", + "Device": "Device", + "WhereExecuted": "Where executed", + "ActionSetBrightness": "Set brightness", + "ActionSetBrightnessDescription": "Sets the display brightness (Only on the Android app!)", + "BindableVariable": "Bindable variable", + "BindableVariableInfo": "The state of this button can be bound to the variable {0}. Do you want to bind the state?", + "Cancelled": "Cancelled", + "Preparing": "Preparing...", + "Installing": "Installing...", + "Completed": "Completed", + "ExtensionStoreDownloaderPackageIdVersion": "{0} version {1}", + "DownloadingAndInstallingXPackages": "Downloading and installing {0} package(s)", + "InstallationOfXPackagesDone": "Installation of {0} package(s) done", + "ActionSetBackgroundColor": "Set background color", + "ActionSetBackgroundColorDescription": "Changes the background color of a action button", + "Fixed": "Fixed", + "Random": "Random" +======= "__Language__": "Portuguese", "__LanguageCode__": "pt", "__Author__": "Patrick", @@ -301,4 +624,5 @@ "Grid": "Rede", "ActionReadVariableFromFile": "Ler variável do arquivo", "ActionReadVariableFromFileDescription": "Lê um arquivo e define o conteúdo como valor para uma variável" +>>>>>>> origin/main } \ No newline at end of file diff --git a/Resources/Languages/Russian.json b/Resources/Languages/Russian.json index 62997a79..e20876ff 100644 --- a/Resources/Languages/Russian.json +++ b/Resources/Languages/Russian.json @@ -1,4 +1,327 @@ { +<<<<<<< HEAD + "__Language__": "Russian", + "__LanguageCode__": "ru", + "__Author__": "LeetPanda1337, zedalert", + "NetworkAdapter": "Сетевой адаптер", + "IPAddress": "IP-адрес", + "Port": "Порт", + "Info": "Информация", + "Error": "Ошибка", + "Warning": "Предупреждение", + "ConfigureNetworkInfo": "Очень важно выбрать правильный сетевой адаптер, в противном случае клиент не сможет подключиться к серверу. В большинстве случаев название сетевого адаптера выглядит как \"Ethernet\" или \"WLAN\", а его IP-адрес выглядит как \"192.168.178.xxx\".\n\n8191 cтандартный порт Macro Deck. Если другие программы используют этот порт, вы можете сменить его.", + "AutomaticallyCheckUpdates": "Автоматически проверять обновления", + "AutomaticallyStartWithWindows": "Автозапуск вместе с Windows", + "Show": "Показать", + "Exit": "Выход", + "XUpdatesAvailable": "{0} обновлений доступно", + "Profile": "Профиль", + "Columns": "Столбцы", + "Rows": "Строки", + "Spacing": "Промежуток", + "CornerRadius": "Радиус углов", + "ButtonBackGround": "Фон кнопок", + "AreYouSure": "Вы уверены?", + "Behaviour": "Действия", + "Plugins": "Плагины", + "IconPacks": "Пакеты иконок", + "All": "Все", + "Updates": "Обновления", + "Installed": "Установлены", + "Install": "Установить", + "Search": "Поиск...", + "Name": "Имя", + "Type": "Тип", + "Value": "Значение", + "Creator": "Создатель", + "Ok": "Ок", + "FolderName": "Имя папки", + "Never": "Никогда", + "OnApplicationFocus": "При запущенной программе", + "Application": "Программа", + "Devices": "Устройства", + "Create": "Создать", + "Save": "Сохранить", + "Appearance": "Оформление", + "ButtonState": "Статус кнопки", + "Label": "Текст", + "Top": "Сверху", + "Center": "По центру", + "Bottom": "Снизу", + "Path": "Путь", + "CurrentState": "Текущее состояние", + "Off": "Выкл.", + "On": "Вкл.", + "DownloadAndInstall": "Загрузить и установить", + "Downloading": "Загрузка...", + "Color": "Цвет", + "IconPack": "Пакет иконок", + "Size": "Размер", + "CurrentProgress": "Текущий прогресс", + "TotalProgress": "Общий прогресс", + "XDownloads": "{0} загрузок", + "Update": "Обновление", + "Plugin": "Плагин", + "MacroDeckNeedsARestart": "Macro Deck требуется перезагрузка", + "MacroDeckMustBeRestartedForTheChanges": "Macro Deck требуется перезагрузка для применения изменений. Перезагрузить сейчас?", + "Configure": "Настроить", + "Uninstall": "Удалить", + "NotLoaded": "Не загружено", + "Yes": "Да", + "No": "Нет", + "Status": "Статус", + "BlockConnection": "Блокировать соединение", + "Change": "Изменить", + "Id": "ID", + "Connected": "Подключен", + "Disconnected": "Отключен", + "Trigger": "Событие", + "Action": "Действие", + "Condition": "Состояние", + "InstalledVersion": "Установленная версия", + "UpdateChannel": "Канал обновлений", + "CheckForUpdatesNow": "Проверить обновления", + "Author": "Автор", + "Version": "Версия", + "TheFolderWillBeDeleted": "Папка {0} и все её кнопки будут удалены.", + "TheProfileWillBeDeleted": "Профиль {0} и все его папки и кнопки будут удалены.", + "ServerOffline": "Сервер не запущен", + "ServerRunning": "Сервер запущен", + "XPluginsLoaded": "Плагинов запущено: {0}", + "XPluginsDisabled": "{0} плагинов отключено", + "XClientsConnected": "Клиентов подключено: {0}", + "IpAddressHostNamePort": "IP-адрес/имя хоста : порт", + "InitialSetupButtonBack": "<- Назад", + "InitialSetupButtonNext": "Далее ->", + "InitialSetupButtonFinish": "Готово", + "InitialSetupSelectLanguage": "Выберите язык", + "InitialSetupPage": "Страница {0}/{1}", + "InitialSetupWelcome": "Добро пожаловать в Macro Deck 2!", + "InitialSetupLetsConfigure": "Давайте настроим Macro Deck 2", + "InitialSetupConfigureNetworkSettings": "Настройте параметры сети", + "InitialSetupConfigureGridPreferences": "Настройте размер сетки", + "InitialSetupPickAllPluginsYouNeed": "Выберите необходимые плагины", + "InitialSetupDontWorryInstallUninstallPlugins": "Не волнуйтесь, вы можете устанавливать и удалять плагины в менеджере пакетов", + "InitialSetupWantSomeIcons": "Хотите установить пакеты иконок?", + "InitialSetupInstallIconPacksPackageManager": "Вы также сможете устанавливать пакеты иконок в менеджере пакетов", + "InitialSetupAlmostDone": "Настройка почти завершена!", + "KnownDevices": "Устройства управления", + "AskOnNewConnections": "Запрашивать подтверждение при новом подключении", + "AllowAllNewConnections": "Разрешить все новые подключения (не рекомендуется)", + "BlockAllNewConnections": "Блокировать все новые подключения", + "InstallDLL": "Установка .dll(не рекомендуется)", + "NeverInstallDLLFiles": "Не устанавливайте .dll файлы из источников, которым вы не доверяете! .dll файлы из неизвестных источников могут нанести вред вашему компьютеру! Устанавливайте их только тогда, когда осознаете, что делаете! Вы уверены, что хотите установить .dll плагин?", + "XWillBeUninstalled": "{0} будет удалён.", + "XSuccessfullyUninstalled": "{0} успешно удален. Macro Deck требуется перезагрузка для применения изменений. Перезагрузить сейчас?", + "CreateVariable": "Новая переменная", + "DeleteVariable": "Удалить переменную", + "SelectAPluginAndActionToBegin": "Выберите плагин и действие для начала", + "ActionNeedsNoConfiguration": "Это действие не требует настройки", + "CantCreateFolder": "Не удалось создать папку", + "FolderCalledXAlreadyExists": "Папка {0} уже существует", + "OnPress": "При нажатии", + "OnEvent": "При событии", + "CantCreateIconPack": "Не удалось создать пакет иконок", + "IconPackCalledXAlreadyExists": "Пакет иконок {0} уже существует", + "CantCreateProfile": "Не удалось создать профиль", + "ProfileCalledXAlreadyExists": "Профиль {0} уже существует", + "TheresAnUpdateForYou": "Новое обновление :)", + "VersionXIsNowAvailable": "Версия {0} ({1}) доступна", + "ReadyToDownloadUpdate": "Подготовка загрузки обновления", + "DownloadingUpdate": "Загрузка обновления... {0}% ({1}MB/{2}MB)", + "VerifyingUpdateFile": "Проверка загруженного файла...", + "MD5NotValid": "Контрольная сумма MD5 неверна", + "StartingInstaller": "Запуск установки", + "FileNotFound": "Файл не найден", + "TryAgainOrDownloadManually": "Повторите попытку или загрузите обновление вручную", + "Trending": "Популярные", + "Layers": "Слои", + "AddImage": "Изображение", + "IconImportQualityInfo": "Высокое качество изображеений может увеличить потребление памяти и время загрузки, особенно при большом количестве анимированных изображений.\n\n\nДля анимированных изображений рекомендуется использовать низкое или самое низкое качество.", + "Original": "Оригинальное", + "High350px": "Высокое (350px)", + "Normal200px": "Нормальное (200px)", + "Low150px": "Низкое (150px)", + "Lowest100px": "Самое низкое (100px)", + "ImportIconPack": "Импорт пакета", + "ExportIconPack": "Экспорт пакета", + "CreateIcon": "Создать", + "ImportIcon": "Импортировать", + "DeleteIcon": "Удалить", + "IconSelectorManagedInfo": "Этот пакет иконок поддерживается менеджером пакетов", + "DownloadingXPackages": "Загрузка {0} пакетов", + "PluginCouldNotBeLoaded": "Плагин не может быть запущен. Версия установленного плагина несовместима с этой версией Macro Deck.", + "CantChangeName": "Не удалось изменить имя", + "DeviceCalledXAlreadyExists": "Устройство {0} уже существует", + "NewConnection": "Новое соединение", + "XIsAnUnknownDevice": "{0} является неизвестным устройством. Разрешить подключение?", + "ShouldMacroDeckBlockConnectionsFromX": "Автоматически блокировать подключения от устройства {0} ?", + "FailedToStartServer": "Не удается запустить сервер. Возможно, выбранный порт используется или вы выбрали не тот сетевой адаптер. Убедитесь, что установлен правильный сетевой адаптер в настройках или попробуйте изменить порт.", + "ErrorWhileLoadingPlugins": "Ошибка загрузки плагинов", + "PluginXCouldNotBeLoaded": "{0} версия {1} не может быть загружена. Возможно, она несовместима с этой версией Macro Deck. Плагин не будет работать, пока не будет обновлен.", + "InstallationSuccessfull": "Установка прошла успешно", + "PluginXInstalledSuccessfully": "{0} успешно установлен", + "ErrorWhileInstallingPlugin": "Ошибка при установке плагина", + "PluginXCouldNotBeInstalled": "{0} не может быть установлен. Возможно, он несовместим с этой версией Macro Deck", + "Settings": "Настройки", + "Language": "Язык", + "General": "Общие", + "Connection": "Подключение", + "Backup": "Резервная копия", + "About": "О программе", + "NoUpdatesAvailable": "Нет доступных обновлений", + "LatestVersionInstalled": "Последняя версия уже установлена", + "WarningDevVersions": "Ипользование Dev версий может быть нестабильным и привести к потере данных (настроек кнопок, папок и профилей). Вы уверены, что хотите переключиться на Dev канал обновлений?", + "WarningBetaVersions": "Ипользование Beta версий может быть нестабильным. Вы уверены, что хотите переключиться на Beta канал обновлений?", + "VariableXGetsDeleted": "Переменная {0} удалена", + "DeckTitle": "Главная", + "DeviceManagerTitle": "Менеджер устройств", + "PackageManagerTitle": "Менеджер пакетов", + "SettingsTitle": "Настройки", + "VariablesTitle": "Общие переменные", + "Edit": "Изменить", + "Delete": "Удалить", + "Run": "Запустить", + "Copy": "Копировать", + "Paste": "Вставить", + "WebSocketAPIVersion": "Версия Websocket API", + "PluginAPIVersion": "Версия API плагинов", + "InstalledPlugins": "Установленные плагины", + "OperatingSystem": "Операционная система", + "DevelopedByX": "Разработано {0} ", + "XTranslationByX": "{0} перевод {1}", + "PackageManagerTabAvailable": "Доступны", + "PackageManagerTabInstalled": "Установлены", + "Event": "Событие", + "AutomaticallySwitchToFolder": "Переключаться на эту папку", + "Restart": "Перезапустить Macro Deck", + "Delay": "Задержка", + "If": "Если", + "Else": "Иначе", + "Online": "Доступные", + "By": "Автор", + "StateBinding": "Привязать статус к переменной", + "ErrorWhileLoadingPackageManager": "Произошла ошибка во время загрузки менеджера пакетов. Возможно вы не подключены к сети интернет или Macro Deck заблокирован вашим брандмауэром.", + "UpdatesAvailable": "Доступны обновления", + "EnableIconCache": "Включить кэширование иконок (быстрее; больше потребление памяти)", + "WebClient": "Веб-клиент", + "AndroidApp": "Android клиент", + "IOSApp": "iOS клиент", + "PluginMacroDeckFolder": "Папки Macro Deck", + "ActionChangeFolder": "Сменить папку", + "ActionChangeFolderDescription": "Сменить текущую папку для текущего устройства на указанную папку", + "ActionGoToParentFolder": "Перейти в родительскую папку", + "ActionGoToParentFolderDescription": "Сменить текущую папку для текущего устройства на родительскую папку", + "ActionGoToRootFolder": "Перейти в корневую папку", + "ActionGoToRootFolderDescription": "Сменить текущую папку для текущего устройства на корневую папку", + "PluginMacroDeckVariables": "Переменные Macro Deck", + "ActionChangeVariableValue": "Изменить значение переменной", + "ActionChangeVariableValueDescription": "Увеличить, уменьшить, изменить или инвертировать переменную", + "CountUp": "Увеличить", + "CountDown": "Уменьшить", + "Set": "Изменить", + "Toggle": "Инвертировать", + "Variable": "Переменная", + "PluginActionButton": "Кнопка действия", + "ActionToggleActionButtonState": "Переключить статус кнопки", + "ActionToggleActionButtonStateDescription": "Переключить статус этой кнопки", + "ActionSetActionButtonStateOff": "Изменить статус на выкл.", + "ActionSetActionButtonStateOffDescription": "Изменить статус этой кнопки на \"выключена\"", + "ActionSetActionButtonStateOn": "Изменить статус на вкл.", + "ActionSetActionButtonStateOnDescription": "Изменить статус этой кнопки на \"включена\"", + "Description": "Описание", + "License": "Лицензия", + "AnimatedGifImported": "Анимированный GIF импортирован", + "GenerateStaticIcon": "Сгенерировать дополнительную статичную иконку на основе первого кадра GIF?", + "XSuccessfullyExportedToX": "{0} успешно экспортирована в {1}", + "SelectedIconWillBeDeleted": "Выбранная иконка будет удалена из пакета иконок {0}", + "SuccessfullyImportedIconPack": "Пакет иконок {0} успешно импортирован", + "SelectedIconPackWillBeDeleted": "Пакет иконок {0} со всем его содержимым будет удалён.", + "GenerateStatic": "Статичная иконка", + "OnlyUserCreatedVariablesVisible": "Видны только переменные, созданные пользователем", + "MacroDeckUsesCottleTemplateEngine": "Macro Deck использует .NET шаблонизатор Cottle. Нажмите здесь для получения дополнительной информации.", + "Result": "Результат", + "InstallDevVersions": "Устанавливать Dev версии", + "InstallBetaVersions": "Устанавливать Beta версии", + "WhatDoYouWantToRestore": "Что необходимо восстановить из резервной копии?", + "Configuration": "Настройки", + "Profiles": "Профили", + "Variables": "Переменные", + "PluginConfigurations": "Настройки плагинов", + "PluginCredentials": "Учётные данные плагинов", + "InstalledIconPacks": "Установленные пакеты иконок", + "Restore": "Восстановить", + "ActionCannotBeReversed": "Это действие не может быть отменено", + "ThisWillDeleteBackupPermanently": "Это действие приведёт к удалению резервной копии", + "Created": "Создан", + "PleaseWait": "Пожалуйста, подождите...", + "Backups": "Резервные копии", + "CreateBackup": "Создать резервную копию", + "BackupFailed": "Не удалось создать резервную копию", + "BackupSuccessfullyCreated": "Резервная копия создана успешно", + "CreateBackupBeforeUpdate": "Создать резервную копию перед обновлением?", + "CreatingBackup": "Создание копии...", + "PluginNeedsConfiguration": "Этот плагин необходимо настроить", + "ConfigureNow": "Настроить плагин {0} прямо сейчас?", + "Hotkey": "Горячая клавиша", + "PressTheKeysNow": "Нажмите желаемые клавиши для привязки", + "XAction": "Действий: {0}", + "XActions": "Действий: {0}", + "OnRelease": "После нажатия", + "OnLongPress": "При длительном нажатии", + "OnLongPressRelease": "После длительного нажатия", + "SimulateOnPress": "Симулировать \"При нажатии\"", + "SimulateOnRelease": "Симулировать \"После нажатия\"", + "SimulateOnLongPress": "Симулировать \"Длительное нажатие\"", + "SimulateOnLongPressRelease": "Симулировать \"После длительного нажатия\"", + "HotkeyExecutesOnPress": "Горячая клавиша активирует действие \"При нажатии\"", + "Important": "Внимание", + "FirewallAlertInfo": "После запуска Macro Deck должно появиться окно предупреждения брандмауэра Windows Defender.\nПожалуйста, установите соответствующие флажки (Частные сети, Общедоступные сети, или сеть Домена).\n\nЕсли это диалоговое окно не появилось, и вы не можете подключиться с других устройств, обратитесь к базе знаний.", + "GotIt": "Понятно", + "DeviceSettings": "Настройки устройства", + "Brightness": "Яркость", + "AutoConnect": "Подключаться автоматически", + "DiscordSupport": "Discord канал", + "Wiki": "База знаний", + "ExportLatestLog": "Экспортировать текущий журнал", + "LogSuccessfullyExportedToX": "Журнал экспортирован в {0}", + "Help": "Помощь", + "XWarningsXErrors": "Предупреждений: {0}, ошибок: {1}", + "TrimBlankLines": "Удалять пустые строки", + "Extensions": "Расширения", + "InstallFromFile": "Установить из файла", + "AllExtensionsUpToDate": "Все расширения обновлены", + "UpdateAll": "Обновить все", + "UpdateAvailable": "Доступно обновление", + "PendingRestart": "Ожидается перезапуск", + "Enabled": "Включено", + "Disabled": "Отключено", + "ActionSaveVariableToFile": "Сохранить переменную в файл", + "ActionSaveVariableToFileDescription": "Сохранить значение переменной в файл", + "Folders": "Папки", + "Grid": "Сетка", + "ActionReadVariableFromFile": "Читать переменную из файла", + "ActionReadVariableFromFileDescription": "Читает файл и устанавливает содержимое как значение для переменной", + "ActionSetProfile": "Set profile", + "ActionSetProfileDescription": "Sets the profile on a device", + "Device": "Device", + "WhereExecuted": "Where executed", + "ActionSetBrightness": "Set brightness", + "ActionSetBrightnessDescription": "Sets the display brightness (Only on the Android app!)", + "BindableVariable": "Bindable variable", + "BindableVariableInfo": "The state of this button can be bound to the variable {0}. Do you want to bind the state?", + "Cancelled": "Cancelled", + "Preparing": "Preparing...", + "Installing": "Installing...", + "Completed": "Completed", + "ExtensionStoreDownloaderPackageIdVersion": "{0} version {1}", + "DownloadingAndInstallingXPackages": "Downloading and installing {0} package(s)", + "InstallationOfXPackagesDone": "Installation of {0} package(s) done", + "ActionSetBackgroundColor": "Set background color", + "ActionSetBackgroundColorDescription": "Changes the background color of a action button", + "Fixed": "Fixed", + "Random": "Random" +======= "__Language__": "Russian", "__LanguageCode__": "ru", "__Author__": "LeetPanda1337, zedalert", @@ -301,4 +624,5 @@ "Grid": "Сетка", "ActionReadVariableFromFile": "Читать переменную из файла", "ActionReadVariableFromFileDescription": "Читает файл и устанавливает содержимое как значение для переменной" +>>>>>>> origin/main } \ No newline at end of file diff --git a/Resources/Languages/Spanish.json b/Resources/Languages/Spanish.json index 524f6455..302bf66e 100644 --- a/Resources/Languages/Spanish.json +++ b/Resources/Languages/Spanish.json @@ -1,4 +1,327 @@ { +<<<<<<< HEAD + "__Language__": "Spanish", + "__LanguageCode__": "es", + "__Author__": "l69l_Anthony", + "NetworkAdapter": "Adaptador de red", + "IPAddress": "Dirección IP", + "Port": "Puerto", + "Info": "Información", + "Error": "Error", + "Warning": "Advertencia", + "ConfigureNetworkInfo": "Es muy importante que se establezca el adaptador de red correcto, de lo contrario no se puede establecer ninguna conexión con el servidor. En la mayoría de los casos, el adaptador de red se llama \"Ethernet\" o \"WLAN\" y la dirección IP suele ser \"192.168.1.xxx\".\n\nEl puerto estándar para Macro Deck es 8191. Si otras aplicaciones ya están usando este puerto, debe cambiarse.", + "AutomaticallyCheckUpdates": "Revisar actualizaciones automaticamente", + "AutomaticallyStartWithWindows": "Iniciar automáticamente con Windows", + "Show": "Configurar Macro Deck", + "Exit": "Salir de Macro Deck", + "XUpdatesAvailable": "{0} Actualizaciones disponibles", + "Profile": "Perfil", + "Columns": "Columnas", + "Rows": "Filas", + "Spacing": "Espaciado", + "CornerRadius": "Radio de esquina", + "ButtonBackGround": "Fondo de botón", + "AreYouSure": "¿Seguro?", + "Behaviour": "Comportamiento", + "Plugins": "Plugins", + "IconPacks": "Paquete de iconos", + "All": "Todos", + "Updates": "Actualizaciones", + "Installed": "Instalado", + "Install": "Instalar", + "Search": "Buscar...", + "Name": "Nombre", + "Type": "Tipo", + "Value": "Valor", + "Creator": "Creado por", + "Ok": "Ok", + "FolderName": "Nombre de carpeta", + "Never": "Nunca", + "OnApplicationFocus": "Cuando la aplicación está enfocada", + "Application": "Aplicación", + "Devices": "Dispositivos", + "Create": "Crear", + "Save": "Guardar", + "Appearance": "Apariencia", + "ButtonState": "Estado del botón", + "Label": "Nombre", + "Top": "Encima", + "Center": "Centrado", + "Bottom": "Debajo", + "Path": "Ruta", + "CurrentState": "Estado actual", + "Off": "Apagado", + "On": "Encendido", + "DownloadAndInstall": "Descargar e instalar", + "Downloading": "Descargar...", + "Color": "Color", + "IconPack": "Paquete de Iconos", + "Size": "Tamaño", + "CurrentProgress": "Progreso actual", + "TotalProgress": "Progreso general", + "XDownloads": "{0} Descargas", + "Update": "Actualizar", + "Plugin": "Plugin", + "MacroDeckNeedsARestart": "Es necesario reiniciar Macro Deck", + "MacroDeckMustBeRestartedForTheChanges": "Es necesario reiniciar Macro Deck.¿Reiniciar ahora?", + "Configure": "Configurar", + "Uninstall": "Desinstalar", + "NotLoaded": "Sin cargar", + "Yes": "Sí", + "No": "No", + "Status": "Estado", + "BlockConnection": "Bloquear conexión", + "Change": "Cambio", + "Id": "ID", + "Connected": "Conectado", + "Disconnected": "Desconectado", + "Trigger": "Desencadenar", + "Action": "Acción", + "Condition": "Condición", + "InstalledVersion": "Versión instalada", + "UpdateChannel": "Canal de actualización", + "CheckForUpdatesNow": "Buscar actualizaciones", + "Author": "Autor", + "Version": "Versión", + "TheFolderWillBeDeleted": "Se eliminará la carpeta {0} con todas las claves configuradas.", + "TheProfileWillBeDeleted": "Se eliminará el perfil {0} con todas las carpetas y claves.", + "ServerOffline": "Servidor fuera de linea", + "ServerRunning": "El servidor se está ejecutando", + "XPluginsLoaded": "{0} plugins activos", + "XPluginsDisabled": "{0} plugins desactivados", + "XClientsConnected": "{0} Dispositivos conectados", + "IpAddressHostNamePort": "Dirección IP/nombre de host: Puerto", + "InitialSetupButtonBack": "<- Anterior", + "InitialSetupButtonNext": "Siguiente ->", + "InitialSetupButtonFinish": "Finalizar", + "InitialSetupSelectLanguage": "Seleccione un idioma", + "InitialSetupPage": "Pagina {0}/{1}", + "InitialSetupWelcome": "¡Bienvenido a Macro Deck 2!", + "InitialSetupLetsConfigure": "Configuremos algunas cosas", + "InitialSetupConfigureNetworkSettings": "Configure sus ajustes de red", + "InitialSetupConfigureGridPreferences": "Ahora configuremos la cuadrícula según sus preferencias.", + "InitialSetupPickAllPluginsYouNeed": "Elija todos los plugins que necesita", + "InitialSetupDontWorryInstallUninstallPlugins": "No se preocupe, siempre puede instalar/desinstalar plugins más tarde en el administrador de paquetes", + "InitialSetupWantSomeIcons": "¿Quieres algunos iconos?", + "InitialSetupInstallIconPacksPackageManager": "También puede instalar paquetes de íconos más tarde en el administrador de paquetes", + "InitialSetupAlmostDone": "¡Estamos a punto de empezar!", + "KnownDevices": "Dispositivos conocidos", + "AskOnNewConnections": "Preguntar sobre nuevas conexiones", + "AllowAllNewConnections": "Permitir todas las conexiones (no recomendado)", + "BlockAllNewConnections": "Bloquear todas las conexiones nuevas", + "InstallDLL": "Instalar .dll (no recomendado)", + "NeverInstallDLLFiles": "¡Nunca instale archivos .dll de fuentes en las que no confíe! Los archivos .dll de fuentes desconocidas pueden dañar su sistema, ¡solo instálelos cuando sepa lo que hace! ¿Realmente desea instalar un complemento .dll?", + "XWillBeUninstalled": "{0} será desinstalado.", + "XSuccessfullyUninstalled": "{0} está desinstalado. Es necesario reiniciar Macro Deck. ¿Reinicia ahora?", + "CreateVariable": "Crear variable", + "DeleteVariable": "Eliminar variable", + "SelectAPluginAndActionToBegin": "Seleccione el plugin y la acción para comenzar", + "ActionNeedsNoConfiguration": "Esta acción no requiere ninguna configuración", + "CantCreateFolder": "No se puede crear la carpeta", + "FolderCalledXAlreadyExists": "Ya existe una carpeta llamada \"{0}\"", + "OnPress": "Al presionar", + "OnEvent": "En caso de un evento", + "CantCreateIconPack": "No se puede crear el paquete de iconos", + "IconPackCalledXAlreadyExists": "Ya existe un paquete de iconos con el nombre {0}", + "CantCreateProfile": "No se puede crear el perfil", + "ProfileCalledXAlreadyExists": "Ya existe un perfil con el nombre {0}", + "TheresAnUpdateForYou": "Nueva actualización disponible :)", + "VersionXIsNowAvailable": "Ya se puede descargar la versión {0} ({1})", + "ReadyToDownloadUpdate": "Listo para descargar la actualización", + "DownloadingUpdate": "Descargando ... {0}% ({1} MB/{2} MB) ", + "VerifyingUpdateFile": "El archivo está verificado...", + "MD5NotValid": "La suma de comprobación MD5 no es válida", + "StartingInstaller": "El instalador comenzará", + "FileNotFound": "Archivo no encontrado", + "TryAgainOrDownloadManually": "Vuelva a intentarlo o instálelo manualmente", + "Trending": "Tendencias", + "Layers": "Niveles", + "AddImage": "Añadir imagen", + "IconImportQualityInfo": "Los íconos de alta calidad pueden conducir a un aumento en el uso de la memoria y los tiempos de carga, especialmente cuando se usan muchos gifs animados grandes.\n\n\nPara los gifs, se recomienda utilizar el ajuste preestablecido bajo o más bajo.", + "Original": "Original", + "High350px": "Alto (350px)", + "Normal200px": "Normal (200px)", + "Low150px": "Bajo (150px)", + "Lowest100px": "Más bajo (100px)", + "ImportIconPack": "Importar paquete de iconos", + "ExportIconPack": "Exportar paquete de iconos", + "CreateIcon": "Crear icono", + "ImportIcon": "Importar icono", + "DeleteIcon": "Eliminar icono", + "IconSelectorManagedInfo": "Este paquete de iconos es administrado por el administrador de plugins.", + "DownloadingXPackages": "{0} Descarga de paquetes", + "PluginCouldNotBeLoaded": "No se pudo cargar el plugin. Es posible que la versión del plugin no sea compatible con esta versión de Macro Deck.", + "CantChangeName": "No se pudo cambiar el nombre", + "DeviceCalledXAlreadyExists": "Ya existe un dispositivo con el nombre {0}", + "NewConnection": "Nueva conexión", + "XIsAnUnknownDevice": "{0} es un dispositivo desconocido. ¿Permitir la conexión? ", + "ShouldMacroDeckBlockConnectionsFromX": "¿Deberían bloquearse siempre los intentos de conexión de {0}? ", + "FailedToStartServer": "No se pudo iniciar el servidor. Quizás el puerto configurado ya está en uso o configuró el adaptador de red incorrecto. Confirme que configuró el adaptador de red correcto en la configuración e intente cambiar el puerto.", + "ErrorWhileLoadingPlugins": "Error al cargar plugins", + "PluginXCouldNotBeLoaded": "No se pudo cargar {0} versión {1}. Tal vez no sea compatible con esta versión de Macro Deck. Las acciones que utilizan este complemento no funcionarán hasta que se actualice el complemento.", + "InstallationSuccessfull": "Instalación exitosa", + "PluginXInstalledSuccessfully": "{0} se ha instalado", + "ErrorWhileInstallingPlugin": "Error al instalar el plugin", + "PluginXCouldNotBeInstalled": "No se pudo instalar {0}. Es posible que la versión no sea compatible.", + "Settings": "Ajustes", + "Language": "Idioma", + "General": "General", + "Connection": "Conexión", + "Backup": "Backup", + "About": "Sobre", + "NoUpdatesAvailable": "No hay actualizaciones disponibles", + "LatestVersionInstalled": "La última versión ya está instalada.", + "WarningDevVersions": "Las versiones para desarrolladores pueden ser muy inestables y causar pérdida de datos dentro de Macro Deck (botones, carpetas y perfiles configurados). ¿Cambiar al canal de actualización de desarrolladores? ", + "WarningBetaVersions": "Las versiones beta pueden ser inestables. ¿Cambiar al canal de actualización beta? ", + "VariableXGetsDeleted": "Se elimina la variable {0}", + "DeckTitle": "Plataforma", + "DeviceManagerTitle": "Administrador de dispositivos", + "PackageManagerTitle": "Administrador de paquetes", + "SettingsTitle": "Ajustes", + "VariablesTitle": "Variables globales", + "Edit": "Editar", + "Delete": "Eliminar", + "Run": "Ejecutar", + "Copy": "Copiar", + "Paste": "Pegar", + "WebSocketAPIVersion": "Versión de API de Websocket", + "PluginAPIVersion": "Versión de la API del plugin", + "InstalledPlugins": "Plugins instalados", + "OperatingSystem": "Sistema operativo", + "DevelopedByX": "Desarrollado por {0} en Alemania", + "XTranslationByX": "Traduccido al Español por {1}", + "PackageManagerTabAvailable": "Disponible", + "PackageManagerTabInstalled": "Instalado", + "Event": "Evento", + "AutomaticallySwitchToFolder": "Cambiar automáticamente a la carpeta", + "Restart": "Reiniciar Macro Deck", + "Delay": "Delay", + "If": "Si", + "Else": "En caso contrario", + "Online": "En línea", + "By": "By", + "StateBinding": "Vincular estado a", + "ErrorWhileLoadingPackageManager": "Error al cargar el administrador de paquetes. Quizás no esté conectado a Internet o su firewall bloquee Macro Deck.", + "UpdatesAvailable": "Actualizaciones disponibles", + "EnableIconCache": "Habilitar la caché de iconos (más rápido; mayor uso de memoria)", + "WebClient": "Cliente Web", + "AndroidApp": "Android App", + "IOSApp": "iOS App", + "PluginMacroDeckFolder": "Carpeta Macro Deck", + "ActionChangeFolder": "Ir a la carpeta seleccionada", + "ActionChangeFolderDescription": "Cambiar la carpeta actual en el dispositivo actual a la carpeta configurada", + "ActionGoToParentFolder": "Ir a la carpeta principal", + "ActionGoToParentFolderDescription": "Cambie la carpeta actual en el dispositivo actual a la carpeta principal de carpetas", + "ActionGoToRootFolder": "Ir a la carpeta raíz", + "ActionGoToRootFolderDescription": "Cambie la carpeta actual en el dispositivo actual a la carpeta raíz", + "PluginMacroDeckVariables": "Variables de Macro Deck", + "ActionChangeVariableValue": "Cambiar el valor de la variable", + "ActionChangeVariableValueDescription": "Cuente hasta, cuente hacia atrás, establezca un valor de variable y cambie el valor de la variable", + "CountUp": "Contar hasta", + "CountDown": "Cuenta atrás", + "Set": "Colocar", + "Toggle": "Interruptor", + "Variable": "Variable", + "PluginActionButton": "Acción de botón", + "ActionToggleActionButtonState": "Cambiar estado del interruptor", + "ActionToggleActionButtonStateDescription": "Cambia el estado de este botón a \"interruptor\"", + "ActionSetActionButtonStateOff": "Establecer en \"apagado\"", + "ActionSetActionButtonStateOffDescription": "Establece el estado de este botón como \"apagado\"", + "ActionSetActionButtonStateOn": "Establecer en \"encendido\"", + "ActionSetActionButtonStateOnDescription": "Establece el estado de este botón como \"encendido\"", + "Description": "Descripción", + "License": "Licencia", + "AnimatedGifImported": "GIF animado importado", + "GenerateStaticIcon": "¿Generar también un icono estático del primer fotograma de los GIF?", + "XSuccessfullyExportedToX": "{0} se exportó con éxito a {1}", + "SelectedIconWillBeDeleted": "El icono seleccionado se eliminará del paquete de iconos {0}", + "SuccessfullyImportedIconPack": "Se importó con éxito el paquete de iconos {0}", + "SelectedIconPackWillBeDeleted": "Se eliminará el paquete de iconos {0} con todos sus iconos.", + "GenerateStatic": "Generar estática", + "OnlyUserCreatedVariablesVisible": "Solo las variables creadas por el usuario son visibles", + "MacroDeckUsesCottleTemplateEngine": "Macro Deck utiliza el motor de plantillas Cottle. Haga clic aquí para más información.", + "Result": "Resultado", + "InstallDevVersions": "Instalar versiones Dev", + "InstallBetaVersions": "Instalar versiones Beta", + "WhatDoYouWantToRestore": "¿Qué desea restaurar desde la copia de seguridad?", + "Configuration": "Configuración", + "Profiles": "Perfiles", + "Variables": "Variables", + "PluginConfigurations": "Configuraciones de los Plugin", + "PluginCredentials": "Credenciales de los Plugin", + "InstalledIconPacks": "Paquetes de iconos instalados", + "Restore": "Restaurar", + "ActionCannotBeReversed": "Esta acción no se puede revertir", + "ThisWillDeleteBackupPermanently": "Esto eliminará la copia de seguridad de forma permanente", + "Created": "Creado", + "PleaseWait": "Espere por favor...", + "Backups": "Copias de seguridad", + "CreateBackup": "Crear copia de seguridad", + "BackupFailed": "Error de copia de seguridad", + "BackupSuccessfullyCreated": "Copia de seguridad creada con éxito", + "CreateBackupBeforeUpdate": "¿Quieres crear una copia de seguridad antes de la actualización?", + "CreatingBackup": "Creando copia de seguridad ...", + "PluginNeedsConfiguration": "Este plugin debe configurarse", + "ConfigureNow": "¿Quieres configurar {0} ahora?", + "Hotkey": "Tecla de acceso rápido", + "PressTheKeysNow": "Presione las teclas que desea asignar ahora", + "XAction": "{0} acción", + "XActions": "{0} acciones", + "OnRelease": "Al soltar", + "OnLongPress": "Pulsación larga", + "OnLongPressRelease": "Al soltar la pulsación larga", + "SimulateOnPress": "Simular \"pulsación\"", + "SimulateOnRelease": "Simular \"Lanzamiento\"", + "SimulateOnLongPress": "Simular \"pulsación larga\"", + "SimulateOnLongPressRelease": "Simular \"Lanzamiento con pulsación larga\"", + "HotkeyExecutesOnPress": "La tecla de acceso rápido ejecuta las acciones \"pulsación\" cuando se presiona", + "Important": "Importante", + "FirewallAlertInfo": "Después de iniciar Macro Deck, aparecerá un cuadro de diálogo del Firewall de Windows Defender.\nMarque todas las casillas (Redes privadas, Redes públicas y, si existe, Redes de dominio).\n\nSi este cuadro de diálogo no aparece y aún experimenta problemas de conexión, visite la wiki o el servidor de discord para obtener ayuda. ", + "GotIt": "¡Entendido!", + "DeviceSettings": "Configuración de dispositivo", + "Brightness": "Brillo", + "AutoConnect": "‎Conéctese automáticamente‎\n", + "DiscordSupport": "Soporte de Discord", + "Wiki": "Wiki", + "ExportLatestLog": "Exportar último registro", + "LogSuccessfullyExportedToX": "Registro exportado con éxito a {0}", + "Help": "Ayuda", + "XWarningsXErrors": "{0} alerta(s), {1} error(es)", + "TrimBlankLines": "‎Recortar líneas en blanco‎", + "Extensions": "Extensiones", + "InstallFromFile": "‎Instalar desde archivo‎", + "AllExtensionsUpToDate": "Todas las extensiones están actualizadas", + "UpdateAll": "Actualizar todo", + "UpdateAvailable": "Actualización disponible", + "PendingRestart": "Pendiente de reinicio", + "Enabled": "Habilitado", + "Disabled": "Deshabilitado", + "ActionSaveVariableToFile": "Guardar variable en archivo", + "ActionSaveVariableToFileDescription": "Guarda el valor de la variable en un archivo", + "Folders": "Carpetas", + "Grid": "Cuadrícula", + "ActionReadVariableFromFile": "Leer variable del archivo", + "ActionReadVariableFromFileDescription": "Lee un archivo y establece el contenido como valor para una variable", + "ActionSetProfile": "Set profile", + "ActionSetProfileDescription": "Sets the profile on a device", + "Device": "Device", + "WhereExecuted": "Where executed", + "ActionSetBrightness": "Set brightness", + "ActionSetBrightnessDescription": "Sets the display brightness (Only on the Android app!)", + "BindableVariable": "Bindable variable", + "BindableVariableInfo": "The state of this button can be bound to the variable {0}. Do you want to bind the state?", + "Cancelled": "Cancelled", + "Preparing": "Preparing...", + "Installing": "Installing...", + "Completed": "Completed", + "ExtensionStoreDownloaderPackageIdVersion": "{0} version {1}", + "DownloadingAndInstallingXPackages": "Downloading and installing {0} package(s)", + "InstallationOfXPackagesDone": "Installation of {0} package(s) done", + "ActionSetBackgroundColor": "Set background color", + "ActionSetBackgroundColorDescription": "Changes the background color of a action button", + "Fixed": "Fixed", + "Random": "Random" +======= "__Language__": "Spanish", "__LanguageCode__": "Es", "__Author__": "danivar", @@ -301,4 +624,5 @@ "Grid": "Cuadrícula", "ActionReadVariableFromFile": "Leer variable del archivo", "ActionReadVariableFromFileDescription": "Lee un archivo y establece el contenido como valor para una variable" +>>>>>>> origin/main } \ No newline at end of file diff --git a/Resources/Languages/Turkish.json b/Resources/Languages/Turkish.json index 86262d3d..732f9fdd 100644 --- a/Resources/Languages/Turkish.json +++ b/Resources/Languages/Turkish.json @@ -1,4 +1,327 @@ { +<<<<<<< HEAD + "__Language__": "Turkish", + "__LanguageCode__": "tr", + "__Author__": "Tuna Karakaşoğlu | twitch.tv/DunyaninEnKotuOyuncusu", + "NetworkAdapter": "Ağ adaptörü", + "IPAddress": "IP adresi", + "Port": "Port", + "Info": "Bilgi", + "Error": "Hata", + "Warning": "Uyarı", + "ConfigureNetworkInfo": "Doğru ağ adaptörünü seçmeniz çok önemlidir. Seçmemeniz durumunda client ve serverı birbirine bağlayamayabilirsiniz. Çoğu durumda Ağ adaptörünün ismi \"Ethernet\" veya \"Wi-Fi\" olmaktadır. Genellikle IP adresi \"192.168.178.xxx\" türevidir.\n\nMacro Deck'in varsayılan portu: 8191. Eğer başka bir uygulama bu portu kullanıyorsa, bu port tanımını değiştirebilirsiniz.", + "AutomaticallyCheckUpdates": "Güncellemeleri otomatik denetle", + "AutomaticallyStartWithWindows": "Windows başlangıcında otomatik başlat", + "Show": "Macro Deck'i ayarla", + "Exit": "Macro Deck'ten çık", + "XUpdatesAvailable": "{0} güncelleştirme mevcut", + "Profile": "Profil", + "Columns": "Kolonlar", + "Rows": "Satırlar", + "Spacing": "Aralık", + "CornerRadius": "Köşe yuvarlatma", + "ButtonBackGround": "Buton arkaplanı", + "AreYouSure": "Emin misiniz?", + "Behaviour": "Davranış", + "Plugins": "Pluginler", + "IconPacks": "Ikon paketleri", + "All": "Hepsi", + "Updates": "Güncelleştirmeler", + "Installed": "Yüklendi", + "Install": "Yükle", + "Search": "Ara...", + "Name": "İsim", + "Type": "Tip", + "Value": "Değer", + "Creator": "Sahip", + "Ok": "Tamam", + "FolderName": "Klasör ismi", + "Never": "Asla", + "OnApplicationFocus": "Uygulamaya odaklanıldığında", + "Application": "Uygulama", + "Devices": "Cihazlar", + "Create": "Oluştur", + "Save": "Kaydet", + "Appearance": "Arayüz", + "ButtonState": "Buton durumu", + "Label": "Etiket", + "Top": "Üst", + "Center": "Orta", + "Bottom": "Alt", + "Path": "Yol", + "CurrentState": "Şu anki durum", + "Off": "Kapalı", + "On": "Açık", + "DownloadAndInstall": "İndir ve yükle", + "Downloading": "İndiriliyor...", + "Color": "Renk", + "IconPack": "Ikon paketi", + "Size": "Boyut", + "CurrentProgress": "Şu anki ilerleme", + "TotalProgress": "Toplam ilerleme", + "XDownloads": "{0} indirme", + "Update": "Güncelleştirme", + "Plugin": "Plugin", + "MacroDeckNeedsARestart": "Macro Deck yeniden başlatılmalı", + "MacroDeckMustBeRestartedForTheChanges": "Değişiklerin uygulanabilmesi için Macro Deck yeniden başlatılmalı. Macro Deck'i şimdi yeniden başlatmak istiyor musunuz?", + "Configure": "Ayarla", + "Uninstall": "Kurulumu kaldır", + "NotLoaded": "Yüklenmemiş", + "Yes": "Evet", + "No": "Hayır", + "Status": "Durum", + "BlockConnection": "Blok bağlantı", + "Change": "Değiştir", + "Id": "ID", + "Connected": "Bağlandı", + "Disconnected": "Bağlantı kesildi", + "Trigger": "Tetik", + "Action": "Aksiyon", + "Condition": "Durum", + "InstalledVersion": "Yüklü versiyon", + "UpdateChannel": "Kanalı güncelle", + "CheckForUpdatesNow": "Güncelleştirmeleri şimdi kontrol et", + "Author": "Eser Sahibi", + "Version": "Versiyon", + "TheFolderWillBeDeleted": "{0} klasörü, içerisindeki tüm aksiyon butonlarıyla beraber silinecektir.", + "TheProfileWillBeDeleted": "{0} profili, içerisindeki tüm klasörler ve aksiyon butonlarıyla beraber silinecektir.", + "ServerOffline": "Sunucu çevrimdışı", + "ServerRunning": "Sunucu çalışıyor", + "XPluginsLoaded": "{0} plugin yüklendi", + "XPluginsDisabled": "{0} plugin devredışı", + "XClientsConnected": "{0} client bağlandı", + "IpAddressHostNamePort": "IP adresi/hostname : Port", + "InitialSetupButtonBack": "<- Önceki", + "InitialSetupButtonNext": "Sonraki ->", + "InitialSetupButtonFinish": "Bitir", + "InitialSetupSelectLanguage": "Dil seçimi yapınız", + "InitialSetupPage": "Sayfa {0}/{1}", + "InitialSetupWelcome": "Macro Deck 2'ye Hoşgeldiniz!", + "InitialSetupLetsConfigure": "Şimdi Macro Deck ayarlarınızı yapalım", + "InitialSetupConfigureNetworkSettings": "Ağ ayarlarınızı düzenleyin", + "InitialSetupConfigureGridPreferences": "Şimdi ızgarayı isteklerinize göre düzenleyin", + "InitialSetupPickAllPluginsYouNeed": "İhtiyacınız olan pluginleri seçin", + "InitialSetupDontWorryInstallUninstallPlugins": "Endişelenmeyin, dilediğiniz zaman istediğiniz plugini paket yöneticisinden yükleyip/kaldırabilirsiniz", + "InitialSetupWantSomeIcons": "İkon eklemek ister misiniz?", + "InitialSetupInstallIconPacksPackageManager": "Dilerseniz daha sonra da ikon paketlerini paket yöneticisinden yükleyebilirsiniz", + "InitialSetupAlmostDone": "Neredeyse tamamlandı!", + "KnownDevices": "Tanınan cihazlar", + "AskOnNewConnections": "Yeni bağlantı olduğunda sor", + "AllowAllNewConnections": "Tüm yeni bağlantılara izin ver (önerilmez)", + "BlockAllNewConnections": "Tüm yeni bağlantıları engelle", + "InstallDLL": ".dll'i yükle (önerilmez)", + "NeverInstallDLLFiles": "Güvenmediğiniz kaynaklardan gelen .dll dosyalarını asla yüklemeyin! Bilinmeyen kaynaklar üzerinden yüklenen .dll dosyaları sisteminize zarar verebilir. Yüklemeleri ne yaptığınızı biliyorsanız yapınız! .dll pluginini gerçekten yüklemek istiyor musunuz?", + "XWillBeUninstalled": "{0} yüklemesi kaldırılacaktır.", + "XSuccessfullyUninstalled": "{0} yüklemesi kaldırılacaktır. Değişikliklerin uygulanabilmesi için Macro Deck yeniden başlatılmadı. Macro Deck'i şimdi yeniden başlat?", + "CreateVariable": "Değişken oluştur", + "DeleteVariable": "Değişkeni sil", + "SelectAPluginAndActionToBegin": "Başlamak için bir plugin ve aksiyon seçin", + "ActionNeedsNoConfiguration": "Bu aksiyon ayar gerektirmemekte", + "CantCreateFolder": "Klasör oluşturulamadı", + "FolderCalledXAlreadyExists": "{0} isimli klasör zaten var", + "OnPress": "Basıldığında", + "OnEvent": "Olay gerçekleştiğinde", + "CantCreateIconPack": "İkon paketi oluşturulamadı", + "IconPackCalledXAlreadyExists": "{0} isimli ikon paketi zaten var", + "CantCreateProfile": "Profil oluşturulamadı", + "ProfileCalledXAlreadyExists": "{0} isimli profil zaten var", + "TheresAnUpdateForYou": "Bir güncelleştirmeniz var :)", + "VersionXIsNowAvailable": "Versiyon {0} ({1}) hazır", + "ReadyToDownloadUpdate": "Güncelleştirme indirilmeye hazır", + "DownloadingUpdate": "Güncelleştirme indiriliyor... {0}% ({1}MB/{2}MB)", + "VerifyingUpdateFile": "Güncelleştirme dosyası doğrulanıyor...", + "MD5NotValid": "MD5 checksum doğrulanamadı", + "StartingInstaller": "Yükleyici başlatılıyor", + "FileNotFound": "Dosya bulunamadı", + "TryAgainOrDownloadManually": "Tekrar deneyin ya da güncelleştirmeyi manuel olarak indirin", + "Trending": "Revaşta", + "Layers": "Katmanlar", + "AddImage": "Imaj ekle", + "IconImportQualityInfo": "Yüksek kaliteli ikonlar (özellikle fazlaca kullanılan büyük hareketli gifler) RAM kullanımını artırabilir ve/veya uzun yükleme zamanlarına mal olabilir.\n\nGifleri kullanacaksanız daha veya en düşük kalitede kullanmanızı öneririz.", + "Original": "Orjinal", + "High350px": "Yüksek (350px)", + "Normal200px": "Normal (200px)", + "Low150px": "Düşük (150px)", + "Lowest100px": "En düşük (100px)", + "ImportIconPack": "İkon paketini içe aktar", + "ExportIconPack": "İkon paketini dışa aktar", + "CreateIcon": "İkon oluştur", + "ImportIcon": "İkon içe aktar", + "DeleteIcon": "İkonu sil", + "IconSelectorManagedInfo": "Bu ikon paketi plugin yöneticisi tarafından yönetilmektedir", + "DownloadingXPackages": "{0} paket indiriliyor", + "PluginCouldNotBeLoaded": "Plugin yüklenemedi. Pluginin yüklü olan versiyonu Macro Deck'in bu versiyonuyla uyumlu olmayabilir.", + "CantChangeName": "İsim değiştirilemiyor", + "DeviceCalledXAlreadyExists": "{0} isimli bir cihaz zaten mevcut", + "NewConnection": "Yeni bağlantı", + "XIsAnUnknownDevice": "{0} isimli bilinmeyen cihaz Macro Deck'e bağlanmak istiyor. Bağlantıya izin verilsin mi?", + "ShouldMacroDeckBlockConnectionsFromX": "Macro Deck {0} isimli cihazdan ileride gelecek bağlantıları engellesin mi?", + "FailedToStartServer": "Sunucu başlatılamadı. Tanımlı port kullanılıyor olabilir ya da hatalı ağ adaptörü seçmiş olabilirsiniz. Ayarlar sayfasından doğru ağ adaptörünü seçtiğinizden emin olun ve portu değiştirmeyi deneyin.", + "ErrorWhileLoadingPlugins": "Pluginleri yüklerken hata oluştu", + "PluginXCouldNotBeLoaded": "{0} versiyon {1} yüklenemedi. Macro Deck'in bu versiyonuyla uyumlu olmayabilir. Bu plugini kullanan aksiyonlar, plugin update edilene kadar çalışmayacaktır.", + "InstallationSuccessfull": "Kurulum başarılı", + "PluginXInstalledSuccessfully": "{0} kurulumu başarılı", + "ErrorWhileInstallingPlugin": "Plugin kurulurken hata oluştu", + "PluginXCouldNotBeInstalled": "{0} kurulamadı. Macro Deck'in bu versiyonuyla uyumlu olmayabilir", + "Settings": "Ayarlar", + "Language": "Dil", + "General": "Genel", + "Connection": "Bağlantı", + "Backup": "Yedekleme", + "About": "Hakkında", + "NoUpdatesAvailable": "Güncelleştirme mevcut değil", + "LatestVersionInstalled": "En son versiyon zaten kurulu", + "WarningDevVersions": "Geliştirilmekte olan(dev) versiyonlar büyük oranla stabil çalışmayacaktır, uygulamada patlamalara ve veri kaybına (ayarladığınız aksiyon butonları, klasörler and profiller) sebep olabilir . Geliştirici güncelleştirmeleri kanalına geçiş yapmayı gerçekten istiyor musunuz?", + "WarningBetaVersions": "Beta versiyonlar bazı durumlarda stabil çalışmaz ve patlamalara sebebiyet verebilir. Beta güncelleştirmeleri kanalına geçiş yapmayı gerçekten istiyor musunuz?", + "VariableXGetsDeleted": "Değişken {0} silinecektir", + "DeckTitle": "Deck", + "DeviceManagerTitle": "Cihaz yönericisi", + "PackageManagerTitle": "Paket yöneticisi", + "SettingsTitle": "Ayarlar", + "VariablesTitle": "Global değişkenler", + "Edit": "Düzenle", + "Delete": "Sil", + "Run": "Çalıştır", + "Copy": "Kopyala", + "Paste": "Yapıştır", + "WebSocketAPIVersion": "Websocket API versiyon", + "PluginAPIVersion": "Plugin API versiyon", + "InstalledPlugins": "Yüklü pluginler", + "OperatingSystem": "İşletim sistemi", + "DevelopedByX": "{0} tarafından Almanya'da geliştirildi", + "XTranslationByX": "{0} çevirisi {1} tarafından yapıldı", + "PackageManagerTabAvailable": "Mevcut", + "PackageManagerTabInstalled": "Yüklendi", + "Event": "Olay", + "AutomaticallySwitchToFolder": "Otomatik olarak klasöre dönüştür", + "Restart": "Macro Deck'i yeniden başlat", + "Delay": "Gecikme(delay)", + "If": "Eğer", + "Else": "Yoksa", + "Online": "Çevrimiçi", + "By": "Tarafından", + "StateBinding": "Durumu şuna bağla", + "ErrorWhileLoadingPackageManager": "Paket yöneticisi yüklenemedi. İnternete bağlı olmayabilirsiniz ya da Macro Deck güvenlik duvarı tarafından engelleniyor olabilir.", + "UpdatesAvailable": "Güncelleştirmeler mevcut", + "EnableIconCache": "İkon önbelleğini aktif et (daha hızlı; yüksek RAM kullanımı)", + "WebClient": "Web client", + "AndroidApp": "Android client", + "IOSApp": "iOS client", + "PluginMacroDeckFolder": "Macro Deck klasörü", + "ActionChangeFolder": "Klasörü değiştir", + "ActionChangeFolderDescription": "Cihaz üzerindeki mevcut klasörü ayarlanmış klasör ile değiştir", + "ActionGoToParentFolder": "Bir üst klasöre git", + "ActionGoToParentFolderDescription": "Cihaz üzerindeki mevcut klasörü, klasörün üst klasörü ile değiştir", + "ActionGoToRootFolder": "Kök klasöre git", + "ActionGoToRootFolderDescription": "Cihaz üzerindeki mevcut klasörü, kök klasör ile değiştir", + "PluginMacroDeckVariables": "Macro Deck değişkenleri", + "ActionChangeVariableValue": "Değişken değerini değiştir", + "ActionChangeVariableValueDescription": "Artır, azalt, değişken bir değer ayarla ve değişken değeri değiştir", + "CountUp": "Artır", + "CountDown": "Azalt", + "Set": "Ayarla", + "Toggle": "Değiştir (Toggle)", + "Variable": "Değişken", + "PluginActionButton": "Bu aksiyon butonu", + "ActionToggleActionButtonState": "Buton durumunu değiştir", + "ActionToggleActionButtonStateDescription": "Bu butonun durumunu değiştirir", + "ActionSetActionButtonStateOff": "Buton durumunu kapalı konumuna getir", + "ActionSetActionButtonStateOffDescription": "Bu buton durumunu \"kapalı\" konumuna getirir", + "ActionSetActionButtonStateOn": "Buton durumunu açık konumuna getir", + "ActionSetActionButtonStateOnDescription": "Bu buton durumunu \"açık\" konumuna getirir", + "Description": "Tanım", + "License": "Lisans", + "AnimatedGifImported": "Hareketli gif içe aktarıldı", + "GenerateStaticIcon": "Ayrıca GIF'lerin ilk karesinin statik bir simgesi oluşturulsun mu?", + "XSuccessfullyExportedToX": "{0} başarıyla {1} hedefine aktarıldı", + "SelectedIconWillBeDeleted": "Seçilen simge, {0} simge paketinden silinecek", + "SuccessfullyImportedIconPack": "{0} simge paketi başarıyla içe aktarıldı", + "SelectedIconPackWillBeDeleted": "Seçilen simge paketi {0}, tüm simgeleriyle birlikte silinecek", + "GenerateStatic": "Statik oluştur", + "OnlyUserCreatedVariablesVisible": "Yalnızca kullanıcı tarafından oluşturulan değişkenler görünür", + "MacroDeckUsesCottleTemplateEngine": "Macro Deck, Cottle şablon motorunu kullanır. Daha fazla bilgi için buraya tıklayın.", + "Result": "Sonuç", + "InstallDevVersions": "Geliştirme sürümlerini yükleyin", + "InstallBetaVersions": "Beta sürümlerini yükleyin", + "WhatDoYouWantToRestore": "Yedekten neyi geri yüklemek istiyorsunuz?", + "Configuration": "Yapılandırma", + "Profiles": "profiller", + "Variables": "Değişkenler", + "PluginConfigurations": "Eklenti yapılandırmaları", + "PluginCredentials": "Eklenti kimlik bilgileri", + "InstalledIconPacks": "Yüklü simge paketleri", + "Restore": "Eski haline getirmek", + "ActionCannotBeReversed": "Bu işlem geri alınamaz", + "ThisWillDeleteBackupPermanently": "Bu, yedeklemeyi kalıcı olarak siler", + "Created": "oluşturuldu", + "PleaseWait": "Lütfen bekle...", + "Backups": "Yedeklemeler", + "CreateBackup": "Yedek oluştur", + "BackupFailed": "Yedekleme başarısız", + "BackupSuccessfullyCreated": "Yedekleme başarıyla oluşturuldu", + "CreateBackupBeforeUpdate": "Güncellemeden önce bir yedek oluşturmak istiyor musunuz?", + "CreatingBackup": "Yedek oluşturuluyor...", + "PluginNeedsConfiguration": "Bu eklentinin yapılandırılması gerekiyor", + "ConfigureNow": "{0} öğesini şimdi yapılandırmak istiyor musunuz?", + "Hotkey": "kısayol tuşu", + "PressTheKeysNow": "Şimdi atamak istediğiniz tuşlara basın", + "XAction": "{0} eylem", + "XActions": "{0} işlem", + "OnRelease": "serbest bırakıldığında", + "OnLongPress": "uzun basıldığında", + "OnLongPressRelease": "Uzun basın açıklamasında", + "SimulateOnPress": "\"Baskıda\" simülasyonu", + "SimulateOnRelease": "\"Yayınlandığında\" simülasyonu", + "SimulateOnLongPress": "\"Uzun basıldığında\" simülasyonu", + "SimulateOnLongPressRelease": "\"Uzun basın açıklamasında\" simülasyonu", + "HotkeyExecutesOnPress": "Kısayol tuşu, basıldığında \"Basıldığında\" eylemlerini yürütür", + "Important": "Önemli", + "FirewallAlertInfo": "Macro Deck'i başlattıktan sonra, Windows Defender Güvenlik Duvarı'ndan bir iletişim kutusu görünecektir.\r\nLütfen tüm kutuları işaretleyin (Özel ağlar, Genel ağlar ve varsa, Etki alanı ağları).\r\n\r\nBu iletişim kutusu görünmüyorsa ve hala bağlantı sorunları yaşıyorsanız, yardım için lütfen wiki'yi veya discord sunucusunu ziyaret edin. ", + "GotIt": "Anladım!", + "DeviceSettings": "Cihaz ayarları", + "Brightness": "Parlaklık", + "AutoConnect": "Otomatik bağlan", + "DiscordSupport": "anlaşmazlık desteği", + "Wiki": "Wiki", + "ExportLatestLog": "En son günlüğü dışa aktar", + "LogSuccessfullyExportedToX": "Günlük başarıyla {0}'e aktarıldı", + "Help": "Yardım", + "XWarningsXErrors": "{0} uyarı(lar), {1} hata(lar)", + "TrimBlankLines": "Boş satırları kırp", + "Extensions": "Uzantılar", + "InstallFromFile": "Dosyadan yükle", + "AllExtensionsUpToDate": "Tüm uzantılar güncel", + "UpdateAll": "Tümünü güncelle", + "UpdateAvailable": "Güncelleme uygun", + "PendingRestart": "Yeniden başlatma bekleniyor", + "Enabled": "Etkinleştirilmiş", + "Disabled": "Engelli", + "ActionSaveVariableToFile": "Değişkeni dosyaya kaydet", + "ActionSaveVariableToFileDescription": "Değişkenin değerini bir dosyaya kaydeder", + "Folders": "klasörler", + "Grid": "Kafes", + "ActionReadVariableFromFile": "Dosyadan değişkeni oku", + "ActionReadVariableFromFileDescription": "Bir dosyayı okur ve içeriği bir değişken için değer olarak ayarlar", + "ActionSetProfile": "Set profile", + "ActionSetProfileDescription": "Sets the profile on a device", + "Device": "Device", + "WhereExecuted": "Where executed", + "ActionSetBrightness": "Set brightness", + "ActionSetBrightnessDescription": "Sets the display brightness (Only on the Android app!)", + "BindableVariable": "Bindable variable", + "BindableVariableInfo": "The state of this button can be bound to the variable {0}. Do you want to bind the state?", + "Cancelled": "Cancelled", + "Preparing": "Preparing...", + "Installing": "Installing...", + "Completed": "Completed", + "ExtensionStoreDownloaderPackageIdVersion": "{0} version {1}", + "DownloadingAndInstallingXPackages": "Downloading and installing {0} package(s)", + "InstallationOfXPackagesDone": "Installation of {0} package(s) done", + "ActionSetBackgroundColor": "Set background color", + "ActionSetBackgroundColorDescription": "Changes the background color of a action button", + "Fixed": "Fixed", + "Random": "Random" +======= "__Language__": "Turkish", "__LanguageCode__": "tr", "__Author__": "Tuna Karakaşoğlu | twitch.tv/DunyaninEnKotuOyuncusu", @@ -301,4 +624,5 @@ "Grid": "Kafes", "ActionReadVariableFromFile": "Dosyadan değişkeni oku", "ActionReadVariableFromFileDescription": "Bir dosyayı okur ve içeriği bir değişken için değer olarak ayarlar" +>>>>>>> origin/main } \ No newline at end of file diff --git a/Server/ADBServerHelper.cs b/Server/ADBServerHelper.cs new file mode 100644 index 00000000..d4f78748 --- /dev/null +++ b/Server/ADBServerHelper.cs @@ -0,0 +1,117 @@ +using SharpAdbClient; +using SuchByte.MacroDeck.Enums; +using SuchByte.MacroDeck.Logging; +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Text; +using System.Threading.Tasks; + +namespace SuchByte.MacroDeck.Server +{ + public class AdbDeviceConnectionStateChangedEventArgs : EventArgs + { + public DeviceData Device { get; set; } + + public AdbDeviceConnectionState ConnectionState { get; set; } + } + + + public class ADBServerHelper + { + + private static AdbServer _adbServer; + + private static AdbClient _adbClient; + + private static string _adbFolderName = "Android Debug Bridge"; + + private static string _adbPath = Path.Combine(MacroDeck.MainDirectoryPath, _adbFolderName, "adb.exe"); + + public static EventHandler OnDeviceConnectionStateChanged; + + public static bool ServerRunning + { + get => _adbServer != null && _adbClient != null && _adbServer.GetStatus().IsRunning; + } + + public static List Devices + { + get => _adbClient.GetDevices(); + } + + public static void Initialize() + { + if (!File.Exists(_adbPath)) + { + MacroDeckLogger.Warning(typeof(ADBServerHelper), $"Cannot start adb server at {_adbPath}: File not found"); + return; + } + MacroDeckLogger.Info(typeof(ADBServerHelper), $"Starting ADB server using {_adbPath}"); + _adbServer = new AdbServer(); + StartServerResult result = _adbServer.StartServer(_adbPath, true); + if (result != StartServerResult.Started) + { + MacroDeckLogger.Info(typeof(ADBServerHelper), $"Unable to start ADB server"); + } + + _adbClient = new AdbClient(); + + Task.Run(() => + { + var monitor = new DeviceMonitor(new AdbSocket(new IPEndPoint(IPAddress.Loopback, AdbClient.AdbServerPort))); + monitor.DeviceConnected += Monitor_DeviceConnected; + monitor.DeviceDisconnected += Monitor_DeviceDisconnected; + monitor.Start(); + }); + + + foreach (var device in _adbClient.GetDevices()) + { + MacroDeckLogger.Info(typeof(ADBServerHelper), $"Found {device.Name}"); + StartReverseForward(device); + } + } + + private static void Monitor_DeviceDisconnected(object sender, DeviceDataEventArgs e) + { + MacroDeckLogger.Info(typeof(ADBServerHelper), $"{e.Device.Name} disconnected"); + if (OnDeviceConnectionStateChanged != null) + { + OnDeviceConnectionStateChanged(null, new AdbDeviceConnectionStateChangedEventArgs() + { + Device = e.Device, + ConnectionState = AdbDeviceConnectionState.DISCONNECTED + }); + } + } + + private static void Monitor_DeviceConnected(object sender, DeviceDataEventArgs e) + { + MacroDeckLogger.Info(typeof(ADBServerHelper), $"{e.Device.Name} connected"); + if (OnDeviceConnectionStateChanged != null) + { + OnDeviceConnectionStateChanged(null, new AdbDeviceConnectionStateChangedEventArgs() + { + Device = e.Device, + ConnectionState = AdbDeviceConnectionState.CONNECTED + }); + } + StartReverseForward(e.Device); + } + + private static void StartReverseForward(DeviceData device) + { + try + { + _adbClient.CreateReverseForward(device, $"tcp:{MacroDeck.Configuration.Host_Port}", $"tcp:{MacroDeck.Configuration.Host_Port}", true); + } catch (Exception ex) + { + MacroDeckLogger.Warning(typeof(ADBServerHelper), $"Unable to start reverse forward on {device?.Name}: {ex.Message}"); + } + MacroDeckLogger.Info(typeof(ADBServerHelper), $"Started reverse forward on {device?.Name}"); + } + + } +} diff --git a/Server/DeviceMessage/IDeviceMessage.cs b/Server/DeviceMessage/IDeviceMessage.cs index b041ff43..6db95e5e 100644 --- a/Server/DeviceMessage/IDeviceMessage.cs +++ b/Server/DeviceMessage/IDeviceMessage.cs @@ -12,7 +12,6 @@ public interface IDeviceMessage public void SendConfiguration(MacroDeckClient macroDeckClient); public void SendAllButtons(MacroDeckClient macroDeckClient); public void UpdateButton(MacroDeckClient macroDeckClient, ActionButton.ActionButton actionButton); - public void SendIconPacks(MacroDeckClient macroDeckClient); diff --git a/Server/DeviceMessage/SoftwareClientMessage.cs b/Server/DeviceMessage/SoftwareClientMessage.cs index 01064279..7f1ed5a0 100644 --- a/Server/DeviceMessage/SoftwareClientMessage.cs +++ b/Server/DeviceMessage/SoftwareClientMessage.cs @@ -8,6 +8,7 @@ using System.Collections.Concurrent; using System.Collections.Generic; using System.Text; +using System.Threading.Tasks; namespace SuchByte.MacroDeck.Server.DeviceMessage { @@ -23,18 +24,29 @@ public void Connected(MacroDeckClient macroDeckClient) DeviceManager.GetMacroDeckDevice(macroDeckClient.ClientId).DeviceType = macroDeckClient.DeviceType; DeviceManager.SaveKnownDevices(); } +<<<<<<< HEAD +======= GC.Collect(); +>>>>>>> origin/main } public void SendAllButtons(MacroDeckClient macroDeckClient) { if (macroDeckClient == null || macroDeckClient.Folder == null || macroDeckClient.Folder.ActionButtons == null) return; +<<<<<<< HEAD + var buttons = new ConcurrentBag(); +======= var buttons = new List(); +>>>>>>> origin/main - foreach (ActionButton.ActionButton actionButton in macroDeckClient.Folder.ActionButtons) + Parallel.ForEach(macroDeckClient.Folder.ActionButtons, actionButton => { string IconBase64 = ""; string LabelBase64 = ""; +<<<<<<< HEAD + string BackgroundColorHex; +======= +>>>>>>> origin/main if (!actionButton.State) { if (!string.IsNullOrWhiteSpace(actionButton.IconOff)) @@ -49,7 +61,13 @@ public void SendAllButtons(MacroDeckClient macroDeckClient) { LabelBase64 = actionButton.LabelOff.LabelBase64 ?? ""; } +<<<<<<< HEAD + BackgroundColorHex = $"#{actionButton.BackColorOff.R:X2}{actionButton.BackColorOff.G:X2}{actionButton.BackColorOff.B:X2}"; + } + else +======= } else +>>>>>>> origin/main { if (!string.IsNullOrWhiteSpace(actionButton.IconOn)) { @@ -63,6 +81,10 @@ public void SendAllButtons(MacroDeckClient macroDeckClient) { LabelBase64 = actionButton.LabelOn.LabelBase64 ?? ""; } +<<<<<<< HEAD + BackgroundColorHex = $"#{actionButton.BackColorOn.R:X2}{actionButton.BackColorOn.G:X2}{actionButton.BackColorOn.B:X2}"; +======= +>>>>>>> origin/main } JObject actionButtonObject = JObject.FromObject(new @@ -71,9 +93,11 @@ public void SendAllButtons(MacroDeckClient macroDeckClient) actionButton.Position_X, actionButton.Position_Y, LabelBase64, + BackgroundColorHex }); buttons.Add(actionButtonObject); - } + }); + JObject buttonsObject = JObject.FromObject(new { Method = JsonMethod.GET_BUTTONS.ToString(), @@ -103,22 +127,15 @@ public void SendConfiguration(MacroDeckClient macroDeckClient) MacroDeckServer.Send(macroDeckClient.SocketConnection, configurationObject); } - public void SendIconPacks(MacroDeckClient macroDeckClient) - { - JObject iconsObject = JObject.FromObject(new - { - Method = JsonMethod.GET_ICONS.ToString(), - IconPacks = IconManager.IconPacks - }); - - MacroDeckServer.Send(macroDeckClient.SocketConnection, iconsObject); - } - public void UpdateButton(MacroDeckClient macroDeckClient, ActionButton.ActionButton actionButton) { if (macroDeckClient.Folder == null || !macroDeckClient.Folder.ActionButtons.Contains(actionButton)) return; string IconBase64 = ""; string LabelBase64 = ""; +<<<<<<< HEAD + string BackgroundColorHex; +======= +>>>>>>> origin/main if (!actionButton.State) { if (!string.IsNullOrWhiteSpace(actionButton.IconOff)) @@ -133,6 +150,10 @@ public void UpdateButton(MacroDeckClient macroDeckClient, ActionButton.ActionBut { LabelBase64 = actionButton.LabelOff.LabelBase64 ?? ""; } +<<<<<<< HEAD + BackgroundColorHex = $"#{actionButton.BackColorOff.R:X2}{actionButton.BackColorOff.G:X2}{actionButton.BackColorOff.B:X2}"; +======= +>>>>>>> origin/main } else { @@ -148,6 +169,10 @@ public void UpdateButton(MacroDeckClient macroDeckClient, ActionButton.ActionBut { LabelBase64 = actionButton.LabelOn.LabelBase64 ?? ""; } +<<<<<<< HEAD + BackgroundColorHex = $"#{actionButton.BackColorOn.R:X2}{actionButton.BackColorOn.G:X2}{actionButton.BackColorOn.B:X2}"; +======= +>>>>>>> origin/main } JObject actionButtonObject = JObject.FromObject(new @@ -156,6 +181,7 @@ public void UpdateButton(MacroDeckClient macroDeckClient, ActionButton.ActionBut actionButton.Position_X, actionButton.Position_Y, LabelBase64, + BackgroundColorHex }); JObject updateObject = JObject.FromObject(new diff --git a/Server/MacroDeckClient.cs b/Server/MacroDeckClient.cs index 02818f04..625ac79b 100644 --- a/Server/MacroDeckClient.cs +++ b/Server/MacroDeckClient.cs @@ -82,14 +82,11 @@ public DeviceType DeviceType case DeviceType.Unknown: case DeviceType.Web: case DeviceType.Android: + case DeviceType.StreamDeck: case DeviceType.iOS: this.DeviceClass = DeviceClass.SoftwareClient; this.DeviceMessage = new SoftwareClientMessage(); break; - case DeviceType.Macro_Deck_DIY_OLED_6_V1: - this.DeviceClass = DeviceClass.Macro_Deck_DIY_OLED_6_V1; - this.DeviceMessage = new MacroDeckDIYOLED6Message(); - break; } } } diff --git a/Server/MacroDeckServer.cs b/Server/MacroDeckServer.cs index 40c04b7c..fee44fb1 100644 --- a/Server/MacroDeckServer.cs +++ b/Server/MacroDeckServer.cs @@ -113,7 +113,7 @@ private static void StartWebSocketServer(string ipAddress, int port) } } - MacroDeckLogger.Info(String.Format("Starting websocket server @ {0}:{1}", ipAddress, port)); + MacroDeckLogger.Info(string.Format("Starting websocket server @ {0}:{1}", ipAddress, port)); _webSocketServer = new WebSocketServer("ws://" + ipAddress + ":" + port); _webSocketServer.ListenerSocket.NoDelay = true; try @@ -330,12 +330,15 @@ private static void OnMessage(MacroDeckClient macroDeckClient, string jsonMessag SendAllButtons(macroDeckClient); }); break; +<<<<<<< HEAD +======= case JsonMethod.GET_ICONS: Task.Run(() => { //SendAllIcons(macroDeckClient); }); break; +>>>>>>> origin/main } } @@ -419,6 +422,7 @@ public static void SetProfile(MacroDeckClient macroDeckClient, MacroDeckProfile if (macroDeckProfile == null) return; macroDeckClient.Profile = macroDeckProfile; macroDeckClient.DeviceMessage.SendConfiguration(macroDeckClient); + SetFolder(macroDeckClient, macroDeckProfile.Folders[0]); } @@ -454,6 +458,8 @@ public static void UpdateFolder(MacroDeckFolder folder) } } +<<<<<<< HEAD +======= /// /// Sends all icon packs to the client @@ -473,12 +479,14 @@ public static void UpdateFolder(MacroDeckFolder folder) } }*/ +>>>>>>> origin/main /// /// Sends all buttons of the current folder to the client /// /// private static void SendAllButtons(MacroDeckClient macroDeckClient) { + if (macroDeckClient == null) return; macroDeckClient.DeviceMessage.SendAllButtons(macroDeckClient); } @@ -489,6 +497,7 @@ private static void SendAllButtons(MacroDeckClient macroDeckClient) /// public static void SendButton(MacroDeckClient macroDeckClient, ActionButton.ActionButton actionButton) { + if (macroDeckClient == null) return; macroDeckClient.DeviceMessage.UpdateButton(macroDeckClient, actionButton); } diff --git a/Updater/Updater.cs b/Updater/Updater.cs index 22ee1011..ba8a4acf 100644 --- a/Updater/Updater.cs +++ b/Updater/Updater.cs @@ -77,6 +77,7 @@ public static void CheckForUpdatesAsync() private static void CheckForUpdates() { + if (UpdateAvailable) return; try { using (WebClient wc = new WebClient()) @@ -88,14 +89,14 @@ private static void CheckForUpdates() jsonString = wc.DownloadString("https://macrodeck.org/files/versions.php?latest&channel=test"); } - jsonString = wc.DownloadString("https://macrodeck.org/files/versions.php?latest" + (MacroDeck.Configuration.UpdateDevVersions ? "&dev" : "") + (MacroDeck.Configuration.UpdateBetaVersions ? "&beta" : "")); + jsonString = wc.DownloadString("https://macrodeck.org/files/versions.php?latest" + (MacroDeck.Configuration.UpdateBetaVersions ? "&beta" : "")); _jsonObject = JObject.Parse(jsonString); if (_jsonObject["build"] != null) { if (Int32.TryParse(_jsonObject["build"].ToString(), out int build)) { - if (build > MacroDeck.BuildVersion || _forceUpdate) + if (build > MacroDeck.Version.Build || _forceUpdate) { MacroDeckLogger.Info("Macro Deck version " + _jsonObject["version"] + " available"); try diff --git a/Variables/Plugin/Views/ChangeVariableValueActionConfigView.Designer.cs b/Variables/Plugin/Views/ChangeVariableValueActionConfigView.Designer.cs index 674dea20..7857f2cb 100644 --- a/Variables/Plugin/Views/ChangeVariableValueActionConfigView.Designer.cs +++ b/Variables/Plugin/Views/ChangeVariableValueActionConfigView.Designer.cs @@ -173,7 +173,7 @@ private void InitializeComponent() this.btnTemplateEditor.Size = new System.Drawing.Size(25, 25); this.btnTemplateEditor.TabIndex = 6; this.btnTemplateEditor.TabStop = false; - this.btnTemplateEditor.Click += new System.EventHandler(this.btnTemplateEditor_Click); + this.btnTemplateEditor.Click += new System.EventHandler(this.BtnTemplateEditor_Click); // // ChangeVariableValueConfigurator // diff --git a/Variables/Plugin/Views/ChangeVariableValueActionConfigView.cs b/Variables/Plugin/Views/ChangeVariableValueActionConfigView.cs index 914ce9b6..645d5c9c 100644 --- a/Variables/Plugin/Views/ChangeVariableValueActionConfigView.cs +++ b/Variables/Plugin/Views/ChangeVariableValueActionConfigView.cs @@ -1,8 +1,10 @@ using Newtonsoft.Json.Linq; using SuchByte.MacroDeck.GUI.CustomControls; using SuchByte.MacroDeck.GUI.Dialogs; +using SuchByte.MacroDeck.InternalPlugins.Variables.Enums; using SuchByte.MacroDeck.Language; using SuchByte.MacroDeck.Plugins; +using SuchByte.MacroDeck.Variables.Plugin.ViewModels; using System; using System.Collections.Generic; using System.ComponentModel; @@ -16,11 +18,15 @@ namespace SuchByte.MacroDeck.Variables.Plugin.GUI { public partial class ChangeVariableValueActionConfigView : ActionConfigControl { - PluginAction _macroDeckAction; + private readonly ChangeVariableValueActionConfigViewModel _viewModel; +<<<<<<< HEAD:InternalPlugins/Variables/Views/ChangeVariableValueActionConfigView.cs + public ChangeVariableValueActionConfigView(PluginAction pluginAction) +======= public ChangeVariableValueActionConfigView(PluginAction macroDeckAction) +>>>>>>> origin/main:Variables/Plugin/Views/ChangeVariableValueActionConfigView.cs { - this._macroDeckAction = macroDeckAction; + this._viewModel = new ChangeVariableValueActionConfigViewModel(pluginAction); InitializeComponent(); this.radioCountUp.Text = LanguageManager.Strings.CountUp; @@ -45,7 +51,7 @@ private void Variables_SelectedIndexChanged(object sender, EventArgs e) { try { - Variable variable = VariableManager.Variables.Find(v => v.Name.Equals(this.variables.Text)); + Variable variable = VariableManager.ListVariables.Where(v => v.Name == this.variables.Text).FirstOrDefault(); if (variable != null) { switch (variable.Type) @@ -98,129 +104,68 @@ private void MethodChanged(object sender, EventArgs e) public override bool OnActionSave() { - if (String.IsNullOrWhiteSpace(this.variables.Text)) - { - return false; - } - JObject jObject = null; - try - { - jObject = JObject.Parse(this._macroDeckAction.Configuration); - } - catch { } - if (jObject == null) - { - jObject = new JObject(); - } + this._viewModel.Variable = this.variables.Text; if (this.radioCountUp.Checked) { - jObject["method"] = "countUp"; + this._viewModel.Method = InternalPlugins.Variables.Enums.ChangeVariableMethod.countUp; } else if (this.radioCountDown.Checked) { - jObject["method"] = "countDown"; + this._viewModel.Method = InternalPlugins.Variables.Enums.ChangeVariableMethod.countDown; } else if (this.radioSet.Checked) { - if (String.IsNullOrWhiteSpace(this.value.Text)) - { - return false; - } - jObject["method"] = "set"; + this._viewModel.Method = InternalPlugins.Variables.Enums.ChangeVariableMethod.set; } else if (this.radioToggle.Checked) { - jObject["method"] = "toggle"; + this._viewModel.Method = InternalPlugins.Variables.Enums.ChangeVariableMethod.toggle; } - jObject["variable"] = variables.Text; - jObject["value"] = this.radioSet.Checked ? this.value.Text : String.Empty; - this._macroDeckAction.Configuration = jObject.ToString(); - this._macroDeckAction.ConfigurationSummary = jObject["variable"].ToString() + " -> " + GetMethodName(jObject["method"].ToString()) + (this.radioSet.Checked ? " -> " + jObject["value"].ToString() : ""); - return true; + this._viewModel.Value = this.radioSet.Checked ? this.value.Text : String.Empty; + + return this._viewModel.SaveConfig(); } private void LoadVariables() { this.variables.Items.Clear(); - foreach (Variable variable in VariableManager.Variables.FindAll(v => v.Creator.Equals("User"))) + foreach (Variable variable in VariableManager.ListVariables.Where(v => v.Creator.Equals("User"))) { this.variables.Items.Add(variable.Name); } - - - /*if (this.radioCountUp.Checked || this.radioCountDown.Checked) - { - foreach (Variable variable in VariableManager.Variables.FindAll(v => v.Creator.Equals("User") && (v.Type.Equals(VariableType.Integer.ToString()) || v.Type.Equals(VariableType.Float.ToString())))) - { - this.variables.Items.Add(variable.Name); - } - } else if (this.radioToggle.Checked) - { - foreach (Variable variable in VariableManager.Variables.FindAll(v => v.Creator.Equals("User") && (v.Type.Equals(VariableType.Bool.ToString())))) - { - this.variables.Items.Add(variable.Name); - } - } - else if (this.radioSet.Checked) - { - - }*/ } - private string GetMethodName(string method) - { - switch (method) - { - case "countUp": - return LanguageManager.Strings.CountUp; - case "countDown": - return LanguageManager.Strings.CountDown; - case "set": - return LanguageManager.Strings.Set; - case "toggle": - return LanguageManager.Strings.Toggle; - } - return ""; - } + private void ChangeVariableValueConfigurator_Load(object sender, EventArgs e) { this.LoadVariables(); - JObject jObject = null; - try - { - jObject = JObject.Parse(this._macroDeckAction.Configuration); - } - catch { } - if (jObject == null) return; - switch (jObject["method"].ToString()) + switch (this._viewModel.Method) { - case "countUp": + case ChangeVariableMethod.countUp: this.radioCountUp.Checked = true; break; - case "countDown": + case ChangeVariableMethod.countDown: this.radioCountDown.Checked = true; break; - case "set": + case ChangeVariableMethod.set: this.radioSet.Checked = true; break; - case "toggle": + case ChangeVariableMethod.toggle: this.radioToggle.Checked = true; break; } - - - this.variables.Text = jObject["variable"].ToString(); - this.value.Text = jObject["value"].ToString(); + this.variables.Text = this._viewModel.Variable; + this.value.Text = this._viewModel.Value; this.value.Visible = this.radioSet.Checked; } - private void btnTemplateEditor_Click(object sender, EventArgs e) + private void BtnTemplateEditor_Click(object sender, EventArgs e) { using (var templateEditor = new TemplateEditor(this.value.Text)) { diff --git a/Variables/Variable.cs b/Variables/Variable.cs index 66e46453..62981282 100644 --- a/Variables/Variable.cs +++ b/Variables/Variable.cs @@ -11,11 +11,18 @@ namespace SuchByte.MacroDeck.Variables public class Variable { + [PrimaryKey] public string Name { get; set; } = ""; public string Value { get; set; } = "false"; public string Creator { get; set; } = "User"; public string Type { get; set; } = VariableType.Bool.ToString(); + [Ignore] + public VariableType VariableType + { + get => (VariableType)Enum.Parse(typeof(VariableType), this.Type); + } + [Ignore] public string[] Suggestions { get; set; } } diff --git a/Variables/VariableManager.cs b/Variables/VariableManager.cs index ac6a6a85..f7f104e6 100644 --- a/Variables/VariableManager.cs +++ b/Variables/VariableManager.cs @@ -3,9 +3,11 @@ using SuchByte.MacroDeck.Logging; using SuchByte.MacroDeck.Plugins; using System; +using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; +using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Threading; @@ -20,37 +22,82 @@ public static class VariableManager internal static event EventHandler OnVariableChanged; internal static event EventHandler OnVariableRemoved; - public static List Variables; - private static DocumentConfiguration templateConfiguration = new DocumentConfiguration + /// + /// Use GetVariables(MacroDeckPlugin macroDeckPlugin) + /// + public static TableQuery ListVariables + { +<<<<<<< HEAD + get => _database.Table(); + } + + /// + /// Do not add/remove items to this list + /// Use SetValue + /// or + /// DeleteVariable + /// + [Obsolete("Use GetVariables to list all variables")] + public static List Variables + { + get + { + var query = _database.Table(); + List variables = new List(); + variables.AddRange(query); + return variables; + } + } + + public static List GetVariables(MacroDeckPlugin macroDeckPlugin) + { + var variables = new ConcurrentBag(); + Parallel.ForEach(ListVariables.Where(x => x.Creator == macroDeckPlugin.Name), variable => + { + variables.Add(variable); + }); + return variables.ToList(); + } + + public static Variable GetVariable(MacroDeckPlugin macroDeckPlugin, string variableName) { + return ListVariables.Where(x => x.Creator == macroDeckPlugin.Name && x.Name.ToLower() == variableName.ToLower()).FirstOrDefault(); + } +======= Trimmer = DocumentConfiguration.TrimFirstAndLastBlankLines, }; private static bool _saving = false; // To prevent multiple save processes +>>>>>>> origin/main + private static SQLiteConnection _database; - internal static void RefreshVariable(Variable variable) + private static DocumentConfiguration templateConfiguration = new DocumentConfiguration { - if (OnVariableChanged != null) - { - OnVariableChanged(variable, EventArgs.Empty); - } - VariableManager.SaveAsync(); + Trimmer = DocumentConfiguration.TrimFirstAndLastBlankLines, + }; + + internal static void InsertVariable(Variable variable) + { + if (ListVariables.Where(x => x.Name.ToLower() == variable.Name.ToLower()).Count() > 0) return; + _database.Insert(variable); } - internal static Variable SetValue(string name, object value, VariableType type, string creator = "User", bool save = true) + internal static Variable SetValue(string name, object value, VariableType type, string creator = "User") { - if (Variables == null) return null; + if (string.IsNullOrWhiteSpace(name)) return null; name = ConvertNameString(name); - Variable variable = Variables.Find(v => v.Name.Equals(name, StringComparison.OrdinalIgnoreCase)); + Variable variable = ListVariables.Where(v => v.Name.ToLower() == name.ToLower()).FirstOrDefault(); if (variable == null) { - variable = new Variable(); - Variables.Add(variable); + variable = new Variable + { + Name = name + }; + _database.Insert(variable); } - variable.Name = name; variable.Type = type.ToString(); variable.Creator = creator; @@ -102,40 +149,36 @@ internal static Variable SetValue(string name, object value, VariableType type, OnVariableChanged(variable, EventArgs.Empty); } } - if (save) + + try { - SaveAsync(); - } + _database.Update(variable); + } catch { } + return variable; } - internal static Variable SetValue(string name, object value, VariableType type, string[] suggestions, string creator = "User", bool save = true) + internal static Variable SetValue(string name, object value, VariableType type, string[] suggestions, string creator = "User") { - if (Variables == null) return null; - Variable variable = SetValue(name, value, type, creator, false); + Variable variable = SetValue(name, value, type, creator); variable.Suggestions = suggestions; - if (save) - { - SaveAsync(); - } return variable; } - /// - /// Set the value of an variable. If the variable does not exists, Macro Deck automatically creates it. - /// - /// Name of the variable - /// Value of the variable - /// Type of the variable - /// The instance of your plugin - /// Save the variable to the database? set to false if your plugin updates the variable often. + [Obsolete("Remove save parameter")] public static void SetValue(string name, object value, VariableType type, MacroDeckPlugin plugin, bool save = true) { - SetValue(name, value, type, plugin.Name, save); + SetValue(name, value, type, plugin.Name); } + [Obsolete("Remove save parameter")] + public static void SetValue(string name, object value, VariableType type, MacroDeckPlugin plugin, string[] suggestions, bool save = true) + { + SetValue(name, value, type, suggestions, plugin.Name); + } + /// /// Set the value of an variable. If the variable does not exists, Macro Deck automatically creates it. /// @@ -144,34 +187,30 @@ public static void SetValue(string name, object value, VariableType type, MacroD /// Type of the variable /// The instance of your plugin /// Suggestions for the value. - /// Save the variable to the database? set to false if your plugin updates the variable often. - public static void SetValue(string name, object value, VariableType type, MacroDeckPlugin plugin, string[] suggestions, bool save = true) + public static void SetValue(string name, object value, VariableType type, MacroDeckPlugin plugin, string[] suggestions = null) { - SetValue(name, value, type, suggestions, plugin.Name, save); + SetValue(name, value, type, suggestions, plugin.Name); } - + /// + /// Deletes a variable + /// + /// Name of the variable public static void DeleteVariable(string name) { - if (Variables == null) return; - Variable variable = Variables.Find(v => v.Name.Equals(name)); - if (variable != null) + _database.Delete(new Variable() { Name = name }); + if (OnVariableRemoved != null) { - Variables.Remove(variable); - MacroDeckLogger.Info("Deleted variable " + name); - if (OnVariableRemoved != null) - { - OnVariableRemoved(name, EventArgs.Empty); - } + OnVariableRemoved(name, EventArgs.Empty); } - Save(); + MacroDeckLogger.Info("Deleted variable " + name); } public static string RenderTemplate(string template) { - string result = ""; + string result; try { templateConfiguration.Trimmer = template.StartsWith("_trimblank_", StringComparison.OrdinalIgnoreCase) ? DocumentConfiguration.TrimFirstAndLastBlankLines : DocumentConfiguration.TrimNothing; @@ -180,7 +219,7 @@ public static string RenderTemplate(string template) Dictionary vars = new Dictionary(); - foreach (Variable v in VariableManager.Variables) + foreach (Variable v in ListVariables) { if (vars.ContainsKey(v.Name)) continue; Value value = ""; @@ -189,7 +228,7 @@ public static string RenderTemplate(string template) { case nameof(VariableType.Bool): bool resultBool = false; - Boolean.TryParse(v.Value.Replace("On", "True", StringComparison.CurrentCultureIgnoreCase).Replace("Off", "False", StringComparison.OrdinalIgnoreCase), out resultBool); + bool.TryParse(v.Value.Replace("On", "True", StringComparison.CurrentCultureIgnoreCase).Replace("Off", "False", StringComparison.OrdinalIgnoreCase), out resultBool); value = Value.FromBoolean(resultBool); break; case nameof(VariableType.Float): @@ -218,6 +257,16 @@ public static string RenderTemplate(string template) return result; } +<<<<<<< HEAD + internal static void Initialize() + { + MacroDeckLogger.Info(typeof(VariableManager), "Initialize variables database..."); + _database = new SQLiteConnection(MacroDeck.VariablesFilePath); + + _database.CreateTable(); + _database.Execute("delete from Variable where 'Name'='';"); + MacroDeckLogger.Info(typeof(VariableManager), ListVariables.Count() + " variables found"); +======= internal static void Load() { MacroDeckLogger.Info(typeof(VariableManager), "Loading variables..."); @@ -240,50 +289,17 @@ internal static void Load() db.Close(); MacroDeckLogger.Info(typeof(VariableManager), Variables.Count + " variables loaded"); +>>>>>>> origin/main } - internal static void Save() + internal static void Close() { - if (MacroDeck.SafeMode || _saving || Variables == null) - { - return; - } - _saving = true; try { - var databasePath = MacroDeck.VariablesFilePath; - - var db = new SQLiteConnection(databasePath); - db.CreateTable(); - db.DeleteAll(); - - foreach (Variable variable in Variables.ToArray()) - { - - db.InsertOrReplace(variable); - } - - db.Close(); - } - catch (Exception ex) - { - MacroDeckLogger.Error("Error while saving variables: " + ex.Message); - } - finally - { - _saving = false; - } - } - - internal static void SaveAsync() - { - Task.Run(() => - { - Save(); - }); + _database.Close(); + } catch { } } - public static string ConvertNameString(string str) { return str.ToString().ToLower() diff --git a/WindowFocus/WindowFocusDetection.cs b/WindowFocus/WindowFocusDetection.cs index 7f82b9c2..9cd6f49c 100644 --- a/WindowFocus/WindowFocusDetection.cs +++ b/WindowFocus/WindowFocusDetection.cs @@ -61,7 +61,7 @@ public void WinEventProc(IntPtr hWinEventHook, uint eventType, IntPtr hwnd, int { this.OnWindowFocusChanged(this._focusedApplication, EventArgs.Empty); } - Variables.VariableManager.SetValue("focused_application", process.ProcessName, Variables.VariableType.String, "Macro Deck", false); + Variables.VariableManager.SetValue("focused_application", process.ProcessName, Variables.VariableType.String, "Macro Deck"); } } }