[gnome-panel] remove unused code



commit 5e1bd6b8c9db4b8cd46637817092d1b694553763
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Mon Sep 17 17:51:47 2018 +0300

    remove unused code
    
    This was used by old menu button, menu bar and user menu objects.

 data/org.gnome.gnome-panel.gschema.xml |   15 -
 gnome-panel/Makefile.am                |   10 -
 gnome-panel/menu.c                     | 1280 ------------------------
 gnome-panel/menu.h                     |   71 --
 gnome-panel/panel-addto-dialog.c       |    9 +-
 gnome-panel/panel-applet-frame.c       |    1 -
 gnome-panel/panel-context-menu.c       |   53 +
 gnome-panel/panel-image-menu-item.c    |  682 -------------
 gnome-panel/panel-image-menu-item.h    |   71 --
 gnome-panel/panel-menu-items.c         | 1666 --------------------------------
 gnome-panel/panel-menu-items.h         |   88 --
 gnome-panel/panel-recent.c             |  240 -----
 gnome-panel/panel-recent.h             |   35 -
 gnome-panel/panel-run-dialog.c         |   10 +-
 gnome-panel/panel-stock-icons.c        |   44 -
 gnome-panel/panel-stock-icons.h        |   38 -
 po/POTFILES.in                         |    5 -
 17 files changed, 69 insertions(+), 4249 deletions(-)
---
diff --git a/data/org.gnome.gnome-panel.gschema.xml b/data/org.gnome.gnome-panel.gschema.xml
index f0c38ea60..83df79c90 100644
--- a/data/org.gnome.gnome-panel.gschema.xml
+++ b/data/org.gnome.gnome-panel.gschema.xml
@@ -22,13 +22,6 @@
     <value nick='64px' value='64'/>
   </enum>
 
-  <enum id='org.gnome.gnome-panel.icon-size'>
-    <value nick='16px' value='1'/>
-    <value nick='24px' value='3'/>
-    <value nick='32px' value='5'/>
-    <value nick='48px' value='6'/>
-  </enum>
-
   <schema id="org.gnome.gnome-panel.general" path="/org/gnome/gnome-panel/general/">
     <key name="enable-tooltips" type="b">
       <default>true</default>
@@ -53,14 +46,6 @@
       <description>The maximum size of icons in panels.</description>
     </key>
 
-    <key name="panel-menu" enum="org.gnome.gnome-panel.icon-size">
-      <default>'24px'</default>
-      <summary>Icon size in the menus</summary>
-    </key>
-    <key name="panel-menu-bar" enum="org.gnome.gnome-panel.icon-size">
-      <default>'16px'</default>
-      <summary>Icon size for only Applications item in the Menu Bar applet</summary>
-    </key>
     <key name="theme-variant" enum="org.gnome.gnome-panel.PanelThemeVariant">
       <default>'system'</default>
       <summary>Which theme variant to use</summary>
diff --git a/gnome-panel/Makefile.am b/gnome-panel/Makefile.am
index 521eab66b..4377c0c8b 100644
--- a/gnome-panel/Makefile.am
+++ b/gnome-panel/Makefile.am
@@ -28,16 +28,11 @@ panel_sources =                     \
        applet.c                \
        panel-util.c            \
        panel-run-dialog.c      \
-       menu.c                  \
        panel-context-menu.c    \
        launcher.c              \
        panel-applet-frame.c    \
        panel-applets-manager.c \
-       panel-stock-icons.c     \
        panel-action-button.c   \
-       panel-image-menu-item.c \
-       panel-menu-items.c      \
-       panel-recent.c          \
        panel-action-protocol.c \
        panel-toplevel.c        \
        panel-struts.c          \
@@ -62,16 +57,11 @@ panel_headers =                     \
        applet.h                \
        panel-util.h            \
        panel-run-dialog.h      \
-       menu.h                  \
        panel-context-menu.h    \
        launcher.h              \
        panel-applet-frame.h    \
        panel-applets-manager.h \
-       panel-stock-icons.h     \
        panel-action-button.h   \
-       panel-image-menu-item.h \
-       panel-menu-items.h      \
-       panel-recent.h          \
        panel-action-protocol.h \
        panel-toplevel.h        \
        panel-struts.h          \
diff --git a/gnome-panel/panel-addto-dialog.c b/gnome-panel/panel-addto-dialog.c
index a90ac50e8..9407f8a92 100644
--- a/gnome-panel/panel-addto-dialog.c
+++ b/gnome-panel/panel-addto-dialog.c
@@ -31,7 +31,6 @@
 #include <libpanel-util/panel-glib.h>
 
 #include "launcher.h"
-#include "menu.h"
 #include "panel.h"
 #include "panel-applets-manager.h"
 #include "panel-applet-frame.h"
@@ -581,6 +580,14 @@ panel_addto_populate_application_model (GtkTreeStore *store,
        }
 }
 
+static gchar *
+get_applications_menu (void)
+{
+       const gchar *xdg_menu_prefx = g_getenv ("XDG_MENU_PREFIX");
+       return g_strdup_printf ("%sapplications.menu",
+                               !PANEL_GLIB_STR_EMPTY (xdg_menu_prefx) ? xdg_menu_prefx : "gnome-");
+}
+
 static void
 panel_addto_make_application_model (PanelAddtoDialog *dialog)
 {
diff --git a/gnome-panel/panel-applet-frame.c b/gnome-panel/panel-applet-frame.c
index 771668b64..b71cf90a6 100644
--- a/gnome-panel/panel-applet-frame.c
+++ b/gnome-panel/panel-applet-frame.c
@@ -39,7 +39,6 @@
 #include "panel-lockdown.h"
 #include "panel-object-loader.h"
 #include "panel-schemas.h"
-#include "panel-stock-icons.h"
 
 #include <libpanel-applet-private/panel-applet-frame-dbus.h>
 #include "panel-applet-frame.h"
diff --git a/gnome-panel/panel-context-menu.c b/gnome-panel/panel-context-menu.c
index 26c765082..e5c96d683 100644
--- a/gnome-panel/panel-context-menu.c
+++ b/gnome-panel/panel-context-menu.c
@@ -117,6 +117,19 @@ present_properties_dialog (GtkWidget     *widget,
   gtk_window_present (GTK_WINDOW (dialog));
 }
 
+static GtkWidget *
+add_menu_separator (GtkWidget *menu)
+{
+       GtkWidget *menuitem;
+
+       menuitem = gtk_separator_menu_item_new ();
+       gtk_widget_set_sensitive (menuitem, FALSE);
+       gtk_widget_show (menuitem);
+       gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+
+       return menuitem;
+}
+
 static void
 panel_context_menu_build_edition (PanelWidget *panel_widget,
                                  GtkWidget   *menu)
@@ -161,6 +174,46 @@ panel_context_menu_build_edition (PanelWidget *panel_widget,
                                  panel_layout_is_writable ());
 }
 
+static GtkWidget *
+panel_create_menu (void)
+{
+       GtkWidget       *retval;
+       GtkStyleContext *context;
+
+       retval = gtk_menu_new ();
+       gtk_widget_set_name (retval, "gnome-panel-main-menu");
+
+       context = gtk_widget_get_style_context (retval);
+       gtk_style_context_add_class (context, "gnome-panel-main-menu");
+
+       return retval;
+}
+
+static gboolean
+menu_dummy_button_press_event (GtkWidget      *menuitem,
+                              GdkEventButton *event)
+{
+       if (event->button == 3)
+               return TRUE;
+
+       return FALSE;
+}
+
+static GtkWidget *
+create_empty_menu (void)
+{
+       GtkWidget *retval;
+
+       retval = panel_create_menu ();
+
+       /* intercept all right button clicks makes sure they don't
+          go to the object itself */
+       g_signal_connect (retval, "button_press_event",
+                         G_CALLBACK (menu_dummy_button_press_event), NULL);
+
+       return retval;
+}
+
 GtkWidget *
 panel_context_menu_create (PanelWidget *panel)
 {
diff --git a/gnome-panel/panel-run-dialog.c b/gnome-panel/panel-run-dialog.c
index 0d7080ccc..856b27500 100644
--- a/gnome-panel/panel-run-dialog.c
+++ b/gnome-panel/panel-run-dialog.c
@@ -51,9 +51,7 @@
 
 #include "panel-util.h"
 #include "panel-enums.h"
-#include "panel-stock-icons.h"
 #include "panel-multiscreen.h"
-#include "menu.h"
 #include "panel-lockdown.h"
 #include "panel-xutils.h"
 #include "panel-icon-names.h"
@@ -892,6 +890,14 @@ get_all_applications_from_dir (GMenuTreeDirectory *directory,
        return list;
 }
 
+static gchar *
+get_applications_menu (void)
+{
+       const gchar *xdg_menu_prefx = g_getenv ("XDG_MENU_PREFIX");
+       return g_strdup_printf ("%sapplications.menu",
+                               !PANEL_GLIB_STR_EMPTY (xdg_menu_prefx) ? xdg_menu_prefx : "gnome-");
+}
+
 static GSList *
 get_all_applications (void)
 {
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 5d6712304..8e3cb33ea 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -22,7 +22,6 @@ gnome-panel/libpanel-util/panel-icon-chooser.c
 gnome-panel/libpanel-util/panel-launch.c
 gnome-panel/libpanel-util/panel-show.c
 gnome-panel/main.c
-gnome-panel/menu.c
 gnome-panel/panel-action-button.c
 gnome-panel/panel-addto-dialog.c
 gnome-panel/panel-addto-dialog.ui
@@ -33,12 +32,8 @@ 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-items.c
-gnome-panel/panel-image-menu-item.c
-gnome-panel/panel-recent.c
 gnome-panel/panel-run-dialog.c
 gnome-panel/panel-run-dialog.ui
-gnome-panel/panel-stock-icons.c
 gnome-panel/panel-toplevel.c
 gnome-panel/panel-util.c
 libgnome-panel/gp-initial-setup-dialog.c


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