[gnome-builder/wip/libide-merge: 34/35] bring back gaction commands
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/libide-merge: 34/35] bring back gaction commands
- Date: Thu, 19 Mar 2015 08:57:25 +0000 (UTC)
commit e87438c57442a4db3443e78ae40471967dd5b6db
Author: Christian Hergert <christian hergert me>
Date: Thu Mar 19 01:48:38 2015 -0700
bring back gaction commands
src/commands/gb-command-gaction-provider.c | 6 +++---
src/commands/gb-command-gaction-provider.h | 2 ++
src/commands/gb-command-provider.c | 6 +++---
src/commands/gb-command-provider.h | 2 ++
src/gnome-builder.mk | 12 ++++++------
src/workbench/gb-workbench.c | 8 ++++++++
6 files changed, 24 insertions(+), 12 deletions(-)
---
diff --git a/src/commands/gb-command-gaction-provider.c b/src/commands/gb-command-gaction-provider.c
index 6a50102..0d77ce4 100644
--- a/src/commands/gb-command-gaction-provider.c
+++ b/src/commands/gb-command-gaction-provider.c
@@ -23,9 +23,9 @@
#include "gb-command-gaction-provider.h"
#include "gb-command-gaction.h"
+#include "gb-view.h"
-G_DEFINE_TYPE (GbCommandGactionProvider, gb_command_gaction_provider,
- GB_TYPE_COMMAND_PROVIDER)
+G_DEFINE_TYPE (GbCommandGactionProvider, gb_command_gaction_provider, GB_TYPE_COMMAND_PROVIDER)
GbCommandProvider *
gb_command_gaction_provider_new (GbWorkbench *workbench)
@@ -38,7 +38,7 @@ gb_command_gaction_provider_new (GbWorkbench *workbench)
static GList *
discover_groups (GbCommandGactionProvider *provider)
{
- GbDocumentView *view;
+ GbView *view;
GApplication *application;
GbWorkbench *workbench;
GtkWidget *widget;
diff --git a/src/commands/gb-command-gaction-provider.h b/src/commands/gb-command-gaction-provider.h
index a9a0a80..1ace8a0 100644
--- a/src/commands/gb-command-gaction-provider.h
+++ b/src/commands/gb-command-gaction-provider.h
@@ -35,6 +35,8 @@ typedef struct _GbCommandGactionProvider GbCommandGactionProvider;
typedef struct _GbCommandGactionProviderClass GbCommandGactionProviderClass;
typedef struct _GbCommandGactionProviderPrivate GbCommandGactionProviderPrivate;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (GbCommandGactionProvider, g_object_unref)
+
struct _GbCommandGactionProvider
{
GbCommandProvider parent;
diff --git a/src/commands/gb-command-provider.c b/src/commands/gb-command-provider.c
index 6602a64..ca2cc5f 100644
--- a/src/commands/gb-command-provider.c
+++ b/src/commands/gb-command-provider.c
@@ -23,9 +23,9 @@
struct _GbCommandProviderPrivate
{
- GbWorkbench *workbench;
- GbView *active_view;
- gint priority;
+ GbWorkbench *workbench;
+ GbView *active_view;
+ gint priority;
};
G_DEFINE_TYPE_WITH_PRIVATE (GbCommandProvider, gb_command_provider, G_TYPE_OBJECT)
diff --git a/src/commands/gb-command-provider.h b/src/commands/gb-command-provider.h
index 5cce3ac..21c4b12 100644
--- a/src/commands/gb-command-provider.h
+++ b/src/commands/gb-command-provider.h
@@ -39,6 +39,8 @@ typedef struct _GbCommandProvider GbCommandProvider;
typedef struct _GbCommandProviderClass GbCommandProviderClass;
typedef struct _GbCommandProviderPrivate GbCommandProviderPrivate;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (GbCommandProvider, g_object_unref)
+
struct _GbCommandProvider
{
GObject parent;
diff --git a/src/gnome-builder.mk b/src/gnome-builder.mk
index 2d7f0aa..e4823d0 100644
--- a/src/gnome-builder.mk
+++ b/src/gnome-builder.mk
@@ -10,10 +10,14 @@ libgnome_builder_la_SOURCES = \
src/app/gb-application-actions.c \
src/app/gb-application-actions.h \
src/app/gb-application-private.h \
- src/commands/gb-command-bar.c \
- src/commands/gb-command-bar.h \
src/commands/gb-command-bar-item.c \
src/commands/gb-command-bar-item.h \
+ src/commands/gb-command-bar.c \
+ src/commands/gb-command-bar.h \
+ src/commands/gb-command-gaction-provider.c \
+ src/commands/gb-command-gaction-provider.h \
+ src/commands/gb-command-gaction.c \
+ src/commands/gb-command-gaction.h \
src/commands/gb-command-manager.c \
src/commands/gb-command-manager.h \
src/commands/gb-command-provider.c \
@@ -125,10 +129,6 @@ libgnome_builder_la_SOURCES = \
$(NULL)
disabled_files = \
- src/commands/gb-command-gaction-provider.c \
- src/commands/gb-command-gaction-provider.h \
- src/commands/gb-command-gaction.c \
- src/commands/gb-command-gaction.h \
src/commands/gb-command-vim-provider.c \
src/commands/gb-command-vim-provider.h \
src/commands/gb-command-vim.c \
diff --git a/src/workbench/gb-workbench.c b/src/workbench/gb-workbench.c
index 414c273..1ec405f 100644
--- a/src/workbench/gb-workbench.c
+++ b/src/workbench/gb-workbench.c
@@ -21,6 +21,7 @@
#include <glib/gi18n.h>
#include <ide.h>
+#include "gb-command-gaction-provider.h"
#include "gb-widget.h"
#include "gb-workbench-actions.h"
#include "gb-workbench-private.h"
@@ -342,12 +343,19 @@ gb_workbench_class_init (GbWorkbenchClass *klass)
static void
gb_workbench_init (GbWorkbench *self)
{
+ g_autoptr(GbCommandProvider) gaction_provider = NULL;
+
IDE_ENTRY;
gtk_widget_init_template (GTK_WIDGET (self));
self->command_manager = gb_command_manager_new ();
+ gaction_provider = g_object_new (GB_TYPE_COMMAND_GACTION_PROVIDER,
+ "workbench", self,
+ NULL);
+ gb_command_manager_add_provider (self->command_manager, gaction_provider);
+
IDE_EXIT;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]