Skip to content

Commit

Permalink
Edit localization, check for running program to avoid conflicts.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey004 committed Nov 26, 2023
1 parent d7b3bf2 commit 19d0ff6
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 17 deletions.
13 changes: 7 additions & 6 deletions Quest2-VRC.GUI/MainWindow.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2994,7 +2994,8 @@ Enter
<value>Exiting and shutting down ADB</value>
</data>
<data name="ExitNote" xml:space="preserve">
<value>Do you want to log out?</value>
<value>Do you want to exit?
Note that this action will stop the ADB server (if rinning)</value>
</data>
<data name="Help" xml:space="preserve">
<value>Help</value>
Expand Down Expand Up @@ -3076,9 +3077,6 @@ Yes for ZeroConf, No for the old method</value>
<data name="Send" xml:space="preserve">
<value>Send only</value>
</data>
<data name="String8" xml:space="preserve">
<value>Note that this action will stop the ADB server</value>
</data>
<data name="TCPIPmode" xml:space="preserve">
<value>In TCP/IP mode</value>
</data>
Expand All @@ -3091,7 +3089,10 @@ Yes for ZeroConf, No for the old method</value>
<data name="materialButton7.Text" xml:space="preserve">
<value>Overlay mode</value>
</data>
<data name="materialButton8.Text" xml:space="preserve">
<value>Overlay setup</value>
<data name="materialCheckbox3.Text" xml:space="preserve">
<value>Disable disconnect messages</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Quest2-VRC GUI</value>
</data>
</root>
32 changes: 32 additions & 0 deletions Quest2-VRC.GUI/MainWindow.resx
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@
</data>
<data name="materialMultiLineTextBox1.Text" xml:space="preserve">
<value />
<comment>@Invariant</comment>
</data>
<data name="&gt;&gt;materialMultiLineTextBox1.Name" xml:space="preserve">
<value>materialMultiLineTextBox1</value>
Expand Down Expand Up @@ -558,6 +559,7 @@
</data>
<data name="materialTextBox1.Text" xml:space="preserve">
<value />
<comment>@Invariant</comment>
</data>
<data name="&gt;&gt;materialTextBox1.Name" xml:space="preserve">
<value>materialTextBox1</value>
Expand Down Expand Up @@ -3608,4 +3610,34 @@
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>MaterialSkin.Controls.MaterialForm, MaterialSkin, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="NewOrOld" xml:space="preserve">
<value></value>
</data>
<data name="NoADB" xml:space="preserve">
<value></value>
</data>
<data name="NoHMD" xml:space="preserve">
<value></value>
</data>
<data name="OSCFall" xml:space="preserve">
<value></value>
</data>
<data name="WakeDevice" xml:space="preserve">
<value></value>
</data>
<data name="USBCon" xml:space="preserve">
<value></value>
</data>
<data name="TCPIPmode" xml:space="preserve">
<value></value>
</data>
<data name="Send" xml:space="preserve">
<value></value>
</data>
<data name="Receive" xml:space="preserve">
<value></value>
</data>
<data name="Ready" xml:space="preserve">
<value></value>
</data>
</root>
12 changes: 9 additions & 3 deletions Quest2-VRC.GUI/MainWindow.ru-RU.resx
Original file line number Diff line number Diff line change
Expand Up @@ -3079,7 +3079,7 @@
</data>
<data name="ExitNote" xml:space="preserve">
<value>Вы хотите выйти?
Обратите внимание, что это действие приведет к остановке сервера ADB</value>
Обратите внимание, что это действие приведет к остановке ADB-сервера (если он запущен)</value>
</data>
<data name="LocalHostErr" xml:space="preserve">
<value>Данная функция не может быть активирована, если HostIP не равен 127.0.0.1</value>
Expand Down Expand Up @@ -3125,7 +3125,13 @@
<data name="materialButton7.Text" xml:space="preserve">
<value>Режим оверлея</value>
</data>
<data name="materialButton8.Text" xml:space="preserve">
<value>Настройка оверлея</value>
<data name="$this.Text" xml:space="preserve">
<value>Quest2-VRC GUI</value>
</data>
<data name="materialLabel5.Text" xml:space="preserve">
<value>Status msg</value>
</data>
<data name="materialLabel4.Text" xml:space="preserve">
<value>Status msg</value>
</data>
</root>
34 changes: 26 additions & 8 deletions Quest2-VRC.GUI/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.CommandLine;
using System.Diagnostics;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Threading;
Expand Down Expand Up @@ -32,7 +33,7 @@ static void Main(string[] args)
forceeng,
enhancedoculuscontrol
};

_cmd.SetHandler<bool, bool>(Handler, forceeng, enhancedoculuscontrol);
_cmd.Invoke(args);

Expand Down Expand Up @@ -76,23 +77,40 @@ static void Handler(bool forceeng, bool enhancedoculuscontrol)
Console.WriteLine("Logs redirected to main window");
GUI();
}

}
Environment.Exit(1987); //Hehe yep I FNAF fan :) (This exit code = 0)
}
static void GUI()
{
try

Process[] processes = Process.GetProcessesByName(System.Reflection.Assembly.GetExecutingAssembly().GetName().Name);


if (processes.Length > 1)
{

Application.EnableVisualStyles();
Application.SetHighDpiMode(HighDpiMode.SystemAware);
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainWindow());
MessageBox.Show("Only one instance of the program can be opened!", System.Reflection.Assembly.GetExecutingAssembly().GetName().Name, MessageBoxButtons.OK, MessageBoxIcon.Error);
Environment.Exit(1987);
}
catch (SystemException)
else
{
// Ignores errors
try
{
Application.EnableVisualStyles();
Application.SetHighDpiMode(HighDpiMode.SystemAware);
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainWindow());
}
catch (SystemException)
{
// Ignores errors
}

}


}
}
}

0 comments on commit 19d0ff6

Please sign in to comment.