Commit e162b7dc authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

New desktop files

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:///
parent 3613a86b
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:
......
......@@ -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
......
......@@ -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>
......@@ -732,6 +732,21 @@
</locale>
</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>
......
......@@ -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);
......
......@@ -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;
......@@ -183,6 +187,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)
{
......@@ -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);
......
......@@ -89,6 +89,20 @@ home_name_changed (gpointer callback_data)
nautilus_desktop_link_changed (link);
}
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)
{
......@@ -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,
......
......@@ -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;
......
......@@ -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)
......@@ -531,6 +543,12 @@ default_home_link_name (void)
return g_strdup_printf (_("%s's Home"), g_get_user_name ());
}
static gpointer
default_computer_link_name (void)
{
return g_strdup (_("Computer"));
}
static gpointer
default_trash_link_name (void)
{
......
......@@ -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"
......
[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;
[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;
[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;
......@@ -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 \
......
......@@ -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);
}
}
......@@ -5538,15 +5540,55 @@ activate_callback (NautilusFile *file, gpointer callback_data)
g_free (parameters);
}
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);
......
......@@ -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;
......
......@@ -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;
......
......@@ -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.
......
......@@ -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);
......
/* -*- 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));