diff options
27 files changed, 752 insertions, 75 deletions
@@ -1,3 +1,59 @@ +2003-11-06 Alexander Larsson <alexl@redhat.com> + + * Makefile.am: + * nautilus-computer.desktop.in: + * nautilus-home.desktop.in: + New desktop files + + * nautilus.desktop.in: + Make this one "browse filesystem" + + * libnautilus-private/apps_nautilus_preferences.schemas.in: + * libnautilus-private/nautilus-global-preferences.c: + * libnautilus-private/nautilus-global-preferences.h: + computer desktop icon prefs + + * libnautilus-private/nautilus-desktop-icon-file.c: + (update_info_from_link): Set permissions too + + * libnautilus-private/nautilus-desktop-link-monitor.c: + * libnautilus-private/nautilus-desktop-link.[ch]: + Add computer icon + + * src/Makefile.am: + * src/nautilus-connect-server-dialog.[ch]: + Connect server dialog + + * src/file-manager/fm-directory-view.c: + Mount drives on activation. + + * src/file-manager/fm-icon-container.c: + Sort computer first + + * src/file-manager/fm-properties-window.c: + Put back NautilusDesktopLink handling for e.g. computer and home. + + * src/nautilus-application.[ch]: + Reload dirs on mounts. + add browser_window argument on open window + + * src/nautilus-main.c: + add browser_window argument on open window (--browser) + hack to register computer icon + + * src/nautilus-shell-interface.idl: + * src/nautilus-shell.c: + add browser_window argument on open window + + * src/nautilus-navigation-window-ui.xml: + * src/nautilus-spatial-window-ui.xml: + * src/nautilus-window-menus.c: + Add connect to server + Add computer + + * src/nautilus-window.c: + Nice title for burn:/// + 2003-11-05 Alexander Larsson <alexl@redhat.com> * configure.in: diff --git a/Makefile.am b/Makefile.am index 90950e25f..871ece7e5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,9 +4,13 @@ include $(top_srcdir)/Makefile.shared DESKTOP_IN_FILES= \ nautilus.desktop.in \ + nautilus-home.desktop.in \ + nautilus-computer.desktop.in \ nautilus-file-management-properties.desktop.in DESKTOP_APPLICATIONS_FILES= \ - nautilus.desktop + nautilus.desktop \ + nautilus-home.desktop \ + nautilus-computer.desktop DESKTOP_SETTINGS_FILES= \ nautilus-file-management-properties.desktop diff --git a/libnautilus-private/apps_nautilus_preferences.schemas.in b/libnautilus-private/apps_nautilus_preferences.schemas.in index 7c6f0ab6f..660c7cfe3 100644 --- a/libnautilus-private/apps_nautilus_preferences.schemas.in +++ b/libnautilus-private/apps_nautilus_preferences.schemas.in @@ -722,7 +722,7 @@ <applyto>/apps/nautilus/desktop/home_icon_visible</applyto> <owner>nautilus</owner> <type>bool</type> - <default>true</default> + <default>false</default> <locale name="C"> <short>Home icon visible on desktop</short> <long> @@ -733,6 +733,21 @@ </schema> <schema> + <key>/schemas/apps/nautilus/desktop/computer_icon_visible</key> + <applyto>/apps/nautilus/desktop/computer_icon_visible</applyto> + <owner>nautilus</owner> + <type>bool</type> + <default>true</default> + <locale name="C"> + <short>Computer icon visible on desktop</short> + <long> + If this is set to true, an icon linking to the computer location + will be put on the desktop. + </long> + </locale> + </schema> + + <schema> <key>/schemas/apps/nautilus/desktop/trash_icon_visible</key> <applyto>/apps/nautilus/desktop/trash_icon_visible</applyto> <owner>nautilus</owner> diff --git a/libnautilus-private/nautilus-desktop-icon-file.c b/libnautilus-private/nautilus-desktop-icon-file.c index 2f482a291..bbfefe1af 100644 --- a/libnautilus-private/nautilus-desktop-icon-file.c +++ b/libnautilus-private/nautilus-desktop-icon-file.c @@ -199,11 +199,17 @@ update_info_from_link (NautilusDesktopIconFile *icon_file) file_info->flags = GNOME_VFS_FILE_FLAGS_NONE; file_info->link_count = 1; file_info->size = 0; + file_info->permissions = + GNOME_VFS_PERM_OTHER_WRITE | + GNOME_VFS_PERM_USER_READ | + GNOME_VFS_PERM_OTHER_READ | + GNOME_VFS_PERM_GROUP_READ; file_info->valid_fields = GNOME_VFS_FILE_INFO_FIELDS_TYPE | GNOME_VFS_FILE_INFO_FIELDS_FLAGS | GNOME_VFS_FILE_INFO_FIELDS_MIME_TYPE | GNOME_VFS_FILE_INFO_FIELDS_SIZE | + GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS | GNOME_VFS_FILE_INFO_FIELDS_LINK_COUNT; volume = nautilus_desktop_link_get_volume (link); diff --git a/libnautilus-private/nautilus-desktop-link-monitor.c b/libnautilus-private/nautilus-desktop-link-monitor.c index ff5fc1c00..47532f3ff 100644 --- a/libnautilus-private/nautilus-desktop-link-monitor.c +++ b/libnautilus-private/nautilus-desktop-link-monitor.c @@ -47,6 +47,7 @@ struct NautilusDesktopLinkMonitorDetails { NautilusDirectory *desktop_dir; NautilusDesktopLink *home_link; + NautilusDesktopLink *computer_link; NautilusDesktopLink *trash_link; gulong mount_id; @@ -96,6 +97,9 @@ nautilus_desktop_link_monitor_delete_link (NautilusDesktopLinkMonitor *monitor, case NAUTILUS_DESKTOP_LINK_HOME: eel_preferences_set_boolean (NAUTILUS_PREFERENCES_DESKTOP_HOME_VISIBLE, FALSE); break; + case NAUTILUS_DESKTOP_LINK_COMPUTER: + eel_preferences_set_boolean (NAUTILUS_PREFERENCES_DESKTOP_COMPUTER_VISIBLE, FALSE); + break; case NAUTILUS_DESKTOP_LINK_TRASH: eel_preferences_set_boolean (NAUTILUS_PREFERENCES_DESKTOP_TRASH_VISIBLE, FALSE); break; @@ -184,6 +188,25 @@ desktop_home_visible_changed (gpointer callback_data) } static void +desktop_computer_visible_changed (gpointer callback_data) +{ + NautilusDesktopLinkMonitor *monitor; + + monitor = NAUTILUS_DESKTOP_LINK_MONITOR (callback_data); + + if (eel_preferences_get_boolean (NAUTILUS_PREFERENCES_DESKTOP_COMPUTER_VISIBLE)) { + if (monitor->details->computer_link == NULL) { + monitor->details->computer_link = nautilus_desktop_link_new (NAUTILUS_DESKTOP_LINK_COMPUTER); + } + } else { + if (monitor->details->computer_link != NULL) { + g_object_unref (monitor->details->computer_link); + monitor->details->computer_link = NULL; + } + } +} + +static void desktop_trash_visible_changed (gpointer callback_data) { NautilusDesktopLinkMonitor *monitor; @@ -221,6 +244,10 @@ nautilus_desktop_link_monitor_init (gpointer object, gpointer klass) monitor->details->home_link = nautilus_desktop_link_new (NAUTILUS_DESKTOP_LINK_HOME); } + if (eel_preferences_get_boolean (NAUTILUS_PREFERENCES_DESKTOP_COMPUTER_VISIBLE)) { + monitor->details->computer_link = nautilus_desktop_link_new (NAUTILUS_DESKTOP_LINK_COMPUTER); + } + if (eel_preferences_get_boolean (NAUTILUS_PREFERENCES_DESKTOP_TRASH_VISIBLE)) { monitor->details->trash_link = nautilus_desktop_link_new (NAUTILUS_DESKTOP_LINK_TRASH); } @@ -237,6 +264,9 @@ nautilus_desktop_link_monitor_init (gpointer object, gpointer klass) eel_preferences_add_callback (NAUTILUS_PREFERENCES_DESKTOP_HOME_VISIBLE, desktop_home_visible_changed, monitor); + eel_preferences_add_callback (NAUTILUS_PREFERENCES_DESKTOP_COMPUTER_VISIBLE, + desktop_computer_visible_changed, + monitor); eel_preferences_add_callback (NAUTILUS_PREFERENCES_DESKTOP_TRASH_VISIBLE, desktop_trash_visible_changed, monitor); @@ -261,6 +291,11 @@ desktop_link_monitor_finalize (GObject *object) monitor->details->home_link = NULL; } + if (monitor->details->computer_link != NULL) { + g_object_unref (monitor->details->computer_link); + monitor->details->computer_link = NULL; + } + if (monitor->details->trash_link != NULL) { g_object_unref (monitor->details->trash_link); monitor->details->trash_link = NULL; @@ -276,6 +311,9 @@ desktop_link_monitor_finalize (GObject *object) eel_preferences_remove_callback (NAUTILUS_PREFERENCES_DESKTOP_HOME_VISIBLE, desktop_home_visible_changed, monitor); + eel_preferences_remove_callback (NAUTILUS_PREFERENCES_DESKTOP_COMPUTER_VISIBLE, + desktop_computer_visible_changed, + monitor); eel_preferences_remove_callback (NAUTILUS_PREFERENCES_DESKTOP_TRASH_VISIBLE, desktop_trash_visible_changed, monitor); diff --git a/libnautilus-private/nautilus-desktop-link.c b/libnautilus-private/nautilus-desktop-link.c index f5279f33b..e8dd7d3e0 100644 --- a/libnautilus-private/nautilus-desktop-link.c +++ b/libnautilus-private/nautilus-desktop-link.c @@ -90,6 +90,20 @@ home_name_changed (gpointer callback_data) } static void +computer_name_changed (gpointer callback_data) +{ + NautilusDesktopLink *link; + + link = NAUTILUS_DESKTOP_LINK (callback_data); + g_assert (link->details->type == NAUTILUS_DESKTOP_LINK_COMPUTER); + + g_free (link->details->display_name); + link->details->display_name = eel_preferences_get (NAUTILUS_PREFERENCES_DESKTOP_COMPUTER_NAME); + + nautilus_desktop_link_changed (link); +} + +static void trash_name_changed (gpointer callback_data) { NautilusDesktopLink *link; @@ -134,6 +148,22 @@ nautilus_desktop_link_new (NautilusDesktopLinkType type) link); break; + + case NAUTILUS_DESKTOP_LINK_COMPUTER: + link->details->filename = g_strdup ("computer"); + + link->details->display_name = eel_preferences_get (NAUTILUS_PREFERENCES_DESKTOP_COMPUTER_NAME); + + link->details->activation_uri = g_strdup ("computer:///"); + /* TODO: This might need a different icon: */ + link->details->icon = g_strdup ("gnome-fs-client"); + + eel_preferences_add_callback (NAUTILUS_PREFERENCES_DESKTOP_COMPUTER_NAME, + computer_name_changed, + link); + + break; + case NAUTILUS_DESKTOP_LINK_TRASH: link->details->filename = g_strdup ("trash"); link->details->display_name = g_strdup (_("Trash")); @@ -305,6 +335,10 @@ nautilus_desktop_link_rename (NautilusDesktopLink *link, eel_preferences_set (NAUTILUS_PREFERENCES_DESKTOP_HOME_NAME, name); break; + case NAUTILUS_DESKTOP_LINK_COMPUTER: + eel_preferences_set (NAUTILUS_PREFERENCES_DESKTOP_COMPUTER_NAME, + name); + break; case NAUTILUS_DESKTOP_LINK_TRASH: eel_preferences_set (NAUTILUS_PREFERENCES_DESKTOP_TRASH_NAME, name); @@ -357,6 +391,12 @@ desktop_link_finalize (GObject *object) link); } + if (link->details->type == NAUTILUS_DESKTOP_LINK_COMPUTER) { + eel_preferences_remove_callback (NAUTILUS_PREFERENCES_DESKTOP_COMPUTER_NAME, + computer_name_changed, + link); + } + if (link->details->type == NAUTILUS_DESKTOP_LINK_TRASH) { eel_preferences_remove_callback (NAUTILUS_PREFERENCES_DESKTOP_TRASH_NAME, trash_name_changed, diff --git a/libnautilus-private/nautilus-desktop-link.h b/libnautilus-private/nautilus-desktop-link.h index d6dede899..fd55bae01 100644 --- a/libnautilus-private/nautilus-desktop-link.h +++ b/libnautilus-private/nautilus-desktop-link.h @@ -52,6 +52,7 @@ typedef struct { typedef enum { NAUTILUS_DESKTOP_LINK_HOME, + NAUTILUS_DESKTOP_LINK_COMPUTER, NAUTILUS_DESKTOP_LINK_TRASH, NAUTILUS_DESKTOP_LINK_VOLUME } NautilusDesktopLinkType; diff --git a/libnautilus-private/nautilus-global-preferences.c b/libnautilus-private/nautilus-global-preferences.c index 252dd7889..29fb25dc4 100644 --- a/libnautilus-private/nautilus-global-preferences.c +++ b/libnautilus-private/nautilus-global-preferences.c @@ -56,6 +56,7 @@ static gpointer default_home_location_callback (void); static gpointer default_default_folder_viewer_callback (void); static void import_old_preferences_if_needed (void); static gpointer default_home_link_name (void); +static gpointer default_computer_link_name (void); static gpointer default_trash_link_name (void); /* An enumeration used for installing type specific preferences defaults. */ @@ -488,7 +489,7 @@ static const PreferenceDefault preference_defaults[] = { /* Desktop Preferences */ { NAUTILUS_PREFERENCES_DESKTOP_HOME_VISIBLE, PREFERENCE_BOOLEAN, - GINT_TO_POINTER (TRUE) + GINT_TO_POINTER (FALSE) }, { NAUTILUS_PREFERENCES_DESKTOP_HOME_NAME, @@ -497,6 +498,17 @@ static const PreferenceDefault preference_defaults[] = { default_home_link_name, g_free, }, + { NAUTILUS_PREFERENCES_DESKTOP_COMPUTER_VISIBLE, + PREFERENCE_BOOLEAN, + GINT_TO_POINTER (TRUE) + }, + + { NAUTILUS_PREFERENCES_DESKTOP_COMPUTER_NAME, + PREFERENCE_STRING, + NULL, + default_computer_link_name, g_free, + }, + { NAUTILUS_PREFERENCES_DESKTOP_TRASH_VISIBLE, PREFERENCE_BOOLEAN, GINT_TO_POINTER (TRUE) @@ -532,6 +544,12 @@ default_home_link_name (void) } static gpointer +default_computer_link_name (void) +{ + return g_strdup (_("Computer")); +} + +static gpointer default_trash_link_name (void) { return g_strdup (_("Trash")); diff --git a/libnautilus-private/nautilus-global-preferences.h b/libnautilus-private/nautilus-global-preferences.h index 3e1686566..176f01ce3 100644 --- a/libnautilus-private/nautilus-global-preferences.h +++ b/libnautilus-private/nautilus-global-preferences.h @@ -168,6 +168,8 @@ typedef enum #define NAUTILUS_PREFERENCES_DESKTOP_HOME_VISIBLE "desktop/home_icon_visible" #define NAUTILUS_PREFERENCES_DESKTOP_HOME_NAME "desktop/home_icon_name" +#define NAUTILUS_PREFERENCES_DESKTOP_COMPUTER_VISIBLE "desktop/computer_icon_visible" +#define NAUTILUS_PREFERENCES_DESKTOP_COMPUTER_NAME "desktop/computer_icon_name" #define NAUTILUS_PREFERENCES_DESKTOP_TRASH_VISIBLE "desktop/trash_icon_visible" #define NAUTILUS_PREFERENCES_DESKTOP_TRASH_NAME "desktop/trash_icon_name" diff --git a/nautilus-computer.desktop.in b/nautilus-computer.desktop.in new file mode 100644 index 000000000..0662c3213 --- /dev/null +++ b/nautilus-computer.desktop.in @@ -0,0 +1,14 @@ +[Desktop Entry] +Encoding=UTF-8 +_Name=Computer +_Comment=View your computer storage +TryExec=nautilus +Exec=nautilus computer: +Icon=gnome-fs-client +Terminal=false +Type=Application +Categories=Application;Core; +X-GNOME-Bugzilla-Bugzilla=GNOME +X-GNOME-Bugzilla-Product=nautilus +X-GNOME-Bugzilla-Component=general +X-Gnome-Bugzilla-OtherBinaries=nautilus-adapter;nautilus-content-loser;nautilus-sidebar-loser;nautilus-text-view;nautilus-throbber; diff --git a/nautilus-home.desktop.in b/nautilus-home.desktop.in new file mode 100644 index 000000000..e50265a7b --- /dev/null +++ b/nautilus-home.desktop.in @@ -0,0 +1,14 @@ +[Desktop Entry] +Encoding=UTF-8 +_Name=Home Folder +_Comment=View your home folder in the Nautilus file manager +TryExec=nautilus +Exec=nautilus +Icon=gnome-home +Terminal=false +Type=Application +Categories=Application;Core; +X-GNOME-Bugzilla-Bugzilla=GNOME +X-GNOME-Bugzilla-Product=nautilus +X-GNOME-Bugzilla-Component=general +X-Gnome-Bugzilla-OtherBinaries=nautilus-adapter;nautilus-content-loser;nautilus-sidebar-loser;nautilus-text-view;nautilus-throbber; diff --git a/nautilus.desktop.in b/nautilus.desktop.in index 7c4b8fef0..debfd6c94 100644 --- a/nautilus.desktop.in +++ b/nautilus.desktop.in @@ -1,10 +1,10 @@ [Desktop Entry] Encoding=UTF-8 -_Name=Home Folder -_Comment=View your home folder in the Nautilus file manager +_Name=Browse Filesystem +_Comment=Browse the filesystem with the file manager TryExec=nautilus -Exec=nautilus -Icon=gnome-home.png +Exec=nautilus --no-desktop --browser +Icon=file-manager Terminal=false Type=Application Categories=Application;Core; @@ -12,6 +12,3 @@ X-GNOME-Bugzilla-Bugzilla=GNOME X-GNOME-Bugzilla-Product=nautilus X-GNOME-Bugzilla-Component=general X-Gnome-Bugzilla-OtherBinaries=nautilus-adapter;nautilus-content-loser;nautilus-sidebar-loser;nautilus-text-view;nautilus-throbber; - - - diff --git a/src/Makefile.am b/src/Makefile.am index 45131a88b..6c599c22a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -63,6 +63,7 @@ nautilus_SOURCES = \ nautilus-bookmarks-window.c \ nautilus-complex-search-bar.c \ nautilus-component-adapter-factory.c \ + nautilus-connect-server-dialog.c \ nautilus-desktop-window.c \ nautilus-first-time-druid.c \ nautilus-information-panel.c \ @@ -100,6 +101,7 @@ nautilus_SOURCES = \ nautilus-bookmarks-window.h \ nautilus-complex-search-bar.h \ nautilus-component-adapter-factory.h \ + nautilus-connect-server-dialog.h \ nautilus-desktop-window.h \ nautilus-first-time-druid.h \ nautilus-information-panel.h \ diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c index 2f0ce241e..9a328a07f 100644 --- a/src/file-manager/fm-directory-view.c +++ b/src/file-manager/fm-directory-view.c @@ -267,6 +267,9 @@ typedef struct { Nautilus_ViewFrame_OpenMode mode; Nautilus_ViewFrame_OpenFlags flags; NautilusFileCallback callback; + gboolean mounted; + gboolean mounting; + gboolean cancelled; } ActivateParameters; typedef struct { @@ -349,6 +352,8 @@ static void fm_directory_view_select_file (FMDirectoryView static void monitor_file_for_open_with (FMDirectoryView *view, NautilusFile *file); static void create_scripts_directory (void); +static void activate_activation_uri_ready_callback (NautilusFile *file, + gpointer callback_data); EEL_CLASS_BOILERPLATE (FMDirectoryView, fm_directory_view, GTK_TYPE_SCROLLED_WINDOW) @@ -4935,15 +4940,12 @@ real_update_menus_volumes (FMDirectoryView *view, unmount_is_eject = eject_for_type (gnome_vfs_volume_get_device_type (volume)); } else if (nautilus_file_has_drive (file)) { drive = nautilus_file_get_drive (file); - volume = gnome_vfs_drive_get_mounted_volume (drive); - if (volume == NULL) { - show_mount = TRUE; - } else { + if (gnome_vfs_drive_is_mounted (drive)) { show_unmount = TRUE; unmount_is_eject = eject_for_type (gnome_vfs_drive_get_device_type (drive)); + } else { + show_mount = TRUE; } - - gnome_vfs_volume_unref (volume); } } @@ -5539,14 +5541,54 @@ activate_callback (NautilusFile *file, gpointer callback_data) } static void +activation_drive_mounted_callback (gboolean succeeded, + char *error, + char *detailed_error, + gpointer callback_data) +{ + ActivateParameters *parameters; + + parameters = callback_data; + + parameters->mounted = TRUE; + parameters->mounting = FALSE; + + if (succeeded && !parameters->cancelled) { + activate_activation_uri_ready_callback (parameters->file, + parameters); + } else { + if (!parameters->cancelled) { + eel_timed_wait_stop (cancel_activate_callback, parameters); + eel_show_error_dialog_with_details (error, _("Mount Error"), detailed_error, NULL); + } + + nautilus_file_unref (parameters->file); + + g_free (parameters); + } +} + + +static void activate_activation_uri_ready_callback (NautilusFile *file, gpointer callback_data) { ActivateParameters *parameters; NautilusFile *actual_file; NautilusFileAttributes attributes; + GnomeVFSDrive *drive; char *uri; parameters = callback_data; + + if (!parameters->mounted && nautilus_file_has_drive (file)) { + drive = nautilus_file_get_drive (file); + if (drive != NULL && + !gnome_vfs_drive_is_mounted (drive)) { + parameters->mounting = TRUE; + gnome_vfs_drive_mount (drive, activation_drive_mounted_callback, callback_data); + return; + } + } /* We want the file for the activation URI since we care * about the attributes for that, not for the original file. @@ -5583,13 +5625,16 @@ cancel_activate_callback (gpointer callback_data) parameters = (ActivateParameters *) callback_data; - nautilus_file_cancel_call_when_ready (parameters->file, - parameters->callback, - parameters); - - nautilus_file_unref (parameters->file); - - g_free (parameters); + parameters->cancelled = TRUE; + if (!parameters->mounting) { + nautilus_file_cancel_call_when_ready (parameters->file, + parameters->callback, + parameters); + + nautilus_file_unref (parameters->file); + + g_free (parameters); + } } /** @@ -5624,7 +5669,8 @@ fm_directory_view_activate_file (FMDirectoryView *view, nautilus_file_ref (file); /* Might have to read some of the file to activate it. */ - attributes = NAUTILUS_FILE_ATTRIBUTE_ACTIVATION_URI; + attributes = NAUTILUS_FILE_ATTRIBUTE_ACTIVATION_URI | + NAUTILUS_FILE_ATTRIBUTE_VOLUMES; parameters = g_new (ActivateParameters, 1); parameters->view = view; @@ -5632,6 +5678,9 @@ fm_directory_view_activate_file (FMDirectoryView *view, parameters->mode = mode; parameters->flags = flags; parameters->callback = activate_activation_uri_ready_callback; + parameters->mounted = FALSE; + parameters->mounting = FALSE; + parameters->cancelled = FALSE; file_name = nautilus_file_get_display_name (file); timed_wait_prompt = g_strdup_printf (_("Opening \"%s\""), file_name); diff --git a/src/file-manager/fm-icon-container.c b/src/file-manager/fm-icon-container.c index ae55ff21e..6cffbaabe 100644 --- a/src/file-manager/fm-icon-container.c +++ b/src/file-manager/fm-icon-container.c @@ -317,6 +317,7 @@ fm_icon_container_get_icon_text (NautilusIconContainer *container, * 4) trash link */ typedef enum { + SORT_COMPUTER_LINK, SORT_HOME_LINK, SORT_MOUNT_LINK, SORT_OTHER, @@ -333,6 +334,9 @@ get_sort_category (NautilusFile *file) link = nautilus_desktop_icon_file_get_link (NAUTILUS_DESKTOP_ICON_FILE (file)); switch (nautilus_desktop_link_get_link_type (link)) { + case NAUTILUS_DESKTOP_LINK_COMPUTER: + category = SORT_COMPUTER_LINK; + break; case NAUTILUS_DESKTOP_LINK_HOME: category = SORT_HOME_LINK; break; diff --git a/src/file-manager/fm-properties-window.c b/src/file-manager/fm-properties-window.c index f583e1afe..68707a296 100644 --- a/src/file-manager/fm-properties-window.c +++ b/src/file-manager/fm-properties-window.c @@ -271,6 +271,7 @@ get_target_file_for_original_file (NautilusFile *file) char *uri_to_display; GnomeVFSVolume *volume; GnomeVFSDrive *drive; + NautilusDesktopLink *link; target_file = NULL; if (nautilus_file_has_volume (file)) { @@ -289,7 +290,19 @@ get_target_file_for_original_file (NautilusFile *file) g_free (uri_to_display); } gnome_vfs_drive_unref (drive); - } + } else if (NAUTILUS_IS_DESKTOP_ICON_FILE (file)) { + link = nautilus_desktop_icon_file_get_link (NAUTILUS_DESKTOP_ICON_FILE (file)); + + /* map to linked URI for these types of links */ + uri_to_display = nautilus_desktop_link_get_activation_uri (link); + if (uri_to_display) { + target_file = nautilus_file_get (uri_to_display); + g_free (uri_to_display); + } + + g_object_unref (link); + } + if (target_file != NULL) { return target_file; diff --git a/src/nautilus-application.c b/src/nautilus-application.c index fec777a45..aab7fe3f6 100644 --- a/src/nautilus-application.c +++ b/src/nautilus-application.c @@ -100,6 +100,9 @@ static void desktop_location_changed_callback (gpointer use static void volume_unmounted_callback (GnomeVFSVolumeMonitor *monitor, GnomeVFSVolume *volume, NautilusApplication *application); +static void volume_mounted_callback (GnomeVFSVolumeMonitor *monitor, + GnomeVFSVolume *volume, + NautilusApplication *application); static void update_session (gpointer callback_data); static void init_session (void); static gboolean is_kdesktop_present (void); @@ -172,6 +175,8 @@ nautilus_application_instance_init (NautilusApplication *application) /* Watch for volume unmounts so we can close open windows */ g_signal_connect_object (gnome_vfs_get_volume_monitor (), "volume_unmounted", G_CALLBACK (volume_unmounted_callback), application, 0); + g_signal_connect_object (gnome_vfs_get_volume_monitor (), "volume_mounted", + G_CALLBACK (volume_mounted_callback), application, 0); nautilus_bonobo_register_activation_shortcut (NAUTILUS_ICON_VIEW_IID, create_object_shortcut, application); nautilus_bonobo_register_activation_shortcut (NAUTILUS_DESKTOP_ICON_VIEW_IID, create_object_shortcut, application); @@ -452,6 +457,7 @@ nautilus_application_startup (NautilusApplication *application, gboolean no_default_window, gboolean no_desktop, gboolean do_first_time_druid_check, + gboolean browser_window, const char *geometry, const char *urls[]) { @@ -625,10 +631,10 @@ nautilus_application_startup (NautilusApplication *application, /* Create the other windows. */ if (urls != NULL) { url_list = nautilus_make_uri_list_from_shell_strv (urls); - Nautilus_Shell_open_windows (shell, url_list, corba_geometry, &ev); + Nautilus_Shell_open_windows (shell, url_list, corba_geometry, browser_window, &ev); CORBA_free (url_list); } else if (!no_default_window) { - Nautilus_Shell_open_default_window (shell, corba_geometry, &ev); + Nautilus_Shell_open_default_window (shell, corba_geometry, browser_window, &ev); } /* Add ourselves to the session */ @@ -1085,6 +1091,23 @@ window_can_be_closed (NautilusWindow *window) return FALSE; } +static void +volume_mounted_callback (GnomeVFSVolumeMonitor *monitor, + GnomeVFSVolume *volume, + NautilusApplication *application) +{ + char *activation_uri; + NautilusDirectory *directory; + + activation_uri = gnome_vfs_volume_get_activation_uri (volume); + directory = nautilus_directory_get_existing (activation_uri); + g_free (activation_uri); + if (directory != NULL) { + nautilus_directory_force_reload (directory); + nautilus_directory_unref (directory); + } +} + /* Called whenever a volume is unmounted. Check and see if there are any windows open * displaying contents on the volume. If there are, close them. * It would also be cool to save open window and position info. diff --git a/src/nautilus-application.h b/src/nautilus-application.h index 503e3bf63..6b43d2d0e 100644 --- a/src/nautilus-application.h +++ b/src/nautilus-application.h @@ -66,6 +66,7 @@ void nautilus_application_startup (NautilusApplication gboolean no_default_window, gboolean no_desktop, gboolean do_first_time_druid_check, + gboolean browser_window, const char *default_geometry, const char *urls[]); GList * nautilus_application_get_window_list (void); diff --git a/src/nautilus-connect-server-dialog.c b/src/nautilus-connect-server-dialog.c new file mode 100644 index 000000000..f3a44e6a8 --- /dev/null +++ b/src/nautilus-connect-server-dialog.c @@ -0,0 +1,249 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ + +/* + * Nautilus + * + * Copyright (C) 2003 Red Hat, Inc. + * + * Nautilus is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * Nautilus is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; see the file COPYING. If not, + * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include <config.h> +#include "nautilus-connect-server-dialog.h" + +#include <string.h> +#include <eel/eel-gtk-macros.h> +#include <eel/eel-stock-dialogs.h> +#include <eel/eel-vfs-extensions.h> +#include <gtk/gtkhbox.h> +#include <gtk/gtktable.h> +#include <gtk/gtklabel.h> +#include <gtk/gtkstock.h> +#include "nautilus-location-entry.h" + +struct _NautilusConnectServerDialogDetails { + GtkWidget *name_entry; + GtkWidget *uri_entry; +}; + +static void nautilus_connect_server_dialog_class_init (NautilusConnectServerDialogClass *class); +static void nautilus_connect_server_dialog_init (NautilusConnectServerDialog *dialog); + +EEL_CLASS_BOILERPLATE (NautilusConnectServerDialog, + nautilus_connect_server_dialog, + GTK_TYPE_DIALOG) +enum { + RESPONSE_CONNECT, + RESPONSE_CANCEL +}; + +static void +nautilus_connect_server_dialog_finalize (GObject *object) +{ + NautilusConnectServerDialog *dialog; + + dialog = NAUTILUS_CONNECT_SERVER_DIALOG (object); + + g_free (dialog->details); + + EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object)); +} + +static void +nautilus_connect_server_dialog_destroy (GtkObject *object) +{ + NautilusConnectServerDialog *dialog; + + dialog = NAUTILUS_CONNECT_SERVER_DIALOG (object); + + EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object)); +} + +static void +connect_to_server (NautilusConnectServerDialog *dialog) +{ + char *uri; + char *user_uri; + GnomeVFSURI *vfs_uri; + char *error_message; + char *name; + char *icon; + + name = gtk_editable_get_chars (GTK_EDITABLE (dialog->details->name_entry), 0, -1); + if (strlen (name) == 0) { + eel_show_error_dialog (_("You must enter a name for the server"), _("Can't connect to server"), GTK_WINDOW (dialog)); + g_free (name); + return; + } + + user_uri = gtk_editable_get_chars (GTK_EDITABLE (dialog->details->uri_entry), 0, -1); + uri = eel_make_uri_from_input (user_uri); + g_free (user_uri); + + vfs_uri = gnome_vfs_uri_new (uri); + + if (vfs_uri == NULL) { + error_message = g_strdup_printf + (_("\"%s\" is not a valid location. Please check the spelling and try again."), + uri); + eel_show_error_dialog (error_message, _("Can't connect to server"), GTK_WINDOW (dialog)); + g_free (error_message); + } else { + gnome_vfs_uri_unref (vfs_uri); + if (g_str_has_prefix (uri, "smb:")) { + icon = "gnome-fs-smb"; + } else if (g_str_has_prefix (uri, "ssh:") || + g_str_has_prefix (uri, "sftp:")) { + icon = "gnome-fs-ssh"; + } else if (g_str_has_prefix (uri, "ftp:")) { + icon = "gnome-fs-ftp"; + } else { + icon = "gnome-fs-share"; + } + + gnome_vfs_connect_to_server (uri, name, icon); + gtk_widget_destroy (GTK_WIDGET (dialog)); + } + g_free (name); + g_free (uri); +} + +static void +response_callback (NautilusConnectServerDialog *dialog, + int response_id, + gpointer data) +{ + switch (response_id) { + case RESPONSE_CONNECT: + connect_to_server (dialog); + break; + case GTK_RESPONSE_NONE: + case GTK_RESPONSE_DELETE_EVENT: + case RESPONSE_CANCEL: + gtk_widget_destroy (GTK_WIDGET (dialog)); + break; + default : + g_assert_not_reached (); + } +} + +static void +entry_activate_callback (GtkEntry *entry, + gpointer user_data) +{ + NautilusConnectServerDialog *dialog; + + dialog = NAUTILUS_CONNECT_SERVER_DIALOG (user_data); + gtk_dialog_response (GTK_DIALOG (dialog), RESPONSE_CONNECT); +} + +static void +nautilus_connect_server_dialog_class_init (NautilusConnectServerDialogClass *class) +{ + GObjectClass *gobject_class; + GtkObjectClass *object_class; + + gobject_class = G_OBJECT_CLASS (class); + gobject_class->finalize = nautilus_connect_server_dialog_finalize; + + object_class = GTK_OBJECT_CLASS (class); + object_class->destroy = nautilus_connect_server_dialog_destroy; +} + +static void +nautilus_connect_server_dialog_init (NautilusConnectServerDialog *dialog) +{ + GtkWidget *label; + GtkWidget *table; + + dialog->details = g_new0 (NautilusConnectServerDialogDetails, 1); + + gtk_window_set_title (GTK_WINDOW (dialog), _("Connect to Server")); + gtk_window_set_default_size (GTK_WINDOW (dialog), 300, -1); + gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); + + table = gtk_table_new (2, 2, FALSE); + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), + table, TRUE, TRUE, 12); + gtk_table_set_row_spacings (GTK_TABLE (table), 6); + gtk_table_set_col_spacings (GTK_TABLE (table), 6); + gtk_widget_show (table); + + label = gtk_label_new (_("Name:")); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, + 0, 1, + 0, 1, + GTK_FILL, GTK_FILL, + 0, 0); + + dialog->details->name_entry = gtk_entry_new (); + gtk_widget_show (dialog->details->name_entry); + gtk_table_attach (GTK_TABLE (table), dialog->details->name_entry, + 1, 2, + 0, 1, + GTK_FILL | GTK_EXPAND, GTK_FILL, + 0, 0); + + + label = gtk_label_new (_("Location:")); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, + 0, 1, + 1, 2, + GTK_FILL, GTK_FILL, + 0, 0); + + dialog->details->uri_entry = nautilus_location_entry_new (); + g_signal_connect (dialog->details->uri_entry, + "activate", + G_CALLBACK (entry_activate_callback), + dialog); + gtk_widget_show (dialog->details->uri_entry); + gtk_table_attach (GTK_TABLE (table), dialog->details->uri_entry, + 1, 2, + 1, 2, + GTK_FILL | GTK_EXPAND, GTK_FILL, + 0, 0); + + gtk_dialog_add_button (GTK_DIALOG (dialog), + GTK_STOCK_CANCEL, + RESPONSE_CANCEL); + gtk_dialog_add_button (GTK_DIALOG (dialog), + _("Connect"), + RESPONSE_CONNECT); + gtk_dialog_set_default_response (GTK_DIALOG (dialog), + RESPONSE_CONNECT); + + g_signal_connect (dialog, "response", + G_CALLBACK (response_callback), + dialog); +} + +GtkWidget * +nautilus_connect_server_dialog_new (NautilusWindow *window) +{ + GtkWidget *dialog; + + dialog = gtk_widget_new (NAUTILUS_TYPE_CONNECT_SERVER_DIALOG, NULL); + + if (window) { + gtk_window_set_screen (GTK_WINDOW (dialog), + gtk_window_get_screen (GTK_WINDOW (window))); + } + + return dialog; +} diff --git a/src/nautilus-connect-server-dialog.h b/src/nautilus-connect-server-dialog.h new file mode 100644 index 000000000..0184855b6 --- /dev/null +++ b/src/nautilus-connect-server-dialog.h @@ -0,0 +1,51 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ + +/* + * Nautilus + * + * Copyright (C) 2003 Red Hat, Inc. + * + * Nautilus is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * Nautilus is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; see the file COPYING. If not, + * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef NAUTILUS_CONNECT_SERVER_DIALOG_H +#define NAUTILUS_CONNECT_SERVER_DIALOG_H + +#include <gtk/gtkdialog.h> +#include "nautilus-window.h" + +#define NAUTILUS_TYPE_CONNECT_SERVER_DIALOG (nautilus_connect_server_dialog_get_type ()) +#define NAUTILUS_CONNECT_SERVER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NAUTILUS_TYPE_CONNECT_SERVER_DIALOG, NautilusConnectServerDialog)) +#define NAUTILUS_CONNECT_SERVER_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_CONNECT_SERVER_DIALOG, NautilusConnectServerDialogClass)) +#define NAUTILUS_IS_CONNECT_SERVER_DIALOG(obj) (G_TYPE_INSTANCE_CHECK_TYPE ((obj), NAUTILUS_TYPE_CONNECT_SERVER_DIALOG) + +typedef struct _NautilusConnectServerDialog NautilusConnectServerDialog; +typedef struct _NautilusConnectServerDialogClass NautilusConnectServerDialogClass; +typedef struct _NautilusConnectServerDialogDetails NautilusConnectServerDialogDetails; + +struct _NautilusConnectServerDialog { + GtkDialog parent; + NautilusConnectServerDialogDetails *details; +}; + +struct _NautilusConnectServerDialogClass { + GtkDialogClass parent_class; +}; + +GType nautilus_connect_server_dialog_get_type (void); +GtkWidget* nautilus_connect_server_dialog_new (NautilusWindow *window); + +#endif /* NAUTILUS_CONNECT_SERVER_DIALOG_H */ diff --git a/src/nautilus-main.c b/src/nautilus-main.c index d451f7f4c..69c2d4a79 100644 --- a/src/nautilus-main.c +++ b/src/nautilus-main.c @@ -43,6 +43,7 @@ #include <eel/eel-self-checks.h> #include <gdk/gdkx.h> #include <gtk/gtkmain.h> +#include <gtk/gtkiconfactory.h> #include <gtk/gtksignal.h> #include <libgnome/gnome-i18n.h> #include <libgnome/gnome-init.h> @@ -126,12 +127,49 @@ nautilus_main_event_loop_quit (void) } } +static void +register_icons (void) +{ + GnomeIconTheme *icon_theme; + char *icon; + GtkIconSource *source; + GtkIconSet *set; + GtkIconFactory *factory; + + icon_theme = nautilus_icon_factory_get_icon_theme (); + icon = gnome_icon_theme_lookup_icon (icon_theme, "gnome-fs-client", 48, + NULL, NULL); + if (icon != NULL) { + factory = gtk_icon_factory_new (); + gtk_icon_factory_add_default (factory); + + source = gtk_icon_source_new (); + gtk_icon_source_set_filename (source, icon); + g_free (icon); + + set = gtk_icon_set_new (); + gtk_icon_set_add_source (set, source); + + gtk_icon_factory_add (factory, "gnome-fs-client", set); + gtk_icon_set_unref (set); + + gtk_icon_source_free (source); + + g_object_unref (factory); + } + + g_object_unref (icon_theme); + + +} + int main (int argc, char *argv[]) { gboolean kill_shell; gboolean restart_shell; gboolean no_default_window; + gboolean browser_window; gboolean no_desktop; char *geometry; gboolean perform_self_check; @@ -154,6 +192,8 @@ main (int argc, char *argv[]) N_("Only create windows for explicitly specified URIs."), NULL }, { "no-desktop", '\0', POPT_ARG_NONE, NULL, 0, N_("Do not manage the desktop (ignore the preference set in the preferences dialog)."), NULL }, + { "browser", '\0', POPT_ARG_NONE, NULL, 0, + N_("open a browser window."), NULL }, { "quit", 'q', POPT_ARG_NONE, NULL, 0, N_("Quit Nautilus."), NULL }, { "restart", '\0', POPT_ARG_NONE | POPT_ARGFLAG_DOC_HIDDEN, NULL, 0, @@ -168,6 +208,7 @@ main (int argc, char *argv[]) options[i++].arg = &geometry; options[i++].arg = &no_default_window; options[i++].arg = &no_desktop; + options[i++].arg = &browser_window; options[i++].arg = &kill_shell; options[i++].arg = &restart_shell; @@ -187,6 +228,7 @@ main (int argc, char *argv[]) no_desktop = FALSE; perform_self_check = FALSE; restart_shell = FALSE; + browser_window = FALSE; g_set_application_name (_("File Manager")); @@ -196,6 +238,8 @@ main (int argc, char *argv[]) GNOME_PARAM_POPT_TABLE, options, GNOME_PARAM_HUMAN_READABLE_NAME, _("Nautilus"), NULL); + + register_icons (); /* Need to set this to the canonical DISPLAY value, since thats where we're registering per-display components */ @@ -276,6 +320,7 @@ main (int argc, char *argv[]) (application, kill_shell, restart_shell, no_default_window, no_desktop, !(kill_shell || restart_shell), + browser_window, geometry, args); if (is_event_loop_needed ()) { diff --git a/src/nautilus-navigation-window-ui.xml b/src/nautilus-navigation-window-ui.xml index 31b88b536..9bdeb5691 100644 --- a/src/nautilus-navigation-window-ui.xml +++ b/src/nautilus-navigation-window-ui.xml @@ -21,6 +21,11 @@ <menu> <submenu name="File"> + <placeholder name="Location Placeholder"> + <menuitem name="Connect to Server" + _label="Connect to _Server..." + verb="Connect to Server"/> + </placeholder> <placeholder name="Close Items Placeholder"> <menuitem name="Close All Windows" _label="Close _All Windows" @@ -72,6 +77,10 @@ accel="*Alt*Home" pixtype="stock" pixname="gtk-home" verb="Home"/> + <menuitem name="Computer" + _label="_Computer" + pixtype="stock" pixname="gnome-fs-client" + verb="Go to Computer"/> <menuitem name="Go to Trash" _label="_Trash" _tip="Go to the trash folder" @@ -144,6 +153,11 @@ priority="1" pixtype="stock" pixname="gtk-home" verb="Home"/> + <toolitem name="Computer" + _label="Computer" + priority="1" + pixtype="stock" pixname="gnome-fs-client" + verb="Go to Computer"/> <toolitem name="Toggle Find Mode" priority="1" type="toggle" diff --git a/src/nautilus-shell-interface.idl b/src/nautilus-shell-interface.idl index 85df1c03f..9427e59a5 100644 --- a/src/nautilus-shell-interface.idl +++ b/src/nautilus-shell-interface.idl @@ -9,8 +9,8 @@ module Nautilus { interface Shell : ::Bonobo::Unknown { - void open_windows (in URIList uris, in string geometry); - void open_default_window (in string geometry); + void open_windows (in URIList uris, in string geometry, in boolean browser_window); + void open_default_window (in string geometry, in boolean browser_window); void start_desktop (); void stop_desktop (); void quit (); diff --git a/src/nautilus-shell.c b/src/nautilus-shell.c index 3c4c0299e..f669590cc 100644 --- a/src/nautilus-shell.c +++ b/src/nautilus-shell.c @@ -45,6 +45,7 @@ #include <libgnome/gnome-i18n.h> #include <libgnomeui/gnome-stock-icons.h> #include <libgnomeui/gnome-uidefs.h> +#include <libgnomevfs/gnome-vfs-utils.h> #include <libnautilus-private/nautilus-file-utilities.h> #include <libnautilus-private/nautilus-global-preferences.h> #include <stdlib.h> @@ -63,9 +64,11 @@ static void finalize (GObject *shell); static void corba_open_windows (PortableServer_Servant servant, const Nautilus_URIList *list, const CORBA_char *geometry, + CORBA_boolean browser_window, CORBA_Environment *ev); static void corba_open_default_window (PortableServer_Servant servant, const CORBA_char *geometry, + CORBA_boolean browser_window, CORBA_Environment *ev); static void corba_start_desktop (PortableServer_Servant servant, CORBA_Environment *ev); @@ -122,47 +125,13 @@ nautilus_shell_new (NautilusApplication *application) } static void -open_window (NautilusShell *shell, const char *uri, const char *geometry) +open_window (NautilusShell *shell, const char *uri, const char *geometry, + gboolean browser_window) { + char *home_uri; NautilusWindow *window; - NautilusWindow *existing_window; - GList *node; - const char *existing_location; - gboolean prefer_existing_window; - -#if NEW_UI_COMPLETE - /* FIXME: This needs more thought */ -#endif - prefer_existing_window = TRUE; - /* If the user's preference is always_open_in_new_window - * we raise an existing window for the location if it already exists. - */ - if (prefer_existing_window) - { - for (node = nautilus_application_get_window_list (); - node != NULL; node = node->next) { - - existing_window = NAUTILUS_WINDOW (node->data); - existing_location = existing_window->details->pending_location; - - if (existing_location == NULL) { - existing_location = existing_window->details->location; - } - - if (eel_uris_match (existing_location, uri)) { - gtk_window_present (GTK_WINDOW (existing_window)); - return; - } - } - } - - /* Otherwise, open a new window. */ - if (uri) { - window = nautilus_application_present_spatial_window (shell->details->application, - uri, - gdk_screen_get_default ()); - } else { + if (browser_window) { window = nautilus_application_create_navigation_window (shell->details->application, gdk_screen_get_default ()); if (uri == NULL) { @@ -170,14 +139,29 @@ open_window (NautilusShell *shell, const char *uri, const char *geometry) } else { nautilus_window_go_to (window, uri); } + } else { + home_uri = NULL; + if (uri == NULL) { +#ifdef WEB_NAVIGATION_ENABLED + home_uri = eel_preferences_get (NAUTILUS_PREFERENCES_HOME_URI); +#else + home_uri = gnome_vfs_get_uri_from_local_path (g_get_home_dir ()); +#endif + uri = home_uri; + } + + window = nautilus_application_present_spatial_window (shell->details->application, + uri, + gdk_screen_get_default ()); + g_free (home_uri); } - if (geometry != NULL) { + if (geometry != NULL && !GTK_WIDGET_VISIBLE (window)) { eel_gtk_window_set_initial_geometry_from_string (GTK_WINDOW (window), - geometry, - APPLICATION_WINDOW_MIN_WIDTH, - APPLICATION_WINDOW_MIN_HEIGHT, - FALSE); + geometry, + APPLICATION_WINDOW_MIN_WIDTH, + APPLICATION_WINDOW_MIN_HEIGHT, + FALSE); } } @@ -185,6 +169,7 @@ static void corba_open_windows (PortableServer_Servant servant, const Nautilus_URIList *list, const CORBA_char *geometry, + CORBA_boolean browser_window, CORBA_Environment *ev) { NautilusShell *shell; @@ -195,13 +180,14 @@ corba_open_windows (PortableServer_Servant servant, /* Open windows at each requested location. */ for (i = 0; i < list->_length; i++) { g_assert (list->_buffer[i] != NULL); - open_window (shell, list->_buffer[i], geometry); + open_window (shell, list->_buffer[i], geometry, browser_window); } } static void corba_open_default_window (PortableServer_Servant servant, const CORBA_char *geometry, + CORBA_boolean browser_window, CORBA_Environment *ev) { NautilusShell *shell; @@ -210,7 +196,7 @@ corba_open_default_window (PortableServer_Servant servant, if (!restore_window_states (shell)) { /* Open a window pointing at the default location. */ - open_window (shell, NULL, geometry); + open_window (shell, NULL, geometry, browser_window); } } diff --git a/src/nautilus-spatial-window-ui.xml b/src/nautilus-spatial-window-ui.xml index 66859e782..aeb8fad4b 100644 --- a/src/nautilus-spatial-window-ui.xml +++ b/src/nautilus-spatial-window-ui.xml @@ -13,10 +13,13 @@ _tip="Open the parent folder" accel="*Alt*Up" verb="Up"/> - <menuitem name="Go to Location" + <menuitem name="Go to Location" _label="Open _Location..." accel="*Control*l" verb="Go to Location"/> + <menuitem name="Connect to Server" + _label="Connect to _Server..." + verb="Connect to Server"/> </placeholder> <placeholder name="Close Items Placeholder"> <menuitem name="Close With Parents" @@ -33,6 +36,11 @@ accel="*Alt*Home" pixtype="stock" pixname="gtk-home" verb="Home"/> + <menuitem name="Go to Computer" + _label="_Computer" + _tip="Go to Computer" + pixtype="stock" pixname="gnome-fs-client" + verb="Go to Computer"/> <menuitem name="Go to Trash" _label="_Trash" _tip="Go to the trash folder" diff --git a/src/nautilus-window-menus.c b/src/nautilus-window-menus.c index a178df21b..a4664be85 100644 --- a/src/nautilus-window-menus.c +++ b/src/nautilus-window-menus.c @@ -30,6 +30,7 @@ #include <locale.h> #include "nautilus-application.h" +#include "nautilus-connect-server-dialog.h" #include "nautilus-file-management-properties.h" #include "nautilus-property-browser.h" #include "nautilus-signaller.h" @@ -90,6 +91,7 @@ #define ID_SHOW_HIDE_STATUS_BAR "Show Hide Statusbar" #define START_HERE_URI "start-here:" +#define COMPUTER_URI "computer:" #define BURN_CD_URI "burn:" /* Struct that stores all the info necessary to activate a bookmark. */ @@ -255,6 +257,17 @@ file_menu_burn_cd_callback (BonoboUIComponent *component, nautilus_window_launch_cd_burner (NAUTILUS_WINDOW (user_data)); } +static void +connect_to_server_callback (BonoboUIComponent *component, + gpointer user_data, + const char *verb) +{ + GtkWidget *dialog; + + dialog = nautilus_connect_server_dialog_new (NAUTILUS_WINDOW (user_data)); + gtk_widget_show (dialog); +} + static gboolean have_burn_uri (void) { @@ -360,6 +373,15 @@ go_menu_start_here_callback (BonoboUIComponent *component, } static void +go_menu_go_to_computer_callback (BonoboUIComponent *component, + gpointer user_data, + const char *verb) +{ + nautilus_window_go_to (NAUTILUS_WINDOW (user_data), + COMPUTER_URI); +} + +static void go_menu_go_to_trash_callback (BonoboUIComponent *component, gpointer user_data, const char *verb) @@ -629,6 +651,7 @@ nautilus_window_initialize_menus_part_1 (NautilusWindow *window) BONOBO_UI_VERB ("New Window", file_menu_new_window_callback), BONOBO_UI_VERB ("Close", file_menu_close_window_callback), BONOBO_UI_VERB ("Burn CD", file_menu_burn_cd_callback), + BONOBO_UI_VERB ("Connect to Server", connect_to_server_callback), #ifdef HAVE_MEDUSA BONOBO_UI_VERB ("Find", file_menu_find_callback), BONOBO_UI_VERB ("Toggle Find Mode", toolbar_toggle_find_mode_callback), @@ -638,6 +661,7 @@ nautilus_window_initialize_menus_part_1 (NautilusWindow *window) BONOBO_UI_VERB ("Up", go_menu_up_callback), BONOBO_UI_VERB ("Home", go_menu_home_callback), BONOBO_UI_VERB ("Start Here", go_menu_start_here_callback), + BONOBO_UI_VERB ("Go to Computer", go_menu_go_to_computer_callback), BONOBO_UI_VERB ("Go to Trash", go_menu_go_to_trash_callback), BONOBO_UI_VERB ("Go to Burn CD", go_menu_go_to_burn_cd_callback), BONOBO_UI_VERB ("Go to Location", go_menu_location_callback), diff --git a/src/nautilus-window.c b/src/nautilus-window.c index 9672f6a81..17960e276 100644 --- a/src/nautilus-window.c +++ b/src/nautilus-window.c @@ -1173,6 +1173,9 @@ compute_default_title (const char *text_uri) } else if (strcmp (text_uri, "fonts://") == 0 || strcmp (text_uri, "fonts:///") == 0) { title = g_strdup (_("Fonts")); + } else if (strcmp (text_uri, "burn://") == 0 || + strcmp (text_uri, "burn:///") == 0) { + title = g_strdup (_("CD Creator")); } else { file = nautilus_file_get (text_uri); title = nautilus_file_get_display_name (file); |