Commit b193419a authored by Alberts Muktupāvels's avatar Alberts Muktupāvels

panel: remove old main menu button

parent 71a0ad1d
...@@ -17,7 +17,6 @@ gsettings_SCHEMAS = \ ...@@ -17,7 +17,6 @@ gsettings_SCHEMAS = \
org.gnome.gnome-panel.applet.initial-settings.gschema.xml \ org.gnome.gnome-panel.applet.initial-settings.gschema.xml \
org.gnome.gnome-panel.gschema.xml \ org.gnome.gnome-panel.gschema.xml \
org.gnome.gnome-panel.launcher.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.object.gschema.xml \
org.gnome.gnome-panel.toplevel.gschema.xml \ org.gnome.gnome-panel.toplevel.gschema.xml \
$(NULL) $(NULL)
......
<schemalist gettext-domain="gnome-panel">
<schema id="org.gnome.gnome-panel.menu-button">
<key name="tooltip" type="s">
<default>''</default>
<summary>Tooltip displayed for menu</summary>
<description>The text to display in a tooltip for this menu.</description>
</key>
<key name="custom-icon" type="s">
<default>''</default>
<summary>Icon used for button</summary>
<description>The location of the image file used as the icon for the object's button. If empty, the default icon for the menu will be used.</description>
</key>
<key name="menu-path" type="s">
<default>''</default>
<summary>Menu content path</summary>
<description>The path from which the menu contents is constructed. If empty, the menu will be the default applications menu.</description>
</key>
</schema>
</schemalist>
...@@ -37,7 +37,6 @@ panel_sources = \ ...@@ -37,7 +37,6 @@ panel_sources = \
panel-stock-icons.c \ panel-stock-icons.c \
panel-action-button.c \ panel-action-button.c \
panel-image-menu-item.c \ panel-image-menu-item.c \
panel-menu-button.c \
panel-menu-items.c \ panel-menu-items.c \
panel-recent.c \ panel-recent.c \
panel-action-protocol.c \ panel-action-protocol.c \
...@@ -72,7 +71,6 @@ panel_headers = \ ...@@ -72,7 +71,6 @@ panel_headers = \
panel-stock-icons.h \ panel-stock-icons.h \
panel-action-button.h \ panel-action-button.h \
panel-image-menu-item.h \ panel-image-menu-item.h \
panel-menu-button.h \
panel-menu-items.h \ panel-menu-items.h \
panel-recent.h \ panel-recent.h \
panel-action-protocol.h \ panel-action-protocol.h \
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include "panel-action-button.h" #include "panel-action-button.h"
#include "panel-toplevel.h" #include "panel-toplevel.h"
#include "panel-util.h" #include "panel-util.h"
#include "panel-menu-button.h"
#include "panel-layout.h" #include "panel-layout.h"
#include "panel-lockdown.h" #include "panel-lockdown.h"
#include "panel-schemas.h" #include "panel-schemas.h"
...@@ -50,10 +49,6 @@ panel_applet_set_dnd_enabled (AppletInfo *info, ...@@ -50,10 +49,6 @@ panel_applet_set_dnd_enabled (AppletInfo *info,
gboolean dnd_enabled) gboolean dnd_enabled)
{ {
switch (info->type) { 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: case PANEL_OBJECT_LAUNCHER:
panel_launcher_set_dnd_enabled (info->data, dnd_enabled); panel_launcher_set_dnd_enabled (info->data, dnd_enabled);
break; break;
...@@ -168,10 +163,6 @@ applet_callback_callback (GtkWidget *widget, ...@@ -168,10 +163,6 @@ applet_callback_callback (GtkWidget *widget,
else if (!strcmp (menu->name, "properties")) else if (!strcmp (menu->name, "properties"))
launcher_properties (menu->info->data); launcher_properties (menu->info->data);
break; break;
case PANEL_OBJECT_MENU:
panel_menu_button_invoke_menu (
PANEL_MENU_BUTTON (menu->info->widget), menu->name);
break;
case PANEL_OBJECT_ACTION: case PANEL_OBJECT_ACTION:
panel_action_button_invoke_menu ( panel_action_button_invoke_menu (
PANEL_ACTION_BUTTON (menu->info->widget), menu->name); PANEL_ACTION_BUTTON (menu->info->widget), menu->name);
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
#include "panel.h" #include "panel.h"
#include "panel-stock-icons.h" #include "panel-stock-icons.h"
#include "panel-action-button.h" #include "panel-action-button.h"
#include "panel-menu-button.h"
#include "panel-menu-items.h" #include "panel-menu-items.h"
#include "panel-run-dialog.h" #include "panel-run-dialog.h"
#include "panel-lockdown.h" #include "panel-lockdown.h"
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#include "panel-util.h" #include "panel-util.h"
#include "panel-force-quit.h" #include "panel-force-quit.h"
#include "panel-run-dialog.h" #include "panel-run-dialog.h"
#include "panel-menu-button.h"
static Atom atom_gnome_panel_action = None; static Atom atom_gnome_panel_action = None;
static Atom atom_gnome_panel_action_main_menu = None; static Atom atom_gnome_panel_action_main_menu = None;
...@@ -48,18 +47,10 @@ panel_action_protocol_main_menu (GdkScreen *screen, ...@@ -48,18 +47,10 @@ panel_action_protocol_main_menu (GdkScreen *screen,
GSList *panels; GSList *panels;
PanelWidget *panel_widget; PanelWidget *panel_widget;
GtkWidget *menu; GtkWidget *menu;
AppletInfo *info;
if (panel_applet_activate_main_menu (activate_time)) if (panel_applet_activate_main_menu (activate_time))
return; 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 (); panels = panel_widget_get_panels ();
panel_widget = panels->data; panel_widget = panels->data;
menu = create_main_menu (panel_widget); menu = create_main_menu (panel_widget);
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
#include "panel-applet-frame.h" #include "panel-applet-frame.h"
#include "panel-action-button.h" #include "panel-action-button.h"
#include "panel-toplevel.h" #include "panel-toplevel.h"
#include "panel-menu-button.h"
#include "panel-layout.h" #include "panel-layout.h"
#include "panel-lockdown.h" #include "panel-lockdown.h"
#include "panel-util.h" #include "panel-util.h"
......
...@@ -32,7 +32,6 @@ G_BEGIN_DECLS ...@@ -32,7 +32,6 @@ G_BEGIN_DECLS
#define PANEL_VERTICAL_MASK (PANEL_ORIENTATION_LEFT | PANEL_ORIENTATION_RIGHT) #define PANEL_VERTICAL_MASK (PANEL_ORIENTATION_LEFT | PANEL_ORIENTATION_RIGHT)
typedef enum { typedef enum {
PANEL_OBJECT_MENU,
PANEL_OBJECT_LAUNCHER, PANEL_OBJECT_LAUNCHER,
PANEL_OBJECT_APPLET, PANEL_OBJECT_APPLET,
PANEL_OBJECT_ACTION PANEL_OBJECT_ACTION
......
This diff is collapsed.
/*
* panel-menu-button.h: panel menu button
*
* Copyright (C) 2003 Sun Microsystems, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* Authors:
* Mark McLoughlin <mark@skynet.ie>
*/
#ifndef __PANEL_MENU_BUTTON_H__
#define __PANEL_MENU_BUTTON_H__
#include <gtk/gtk.h>
#include "button-widget.h"
#include "panel-widget.h"
G_BEGIN_DECLS
#define PANEL_TYPE_MENU_BUTTON (panel_menu_button_get_type ())
#define PANEL_MENU_BUTTON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PANEL_TYPE_MENU_BUTTON, PanelMenuButton))
#define PANEL_MENU_BUTTON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PANEL_TYPE_MENU_BUTTON, PanelMenuButtonClass))
#define PANEL_IS_MENU_BUTTON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PANEL_TYPE_MENU_BUTTON))
#define PANEL_IS_MENU_BUTTON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PANEL_TYPE_MENU_BUTTON))
#define PANEL_MENU_BUTTON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), PANEL_TYPE_MENU_BUTTON, PanelMenuButtonClass))
typedef struct _PanelMenuButton PanelMenuButton;
typedef struct _PanelMenuButtonClass PanelMenuButtonClass;
typedef struct _PanelMenuButtonPrivate PanelMenuButtonPrivate;
struct _PanelMenuButton {
ButtonWidget button;
PanelMenuButtonPrivate *priv;
};
struct _PanelMenuButtonClass {
ButtonWidgetClass button_class;
};
GType panel_menu_button_get_type (void) G_GNUC_CONST;
gboolean panel_menu_button_create (PanelToplevel *toplevel,
PanelObjectPackType pack_type,
int pack_index,
const char *filename,
const char *menu_path,
const char *tooltip);
gboolean panel_menu_button_is_main_menu (PanelMenuButton *button);
void panel_menu_button_set_menu_path (PanelMenuButton *button,
const char *menu_path);
void panel_menu_button_set_custom_icon (PanelMenuButton *button,
const char *custom_icon);
void panel_menu_button_set_tooltip (PanelMenuButton *button,
const char *tooltip);
void panel_menu_button_load (PanelWidget *panel,
const char *id,
GSettings *settings);
void panel_menu_button_invoke_menu (PanelMenuButton *button,
const char *callback_name);
void panel_menu_button_popup_menu (PanelMenuButton *button,
guint n_button,
guint32 activate_time);
void panel_menu_button_set_dnd_enabled (PanelMenuButton *button,
gboolean dnd_enabled);
G_END_DECLS
#endif /* __PANEL_MENU_BUTTON_H__ */
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
#include "launcher.h" #include "launcher.h"
#include "panel-action-button.h" #include "panel-action-button.h"
#include "panel-applet-frame.h" #include "panel-applet-frame.h"
#include "panel-menu-button.h"
#include "panel-object-loader.h" #include "panel-object-loader.h"
...@@ -201,11 +200,6 @@ panel_object_loader_idle_handler (gpointer dummy) ...@@ -201,11 +200,6 @@ panel_object_loader_idle_handler (gpointer dummy)
object->id, object->id,
object->settings); object->settings);
break; break;
case PANEL_OBJECT_MENU:
panel_menu_button_load (panel_widget,
object->id,
object->settings);
break;
case PANEL_OBJECT_LAUNCHER: case PANEL_OBJECT_LAUNCHER:
launcher_load (panel_widget, launcher_load (panel_widget,
object->id, object->id,
...@@ -352,7 +346,6 @@ static struct { ...@@ -352,7 +346,6 @@ static struct {
gboolean has_detail; gboolean has_detail;
} panel_object_iid_map[] = { } panel_object_iid_map[] = {
{ PANEL_OBJECT_ACTION, "ActionButton" , TRUE }, { PANEL_OBJECT_ACTION, "ActionButton" , TRUE },
{ PANEL_OBJECT_MENU, "MenuButton" , FALSE },
{ PANEL_OBJECT_LAUNCHER, "Launcher" , FALSE } { PANEL_OBJECT_LAUNCHER, "Launcher" , FALSE }
}; };
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#include "panel-action-button.h" #include "panel-action-button.h"
#include "panel-multiscreen.h" #include "panel-multiscreen.h"
#include "panel-toplevel.h" #include "panel-toplevel.h"
#include "panel-menu-button.h"
#include "panel-lockdown.h" #include "panel-lockdown.h"
#include "panel-icon-names.h" #include "panel-icon-names.h"
#include "panel-layout.h" #include "panel-layout.h"
...@@ -76,7 +75,6 @@ orientation_change (AppletInfo *info, ...@@ -76,7 +75,6 @@ orientation_change (AppletInfo *info,
panel_applet_frame_change_orientation ( panel_applet_frame_change_orientation (
PANEL_APPLET_FRAME (info->widget), orientation); PANEL_APPLET_FRAME (info->widget), orientation);
break; break;
case PANEL_OBJECT_MENU:
case PANEL_OBJECT_LAUNCHER: case PANEL_OBJECT_LAUNCHER:
case PANEL_OBJECT_ACTION: case PANEL_OBJECT_ACTION:
button_widget_set_orientation (BUTTON_WIDGET (info->widget), orientation); button_widget_set_orientation (BUTTON_WIDGET (info->widget), orientation);
...@@ -432,24 +430,6 @@ drop_url (PanelWidget *panel, ...@@ -432,24 +430,6 @@ drop_url (PanelWidget *panel,
return TRUE; 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 static gboolean
drop_uri (PanelWidget *panel, drop_uri (PanelWidget *panel,
PanelObjectPackType pack_type, PanelObjectPackType pack_type,
...@@ -742,37 +722,6 @@ drop_internal_icon (PanelWidget *panel, ...@@ -742,37 +722,6 @@ drop_internal_icon (PanelWidget *panel,
return TRUE; 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 static gboolean
drop_internal_applet (PanelWidget *panel, drop_internal_applet (PanelWidget *panel,
PanelObjectPackType pack_type, PanelObjectPackType pack_type,
...@@ -787,36 +736,7 @@ drop_internal_applet (PanelWidget *panel, ...@@ -787,36 +736,7 @@ drop_internal_applet (PanelWidget *panel,
if (applet_type == NULL) if (applet_type == NULL)
return FALSE; return FALSE;
if (sscanf (applet_type, "MENU:%d", &applet_index) == 1) { if (!strncmp (applet_type, "ACTION:", strlen ("ACTION:"))) {
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 (panel_layout_is_writable ()) { if (panel_layout_is_writable ()) {
remove_applet = panel_action_button_load_from_drag ( remove_applet = panel_action_button_load_from_drag (
panel->toplevel, panel->toplevel,
......
...@@ -6,7 +6,6 @@ data/org.gnome.gnome-panel.applet.window-list.gschema.xml ...@@ -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.applet.workspace-switcher.gschema.xml
data/org.gnome.gnome-panel.gschema.xml data/org.gnome.gnome-panel.gschema.xml
data/org.gnome.gnome-panel.launcher.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.object.gschema.xml
data/org.gnome.gnome-panel.toplevel.gschema.xml data/org.gnome.gnome-panel.toplevel.gschema.xml
gnome-panel/applet.c gnome-panel/applet.c
...@@ -35,7 +34,6 @@ gnome-panel/panel-context-menu.c ...@@ -35,7 +34,6 @@ gnome-panel/panel-context-menu.c
gnome-panel/panel-ditem-editor.c gnome-panel/panel-ditem-editor.c
gnome-panel/panel-force-quit.c gnome-panel/panel-force-quit.c
gnome-panel/panel-layout.c gnome-panel/panel-layout.c
gnome-panel/panel-menu-button.c
gnome-panel/panel-menu-items.c gnome-panel/panel-menu-items.c
gnome-panel/panel-image-menu-item.c gnome-panel/panel-image-menu-item.c
gnome-panel/panel-recent.c gnome-panel/panel-recent.c
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment