[geary/mjog/plugin-problem-reports] Plugin.Application: Add support for reporting problems




commit c37cf0640b05b22953d0b7c286508cb15fbef801
Author: Michael Gratton <mike vee net>
Date:   Tue Jul 7 09:54:23 2020 +1000

    Plugin.Application: Add support for reporting problems

 src/client/application/application-plugin-manager.vala |  4 ++++
 src/client/plugin/plugin-application.vala              | 16 ++++++++++++++++
 2 files changed, 20 insertions(+)
---
diff --git a/src/client/application/application-plugin-manager.vala 
b/src/client/application/application-plugin-manager.vala
index 7809861e7..d2bad7094 100644
--- a/src/client/application/application-plugin-manager.vala
+++ b/src/client/application/application-plugin-manager.vala
@@ -141,6 +141,10 @@ public class Application.PluginManager : GLib.Object {
            }
         }
 
+        public void report_problem(Geary.ProblemReport problem) {
+            this.backing.controller.report_problem(problem);
+        }
+
         private void on_window_added(Gtk.Window window) {
             if (this.action_group != null) {
                 var main = window as MainWindow;
diff --git a/src/client/plugin/plugin-application.vala b/src/client/plugin/plugin-application.vala
index 19bb837c5..97b30da66 100644
--- a/src/client/plugin/plugin-application.vala
+++ b/src/client/plugin/plugin-application.vala
@@ -61,4 +61,20 @@ public interface Plugin.Application : Geary.BaseObject {
     public abstract async void empty_folder(Folder folder)
         throws Error.PERMISSION_DENIED;
 
+
+    /**
+     * Sends a problem report to the application.
+     *
+     * Calling this method will display a problem report for the
+     * plugin with a given error so that both people using the
+     * application are aware that an error condition exists, and that
+     * they may report the problem to developers.
+     *
+     * Since displaying an error report causes visual and workflow
+     * disruptions, and as such this method called with care and only
+     * when necessary. For logging, use {@link GLib.debug} and related
+     * methods and these will appear in Geary's Inspector.
+     */
+    public abstract void report_problem(Geary.ProblemReport problem);
+
 }


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