Rename GitgExt.RefAction to GitgExt.Action

This commit is contained in:
Jesse van den Kieboom 2014-01-18 13:20:16 +01:00 committed by Jesse van den Kieboom
parent d0aa7692d7
commit 799d90fb31
3 changed files with 25 additions and 3 deletions

View file

@ -20,7 +20,7 @@
namespace Gitg
{
class RefActionDelete : GitgExt.RefAction, GitgExt.Action, Object
class RefActionDelete : GitgExt.Action, GitgExt.RefAction, Object
{
public Ggit.Ref reference { get; construct set; }
public GitgExt.ActionInterface action_interface { get; construct set; }

View file

@ -20,7 +20,7 @@
namespace Gitg
{
class RefActionRename : GitgExt.RefAction, GitgExt.Action, Object
class RefActionRename : GitgExt.Action, GitgExt.RefAction, Object
{
public Ggit.Ref reference { get; construct set; }
public GitgExt.ActionInterface action_interface { get; construct set; }

View file

@ -26,8 +26,30 @@ public interface Action : Object
public abstract string label { get; }
public abstract bool enabled { get; }
public abstract bool visible { get; }
public abstract void activate();
public virtual signal void activated()
{
}
public virtual void populate_menu(Gtk.Menu menu)
{
var item = new Gtk.MenuItem.with_label(label);
if (enabled)
{
item.activate.connect(() => {
activated();
});
}
else
{
item.sensitive = false;
}
item.show();
menu.append(item);
}
}
}