[gedit-plugins] drawspaces: remove menu item



commit 95069ef2a6fa885b20e905c224a9bfa5b425c32e
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Wed Sep 23 23:57:01 2020 +0200

    drawspaces: remove menu item
    
    The new GUI for this plugin will be:
    - When the plugin is enabled, space drawing is enabled (bind the two).
    - When the plugin is enabled, be able to access options: configure the
      space types to draw for each locations, roughly.
    The two will be close to each other (like with every standard
    libpeas-gtk plugin providing a configuration).
    
    The problem with the menu item was that it was separate from the rest of
    the configuration. It was a bit awkward, there were two ways to disable
    space drawing: by disabling the plugin, and with the menu item. When the
    menu item was disabled, another problem is that it could be hard to know
    why the spaces are not drawn even though the plugin and the options are
    enabled: three things needed to be enabled in order for the white spaces
    to be drawn: the plugin needed to be enabled, the menu item too, and the
    plugin configuration plays a role too (in case all checkbuttons are
    disabled).
    
    It now takes more clicks to disable space drawing, we need to go to the
    preferences dialog and disable the plugin. But once the plugin is
    correctly configured we probably don't often need to disable/enable it.
    
    So I think the advantage (clearer way to configure space drawing)
    outweighs the disadvantage (more clicks to enable/disable space drawing,
    which I think is not often needed).

 .../drawspaces/gedit-drawspaces-app-activatable.c  |  19 ---
 .../gedit-drawspaces-window-activatable.c          | 178 ---------------------
 .../gedit-drawspaces-window-activatable.h          |  55 -------
 plugins/drawspaces/meson.build                     |   1 -
 4 files changed, 253 deletions(-)
---
diff --git a/plugins/drawspaces/gedit-drawspaces-app-activatable.c 
b/plugins/drawspaces/gedit-drawspaces-app-activatable.c
index f1d6064..cb3d302 100644
--- a/plugins/drawspaces/gedit-drawspaces-app-activatable.c
+++ b/plugins/drawspaces/gedit-drawspaces-app-activatable.c
@@ -18,7 +18,6 @@
 
 #include "config.h"
 #include "gedit-drawspaces-app-activatable.h"
-#include "gedit-drawspaces-window-activatable.h"
 #include "gedit-drawspaces-view-activatable.h"
 
 #include <gedit/gedit-app.h>
@@ -31,7 +30,6 @@
 typedef struct _GeditDrawspacesAppActivatablePrivate
 {
        GeditApp *app;
-       GeditMenuExtension *menu_ext;
 } GeditDrawspacesAppActivatablePrivate;
 
 typedef struct _DrawspacesConfigureWidget DrawspacesConfigureWidget;
@@ -149,27 +147,11 @@ gedit_drawspaces_app_activatable_init (GeditDrawspacesAppActivatable *self)
 static void
 gedit_drawspaces_app_activatable_activate (GeditAppActivatable *activatable)
 {
-       GeditDrawspacesAppActivatable *app_activatable = GEDIT_DRAWSPACES_APP_ACTIVATABLE (activatable);
-       GeditDrawspacesAppActivatablePrivate *priv = gedit_drawspaces_app_activatable_get_instance_private 
(app_activatable);
-       GMenuItem *item;
-
-       gedit_debug (DEBUG_PLUGINS);
-
-       priv->menu_ext = gedit_app_activatable_extend_menu (activatable, "view-section-2");
-       item = g_menu_item_new (_("Show _White Space"), "win.show-white-space");
-       gedit_menu_extension_append_menu_item (priv->menu_ext, item);
-       g_object_unref (item);
 }
 
 static void
 gedit_drawspaces_app_activatable_deactivate (GeditAppActivatable *activatable)
 {
-       GeditDrawspacesAppActivatable *app_activatable = GEDIT_DRAWSPACES_APP_ACTIVATABLE (activatable);
-       GeditDrawspacesAppActivatablePrivate *priv = gedit_drawspaces_app_activatable_get_instance_private 
(app_activatable);
-
-       gedit_debug (DEBUG_PLUGINS);
-
-       g_clear_object (&priv->menu_ext);
 }
 
 static void
@@ -354,7 +336,6 @@ G_MODULE_EXPORT void
 peas_register_types (PeasObjectModule *module)
 {
        gedit_drawspaces_app_activatable_register_type (G_TYPE_MODULE (module));
-       gedit_drawspaces_window_activatable_register (G_TYPE_MODULE (module));
        gedit_drawspaces_view_activatable_register (G_TYPE_MODULE (module));
 
        peas_object_module_register_extension_type (module,
diff --git a/plugins/drawspaces/meson.build b/plugins/drawspaces/meson.build
index 042ce9f..75610cb 100644
--- a/plugins/drawspaces/meson.build
+++ b/plugins/drawspaces/meson.build
@@ -1,7 +1,6 @@
 libdrawspaces_sources = files(
   'gedit-drawspaces-app-activatable.c',
   'gedit-drawspaces-view-activatable.c',
-  'gedit-drawspaces-window-activatable.c',
 )
 
 libdrawspaces_deps = [


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