[gitg/wip/simplify-arch] Rename view to activity
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg/wip/simplify-arch] Rename view to activity
- Date: Mon, 1 Jul 2013 08:34:42 +0000 (UTC)
commit dbbd46789521d364e947b29eba32870192fa5e69
Author: Jesse van den Kieboom <jessevdk gmail com>
Date: Mon Jul 1 10:32:47 2013 +0200
Rename view to activity
gitg/gitg-window.vala | 62 ++++++++++----------
gitg/history/gitg-history.vala | 4 +-
gitg/resources/ui/gitg-window.ui | 2 +-
libgitg-ext/Makefile.am | 2 +-
.../{gitg-ext-view.vala => gitg-ext-activity.vala} | 17 +++---
libgitg-ext/gitg-ext-application.vala | 12 ++--
libgitg-ext/gitg-ext-history-panel.vala | 2 +-
libgitg-ext/gitg-ext-history.vala | 2 +-
libgitg-ext/gitg-ext-ui-element.vala | 7 --
9 files changed, 52 insertions(+), 58 deletions(-)
---
diff --git a/gitg/gitg-window.vala b/gitg/gitg-window.vala
index 038dc20..31a0cb7 100644
--- a/gitg/gitg-window.vala
+++ b/gitg/gitg-window.vala
@@ -30,7 +30,7 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
private GitgExt.MessageBus d_message_bus;
private string? d_action;
- private UIElements<GitgExt.View> d_views;
+ private UIElements<GitgExt.Activity> d_activities;
// Widgets
[GtkChild]
@@ -40,7 +40,7 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
[GtkChild]
private Gtk.MenuButton d_gear_menu;
private MenuModel d_dash_model;
- private MenuModel d_views_model;
+ private MenuModel d_activities_model;
[GtkChild]
private Gtk.Button d_dash_button;
@@ -61,7 +61,7 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
private Gitg.DashView d_dash_view;
[GtkChild]
- private Gtk.Stack d_stack_view;
+ private Gtk.Stack d_stack_activities;
[GtkChild]
private Gtk.InfoBar infobar;
@@ -155,7 +155,7 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
}
d_dash_model = Resource.load_object<MenuModel>("ui/gitg-menus.ui", menuname + "-dash");
- d_views_model = Resource.load_object<MenuModel>("ui/gitg-menus.ui", menuname + "-views");
+ d_activities_model = Resource.load_object<MenuModel>("ui/gitg-menus.ui", menuname + "-views");
// search bar
d_search_bar.connect_entry(d_search_entry);
@@ -177,9 +177,9 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
action.set_state(new Variant.boolean(!state));
}
- public GitgExt.View? current_view
+ public GitgExt.Activity? current_activity
{
- owned get { return d_views.current; }
+ owned get { return d_activities.current; }
}
public GitgExt.MessageBus message_bus
@@ -235,11 +235,11 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
d_header_bar.set_subtitle(Markup.escape_text(head_name));
d_main_stack.transition_type = Gtk.StackTransitionType.SLIDE_LEFT;
- d_main_stack.set_visible_child(d_stack_view);
+ d_main_stack.set_visible_child(d_stack_activities);
d_commit_view_switcher.show();
d_dash_button.show();
d_dash_view.add_repository(d_repository);
- d_gear_menu.menu_model = d_views_model;
+ d_gear_menu.menu_model = d_activities_model;
}
else
{
@@ -255,11 +255,11 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
d_gear_menu.menu_model = d_dash_model;
}
- d_views.update();
+ d_activities.update();
if (d_repository != null)
{
- activate_default_view();
+ activate_default_activity();
}
}
@@ -308,7 +308,7 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
null);
notify_property("repository");
- d_views.current.reload();
+ d_activities.current.reload();
}
catch {}
}
@@ -523,21 +523,21 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
});
}
- private void on_current_view_changed(Object obj, ParamSpec pspec)
+ private void on_current_activity_changed(Object obj, ParamSpec pspec)
{
- notify_property("current_view");
+ notify_property("current_activity");
}
- private void activate_default_view()
+ private void activate_default_activity()
{
- GitgExt.View? def = null;
+ GitgExt.Activity? def = null;
- d_views.foreach((element) => {
- GitgExt.View view = (GitgExt.View)element;
+ d_activities.foreach((element) => {
+ GitgExt.Activity activity = (GitgExt.Activity)element;
- if (view.is_default_for(d_action != null ? d_action : ""))
+ if (activity.is_default_for(d_action != null ? d_action : ""))
{
- def = view;
+ def = activity;
}
return true;
@@ -545,7 +545,7 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
if (def != null)
{
- d_views.current = def;
+ d_activities.current = def;
}
}
@@ -558,23 +558,23 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
// Setup message bus
d_message_bus = new GitgExt.MessageBus();
- // Initialize peas extensions set for views
+ // Initialize peas extensions set for activities
var engine = PluginsEngine.get_default();
- var builtins = new GitgExt.View[] {
- new GitgHistory.View(this)
+ var builtins = new GitgExt.Activity[] {
+ new GitgHistory.Activity(this)
};
var extset = new Peas.ExtensionSet(engine,
- typeof(GitgExt.View),
+ typeof(GitgExt.Activity),
"application",
this);
- d_views = new UIElements<GitgExt.View>.with_builtin(builtins,
+ d_activities = new UIElements<GitgExt.Activity>.with_builtin(builtins,
extset,
- d_stack_view);
+ d_stack_activities);
- d_views.notify["current"].connect(on_current_view_changed);
+ d_activities.notify["current"].connect(on_current_activity_changed);
// Setup window geometry saving
Gdk.WindowState window_state = (Gdk.WindowState)d_state_settings.get_int("state");
@@ -616,16 +616,16 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
}
/* public API implementation of GitgExt.Application */
- public GitgExt.View? view(string id)
+ public GitgExt.Activity? activity(string id)
{
- GitgExt.View? v = d_views.lookup(id);
+ GitgExt.Activity? v = d_activities.lookup(id);
if (v != null)
{
- d_views.current = v;
+ d_activities.current = v;
}
- if (d_views.current == v)
+ if (d_activities.current == v)
{
return v;
}
diff --git a/gitg/history/gitg-history.vala b/gitg/history/gitg-history.vala
index bf438f5..a112e35 100644
--- a/gitg/history/gitg-history.vala
+++ b/gitg/history/gitg-history.vala
@@ -22,7 +22,7 @@ namespace GitgHistory
/* The main history view. This view shows the equivalent of git log, but
* in a nice way with lanes, merges, ref labels etc.
*/
- public class View : Object, GitgExt.UIElement, GitgExt.View, GitgExt.History
+ public class Activity : Object, GitgExt.UIElement, GitgExt.Activity, GitgExt.History
{
// Do this to pull in config.h before glib.h (for gettext...)
private const string version = Gitg.Config.VERSION;
@@ -43,7 +43,7 @@ namespace GitgHistory
private Gitg.UIElements<GitgExt.HistoryPanel> d_panels;
- public View(GitgExt.Application application)
+ public Activity(GitgExt.Application application)
{
Object(application: application);
}
diff --git a/gitg/resources/ui/gitg-window.ui b/gitg/resources/ui/gitg-window.ui
index 823113b..53bf020 100644
--- a/gitg/resources/ui/gitg-window.ui
+++ b/gitg/resources/ui/gitg-window.ui
@@ -232,7 +232,7 @@
</object>
</child>
<child>
- <object class="GtkStack" id="d_stack_view">
+ <object class="GtkStack" id="d_stack_activities">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
diff --git a/libgitg-ext/Makefile.am b/libgitg-ext/Makefile.am
index 9c807e9..eb869d7 100644
--- a/libgitg-ext/Makefile.am
+++ b/libgitg-ext/Makefile.am
@@ -41,7 +41,7 @@ VALA_FILES = \
gitg-ext-assembly-info.vala \
gitg-ext-application.vala \
gitg-ext-ui-element.vala \
- gitg-ext-view.vala \
+ gitg-ext-activity.vala \
gitg-ext-message-id.vala \
gitg-ext-message.vala \
gitg-ext-message-bus.vala \
diff --git a/libgitg-ext/gitg-ext-view.vala b/libgitg-ext/gitg-ext-activity.vala
similarity index 67%
rename from libgitg-ext/gitg-ext-view.vala
rename to libgitg-ext/gitg-ext-activity.vala
index c295307..78522f4 100644
--- a/libgitg-ext/gitg-ext-view.vala
+++ b/libgitg-ext/gitg-ext-activity.vala
@@ -21,26 +21,27 @@ namespace GitgExt
{
/**
- * gitg View interface.
+ * gitg Activity interface.
*
- * The View interface can be implemented to provide a main view in
- * gitg. An example of such views are the builtin History and
- * Commit views.
+ * The Activity interface can be implemented to provide a main activity in
+ * gitg. An example of such activities are the builtin History and
+ * Commit activities.
*/
-public interface View : Object, UIElement
+public interface Activity : Object, UIElement
{
/**
- * Method called to reload the view.
+ * Method called to reload the activity.
*
*/
public abstract void reload();
/**
- * Whether the view is the default for the specified action.
+ * Whether the activity is the default for the specified action.
*
* @param action the action.
*
- * Returns %TRUE if the view is the default view for @action, %FALSE otherwise.
+ * Returns %TRUE if the activity is the default activity for @action,
+ * %FALSE otherwise.
*
*/
public abstract bool is_default_for(string action);
diff --git a/libgitg-ext/gitg-ext-application.vala b/libgitg-ext/gitg-ext-application.vala
index 7b4b311..ecd3a28 100644
--- a/libgitg-ext/gitg-ext-application.vala
+++ b/libgitg-ext/gitg-ext-application.vala
@@ -41,19 +41,19 @@ public interface Application : Object
public abstract GitgExt.MessageBus message_bus { owned get; }
/**
- * The current application main view.
+ * The current application main activity.
*/
- public abstract GitgExt.View? current_view { owned get; }
+ public abstract GitgExt.Activity? current_activity { owned get; }
/**
- * Set the current application main view.
+ * Set the current application main activity.
*
- * @param id the id of the view { link UIElement.id}.
+ * @param id the id of the activity { link UIElement.id}.
*
- * @return the created new main view, or ``null`` if no view with the
+ * @return the created new main activity, or ``null`` if no activity with the
* given id exists.
*/
- public abstract GitgExt.View? view(string id);
+ public abstract GitgExt.Activity? activity(string id);
}
}
diff --git a/libgitg-ext/gitg-ext-history-panel.vala b/libgitg-ext/gitg-ext-history-panel.vala
index 8bc3547..baeb084 100644
--- a/libgitg-ext/gitg-ext-history-panel.vala
+++ b/libgitg-ext/gitg-ext-history-panel.vala
@@ -25,7 +25,7 @@ namespace GitgExt
* the history.
*
* The panel interface can be implemented to show additional details of the
- * history view. The panel will be shown in a split view below the history
+ * history activity. The panel will be shown in a split view below the history
* when activated. Panels should implement the { link UIElement.available} property to
* indicate for which state of the application the panel is active.
*
diff --git a/libgitg-ext/gitg-ext-history.vala b/libgitg-ext/gitg-ext-history.vala
index b72811b..f95ad36 100644
--- a/libgitg-ext/gitg-ext-history.vala
+++ b/libgitg-ext/gitg-ext-history.vala
@@ -22,7 +22,7 @@ namespace GitgExt
public delegate bool ForeachCommitSelectionFunc(Ggit.Commit object);
-public interface History : Object, View
+public interface History : Object, Activity
{
public signal void selection_changed();
diff --git a/libgitg-ext/gitg-ext-ui-element.vala b/libgitg-ext/gitg-ext-ui-element.vala
index cb793f6..14ec5d7 100644
--- a/libgitg-ext/gitg-ext-ui-element.vala
+++ b/libgitg-ext/gitg-ext-ui-element.vala
@@ -23,13 +23,6 @@ namespace GitgExt
/**
* gitg UIElement interface.
*
- * The GitgExtView interface can be implemented to provide a main view in
- * gitg. An example of such views are the builtin Dashboard, History and
- * Commit views.
- *
- * Implementations of the GitgExtView interface will be integrated
- * automatically in the gitg interface according to the various interface
- * methods and properties that need to be implemented.
*/
public interface UIElement : Object
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]