Revision 368e06fd trunk/Pithos.Client.WPF/FileProperties/ConflictsViewModel.cs
b/trunk/Pithos.Client.WPF/FileProperties/ConflictsViewModel.cs | ||
---|---|---|
24 | 24 |
KeepLocal, |
25 | 25 |
[Description("Keep Server")] |
26 | 26 |
KeepServer, |
27 |
[Description("Keep Both")] |
|
28 |
KeepBoth, |
|
27 |
/* [Description("Keep Both")]
|
|
28 |
KeepBoth,*/
|
|
29 | 29 |
[Description("Clear Record")] |
30 | 30 |
ClearLocal |
31 | 31 |
} |
... | ... | |
72 | 72 |
|
73 | 73 |
public DateTime CloudModified { get; set; } |
74 | 74 |
|
75 |
public FileState State { get; set; } |
|
76 |
|
|
75 | 77 |
public void GoToFile() |
76 | 78 |
{ |
77 | 79 |
if (!File.Exists(FilePath) && !Directory.Exists(FilePath)) |
... | ... | |
119 | 121 |
protected override void OnViewLoaded(object view) |
120 | 122 |
{ |
121 | 123 |
base.OnViewLoaded(view); |
124 |
LoadConflicts(); |
|
125 |
} |
|
126 |
|
|
127 |
private void LoadConflicts() |
|
128 |
{ |
|
122 | 129 |
var fileStates = from state in FileState.Queryable |
123 | 130 |
where state.FileStatus == FileStatus.Conflict || |
124 | 131 |
state.OverlayStatus == FileOverlayStatus.Conflict |
... | ... | |
126 | 133 |
var conflicts = from state in fileStates |
127 | 134 |
let info = FileInfoExtensions.FromPath(state.FilePath) |
128 | 135 |
select new ConflictFile |
129 |
{ |
|
130 |
FilePath = state.FilePath, |
|
131 |
Reason = state.ConflictReason ?? state.FileStatus.Name(), |
|
132 |
LocalModified = info.LastWriteTime |
|
133 |
}; |
|
136 |
{ |
|
137 |
FilePath = state.FilePath, |
|
138 |
State = state, |
|
139 |
Reason = state.ConflictReason ?? state.FileStatus.Name(), |
|
140 |
LocalModified = info.LastWriteTime |
|
141 |
}; |
|
134 | 142 |
Conflicts.Clear(); |
135 | 143 |
foreach (var conflict in conflicts) |
136 | 144 |
{ |
137 | 145 |
Conflicts.Add(conflict); |
138 | 146 |
} |
139 |
NotifyOfPropertyChange(()=>Conflicts);
|
|
147 |
NotifyOfPropertyChange(() => Conflicts);
|
|
140 | 148 |
NotifyOfPropertyChange(() => HasConflicts); |
141 | 149 |
NotifyOfPropertyChange(() => HasNoConflicts); |
142 | 150 |
StatusKeeper.CleanupOrphanStates(); |
... | ... | |
154 | 162 |
Process.Start("explorer.exe", "/select, " + fullPath); |
155 | 163 |
} |
156 | 164 |
|
165 |
public void Refresh() |
|
166 |
{ |
|
167 |
LoadConflicts(); |
|
168 |
} |
|
169 |
|
|
157 | 170 |
public void Apply() |
158 | 171 |
{ |
159 | 172 |
var conflicts = from conflict in Conflicts |
Also available in: Unified diff