Commit 4fbe28ee authored by Rodrigo Moya's avatar Rodrigo Moya Committed by Rodrigo Moya

added an argument to specify whether to exit the program when the shell

2007-01-17  Rodrigo Moya <rodrigo@gnome-db.org>

	* libslab/app-shell.[ch] (appshelldata_new): added an argument to
	specify whether to exit the program when the shell window is closed.

	* application-browser/src/application-browser.c (main): pass FALSE,
	don't quit.

	* control-center/src/control-center.c (main): pass TRUE, quit when
	closed.
	(handle_static_action_clicked): check for the exit_on_close flag if
	the GConf key is set.

svn path=/trunk/; revision=101
parent c47f23b6
2007-01-17 Rodrigo Moya <rodrigo@gnome-db.org>
* libslab/app-shell.[ch] (appshelldata_new): added an argument to
specify whether to exit the program when the shell window is closed.
* application-browser/src/application-browser.c (main): pass FALSE,
don't quit.
* control-center/src/control-center.c (main): pass TRUE, quit when
closed.
(handle_static_action_clicked): check for the exit_on_close flag if
the GConf key is set.
2007-01-12 Scott Reeves <sreeves@novell.com>
* libslab/libslab.pc.in:
Clean up the .pc file
......
......@@ -84,7 +84,7 @@ main (int argc, char *argv[])
config->max_items = get_slab_gconf_int (NEW_APPS_MAX_ITEMS);
config->name = _("New Applications");
AppShellData *app_data = appshelldata_new (
"applications.menu", config, APPLICATION_BROWSER_PREFIX, GTK_ICON_SIZE_DND);
"applications.menu", config, APPLICATION_BROWSER_PREFIX, GTK_ICON_SIZE_DND, FALSE);
generate_categories (app_data);
layout_shell (app_data, _("Filter"), _("Groups"), _("Application Actions"), NULL, NULL);
......
......@@ -97,7 +97,8 @@ handle_static_action_clicked (Tile * tile, TileEvent * event, gpointer data)
temp = g_strdup_printf("%s%s", app_data->gconf_prefix, EXIT_SHELL_ON_STATIC_ACTION);
if (get_slab_gconf_bool(temp))
gtk_main_quit ();
if (app_data->exit_on_close)
gtk_main_quit ();
g_free (temp);
}
......@@ -139,7 +140,7 @@ main (int argc, char *argv[])
}
AppShellData *app_data = appshelldata_new (
"preferences.menu", NULL, CONTROL_CENTER_PREFIX, GTK_ICON_SIZE_DIALOG);
"preferences.menu", NULL, CONTROL_CENTER_PREFIX, GTK_ICON_SIZE_DIALOG, TRUE);
generate_categories (app_data);
GSList *actions = get_actions_list ();
......
......@@ -217,7 +217,10 @@ main_keypress_callback (GtkWidget * widget, GdkEventKey * event, AppShellData *
static gboolean
main_delete_callback (GtkWidget * widget, GdkEvent * event, AppShellData * app_data)
{
hide_shell (app_data);
if (app_data->exit_on_close)
gtk_main_quit ();
else
hide_shell (app_data);
return TRUE; /* stop the processing of this event */
}
......@@ -813,7 +816,7 @@ gmenu_tree_changed_callback (GMenuTree * old_tree, gpointer user_data)
AppShellData *
appshelldata_new (const gchar * menu_name, NewAppConfig * new_apps, const gchar * gconf_keys_prefix,
GtkIconSize icon_size)
GtkIconSize icon_size, gboolean exit_on_close)
{
AppShellData *app_data = g_new0 (AppShellData, 1);
app_data->gconf_prefix = gconf_keys_prefix;
......@@ -821,6 +824,7 @@ appshelldata_new (const gchar * menu_name, NewAppConfig * new_apps, const gchar
app_data->menu_name = menu_name;
app_data->icon_size = icon_size;
app_data->stop_incremental_relayout = TRUE;
app_data->exit_on_close = exit_on_close;
return app_data;
}
......
......@@ -92,6 +92,8 @@ typedef struct _AppShellData
gboolean filtered_out_everything;
GtkWidget *filtered_out_everything_widget;
GtkLabel *filtered_out_everything_widget_label;
gboolean exit_on_close;
} AppShellData;
typedef struct
......@@ -120,7 +122,7 @@ void generate_categories (AppShellData * app_data);
/* If new_apps is NULL then the new applications category is not created */
AppShellData *appshelldata_new (const gchar * menu_name, NewAppConfig * new_apps,
const gchar * gconf_keys_prefix, GtkIconSize icon_size);
const gchar * gconf_keys_prefix, GtkIconSize icon_size, gboolean exit_on_close);
void layout_shell (AppShellData * app_data, const gchar * filter_title, const gchar * groups_title,
const gchar * actions_title, GSList * actions,
......
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