2
using System.Collections;
7
using MonoDevelop.Components;
8
4
using MonoDevelop.Core;
9
using MonoDevelop.Core.Gui;
10
5
using MonoDevelop.Ide.Gui;
12
8
namespace MonoDevelop.VersionControl.Views
64
60
if (history == null)
66
62
LogView d = new LogView (filepath, isDirectory, history, vc);
67
MonoDevelop.Ide.Gui.IdeApp.Workbench.OpenDocument (d, true);
63
IdeApp.Workbench.OpenDocument (d, true);
94
90
commandbar.IconSize = Gtk.IconSize.Menu;
95
91
box.PackStart (commandbar, false, false, 0);
97
if (!isDirectory && vinfo != null) {
98
94
Gtk.ToolButton button = new Gtk.ToolButton (new Gtk.Image ("vc-diff", Gtk.IconSize.Menu), GettextCatalog.GetString ("View Changes"));
99
95
button.IsImportant = true;
100
button.Clicked += new EventHandler (DiffButtonClicked);
101
commandbar.Insert (button, -1);
103
button = new Gtk.ToolButton (new Gtk.Image (Gtk.Stock.Open, Gtk.IconSize.Menu), GettextCatalog.GetString ("View File"));
104
button.IsImportant = true;
105
button.Clicked += new EventHandler (ViewTextButtonClicked);
106
commandbar.Insert (button, -1);
97
button.Clicked += new EventHandler (DirDiffButtonClicked);
98
commandbar.Insert (button, -1);
100
button.Clicked += new EventHandler (DiffButtonClicked);
101
commandbar.Insert (button, -1);
103
button = new Gtk.ToolButton (new Gtk.Image (Gtk.Stock.Open, Gtk.IconSize.Menu), GettextCatalog.GetString ("View File"));
104
button.IsImportant = true;
105
button.Clicked += new EventHandler (ViewTextButtonClicked);
106
commandbar.Insert (button, -1);
109
110
revertButton = new Gtk.ToolButton (new Gtk.Image ("vc-revert-command", Gtk.IconSize.Menu), GettextCatalog.GetString ("Revert changes from this revision"));
180
181
TreeViewColumn colOperation = new TreeViewColumn ();
181
182
CellRendererText crt = new CellRendererText ();
182
CellRendererPixbuf crp = new CellRendererPixbuf ();
183
var crp = new CellRendererPixbuf ();
183
184
colOperation.Title = GettextCatalog.GetString ("Operation");
184
185
colOperation.PackStart (crp, false);
185
186
colOperation.PackStart (crt, true);
251
252
actionIcon = ImageService.GetPixbuf ("gtk-edit", Gtk.IconSize.Menu);
253
254
action = rp.ActionDescription;
254
actionIcon = ImageService.GetPixbuf (MonoDevelop.Core.Gui.Stock.Empty, Gtk.IconSize.Menu);
255
actionIcon = ImageService.GetPixbuf (MonoDevelop.Ide.Gui.Stock.Empty, Gtk.IconSize.Menu);
257
258
Gdk.Pixbuf fileIcon = DesktopService.GetPixbufForFile (rp.Path, Gtk.IconSize.Menu);
266
267
new DiffWorker (Path.GetFileName (filepath), vc, vinfo.RepositoryPath, d).Start ();
270
void DirDiffButtonClicked (object src, EventArgs args) {
271
Revision d = GetSelectedRev ();
274
new DirectoryDiffWorker (filepath, vc, d).Start ();
269
277
void ViewTextButtonClicked (object src, EventArgs args) {
270
278
Revision d = GetSelectedRev ();
353
/// Background worker to create a revision-specific diff for a directory
354
internal class DirectoryDiffWorker: Task
362
public DirectoryDiffWorker (FilePath path, Repository repo, Revision revision)
365
name = string.Format ("{0} (revision {1})", path.FileName, revision);
367
this.revision = revision;
370
protected override string GetDescription ()
372
return GettextCatalog.GetString ("Retrieving changes in {0} ...", name, revision);
376
protected override void Run ()
378
DiffInfo[] diffs = repo.PathDiff (path, revision.GetPrevious (), revision);
379
patch = repo.CreatePatch (diffs);
382
protected override void Finished ()
385
IdeApp.Workbench.NewDocument (name, "text/x-diff", patch);
347
391
internal class HistoricalFileView
350
394
string mimeType = DesktopService.GetMimeTypeForUri (file);
351
395
if (mimeType == null || mimeType.Length == 0)
352
396
mimeType = "text/plain";
353
Document doc = MonoDevelop.Ide.Gui.IdeApp.Workbench.NewDocument (name, mimeType, text);
397
Document doc = IdeApp.Workbench.NewDocument (name, mimeType, text);
354
398
doc.IsDirty = false;