[gnome-panel] panel: remove old main menu button



commit b193419a01ce8289749ea0f659f5d2f02775282f
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sun Sep 16 01:13:50 2018 +0300

    panel: remove old main menu button

 data/Makefile.am                                   |    1 -
 data/org.gnome.gnome-panel.menu-button.gschema.xml |   19 -
 gnome-panel/Makefile.am                            |    2 -
 gnome-panel/applet.c                               |    9 -
 gnome-panel/menu.c                                 |    1 -
 gnome-panel/panel-action-protocol.c                |    9 -
 gnome-panel/panel-addto-dialog.c                   |    1 -
 gnome-panel/panel-enums.h                          |    1 -
 gnome-panel/panel-menu-button.c                    | 1054 --------------------
 gnome-panel/panel-menu-button.h                    |   86 --
 gnome-panel/panel-object-loader.c                  |    7 -
 gnome-panel/panel.c                                |   82 +-
 po/POTFILES.in                                     |    2 -
 13 files changed, 1 insertion(+), 1273 deletions(-)
---
diff --git a/data/Makefile.am b/data/Makefile.am
index ce9c18d00..7648a829e 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -17,7 +17,6 @@ gsettings_SCHEMAS = \
        org.gnome.gnome-panel.applet.initial-settings.gschema.xml \
        org.gnome.gnome-panel.gschema.xml \
        org.gnome.gnome-panel.launcher.gschema.xml \
-       org.gnome.gnome-panel.menu-button.gschema.xml \
        org.gnome.gnome-panel.object.gschema.xml \
        org.gnome.gnome-panel.toplevel.gschema.xml \
        $(NULL)
diff --git a/gnome-panel/Makefile.am b/gnome-panel/Makefile.am
index 5b3802253..999a6bf9d 100644
--- a/gnome-panel/Makefile.am
+++ b/gnome-panel/Makefile.am
@@ -37,7 +37,6 @@ panel_sources =                       \
        panel-stock-icons.c     \
        panel-action-button.c   \
        panel-image-menu-item.c \
-       panel-menu-button.c     \
        panel-menu-items.c      \
        panel-recent.c          \
        panel-action-protocol.c \
@@ -72,7 +71,6 @@ panel_headers =                       \
        panel-stock-icons.h     \
        panel-action-button.h   \
        panel-image-menu-item.h \
-       panel-menu-button.h     \
        panel-menu-items.h      \
        panel-recent.h          \
        panel-action-protocol.h \
diff --git a/gnome-panel/applet.c b/gnome-panel/applet.c
index 302cecb54..71fa814e9 100644
--- a/gnome-panel/applet.c
+++ b/gnome-panel/applet.c
@@ -26,7 +26,6 @@
 #include "panel-action-button.h"
 #include "panel-toplevel.h"
 #include "panel-util.h"
-#include "panel-menu-button.h"
 #include "panel-layout.h"
 #include "panel-lockdown.h"
 #include "panel-schemas.h"
@@ -50,10 +49,6 @@ panel_applet_set_dnd_enabled (AppletInfo *info,
                              gboolean    dnd_enabled)
 {
        switch (info->type) {
-       case PANEL_OBJECT_MENU:
-               panel_menu_button_set_dnd_enabled (PANEL_MENU_BUTTON (info->widget),
-                                                  dnd_enabled);
-               break;
        case PANEL_OBJECT_LAUNCHER:
                panel_launcher_set_dnd_enabled (info->data, dnd_enabled);
                break;
@@ -168,10 +163,6 @@ applet_callback_callback (GtkWidget      *widget,
                else if (!strcmp (menu->name, "properties"))
                        launcher_properties (menu->info->data);
                break;
-       case PANEL_OBJECT_MENU:
-               panel_menu_button_invoke_menu (
-                       PANEL_MENU_BUTTON (menu->info->widget), menu->name);
-               break;
        case PANEL_OBJECT_ACTION:
                panel_action_button_invoke_menu (
                        PANEL_ACTION_BUTTON (menu->info->widget), menu->name);
diff --git a/gnome-panel/menu.c b/gnome-panel/menu.c
index 6e990d1ba..58a97de3a 100644
--- a/gnome-panel/menu.c
+++ b/gnome-panel/menu.c
@@ -37,7 +37,6 @@
 #include "panel.h"
 #include "panel-stock-icons.h"
 #include "panel-action-button.h"
-#include "panel-menu-button.h"
 #include "panel-menu-items.h"
 #include "panel-run-dialog.h"
 #include "panel-lockdown.h"
diff --git a/gnome-panel/panel-action-protocol.c b/gnome-panel/panel-action-protocol.c
index e744101be..e914ce9be 100644
--- a/gnome-panel/panel-action-protocol.c
+++ b/gnome-panel/panel-action-protocol.c
@@ -34,7 +34,6 @@
 #include "panel-util.h"
 #include "panel-force-quit.h"
 #include "panel-run-dialog.h"
-#include "panel-menu-button.h"
 
 static Atom atom_gnome_panel_action            = None;
 static Atom atom_gnome_panel_action_main_menu  = None;
@@ -48,18 +47,10 @@ panel_action_protocol_main_menu (GdkScreen *screen,
        GSList      *panels;
        PanelWidget *panel_widget;
        GtkWidget   *menu;
-       AppletInfo  *info;
 
        if (panel_applet_activate_main_menu (activate_time))
                return;
 
-       info = panel_applet_get_by_type (PANEL_OBJECT_MENU, screen);
-       if (info && panel_menu_button_is_main_menu (PANEL_MENU_BUTTON (info->widget))) {
-               panel_menu_button_popup_menu (PANEL_MENU_BUTTON (info->widget),
-                                             1, activate_time);
-               return;
-       }
-
        panels = panel_widget_get_panels ();
        panel_widget = panels->data;
        menu = create_main_menu (panel_widget);
diff --git a/gnome-panel/panel-addto-dialog.c b/gnome-panel/panel-addto-dialog.c
index 1170007bf..a90ac50e8 100644
--- a/gnome-panel/panel-addto-dialog.c
+++ b/gnome-panel/panel-addto-dialog.c
@@ -37,7 +37,6 @@
 #include "panel-applet-frame.h"
 #include "panel-action-button.h"
 #include "panel-toplevel.h"
-#include "panel-menu-button.h"
 #include "panel-layout.h"
 #include "panel-lockdown.h"
 #include "panel-util.h"
diff --git a/gnome-panel/panel-enums.h b/gnome-panel/panel-enums.h
index 40ace09eb..dece5ff87 100644
--- a/gnome-panel/panel-enums.h
+++ b/gnome-panel/panel-enums.h
@@ -32,7 +32,6 @@ G_BEGIN_DECLS
 #define PANEL_VERTICAL_MASK   (PANEL_ORIENTATION_LEFT | PANEL_ORIENTATION_RIGHT)
 
 typedef enum {
-       PANEL_OBJECT_MENU,
        PANEL_OBJECT_LAUNCHER,
        PANEL_OBJECT_APPLET,
        PANEL_OBJECT_ACTION
diff --git a/gnome-panel/panel-object-loader.c b/gnome-panel/panel-object-loader.c
index 4be66bfef..41eb84e31 100644
--- a/gnome-panel/panel-object-loader.c
+++ b/gnome-panel/panel-object-loader.c
@@ -39,7 +39,6 @@
 #include "launcher.h"
 #include "panel-action-button.h"
 #include "panel-applet-frame.h"
-#include "panel-menu-button.h"
 
 #include "panel-object-loader.h"
 
@@ -201,11 +200,6 @@ panel_object_loader_idle_handler (gpointer dummy)
                                          object->id,
                                          object->settings);
                 break;
-        case PANEL_OBJECT_MENU:
-                panel_menu_button_load (panel_widget,
-                                        object->id,
-                                        object->settings);
-                break;
         case PANEL_OBJECT_LAUNCHER:
                 launcher_load (panel_widget,
                                object->id,
@@ -352,7 +346,6 @@ static struct {
         gboolean         has_detail;
 } panel_object_iid_map[] = {
         { PANEL_OBJECT_ACTION,    "ActionButton" , TRUE  },
-        { PANEL_OBJECT_MENU,      "MenuButton"   , FALSE },
         { PANEL_OBJECT_LAUNCHER,  "Launcher"     , FALSE }
 };
 
diff --git a/gnome-panel/panel.c b/gnome-panel/panel.c
index 4f31f31bf..2016fb563 100644
--- a/gnome-panel/panel.c
+++ b/gnome-panel/panel.c
@@ -35,7 +35,6 @@
 #include "panel-action-button.h"
 #include "panel-multiscreen.h"
 #include "panel-toplevel.h"
-#include "panel-menu-button.h"
 #include "panel-lockdown.h"
 #include "panel-icon-names.h"
 #include "panel-layout.h"
@@ -76,7 +75,6 @@ orientation_change (AppletInfo  *info,
                panel_applet_frame_change_orientation (
                                PANEL_APPLET_FRAME (info->widget), orientation);
                break;
-       case PANEL_OBJECT_MENU:
        case PANEL_OBJECT_LAUNCHER:
        case PANEL_OBJECT_ACTION:
                button_widget_set_orientation (BUTTON_WIDGET (info->widget), orientation);
@@ -432,24 +430,6 @@ drop_url (PanelWidget         *panel,
        return TRUE;
 }
 
-static gboolean
-drop_menu (PanelWidget         *panel,
-          PanelObjectPackType  pack_type,
-          int                  pack_index,
-          const char          *menu_filename,
-          const char          *menu_path)
-{
-       if (!panel_layout_is_writable ())
-               return FALSE;
-
-       return panel_menu_button_create (panel->toplevel,
-                                        pack_type, pack_index,
-                                        menu_filename,
-                                        menu_path,
-                                        NULL);
-
-}
-
 static gboolean
 drop_uri (PanelWidget         *panel,
          PanelObjectPackType  pack_type,
@@ -742,37 +722,6 @@ drop_internal_icon (PanelWidget         *panel,
        return TRUE;
 }
 
-static gboolean
-move_applet (PanelWidget         *panel,
-            PanelObjectPackType  pack_type,
-            int                  pack_index,
-            int                  applet_index)
-{
-       GSList     *applet_list;
-       AppletInfo *info;
-       GtkWidget  *parent;
-
-       applet_list = panel_applet_list_applets ();
-
-       info = g_slist_nth_data (applet_list, applet_index);
-
-       if (info == NULL || info->widget == NULL ||
-           !panel_applet_can_freely_move (info))
-               return FALSE;
-
-       parent = gtk_widget_get_parent (info->widget);
-
-       if (parent != NULL &&
-           PANEL_IS_WIDGET (parent)) {
-               panel_widget_reparent (PANEL_WIDGET (parent),
-                                      panel,
-                                      info->widget,
-                                      pack_type, pack_index);
-       }
-
-       return TRUE;
-}
-
 static gboolean
 drop_internal_applet (PanelWidget         *panel,
                      PanelObjectPackType  pack_type,
@@ -787,36 +736,7 @@ drop_internal_applet (PanelWidget         *panel,
        if (applet_type == NULL)
                return FALSE;
 
-       if (sscanf (applet_type, "MENU:%d", &applet_index) == 1) {
-               if (action != GDK_ACTION_MOVE)
-                       g_warning ("Only MOVE supported for menus");
-               success = move_applet (panel, pack_type, pack_index, applet_index);
-
-       } else if (strncmp (applet_type, "MENU:", strlen ("MENU:")) == 0) {
-               const char *menu;
-               const char *menu_path;
-
-               menu = &applet_type[strlen ("MENU:")];
-               menu_path = strchr (menu, '/');
-
-               if (!menu_path) {
-                       if (strncmp (menu, "MAIN", strlen ("MAIN")) == 0)
-                               success = drop_menu (panel, pack_type, pack_index,
-                                                    NULL, NULL);
-                       else
-                               success = drop_menu (panel, pack_type, pack_index,
-                                                    menu, NULL);
-               } else {
-                       char *menu_filename;
-
-                       menu_filename = g_strndup (menu, menu_path - menu);
-                       menu_path++;
-                       success = drop_menu (panel, pack_type, pack_index,
-                                            menu_filename, menu_path);
-                       g_free (menu_filename);
-               }
-
-       } else if (!strncmp (applet_type, "ACTION:", strlen ("ACTION:"))) {
+       if (!strncmp (applet_type, "ACTION:", strlen ("ACTION:"))) {
                if (panel_layout_is_writable ()) {
                        remove_applet = panel_action_button_load_from_drag (
                                                        panel->toplevel,
diff --git a/po/POTFILES.in b/po/POTFILES.in
index e8ac87afb..e453b0320 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -6,7 +6,6 @@ data/org.gnome.gnome-panel.applet.window-list.gschema.xml
 data/org.gnome.gnome-panel.applet.workspace-switcher.gschema.xml
 data/org.gnome.gnome-panel.gschema.xml
 data/org.gnome.gnome-panel.launcher.gschema.xml
-data/org.gnome.gnome-panel.menu-button.gschema.xml
 data/org.gnome.gnome-panel.object.gschema.xml
 data/org.gnome.gnome-panel.toplevel.gschema.xml
 gnome-panel/applet.c
@@ -35,7 +34,6 @@ gnome-panel/panel-context-menu.c
 gnome-panel/panel-ditem-editor.c
 gnome-panel/panel-force-quit.c
 gnome-panel/panel-layout.c
-gnome-panel/panel-menu-button.c
 gnome-panel/panel-menu-items.c
 gnome-panel/panel-image-menu-item.c
 gnome-panel/panel-recent.c


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