mirror of
https://gitlab.gnome.org/GNOME/gitg
synced 2024-09-17 23:12:14 +00:00
Add a 'on_panel_activated()' method into the panel interface
We have added 'on_view_activated()' method into view interface previously, so for consistency, we do the same for panel. Let the panel have a chance to do some work after activated.
This commit is contained in:
parent
ed3e11efc3
commit
ad335d08b2
|
@ -509,6 +509,12 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable, Gtk.
|
||||||
private void on_panel_activated(UIElements elements,
|
private void on_panel_activated(UIElements elements,
|
||||||
GitgExt.UIElement element)
|
GitgExt.UIElement element)
|
||||||
{
|
{
|
||||||
|
GitgExt.Panel? panel = (GitgExt.Panel?)element;
|
||||||
|
|
||||||
|
if (panel != null)
|
||||||
|
{
|
||||||
|
panel.on_panel_activated();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void activate_default_view()
|
private void activate_default_view()
|
||||||
|
|
|
@ -37,6 +37,14 @@ namespace GitgExt
|
||||||
*/
|
*/
|
||||||
public interface Panel : Object, UIElement
|
public interface Panel : Object, UIElement
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Give the panel itself a chance to perform some actions after being
|
||||||
|
* activated.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public abstract void on_panel_activated();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,6 +75,10 @@ namespace GitgDiff
|
||||||
owned get { return "diff-symbolic"; }
|
owned get { return "diff-symbolic"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void on_panel_activated()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
private void on_selection_changed(GitgExt.ObjectSelection selection)
|
private void on_selection_changed(GitgExt.ObjectSelection selection)
|
||||||
{
|
{
|
||||||
selection.foreach_selected((commit) => {
|
selection.foreach_selected((commit) => {
|
||||||
|
|
|
@ -82,6 +82,10 @@ namespace GitgFiles
|
||||||
owned get { return "system-file-manager-symbolic"; }
|
owned get { return "system-file-manager-symbolic"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void on_panel_activated()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
private void on_selection_changed(GitgExt.ObjectSelection selection)
|
private void on_selection_changed(GitgExt.ObjectSelection selection)
|
||||||
{
|
{
|
||||||
selection.foreach_selected((commit) => {
|
selection.foreach_selected((commit) => {
|
||||||
|
|
Loading…
Reference in a new issue