[gnome-builder] context: add ide_context_warning()



commit 066ca9e6d621176f92512991f4230680608c7b64
Author: Christian Hergert <chergert redhat com>
Date:   Sun Feb 14 20:44:56 2016 -0800

    context: add ide_context_warning()
    
    This should start being used to notify of errors and warnings for the
    context. This will allow us to show messages later on in the UI.

 libide/ide-context.c |   18 ++++++++++++++++++
 libide/ide-context.h |    3 +++
 2 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/libide/ide-context.c b/libide/ide-context.c
index 63e976e..939eedb 100644
--- a/libide/ide-context.c
+++ b/libide/ide-context.c
@@ -2082,3 +2082,21 @@ ide_context_get_configuration_manager (IdeContext *self)
   return self->configuration_manager;
 }
 
+void
+ide_context_warning (IdeContext  *self,
+                     const gchar *format,
+                     ...)
+{
+  va_list args;
+
+  g_return_if_fail (IDE_IS_CONTEXT (self));
+  g_return_if_fail (format != NULL);
+
+  va_start (args, format);
+  /*
+   * TODO: Track logging information so that we can display warnings
+   *       to the user in the workbench.
+   */
+  g_logv ("Ide", G_LOG_LEVEL_WARNING, format, args);
+  va_end (args);
+}
diff --git a/libide/ide-context.h b/libide/ide-context.h
index f49525b..e255454 100644
--- a/libide/ide-context.h
+++ b/libide/ide-context.h
@@ -76,6 +76,9 @@ void                      ide_context_hold_for_object       (IdeContext
 void                      ide_context_release               (IdeContext           *self);
 IdeConfigurationManager  *ide_context_get_configuration_manager (IdeContext           *self);
 IdeRuntimeManager        *ide_context_get_runtime_manager       (IdeContext           *self);
+void                      ide_context_warning                   (IdeContext           *self,
+                                                                 const gchar          *format,
+                                                                 ...) G_GNUC_PRINTF (2, 3);
 
 G_END_DECLS
 


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