summaryrefslogtreecommitdiff
path: root/src/nautilus-shell.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2003-11-06 16:07:05 +0000
committerAlexander Larsson <alexl@src.gnome.org>2003-11-06 16:07:05 +0000
commite162b7dceb9596fa4a7d8a898d64b7c9031fd654 (patch)
treee7d763186488c9bb899f400f41ff8d41d2768573 /src/nautilus-shell.c
parent3613a86b2039395b3ee229c901a00e35b85865b6 (diff)
downloadnautilus-e162b7dceb9596fa4a7d8a898d64b7c9031fd654.tar.gz
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:///
Diffstat (limited to 'src/nautilus-shell.c')
-rw-r--r--src/nautilus-shell.c76
1 files changed, 31 insertions, 45 deletions
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);
}
}