mirror of
https://gitlab.gnome.org/GNOME/gitg
synced 2024-10-12 10:53:29 +00:00
Rename GitgExt.RefAction to GitgExt.Action
This commit is contained in:
parent
d0aa7692d7
commit
799d90fb31
|
@ -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; }
|
||||
|
|
|
@ -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; }
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue