[gnome-panel/wip/3.0-freeze-break: 11/32] panel, libpanel-applet: Drop per-applet Lock setting
- From: Vincent Untz <vuntz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel/wip/3.0-freeze-break: 11/32] panel, libpanel-applet: Drop per-applet Lock setting
- Date: Thu, 24 Mar 2011 17:53:36 +0000 (UTC)
commit 163c1faeccae8bb14d8307c1f497bd581b95fa1b
Author: Vincent Untz <vuntz gnome org>
Date: Wed Mar 23 11:42:06 2011 +0100
panel, libpanel-applet: Drop per-applet Lock setting
This was mostly useful because it was too easy to move applets, but with
the new way to edit panels, it's not needed anymore.
doc/reference/panel-applet/tmpl/applet.sgml | 5 -
gnome-panel/applet.c | 145 +-----------
gnome-panel/applet.h | 9 +-
gnome-panel/launcher.c | 5 +-
gnome-panel/launcher.h | 1 -
.../panel-applet-container.c | 16 --
.../panel-applet-container.h | 2 -
.../panel-applet-frame-dbus.c | 19 --
gnome-panel/panel-action-button.c | 6 +-
gnome-panel/panel-action-button.h | 1 -
gnome-panel/panel-applet-frame.c | 38 +---
gnome-panel/panel-applet-frame.h | 7 +-
gnome-panel/panel-menu-bar.c | 6 +-
gnome-panel/panel-menu-bar.h | 1 -
gnome-panel/panel-menu-button.c | 5 +-
gnome-panel/panel-menu-button.h | 1 -
gnome-panel/panel-object.schemas.in | 7 +-
gnome-panel/panel-profile.c | 7 +-
gnome-panel/panel-separator.c | 3 +-
gnome-panel/panel-separator.h | 1 -
gnome-panel/panel-widget.c | 249 +-------------------
gnome-panel/panel-widget.h | 11 -
libpanel-applet/panel-applet.c | 112 ---------
23 files changed, 24 insertions(+), 633 deletions(-)
---
diff --git a/doc/reference/panel-applet/tmpl/applet.sgml b/doc/reference/panel-applet/tmpl/applet.sgml
index eddf72b..56f9d1d 100644
--- a/doc/reference/panel-applet/tmpl/applet.sgml
+++ b/doc/reference/panel-applet/tmpl/applet.sgml
@@ -83,11 +83,6 @@ Panel Applet
</para>
-<!-- ##### ARG PanelApplet:locked ##### -->
-<para>
-
-</para>
-
<!-- ##### ARG PanelApplet:locked-down ##### -->
<para>
diff --git a/gnome-panel/applet.c b/gnome-panel/applet.c
index 6479e02..9379ed0 100644
--- a/gnome-panel/applet.c
+++ b/gnome-panel/applet.c
@@ -79,36 +79,6 @@ panel_applet_set_dnd_enabled (AppletInfo *info,
}
-gboolean
-panel_applet_toggle_locked (AppletInfo *info)
-{
- PanelWidget *panel_widget;
- gboolean locked;
-
- panel_widget = panel_applet_get_panel_widget (info);
-
- locked = panel_widget_toggle_applet_locked (panel_widget, info->widget);
-
- panel_applet_save_position (info, info->id, TRUE);
- panel_applet_set_dnd_enabled (info, !locked);
-
- return locked;
-}
-
-static void
-panel_applet_lock (GtkCheckMenuItem *menuitem,
- AppletInfo *info)
-{
- gboolean locked;
-
- locked = panel_applet_toggle_locked (info);
-
- gtk_check_menu_item_set_active (menuitem, locked);
-
- if (info->move_item)
- gtk_widget_set_sensitive (info->move_item, !locked);
-}
-
static void
move_applet_callback (GtkWidget *widget, AppletInfo *info)
{
@@ -203,46 +173,6 @@ panel_applet_recreate_menus (AppletInfo *info)
}
static void
-panel_applet_locked_change_notify (GConfClient *client,
- guint cnxn_id,
- GConfEntry *entry,
- GtkWidget *applet)
-{
- GConfValue *value;
- gboolean locked;
- gboolean applet_locked;
- AppletInfo *info;
- PanelWidget *panel_widget;
-
- g_assert (applet != NULL);
-
- info = (AppletInfo *) g_object_get_data (G_OBJECT (applet),
- "applet_info");
- if (info == NULL)
- return;
-
- value = gconf_entry_get_value (entry);
- if (value == NULL || value->type != GCONF_VALUE_BOOL)
- return;
-
- locked = gconf_value_get_bool (value);
-
- panel_widget = panel_applet_get_panel_widget (info);
- applet_locked = panel_widget_get_applet_locked (panel_widget,
- info->widget);
-
- if ((locked && applet_locked) || !(locked || applet_locked))
- return;
-
- panel_applet_toggle_locked (info);
-
- if (info->type == PANEL_OBJECT_APPLET)
- panel_applet_frame_sync_menu_state (PANEL_APPLET_FRAME (info->widget));
- else
- panel_applet_recreate_edit_menu (info);
-}
-
-static void
applet_remove_callback (GtkWidget *widget,
AppletInfo *info)
{
@@ -547,8 +477,6 @@ panel_applet_get_edit_menu (AppletInfo *info)
GtkWidget *menuitem;
PanelWidget *panel_widget;
GtkWidget *image;
- gboolean locked;
- gboolean lockable;
gboolean movable;
gboolean removable;
@@ -561,12 +489,9 @@ panel_applet_get_edit_menu (AppletInfo *info)
menu = panel_applet_create_bare_menu (info);
panel_widget = panel_applet_get_panel_widget (info);
- lockable = panel_applet_lockable (info);
movable = panel_applet_can_freely_move (info);
removable = panel_profile_id_lists_are_writable ();
- locked = panel_widget_get_applet_locked (panel_widget, info->widget);
-
menuitem = gtk_image_menu_item_new_with_mnemonic (_("_Remove From Panel"));
image = gtk_image_new_from_stock (GTK_STOCK_REMOVE,
GTK_ICON_SIZE_MENU);
@@ -576,14 +501,14 @@ panel_applet_get_edit_menu (AppletInfo *info)
G_CALLBACK (applet_remove_callback), info);
gtk_widget_show (menuitem);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
- gtk_widget_set_sensitive (menuitem, (!locked || lockable) && removable);
+ gtk_widget_set_sensitive (menuitem, removable);
menuitem = gtk_menu_item_new_with_mnemonic (_("_Move"));
g_signal_connect (menuitem, "activate",
G_CALLBACK (move_applet_callback), info);
gtk_widget_show (menuitem);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
- gtk_widget_set_sensitive (menuitem, !locked && movable);
+ gtk_widget_set_sensitive (menuitem, movable);
g_assert (info->move_item == NULL);
@@ -591,19 +516,6 @@ panel_applet_get_edit_menu (AppletInfo *info)
g_object_add_weak_pointer (G_OBJECT (menuitem),
(gpointer *) &info->move_item);
- menuitem = gtk_separator_menu_item_new ();
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
- gtk_widget_show (menuitem);
-
- menuitem = gtk_check_menu_item_new_with_mnemonic (_("Loc_k To Panel"));
- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem),
- locked);
- g_signal_connect (menuitem, "toggled",
- G_CALLBACK (panel_applet_lock), info);
- gtk_widget_show (menuitem);
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
- gtk_widget_set_sensitive (menuitem, lockable);
-
info->edit_menu = menu;
return info->edit_menu;
@@ -871,7 +783,6 @@ typedef struct {
char *toplevel_id;
int position;
guint right_stick : 1;
- guint locked : 1;
} PanelAppletToLoad;
/* Each time those lists get both empty,
@@ -1017,27 +928,23 @@ panel_applet_load_idle_handler (gpointer dummy)
case PANEL_OBJECT_APPLET:
panel_applet_frame_load_from_gconf (
panel_widget,
- applet->locked,
applet->position,
applet->id);
break;
case PANEL_OBJECT_MENU:
panel_menu_button_load_from_gconf (panel_widget,
- applet->locked,
applet->position,
TRUE,
applet->id);
break;
case PANEL_OBJECT_LAUNCHER:
launcher_load_from_gconf (panel_widget,
- applet->locked,
applet->position,
applet->id);
break;
case PANEL_OBJECT_ACTION:
panel_action_button_load_from_gconf (
panel_widget,
- applet->locked,
applet->position,
TRUE,
applet->id);
@@ -1045,14 +952,12 @@ panel_applet_load_idle_handler (gpointer dummy)
case PANEL_OBJECT_MENU_BAR:
panel_menu_bar_load_from_gconf (
panel_widget,
- applet->locked,
applet->position,
TRUE,
applet->id);
break;
case PANEL_OBJECT_SEPARATOR:
panel_separator_load_from_gconf (panel_widget,
- applet->locked,
applet->position,
applet->id);
break;
@@ -1073,8 +978,7 @@ panel_applet_queue_applet_to_load (const char *id,
PanelObjectType type,
const char *toplevel_id,
int position,
- gboolean right_stick,
- gboolean locked)
+ gboolean right_stick)
{
PanelAppletToLoad *applet;
@@ -1090,7 +994,6 @@ panel_applet_queue_applet_to_load (const char *id,
applet->toplevel_id = g_strdup (toplevel_id);
applet->position = position;
applet->right_stick = right_stick != FALSE;
- applet->locked = locked != FALSE;
panel_applets_to_load = g_slist_prepend (panel_applets_to_load, applet);
}
@@ -1190,7 +1093,6 @@ panel_applet_save_position (AppletInfo *applet_info,
const char *toplevel_id;
char *old_toplevel_id;
gboolean right_stick;
- gboolean locked;
int position;
g_return_if_fail (applet_info != NULL);
@@ -1247,11 +1149,6 @@ panel_applet_save_position (AppletInfo *applet_info,
if (gconf_client_key_is_writable (client, key, NULL) &&
gconf_client_get_int (client, key, NULL) != position)
gconf_client_set_int (client, key, position, NULL);
-
- locked = panel_widget_get_applet_locked (panel_widget, applet_info->widget) ? 1 : 0;
- key = panel_gconf_full_key (key_type, id, "locked");
- if (gconf_client_get_bool (client, key, NULL) ? 1 : 0 != locked)
- gconf_client_set_bool (client, key, locked, NULL);
}
const char *
@@ -1327,14 +1224,12 @@ panel_applet_register (GtkWidget *applet,
gpointer data,
GDestroyNotify data_destroy,
PanelWidget *panel,
- gboolean locked,
gint pos,
gboolean exactpos,
PanelObjectType type,
const char *id)
{
AppletInfo *info;
- const char *key;
g_return_val_if_fail (applet != NULL && panel != NULL, NULL);
@@ -1361,23 +1256,16 @@ panel_applet_register (GtkWidget *applet,
panel_lockdown_notify_add (G_CALLBACK (panel_applet_recreate_menus),
info);
- key = panel_gconf_full_key ((type == PANEL_OBJECT_APPLET) ?
- PANEL_GCONF_APPLETS : PANEL_GCONF_OBJECTS,
- id, "locked");
- panel_gconf_notify_add_while_alive (key,
- (GConfClientNotifyFunc) panel_applet_locked_change_notify,
- G_OBJECT (applet));
-
registered_applets = g_slist_append (registered_applets, info);
- if (panel_widget_add (panel, applet, locked, pos, exactpos) == -1 &&
- panel_widget_add (panel, applet, locked, 0, TRUE) == -1) {
+ if (panel_widget_add (panel, applet, pos, exactpos) == -1 &&
+ panel_widget_add (panel, applet, 0, TRUE) == -1) {
GSList *l;
for (l = panels; l; l = l->next) {
panel = PANEL_WIDGET (l->data);
- if (panel_widget_add (panel, applet, locked, 0, TRUE) != -1)
+ if (panel_widget_add (panel, applet, 0, TRUE) != -1)
break;
}
@@ -1403,7 +1291,7 @@ panel_applet_register (GtkWidget *applet,
G_CALLBACK (panel_applet_destroy),
info);
- panel_applet_set_dnd_enabled (info, !locked);
+ panel_applet_set_dnd_enabled (info, TRUE);
gtk_widget_show_all (applet);
@@ -1460,22 +1348,3 @@ panel_applet_can_freely_move (AppletInfo *applet)
return TRUE;
}
-
-gboolean
-panel_applet_lockable (AppletInfo *applet)
-{
- GConfClient *client;
- PanelGConfKeyType key_type;
- const char *key;
-
- if (panel_lockdown_get_locked_down ())
- return FALSE;
-
- client = panel_gconf_get_client ();
-
- key_type = (applet->type == PANEL_OBJECT_APPLET) ? PANEL_GCONF_APPLETS : PANEL_GCONF_OBJECTS;
-
- key = panel_gconf_full_key (key_type, applet->id, "locked");
-
- return gconf_client_key_is_writable (client, key, NULL);
-}
diff --git a/gnome-panel/applet.h b/gnome-panel/applet.h
index 62b8b7e..a38b056 100644
--- a/gnome-panel/applet.h
+++ b/gnome-panel/applet.h
@@ -49,7 +49,6 @@ AppletInfo *panel_applet_register (GtkWidget *applet,
gpointer data,
GDestroyNotify data_destroy,
PanelWidget *panel,
- gboolean locked,
gint pos,
gboolean exactpos,
PanelObjectType type,
@@ -69,8 +68,7 @@ void panel_applet_queue_applet_to_load (const char *id,
PanelObjectType type,
const char *toplevel_id,
int position,
- gboolean right_stick,
- gboolean locked);
+ gboolean right_stick);
void panel_applet_load_queued_applets (gboolean initial_load);
gboolean panel_applet_on_load_queue (const char *id);
@@ -95,17 +93,12 @@ int panel_applet_get_position (AppletInfo *applet);
(position, toplevel_id, panel_right_stick) */
gboolean panel_applet_can_freely_move (AppletInfo *applet);
-/* True if the locked flag is writable */
-gboolean panel_applet_lockable (AppletInfo *applet);
-
GtkWidget *panel_applet_get_edit_menu (AppletInfo *info);
void panel_applet_menu_set_recurse (GtkMenu *menu,
const gchar *key,
gpointer data);
-gboolean panel_applet_toggle_locked (AppletInfo *info);
-
void panel_applet_position_menu (GtkMenu *menu,
int *x,
int *y,
diff --git a/gnome-panel/launcher.c b/gnome-panel/launcher.c
index cf0e033..5f1b70d 100644
--- a/gnome-panel/launcher.c
+++ b/gnome-panel/launcher.c
@@ -757,7 +757,6 @@ lancher_properties_enabled (void)
static Launcher *
load_launcher_applet (const char *location,
PanelWidget *panel,
- gboolean locked,
int pos,
gboolean exactpos,
const char *id)
@@ -771,7 +770,7 @@ load_launcher_applet (const char *location,
launcher->info = panel_applet_register (launcher->button, launcher,
free_launcher,
- panel, locked, pos, exactpos,
+ panel, pos, exactpos,
PANEL_OBJECT_LAUNCHER, id);
if (!launcher->info) {
free_launcher (launcher);
@@ -801,7 +800,6 @@ load_launcher_applet (const char *location,
void
launcher_load_from_gconf (PanelWidget *panel_widget,
- gboolean locked,
int position,
const char *id)
{
@@ -826,7 +824,6 @@ launcher_load_from_gconf (PanelWidget *panel_widget,
launcher = load_launcher_applet (launcher_location,
panel_widget,
- locked,
position,
TRUE,
id);
diff --git a/gnome-panel/launcher.h b/gnome-panel/launcher.h
index b848b77..3ff609a 100644
--- a/gnome-panel/launcher.h
+++ b/gnome-panel/launcher.h
@@ -52,7 +52,6 @@ void launcher_launch (Launcher *launcher,
void launcher_properties (Launcher *launcher);
void launcher_load_from_gconf (PanelWidget *panel_widget,
- gboolean locked,
gint position,
const char *id);
diff --git a/gnome-panel/libpanel-applet-private/panel-applet-container.c b/gnome-panel/libpanel-applet-private/panel-applet-container.c
index f8cc985..ce80cba 100644
--- a/gnome-panel/libpanel-applet-private/panel-applet-container.c
+++ b/gnome-panel/libpanel-applet-private/panel-applet-container.c
@@ -41,7 +41,6 @@ enum {
APPLET_BROKEN,
APPLET_MOVE,
APPLET_REMOVE,
- APPLET_LOCK,
CHILD_PROPERTY_CHANGED,
LAST_SIGNAL
};
@@ -60,7 +59,6 @@ static const AppletPropertyInfo applet_properties [] = {
{ "size-hints", "SizeHints" },
{ "background", "Background" },
{ "flags", "Flags" },
- { "locked", "Locked" },
{ "locked-down", "LockedDown" }
};
@@ -189,16 +187,6 @@ panel_applet_container_class_init (PanelAppletContainerClass *klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE,
0);
- signals[APPLET_LOCK] =
- g_signal_new ("applet-lock",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (PanelAppletContainerClass, applet_lock),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__BOOLEAN,
- G_TYPE_NONE,
- 1, G_TYPE_BOOLEAN);
signals[CHILD_PROPERTY_CHANGED] =
g_signal_new ("child-property-changed",
G_TYPE_FROM_CLASS (klass),
@@ -273,10 +261,6 @@ panel_applet_container_child_signal (GDBusProxy *proxy,
g_signal_emit (container, signals[APPLET_MOVE], 0);
} else if (g_strcmp0 (signal_name, "RemoveFromPanel") == 0) {
g_signal_emit (container, signals[APPLET_REMOVE], 0);
- } else if (g_strcmp0 (signal_name, "Lock") == 0) {
- g_signal_emit (container, signals[APPLET_LOCK], 0, TRUE);
- } else if (g_strcmp0 (signal_name, "Unlock") == 0) {
- g_signal_emit (container, signals[APPLET_LOCK], 0, FALSE);
}
}
diff --git a/gnome-panel/libpanel-applet-private/panel-applet-container.h b/gnome-panel/libpanel-applet-private/panel-applet-container.h
index 912193e..b251b0d 100644
--- a/gnome-panel/libpanel-applet-private/panel-applet-container.h
+++ b/gnome-panel/libpanel-applet-private/panel-applet-container.h
@@ -60,8 +60,6 @@ struct _PanelAppletContainerClass {
void (*applet_broken) (PanelAppletContainer *container);
void (*applet_move) (PanelAppletContainer *container);
void (*applet_remove) (PanelAppletContainer *container);
- void (*applet_lock) (PanelAppletContainer *container,
- gboolean locked);
void (*child_property_changed) (PanelAppletContainer *container,
const gchar *property_name,
GVariant *value);
diff --git a/gnome-panel/libpanel-applet-private/panel-applet-frame-dbus.c b/gnome-panel/libpanel-applet-private/panel-applet-frame-dbus.c
index 7f365ab..83afc26 100644
--- a/gnome-panel/libpanel-applet-private/panel-applet-frame-dbus.c
+++ b/gnome-panel/libpanel-applet-private/panel-applet-frame-dbus.c
@@ -158,16 +158,11 @@ static void
panel_applet_frame_dbus_sync_menu_state (PanelAppletFrame *frame,
gboolean movable,
gboolean removable,
- gboolean lockable,
- gboolean locked,
gboolean locked_down)
{
PanelAppletFrameDBus *dbus_frame = PANEL_APPLET_FRAME_DBUS (frame);
panel_applet_container_child_set (dbus_frame->priv->container,
- "locked", g_variant_new_boolean (lockable && locked),
- NULL, NULL, NULL);
- panel_applet_container_child_set (dbus_frame->priv->container,
"locked-down", g_variant_new_boolean (locked_down),
NULL, NULL, NULL);
}
@@ -328,14 +323,6 @@ panel_applet_frame_dbus_applet_move (PanelAppletContainer *container,
}
static void
-panel_applet_frame_dbus_applet_lock (PanelAppletContainer *container,
- gboolean locked,
- PanelAppletFrame *frame)
-{
- _panel_applet_frame_applet_lock (frame, locked);
-}
-
-static void
panel_applet_frame_dbus_finalize (GObject *object)
{
PanelAppletFrameDBus *frame = PANEL_APPLET_FRAME_DBUS (object);
@@ -376,9 +363,6 @@ panel_applet_frame_dbus_init (PanelAppletFrameDBus *frame)
g_signal_connect (container, "applet-move",
G_CALLBACK (panel_applet_frame_dbus_applet_move),
frame);
- g_signal_connect (container, "applet-lock",
- G_CALLBACK (panel_applet_frame_dbus_applet_lock),
- frame);
}
static void
@@ -457,9 +441,6 @@ panel_applet_frame_dbus_load (const gchar *iid,
"size",
g_variant_new_uint32 (panel_applet_frame_activating_get_size (frame_act)));
g_variant_builder_add (&builder, "{sv}",
- "locked",
- g_variant_new_boolean (panel_applet_frame_activating_get_locked (frame_act)));
- g_variant_builder_add (&builder, "{sv}",
"locked-down",
g_variant_new_boolean (panel_applet_frame_activating_get_locked_down (frame_act)));
if (background) {
diff --git a/gnome-panel/panel-action-button.c b/gnome-panel/panel-action-button.c
index 413acbd..bf0ae88 100644
--- a/gnome-panel/panel-action-button.c
+++ b/gnome-panel/panel-action-button.c
@@ -666,7 +666,6 @@ panel_action_button_style_updated (PanelActionButton *button)
static void
panel_action_button_load (PanelActionButtonType type,
PanelWidget *panel,
- gboolean locked,
int position,
gboolean exactpos,
const char *id)
@@ -679,7 +678,7 @@ panel_action_button_load (PanelActionButtonType type,
button->priv->info = panel_applet_register (GTK_WIDGET (button),
NULL, NULL,
- panel, locked, position,
+ panel, position,
exactpos, PANEL_OBJECT_ACTION, id);
if (!button->priv->info) {
gtk_widget_destroy (GTK_WIDGET (button));
@@ -724,7 +723,6 @@ panel_action_button_create (PanelToplevel *toplevel,
void
panel_action_button_load_from_gconf (PanelWidget *panel,
- gboolean locked,
int position,
gboolean exactpos,
const char *id)
@@ -744,7 +742,7 @@ panel_action_button_load_from_gconf (PanelWidget *panel,
g_free (action_type);
- panel_action_button_load (type, panel, locked,
+ panel_action_button_load (type, panel,
position, exactpos, id);
}
diff --git a/gnome-panel/panel-action-button.h b/gnome-panel/panel-action-button.h
index f4a3d6a..27ac7d8 100644
--- a/gnome-panel/panel-action-button.h
+++ b/gnome-panel/panel-action-button.h
@@ -64,7 +64,6 @@ void panel_action_button_set_type (PanelActionButton *button,
PanelActionButtonType type);
void panel_action_button_load_from_gconf (PanelWidget *panel,
- gboolean locked,
int position,
gboolean exactpos,
const char *id);
diff --git a/gnome-panel/panel-applet-frame.c b/gnome-panel/panel-applet-frame.c
index ae395e7..a7ce389 100644
--- a/gnome-panel/panel-applet-frame.c
+++ b/gnome-panel/panel-applet-frame.c
@@ -55,13 +55,11 @@ static void panel_applet_frame_loading_failed (const char *iid,
static void panel_applet_frame_load (const gchar *iid,
PanelWidget *panel,
- gboolean locked,
int position,
gboolean exactpos,
const char *id);
struct _PanelAppletFrameActivating {
- gboolean locked;
PanelWidget *panel;
int position;
gboolean exactpos;
@@ -467,8 +465,6 @@ panel_applet_frame_sync_menu_state (PanelAppletFrame *frame)
{
PanelWidget *panel_widget;
gboolean locked_down;
- gboolean locked;
- gboolean lockable;
gboolean movable;
gboolean removable;
@@ -476,12 +472,9 @@ panel_applet_frame_sync_menu_state (PanelAppletFrame *frame)
movable = panel_applet_can_freely_move (frame->priv->applet_info);
removable = panel_profile_id_lists_are_writable ();
- lockable = panel_applet_lockable (frame->priv->applet_info);
-
- locked = panel_widget_get_applet_locked (panel_widget, GTK_WIDGET (frame));
locked_down = panel_lockdown_get_locked_down ();
- PANEL_APPLET_FRAME_GET_CLASS (frame)->sync_menu_state (frame, movable, removable, lockable, locked, locked_down);
+ PANEL_APPLET_FRAME_GET_CLASS (frame)->sync_menu_state (frame, movable, removable, locked_down);
}
void
@@ -572,7 +565,7 @@ _panel_applet_frame_activated (PanelAppletFrame *frame,
info = panel_applet_register (GTK_WIDGET (frame), GTK_WIDGET (frame),
NULL, frame->priv->panel,
- frame_act->locked, frame_act->position,
+ frame_act->position,
frame_act->exactpos, PANEL_OBJECT_APPLET,
frame_act->id);
frame->priv->applet_info = info;
@@ -691,7 +684,6 @@ panel_applet_frame_reload_response (GtkWidget *dialog,
char *iid;
char *id = NULL;
int position = -1;
- gboolean locked = FALSE;
panel = frame->priv->panel;
iid = g_strdup (frame->priv->iid);
@@ -699,11 +691,10 @@ panel_applet_frame_reload_response (GtkWidget *dialog,
if (info) {
id = g_strdup (info->id);
position = panel_applet_get_position (info);
- locked = panel_widget_get_applet_locked (panel, info->widget);
panel_applet_clean (info);
}
- panel_applet_frame_load (iid, panel, locked,
+ panel_applet_frame_load (iid, panel,
position, TRUE, id);
g_free (iid);
@@ -808,18 +799,6 @@ _panel_applet_frame_applet_move (PanelAppletFrame *frame)
GDK_CURRENT_TIME);
}
-void
-_panel_applet_frame_applet_lock (PanelAppletFrame *frame,
- gboolean locked)
-{
- PanelWidget *panel_widget = PANEL_WIDGET (gtk_widget_get_parent (GTK_WIDGET (frame)));
-
- if (panel_widget_get_applet_locked (panel_widget, GTK_WIDGET (frame)) == locked)
- return;
-
- panel_applet_toggle_locked (frame->priv->applet_info);
-}
-
/* Generic methods */
static GSList *no_reload_applets = NULL;
@@ -855,12 +834,6 @@ panel_applet_frame_activating_get_size (PanelAppletFrameActivating *frame_act)
}
gboolean
-panel_applet_frame_activating_get_locked (PanelAppletFrameActivating *frame_act)
-{
- return frame_act->locked;
-}
-
-gboolean
panel_applet_frame_activating_get_locked_down (PanelAppletFrameActivating *frame_act)
{
return panel_lockdown_get_locked_down ();
@@ -961,7 +934,6 @@ panel_applet_frame_loading_failed (const char *iid,
static void
panel_applet_frame_load (const gchar *iid,
PanelWidget *panel,
- gboolean locked,
int position,
gboolean exactpos,
const char *id)
@@ -984,7 +956,6 @@ panel_applet_frame_load (const gchar *iid,
}
frame_act = g_slice_new0 (PanelAppletFrameActivating);
- frame_act->locked = locked;
frame_act->panel = panel;
frame_act->position = position;
frame_act->exactpos = exactpos;
@@ -998,7 +969,6 @@ panel_applet_frame_load (const gchar *iid,
void
panel_applet_frame_load_from_gconf (PanelWidget *panel_widget,
- gboolean locked,
int position,
const char *id)
{
@@ -1014,7 +984,7 @@ panel_applet_frame_load_from_gconf (PanelWidget *panel_widget,
}
panel_applet_frame_load (applet_iid, panel_widget,
- locked, position, TRUE, id);
+ position, TRUE, id);
g_free (applet_iid);
}
diff --git a/gnome-panel/panel-applet-frame.h b/gnome-panel/panel-applet-frame.h
index 2d0723e..458d961 100644
--- a/gnome-panel/panel-applet-frame.h
+++ b/gnome-panel/panel-applet-frame.h
@@ -51,8 +51,6 @@ struct _PanelAppletFrameClass {
void (*sync_menu_state) (PanelAppletFrame *frame,
gboolean movable,
gboolean removable,
- gboolean lockable,
- gboolean locked,
gboolean locked_down);
void (*popup_menu) (PanelAppletFrame *frame,
@@ -86,7 +84,6 @@ void panel_applet_frame_create (PanelToplevel *toplevel,
const char *iid);
void panel_applet_frame_load_from_gconf (PanelWidget *panel_widget,
- gboolean locked,
int position,
const char *id);
@@ -112,7 +109,6 @@ typedef struct _PanelAppletFrameActivating PanelAppletFrameActivating;
GdkScreen *panel_applet_frame_activating_get_screen (PanelAppletFrameActivating *frame_act);
PanelOrientation panel_applet_frame_activating_get_orientation (PanelAppletFrameActivating *frame_act);
guint32 panel_applet_frame_activating_get_size (PanelAppletFrameActivating *frame_act);
-gboolean panel_applet_frame_activating_get_locked (PanelAppletFrameActivating *frame_act);
gboolean panel_applet_frame_activating_get_locked_down (PanelAppletFrameActivating *frame_act);
gchar *panel_applet_frame_activating_get_conf_path (PanelAppletFrameActivating *frame_act);
@@ -140,8 +136,7 @@ void _panel_applet_frame_applet_broken (PanelAppletFrame *frame);
void _panel_applet_frame_applet_remove (PanelAppletFrame *frame);
void _panel_applet_frame_applet_move (PanelAppletFrame *frame);
-void _panel_applet_frame_applet_lock (PanelAppletFrame *frame,
- gboolean locked);
+
G_END_DECLS
#endif /* __PANEL_APPLET_FRAME_H__ */
diff --git a/gnome-panel/panel-menu-bar.c b/gnome-panel/panel-menu-bar.c
index 4fdc262..ef98f90 100644
--- a/gnome-panel/panel-menu-bar.c
+++ b/gnome-panel/panel-menu-bar.c
@@ -382,7 +382,6 @@ panel_menu_bar_on_draw (GtkWidget *widget,
static void
panel_menu_bar_load (PanelWidget *panel,
- gboolean locked,
int position,
gboolean exactpos,
const char *id)
@@ -395,7 +394,7 @@ panel_menu_bar_load (PanelWidget *panel,
menubar->priv->info = panel_applet_register (
GTK_WIDGET (menubar), NULL, NULL,
- panel, locked, position, exactpos,
+ panel, position, exactpos,
PANEL_OBJECT_MENU_BAR, id);
if (!menubar->priv->info) {
gtk_widget_destroy (GTK_WIDGET (menubar));
@@ -430,12 +429,11 @@ panel_menu_bar_load (PanelWidget *panel,
void
panel_menu_bar_load_from_gconf (PanelWidget *panel,
- gboolean locked,
int position,
gboolean exactpos,
const char *id)
{
- panel_menu_bar_load (panel, locked, position, exactpos, id);
+ panel_menu_bar_load (panel, position, exactpos, id);
}
void
diff --git a/gnome-panel/panel-menu-bar.h b/gnome-panel/panel-menu-bar.h
index a172e5c..87e4c5e 100644
--- a/gnome-panel/panel-menu-bar.h
+++ b/gnome-panel/panel-menu-bar.h
@@ -57,7 +57,6 @@ void panel_menu_bar_create (PanelToplevel *toplevel,
int position);
void panel_menu_bar_load_from_gconf (PanelWidget *panel,
- gboolean locked,
int position,
gboolean exactpos,
const char *id);
diff --git a/gnome-panel/panel-menu-button.c b/gnome-panel/panel-menu-button.c
index c7b81cd..8686ced 100644
--- a/gnome-panel/panel-menu-button.c
+++ b/gnome-panel/panel-menu-button.c
@@ -648,7 +648,6 @@ panel_menu_button_load (const char *menu_path,
gboolean use_custom_icon,
const char *tooltip,
PanelWidget *panel,
- gboolean locked,
int position,
gboolean exactpos,
const char *id)
@@ -668,7 +667,7 @@ panel_menu_button_load (const char *menu_path,
NULL);
info = panel_applet_register (GTK_WIDGET (button), NULL, NULL,
- panel, locked, position, exactpos,
+ panel, position, exactpos,
PANEL_OBJECT_MENU, id);
if (!info) {
gtk_widget_destroy (GTK_WIDGET (button));
@@ -879,7 +878,6 @@ panel_menu_button_set_use_custom_icon (PanelMenuButton *button,
void
panel_menu_button_load_from_gconf (PanelWidget *panel,
- gboolean locked,
int position,
gboolean exactpos,
const char *id)
@@ -926,7 +924,6 @@ panel_menu_button_load_from_gconf (PanelWidget *panel,
use_custom_icon,
tooltip,
panel,
- locked,
position,
exactpos,
id);
diff --git a/gnome-panel/panel-menu-button.h b/gnome-panel/panel-menu-button.h
index 2de07f7..c8e8561 100644
--- a/gnome-panel/panel-menu-button.h
+++ b/gnome-panel/panel-menu-button.h
@@ -74,7 +74,6 @@ void panel_menu_button_set_use_custom_icon (PanelMenuButton *button,
gboolean use_custom_icon);
void panel_menu_button_load_from_gconf (PanelWidget *panel,
- gboolean locked,
int position,
gboolean exactpos,
const char *id);
diff --git a/gnome-panel/panel-object.schemas.in b/gnome-panel/panel-object.schemas.in
index dfab892..974bc6e 100644
--- a/gnome-panel/panel-object.schemas.in
+++ b/gnome-panel/panel-object.schemas.in
@@ -69,11 +69,8 @@
<type>bool</type>
<default>false</default>
<locale name="C">
- <short>Lock the object to the panel</short>
- <long>
- If true, the user may not move the applet without first unlocking
- the object using the "Unlock" menuitem.
- </long>
+ <short>Deprecated</short>
+ <long></long>
</locale>
</schema>
diff --git a/gnome-panel/panel-profile.c b/gnome-panel/panel-profile.c
index b699c43..57e6a2e 100644
--- a/gnome-panel/panel-profile.c
+++ b/gnome-panel/panel-profile.c
@@ -1826,7 +1826,6 @@ panel_profile_load_object (GConfClient *client,
char *toplevel_id;
int position;
gboolean right_stick;
- gboolean locked;
object_dir = g_strdup_printf ("%s/%s/%s",
profile_dir,
@@ -1854,15 +1853,11 @@ panel_profile_load_object (GConfClient *client,
key = panel_gconf_sprintf ("%s/panel_right_stick", object_dir);
right_stick = gconf_client_get_bool (client, key, NULL);
- key = panel_gconf_sprintf ("%s/locked", object_dir);
- locked = gconf_client_get_bool (client, key, NULL);
-
panel_applet_queue_applet_to_load (id,
object_type,
toplevel_id,
position,
- right_stick,
- locked);
+ right_stick);
g_free (toplevel_id);
g_free (type_string);
diff --git a/gnome-panel/panel-separator.c b/gnome-panel/panel-separator.c
index a604231..f8ace3c 100644
--- a/gnome-panel/panel-separator.c
+++ b/gnome-panel/panel-separator.c
@@ -229,7 +229,6 @@ panel_separator_set_orientation (PanelSeparator *separator,
void
panel_separator_load_from_gconf (PanelWidget *panel,
- gboolean locked,
int position,
const char *id)
{
@@ -239,7 +238,7 @@ panel_separator_load_from_gconf (PanelWidget *panel,
separator->priv->info = panel_applet_register (GTK_WIDGET (separator),
NULL, NULL,
- panel, locked, position,
+ panel, position,
TRUE,
PANEL_OBJECT_SEPARATOR,
id);
diff --git a/gnome-panel/panel-separator.h b/gnome-panel/panel-separator.h
index 5a23c0a..5df4858 100644
--- a/gnome-panel/panel-separator.h
+++ b/gnome-panel/panel-separator.h
@@ -55,7 +55,6 @@ GType panel_separator_get_type (void) G_GNUC_CONST;
void panel_separator_create (PanelToplevel *toplevel,
int position);
void panel_separator_load_from_gconf (PanelWidget *panel_widget,
- gboolean locked,
gint position,
const char *id);
void panel_separator_set_orientation (PanelSeparator *separator,
diff --git a/gnome-panel/panel-widget.c b/gnome-panel/panel-widget.c
index dcc08ff..d6327ff 100644
--- a/gnome-panel/panel-widget.c
+++ b/gnome-panel/panel-widget.c
@@ -475,7 +475,7 @@ panel_widget_cadd (GtkContainer *container,
g_return_if_fail (PANEL_IS_WIDGET (container));
g_return_if_fail (GTK_IS_WIDGET (widget));
- panel_widget_add (PANEL_WIDGET (container), widget, FALSE, 0, FALSE);
+ panel_widget_add (PANEL_WIDGET (container), widget, 0, FALSE);
}
static void
@@ -586,41 +586,6 @@ get_size_from_hints (AppletData *ad, int cells)
}
static void
-panel_widget_jump_applet_right (PanelWidget *panel,
- GList *list,
- GList *next,
- int pos)
-{
- AppletData *ad;
- AppletData *nad = NULL;
-
- ad = list->data;
- if (next)
- nad = next->data;
-
- if (pos >= panel->size)
- return;
-
- if (!nad || nad->constrained >= pos + ad->min_cells)
- goto jump_right;
-
- if (!panel_widget_push_applet_right (panel, next, pos + ad->min_cells - nad->constrained)) {
- panel_widget_jump_applet_right (panel,
- list,
- next->next,
- nad->constrained + nad->min_cells);
- return;
- }
-
- jump_right:
- ad->pos = ad->constrained = pos;
- panel->applet_list = g_list_remove_link (panel->applet_list, list);
- panel->applet_list = panel_g_list_insert_before (panel->applet_list, next, list);
- gtk_widget_queue_resize (GTK_WIDGET (panel));
- emit_applet_moved (panel, ad);
-}
-
-static void
panel_widget_switch_applet_right (PanelWidget *panel,
GList *list)
{
@@ -643,14 +608,6 @@ panel_widget_switch_applet_right (PanelWidget *panel,
return;
}
- if (nad->locked) {
- panel_widget_jump_applet_right (panel,
- list,
- list->next->next,
- nad->constrained + nad->min_cells);
- return;
- }
-
nad->constrained = nad->pos = ad->constrained;
ad->constrained = ad->pos = ad->constrained + nad->min_cells;
panel->applet_list = panel_g_list_swap_next (panel->applet_list, list);
@@ -662,41 +619,6 @@ panel_widget_switch_applet_right (PanelWidget *panel,
}
static void
-panel_widget_jump_applet_left (PanelWidget *panel,
- GList *list,
- GList *prev,
- int pos)
-{
- AppletData *ad;
- AppletData *pad = NULL;
-
- ad = list->data;
- if (prev)
- pad = prev->data;
-
- if (pos < 0)
- return;
-
- if (!pad || pad->constrained + pad->min_cells <= pos)
- goto jump_left;
-
- if (!panel_widget_push_applet_left (panel, prev, pad->constrained + pad->min_cells - pos)) {
- panel_widget_jump_applet_left (panel,
- list,
- prev->prev,
- pad->constrained - ad->min_cells);
- return;
- }
-
- jump_left:
- ad->pos = ad->constrained = pos;
- panel->applet_list = g_list_remove_link (panel->applet_list, list);
- panel->applet_list = panel_g_list_insert_after (panel->applet_list, prev, list);
- gtk_widget_queue_resize (GTK_WIDGET (panel));
- emit_applet_moved (panel, ad);
-}
-
-static void
panel_widget_switch_applet_left (PanelWidget *panel,
GList *list)
{
@@ -717,14 +639,6 @@ panel_widget_switch_applet_left (PanelWidget *panel,
return;
}
- if (pad->locked) {
- panel_widget_jump_applet_left (panel,
- list,
- list->prev->prev,
- pad->constrained - ad->min_cells);
- return;
- }
-
ad->constrained = ad->pos = pad->constrained;
pad->constrained = pad->pos = ad->constrained + ad->min_cells;
panel->applet_list = panel_g_list_swap_prev (panel->applet_list, list);
@@ -735,55 +649,6 @@ panel_widget_switch_applet_left (PanelWidget *panel,
emit_applet_moved (panel, pad);
}
-static gboolean
-panel_widget_try_push_right (PanelWidget *panel,
- GList *list,
- int push)
-{
- AppletData *ad;
- AppletData *nad = NULL;
-
- g_assert (list != NULL);
-
- ad = list->data;
- if (list->next)
- nad = list->next->data;
-
- if (ad->locked)
- return FALSE;
-
- if (ad->constrained + ad->min_cells + push >= panel->size)
- return FALSE;
-
- if (!nad || nad->constrained >= ad->constrained + ad->min_cells + push)
- return TRUE;
-
- return panel_widget_try_push_right (panel, list->next, push);
-}
-
-static int
-panel_widget_get_right_jump_pos (PanelWidget *panel,
- AppletData *ad,
- GList *next,
- int pos)
-{
- AppletData *nad = NULL;
-
- if (next)
- nad = next->data;
-
- if (!nad || nad->constrained >= pos + ad->min_cells)
- return pos;
-
- if (panel_widget_try_push_right (panel, next, pos + ad->min_cells - nad->constrained))
- return pos;
-
- return panel_widget_get_right_jump_pos (panel,
- ad,
- next->next,
- nad->constrained + nad->min_cells);
-}
-
static int
panel_widget_get_right_switch_pos (PanelWidget *panel,
GList *list)
@@ -800,64 +665,9 @@ panel_widget_get_right_switch_pos (PanelWidget *panel,
if (!nad || nad->constrained >= ad->constrained + ad->min_cells + MOVE_INCREMENT)
return ad->constrained + MOVE_INCREMENT;
- if (nad->locked)
- return panel_widget_get_right_jump_pos (panel,
- ad,
- list->next->next,
- nad->constrained + nad->min_cells);
-
return nad->constrained + nad->min_cells - ad->cells;
}
-static gboolean
-panel_widget_try_push_left (PanelWidget *panel,
- GList *list,
- int push)
-{
- AppletData *ad;
- AppletData *pad = NULL;
-
- g_assert (list != NULL);
-
- ad = list->data;
- if (list->prev)
- pad = list->prev->data;
-
- if (ad->locked)
- return FALSE;
-
- if (ad->constrained - push < 0)
- return FALSE;
-
- if (!pad || pad->constrained + pad->min_cells <= ad->constrained - push)
- return TRUE;
-
- return panel_widget_try_push_left (panel, list->prev, push);
-}
-
-static int
-panel_widget_get_left_jump_pos (PanelWidget *panel,
- AppletData *ad,
- GList *prev,
- int pos)
-{
- AppletData *pad = NULL;
-
- if (prev)
- pad = prev->data;
-
- if (!pad || pad->constrained + pad->min_cells <= pos)
- return pos;
-
- if (panel_widget_try_push_left (panel, prev, pad->constrained + pad->min_cells - pos))
- return pos;
-
- return panel_widget_get_left_jump_pos (panel,
- ad,
- prev->prev,
- pad->constrained - ad->min_cells);
-}
-
static int
panel_widget_get_left_switch_pos (PanelWidget *panel,
GList *list)
@@ -874,12 +684,6 @@ panel_widget_get_left_switch_pos (PanelWidget *panel,
if (!pad || pad->constrained + pad->min_cells <= ad->constrained - MOVE_INCREMENT)
return ad->constrained - MOVE_INCREMENT;
- if (pad->locked)
- return panel_widget_get_left_jump_pos (panel,
- ad,
- list->prev->prev,
- pad->constrained - ad->min_cells);
-
return pad->constrained;
}
@@ -962,9 +766,6 @@ panel_widget_push_applet_right (PanelWidget *panel,
if (ad->constrained + ad->min_cells + push >= panel->size)
return FALSE;
- if (ad->locked)
- return FALSE;
-
if (list->next)
nad = list->next->data;
@@ -1001,9 +802,6 @@ panel_widget_push_applet_left (PanelWidget *panel,
if (ad->constrained - push < 0)
return FALSE;
- if (ad->locked)
- return FALSE;
-
if (list->prev)
pad = list->prev->data;
@@ -1711,9 +1509,6 @@ panel_widget_applet_drag_start_no_grab (PanelWidget *panel,
ad = g_object_get_data (G_OBJECT (applet), PANEL_APPLET_DATA);
g_return_val_if_fail (ad != NULL, FALSE);
- if (ad->locked)
- return FALSE;
-
/* Check if we can actually move this object in the
configuration */
info = g_object_get_data (G_OBJECT (applet), "applet_info");
@@ -2437,7 +2232,6 @@ panel_widget_find_empty_pos(PanelWidget *panel, int pos)
int
panel_widget_add (PanelWidget *panel,
GtkWidget *applet,
- gboolean locked,
int pos,
gboolean insert_at_pos)
{
@@ -2484,7 +2278,6 @@ panel_widget_add (PanelWidget *panel,
ad->size_constrained = FALSE;
ad->expand_major = FALSE;
ad->expand_minor = FALSE;
- ad->locked = locked;
ad->size_hints = NULL;
g_object_set_data (G_OBJECT (applet),
PANEL_APPLET_DATA, ad);
@@ -2867,46 +2660,6 @@ panel_widget_set_applet_size_hints (PanelWidget *panel,
gtk_widget_queue_resize (GTK_WIDGET (panel));
}
-void
-panel_widget_set_applet_locked (PanelWidget *panel,
- GtkWidget *applet,
- gboolean locked)
-{
- AppletData *ad;
-
- ad = g_object_get_data (G_OBJECT (applet), PANEL_APPLET_DATA);
- if (!ad)
- return;
-
- ad->locked = locked;
-}
-
-gboolean
-panel_widget_get_applet_locked (PanelWidget *panel,
- GtkWidget *applet)
-{
- AppletData *ad;
-
- ad = g_object_get_data (G_OBJECT (applet), PANEL_APPLET_DATA);
- if (!ad)
- return FALSE;
-
- return ad->locked;
-}
-
-gboolean
-panel_widget_toggle_applet_locked (PanelWidget *panel,
- GtkWidget *applet)
-{
- AppletData *ad;
-
- ad = g_object_get_data (G_OBJECT (applet), PANEL_APPLET_DATA);
- if (!ad)
- return FALSE;
-
- return ad->locked = !ad->locked;
-}
-
gboolean
panel_applet_is_in_drag (void)
{
diff --git a/gnome-panel/panel-widget.h b/gnome-panel/panel-widget.h
index b3e0f4d..3f3fcf1 100644
--- a/gnome-panel/panel-widget.h
+++ b/gnome-panel/panel-widget.h
@@ -75,8 +75,6 @@ struct _AppletData
guint size_constrained : 1;
guint expand_major : 1;
guint expand_minor : 1;
- guint locked : 1;
-
};
struct _PanelWidget
@@ -148,7 +146,6 @@ GtkWidget * panel_widget_new (PanelToplevel *toplevel,
is on, we REALLY want to insert at the pos given by pos*/
int panel_widget_add (PanelWidget *panel,
GtkWidget *applet,
- gboolean locked,
int pos,
gboolean insert_at_pos);
@@ -212,14 +209,6 @@ void panel_widget_set_applet_size_hints (PanelWidget *panel,
int *size_hints,
int size_hints_len);
-void panel_widget_set_applet_locked (PanelWidget *panel,
- GtkWidget *applet,
- gboolean locked);
-gboolean panel_widget_get_applet_locked (PanelWidget *panel,
- GtkWidget *applet);
-gboolean panel_widget_toggle_applet_locked (PanelWidget *panel,
- GtkWidget *applet);
-
void panel_widget_register_open_dialog (PanelWidget *panel,
GtkWidget *dialog);
G_END_DECLS
diff --git a/libpanel-applet/panel-applet.c b/libpanel-applet/panel-applet.c
index ba2687a..679100b 100644
--- a/libpanel-applet/panel-applet.c
+++ b/libpanel-applet/panel-applet.c
@@ -109,7 +109,6 @@ struct _PanelAppletPrivate {
gboolean moving_focus_out;
- gboolean locked;
gboolean locked_down;
};
@@ -134,7 +133,6 @@ enum {
PROP_BACKGROUND,
PROP_FLAGS,
PROP_SIZE_HINTS,
- PROP_LOCKED,
PROP_LOCKED_DOWN
};
@@ -146,8 +144,6 @@ static void panel_applet_menu_cmd_remove (GtkAction *action,
PanelApplet *applet);
static void panel_applet_menu_cmd_move (GtkAction *action,
PanelApplet *applet);
-static void panel_applet_menu_cmd_lock (GtkAction *action,
- PanelApplet *applet);
static void panel_applet_register_object (PanelApplet *applet);
static const gchar panel_menu_ui[] =
@@ -158,8 +154,6 @@ static const gchar panel_menu_ui[] =
" <popup name=\"PanelAppletEditPopup\" action=\"PopupEditAction\">\n"
" <menuitem name=\"RemoveItem\" action=\"Remove\"/>\n"
" <menuitem name=\"MoveItem\" action=\"Move\"/>\n"
- " <separator/>\n"
- " <menuitem name=\"LockItem\" action=\"Lock\"/>\n"
" </popup>\n"
"</ui>\n";
@@ -175,12 +169,6 @@ static const GtkActionEntry menu_entries[] = {
G_CALLBACK (panel_applet_menu_cmd_move) }
};
-static const GtkToggleActionEntry menu_toggle_entries[] = {
- { "Lock", NULL, N_("Loc_k To Panel"),
- NULL, NULL,
- G_CALLBACK (panel_applet_menu_cmd_lock) }
-};
-
G_DEFINE_TYPE (PanelApplet, panel_applet, GTK_TYPE_EVENT_BOX)
#define PANEL_APPLET_INTERFACE "org.gnome.panel.applet.Applet"
@@ -628,62 +616,6 @@ panel_applet_set_orient (PanelApplet *applet,
g_object_notify (G_OBJECT (applet), "orient");
}
-#if 0
-/* Locked should not be public API: it's not useful for applet writers to know
- * if the applet is locked (as opposed to locked_down). */
-static gboolean
-panel_applet_get_locked (PanelApplet *applet)
-{
- g_return_val_if_fail (PANEL_IS_APPLET (applet), FALSE);
-
- return applet->priv->locked;
-}
-#endif
-
-static void
-panel_applet_set_locked (PanelApplet *applet,
- gboolean locked)
-{
- GtkAction *action;
-
- g_return_if_fail (PANEL_IS_APPLET (applet));
-
- if (applet->priv->locked == locked)
- return;
-
- applet->priv->locked = locked;
-
- action = panel_applet_menu_get_action (applet, "Lock");
- g_signal_handlers_block_by_func (action,
- panel_applet_menu_cmd_lock,
- applet);
- gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), locked);
- g_signal_handlers_unblock_by_func (action,
- panel_applet_menu_cmd_lock,
- applet);
-
- panel_applet_menu_update_actions (applet);
-
- g_object_notify (G_OBJECT (applet), "locked");
-
- if (applet->priv->connection) {
- GError *error = NULL;
-
- g_dbus_connection_emit_signal (applet->priv->connection,
- NULL,
- applet->priv->object_path,
- PANEL_APPLET_INTERFACE,
- locked ? "Lock" : "Unlock",
- NULL, &error);
- if (error) {
- g_printerr ("Failed to send signal %s: %s\n",
- locked ? "Lock" : "Unlock",
- error->message);
- g_error_free (error);
- }
- }
-}
-
/**
* panel_applet_get_locked_down:
* @applet: a #PanelApplet.
@@ -871,17 +803,12 @@ panel_applet_menu_get_action (PanelApplet *applet,
static void
panel_applet_menu_update_actions (PanelApplet *applet)
{
- gboolean locked = applet->priv->locked;
gboolean locked_down = applet->priv->locked_down;
- g_object_set (panel_applet_menu_get_action (applet, "Lock"),
- "visible", !locked_down, NULL);
g_object_set (panel_applet_menu_get_action (applet, "Move"),
- "sensitive", !locked,
"visible", !locked_down,
NULL);
g_object_set (panel_applet_menu_get_action (applet, "Remove"),
- "sensitive", !locked,
"visible", !locked_down,
NULL);
}
@@ -930,16 +857,6 @@ panel_applet_menu_cmd_move (GtkAction *action,
}
}
-static void
-panel_applet_menu_cmd_lock (GtkAction *action,
- PanelApplet *applet)
-{
- gboolean locked;
-
- locked = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
- panel_applet_set_locked (applet, locked);
-}
-
/**
* panel_applet_setup_menu:
* @applet: a #PanelApplet.
@@ -1878,9 +1795,6 @@ panel_applet_get_property (GObject *object,
g_value_set_pointer (value, variant);
}
break;
- case PROP_LOCKED:
- g_value_set_boolean (value, applet->priv->locked);
- break;
case PROP_LOCKED_DOWN:
g_value_set_boolean (value, applet->priv->locked_down);
break;
@@ -1937,9 +1851,6 @@ panel_applet_set_property (GObject *object,
panel_applet_set_size_hints (applet, size_hints, n_elements, 0);
}
break;
- case PROP_LOCKED:
- panel_applet_set_locked (applet, g_value_get_boolean (value));
- break;
case PROP_LOCKED_DOWN:
panel_applet_set_locked_down (applet, g_value_get_boolean (value));
break;
@@ -2022,10 +1933,6 @@ panel_applet_init (PanelApplet *applet)
menu_entries,
G_N_ELEMENTS (menu_entries),
applet);
- gtk_action_group_add_toggle_actions (applet->priv->panel_action_group,
- menu_toggle_entries,
- G_N_ELEMENTS (menu_toggle_entries),
- applet);
applet->priv->ui_manager = gtk_ui_manager_new ();
gtk_ui_manager_insert_action_group (applet->priv->ui_manager,
@@ -2216,18 +2123,6 @@ panel_applet_class_init (PanelAppletClass *klass)
"Size hints of the applet",
G_PARAM_READWRITE));
/**
- * PanelApplet:locked:
- *
- * Whether the position of the applet is locked.
- **/
- g_object_class_install_property (gobject_class,
- PROP_LOCKED,
- g_param_spec_boolean ("locked",
- "Locked",
- "Whether the position of the applet is locked",
- FALSE,
- G_PARAM_READWRITE));
- /**
* PanelApplet:locked-down:
*
* Whether the panel the applet is on is locked down.
@@ -2391,8 +2286,6 @@ get_property_cb (GDBusConnection *connection,
retval = g_variant_new_array (G_VARIANT_TYPE_INT32,
children, applet->priv->size_hints_len);
g_free (children);
- } else if (g_strcmp0 (property_name, "Locked") == 0) {
- retval = g_variant_new_boolean (applet->priv->locked);
} else if (g_strcmp0 (property_name, "LockedDown") == 0) {
retval = g_variant_new_boolean (applet->priv->locked_down);
}
@@ -2428,8 +2321,6 @@ set_property_cb (GDBusConnection *connection,
size_hints = g_variant_get_fixed_array (value, &n_elements, sizeof (gint32));
panel_applet_set_size_hints (applet, size_hints, n_elements, 0);
- } else if (g_strcmp0 (property_name, "Locked") == 0) {
- panel_applet_set_locked (applet, g_variant_get_boolean (value));
} else if (g_strcmp0 (property_name, "LockedDown") == 0) {
panel_applet_set_locked_down (applet, g_variant_get_boolean (value));
}
@@ -2454,12 +2345,9 @@ static const gchar introspection_xml[] =
"<property name='Background' type='s' access='readwrite'/>"
"<property name='Flags' type='u' access='readwrite'/>"
"<property name='SizeHints' type='ai' access='readwrite'/>"
- "<property name='Locked' type='b' access='readwrite'/>"
"<property name='LockedDown' type='b' access='readwrite'/>"
"<signal name='Move' />"
"<signal name='RemoveFromPanel' />"
- "<signal name='Lock' />"
- "<signal name='Unlock' />"
"</interface>"
"</node>";
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]