mirror of
https://gitlab.gnome.org/GNOME/gitg
synced 2024-10-30 06:40:39 +00:00
Removed test application for diff view
This commit is contained in:
parent
59643a0d06
commit
f7cfa3baf5
1 changed files with 0 additions and 51 deletions
|
@ -1,51 +0,0 @@
|
|||
class Test
|
||||
{
|
||||
public static void main(string[] args)
|
||||
{
|
||||
Gtk.init(ref args);
|
||||
|
||||
var wnd = new Gtk.Window();
|
||||
wnd.set_default_size(800, 600);
|
||||
var sw = new Gtk.ScrolledWindow(null, null);
|
||||
|
||||
var v = new GitgGtk.DiffView(null);
|
||||
sw.add(v);
|
||||
|
||||
var repo = Ggit.Repository.open(File.new_for_path("../"));
|
||||
|
||||
if (repo == null)
|
||||
{
|
||||
stderr.printf("Failed\n");
|
||||
return;
|
||||
}
|
||||
|
||||
v.options = new Ggit.DiffOptions(Ggit.DiffFlags.NORMAL,
|
||||
3,
|
||||
3,
|
||||
null,
|
||||
null,
|
||||
null);
|
||||
|
||||
var commit = repo.get_head().lookup() as Ggit.Commit;
|
||||
v.commit = commit;
|
||||
|
||||
v.key_press_event.connect((vv, ev) => {
|
||||
var state = ev.state & Gtk.accelerator_get_default_mod_mask();
|
||||
|
||||
if (ev.keyval == Gdk.Key.r && state == Gdk.ModifierType.CONTROL_MASK)
|
||||
{
|
||||
v.reload_bypass_cache();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
wnd.add(sw);
|
||||
wnd.show_all();
|
||||
|
||||
Gtk.main();
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue