0
0
Fork 0

Add button in settings to open logs folder (#947)

This commit is contained in:
Xpl0itR 2020-02-17 21:35:03 +00:00 committed by GitHub
parent e5f78fb1d4
commit d736352da2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 36 deletions

View file

@ -4,6 +4,7 @@ using Ryujinx.Configuration.Hid;
using Ryujinx.Configuration.System; using Ryujinx.Configuration.System;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
@ -47,7 +48,6 @@ namespace Ryujinx.Ui
[GUI] ToggleButton _addDir; [GUI] ToggleButton _addDir;
[GUI] ToggleButton _browseDir; [GUI] ToggleButton _browseDir;
[GUI] ToggleButton _removeDir; [GUI] ToggleButton _removeDir;
[GUI] Entry _logPath;
[GUI] Entry _graphicsShadersDumpPath; [GUI] Entry _graphicsShadersDumpPath;
[GUI] Image _controller1Image; [GUI] Image _controller1Image;
@ -244,8 +244,6 @@ namespace Ryujinx.Ui
_browseThemePath.Sensitive = false; _browseThemePath.Sensitive = false;
} }
_logPath.Buffer.Text = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Ryujinx.log");
_listeningForKeypress = false; _listeningForKeypress = false;
} }
@ -366,6 +364,16 @@ namespace Ryujinx.Ui
_browseThemePath.SetStateFlags(0, true); _browseThemePath.SetStateFlags(0, true);
} }
private void OpenLogsFolder_Pressed(object sender, EventArgs args)
{
Process.Start(new ProcessStartInfo()
{
FileName = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Logs"),
UseShellExecute = true,
Verb = "open"
});
}
private void SaveToggle_Activated(object sender, EventArgs args) private void SaveToggle_Activated(object sender, EventArgs args)
{ {
List<string> gameDirs = new List<string>(); List<string> gameDirs = new List<string>();

View file

@ -1437,55 +1437,42 @@
<property name="margin_left">10</property> <property name="margin_left">10</property>
<property name="margin_right">10</property> <property name="margin_right">10</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<child>
<object class="GtkCheckButton" id="_fileLogToggle">
<property name="label" translatable="yes">Enable Logging to File</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Enables or disables logging to a file on disk</property>
<property name="halign">start</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child> <child>
<object class="GtkBox"> <object class="GtkBox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="margin_left">5</property>
<property name="margin_bottom">10</property>
<child> <child>
<object class="GtkLabel"> <object class="GtkCheckButton" id="_fileLogToggle">
<property name="label" translatable="yes">Enable Logging to File</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">Location of the log file</property> <property name="receives_default">False</property>
<property name="label" translatable="yes">Log File Location:</property> <property name="tooltip_text" translatable="yes">Enables or disables logging to a file on disk</property>
<property name="halign">start</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="draw_indicator">True</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="padding">5</property>
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="_logPath"> <object class="GtkButton" id="_openLogsFolderButton">
<property name="label" translatable="yes">Open Logs Folder</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">Location of the log file</property> <property name="receives_default">True</property>
<property name="valign">center</property> <property name="tooltip_text" translatable="yes">Opens the folder where logs are written to.</property>
<property name="editable">False</property> <property name="margin_left">5</property>
<property name="caps_lock_warning">False</property> <property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<signal name="clicked" handler="OpenLogsFolder_Pressed" swapped="no"/>
</object> </object>
<packing> <packing>
<property name="expand">True</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
@ -1494,8 +1481,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="padding">5</property> <property name="position">0</property>
<property name="position">1</property>
</packing> </packing>
</child> </child>
<child> <child>