From e162b7dceb9596fa4a7d8a898d64b7c9031fd654 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 6 Nov 2003 16:07:05 +0000 Subject: New desktop files 2003-11-06 Alexander Larsson * 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:/// --- src/nautilus-main.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'src/nautilus-main.c') 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 #include #include +#include #include #include #include @@ -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 ()) { -- cgit v1.2.1