[gnome-builder: 123/139] support: port to libide-gui



commit 48b13e296be65e73de511f91ae08879cc645e7a4
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jan 9 17:38:31 2019 -0800

    support: port to libide-gui

 src/plugins/support/gtk/menus.ui                   |  4 ++--
 .../support/ide-support-application-addin.c        |  9 +++++++--
 src/plugins/support/ide-support.c                  |  2 +-
 src/plugins/support/meson.build                    | 23 ++++++++--------------
 .../{ide-support-plugin.c => support-plugin.c}     |  8 ++++----
 src/plugins/support/support.gresource.xml          |  4 +---
 src/plugins/support/support.plugin                 |  4 ++--
 7 files changed, 25 insertions(+), 29 deletions(-)
---
diff --git a/src/plugins/support/gtk/menus.ui b/src/plugins/support/gtk/menus.ui
index 710acf348..26bfa30af 100644
--- a/src/plugins/support/gtk/menus.ui
+++ b/src/plugins/support/gtk/menus.ui
@@ -1,8 +1,8 @@
 <?xml version="1.0"?>
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
-  <menu id="gear-menu">
-    <section id="gear-menu-placeholder-1">
+  <menu id="ide-primary-workspace-menu">
+    <section id="ide-primary-workspace-menu-placeholder3">
       <item>
         <attribute name="label" translatable="yes">Generate Support Log</attribute>
         <attribute name="action">app.generate-support</attribute>
diff --git a/src/plugins/support/ide-support-application-addin.c 
b/src/plugins/support/ide-support-application-addin.c
index 702682bc5..4304dbd8c 100644
--- a/src/plugins/support/ide-support-application-addin.c
+++ b/src/plugins/support/ide-support-application-addin.c
@@ -19,10 +19,10 @@
  */
 
 #include <glib/gi18n.h>
-#include <ide.h>
+#include <libide-gui.h>
 
-#include "ide-support-application-addin.h"
 #include "ide-support.h"
+#include "ide-support-application-addin.h"
 
 struct _IdeSupportApplicationAddin
 {
@@ -53,6 +53,7 @@ generate_support_activate (GSimpleAction              *action,
                            GVariant                   *variant,
                            IdeSupportApplicationAddin *self)
 {
+  g_autoptr(GFile) file = NULL;
   GtkWidget *dialog;
   gchar *text = NULL;
   GList *windows;
@@ -68,6 +69,8 @@ generate_support_activate (GSimpleAction              *action,
   log_path = g_build_filename (g_get_home_dir (), name, NULL);
   g_free (name);
 
+  file = g_file_new_for_path (log_path);
+
   windows = gtk_application_get_windows (GTK_APPLICATION (IDE_APPLICATION_DEFAULT));
 
   str = ide_get_support_log ();
@@ -94,6 +97,8 @@ generate_support_activate (GSimpleAction              *action,
   g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
   gtk_window_present (GTK_WINDOW (dialog));
 
+  dzl_file_manager_show (file, NULL);
+
 cleanup:
   g_free (text);
   g_clear_error (&error);
diff --git a/src/plugins/support/ide-support.c b/src/plugins/support/ide-support.c
index 35510760e..aa2bcb4e6 100644
--- a/src/plugins/support/ide-support.c
+++ b/src/plugins/support/ide-support.c
@@ -24,7 +24,7 @@
 
 #include <dazzle.h>
 #include <gtk/gtk.h>
-#include <ide.h>
+#include <libide-gui.h>
 #include <ide-build-ident.h>
 #include <libpeas/peas.h>
 #include <string.h>
diff --git a/src/plugins/support/meson.build b/src/plugins/support/meson.build
index 1e1d9fba7..23db282d9 100644
--- a/src/plugins/support/meson.build
+++ b/src/plugins/support/meson.build
@@ -1,20 +1,13 @@
-if get_option('with_support')
+plugins_sources += files([
+  'ide-support-application-addin.c',
+  'ide-support.c',
+  'support-plugin.c',
+])
 
-support_resources = gnome.compile_resources(
+plugin_support_resources = gnome.compile_resources(
   'support-resources',
   'support.gresource.xml',
-  c_name: 'ide_support',
+  c_name: 'gbp_support',
 )
 
-support_sources = [
-  'ide-support-application-addin.c',
-  'ide-support-application-addin.h',
-  'ide-support.c',
-  'ide-support.h',
-  'ide-support-plugin.c',
-]
-
-gnome_builder_plugins_sources += files(support_sources)
-gnome_builder_plugins_sources += support_resources[0]
-
-endif
+plugins_sources += plugin_support_resources[0]
diff --git a/src/plugins/support/ide-support-plugin.c b/src/plugins/support/support-plugin.c
similarity index 90%
rename from src/plugins/support/ide-support-plugin.c
rename to src/plugins/support/support-plugin.c
index 30daa89f9..88ccd0be2 100644
--- a/src/plugins/support/ide-support-plugin.c
+++ b/src/plugins/support/support-plugin.c
@@ -1,4 +1,4 @@
-/* ide-support-plugin.c
+/* support-plugin.c
  *
  * Copyright 2015-2019 Christian Hergert <chergert redhat com>
  *
@@ -19,12 +19,12 @@
  */
 
 #include <libpeas/peas.h>
-#include <ide.h>
+#include <libide-gui.h>
 
 #include "ide-support-application-addin.h"
 
-void
-ide_support_register_types (PeasObjectModule *module)
+_IDE_EXTERN void
+_ide_support_register_types (PeasObjectModule *module)
 {
   peas_object_module_register_extension_type (module,
                                               IDE_TYPE_APPLICATION_ADDIN,
diff --git a/src/plugins/support/support.gresource.xml b/src/plugins/support/support.gresource.xml
index 03ae36934..e9dd9595c 100644
--- a/src/plugins/support/support.gresource.xml
+++ b/src/plugins/support/support.gresource.xml
@@ -1,9 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <gresources>
-  <gresource prefix="/org/gnome/builder/plugins">
+  <gresource prefix="/plugins/support">
     <file>support.plugin</file>
-  </gresource>
-  <gresource prefix="/org/gnome/builder/plugins/support-plugin">
     <file>gtk/menus.ui</file>
   </gresource>
 </gresources>
diff --git a/src/plugins/support/support.plugin b/src/plugins/support/support.plugin
index 5ce7621e9..fb42e627e 100644
--- a/src/plugins/support/support.plugin
+++ b/src/plugins/support/support.plugin
@@ -1,9 +1,9 @@
 [Plugin]
-Module=support-plugin
+Module=support
 Name=Support
 Description=Generate support logs for assistance
 Authors=Christian Hergert <christian hergert me>
 Copyright=Copyright © 2015 Christian Hergert
 Builtin=true
 Hidden=true
-Embedded=ide_support_register_types
+Embedded=_ide_support_register_types


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]