adding includeor exclude enum to settingswindow.glade

This commit is contained in:
avikpl1911 2024-02-07 16:30:14 +05:30
parent 1df084a635
commit cfba977275
2 changed files with 37 additions and 0 deletions

View file

@ -27,6 +27,9 @@ namespace Ryujinx.Ui.Windows
{
public class SettingsWindow : Window
{
private readonly MainWindow _parent;
private readonly ListStore _gameDirsBoxStore;
private readonly ListStore _gameDirsBoxStore1;
@ -38,6 +41,12 @@ namespace Ryujinx.Ui.Windows
private float _previousVolumeLevel;
private bool _directoryChanged = false;
private enum IncludeorExclude { Include, Exclude }
private IncludeorExclude _includeorexlude = IncludeorExclude.Include;
#pragma warning disable CS0649, IDE0044 // Field is never assigned to, Add readonly modifier
[GUI] CheckButton _traceLogToggle;
[GUI] CheckButton _errorLogToggle;
@ -766,12 +775,14 @@ namespace Ryujinx.Ui.Windows
{
Console.WriteLine("here");
_include_exclude_dir.Label = "exclude";
_includeorexlude = IncludeorExclude.Exclude;
}
private void onRowActivated1(object sender, ButtonReleaseEventArgs args)
{
Console.WriteLine("here");
_include_exclude_dir.Label = "include";
_includeorexlude = IncludeorExclude.Include;
}
@ -824,6 +835,31 @@ namespace Ryujinx.Ui.Windows
((ToggleButton)sender).SetStateFlags(StateFlags.Normal, true);
}
private void Include_exclude_Pressed(object sender,EventArgs args)
{
if (_includeorexlude==IncludeorExclude.Exclude)
{
TreeSelection selection = _gameDirsBox.Selection;
if (selection.GetSelected(out TreeIter treeIter))
{
var model = _gameDirsBox.Model;
Console.WriteLine(model.GetValue(treeIter,0));
}
((ToggleButton)sender).SetStateFlags(StateFlags.Normal, true);
}
else if (_includeorexlude == IncludeorExclude.Include)
{
}
}
private void RemoveDir_Pressed(object sender, EventArgs args)
{
TreeSelection selection = _gameDirsBox.Selection;

View file

@ -429,6 +429,7 @@
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes"> Add a game tyu directory to the list</property>
<signal name="toggled" handler="Include_exclude_Pressed" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>