Exemple #1
0
static gboolean
gui_message_error_console (Gimp                *gimp,
                           GimpMessageSeverity  severity,
                           const gchar         *domain,
                           const gchar         *message)
{
    GtkWidget *dockable = NULL;

    /* try to avoid raising the error console for not so severe messages */
    if (severity < GIMP_MESSAGE_ERROR)
    {
        GtkWidget *widget =
            gimp_dialog_factory_find_widget (gimp_dialog_factory_get_singleton (),
                                             "gimp-error-console");
        if (GIMP_IS_DOCKABLE (widget))
            dockable = widget;
    }

    if (! dockable)
    {
        GdkScreen *screen;
        gint       monitor;

        monitor = gimp_get_monitor_at_pointer (&screen);

        dockable =
            gimp_window_strategy_show_dockable_dialog (GIMP_WINDOW_STRATEGY (gimp_get_window_strategy (gimp)),
                    gimp,
                    gimp_dialog_factory_get_singleton (),
                    screen, monitor,
                    "gimp-error-console");
    }

    if (dockable)
    {
        GtkWidget *child = gtk_bin_get_child (GTK_BIN (dockable));

        gimp_error_console_add (GIMP_ERROR_CONSOLE (child),
                                severity, domain, message);

        return TRUE;
    }

    return FALSE;
}
Exemple #2
0
static gboolean
gui_message_error_console (GimpMessageSeverity  severity,
                           const gchar         *domain,
                           const gchar         *message)
{
  GtkWidget *dockable = NULL;

  /* try to avoid raising the error console for not so severe messages */
  if (severity < GIMP_MESSAGE_ERROR)
    {
      GimpSessionInfo *info;

      info = gimp_dialog_factory_find_session_info (global_dock_factory,
                                                    "gimp-error-console");

      if (info && GIMP_IS_DOCKABLE (info->widget))
        dockable = info->widget;
    }

  if (! dockable)
    dockable = gimp_dialog_factory_dialog_raise (global_dock_factory,
                                                 gdk_screen_get_default (),
                                                 "gimp-error-console", -1);

  if (dockable)
    {
      GtkWidget *child = gtk_bin_get_child (GTK_BIN (dockable));

      gimp_error_console_add (GIMP_ERROR_CONSOLE (child),
                              severity, domain, message);

      return TRUE;
    }

  return FALSE;
}