[gimp] Bug 764320 - Xsane Gimp no device dialog



commit 3a34a2b54c64782be236ae8e714ea4b6c64cce3e
Author: Michael Natterer <mitch gimp org>
Date:   Tue Apr 26 16:10:08 2016 +0200

    Bug 764320 - Xsane Gimp no device dialog
    
    Pass the run_mode again to GIMP_EXTENSION plug-ins, this got lost in
    the cleanup in commit dda06ac0653e818d87619727f63437c7f8b61f0c.
    Spotted by Massimo.

 app/actions/plug-in-commands.c   |    1 +
 app/actions/procedure-commands.c |   22 ++++++++++++++++++++++
 app/actions/procedure-commands.h |    1 +
 3 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/app/actions/plug-in-commands.c b/app/actions/plug-in-commands.c
index 6b29881..4092228 100644
--- a/app/actions/plug-in-commands.c
+++ b/app/actions/plug-in-commands.c
@@ -78,6 +78,7 @@ plug_in_run_cmd_callback (GtkAction     *action,
   switch (procedure->proc_type)
     {
     case GIMP_EXTENSION:
+      args = procedure_commands_get_run_mode_arg (procedure);
       break;
 
     case GIMP_PLUGIN:
diff --git a/app/actions/procedure-commands.c b/app/actions/procedure-commands.c
index 246853d..28e1b98 100644
--- a/app/actions/procedure-commands.c
+++ b/app/actions/procedure-commands.c
@@ -37,6 +37,28 @@
 
 
 GimpValueArray *
+procedure_commands_get_run_mode_arg (GimpProcedure *procedure)
+{
+  GimpValueArray *args;
+  gint            n_args = 0;
+
+  args = gimp_procedure_get_arguments (procedure);
+
+  /* initialize the first argument  */
+  if (gimp_value_array_length (args) > n_args &&
+      GIMP_IS_PARAM_SPEC_INT32 (procedure->args[n_args]))
+    {
+      g_value_set_int (gimp_value_array_index (args, n_args),
+                       GIMP_RUN_INTERACTIVE);
+      n_args++;
+    }
+
+  gimp_value_array_truncate (args, n_args);
+
+  return args;
+}
+
+GimpValueArray *
 procedure_commands_get_data_args (GimpProcedure *procedure,
                                   GimpObject    *object)
 {
diff --git a/app/actions/procedure-commands.h b/app/actions/procedure-commands.h
index 16e26d7..72748d3 100644
--- a/app/actions/procedure-commands.h
+++ b/app/actions/procedure-commands.h
@@ -19,6 +19,7 @@
 #define __PROCEDURE_COMMANDS_H__
 
 
+GimpValueArray * procedure_commands_get_run_mode_arg (GimpProcedure  *procedure);
 GimpValueArray * procedure_commands_get_data_args    (GimpProcedure  *procedure,
                                                       GimpObject     *object);
 GimpValueArray * procedure_commands_get_image_args   (GimpProcedure  *procedure,


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