mirror of
https://gitlab.gnome.org/GNOME/gitg
synced 2024-08-28 04:19:40 +00:00
Implement GitgExt.Action interface
This commit is contained in:
parent
0974aac605
commit
3818eacb09
|
@ -22,20 +22,41 @@ namespace Gitg
|
|||
|
||||
class RefActionDelete : GitgExt.Action, GitgExt.RefAction, Object
|
||||
{
|
||||
public Ggit.Ref reference { get; construct set; }
|
||||
// Do this to pull in config.h before glib.h (for gettext...)
|
||||
private const string version = Gitg.Config.VERSION;
|
||||
|
||||
public GitgExt.ActionInterface action_interface { get; construct set; }
|
||||
public Ggit.Ref reference { get; construct set; }
|
||||
|
||||
public RefActionDelete(GitgExt.ActionInterface action_interface, Ggit.Ref reference)
|
||||
{
|
||||
Object(action_interface: action_interface, reference: reference);
|
||||
}
|
||||
|
||||
public string label
|
||||
{
|
||||
get { return "Delete"; }
|
||||
get { return _("Delete"); }
|
||||
}
|
||||
|
||||
public bool enabled
|
||||
{
|
||||
get
|
||||
{
|
||||
var r = reference as Gitg.Ref;
|
||||
var rtype = r.parsed_name.rtype;
|
||||
|
||||
return rtype == RefType.BRANCH
|
||||
|| rtype == RefType.TAG
|
||||
|| rtype == RefType.REMOTE;
|
||||
}
|
||||
}
|
||||
|
||||
public bool visible
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public void activate()
|
||||
public void activated()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,21 +22,36 @@ namespace Gitg
|
|||
|
||||
class RefActionRename : GitgExt.Action, GitgExt.RefAction, Object
|
||||
{
|
||||
public Ggit.Ref reference { get; construct set; }
|
||||
// Do this to pull in config.h before glib.h (for gettext...)
|
||||
private const string version = Gitg.Config.VERSION;
|
||||
|
||||
public GitgExt.ActionInterface action_interface { get; construct set; }
|
||||
public Ggit.Ref reference { get; construct set; }
|
||||
|
||||
public RefActionRename(GitgExt.ActionInterface action_interface, Ggit.Ref reference)
|
||||
{
|
||||
Object(action_interface: action_interface, reference: reference);
|
||||
}
|
||||
|
||||
public string label
|
||||
{
|
||||
get { return "Rename"; }
|
||||
get { return _("Rename"); }
|
||||
}
|
||||
|
||||
public bool enabled
|
||||
public bool visible
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public void activate()
|
||||
public bool enabled
|
||||
{
|
||||
get
|
||||
{
|
||||
var r = reference as Gitg.Ref;
|
||||
var rtype = r.parsed_name.rtype;
|
||||
|
||||
return rtype == RefType.BRANCH || rtype == RefType.TAG;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue