2011-05-01 18:17:04 +00:00
|
|
|
|
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;
|
2011-05-03 02:32:21 +00:00
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Reflection;
|
2011-05-01 18:17:04 +00:00
|
|
|
|
|
|
|
|
|
namespace BizHawk.MultiClient
|
|
|
|
|
{
|
|
|
|
|
public partial class PathConfig : Form
|
|
|
|
|
{
|
2011-05-01 18:58:19 +00:00
|
|
|
|
//TODO:
|
2011-05-03 15:53:12 +00:00
|
|
|
|
// `exe` should be valid notation to mean path that the .exe is in ex: `exe`/NES
|
2011-05-01 18:58:19 +00:00
|
|
|
|
// ./ and ../ are always always relative to base path
|
2011-05-03 15:53:12 +00:00
|
|
|
|
// ./ and ../ in the base path are always relative to EXE path
|
2011-05-01 18:58:19 +00:00
|
|
|
|
// `recent` notation for most recently used path
|
|
|
|
|
//If "always use recent path for roms" is checked then base path of each platorm should be disabled
|
|
|
|
|
//Path text boxes shoudl be anchored L + R and the remaining widgets anchored R
|
2011-05-03 15:53:12 +00:00
|
|
|
|
//Find a way for base to always be absolute
|
2011-05-03 20:48:51 +00:00
|
|
|
|
//Make all base path text boxes not allow %recent%
|
|
|
|
|
//All path text boxes should do some kind of error checking
|
2011-05-01 18:58:19 +00:00
|
|
|
|
|
2011-05-01 18:17:04 +00:00
|
|
|
|
public PathConfig()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void PathConfig_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
2011-05-03 02:32:21 +00:00
|
|
|
|
WatchBox.Text = Global.Config.WatchPath;
|
|
|
|
|
}
|
|
|
|
|
|
2011-05-01 18:17:04 +00:00
|
|
|
|
private void SaveSettings()
|
|
|
|
|
{
|
2011-05-04 02:00:08 +00:00
|
|
|
|
Global.Config.BasePath = BasePathBox.Text;
|
2011-05-03 02:32:21 +00:00
|
|
|
|
Global.Config.WatchPath = WatchBox.Text;
|
2011-05-01 18:17:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Cancel_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.Close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OK_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
SaveSettings();
|
|
|
|
|
this.Close();
|
|
|
|
|
}
|
2011-05-01 18:58:19 +00:00
|
|
|
|
|
2011-05-02 20:37:01 +00:00
|
|
|
|
private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
|
2011-05-01 18:58:19 +00:00
|
|
|
|
{
|
2011-05-02 20:37:01 +00:00
|
|
|
|
//TODO: make base text box Controls[0] so this will focus on it
|
|
|
|
|
//tabControl1.TabPages[tabControl1.SelectedIndex].Controls[0].Focus();
|
|
|
|
|
}
|
2011-05-01 18:58:19 +00:00
|
|
|
|
|
2011-05-02 20:37:01 +00:00
|
|
|
|
private void RecentForROMs_CheckedChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (RecentForROMs.Checked)
|
|
|
|
|
{
|
|
|
|
|
NESROMsBox.Enabled = false;
|
|
|
|
|
BrowseNESROMs.Enabled = false;
|
|
|
|
|
Sega8ROMsBox.Enabled = false;
|
|
|
|
|
Sega8BrowseROMs.Enabled = false;
|
|
|
|
|
GenesisROMsBox.Enabled = false;
|
|
|
|
|
GenesisBrowseROMs.Enabled = false;
|
|
|
|
|
PCEROMsBox.Enabled = false;
|
|
|
|
|
PCEBrowseROMs.Enabled = false;
|
|
|
|
|
GBROMsBox.Enabled = false;
|
|
|
|
|
GBBrowseROMs.Enabled = false;
|
|
|
|
|
TI83ROMsBox.Enabled = false;
|
|
|
|
|
TI83BrowseROMs.Enabled = false;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
NESROMsBox.Enabled = true;
|
|
|
|
|
BrowseNESROMs.Enabled = true;
|
|
|
|
|
Sega8ROMsBox.Enabled = true;
|
|
|
|
|
Sega8BrowseROMs.Enabled = true;
|
|
|
|
|
GenesisROMsBox.Enabled = true;
|
|
|
|
|
GenesisBrowseROMs.Enabled = true;
|
|
|
|
|
PCEROMsBox.Enabled = true;
|
|
|
|
|
PCEBrowseROMs.Enabled = true;
|
|
|
|
|
GBROMsBox.Enabled = true;
|
|
|
|
|
GBBrowseROMs.Enabled = true;
|
|
|
|
|
TI83ROMsBox.Enabled = true;
|
|
|
|
|
TI83BrowseROMs.Enabled = true;
|
|
|
|
|
}
|
2011-05-01 18:58:19 +00:00
|
|
|
|
}
|
2011-05-03 02:32:21 +00:00
|
|
|
|
|
2011-05-04 02:00:08 +00:00
|
|
|
|
private void BrowseFolder(TextBox box, string Name)
|
2011-05-03 02:32:21 +00:00
|
|
|
|
{
|
|
|
|
|
FolderBrowserDialog f = new FolderBrowserDialog();
|
2011-05-04 02:00:08 +00:00
|
|
|
|
f.Description = "Set the directory for " + Name;
|
|
|
|
|
f.SelectedPath = PathManager.MakeAbsolutePath(box.Text);
|
2011-05-03 02:32:21 +00:00
|
|
|
|
DialogResult result = f.ShowDialog();
|
|
|
|
|
if (result == DialogResult.OK)
|
2011-05-04 02:00:08 +00:00
|
|
|
|
box.Text = f.SelectedPath;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void BrowseWatch_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
BrowseFolder(WatchBox, WatchDescription.Text);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void BrowseBase_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
BrowseFolder(BasePathBox, BaseDescription.Text);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void SaveButton_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
SaveSettings();
|
2011-05-03 02:32:21 +00:00
|
|
|
|
}
|
2011-05-01 18:17:04 +00:00
|
|
|
|
}
|
|
|
|
|
}
|