GUI: Add option to register file types (#4250)
* Add FileAssociationHelper.cs * Add register file types option to gtk * Add register file types option to avalonia * Add Windows support to FileAssociationHelper.cs * linux: Add uninstall support for file types * Ignore .glade~ backup files * Rename Register/Unregister methods * gtk: Add manage file types submenu * ava: Add manage file types submenu * windows: Add uninstall support for file types * Don't invert uninstall condition (formatting change) Co-authored-by: gdkchan <gab.dark.100@gmail.com> * Add IsTypesRegisteredWindows & Fix Windows install function * Add AreMimeTypesRegisteredLinux() * Fix wrong indention Co-authored-by: AcK77 <acoustik666@gmail.com> Co-authored-by: gdkchan <gab.dark.100@gmail.com>
This commit is contained in:
parent
dc30d94852
commit
ad6ff6ce99
10 changed files with 506 additions and 308 deletions
|
@ -44,7 +44,6 @@ using System.IO;
|
|||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using GUI = Gtk.Builder.ObjectAttribute;
|
||||
using ShaderCacheLoadingState = Ryujinx.Graphics.Gpu.Shader.ShaderCacheState;
|
||||
|
||||
|
@ -109,6 +108,7 @@ namespace Ryujinx.Ui
|
|||
[GUI] CheckMenuItem _favToggle;
|
||||
[GUI] MenuItem _firmwareInstallDirectory;
|
||||
[GUI] MenuItem _firmwareInstallFile;
|
||||
[GUI] MenuItem _fileTypesSubMenu;
|
||||
[GUI] Label _fifoStatus;
|
||||
[GUI] CheckMenuItem _iconToggle;
|
||||
[GUI] CheckMenuItem _developerToggle;
|
||||
|
@ -220,6 +220,8 @@ namespace Ryujinx.Ui
|
|||
_pauseEmulation.Sensitive = false;
|
||||
_resumeEmulation.Sensitive = false;
|
||||
|
||||
_fileTypesSubMenu.Visible = FileAssociationHelper.IsTypeAssociationSupported;
|
||||
|
||||
if (ConfigurationState.Instance.Ui.GuiColumns.FavColumn) _favToggle.Active = true;
|
||||
if (ConfigurationState.Instance.Ui.GuiColumns.IconColumn) _iconToggle.Active = true;
|
||||
if (ConfigurationState.Instance.Ui.GuiColumns.AppColumn) _appToggle.Active = true;
|
||||
|
@ -1500,6 +1502,30 @@ namespace Ryujinx.Ui
|
|||
});
|
||||
}
|
||||
|
||||
private void InstallFileTypes_Pressed(object sender, EventArgs e)
|
||||
{
|
||||
if (FileAssociationHelper.Install())
|
||||
{
|
||||
GtkDialog.CreateInfoDialog("Install file types", "File types successfully installed!");
|
||||
}
|
||||
else
|
||||
{
|
||||
GtkDialog.CreateErrorDialog("Failed to install file types.");
|
||||
}
|
||||
}
|
||||
|
||||
private void UninstallFileTypes_Pressed(object sender, EventArgs e)
|
||||
{
|
||||
if (FileAssociationHelper.Uninstall())
|
||||
{
|
||||
GtkDialog.CreateInfoDialog("Uninstall file types", "File types successfully uninstalled!");
|
||||
}
|
||||
else
|
||||
{
|
||||
GtkDialog.CreateErrorDialog("Failed to uninstall file types.");
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleRelaunch()
|
||||
{
|
||||
if (_userChannelPersistence.PreviousIndex != -1 && _userChannelPersistence.ShouldRestart)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue