[gitg] Put back activating the default view for an action
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg] Put back activating the default view for an action
- Date: Tue, 2 Jul 2013 13:29:24 +0000 (UTC)
commit 4df870d91c5082c2ef6d4bcd3d56b69154764412
Author: Jesse van den Kieboom <jessevdk gmail com>
Date: Mon Jul 1 09:53:28 2013 +0200
Put back activating the default view for an action
gitg/gitg-window.vala | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/gitg/gitg-window.vala b/gitg/gitg-window.vala
index 1a9de6d..2d4272e 100644
--- a/gitg/gitg-window.vala
+++ b/gitg/gitg-window.vala
@@ -244,6 +244,11 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
}
d_views.update();
+
+ if (d_repository != null)
+ {
+ activate_default_view();
+ }
}
protected override bool window_state_event(Gdk.EventWindowState event)
@@ -511,6 +516,27 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
notify_property("current_view");
}
+ private void activate_default_view()
+ {
+ GitgExt.View? def = null;
+
+ d_views.foreach((element) => {
+ GitgExt.View view = (GitgExt.View)element;
+
+ if (view.is_default_for(d_action != null ? d_action : ""))
+ {
+ def = view;
+ }
+
+ return true;
+ });
+
+ if (def != null)
+ {
+ d_views.current = def;
+ }
+ }
+
private bool init(Cancellable? cancellable)
{
// Settings
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]