Commit 3082173b authored by Mark McLoughlin's avatar Mark McLoughlin Committed by Mark McLoughlin

Move applet loading/saving to/from gconf into applet.c where it can be

2002-01-07  Mark McLoughlin  <mark@skynet.ie>

        Move applet loading/saving to/from gconf into applet.c where
        it can be used by all type of panel objects.

        * applet.[ch]:
        (panel_applet_clean_gconf): impl.
        (panel_applet_clean): clean_gconf and remove the applet from
        the list.
        (applet_idle_remove): save position for all object.
        (applet_destroy): free gconf_key.
        (panel_applet_get_full_gconf_key),
        (panel_applet_load_from_unique_id), (panel_applet_load_list),
        (panel_applet_load_applets_from_gconf),
        (panel_applet_save_position),
        (panel_applet_save_to_gconf): impl.
        (panel_applet_register): add gconf_key arg, save_to_gconf.
        (panel_applet_get_position),
        (panel_applet_get_panel_id), (panel_applet_get_right_stick):
        add preconditions.

        * drawer.c: (load_drawer_applet):
        * launcher.c: (load_launcher_applet_full):
        * logout.c: (load_logout_applet), (load_lock_applet):
        * menu.c: (load_menu_applet):
        * status.c: (load_status_applet):
        * swallow.c: (load_swallow_applet): update for
        panel_applet_register param change.

        * panel-applet-frame.[ch]:
        (panel_applet_frame_save_to_gconf): only save the bonobo iid.
        (popup_handle_remove): kill gconf stuff.
        (panel_applet_frame_load): generate a gconf_keyt if we're
        loading the applet for the first time.
        (panel_applet_frame_finalize), (panel_applet_frame_construct),
        (panel_applet_frame_new): upd.

        * panel-gconf.[ch]: (panel_gconf_objects_profile_get_full_key),
        (panel_gconf_objects_default_profile_get_full_key): rename
        from panel_gconf_launchers_*.

        * panel.c: (panel_remove_applets): save position for all
        objects.

        * session.c:
        (panel_session_save_applets): save position for all object.
        (panel_session_die): ditto.
        (session_load): use panel_applet_load_applets_from_gconf.
parent ed4008aa
2002-01-07 Mark McLoughlin <mark@skynet.ie>
Move applet loading/saving to/from gconf into applet.c where
it can be used by all type of panel objects.
* applet.[ch]:
(panel_applet_clean_gconf): impl.
(panel_applet_clean): clean_gconf and remove the applet from
the list.
(applet_idle_remove): save position for all object.
(applet_destroy): free gconf_key.
(panel_applet_get_full_gconf_key),
(panel_applet_load_from_unique_id), (panel_applet_load_list),
(panel_applet_load_applets_from_gconf),
(panel_applet_save_position),
(panel_applet_save_to_gconf): impl.
(panel_applet_register): add gconf_key arg, save_to_gconf.
(panel_applet_get_position),
(panel_applet_get_panel_id), (panel_applet_get_right_stick):
add preconditions.
* drawer.c: (load_drawer_applet):
* launcher.c: (load_launcher_applet_full):
* logout.c: (load_logout_applet), (load_lock_applet):
* menu.c: (load_menu_applet):
* status.c: (load_status_applet):
* swallow.c: (load_swallow_applet): update for
panel_applet_register param change.
* panel-applet-frame.[ch]:
(panel_applet_frame_save_to_gconf): only save the bonobo iid.
(popup_handle_remove): kill gconf stuff.
(panel_applet_frame_load): generate a gconf_keyt if we're
loading the applet for the first time.
(panel_applet_frame_finalize), (panel_applet_frame_construct),
(panel_applet_frame_new): upd.
* panel-gconf.[ch]: (panel_gconf_objects_profile_get_full_key),
(panel_gconf_objects_default_profile_get_full_key): rename
from panel_gconf_launchers_*.
* panel.c: (panel_remove_applets): save position for all
objects.
* session.c:
(panel_session_save_applets): save position for all object.
(panel_session_die): ditto.
(session_load): use panel_applet_load_applets_from_gconf.
2002-01-07 Mikael Hallendal <micke@codefactory.se>
* gnome-panel-screenshot.c: always include locale.h, it's used in
......
......@@ -20,6 +20,7 @@
#include "menu-properties.h"
#include "menu-util.h"
#include "panel-config.h"
#include "panel-gconf.h"
#include "panel-config-global.h"
#include "session.h"
#include "status.h"
......@@ -40,6 +41,19 @@ extern int need_complete_save;
extern gboolean commie_mode;
extern GlobalConfig global_config;
static GConfEnumStringPair object_type_enum_map [] = {
{ APPLET_DRAWER, "drawer-object" },
{ APPLET_MENU, "menu-object" },
{ APPLET_LOGOUT, "logout-object" },
{ APPLET_SWALLOW, "swallow-object" },
{ APPLET_LAUNCHER, "launcher-object" },
{ APPLET_EMPTY, "empty-object" },
{ APPLET_LOCK, "lock-object" },
{ APPLET_STATUS, "status-object" },
{ APPLET_RUN, "run-object" },
{ APPLET_BONOBO, "bonobo-applet" },
};
static void
move_applet_callback (GtkWidget *widget, AppletInfo *info)
{
......@@ -56,12 +70,67 @@ move_applet_callback (GtkWidget *widget, AppletInfo *info)
PW_DRAG_OFF_CENTER);
}
static void
panel_applet_clean_gconf (AppletInfo *info)
{
GConfClient *client;
GSList *id_list, *l;
char *temp_key = NULL;
char *profile;
g_return_if_fail (info && info->gconf_key);
client = panel_gconf_get_client ();
profile = session_get_current_profile ();
if (info->type == APPLET_BONOBO)
temp_key = panel_gconf_general_profile_get_full_key (profile, "applet-id-list");
else
temp_key = panel_gconf_general_profile_get_full_key (profile, "object-id-list");
id_list = gconf_client_get_list (panel_gconf_get_client (), temp_key, GCONF_VALUE_STRING, NULL);
for (l = id_list; l; l = l->next)
if (!strcmp (info->gconf_key, (char *) l->data))
break;
if (l) {
char *tmp;
id_list = g_slist_remove_link (id_list, l);
g_free (l->data);
g_slist_free (l);
gconf_client_set_list (client, temp_key, GCONF_VALUE_STRING, id_list, NULL);
if (info->type == APPLET_BONOBO)
tmp = g_strdup_printf ("/apps/panel/profiles/%s/applets/%s",
profile, info->gconf_key);
else
tmp = g_strdup_printf ("/apps/panel/profiles/%s/objects/%s",
profile, info->gconf_key);
panel_gconf_directory_recursive_clean (client, tmp);
g_free (tmp);
}
g_free (temp_key);
g_slist_foreach (id_list, (GFunc) g_free, NULL);
g_slist_free (id_list);
}
/*destroy widgets and call the above cleanup function*/
void
panel_applet_clean (AppletInfo *info)
{
g_return_if_fail (info != NULL);
panel_applet_clean_gconf (info);
applets = g_slist_remove (applets, info);
if (info->widget != NULL) {
if(info->type == APPLET_STATUS) {
status_applet_put_offscreen (info->data);
......@@ -72,6 +141,10 @@ panel_applet_clean (AppletInfo *info)
}
info->data = NULL;
/*
* FIXME: where are we supposed to free the structure?
*/
}
static gboolean
......@@ -79,18 +152,12 @@ applet_idle_remove (gpointer data)
{
AppletInfo *info = data;
switch (info->type) {
case APPLET_BONOBO:
panel_applet_frame_save_position (PANEL_APPLET_FRAME (info->data));
break;
case APPLET_SWALLOW: {
panel_applet_save_position (info, info->gconf_key);
if (info->type == APPLET_SWALLOW) {
Swallow *swallow = info->data;
swallow->clean_remove = TRUE;
}
break;
default:
break;
}
panel_applet_clean (info);
......@@ -732,6 +799,9 @@ applet_destroy (GtkWidget *w, AppletInfo *info)
info->data_destroy = NULL;
info->data = NULL;
g_free (info->gconf_key);
info->gconf_key = NULL;
/*free the user menu*/
for(li = info->user_menu; li != NULL; li = g_list_next(li)) {
AppletUserMenu *umenu = li->data;
......@@ -751,6 +821,195 @@ applet_destroy (GtkWidget *w, AppletInfo *info)
info->user_menu = NULL;
}
static char *
panel_applet_get_full_gconf_key (AppletType type,
const gchar *profile,
const gchar *object_id,
const gchar *key)
{
char *retval = NULL;
if (type == APPLET_BONOBO)
retval = panel_gconf_applets_default_profile_get_full_key (profile, object_id, key);
else
retval = panel_gconf_objects_default_profile_get_full_key (profile, object_id, key);
return retval;
}
static void
panel_applet_load_from_unique_id (GConfClient *gconf_client,
const char *profile,
const char *unique_id)
{
PanelWidget *panel_widget;
AppletType applet_type;
char *type_string;
char *temp_key;
char *panel_id;
int position;
gboolean right_stick;
temp_key = panel_gconf_applets_default_profile_get_full_key (profile, unique_id, "object-type");
type_string = gconf_client_get_string (gconf_client, temp_key, NULL);
if (!gconf_string_to_enum (object_type_enum_map, type_string, (int *) &applet_type)) {
g_warning ("Unkown applet type %s from %s", type_string, temp_key);
return;
}
g_free (temp_key);
g_free (type_string);
temp_key = panel_gconf_applets_default_profile_get_full_key (profile, unique_id, "position");
position = gconf_client_get_int (gconf_client, temp_key, NULL);
g_free (temp_key);
temp_key = panel_gconf_applets_default_profile_get_full_key (profile, unique_id, "panel-id");
panel_id = gconf_client_get_string (gconf_client, temp_key, NULL);
g_free (temp_key);
temp_key = panel_gconf_applets_default_profile_get_full_key (profile, unique_id, "right-stick");
right_stick = gconf_client_get_bool (gconf_client, temp_key, NULL);
g_free (temp_key);
panel_widget = panel_widget_get_by_id (panel_id);
g_free (panel_id);
/*
* A hack from the old panel to make sure the applet is on the right
*/
position += right_stick ? G_MAXINT/2 : 0;
switch (applet_type) {
case APPLET_BONOBO: {
char *applet_iid;
temp_key = panel_gconf_applets_default_profile_get_full_key (profile, unique_id, "bonobo-iid");
applet_iid = gconf_client_get_string (gconf_client, temp_key, NULL);
g_free (temp_key);
panel_applet_frame_load (applet_iid, panel_widget, position, unique_id);
g_free (applet_iid);
}
break;
default:
break;
}
}
static void
panel_applet_load_list (GConfClient *client,
const char *profile,
const char *list_key)
{
GSList *id_list, *l;
char *temp_key;
temp_key = panel_gconf_general_profile_get_full_key (profile, list_key);
id_list = gconf_client_get_list (panel_gconf_get_client (), temp_key, GCONF_VALUE_STRING, NULL);
for (l = id_list; l; l = l->next)
panel_applet_load_from_unique_id (client, profile, (char *) l->data);
g_free (temp_key);
g_slist_foreach (id_list, (GFunc) g_free, NULL);
g_slist_free (id_list);
}
void
panel_applet_load_applets_from_gconf (void)
{
GConfClient *client;
char *profile;
client = panel_gconf_get_client ();
profile = session_get_current_profile ();
panel_applet_load_list (client, profile, "applet-id-list");
panel_applet_load_list (client, profile, "object-id-list");
}
void
panel_applet_save_position (AppletInfo *applet_info,
const char *gconf_key)
{
GConfClient *client;
char *profile;
char *temp_key;
client = panel_gconf_get_client ();
profile = session_get_current_profile ();
temp_key = panel_applet_get_full_gconf_key (applet_info->type, profile, gconf_key, "position");
gconf_client_set_int (client, temp_key, panel_applet_get_position (applet_info), NULL);
g_free (temp_key);
temp_key = panel_applet_get_full_gconf_key (applet_info->type, profile, gconf_key, "panel-id");
gconf_client_set_string (client, temp_key, panel_applet_get_panel_id (applet_info), NULL);
g_free (temp_key);
temp_key = panel_applet_get_full_gconf_key (applet_info->type, profile, gconf_key, "right-stick");
gconf_client_set_bool (client, temp_key, panel_applet_get_right_stick (applet_info), NULL);
g_free (temp_key);
}
void
panel_applet_save_to_gconf (AppletInfo *applet_info)
{
GConfClient *client;
char *profile;
char *temp_key;
GSList *id_list, *l;
client = panel_gconf_get_client ();
profile = session_get_current_profile ();
if (applet_info->type == APPLET_BONOBO)
temp_key = panel_gconf_general_profile_get_full_key (profile, "applet-id-list");
else
temp_key = panel_gconf_general_profile_get_full_key (profile, "object-id-list");
id_list = gconf_client_get_list (client, temp_key, GCONF_VALUE_STRING, NULL);
if (!applet_info->gconf_key)
applet_info->gconf_key = gconf_unique_key ();
for (l = id_list; l; l = l->next)
if (!strcmp (applet_info->gconf_key, (char *) l->data))
break;
if (!l) {
id_list = g_slist_prepend (id_list, g_strdup (applet_info->gconf_key));
gconf_client_set_list (client, temp_key, GCONF_VALUE_STRING, id_list, NULL);
}
g_free (temp_key);
g_slist_foreach (id_list, (GFunc) g_free, NULL);
g_slist_free (id_list);
temp_key = panel_applet_get_full_gconf_key (applet_info->type, profile,
applet_info->gconf_key, "object-type");
gconf_client_set_string (client, temp_key,
gconf_enum_to_string (object_type_enum_map, applet_info->type),
NULL);
g_free (temp_key);
panel_applet_save_position (applet_info, applet_info->gconf_key);
switch (applet_info->type) {
case APPLET_BONOBO:
panel_applet_frame_save_to_gconf (PANEL_APPLET_FRAME (applet_info->data),
applet_info->gconf_key);
break;
default:
break;
}
}
AppletInfo *
panel_applet_register (GtkWidget *applet,
gpointer data,
......@@ -758,7 +1017,8 @@ panel_applet_register (GtkWidget *applet,
PanelWidget *panel,
gint pos,
gboolean exactpos,
AppletType type)
AppletType type,
const char *gconf_key)
{
AppletInfo *info;
int newpos;
......@@ -869,6 +1129,11 @@ panel_applet_register (GtkWidget *applet,
size_change (info, panel);
back_change (info, panel);
if (gconf_key)
info->gconf_key = g_strdup (gconf_key);
panel_applet_save_to_gconf (info);
return info;
}
......@@ -877,6 +1142,9 @@ panel_applet_get_position (AppletInfo *applet)
{
AppletData *applet_data;
g_return_val_if_fail (applet, 0);
g_return_val_if_fail (G_IS_OBJECT (applet->widget), 0);
applet_data = g_object_get_data (G_OBJECT (applet->widget), PANEL_APPLET_DATA);
return applet_data->pos;
......@@ -887,6 +1155,9 @@ panel_applet_get_panel_id (AppletInfo *applet)
{
PanelWidget *panel;
g_return_val_if_fail (applet, NULL);
g_return_val_if_fail (G_IS_OBJECT (applet->widget), NULL);
panel = PANEL_WIDGET (applet->widget->parent);
return panel->unique_id;
......@@ -900,6 +1171,9 @@ panel_applet_get_right_stick (AppletInfo *applet)
{
PanelWidget *panel;
g_return_val_if_fail (applet, FALSE);
g_return_val_if_fail (G_IS_OBJECT (applet->widget), FALSE);
panel = PANEL_WIDGET (applet->widget->parent);
return panel_widget_is_applet_stuck (panel, applet->widget);
......
......@@ -46,6 +46,8 @@ typedef struct {
gpointer data;
GDestroyNotify data_destroy;
char *gconf_key;
} AppletInfo;
typedef struct {
......@@ -66,7 +68,8 @@ AppletInfo *panel_applet_register (GtkWidget *applet,
PanelWidget *panel,
gint pos,
gboolean exactpos,
AppletType type);
AppletType type,
const char *gconf_key);
void panel_applet_clean (AppletInfo *info);
......@@ -90,6 +93,11 @@ void panel_applet_callback_set_sensitive (AppletInfo *info,
const char *callback_name,
gint sensitive);
void panel_applet_load_applets_from_gconf (void);
void panel_applet_save_to_gconf (AppletInfo *applet_info);
void panel_applet_save_position (AppletInfo *applet_info,
const char *gconf_key);
int panel_applet_get_position (AppletInfo *applet);
gchar *panel_applet_get_panel_id (AppletInfo *applet);
gboolean panel_applet_get_right_stick (AppletInfo *applet);
......
......@@ -472,7 +472,8 @@ load_drawer_applet (gchar *mypanel_id, const char *pixmap, const char *tooltip,
panel,
pos,
exactpos,
APPLET_DRAWER);
APPLET_DRAWER,
NULL);
if (!info) {
gtk_widget_destroy (dw);
......
......@@ -609,7 +609,8 @@ load_launcher_applet_full (const char *params, GnomeDesktopItem *ditem,
launcher->info = panel_applet_register (launcher->button, launcher,
free_launcher, panel, pos,
exactpos, APPLET_LAUNCHER);
exactpos, APPLET_LAUNCHER,
NULL);
if (!launcher->info) {
/*
* Don't free launcher here, the button has
......
......@@ -118,7 +118,8 @@ load_logout_applet (PanelWidget *panel,
return;
info = panel_applet_register (logout, NULL, NULL, panel,
pos, exactpos, APPLET_LOGOUT);
pos, exactpos, APPLET_LOGOUT,
NULL);
if (!info)
return;
......@@ -183,7 +184,7 @@ load_lock_applet (PanelWidget *panel,
return;
info = panel_applet_register (lock, NULL, NULL, panel, pos,
exactpos, APPLET_LOCK);
exactpos, APPLET_LOCK, NULL);
if (!info)
return;
......
......@@ -4648,7 +4648,7 @@ load_menu_applet (const char *params,
AppletInfo *info;
info = panel_applet_register (menu->button, menu, free_menu, panel,
pos, exactpos, APPLET_MENU);
pos, exactpos, APPLET_MENU, NULL);
if (!info)
return;
......
......@@ -42,113 +42,24 @@ struct _PanelAppletFramePrivate {
AppletInfo *applet_info;
gchar *iid;
gchar *unique_key;
};
static GObjectClass *parent_class;
static void panel_applet_frame_save_to_gconf (PanelAppletFrame *frame);
static void
panel_applet_frame_load_from_unique_id (GConfClient *gconf_client,
const char *profile,
const char *unique_id)
{
PanelWidget *panel_widget;
char *temp_key;
char *panel_id;
char *applet_iid;
int position;
gboolean right_stick;
temp_key = panel_gconf_applets_default_profile_get_full_key (profile, unique_id, "bonobo-iid");
applet_iid = gconf_client_get_string (gconf_client, temp_key, NULL);
g_free (temp_key);
temp_key = panel_gconf_applets_default_profile_get_full_key (profile, unique_id, "position");
position = gconf_client_get_int (gconf_client, temp_key, NULL);
g_free (temp_key);
temp_key = panel_gconf_applets_default_profile_get_full_key (profile, unique_id, "panel-id");
panel_id = gconf_client_get_string (gconf_client, temp_key, NULL);
g_free (temp_key);
temp_key = panel_gconf_applets_default_profile_get_full_key (profile, unique_id, "right-stick");
right_stick = gconf_client_get_bool (gconf_client, temp_key, NULL);
g_free (temp_key);
panel_widget = panel_widget_get_by_id (panel_id);
/*
* A hack from the old panel to make sure the applet is on the right
*/
position += right_stick ? G_MAXINT/2 : 0;
panel_applet_frame_load (applet_iid, panel_widget, position, unique_id);
g_free (panel_id);
g_free (applet_iid);
}
void
panel_applet_frame_load_applets (void)
{
GConfClient *client;
GSList *applet_id_list, *l;
char *temp_key;
char *profile;
client = panel_gconf_get_client ();
profile = session_get_current_profile ();
temp_key = panel_gconf_general_profile_get_full_key (profile, "applet-id-list");
applet_id_list = gconf_client_get_list (panel_gconf_get_client (),
temp_key,
GCONF_VALUE_STRING,
NULL);
for (l = applet_id_list; l; l = l->next)
panel_applet_frame_load_from_unique_id (client, profile, (char *) l->data);
g_free (temp_key);
g_slist_foreach (applet_id_list, (GFunc) g_free, NULL);
g_slist_free (applet_id_list);
}
static void
panel_applet_frame_save_to_gconf (PanelAppletFrame *frame)
panel_applet_frame_save_to_gconf (PanelAppletFrame *frame,
const char *gconf_key)
{
GConfClient *client;
char *profile;
char *temp_key;
GSList *applet_id_list, *l;
client = panel_gconf_get_client ();
profile = session_get_current_profile ();
temp_key = panel_gconf_general_profile_get_full_key (profile, "applet-id-list");
applet_id_list = gconf_client_get_list (client, temp_key, GCONF_VALUE_STRING, NULL);
for (l = applet_id_list; l; l = l->next)
if (!strcmp (frame->priv->unique_key, (gchar *) l->data))
g_warning ("%s unique applet id already registered",
frame->priv->unique_key);
applet_id_list = g_slist_prepend (applet_id_list, g_strdup (frame->priv->unique_key));
gconf_client_set_list (client, temp_key, GCONF_VALUE_STRING, applet_id_list, NULL);
g_free (temp_key);
g_slist_foreach (applet_id_list, (GFunc) g_free, NULL);
g_slist_free (applet_id_list);
temp_key = panel_gconf_applets_default_profile_get_full_key (profile, frame->priv->unique_key, "bonobo-iid");
temp_key = panel_gconf_applets_default_profile_get_full_key (profile, gconf_key, "bonobo-iid");
gconf_client_set_string (client, temp_key, frame->priv->iid, NULL);
g_free (temp_key);
panel_applet_frame_save_position (frame);
}
static void
......@@ -156,48 +67,6 @@ popup_handle_remove (BonoboUIComponent *uic,
PanelAppletFrame *frame,
const gchar *verbname)
{
GConfClient *client;
GSList *applet_id_list, *l;
char *temp_key;
char *profile;
g_return_if_fail (frame && PANEL_IS_APPLET_FRAME (frame));
client = panel_gconf_get_client ();
profile = session_get_current_profile ();
temp_key = panel_gconf_general_profile_get_full_key (profile, "applet-id-list");
applet_id_list = gconf_client_get_list (panel_gconf_get_client (),
temp_key,
GCONF_VALUE_STRING,
NULL);
for (l = applet_id_list; l; l = l->next)
if (!strcmp (frame->priv->unique_key, (char *) l->data))
break;
if (l) {
char *tmp;
applet_id_list = g_slist_remove_link (applet_id_list, l);
g_free (l->data);
g_slist_free (l);
gconf_client_set_list (client, temp_key, GCONF_VALUE_STRING, applet_id_list, NULL);
tmp = g_strdup_printf ("/apps/panel/profiles/%s/applets/%s", profile, frame->priv->unique_key);
panel_gconf_directory_recursive_clean (client, tmp);
g_free (tmp);
}
g_free (temp_key);
g_slist_foreach (applet_id_list, (GFunc) g_free, NULL);
g_slist_free (applet_id_list);
panel_applet_clean (frame->priv->applet_info);
}
......@@ -243,13 +112,19 @@ panel_applet_frame_load (const gchar *iid,
gint pos,
const char *gconf_key)
{
GtkWidget *frame;
GtkWidget *frame = NULL;
AppletInfo *info;
char *real_key;
g_return_if_fail (iid);
g_return_if_fail (panel);
frame = panel_applet_frame_new (iid, gconf_key);
if (gconf_key)
real_key = g_strdup (gconf_key);
else
real_key = gconf_unique_key ();
frame = panel_applet_frame_new (iid, real_key);
if (!frame) {
GtkWidget *dialog;
......@@ -274,41 +149,15 @@ panel_applet_frame_load (const gchar *iid,
panel,
pos,
FALSE,
APPLET_BONOBO);
APPLET_BONOBO,
real_key);
if (!info)
g_warning (_("Cannot register control widget\n"));
panel_applet_frame_set_info (PANEL_APPLET_FRAME (frame), info);
if (!gconf_key)
panel_applet_frame_save_to_gconf (PANEL_APPLET_FRAME (frame));
}
void
panel_applet_frame_save_position (PanelAppletFrame *frame)
{
GConfClient *client;
AppletInfo *info;
char *profile;
char *temp_key;
client = panel_gconf_get_client ();
profile = session_get_current_profile ();
info = frame->priv->applet_info;
g_free (real_key);
temp_key = panel_gconf_applets_default_profile_get_full_key (profile, frame->priv->unique_key, "position");
gconf_client_set_int (client, temp_key, panel_applet_get_position (info), NULL);
g_free (temp_key);
temp_key = panel_gconf_applets_default_profile_get_full_key (profile, frame->priv->unique_key, "panel-id");
gconf_client_set_string (client, temp_key, panel_applet_get_panel_id (info), NULL);
g_free (temp_key);
temp_key = panel_gconf_applets_default_profile_get_full_key (profile, frame->priv->unique_key, "right-stick");