Commit 1abec36f authored by Glynn Foster's avatar Glynn Foster Committed by Glynn Foster

Okay, I've already forgotten what has gone into this patch. Think I've got

2002-01-11  Glynn Foster  <glynn.foster@sun.com>

	* applet.c, drawer.c, drawer.h, gnome-panel-properties.c,
	  launcher.c, launcher.h, logout.c, logout.h, menu.c,
	  menu.h, panel-applet-frame.c, panel-applet-frame.h, panel-gconf.c,
	  panel-gconf.h, panel-per-panel-config.schemas, panel.c,
	  status.c, status.h, swallow.c, swallow.h:
	Okay, I've already forgotten what has gone into this patch. Think I've
	got the global propeties animation speed thing nailed. Tweaked the default
	schema just enough to get everyone pissed because the panel won't load up
	for them. Make everyone happy and tell them that it's only a short 'rm -rf'
	command away from panel utopia...until I break it the next time. Moved some
	stuff around to where it makes more sense. Now I'm seeing elephant trunks
	in my ChangeLog...I need to sleep.
parent 043c3309
2002-01-11 Glynn Foster <glynn.foster@sun.com>
* applet.c, drawer.c, drawer.h, gnome-panel-properties.c,
launcher.c, launcher.h, logout.c, logout.h, menu.c,
menu.h, panel-applet-frame.c, panel-applet-frame.h, panel-gconf.c,
panel-gconf.h, panel-per-panel-config.schemas, panel.c,
status.c, status.h, swallow.c, swallow.h:
Okay, I've already forgotten what has gone into this patch. Think I've
got the global propeties animation speed thing nailed. Tweaked the default
schema just enough to get everyone pissed because the panel won't load up
for them. Make everyone happy and tell them that it's only a short 'rm -rf'
command away from panel utopia...until I break it the next time. Moved some
stuff around to where it makes more sense. Now I'm seeing elephant trunks
in my ChangeLog...I need to sleep.
2002-01-11 Anders Carlsson <andersca@gnu.org>
* panel-shell.c (panel_shell_register): Print out the error
......
......@@ -792,15 +792,17 @@ static char *
panel_applet_get_full_gconf_key (AppletType type,
const gchar *profile,
const gchar *object_id,
const gchar *key)
const gchar *key,
gboolean use_default)
{
char *retval = NULL;
if (type == APPLET_BONOBO)
retval = panel_gconf_applets_profile_get_full_key (profile, object_id, key);
retval = use_default ? panel_gconf_applets_default_profile_get_full_key (profile, object_id, key) :
panel_gconf_applets_profile_get_full_key (profile, object_id, key);
else
retval = panel_gconf_objects_profile_get_full_key (profile, object_id, key);
retval = use_default ? panel_gconf_objects_default_profile_get_full_key (profile, object_id, key) :
panel_gconf_objects_profile_get_full_key (profile, object_id, key);
return retval;
}
......@@ -808,7 +810,8 @@ static void
panel_applet_load_from_unique_id (AppletType type,
GConfClient *gconf_client,
const char *profile,
const char *unique_id)
const char *unique_id,
gboolean use_default)
{
PanelWidget *panel_widget;
AppletType applet_type;
......@@ -818,26 +821,27 @@ panel_applet_load_from_unique_id (AppletType type,
int position;
gboolean right_stick;
temp_key = panel_applet_get_full_gconf_key (type, profile, unique_id, "object-type");
temp_key = panel_applet_get_full_gconf_key (type, profile, unique_id, "object-type", use_default);
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_applet_get_full_gconf_key (type, profile, unique_id, "position");
temp_key = panel_applet_get_full_gconf_key (type, profile, unique_id, "position", use_default);
position = gconf_client_get_int (gconf_client, temp_key, NULL);
g_free (temp_key);
temp_key = panel_applet_get_full_gconf_key (type, profile, unique_id, "panel-id");
temp_key = panel_applet_get_full_gconf_key (type, profile, unique_id, "panel-id", use_default);
panel_id = gconf_client_get_string (gconf_client, temp_key, NULL);
g_free (temp_key);
temp_key = panel_applet_get_full_gconf_key (type, profile, unique_id, "right-stick");
temp_key = panel_applet_get_full_gconf_key (type, profile, unique_id, "panel-right-stick", use_default);
right_stick = gconf_client_get_bool (gconf_client, temp_key, NULL);
g_free (temp_key);
......@@ -851,28 +855,28 @@ panel_applet_load_from_unique_id (AppletType type,
switch (applet_type) {
case APPLET_BONOBO:
panel_applet_frame_load_from_gconf (panel_widget, position, unique_id);
panel_applet_frame_load_from_gconf (panel_widget, position, unique_id, use_default);
break;
case APPLET_DRAWER:
drawer_load_from_gconf (panel_widget, position, unique_id);
drawer_load_from_gconf (panel_widget, position, unique_id, use_default);
break;
case APPLET_SWALLOW:
swallow_load_from_gconf (panel_widget, position, unique_id);
swallow_load_from_gconf (panel_widget, position, unique_id, use_default);
break;
case APPLET_MENU:
menu_load_from_gconf (panel_widget, position, unique_id);
menu_load_from_gconf (panel_widget, position, unique_id, use_default);
break;
case APPLET_LAUNCHER:
launcher_load_from_gconf (panel_widget, position, unique_id);
launcher_load_from_gconf (panel_widget, position, unique_id, use_default);
break;
case APPLET_LOGOUT:
load_logout_applet (panel_widget, position, TRUE);
load_logout_applet (panel_widget, position, TRUE, use_default);
break;
case APPLET_LOCK:
load_lock_applet (panel_widget, position, TRUE);
load_lock_applet (panel_widget, position, TRUE, use_default);
break;
case APPLET_STATUS:
load_status_applet (panel_widget, position, TRUE);
load_status_applet (panel_widget, position, TRUE, use_default);
break;
default:
break;
......@@ -881,21 +885,32 @@ panel_applet_load_from_unique_id (AppletType type,
static void
panel_applet_load_list (AppletType type,
GConfClient *client,
const char *profile)
gboolean use_default)
{
GConfClient *client;
GSList *id_list, *l;
char *profile;
char *temp_key = NULL;
client = panel_gconf_get_client ();
/* This needs to be vastly improved */
if (use_default)
profile = g_strdup ("medium");
else
profile = session_get_current_profile ();
if (type == APPLET_BONOBO)
temp_key = panel_gconf_general_profile_get_full_key (profile, "applet-id-list");
temp_key = use_default ? panel_gconf_general_default_profile_get_full_key (profile, "applet-id-list") :
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");
temp_key = use_default ? panel_gconf_general_default_profile_get_full_key (profile, "object-id-list") :
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)
panel_applet_load_from_unique_id (type, client, profile, (char *) l->data);
panel_applet_load_from_unique_id (type, client, profile, (char *) l->data, use_default);
g_free (temp_key);
g_slist_foreach (id_list, (GFunc) g_free, NULL);
......@@ -905,14 +920,18 @@ panel_applet_load_list (AppletType type,
void
panel_applet_load_applets_from_gconf (void)
{
GConfClient *client;
char *profile;
char *profile_key;
gboolean use_default = FALSE;
client = panel_gconf_get_client ();
profile = session_get_current_profile ();
profile_key = g_strdup_printf ("/apps/panel/profiles/%s", session_get_current_profile ());
if (panel_gconf_dir_exists (profile_key) == FALSE)
use_default = TRUE;
g_free (profile_key);
panel_applet_load_list (APPLET_BONOBO, client, profile);
panel_applet_load_list (APPLET_EMPTY, client, profile);
panel_applet_load_list (APPLET_BONOBO, use_default);
panel_applet_load_list (APPLET_EMPTY, use_default);
}
void
......@@ -926,15 +945,15 @@ panel_applet_save_position (AppletInfo *applet_info,
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");
temp_key = panel_applet_get_full_gconf_key (applet_info->type, profile, gconf_key, "position", FALSE);
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");
temp_key = panel_applet_get_full_gconf_key (applet_info->type, profile, gconf_key, "panel-id", FALSE);
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");
temp_key = panel_applet_get_full_gconf_key (applet_info->type, profile, gconf_key, "right-stick", FALSE);
gconf_client_set_bool (client, temp_key, panel_applet_get_right_stick (applet_info), NULL);
g_free (temp_key);
......@@ -977,7 +996,7 @@ panel_applet_save_to_gconf (AppletInfo *applet_info)
g_slist_free (id_list);
temp_key = panel_applet_get_full_gconf_key (applet_info->type, profile,
applet_info->gconf_key, "object-type");
applet_info->gconf_key, "object-type", FALSE);
gconf_client_set_string (client, temp_key,
gconf_enum_to_string (object_type_enum_map, applet_info->type),
NULL);
......@@ -995,7 +1014,7 @@ panel_applet_save_to_gconf (AppletInfo *applet_info)
applet_info->gconf_key);
break;
case APPLET_SWALLOW:
swallow_save_to_gconf ((Drawer *) applet_info->data,
swallow_save_to_gconf ((Swallow *) applet_info->data,
applet_info->gconf_key);
break;
case APPLET_MENU:
......
......@@ -532,31 +532,34 @@ drawer_save_to_gconf (Drawer *drawer,
client = panel_gconf_get_client ();
profile = session_get_current_profile ();
temp_key = panel_gconf_objects_default_profile_get_full_key (profile, gconf_key, "parameters");
temp_key = panel_gconf_objects_profile_get_full_key (profile, gconf_key, "parameters");
gconf_client_set_int (client, temp_key,
g_slist_index (panels, BASEP_WIDGET (drawer->drawer)->panel),
NULL);
g_free (temp_key);
temp_key = panel_gconf_objects_default_profile_get_full_key (profile, gconf_key, "unique-drawer-panel-id");
temp_key = panel_gconf_objects_profile_get_full_key (profile, gconf_key, "unique-drawer-panel-id");
gconf_client_set_string (client, temp_key,
PANEL_WIDGET (BASEP_WIDGET (drawer->drawer)->panel)->unique_id,
NULL);
g_free (temp_key);
temp_key = panel_gconf_objects_default_profile_get_full_key (profile, gconf_key, "pixmap");
temp_key = panel_gconf_objects_profile_get_full_key (profile, gconf_key, "pixmap");
gconf_client_set_string (client, temp_key, drawer->pixmap, NULL);
g_free (temp_key);
temp_key = panel_gconf_objects_default_profile_get_full_key (profile, gconf_key, "tooltip");
temp_key = panel_gconf_objects_profile_get_full_key (profile, gconf_key, "tooltip");
gconf_client_set_string (client, temp_key, drawer->tooltip, NULL);
g_free (temp_key);
g_free (profile);
}
void
drawer_load_from_gconf (PanelWidget *panel_widget,
gint position,
const char *gconf_key)
const char *gconf_key,
gboolean use_default)
{
GConfClient *client;
char *profile;
......@@ -570,21 +573,26 @@ drawer_load_from_gconf (PanelWidget *panel_widget,
g_return_if_fail (gconf_key);
client = panel_gconf_get_client ();
profile = session_get_current_profile ();
temp_key = panel_gconf_objects_default_profile_get_full_key (profile, gconf_key, "parameters");
/* FIXME: Screen widths etc.. */
if (use_default)
profile = g_strdup ("medium");
else
profile = session_get_current_profile ();
temp_key = panel_gconf_objects_get_full_key (profile, gconf_key, "parameters", use_default);
panel = gconf_client_get_int (client, temp_key, NULL);
g_free (temp_key);
temp_key = panel_gconf_objects_default_profile_get_full_key (profile, gconf_key, "unique-drawer-panel-id");
temp_key = panel_gconf_objects_get_full_key (profile, gconf_key, "unique-drawer-panel-id", use_default);
panel_id = gconf_client_get_string (client, temp_key, NULL);
g_free (temp_key);
temp_key = panel_gconf_objects_default_profile_get_full_key (profile, gconf_key, "pixmap");
temp_key = panel_gconf_objects_get_full_key (profile, gconf_key, "pixmap", use_default);
pixmap = gconf_client_get_string (client, temp_key, NULL);
g_free (temp_key);
temp_key = panel_gconf_objects_default_profile_get_full_key (profile, gconf_key, "tooltip");
temp_key = panel_gconf_objects_get_full_key (profile, gconf_key, "tooltip", use_default);
tooltip = gconf_client_get_string (client, temp_key, NULL);
g_free (temp_key);
......@@ -600,4 +608,5 @@ drawer_load_from_gconf (PanelWidget *panel_widget,
g_free (panel_id);
g_free (pixmap);
g_free (tooltip);
g_free (profile);
}
......@@ -29,7 +29,8 @@ void drawer_save_to_gconf (Drawer *drawer,
void drawer_load_from_gconf (PanelWidget *panel_widget,
gint position,
const char *gconf_key);
const char *gconf_key,
gboolean use_default);
void set_drawer_applet_orient(Drawer *drawer, PanelOrient orient);
......
......@@ -41,6 +41,8 @@
#include <gconf/gconf-client.h>
#define GNOME_PANEL_PROPERTIES_DEBUG 1
/* Just so we can link with panel-util.c for the convert keys stuff*/
GSList *applets;
......
......@@ -41,6 +41,8 @@
#include <gconf/gconf-client.h>
#define GNOME_PANEL_PROPERTIES_DEBUG 1
/* Just so we can link with panel-util.c for the convert keys stuff*/
GSList *applets;
......
......@@ -610,7 +610,7 @@ launcher_save_to_gconf (Launcher *launcher,
location = gnome_desktop_item_get_location (launcher->ditem);
temp_key = panel_gconf_objects_default_profile_get_full_key (profile, gconf_key, "base-location");
temp_key = panel_gconf_objects_profile_get_full_key (profile, gconf_key, "launcher-location");
gconf_client_set_string (client, temp_key, location, NULL);
g_free (temp_key);
}
......@@ -618,26 +618,26 @@ launcher_save_to_gconf (Launcher *launcher,
void
launcher_load_from_gconf (PanelWidget *panel_widget,
gint position,
const char *gconf_key)
const char *gconf_key,
gboolean use_default)
{
GConfClient *client;
char *profile;
char *temp_key;
char *base_location;
char *launcher_location;
g_return_if_fail (panel_widget);
g_return_if_fail (gconf_key);
client = panel_gconf_get_client ();
profile = session_get_current_profile ();
temp_key = panel_gconf_objects_default_profile_get_full_key (profile, gconf_key, "base-location");
base_location = gconf_client_get_string (client, temp_key, NULL);
/* FIXME : We need to do checking of screen dimensions for default */
temp_key = use_default ? panel_gconf_objects_default_profile_get_full_key ("medium", gconf_key, "launcher-location") :
panel_gconf_objects_profile_get_full_key (session_get_current_profile (), gconf_key, "launcher-location");
launcher_location = gconf_client_get_string (client, temp_key, NULL);
g_free (temp_key);
load_launcher_applet (base_location, panel_widget, position, TRUE, gconf_key);
load_launcher_applet (launcher_location, panel_widget, position, TRUE, gconf_key);
g_free (base_location);
g_free (launcher_location);
}
Launcher *
......@@ -901,11 +901,11 @@ launcher_get_unique_uri (void)
}
char *
launcher_file_name (const char *base)
launcher_file_name (const char *location)
{
char *tmp, *retval;
g_return_val_if_fail (base != NULL, NULL);
g_return_val_if_fail (location!= NULL, NULL);
tmp = gnome_util_home_file (PANEL_CONFIG_PATH "launchers");
/* Make sure the launcher directory exists */
......@@ -913,7 +913,7 @@ launcher_file_name (const char *base)
mkdir (tmp, 0700);
}
retval = g_build_filename (tmp, base, NULL);
retval = g_build_filename (tmp, location, NULL);
g_free (tmp);
return retval;
......
......@@ -67,7 +67,8 @@ void launcher_save_to_gconf (Launcher *launcher,
void launcher_load_from_gconf (PanelWidget *panel_widget,
gint position,
const char *gconf_key);
const char *gconf_key,
gboolean use_default);
void ask_about_launcher (const char *file,
PanelWidget *panel,
......
......@@ -108,7 +108,8 @@ create_logout_widget (void)
void
load_logout_applet (PanelWidget *panel,
gint pos,
gboolean exactpos)
gboolean exactpos,
gboolean use_default)
{
GtkWidget *logout;
AppletInfo *info;
......@@ -173,7 +174,8 @@ create_lock_widget(void)
void
load_lock_applet (PanelWidget *panel,
gint pos,
gboolean exactpos)
gboolean exactpos,
gboolean use_default)
{
GtkWidget *lock;
AppletInfo *info;
......
......@@ -12,8 +12,8 @@
G_BEGIN_DECLS
void load_logout_applet(PanelWidget *panel, int pos, gboolean exactpos);
void load_lock_applet(PanelWidget *panel, int pos, gboolean exactpos);
void load_logout_applet(PanelWidget *panel, int pos, gboolean exactpos, gboolean use_default);
void load_lock_applet(PanelWidget *panel, int pos, gboolean exactpos, gboolean use_default);
G_END_DECLS
......
......@@ -1901,20 +1901,20 @@ add_drawer_to_panel (GtkWidget *widget, gpointer data)
static void
add_logout_to_panel (GtkWidget *widget, gpointer data)
{
load_logout_applet (get_panel_from_menu_data(widget, TRUE), 0, FALSE);
load_logout_applet (get_panel_from_menu_data(widget, TRUE), 0, FALSE, FALSE);
}
static void
add_lock_to_panel (GtkWidget *widget, gpointer data)
{
load_lock_applet (get_panel_from_menu_data(widget, TRUE), 0, FALSE);
load_lock_applet (get_panel_from_menu_data(widget, TRUE), 0, FALSE, FALSE);
}
static void
try_add_status_to_panel (GtkWidget *widget, gpointer data)
{
if(!load_status_applet(get_panel_from_menu_data(widget, TRUE),
0, FALSE)) {
0, FALSE, FALSE)) {
GtkWidget *mbox;
mbox = gtk_message_dialog_new (NULL, 0,
GTK_MESSAGE_INFO,
......@@ -3119,18 +3119,12 @@ create_new_panel (GtkWidget *w, gpointer data)
gchar *s;
if (!foobar_widget_exists (screen)) {
const char *panel_id;
panel = foobar_widget_new (NULL, screen);
panel_id = PANEL_WIDGET (FOOBAR_WIDGET (panel)->panel)->unique_id;
/* Don't translate the first part of this string */
s = panel_gconf_panel_profile_get_conditional_string (session_get_current_profile (),
panel_id,
"clock-format",
FALSE, _("%I:%M:%S %p"));
if (s != NULL)
foobar_widget_set_clock_format (FOOBAR_WIDGET (panel), s);
g_free (s);
foobar_widget_set_clock_format (FOOBAR_WIDGET (panel), _("%I: %M: %S: %p"));
panel_setup (panel);
gtk_widget_show (panel);
break;
......@@ -5091,37 +5085,39 @@ menu_save_to_gconf (Menu *menu,
client = panel_gconf_get_client ();
profile = session_get_current_profile ();
temp_key = panel_gconf_objects_default_profile_get_full_key (profile, gconf_key, "path");
temp_key = panel_gconf_objects_profile_get_full_key (profile, gconf_key, "path");
gconf_client_set_string (client, temp_key, menu->path, NULL);
g_free (temp_key);
temp_key = panel_gconf_objects_default_profile_get_full_key (profile, gconf_key, "main-menu");
temp_key = panel_gconf_objects_profile_get_full_key (profile, gconf_key, "main-menu");
gconf_client_set_bool (client, temp_key, menu->main_menu, NULL);
g_free (temp_key);
temp_key = panel_gconf_objects_default_profile_get_full_key (profile, gconf_key, "global-main");
temp_key = panel_gconf_objects_profile_get_full_key (profile, gconf_key, "global-main");
gconf_client_set_bool (client, temp_key, menu->global_main, NULL);
g_free (temp_key);
temp_key = panel_gconf_objects_default_profile_get_full_key (profile, gconf_key, "custom-icon");
temp_key = panel_gconf_objects_profile_get_full_key (profile, gconf_key, "custom-icon");
gconf_client_set_bool (client, temp_key, menu->custom_icon, NULL);
g_free (temp_key);
if (menu->custom_icon) {
temp_key = panel_gconf_objects_default_profile_get_full_key (profile, gconf_key, "custom-icon-file");
temp_key = panel_gconf_objects_profile_get_full_key (profile, gconf_key, "custom-icon-file");
gconf_client_set_string (client, temp_key, menu->custom_icon_file, NULL);
g_free (temp_key);
}
temp_key = panel_gconf_objects_default_profile_get_full_key (profile, gconf_key, "main-menu-flags");
temp_key = panel_gconf_objects_profile_get_full_key (profile, gconf_key, "main-menu-flags");
gconf_client_set_int (client, temp_key, menu->main_menu_flags, NULL);
g_free (temp_key);
g_free (profile);
}
void
menu_load_from_gconf (PanelWidget *panel_widget,
gint position,
const char *gconf_key)
const char *gconf_key,
gboolean use_default)
{
GConfClient *client;
char *profile;
......@@ -5137,31 +5133,35 @@ menu_load_from_gconf (PanelWidget *panel_widget,
g_return_if_fail (gconf_key);
client = panel_gconf_get_client ();
profile = session_get_current_profile ();
/* FIXME : screeen checks */
if (use_default)
profile = g_strdup ("medium");
else
profile = session_get_current_profile ();
temp_key = panel_gconf_objects_default_profile_get_full_key (profile, gconf_key, "path");
temp_key = panel_gconf_objects_get_full_key (profile, gconf_key, "path", use_default);
path = gconf_client_get_string (client, temp_key, NULL);
g_free (temp_key);
temp_key = panel_gconf_objects_default_profile_get_full_key (profile, gconf_key, "main-menu");
temp_key = panel_gconf_objects_get_full_key (profile, gconf_key, "main-menu", use_default);
main_menu = gconf_client_get_bool (client, temp_key, NULL);
g_free (temp_key);
temp_key = panel_gconf_objects_default_profile_get_full_key (profile, gconf_key, "global-main");
temp_key = panel_gconf_objects_get_full_key (profile, gconf_key, "global-main", use_default);
global_main = gconf_client_get_bool (client, temp_key, NULL);
g_free (temp_key);
temp_key = panel_gconf_objects_default_profile_get_full_key (profile, gconf_key, "custom-icon");
temp_key = panel_gconf_objects_get_full_key (profile, gconf_key, "custom-icon", use_default);
custom_icon = gconf_client_get_bool (client, temp_key, NULL);
g_free (temp_key);
if (custom_icon) {
temp_key = panel_gconf_objects_default_profile_get_full_key (profile, gconf_key, "custom-icon-file");
temp_key = panel_gconf_objects_get_full_key (profile, gconf_key, "custom-icon-file", use_default);
custom_icon_file = gconf_client_get_string (client, temp_key, NULL);
g_free (temp_key);
}
temp_key = panel_gconf_objects_default_profile_get_full_key (profile, gconf_key, "main-menu-flags");
temp_key = panel_gconf_objects_get_full_key (profile, gconf_key, "main-menu-flags", use_default);
flags = gconf_client_get_int (client, temp_key, NULL);
g_free (temp_key);
......@@ -5171,4 +5171,5 @@ menu_load_from_gconf (PanelWidget *panel_widget,
g_free (path);
g_free (custom_icon_file);
g_free (profile);
}
......@@ -121,7 +121,8 @@ void menu_save_to_gconf (Menu *menu,
void menu_load_from_gconf (PanelWidget *panel_widget,
gint position,
const char *gconf_key);
const char *gconf_key,
gboolean use_default);
/* perhaps into basep-widget.h? */
enum {
......
......@@ -62,15 +62,16 @@ panel_applet_frame_save_to_gconf (PanelAppletFrame *frame,
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);
g_free (profile);
}
void
panel_applet_frame_load_from_gconf (PanelWidget *panel_widget,
gint position,
const char *gconf_key)
const char *gconf_key,
gboolean use_default)
{
GConfClient *client;
char *profile;
char *temp_key;
char *applet_iid;
......@@ -78,9 +79,9 @@ panel_applet_frame_load_from_gconf (PanelWidget *panel_widget,
g_return_if_fail (gconf_key);
client = panel_gconf_get_client ();
profile = session_get_current_profile ();
temp_key = panel_gconf_applets_default_profile_get_full_key (profile, gconf_key, "bonobo-iid");
temp_key = use_default ? panel_gconf_applets_default_profile_get_full_key ("medium", gconf_key, "bonobo-iid") :
panel_gconf_applets_profile_get_full_key (session_get_current_profile (), gconf_key, "bonobo-iid");
applet_iid = gconf_client_get_string (client, temp_key, NULL);
g_free (temp_key);
......
......@@ -97,7 +97,8 @@ void panel_applet_frame_save_to_gconf (PanelAppletFrame *frame,
void panel_applet_frame_load_from_gconf (PanelWidget *panel_widget,
gint position,
const char *gconf_key);
const char *gconf_key,
gboolean use_default);
G_END_DECLS
......
......@@ -235,99 +235,18 @@ panel_gconf_dir_exists (const gchar *key) {
NULL);
}
void
panel_gconf_panel_profile_set_int (const gchar *profile, const gchar *panel_id, const gchar *key, gint value) {
gchar *panel_profile_key;
panel_profile_key = panel_gconf_panel_profile_get_full_key (profile, panel_id, key);
#ifdef PANEL_GCONF_DEBUG
printf ("Saving to %s\n", panel_profile_key);
#endif
panel_gconf_set_int (panel_profile_key, value);
return;
}
void
panel_gconf_panel_profile_set_bool (const gchar *profile, const gchar *panel_id, const gchar *key, gboolean value) {
gchar *panel_profile_key;
panel_profile_key = panel_gconf_panel_profile_get_full_key (profile, panel_id, key);
#ifdef PANEL_GCONF_DEBUG
printf ("Saving to %s\n", panel_profile_key);
#endif
panel_gconf_set_bool (panel_profile_key, value);
}
void
panel_gconf_panel_profile_set_string (const gchar *profile, const gchar *panel_id, const gchar *key, const gchar *value) {
gchar *panel_profile_key;
panel_profile_key = panel_gconf_panel_profile_get_full_key (profile, panel_id, key);
#ifdef PANEL_GCONF_DEBUG
printf ("Saving to %s\n", panel_profile_key);
#endif
panel_gconf_set_string (panel_profile_key, value);
return;
}
gchar *
panel_gconf_panel_profile_get_conditional_string (const gchar *profile, const gchar *panel_id, const gchar *key, gboolean use_default, const gchar *default_val) {
gchar *panel_profile_key;
gchar *return_val;
/* FIXME: Make this check screen sizes and stuff */
if (use_default) {
panel_profile_key = panel_gconf_panel_default_profile_get_full_key ("medium", panel_id, key);
}
else {
panel_profile_key = panel_gconf_panel_profile_get_full_key (profile, panel_id, key);
}
return_val = panel_gconf_get_string (panel_profile_key, default_val);
g_free (panel_profile_key);
return return_val;
}
gint
panel_gconf_panel_profile_get_conditional_int (const gchar *profile, const gchar *panel_id, const gchar *key, gboolean use_default, gint default_val) {
gchar *panel_profile_key;
gint return_val;
/* FIXME: Make this check screen sizes and stuff */
if (use_default) {
panel_profile_key = panel_gconf_panel_default_profile_get_full_key ("medium", panel_id, key);
}
else {
panel_profile_key = panel_gconf_panel_profile_get_full_key (profile, panel_id, key);
}
return_val = panel_gconf_get_int (panel_profile_key, default_val);
g_free (panel_profile_key);
return return_val;
}
gboolean
panel_gconf_panel_profile_get_conditional_bool (const gchar *profile, const gchar *panel_id, const gchar *key, gboolean use_default, gboolean default_val) {
gchar *panel_profile_key;
gboolean return_val;
char *
panel_gconf_objects_get_full_key (const gchar *profile,
const gchar *object_id,
const gchar *key,
gboolean use_default)
{
char *retval