Add parameter GNOME_PARAM_APP_DATADIR
2001-12-20 Bradford Hovinen <hovinen@ximian.com> * capplets/screensaver/main.c (main): Add parameter GNOME_PARAM_APP_DATADIR * mouse-properties-capplet.c (main): Add parameter GNOME_PARAM_APP_DATADIR * configure.in (GNOMECC_DESKTOP_DIR): Define (GNOMECC_DATA_DIR): Define Remove AC_DEFINE_UNQUOTED for the rest of the directories * All: Update to reflect above
This commit is contained in:
parent
2dd5ccf964
commit
30389610b4
15 changed files with 99 additions and 49 deletions
|
@ -1,5 +1,9 @@
|
|||
2001-12-20 Bradford Hovinen <hovinen@ximian.com>
|
||||
|
||||
* configure.in (GNOMECC_DESKTOP_DIR): Define
|
||||
(GNOMECC_DATA_DIR): Define
|
||||
Remove AC_DEFINE_UNQUOTED for the rest of the directories
|
||||
|
||||
* schemas/Makefile.am (EXTRA_DIST): Add
|
||||
|
||||
* configure.in: Removed capplets/sound/Makefile
|
||||
|
|
|
@ -8,11 +8,7 @@
|
|||
#undef HAVE_PROGRAM_INVOCATION_SHORT_NAME
|
||||
#undef HAVE_PROGRAM_INVOCATION_NAME
|
||||
|
||||
#undef GNOMECC_ICONS_DIR
|
||||
#undef GNOMECC_GLADE_DIR
|
||||
#undef GNOMECC_PIXMAPS_DIR
|
||||
#undef GNOMECC_DEFAULTS_DIR
|
||||
#undef GNOMECC_SCREENSAVERS_DIR
|
||||
#undef GNOMECC_DATA_DIR
|
||||
|
||||
#undef PACKAGE
|
||||
#undef VERSION
|
||||
|
|
|
@ -249,7 +249,7 @@ create_dialog (BGApplier *bg_applier)
|
|||
GladeXML *dialog;
|
||||
|
||||
/* FIXME: What the hell is domain? */
|
||||
dialog = glade_xml_new (GNOMECC_GLADE_DIR "/background-properties.glade", "prefs_widget", NULL);
|
||||
dialog = glade_xml_new (GNOMECC_DATA_DIR "/interfaces/background-properties.glade", "prefs_widget", NULL);
|
||||
widget = glade_xml_get_widget (dialog, "prefs_widget");
|
||||
|
||||
/* Minor GUI addition */
|
||||
|
|
|
@ -212,7 +212,7 @@ create_dialog (void)
|
|||
{
|
||||
GladeXML *dialog;
|
||||
|
||||
dialog = glade_xml_new (GNOMECC_GLADE_DIR "/keyboard-properties.glade", "prefs_widget", NULL);
|
||||
dialog = glade_xml_new (GNOMECC_DATA_DIR "/interfaces/keyboard-properties.glade", "prefs_widget", NULL);
|
||||
|
||||
/* Minor GUI addition */
|
||||
/* FIXME: There should be a way to do this using glade alone */
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
* mouse-properties-capplet.c (dialog_button_clicked_cb): Update
|
||||
(main): Use a GtkDialog rather than GnomeDialog; don't place weak
|
||||
ref on gtk_main_quit
|
||||
(load_pixbufs): Locate files with gnome_program_locate_file
|
||||
|
||||
2001-12-20 Hans Petter Jansson <hpj@ximian.com>
|
||||
|
||||
|
|
|
@ -278,21 +278,37 @@ static void
|
|||
load_pixbufs (void)
|
||||
{
|
||||
static gboolean called = FALSE;
|
||||
gchar *filename;
|
||||
GnomeProgram *program;
|
||||
|
||||
if (called) return;
|
||||
|
||||
left_handed_pixbuf = gdk_pixbuf_new_from_file ("mouse-left.png", NULL);
|
||||
right_handed_pixbuf = gdk_pixbuf_new_from_file ("mouse-right.png", NULL);
|
||||
double_click_on_pixbuf = gdk_pixbuf_new_from_file ("double-click-on.png", NULL);
|
||||
double_click_maybe_pixbuf = gdk_pixbuf_new_from_file ("double-click-maybe.png", NULL);
|
||||
double_click_off_pixbuf = gdk_pixbuf_new_from_file ("double-click-off.png", NULL);
|
||||
program = gnome_program_get ();
|
||||
|
||||
/* Let's be paranoid here. I like this feature :-) */
|
||||
g_object_add_weak_pointer (G_OBJECT (left_handed_pixbuf), (gpointer *) &left_handed_pixbuf);
|
||||
g_object_add_weak_pointer (G_OBJECT (right_handed_pixbuf), (gpointer *) &right_handed_pixbuf);
|
||||
g_object_add_weak_pointer (G_OBJECT (double_click_on_pixbuf), (gpointer *) &double_click_on_pixbuf);
|
||||
filename = gnome_program_locate_file (program, GNOME_FILE_DOMAIN_APP_PIXMAP, "mouse-left.png", TRUE, NULL);
|
||||
left_handed_pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
|
||||
g_object_add_weak_pointer (G_OBJECT (left_handed_pixbuf), (gpointer *) &left_handed_pixbuf);
|
||||
g_free (filename);
|
||||
|
||||
filename = gnome_program_locate_file (program, GNOME_FILE_DOMAIN_APP_PIXMAP, "mouse-right.png", TRUE, NULL);
|
||||
right_handed_pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
|
||||
g_object_add_weak_pointer (G_OBJECT (right_handed_pixbuf), (gpointer *) &right_handed_pixbuf);
|
||||
g_free (filename);
|
||||
|
||||
filename = gnome_program_locate_file (program, GNOME_FILE_DOMAIN_APP_PIXMAP, "double-click-on.png", TRUE, NULL);
|
||||
double_click_on_pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
|
||||
g_object_add_weak_pointer (G_OBJECT (double_click_on_pixbuf), (gpointer *) &double_click_on_pixbuf);
|
||||
g_free (filename);
|
||||
|
||||
filename = gnome_program_locate_file (program, GNOME_FILE_DOMAIN_APP_PIXMAP, "double-click-maybe.png", TRUE, NULL);
|
||||
double_click_maybe_pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
|
||||
g_object_add_weak_pointer (G_OBJECT (double_click_maybe_pixbuf), (gpointer *) &double_click_maybe_pixbuf);
|
||||
g_object_add_weak_pointer (G_OBJECT (double_click_off_pixbuf), (gpointer *) &double_click_off_pixbuf);
|
||||
g_free (filename);
|
||||
|
||||
filename = gnome_program_locate_file (program, GNOME_FILE_DOMAIN_APP_PIXMAP, "double-click-off.png", TRUE, NULL);
|
||||
double_click_off_pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
|
||||
g_object_add_weak_pointer (G_OBJECT (double_click_off_pixbuf), (gpointer *) &double_click_off_pixbuf);
|
||||
g_free (filename);
|
||||
|
||||
called = TRUE;
|
||||
}
|
||||
|
@ -360,7 +376,7 @@ create_dialog (void)
|
|||
GladeXML *dialog;
|
||||
GtkSizeGroup *size_group;
|
||||
|
||||
dialog = glade_xml_new (GNOMECC_GLADE_DIR "/mouse-properties.glade", "prefs_widget", NULL);
|
||||
dialog = glade_xml_new (GNOMECC_DATA_DIR "/interfaces/mouse-properties.glade", "prefs_widget", NULL);
|
||||
widget = glade_xml_get_widget (dialog, "prefs_widget");
|
||||
|
||||
size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
|
||||
|
@ -425,6 +441,7 @@ main (int argc, char **argv)
|
|||
|
||||
gnome_program_init (argv[0], VERSION, LIBGNOMEUI_MODULE, argc, argv,
|
||||
GNOME_PARAM_POPT_TABLE, cap_options,
|
||||
GNOME_PARAM_APP_DATADIR, GNOMECC_DATA_DIR,
|
||||
NULL);
|
||||
|
||||
client = gconf_client_get_default ();
|
||||
|
|
|
@ -278,21 +278,37 @@ static void
|
|||
load_pixbufs (void)
|
||||
{
|
||||
static gboolean called = FALSE;
|
||||
gchar *filename;
|
||||
GnomeProgram *program;
|
||||
|
||||
if (called) return;
|
||||
|
||||
left_handed_pixbuf = gdk_pixbuf_new_from_file ("mouse-left.png", NULL);
|
||||
right_handed_pixbuf = gdk_pixbuf_new_from_file ("mouse-right.png", NULL);
|
||||
double_click_on_pixbuf = gdk_pixbuf_new_from_file ("double-click-on.png", NULL);
|
||||
double_click_maybe_pixbuf = gdk_pixbuf_new_from_file ("double-click-maybe.png", NULL);
|
||||
double_click_off_pixbuf = gdk_pixbuf_new_from_file ("double-click-off.png", NULL);
|
||||
program = gnome_program_get ();
|
||||
|
||||
/* Let's be paranoid here. I like this feature :-) */
|
||||
g_object_add_weak_pointer (G_OBJECT (left_handed_pixbuf), (gpointer *) &left_handed_pixbuf);
|
||||
g_object_add_weak_pointer (G_OBJECT (right_handed_pixbuf), (gpointer *) &right_handed_pixbuf);
|
||||
g_object_add_weak_pointer (G_OBJECT (double_click_on_pixbuf), (gpointer *) &double_click_on_pixbuf);
|
||||
filename = gnome_program_locate_file (program, GNOME_FILE_DOMAIN_APP_PIXMAP, "mouse-left.png", TRUE, NULL);
|
||||
left_handed_pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
|
||||
g_object_add_weak_pointer (G_OBJECT (left_handed_pixbuf), (gpointer *) &left_handed_pixbuf);
|
||||
g_free (filename);
|
||||
|
||||
filename = gnome_program_locate_file (program, GNOME_FILE_DOMAIN_APP_PIXMAP, "mouse-right.png", TRUE, NULL);
|
||||
right_handed_pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
|
||||
g_object_add_weak_pointer (G_OBJECT (right_handed_pixbuf), (gpointer *) &right_handed_pixbuf);
|
||||
g_free (filename);
|
||||
|
||||
filename = gnome_program_locate_file (program, GNOME_FILE_DOMAIN_APP_PIXMAP, "double-click-on.png", TRUE, NULL);
|
||||
double_click_on_pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
|
||||
g_object_add_weak_pointer (G_OBJECT (double_click_on_pixbuf), (gpointer *) &double_click_on_pixbuf);
|
||||
g_free (filename);
|
||||
|
||||
filename = gnome_program_locate_file (program, GNOME_FILE_DOMAIN_APP_PIXMAP, "double-click-maybe.png", TRUE, NULL);
|
||||
double_click_maybe_pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
|
||||
g_object_add_weak_pointer (G_OBJECT (double_click_maybe_pixbuf), (gpointer *) &double_click_maybe_pixbuf);
|
||||
g_object_add_weak_pointer (G_OBJECT (double_click_off_pixbuf), (gpointer *) &double_click_off_pixbuf);
|
||||
g_free (filename);
|
||||
|
||||
filename = gnome_program_locate_file (program, GNOME_FILE_DOMAIN_APP_PIXMAP, "double-click-off.png", TRUE, NULL);
|
||||
double_click_off_pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
|
||||
g_object_add_weak_pointer (G_OBJECT (double_click_off_pixbuf), (gpointer *) &double_click_off_pixbuf);
|
||||
g_free (filename);
|
||||
|
||||
called = TRUE;
|
||||
}
|
||||
|
@ -360,7 +376,7 @@ create_dialog (void)
|
|||
GladeXML *dialog;
|
||||
GtkSizeGroup *size_group;
|
||||
|
||||
dialog = glade_xml_new (GNOMECC_GLADE_DIR "/mouse-properties.glade", "prefs_widget", NULL);
|
||||
dialog = glade_xml_new (GNOMECC_DATA_DIR "/interfaces/mouse-properties.glade", "prefs_widget", NULL);
|
||||
widget = glade_xml_get_widget (dialog, "prefs_widget");
|
||||
|
||||
size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
|
||||
|
@ -425,6 +441,7 @@ main (int argc, char **argv)
|
|||
|
||||
gnome_program_init (argv[0], VERSION, LIBGNOMEUI_MODULE, argc, argv,
|
||||
GNOME_PARAM_POPT_TABLE, cap_options,
|
||||
GNOME_PARAM_APP_DATADIR, GNOMECC_DATA_DIR,
|
||||
NULL);
|
||||
|
||||
client = gconf_client_get_default ();
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
(setup_capplet_widget): Don't connect to state_changed_cb
|
||||
(state_changed_cb): Remove
|
||||
(main): Don't pass cap_options
|
||||
(main): Add parameter GNOME_PARAM_APP_DATADIR
|
||||
|
||||
2001-12-19 Seth Nickell <snickell@stanford.edu>
|
||||
|
||||
|
|
|
@ -215,6 +215,7 @@ main (int argc, char **argv)
|
|||
|
||||
gnome_program_init ("screensaver-properties", VERSION,
|
||||
LIBGNOMEUI_MODULE, argc, argv,
|
||||
GNOME_PARAM_APP_DATADIR, GNOMECC_DATA_DIR,
|
||||
NULL);
|
||||
|
||||
client = gnome_master_client ();
|
||||
|
@ -243,7 +244,7 @@ main (int argc, char **argv)
|
|||
}
|
||||
|
||||
gnome_window_icon_set_default_from_file
|
||||
(GNOMECC_ICONS_DIR"/gnome-ccscreensaver.png");
|
||||
(GNOMECC_DATA_DIR"/icons/gnome-ccscreensaver.png");
|
||||
|
||||
init_resource_database (argc, argv);
|
||||
prefs = preferences_new ();
|
||||
|
|
|
@ -212,7 +212,7 @@ screensaver_list_load (GHashTable *savers_hash)
|
|||
gchar *userdir;
|
||||
|
||||
l = screensaver_list_prepend_dir (savers_hash,
|
||||
l, GNOMECC_SCREENSAVERS_DIR);
|
||||
l, GNOMECC_DATA_DIR "/screensavers");
|
||||
|
||||
userdir = g_concat_dir_and_file (g_get_home_dir (), ".screensavers");
|
||||
l = screensaver_list_prepend_dir (savers_hash,
|
||||
|
@ -732,7 +732,9 @@ screensaver_read_xml (xmlNodePtr saver_node)
|
|||
}
|
||||
else if (!strcmp (node->name, "fakepreview"))
|
||||
{
|
||||
saver->fakepreview = g_concat_dir_and_file (GNOMECC_PIXMAPS_DIR "/screensavers", xmlNodeGetContent (node));
|
||||
saver->fakepreview = gnome_program_locate_file
|
||||
(gnome_program_get (), GNOME_FILE_DOMAIN_APP_PIXMAP,
|
||||
xmlNodeGetContent (node), TRUE, NULL);
|
||||
}
|
||||
else if (!strcmp (node->name, "fake"))
|
||||
{
|
||||
|
|
|
@ -193,7 +193,7 @@ prefs_widget_init (PrefsWidget *prefs_widget)
|
|||
|
||||
prefs_widget->priv = g_new0 (PrefsWidgetPrivate, 1);
|
||||
prefs_widget->priv->xml =
|
||||
glade_xml_new (GNOMECC_GLADE_DIR "/screensaver-properties.glade",
|
||||
glade_xml_new (GNOMECC_DATA_DIR "/interfaces/screensaver-properties.glade",
|
||||
NULL, NULL);
|
||||
if (!prefs_widget->priv->xml)
|
||||
return;
|
||||
|
|
|
@ -252,6 +252,7 @@ static gint
|
|||
show_screensaver_timeout (void)
|
||||
{
|
||||
int ret;
|
||||
gchar *filename;
|
||||
|
||||
ret = waitpid (preview_pid, NULL, WNOHANG);
|
||||
|
||||
|
@ -262,8 +263,12 @@ show_screensaver_timeout (void)
|
|||
if (pixbuf)
|
||||
gdk_pixbuf_unref (pixbuf);
|
||||
|
||||
pixbuf = gdk_pixbuf_new_from_file
|
||||
(GNOMECC_PIXMAPS_DIR "/no-hack.png", NULL);
|
||||
filename = gnome_program_locate_file
|
||||
(gnome_program_get (), GNOME_FILE_DOMAIN_APP_PIXMAP,
|
||||
"no-hack.png", TRUE, NULL);
|
||||
pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
|
||||
g_free (filename);
|
||||
|
||||
gdk_pixbuf_render_to_drawable
|
||||
(pixbuf, (GdkDrawable *) preview_window->window,
|
||||
preview_window->style->fg_gc[0], 0, 0, 0, 0,
|
||||
|
@ -326,13 +331,20 @@ close_preview (void)
|
|||
void
|
||||
show_blank_preview (void)
|
||||
{
|
||||
gchar *filename;
|
||||
|
||||
close_preview ();
|
||||
gtk_widget_map (preview_window);
|
||||
|
||||
if (pixbuf)
|
||||
gdk_pixbuf_unref (pixbuf);
|
||||
|
||||
pixbuf = gdk_pixbuf_new_from_file (GNOMECC_PIXMAPS_DIR "/blank-screen.png", NULL);
|
||||
filename = gnome_program_locate_file
|
||||
(gnome_program_get (), GNOME_FILE_DOMAIN_APP_PIXMAP,
|
||||
"blank-screen.png", TRUE, NULL);
|
||||
pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
|
||||
g_free (filename);
|
||||
|
||||
gdk_pixbuf_render_to_drawable
|
||||
(pixbuf, (GdkDrawable *) preview_window->window,
|
||||
preview_window->style->fg_gc[0], 0, 0, 0, 0,
|
||||
|
|
|
@ -253,7 +253,7 @@ get_known_savers (void)
|
|||
|
||||
if (known_savers) return known_savers;
|
||||
|
||||
parent_dir = opendir (GNOMECC_SCREENSAVERS_DIR "/screensavers");
|
||||
parent_dir = opendir (GNOMECC_DATA_DIR "/screensavers");
|
||||
if (parent_dir == NULL)
|
||||
return NULL;
|
||||
|
||||
|
@ -262,8 +262,7 @@ get_known_savers (void)
|
|||
while ((child_dir = readdir (parent_dir)) != NULL) {
|
||||
if (child_dir->d_name[0] != '.') {
|
||||
fullpath = g_concat_dir_and_file
|
||||
(GNOMECC_SCREENSAVERS_DIR "/screensavers",
|
||||
child_dir->d_name);
|
||||
(GNOMECC_DATA_DIR "/screensavers", child_dir->d_name);
|
||||
|
||||
if (stat (fullpath, &filedata) != -1) {
|
||||
if (!S_ISDIR (filedata.st_mode)) {
|
||||
|
|
10
configure.in
10
configure.in
|
@ -133,19 +133,15 @@ else
|
|||
real_prefix=${prefix}
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(GNOMECC_ICONS_DIR, "${real_prefix}/share/${PACKAGE}/icons")
|
||||
AC_DEFINE_UNQUOTED(GNOMECC_DATA_DIR, "${real_prefix}/share/${PACKAGE}")
|
||||
GNOMECC_ICONS_DIR=""${datadir}/${PACKAGE}/icons""
|
||||
AC_SUBST(GNOMECC_ICONS_DIR)
|
||||
AC_DEFINE_UNQUOTED(GNOMECC_GLADE_DIR, "${real_prefix}/share/${PACKAGE}/interfaces")
|
||||
GNOMECC_DESKTOP_DIR=""${datadir}/${PACKAGE}/capplets""
|
||||
AC_SUBST(GNOMECC_DESKTOP_DIR)
|
||||
GNOMECC_GLADE_DIR=""${datadir}/${PACKAGE}/interfaces""
|
||||
AC_SUBST(GNOMECC_GLADE_DIR)
|
||||
AC_DEFINE_UNQUOTED(GNOMECC_PIXMAPS_DIR, "${real_prefix}/share/${PACKAGE}/pixmaps")
|
||||
GNOMECC_PIXMAPS_DIR=""${datadir}/${PACKAGE}/pixmaps""
|
||||
AC_SUBST(GNOMECC_PIXMAPS_DIR)
|
||||
AC_DEFINE_UNQUOTED(GNOMECC_DEFAULTS_DIR, "${real_prefix}/share/${PACKAGE}/defaults")
|
||||
GNOMECC_DEFAULTS_DIR=""${datadir}/${PACKAGE}/defaults""
|
||||
AC_SUBST(GNOMECC_DEFAULTS_DIR)
|
||||
AC_DEFINE_UNQUOTED(GNOMECC_SCREENSAVERS_DIR, "${real_prefix}/share/${PACKAGE}/screensavers")
|
||||
GNOMECC_SCREENSAVERS_DIR=""${datadir}/${PACKAGE}/screensavers""
|
||||
AC_SUBST(GNOMECC_SCREENSAVERS_DIR)
|
||||
dnl ==============================================
|
||||
|
|
|
@ -119,8 +119,10 @@ capplet_new (CappletDir *dir, gchar *desktop_path)
|
|||
entry->exec = vec;
|
||||
entry->dir = dir;
|
||||
|
||||
if (!entry->icon)
|
||||
entry->icon = GNOMECC_PIXMAPS_DIR "/control-center.png";
|
||||
if (entry->icon == NULL)
|
||||
entry->icon = gnome_program_locate_file
|
||||
(gnome_program_get (), GNOME_FILE_DOMAIN_APP_PIXMAP,
|
||||
"control-center.png", TRUE, NULL);
|
||||
|
||||
entry->pb = gdk_pixbuf_new_from_file (entry->icon, NULL);
|
||||
|
||||
|
@ -166,7 +168,9 @@ capplet_dir_new (CappletDir *dir, gchar *dir_path)
|
|||
GNOME_DESKTOP_ITEM_ICON));
|
||||
|
||||
if (!entry->icon)
|
||||
entry->icon = g_strdup (GNOMECC_PIXMAPS_DIR "/control-center.png");
|
||||
entry->icon = gnome_program_locate_file
|
||||
(gnome_program_get (), GNOME_FILE_DOMAIN_APP_PIXMAP,
|
||||
"control-center.png", TRUE, NULL);
|
||||
|
||||
entry->pb = gdk_pixbuf_new_from_file (entry->icon, NULL);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue