Commit 9a05e06f authored by Ramiro Estrugo's avatar Ramiro Estrugo
Browse files

Change preferences startup code to occur in only one place.

* components/history/nautilus-history-view.c: (main):
* libnautilus-extensions/nautilus-global-preferences.c:
(nautilus_global_preferences_startup):
* libnautilus-extensions/nautilus-global-preferences.h:
* src/nautilus-application.c: (nautilus_app_class_init):
* src/nautilus-main.c: (main):

Change preferences startup code to occur in only one place.
parent 1f720bb2
2000-05-30 Ramiro Estrugo <ramiro@eazel.com>
* components/history/nautilus-history-view.c: (main):
* libnautilus-extensions/nautilus-global-preferences.c:
(nautilus_global_preferences_startup):
* libnautilus-extensions/nautilus-global-preferences.h:
* src/nautilus-application.c: (nautilus_app_class_init):
* src/nautilus-main.c: (main):
Change preferences startup code to occur in only one place.
2000-05-29 Raph Levien <raph@acm.org> 2000-05-29 Raph Levien <raph@acm.org>
* librsvg/art_render_gradient.c (art_render_gradient_setpix): Fixed * librsvg/art_render_gradient.c (art_render_gradient_setpix): Fixed
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include <libnautilus/libnautilus.h> #include <libnautilus/libnautilus.h>
#include <libnautilus-extensions/nautilus-bookmark.h> #include <libnautilus-extensions/nautilus-bookmark.h>
#include <libnautilus-extensions/nautilus-icon-factory.h> #include <libnautilus-extensions/nautilus-icon-factory.h>
#include <nautilus-widgets/nautilus-preferences.h> #include <libnautilus-extensions/nautilus-global-preferences.h>
#include <libgnome/gnome-i18n.h> #include <libgnome/gnome-i18n.h>
#include <libgnomevfs/gnome-vfs-init.h> #include <libgnomevfs/gnome-vfs-init.h>
#include <libgnomevfs/gnome-vfs-uri.h> #include <libgnomevfs/gnome-vfs-uri.h>
...@@ -257,7 +257,6 @@ make_obj(BonoboGenericFactory *Factory, const char *goad_id, gpointer closure) ...@@ -257,7 +257,6 @@ make_obj(BonoboGenericFactory *Factory, const char *goad_id, gpointer closure)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
gboolean preferences_succeeded;
BonoboGenericFactory *factory; BonoboGenericFactory *factory;
CORBA_ORB orb; CORBA_ORB orb;
...@@ -266,13 +265,13 @@ int main(int argc, char *argv[]) ...@@ -266,13 +265,13 @@ int main(int argc, char *argv[])
oaf_popt_options, 0, NULL); oaf_popt_options, 0, NULL);
orb = oaf_init (argc, argv); orb = oaf_init (argc, argv);
/* FIXME bugzilla.eazel.com 672: Need better error reporting if this /* Initialize global preferences. */
* fails. But is it too early to post a dialog here? Does every user nautilus_global_preferences_startup (argc, argv);
* of NautilusPreferences have to deal with this;
/* FIXME bugzilla.eazel.com 672:
* Need better error reporting here if preferences initialization fails.
*/ */
preferences_succeeded = nautilus_preferences_initialize (argc, argv);
g_assert (preferences_succeeded);
bonobo_init(orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL); bonobo_init(orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
gnome_vfs_init (); gnome_vfs_init ();
......
...@@ -541,10 +541,20 @@ nautilus_global_preferences_shutdown (void) ...@@ -541,10 +541,20 @@ nautilus_global_preferences_shutdown (void)
} }
void void
nautilus_global_preferences_startup (void) nautilus_global_preferences_startup (int argc, char **argv)
{ {
global_preferences_register_for_ui (); gboolean result;
/* Initialize preferences */
result = nautilus_preferences_initialize (argc, argv);
/* FIXME bugzilla.eazel.com 672:
* Need error reporting if this fails instead of a core dump.
*/
g_assert (result);
global_preferences_register_for_ui ();
/* Keep track of user level changes */ /* Keep track of user level changes */
nautilus_preferences_add_enum_callback (NAUTILUS_PREFERENCES_USER_LEVEL_KEY, nautilus_preferences_add_enum_callback (NAUTILUS_PREFERENCES_USER_LEVEL_KEY,
user_level_changed_callback, user_level_changed_callback,
......
...@@ -73,13 +73,15 @@ enum ...@@ -73,13 +73,15 @@ enum
#define NAUTILUS_PREFERENCES_SHOW_TEXT_IN_REMOTE_ICONS "/nautilus/preferences/remote_icon_text" #define NAUTILUS_PREFERENCES_SHOW_TEXT_IN_REMOTE_ICONS "/nautilus/preferences/remote_icon_text"
void nautilus_global_preferences_startup (void); void nautilus_global_preferences_startup (int argc,
void nautilus_global_preferences_shutdown (void); char **argv);
void nautilus_global_preferences_show_dialog (void); void nautilus_global_preferences_shutdown (void);
void nautilus_global_preferences_show_dialog (void);
/* Sidebar */ /* Sidebar */
GList * nautilus_global_preferences_get_enabled_sidebar_panel_view_identifiers (void); GList *nautilus_global_preferences_get_enabled_sidebar_panel_view_identifiers (void);
GList * nautilus_global_preferences_get_disabled_sidebar_panel_view_identifiers (void); GList *nautilus_global_preferences_get_disabled_sidebar_panel_view_identifiers (void);
BEGIN_GNOME_DECLS BEGIN_GNOME_DECLS
......
...@@ -541,10 +541,20 @@ nautilus_global_preferences_shutdown (void) ...@@ -541,10 +541,20 @@ nautilus_global_preferences_shutdown (void)
} }
void void
nautilus_global_preferences_startup (void) nautilus_global_preferences_startup (int argc, char **argv)
{ {
global_preferences_register_for_ui (); gboolean result;
/* Initialize preferences */
result = nautilus_preferences_initialize (argc, argv);
/* FIXME bugzilla.eazel.com 672:
* Need error reporting if this fails instead of a core dump.
*/
g_assert (result);
global_preferences_register_for_ui ();
/* Keep track of user level changes */ /* Keep track of user level changes */
nautilus_preferences_add_enum_callback (NAUTILUS_PREFERENCES_USER_LEVEL_KEY, nautilus_preferences_add_enum_callback (NAUTILUS_PREFERENCES_USER_LEVEL_KEY,
user_level_changed_callback, user_level_changed_callback,
......
...@@ -73,13 +73,15 @@ enum ...@@ -73,13 +73,15 @@ enum
#define NAUTILUS_PREFERENCES_SHOW_TEXT_IN_REMOTE_ICONS "/nautilus/preferences/remote_icon_text" #define NAUTILUS_PREFERENCES_SHOW_TEXT_IN_REMOTE_ICONS "/nautilus/preferences/remote_icon_text"
void nautilus_global_preferences_startup (void); void nautilus_global_preferences_startup (int argc,
void nautilus_global_preferences_shutdown (void); char **argv);
void nautilus_global_preferences_show_dialog (void); void nautilus_global_preferences_shutdown (void);
void nautilus_global_preferences_show_dialog (void);
/* Sidebar */ /* Sidebar */
GList * nautilus_global_preferences_get_enabled_sidebar_panel_view_identifiers (void); GList *nautilus_global_preferences_get_enabled_sidebar_panel_view_identifiers (void);
GList * nautilus_global_preferences_get_disabled_sidebar_panel_view_identifiers (void); GList *nautilus_global_preferences_get_disabled_sidebar_panel_view_identifiers (void);
BEGIN_GNOME_DECLS BEGIN_GNOME_DECLS
......
...@@ -212,13 +212,6 @@ nautilus_app_class_init (NautilusAppClass *klass) ...@@ -212,13 +212,6 @@ nautilus_app_class_init (NautilusAppClass *klass)
object_class->destroy = nautilus_app_destroy; object_class->destroy = nautilus_app_destroy;
app_parent_class = gtk_type_class (gtk_object_get_type ()); app_parent_class = gtk_type_class (gtk_object_get_type ());
/* Startup preferences. This call is needed so that preferences have
* decent defaults. Not calling this function would cause some
* preferences to have "not nice" defaults. Things would still work
* because it is legal to use nautilus preferences implicitly.
*/
nautilus_global_preferences_startup ();
} }
static void static void
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include <libnautilus-extensions/nautilus-debug.h> #include <libnautilus-extensions/nautilus-debug.h>
#include <libnautilus-extensions/nautilus-lib-self-check-functions.h> #include <libnautilus-extensions/nautilus-lib-self-check-functions.h>
#include <libnautilus-extensions/nautilus-self-checks.h> #include <libnautilus-extensions/nautilus-self-checks.h>
#include <nautilus-widgets/nautilus-preferences.h> #include <libnautilus-extensions/nautilus-global-preferences.h>
#include <nautilus-widgets/nautilus-widgets-self-check-functions.h> #include <nautilus-widgets/nautilus-widgets-self-check-functions.h>
#include <popt.h> #include <popt.h>
#include <libgnome/gnome-i18n.h> #include <libgnome/gnome-i18n.h>
...@@ -51,7 +51,6 @@ main(int argc, char *argv[]) ...@@ -51,7 +51,6 @@ main(int argc, char *argv[])
gboolean handle_desktop; gboolean handle_desktop;
poptContext popt_context; poptContext popt_context;
CORBA_ORB orb; CORBA_ORB orb;
gboolean preferences_initialized;
NautilusApp *application; NautilusApp *application;
const char **args; const char **args;
struct poptOption options[] = { struct poptOption options[] = {
...@@ -87,12 +86,12 @@ main(int argc, char *argv[]) ...@@ -87,12 +86,12 @@ main(int argc, char *argv[])
gnome_vfs_init (); gnome_vfs_init ();
bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL); bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
/* Initialize parts of Nautilus (move to NautilusApplication?). */ /* Initialize global preferences. */
preferences_initialized = nautilus_preferences_initialize (argc, argv); nautilus_global_preferences_startup (argc, argv);
/* FIXME bugzilla.eazel.com 672: /* FIXME bugzilla.eazel.com 672:
* Need error reporting if this fails instead of a core dump. * Need better error reporting here if preferences initialization fails.
*/ */
g_assert (preferences_initialized);
if (perform_self_check) { if (perform_self_check) {
#ifndef NAUTILUS_OMIT_SELF_CHECK #ifndef NAUTILUS_OMIT_SELF_CHECK
......
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