Commit 09ffc38e authored by Scott Reeves's avatar Scott Reeves

main-menu/src/system-tile.c main-menu/src/slab-window.c

	* main-menu/src/system-tile.c
	* main-menu/src/slab-window.c
	* control-center/src/control-center.c
	* libslab/application-tile.c
	* libslab/slab-gnome-util.c
	* libslab/slab-gnome-util.h
	* libslab/document-tile.c
	* libslab/shell-window.c
	* libslab/slab-section.c
	* libslab/app-shell.c:
	Use smaller icons in CC - Partial fix for BGO 405078
	Patch from Brandon Wright for overdrawn text - BGO 403856
	Fix memory leaks - BGO 402563 and BNC 229190
	Don't crash (on debug builds) when no menu file - BGO 407825
	Check for NULL gconf prefix - BGO 406255

svn path=/trunk/; revision=190
parent 02e86e80
2007-02-15 Scott Reeves <sreeves@novell.com>
* main-menu/src/system-tile.c
* main-menu/src/slab-window.c
* control-center/src/control-center.c
* libslab/application-tile.c
* libslab/slab-gnome-util.c
* libslab/slab-gnome-util.h
* libslab/document-tile.c
* libslab/shell-window.c
* libslab/slab-section.c
* libslab/app-shell.c:
Use smaller icons in CC - Partial fix for BGO 405078
Patch from Brandon Wright for overdrawn text - BGO 403856
Fix memory leaks - BGO 402563 and BNC 229190
Don't crash (on debug builds) when no menu file - BGO 407825
Check for NULL gconf prefix - BGO 406255
2007-02-14 Rodney Dawes <dobey@novell.com>
* libslab/tile.c (tile_expose): Revert previous patch, as it doesn't
......
......@@ -153,7 +153,7 @@ main (int argc, char *argv[])
}
app_data = appshelldata_new ("preferences.menu", NULL, CONTROL_CENTER_PREFIX,
GTK_ICON_SIZE_DIALOG, FALSE, TRUE);
GTK_ICON_SIZE_DND, FALSE, TRUE);
generate_categories (app_data);
actions = get_actions_list ();
......
......@@ -848,8 +848,9 @@ generate_categories (AppShellData * app_data)
gmenu_tree_add_monitor (app_data->tree, gmenu_tree_changed_callback, app_data);
}
root_dir = gmenu_tree_get_root_directory (app_data->tree);
contents = gmenu_tree_directory_get_contents (root_dir);
if (!contents)
if (root_dir)
contents = gmenu_tree_directory_get_contents (root_dir);
if (!root_dir || !contents)
{
GtkWidget *dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "Failure loading - %s",
......
......@@ -292,7 +292,12 @@ application_tile_setup (ApplicationTile *this, const gchar *gconf_prefix)
const gchar *comment;
const gchar *key;
gchar *markup, *value;
gchar *markup;
/*Fixme - need to address the entire gconf key location issue */
/*Fixme - this is just a temporary stop gap */
gboolean use_new_prefix;
GSList *list;
GError *error = NULL;
......@@ -386,12 +391,18 @@ application_tile_setup (ApplicationTile *this, const gchar *gconf_prefix)
/* make "add/remove to favorites" action */
if (this->gconf_prefix && g_str_has_prefix (this->gconf_prefix, "/desktop/"))
if (this->gconf_prefix && !g_str_has_prefix (this->gconf_prefix, "/desktop/"))
use_new_prefix = TRUE;
else
use_new_prefix = FALSE;
if(!use_new_prefix)
key = SLAB_USER_SPECIFIED_APPS_KEY;
else
key = "/apps/main-menu/file-area/user_specified_apps";
if ((value = get_slab_gconf_string (key))) {
if ((list = get_slab_gconf_slist (key))) {
free_slab_gconf_slist_of_strings (list);
action = tile_action_new (TILE (this), user_apps_trigger, NULL, 0);
actions [APPLICATION_TILE_ACTION_UPDATE_MAIN_MENU] = action;
......@@ -401,7 +412,6 @@ application_tile_setup (ApplicationTile *this, const gchar *gconf_prefix)
gtk_container_add (menu_ctnr, menu_item);
g_free (value);
} else
actions [APPLICATION_TILE_ACTION_UPDATE_MAIN_MENU] = NULL;
......@@ -420,7 +430,7 @@ application_tile_setup (ApplicationTile *this, const gchar *gconf_prefix)
/* make upgrade action */
if (this->gconf_prefix && g_str_has_prefix (this->gconf_prefix, "/desktop/"))
if(!use_new_prefix)
key = SLAB_UPGRADE_PACKAGE_KEY;
else
key = "/apps/main-menu/upgrade_package_command";
......@@ -435,7 +445,7 @@ application_tile_setup (ApplicationTile *this, const gchar *gconf_prefix)
/* make uninstall action */
if (this->gconf_prefix && g_str_has_prefix (this->gconf_prefix, "/desktop/"))
if(!use_new_prefix)
key = SLAB_UNINSTALL_PACKAGE_KEY;
else
key = "/apps/main-menu/uninstall_package_command";
......@@ -536,7 +546,7 @@ add_to_user_list (ApplicationTile *this)
GError *error;
loc = (gchar *) gnome_desktop_item_get_location (priv->desktop_item);
loc = g_strdup (gnome_desktop_item_get_location (priv->desktop_item));
app_list = get_slab_gconf_slist (SLAB_USER_SPECIFIED_APPS_KEY);
app_list = g_slist_append (app_list, loc);
......@@ -552,6 +562,7 @@ add_to_user_list (ApplicationTile *this)
"error adding %s to %s [%s]\n",
loc, SLAB_USER_SPECIFIED_APPS_KEY, error->message);
free_slab_gconf_slist_of_strings (app_list);
priv->is_in_user_list = TRUE;
}
......@@ -601,6 +612,7 @@ remove_from_user_list (ApplicationTile *this)
"error removing %s from %s [%s]\n",
loc, SLAB_USER_SPECIFIED_APPS_KEY, error->message);
free_slab_gconf_slist_of_strings (app_list);
priv->is_in_user_list = FALSE;
}
......@@ -799,7 +811,9 @@ is_desktop_item_in_user_list (const gchar *uri)
GSList *node;
gint offset;
gboolean retval;
retval = FALSE;
app_list = get_slab_gconf_slist (SLAB_USER_SPECIFIED_APPS_KEY);
if (! app_list)
......@@ -812,10 +826,14 @@ is_desktop_item_in_user_list (const gchar *uri)
offset = 0;
if (! strcmp (& uri [offset], (gchar *) node->data))
return TRUE;
{
retval = TRUE;
break;
}
}
return FALSE;
free_slab_gconf_slist_of_strings (app_list);
return retval;
}
static void
......
......@@ -163,6 +163,7 @@ document_tile_new (const gchar *in_uri, const gchar *mime_type, time_t modified)
"nameplate-tooltip", tooltip_text, "context-menu", context_menu, NULL);
g_free (uri);
g_free (tooltip_text);
priv = DOCUMENT_TILE_GET_PRIVATE (this);
priv->basename = g_strdup (basename);
......
......@@ -173,7 +173,6 @@ shell_window_set_contents (ShellWindow * shell, GtkWidget * left_pane, GtkWidget
gboolean
shell_window_paint_window (GtkWidget * widget, GdkEventExpose * event, gpointer data)
{
GList *child;
GtkWidget *left_pane, *right_pane;
left_pane = SHELL_WINDOW (widget)->_left_pane;
......@@ -184,10 +183,5 @@ shell_window_paint_window (GtkWidget * widget, GdkEventExpose * event, gpointer
left_pane->allocation.x, left_pane->allocation.y, left_pane->allocation.width,
left_pane->allocation.height);
child = gtk_container_get_children (GTK_CONTAINER (widget));
for (; child; child = child->next)
gtk_container_propagate_expose (GTK_CONTAINER (widget), GTK_WIDGET (child->data),
event);
return FALSE;
}
......@@ -84,6 +84,17 @@ get_slab_gconf_string (const gchar * key)
return value;
}
void
free_slab_gconf_slist_of_strings (GSList * string_list)
{
g_assert (string_list != NULL);
GSList * temp;
for(temp = string_list; temp; temp = temp->next)
g_free (temp->data);
g_slist_free (string_list);
}
GSList *
get_slab_gconf_slist (const gchar * key)
{
......
......@@ -47,6 +47,7 @@ G_BEGIN_DECLS
gboolean get_slab_gconf_bool (const gchar * key);
gint get_slab_gconf_int (const gchar * key);
GSList *get_slab_gconf_slist (const gchar * key);
void free_slab_gconf_slist_of_strings (GSList * list);
gchar *get_slab_gconf_string (const gchar * key);
GnomeDesktopItem *load_desktop_item_from_gconf_key (const gchar * key);
......
......@@ -88,17 +88,10 @@ slab_section_style_set (GtkWidget * widget, GtkStyle * prev_style, gpointer user
gboolean
slab_section_expose_event (GtkWidget * widget, GdkEventExpose * event, gpointer data)
{
GList *child;
gdk_draw_rectangle (widget->window, widget->style->light_gc[GTK_STATE_SELECTED], TRUE,
widget->allocation.x, widget->allocation.y,
widget->allocation.width + 40, widget->allocation.height);
child = gtk_container_get_children (GTK_CONTAINER (widget));
for (; child; child = child->next)
gtk_container_propagate_expose (GTK_CONTAINER (widget), GTK_WIDGET (child->data),
event);
return FALSE;
}
......
......@@ -131,7 +131,6 @@ slab_window_size_allocate (GtkWidget * widget, GtkAllocation * alloc)
gboolean
paint_window (GtkWidget * widget, GdkEventExpose * event, gpointer data)
{
GList *child;
GtkWidget *left_pane, *right_pane;
/* draw colored border */
......@@ -174,11 +173,5 @@ paint_window (GtkWidget * widget, GdkEventExpose * event, gpointer data)
right_pane->allocation.x, right_pane->allocation.y, right_pane->allocation.x,
right_pane->allocation.y + right_pane->allocation.height - 1);
child = gtk_container_get_children (GTK_CONTAINER (widget));
for (; child; child = child->next)
gtk_container_propagate_expose (GTK_CONTAINER (widget), GTK_WIDGET (child->data),
event);
return FALSE;
}
......@@ -298,6 +298,7 @@ system_tile_lock_screen (Tile * tile, TileEvent * event, TileAction * action)
GSList *command_priority;
gchar *exec_string;
gboolean found_command;
gchar *cmd_string;
gchar *arg_string;
......@@ -306,6 +307,7 @@ system_tile_lock_screen (Tile * tile, TileEvent * event, TileAction * action)
command_priority = get_slab_gconf_slist (SLAB_LOCK_SCREEN_PRIORITY_KEY);
found_command = FALSE;
for (node = command_priority; node; node = node->next)
{
exec_string = (gchar *) node->data;
......@@ -335,9 +337,12 @@ system_tile_lock_screen (Tile * tile, TileEvent * event, TileAction * action)
g_free (arg_string);
g_free (exec_string);
return;
found_command = TRUE;
break;
}
}
g_warning ("could not find a command to lock screen\n");
free_slab_gconf_slist_of_strings (command_priority);
if(!found_command)
g_warning ("could not find a command to lock screen\n");
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment