cleanup<*>: run vs code cleanup to format codestyle and remove unused references

This commit is contained in:
leo 2021-08-05 15:54:00 +08:00
parent 37559b60d4
commit 2cf7192ec4
41 changed files with 77 additions and 89 deletions

View file

@ -1,6 +1,5 @@
using System; using System;
using System.IO; using System.IO;
using System.Threading.Tasks;
using System.Windows; using System.Windows;
namespace SourceGit { namespace SourceGit {

View file

@ -45,7 +45,7 @@ namespace SourceGit.Commands {
var when = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddSeconds(timestamp).ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss"); var when = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddSeconds(timestamp).ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss");
var blameLine = new Models.BlameLine() { var blameLine = new Models.BlameLine() {
LineNumber = $"{data.Lines.Count+1}", LineNumber = $"{data.Lines.Count + 1}",
CommitSHA = commit, CommitSHA = commit,
Author = author, Author = author,
Time = when, Time = when,

View file

@ -101,7 +101,7 @@ namespace SourceGit.Commands {
#endif #endif
return; return;
} }
if (string.IsNullOrEmpty(e.Data)) return; if (string.IsNullOrEmpty(e.Data)) return;
if (TraitErrorAsOutput) OnReadline(e.Data); if (TraitErrorAsOutput) OnReadline(e.Data);
@ -147,7 +147,7 @@ namespace SourceGit.Commands {
start.StandardErrorEncoding = Encoding.UTF8; start.StandardErrorEncoding = Encoding.UTF8;
if (!string.IsNullOrEmpty(Cwd)) start.WorkingDirectory = Cwd; if (!string.IsNullOrEmpty(Cwd)) start.WorkingDirectory = Cwd;
var proc = new Process() { StartInfo = start }; var proc = new Process() { StartInfo = start };
try { try {
proc.Start(); proc.Start();
@ -174,6 +174,6 @@ namespace SourceGit.Commands {
/// 调用Exec时的读取函数 /// 调用Exec时的读取函数
/// </summary> /// </summary>
/// <param name="line"></param> /// <param name="line"></param>
public virtual void OnReadline(string line) {} public virtual void OnReadline(string line) { }
} }
} }

View file

@ -117,7 +117,7 @@ namespace SourceGit.Commands {
} }
} }
decorators.Sort((l, r) => { decorators.Sort((l, r) => {
if (l.Type != r.Type) { if (l.Type != r.Type) {
return (int)l.Type - (int)r.Type; return (int)l.Type - (int)r.Type;
} else { } else {

View file

@ -4,7 +4,7 @@ namespace SourceGit.Commands {
/// </summary> /// </summary>
public class Config : Command { public class Config : Command {
public Config() {} public Config() { }
public Config(string repo) { public Config(string repo) {
Cwd = repo; Cwd = repo;

View file

@ -71,7 +71,7 @@ namespace SourceGit.Commands {
} }
} }
} }
private void ProcessChanges() { private void ProcessChanges() {
if (deleted.Any()) { if (deleted.Any()) {
if (added.Count == deleted.Count) { if (added.Count == deleted.Count) {

View file

@ -12,7 +12,7 @@ namespace SourceGit.Commands {
this.repo = repo; this.repo = repo;
} }
public void Whole() { public void Whole() {
new Reset(repo, "HEAD", "--hard").Exec(); new Reset(repo, "HEAD", "--hard").Exec();
new Clean(repo).Exec(); new Clean(repo).Exec();
} }

View file

@ -69,7 +69,7 @@ namespace SourceGit.Commands {
private void OnTick(object o) { private void OnTick(object o) {
var now = DateTime.Now.ToFileTime(); var now = DateTime.Now.ToFileTime();
if (nextFetchPoint > now) return; if (nextFetchPoint > now) return;
Models.Watcher.SetEnabled(cmd.Cwd, false); Models.Watcher.SetEnabled(cmd.Cwd, false);
cmd.Exec(); cmd.Exec();
nextFetchPoint = DateTime.Now.AddMinutes(10).ToFileTime(); nextFetchPoint = DateTime.Now.AddMinutes(10).ToFileTime();

View file

@ -1,10 +1,7 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Net; using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Reflection; using System.Reflection;
using System.Text;
using System.Text.Json; using System.Text.Json;
using System.Text.Json.Serialization; using System.Text.Json.Serialization;
@ -54,7 +51,7 @@ namespace SourceGit.Models {
} }
req.GetResponse(); req.GetResponse();
} catch {} } catch { }
} }
} }
} }

View file

@ -25,7 +25,7 @@ namespace SourceGit.Models {
new MergeTool(5, "Beyond Compare 4", "BComp.exe", "\"$REMOTE\" \"$LOCAL\" \"$BASE\" \"$MERGED\"", "\"$LOCAL\" \"$REMOTE\"", FindBCompare), new MergeTool(5, "Beyond Compare 4", "BComp.exe", "\"$REMOTE\" \"$LOCAL\" \"$BASE\" \"$MERGED\"", "\"$LOCAL\" \"$REMOTE\"", FindBCompare),
new MergeTool(6, "WinMerge", "WinMergeU.exe", "-u -e \"$REMOTE\" \"$LOCAL\" \"$MERGED\"", "-u -e \"$LOCAL\" \"$REMOTE\"", FindWinMerge), new MergeTool(6, "WinMerge", "WinMergeU.exe", "-u -e \"$REMOTE\" \"$LOCAL\" \"$MERGED\"", "-u -e \"$LOCAL\" \"$REMOTE\"", FindWinMerge),
}; };
public MergeTool(int type, string name, string exec, string cmd, string diffCmd, Func<string> finder) { public MergeTool(int type, string name, string exec, string cmd, string diffCmd, Func<string> finder) {
Type = type; Type = type;
Name = name; Name = name;

View file

@ -43,7 +43,7 @@ namespace SourceGit.Models {
} }
} }
public Line() {} public Line() { }
public Line(LineMode mode, string content, string oldLine, string newLine) { public Line(LineMode mode, string content, string oldLine, string newLine) {
Mode = mode; Mode = mode;

View file

@ -2,10 +2,10 @@ using System;
using System.Net; using System.Net;
using System.Reflection; using System.Reflection;
using System.Text; using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Text.Json; using System.Text.Json;
using System.Text.Json.Serialization; using System.Text.Json.Serialization;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace SourceGit.Models { namespace SourceGit.Models {

View file

@ -101,7 +101,7 @@ namespace SourceGit.Models {
/// </summary> /// </summary>
/// <param name="commit"></param> /// <param name="commit"></param>
public void NavigateTo(string commit) { public void NavigateTo(string commit) {
Navigate?.Invoke(commit); Navigate?.Invoke(commit);
} }
/// <summary> /// <summary>
@ -140,7 +140,7 @@ namespace SourceGit.Models {
repoWatcher.Renamed += OnRepositoryChanged; repoWatcher.Renamed += OnRepositoryChanged;
repoWatcher.Changed += OnRepositoryChanged; repoWatcher.Changed += OnRepositoryChanged;
repoWatcher.Deleted += OnRepositoryChanged; repoWatcher.Deleted += OnRepositoryChanged;
repoWatcher.EnableRaisingEvents = true; repoWatcher.EnableRaisingEvents = true;
timer = new Timer(Tick, null, 100, 100); timer = new Timer(Tick, null, 100, 100);
} }
@ -176,7 +176,7 @@ namespace SourceGit.Models {
} else if (e.Name.StartsWith("refs\\stash", StringComparison.Ordinal)) { } else if (e.Name.StartsWith("refs\\stash", StringComparison.Ordinal)) {
updateStashes = DateTime.Now.AddSeconds(.5).ToFileTime(); updateStashes = DateTime.Now.AddSeconds(.5).ToFileTime();
} else if (e.Name.Equals("HEAD", StringComparison.Ordinal) || } else if (e.Name.Equals("HEAD", StringComparison.Ordinal) ||
e.Name.StartsWith("refs\\heads\\", StringComparison.Ordinal) || e.Name.StartsWith("refs\\heads\\", StringComparison.Ordinal) ||
e.Name.StartsWith("refs\\remotes\\", StringComparison.Ordinal) || e.Name.StartsWith("refs\\remotes\\", StringComparison.Ordinal) ||
e.Name.StartsWith("worktrees\\")) { e.Name.StartsWith("worktrees\\")) {
updateBranch = DateTime.Now.AddSeconds(.5).ToFileTime(); updateBranch = DateTime.Now.AddSeconds(.5).ToFileTime();

View file

@ -41,9 +41,9 @@ namespace SourceGit.Views.Controls {
/// 邮件属性定义 /// 邮件属性定义
/// </summary> /// </summary>
public static readonly DependencyProperty EmailProperty = DependencyProperty.Register( public static readonly DependencyProperty EmailProperty = DependencyProperty.Register(
"Email", "Email",
typeof(string), typeof(string),
typeof(Avatar), typeof(Avatar),
new PropertyMetadata(null, OnEmailChanged)); new PropertyMetadata(null, OnEmailChanged));
/// <summary> /// <summary>

View file

@ -1,6 +1,5 @@
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Media;
namespace SourceGit.Views.Controls { namespace SourceGit.Views.Controls {

View file

@ -1,8 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Media; using System.Windows.Media;
@ -67,7 +62,7 @@ namespace SourceGit.Views.Controls {
return; return;
} }
if (!mark.IsNewPage) { if (!mark.IsNewPage) {
if (mark.Color == 0) { if (mark.Color == 0) {
mark.icon.SetResourceReference(Path.FillProperty, "Brush.FG1"); mark.icon.SetResourceReference(Path.FillProperty, "Brush.FG1");
mark.icon.Data = mark.FindResource("Icon.Git") as Geometry; mark.icon.Data = mark.FindResource("Icon.Git") as Geometry;

View file

@ -10,9 +10,9 @@ namespace SourceGit.Views.Controls {
class ChangeStatusIcon : FrameworkElement { class ChangeStatusIcon : FrameworkElement {
public static readonly DependencyProperty ChangeProperty = DependencyProperty.Register( public static readonly DependencyProperty ChangeProperty = DependencyProperty.Register(
"Change", "Change",
typeof(Models.Change), typeof(Models.Change),
typeof(ChangeStatusIcon), typeof(ChangeStatusIcon),
new PropertyMetadata(null, ForceDirty)); new PropertyMetadata(null, ForceDirty));
public Models.Change Change { public Models.Change Change {
@ -21,9 +21,9 @@ namespace SourceGit.Views.Controls {
} }
public static readonly DependencyProperty IsLocalChangeProperty = DependencyProperty.Register( public static readonly DependencyProperty IsLocalChangeProperty = DependencyProperty.Register(
"IsLocalChange", "IsLocalChange",
typeof(bool), typeof(bool),
typeof(ChangeStatusIcon), typeof(ChangeStatusIcon),
new PropertyMetadata(false, ForceDirty)); new PropertyMetadata(false, ForceDirty));
public bool IsLocalChange { public bool IsLocalChange {
@ -76,7 +76,7 @@ namespace SourceGit.Views.Controls {
FlowDirection.LeftToRight, FlowDirection.LeftToRight,
new Typeface(new FontFamily("Microsoft YaHei UI"), FontStyles.Normal, FontWeights.Normal, FontStretches.Normal), new Typeface(new FontFamily("Microsoft YaHei UI"), FontStyles.Normal, FontWeights.Normal, FontStretches.Normal),
icon.Width * 0.8, icon.Width * 0.8,
new SolidColorBrush(Color.FromRgb(241,241,241)), new SolidColorBrush(Color.FromRgb(241, 241, 241)),
VisualTreeHelper.GetDpi(icon).PixelsPerDip); VisualTreeHelper.GetDpi(icon).PixelsPerDip);
icon.InvalidateVisual(); icon.InvalidateVisual();

View file

@ -269,7 +269,7 @@ namespace SourceGit.Views.Controls {
dc.DrawEllipse(dotFill, PENS[dot.Color], dot.Center, 3, 3); dc.DrawEllipse(dotFill, PENS[dot.Color], dot.Center, 3, 3);
} }
} }
private void DrawCurves(DrawingContext dc, double top, double bottom) { private void DrawCurves(DrawingContext dc, double top, double bottom) {
foreach (var line in data.Paths) { foreach (var line in data.Paths) {
var last = line.Points[0]; var last = line.Points[0];

View file

@ -84,7 +84,7 @@ namespace SourceGit.Views.Controls {
if (result != IntPtr.Zero) { if (result != IntPtr.Zero) {
IntPtr pathPtr = Marshal.AllocHGlobal(260 * Marshal.SystemDefaultCharSize); IntPtr pathPtr = Marshal.AllocHGlobal(260 * Marshal.SystemDefaultCharSize);
Shell32.SHGetPathFromIDList(result, pathPtr); Shell32.SHGetPathFromIDList(result, pathPtr);
if (pathPtr != IntPtr.Zero) { if (pathPtr != IntPtr.Zero) {
SelectedPath = Marshal.PtrToStringAuto(pathPtr); SelectedPath = Marshal.PtrToStringAuto(pathPtr);
ok = true; ok = true;

View file

@ -1,7 +1,7 @@
using System.Windows; using System.Windows;
using System.Windows.Media;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Documents; using System.Windows.Documents;
using System.Windows.Media;
namespace SourceGit.Views.Controls { namespace SourceGit.Views.Controls {
/// <summary> /// <summary>
@ -15,9 +15,9 @@ namespace SourceGit.Views.Controls {
private static readonly Brush HL_DELETED = new SolidColorBrush(Color.FromArgb(128, 255, 0, 0)); private static readonly Brush HL_DELETED = new SolidColorBrush(Color.FromArgb(128, 255, 0, 0));
public static readonly DependencyProperty DataProperty = DependencyProperty.Register( public static readonly DependencyProperty DataProperty = DependencyProperty.Register(
"Data", "Data",
typeof(Models.TextChanges.Line), typeof(Models.TextChanges.Line),
typeof(HighlightableTextBlock), typeof(HighlightableTextBlock),
new PropertyMetadata(null, OnContentChanged)); new PropertyMetadata(null, OnContentChanged));
public Models.TextChanges.Line Data { public Models.TextChanges.Line Data {

View file

@ -10,9 +10,9 @@ namespace SourceGit.Views.Controls {
public class IconButton : Button { public class IconButton : Button {
public static readonly DependencyProperty IconProperty = DependencyProperty.Register( public static readonly DependencyProperty IconProperty = DependencyProperty.Register(
"Icon", "Icon",
typeof(Geometry), typeof(Geometry),
typeof(IconButton), typeof(IconButton),
new PropertyMetadata(null)); new PropertyMetadata(null));
public Geometry Icon { public Geometry Icon {
@ -21,9 +21,9 @@ namespace SourceGit.Views.Controls {
} }
public static readonly DependencyProperty HoverBackgroundProperty = DependencyProperty.Register( public static readonly DependencyProperty HoverBackgroundProperty = DependencyProperty.Register(
"HoverBackground", "HoverBackground",
typeof(Brush), typeof(Brush),
typeof(IconButton), typeof(IconButton),
new PropertyMetadata(Brushes.Transparent)); new PropertyMetadata(Brushes.Transparent));
public Brush HoverBackground { public Brush HoverBackground {

View file

@ -14,9 +14,9 @@ namespace SourceGit.Views.Controls {
private Path icon = null; private Path icon = null;
public static readonly DependencyProperty IsAnimatingProperty = DependencyProperty.Register( public static readonly DependencyProperty IsAnimatingProperty = DependencyProperty.Register(
"IsAnimating", "IsAnimating",
typeof(bool), typeof(bool),
typeof(Loading), typeof(Loading),
new PropertyMetadata(false, OnIsAnimatingChanged)); new PropertyMetadata(false, OnIsAnimatingChanged));
public bool IsAnimating { public bool IsAnimating {

View file

@ -14,7 +14,7 @@ namespace SourceGit.Views.Controls {
public static readonly DependencyProperty PlaceholderProperty = DependencyProperty.Register( public static readonly DependencyProperty PlaceholderProperty = DependencyProperty.Register(
"Placeholder", "Placeholder",
typeof(string), typeof(string),
typeof(TextEdit), typeof(TextEdit),
new PropertyMetadata("")); new PropertyMetadata(""));
@ -24,9 +24,9 @@ namespace SourceGit.Views.Controls {
} }
public static readonly DependencyProperty PlaceholderBaselineProperty = DependencyProperty.Register( public static readonly DependencyProperty PlaceholderBaselineProperty = DependencyProperty.Register(
"PlaceholderBaseline", "PlaceholderBaseline",
typeof(AlignmentY), typeof(AlignmentY),
typeof(TextEdit), typeof(TextEdit),
new PropertyMetadata(AlignmentY.Center)); new PropertyMetadata(AlignmentY.Center));
public AlignmentY PlaceholderBaseline { public AlignmentY PlaceholderBaseline {

View file

@ -13,9 +13,9 @@ namespace SourceGit.Views.Controls {
/// </summary> /// </summary>
public class Tree : TreeView { public class Tree : TreeView {
public static readonly DependencyProperty MultiSelectionProperty = DependencyProperty.Register( public static readonly DependencyProperty MultiSelectionProperty = DependencyProperty.Register(
"MultiSelection", "MultiSelection",
typeof(bool), typeof(bool),
typeof(Tree), typeof(Tree),
new PropertyMetadata(false)); new PropertyMetadata(false));
public bool MultiSelection { public bool MultiSelection {
@ -90,7 +90,7 @@ namespace SourceGit.Views.Controls {
protected override void OnItemsSourceChanged(IEnumerable oldValue, IEnumerable newValue) { protected override void OnItemsSourceChanged(IEnumerable oldValue, IEnumerable newValue) {
base.OnItemsSourceChanged(oldValue, newValue); base.OnItemsSourceChanged(oldValue, newValue);
if (Selected.Count > 0) { if (Selected.Count > 0) {
Selected.Clear(); Selected.Clear();
RaiseEvent(new RoutedEventArgs(SelectionChangedEvent)); RaiseEvent(new RoutedEventArgs(SelectionChangedEvent));

View file

@ -9,9 +9,9 @@ namespace SourceGit.Views.Controls {
public class TreeItem : TreeViewItem { public class TreeItem : TreeViewItem {
public static readonly DependencyProperty IsCheckedProperty = DependencyProperty.Register( public static readonly DependencyProperty IsCheckedProperty = DependencyProperty.Register(
"IsChecked", "IsChecked",
typeof(bool), typeof(bool),
typeof(TreeItem), typeof(TreeItem),
new PropertyMetadata(false)); new PropertyMetadata(false));
public bool IsChecked { public bool IsChecked {

View file

@ -7,7 +7,7 @@ namespace SourceGit.Views.Popups {
/// 应用补丁 /// 应用补丁
/// </summary> /// </summary>
public partial class Apply : Controls.PopupWidget { public partial class Apply : Controls.PopupWidget {
private string repo = null; private string repo = null;
public string File { get; set; } public string File { get; set; }
public Apply(string repo) { public Apply(string repo) {

View file

@ -7,7 +7,7 @@ namespace SourceGit.Views.Popups {
/// </summary> /// </summary>
public partial class Fetch : Controls.PopupWidget { public partial class Fetch : Controls.PopupWidget {
private string repo = null; private string repo = null;
public Fetch(Models.Repository repo, string preferRemote) { public Fetch(Models.Repository repo, string preferRemote) {
this.repo = repo.Path; this.repo = repo.Path;
InitializeComponent(); InitializeComponent();

View file

@ -22,7 +22,7 @@ namespace SourceGit.Views.Popups {
name = branch.Substring(repo.GitFlow.Feature.Length); name = branch.Substring(repo.GitFlow.Feature.Length);
break; break;
case Models.GitFlowBranchType.Release: case Models.GitFlowBranchType.Release:
txtPrefix.Text = App.Text("GitFlow.Release"); txtPrefix.Text = App.Text("GitFlow.Release");
name = branch.Substring(repo.GitFlow.Release.Length); name = branch.Substring(repo.GitFlow.Release.Length);
break; break;
case Models.GitFlowBranchType.Hotfix: case Models.GitFlowBranchType.Hotfix:

View file

@ -39,11 +39,11 @@ namespace SourceGit.Views.Popups {
return Task.Run(() => { return Task.Run(() => {
Models.Watcher.SetEnabled(repo.Path, false); Models.Watcher.SetEnabled(repo.Path, false);
var succ = new Commands.Push( var succ = new Commands.Push(
repo.Path, repo.Path,
localBranch.Name, localBranch.Name,
remoteBranch.Remote, remoteBranch.Remote,
remoteBranch.Name.Replace(" (new)", ""), remoteBranch.Name.Replace(" (new)", ""),
withTags, withTags,
force, force,
track, track,
UpdateProgress).Exec(); UpdateProgress).Exec();

View file

@ -1,6 +1,4 @@
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace SourceGit.Views.Popups { namespace SourceGit.Views.Popups {

View file

@ -5,8 +5,8 @@ using System.Windows.Controls;
namespace SourceGit.Views.Validations { namespace SourceGit.Views.Validations {
public class CloneDir : ValidationRule { public class CloneDir : ValidationRule {
public override ValidationResult Validate(object value, CultureInfo cultureInfo) { public override ValidationResult Validate(object value, CultureInfo cultureInfo) {
return Directory.Exists(value as string) return Directory.Exists(value as string)
? ValidationResult.ValidResult ? ValidationResult.ValidResult
: new ValidationResult(false, App.Text("BadCloneFolder")); : new ValidationResult(false, App.Text("BadCloneFolder"));
} }
} }

View file

@ -5,8 +5,8 @@ namespace SourceGit.Views.Validations {
public class CommitMessage : ValidationRule { public class CommitMessage : ValidationRule {
public override ValidationResult Validate(object value, CultureInfo cultureInfo) { public override ValidationResult Validate(object value, CultureInfo cultureInfo) {
var subject = value as string; var subject = value as string;
return string.IsNullOrWhiteSpace(subject) return string.IsNullOrWhiteSpace(subject)
? new ValidationResult(false, App.Text("EmptyCommitMessage")) ? new ValidationResult(false, App.Text("EmptyCommitMessage"))
: ValidationResult.ValidResult; : ValidationResult.ValidResult;
} }
} }

View file

@ -5,8 +5,8 @@ namespace SourceGit.Views.Validations {
public class Required : ValidationRule { public class Required : ValidationRule {
public override ValidationResult Validate(object value, CultureInfo cultureInfo) { public override ValidationResult Validate(object value, CultureInfo cultureInfo) {
var path = value as string; var path = value as string;
return string.IsNullOrEmpty(path) ? return string.IsNullOrEmpty(path) ?
new ValidationResult(false, App.Text("Required")) : new ValidationResult(false, App.Text("Required")) :
ValidationResult.ValidResult; ValidationResult.ValidResult;
} }
} }

View file

@ -337,7 +337,7 @@ namespace SourceGit.Views.Widgets {
var row = sender as DataGridRow; var row = sender as DataGridRow;
if (row == null) return; if (row == null) return;
var change = row.Item as Models.Change; var change = row.Item as Models.Change;
if (change == null) return; if (change == null) return;
OpenChangeContextMenu(change); OpenChangeContextMenu(change);

View file

@ -454,7 +454,7 @@ namespace SourceGit.Views.Widgets {
private void OpenNewBranch(object sender, RoutedEventArgs e) { private void OpenNewBranch(object sender, RoutedEventArgs e) {
var current = repo.Branches.Find(x => x.IsCurrent); var current = repo.Branches.Find(x => x.IsCurrent);
if (current != null) { if (current != null) {
new Popups.CreateBranch(repo, current).Show(); new Popups.CreateBranch(repo, current).Show();
} else { } else {
Models.Exception.Raise(App.Text("CreateBranch.Idle")); Models.Exception.Raise(App.Text("CreateBranch.Idle"));
@ -815,7 +815,7 @@ namespace SourceGit.Views.Widgets {
Clipboard.SetText(branch.Remote + "/" + branch.Name); Clipboard.SetText(branch.Remote + "/" + branch.Name);
e.Handled = true; e.Handled = true;
}; };
menu.Items.Add(delete); menu.Items.Add(delete);
menu.Items.Add(new Separator()); menu.Items.Add(new Separator());
menu.Items.Add(createBranch); menu.Items.Add(createBranch);

View file

@ -170,7 +170,7 @@ namespace SourceGit.Views.Widgets {
if (dummy != seq) return; if (dummy != seq) return;
loading.Visibility = Visibility.Collapsed; loading.Visibility = Visibility.Collapsed;
mask.Visibility = Visibility.Collapsed; mask.Visibility = Visibility.Collapsed;
toolbarOptions.Visibility = Visibility.Collapsed; toolbarOptions.Visibility = Visibility.Collapsed;
noChange.Visibility = Visibility.Visible; noChange.Visibility = Visibility.Visible;
}); });
@ -226,7 +226,7 @@ namespace SourceGit.Views.Widgets {
} }
foreach (var s in splitters) s.Visibility = Visibility.Visible; foreach (var s in splitters) s.Visibility = Visibility.Visible;
editor.Columns[0].Width = new DataGridLength(lineNumberWidth, DataGridLengthUnitType.Pixel); editor.Columns[0].Width = new DataGridLength(lineNumberWidth, DataGridLengthUnitType.Pixel);
editor.Columns[1].Width = new DataGridLength(lineNumberWidth, DataGridLengthUnitType.Pixel); editor.Columns[1].Width = new DataGridLength(lineNumberWidth, DataGridLengthUnitType.Pixel);
editor.Columns[2].MinWidth = minWidth; editor.Columns[2].MinWidth = minWidth;

View file

@ -242,7 +242,7 @@ namespace SourceGit.Views.Widgets {
mask.Visibility = Visibility.Visible; mask.Visibility = Visibility.Visible;
txtCounter.Text = App.Text("Histories.Selected", selected.Count); txtCounter.Text = App.Text("Histories.Selected", selected.Count);
} else { } else {
mask.Visibility = Visibility.Visible; mask.Visibility = Visibility.Visible;
txtCounter.Text = App.Text("Histories.Guide"); txtCounter.Text = App.Text("Histories.Guide");
} }
} }

View file

@ -44,7 +44,7 @@ namespace SourceGit.Views.Widgets {
public void ShowAndStart(Controls.PopupWidget widget) { public void ShowAndStart(Controls.PopupWidget widget) {
if (locked) return; if (locked) return;
Show(widget); Show(widget);
Sure(null, null); Sure(null, null);
} }
public void UpdateProgress(string message) { public void UpdateProgress(string message) {

View file

@ -200,7 +200,7 @@ namespace SourceGit.Views.Widgets {
} }
private void OnTreeDragOver(object sender, DragEventArgs e) { private void OnTreeDragOver(object sender, DragEventArgs e) {
if (!e.Data.GetDataPresent(DataFormats.FileDrop) && !e.Data.GetDataPresent(typeof(Node))) return; if (!e.Data.GetDataPresent(DataFormats.FileDrop) && !e.Data.GetDataPresent(typeof(Node))) return;
var item = tree.FindItem(e.OriginalSource as DependencyObject); var item = tree.FindItem(e.OriginalSource as DependencyObject);
if (item == null) return; if (item == null) return;

View file

@ -30,7 +30,7 @@ namespace SourceGit.Views.Widgets {
List<Models.Change> stagedChanges = new List<Models.Change>(); List<Models.Change> stagedChanges = new List<Models.Change>();
foreach (var c in changes) { foreach (var c in changes) {
if (c.Index == Models.Change.Status.Modified if (c.Index == Models.Change.Status.Modified
|| c.Index == Models.Change.Status.Added || c.Index == Models.Change.Status.Added
|| c.Index == Models.Change.Status.Deleted || c.Index == Models.Change.Status.Deleted
|| c.Index == Models.Change.Status.Renamed) { || c.Index == Models.Change.Status.Renamed) {

View file

@ -344,7 +344,7 @@ namespace SourceGit.Views.Widgets {
explore.IsEnabled = File.Exists(path) || Directory.Exists(path); explore.IsEnabled = File.Exists(path) || Directory.Exists(path);
explore.Header = App.Text("RevealFile"); explore.Header = App.Text("RevealFile");
explore.Click += (o, e) => { explore.Click += (o, e) => {
if (node.IsFolder) Process.Start("explorer", path); if (node.IsFolder) Process.Start("explorer", path);
else Process.Start("explorer", $"/select,{path}"); else Process.Start("explorer", $"/select,{path}");
e.Handled = true; e.Handled = true;
}; };