Basic Commit viewer.
[Gitrdone.git] / PreferencesEditor.cs
blobaffdc540b10e6232f1fd8c8bda2dae79c2b68b11
1 using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Data;
5 using System.Drawing;
6 using System.Text;
7 using System.Windows.Forms;
9 namespace Gitrdone
11 public partial class PreferencesEditor : Form
13 internal Prefs m_prefs;
15 internal PreferencesEditor(Prefs p)
17 m_prefs = p;
18 InitializeComponent();
19 m_gitPath.Text = m_prefs.GitDir;
22 private void button1_Click(object sender, EventArgs e)
24 DialogResult r = m_folderChooser.ShowDialog();
25 if (r == DialogResult.OK)
27 if (!System.IO.File.Exists(m_folderChooser.SelectedPath + System.IO.Path.DirectorySeparatorChar + "git-init-db") &&
28 !System.IO.File.Exists(m_folderChooser.SelectedPath + System.IO.Path.DirectorySeparatorChar + "git-init-db.exe"))
30 MessageBox.Show("The location does not appear to have git executables in it.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
32 else
34 m_prefs.GitDir = m_folderChooser.SelectedPath;
35 m_gitPath.Text = m_prefs.GitDir;
36 m_prefs.Save();