summaryrefslogtreecommitdiff
path: root/src/nautilus-application.c
diff options
context:
space:
mode:
authorDarin Adler <darin@src.gnome.org>2000-07-11 01:10:05 +0000
committerDarin Adler <darin@src.gnome.org>2000-07-11 01:10:05 +0000
commit8883807146859fff9e6facdafaaf4ff0a3550698 (patch)
tree2c48e5644bf5d2491f943c1eae99713f7a61ead6 /src/nautilus-application.c
parentb3c9a1c6473aa7796817aa4b6c83f3f38472836e (diff)
downloadnautilus-8883807146859fff9e6facdafaaf4ff0a3550698.tar.gz
Changed history list to include a separate position field instead of
* components/history/nautilus-history-view.c: (history_view_update_icons), (get_history_list), (hyperbola_navigation_history_load_location): * libnautilus/nautilus-view-component.idl: * src/nautilus-history-frame.c: (impl_Nautilus_HistoryFrame_get_history_list): * src/nautilus-view-frame.h: * src/nautilus-view-frame.c: (nautilus_view_frame_get_history_list): * src/nautilus-window.c: (nautilus_window_get_history_list_callback), (nautilus_window_connect_view): Changed history list to include a separate position field instead of having a position in each entry. * components/notes/nautilus-notes.c: (done_with_file): Name changed from nautilus_file_cancel_callback to nautilus_file_cancel_call_when_ready to reduce confusion with nautilus_file_cancel. * libnautilus-extensions/nautilus-directory.c: (nautilus_directory_get): Made NULL for URI be legal (and result in NULL for the directory object). * libnautilus-extensions/nautilus-mime-actions.c: (get_mime_type_from_uri): Made NULL for URI be legal (and result in NULL for MIME type). * libnautilus-extensions/nautilus-entry.c: (nautilus_entry_set_text): Minor tweak. * libnautilus-extensions/nautilus-file.h: * libnautilus-extensions/nautilus-file-private.h: * libnautilus-extensions/nautilus-file.c: (operation_new), (operation_free), (operation_complete), (operation_cancel), (rename_update_info_and_metafile), (rename_callback), (nautilus_file_rename), (nautilus_file_cancel), (nautilus_file_set_owner), (nautilus_file_cancel_call_when_ready): Added cancelling to rename as a prelude to doing the same for set_file_info-based calls. * libnautilus-extensions/nautilus-graphic.c: Fixed a formatting mistake and a typo. * libnautilus-extensions/nautilus-stock-dialogs.h: * libnautilus-extensions/nautilus-stock-dialogs.c: (timed_wait_hash), (timed_wait_hash_equal), (nautilus_timed_wait_start), (nautilus_timed_wait_free), (nautilus_timed_wait_stop): Re-did timed wait API now that we are really using it. Still unimplemented. * src/Makefile.am: Since IDL dependencies are not understood by automake, added an explicit one so we pick up the change to the libnautilus view component IDL. * src/file-manager/fm-error-reporting.h: * src/file-manager/fm-error-reporting.c: (rename_callback), (cancel_rename_callback), (fm_rename_file): Moved code for renaming into here so it can be shared between the icon view and the properties dialog. Perhaps it needs to be renamed. * src/file-manager/fm-icon-view.c: (fm_icon_view_icon_text_changed_callback): Use the shared code instead of having the rename code here. * src/nautilus-application.c: (create_object): Make a new shell object each time instead of trying to share one. (nautilus_application_startup): Activate the shell object using OAF. This makes it work across processes and adds the feature. * src/nautilus-main.c: (main): Call bonobo_activate explicitly so CORBA calls work before the main loop. * src/nautilus-shell.c: (display_caveat_first_time), (corba_manage_desktop): Got rid of all state in NautilusShell so we can use multiple shell objects if we want. * src/nautilus-sidebar.c: (nautilus_sidebar_update_info): Got rid of code that checks for NULL.
Diffstat (limited to 'src/nautilus-application.c')
-rw-r--r--src/nautilus-application.c70
1 files changed, 33 insertions, 37 deletions
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index 85a7442a5..36206af57 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -98,7 +98,6 @@ create_object (PortableServer_Servant servant,
{
BonoboObject *object;
FMDirectoryView *directory_view;
- static NautilusShell *shell;
NautilusApplication *application;
if (strcmp (iid, ICON_VIEW_IID) == 0) {
@@ -111,13 +110,8 @@ create_object (PortableServer_Servant servant,
directory_view = FM_DIRECTORY_VIEW (gtk_object_new (fm_list_view_get_type (), NULL));
object = BONOBO_OBJECT (fm_directory_view_get_nautilus_view (directory_view));
} else if (strcmp (iid, SHELL_IID) == 0) {
- if (shell == NULL) {
- application = NAUTILUS_APPLICATION (((BonoboObjectServant *) servant)->bonobo_object);
- shell = nautilus_shell_new (application);
- } else {
- bonobo_object_ref (BONOBO_OBJECT (shell));
- }
- object = BONOBO_OBJECT (shell);
+ application = NAUTILUS_APPLICATION (((BonoboObjectServant *) servant)->bonobo_object);
+ object = BONOBO_OBJECT (nautilus_shell_new (application));
} else {
return CORBA_OBJECT_NIL;
}
@@ -297,17 +291,10 @@ nautilus_application_startup (NautilusApplication *application,
*/
nautilus_application_check_user_directories (application);
+ CORBA_exception_init (&ev);
+
/* Start up the factory. */
-#if 0
for (;;) {
- shell = oaf_activate_from_id (SHELL_IID, OAF_FLAG_EXISTING_ONLY, NULL, NULL);
- if (shell != CORBA_OBJECT_NIL) {
- g_message ("did activate");
- break;
- }
- g_message ("didn't activate");
-#endif
-
/* Try to register the file manager view factory with OAF. */
result = oaf_active_server_register
(FACTORY_IID,
@@ -315,6 +302,8 @@ nautilus_application_startup (NautilusApplication *application,
switch (result) {
case OAF_REG_SUCCESS:
/* We are registered with OAF and all is right with the world. */
+ case OAF_REG_ALREADY_ACTIVE:
+ /* Another copy of . */
message = NULL;
break;
case OAF_REG_NOT_LISTED:
@@ -344,15 +333,6 @@ nautilus_application_startup (NautilusApplication *application,
"the problem, but we don't know why. "
"We need a much less confusing message here for Nautilus 1.0.");
break;
- case OAF_REG_ALREADY_ACTIVE:
- /* Another copy of Nautilus is already running. */
- /* FIXME: We want to "glom on" to this old copy. */
- message = _("Nautilus is already running. "
- "Soon, instead of presenting this dialog, "
- "the already-running copy of Nautilus will "
- "respond by opening windows.");
- detailed_message = NULL;
- break;
default:
/* This should never happen. */
g_warning ("bad error code from oaf_active_server_register");
@@ -361,28 +341,43 @@ nautilus_application_startup (NautilusApplication *application,
* version of OAF). Show dialog and terminate the
* program.
*/
+ /* FIXME: Looks like this does happen with the
+ * current OAF. I guess I read the code
+ * wrong. Need to figure out when and make a
+ * good message.
+ */
message = _("Nautilus can't be used now, due to an unexpected error.");
detailed_message = _("Nautilus can't be used now, due to an unexpected error "
"from OAF when attempting to register the file manager view server.");
break;
}
+
+ /* Get the shell object. */
+ if (message == NULL) {
+ shell = oaf_activate_from_id (SHELL_IID, 0, NULL, NULL);
+ if (!CORBA_Object_is_nil (shell, &ev)) {
+ break;
+ }
+
+ /* If we couldn't find ourselves it's a bad problem so
+ * we better stop looping.
+ */
+ if (result == OAF_REG_SUCCESS) {
+ /* FIXME: When can this happen? */
+ message = _("Nautilus can't be used now, due to an unexpected error.");
+ detailed_message = _("Nautilus can't be used now, due to an unexpected error "
+ "from OAF when attempting to locate the factory.");
+ }
+ }
+
if (message != NULL) {
dialog = nautilus_error_dialog_with_details
(message, detailed_message, NULL);
gtk_signal_connect (GTK_OBJECT (dialog), "destroy",
gtk_main_quit, NULL);
- return;
+ goto out;
}
-#if 0
}
-#endif
-
- CORBA_exception_init (&ev);
-
- /* FIXME: This is a temporary hack so we can use the CORBA
- * interface even though I can't get activation to work.
- */
- shell = CORBA_Object_duplicate (bonobo_object_corba_objref (BONOBO_OBJECT (nautilus_shell_new (application))), &ev);
/* Set up the desktop. */
if (manage_desktop) {
@@ -408,6 +403,7 @@ nautilus_application_startup (NautilusApplication *application,
Nautilus_Shell_unref (shell, &ev);
CORBA_Object_release (shell, &ev);
+ out:
CORBA_exception_free (&ev);
}
@@ -416,7 +412,7 @@ nautilus_application_destroy_window (GtkObject *obj, NautilusApplication *applic
{
application->windows = g_slist_remove (application->windows, obj);
if (application->windows == NULL) {
- nautilus_application_quit();
+ nautilus_application_quit ();
}
}