Commit 540e21ee authored by Gene Z. Ragan's avatar Gene Z. Ragan Committed by Gene Ragan
Browse files

reviewed by: Mike Engber <angber@eazel.com>

2001-02-08  Gene Z. Ragan  <gzr@eazel.com>

	reviewed by: Mike Engber <angber@eazel.com>

	Fixed bug 3087, gmc to Nautilus transition tool

	Added all features except removing gmc from session. Will
	need some additional help to add that feature.

	* libnautilus-extensions/nautilus-global-preferences.h:
	Add a preferences constant to indicate if Nautilus should
	respawn in the Gnome session.

	* src/nautilus-application.c: (nautilus_application_startup),
	(volume_unmounted_callback), (removed_from_session),
	(save_session), (set_session_restart), (init_session):
	Check preferences add add ourselves to session with a respawn
	setting if the user has specified that they wish such behavior.

	* src/nautilus-first-time-druid.c: (druid_finished),
	(set_up_gmc_transition_page):
	Save gmc to nautilus transition values in nautilus preferences.
parent ac9ce10a
2001-02-08 Gene Z. Ragan <gzr@eazel.com>
reviewed by: Mike Engber <angber@eazel.com>
Fixed bug 3087, gmc to Nautilus transition tool
Added all features except removing gmc from session. Will
need some additional help to add that feature.
* libnautilus-extensions/nautilus-global-preferences.h:
Add a preferences constant to indicate if Nautilus should
respawn in the Gnome session.
* src/nautilus-application.c: (nautilus_application_startup),
(volume_unmounted_callback), (removed_from_session),
(save_session), (set_session_restart), (init_session):
Check preferences add add ourselves to session with a respawn
setting if the user has specified that they wish such behavior.
* src/nautilus-first-time-druid.c: (druid_finished),
(set_up_gmc_transition_page):
Save gmc to nautilus transition values in nautilus preferences.
2001-02-08 Michael K. Fleming <mfleming@eazel.com>
reviewed by: <ramiro@eazel.com>
......
......@@ -128,6 +128,9 @@ typedef enum
NAUTILUS_SIMPLE_SEARCH_BAR
} NautilusSearchBarMode;
/* Gnome session management */
#define NAUTILUS_PREFERENCES_ADD_TO_SESSION "preferences/add_to_session"
void nautilus_global_preferences_initialize (void);
void nautilus_global_preferences_show_dialog (void);
void nautilus_global_preferences_hide_dialog (void);
......
......@@ -128,6 +128,9 @@ typedef enum
NAUTILUS_SIMPLE_SEARCH_BAR
} NautilusSearchBarMode;
/* Gnome session management */
#define NAUTILUS_PREFERENCES_ADD_TO_SESSION "preferences/add_to_session"
void nautilus_global_preferences_initialize (void);
void nautilus_global_preferences_show_dialog (void);
void nautilus_global_preferences_hide_dialog (void);
......
......@@ -41,9 +41,11 @@
#include <bonobo/bonobo-main.h>
#include <bonobo/bonobo-object.h>
#include <gtk/gtksignal.h>
#include <libgnome/gnome-config.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-util.h>
#include <libgnomeui/gnome-messagebox.h>
#include <libgnomeui/gnome-client.h>
#include <libgnomeui/gnome-stock.h>
#include <libgnomevfs/gnome-vfs-uri.h>
#include <libnautilus-extensions/nautilus-file-utilities.h>
......@@ -83,7 +85,7 @@ static void volume_mounted_callback (NautilusVolumeMonito
static void volume_unmounted_callback (NautilusVolumeMonitor *monitor,
NautilusVolume *volume,
NautilusApplication *application);
static void init_session (void);
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusApplication, nautilus_application, BONOBO_OBJECT_TYPE)
......@@ -494,6 +496,9 @@ nautilus_application_startup (NautilusApplication *application,
} else if (!no_default_window) {
Nautilus_Shell_open_default_window (shell, corba_geometry, &ev);
}
/* Add ourselves to the session */
init_session ();
}
/* We're done with the shell now, so let it go. */
......@@ -734,3 +739,42 @@ volume_unmounted_callback (NautilusVolumeMonitor *monitor, NautilusVolume *volum
g_list_free (close_list);
}
static void
removed_from_session (GnomeClient *client, gpointer data)
{
nautilus_main_event_loop_quit ();
}
static gint
save_session (GnomeClient *client, gint phase, GnomeSaveStyle save_style, gint shutdown,
GnomeInteractStyle interact_style, gint fast, gpointer data)
{
return TRUE;
}
static void
set_session_restart (GnomeClient *client, gboolean restart)
{
gnome_client_set_priority (client, 40);
gnome_client_set_restart_style (client, (restart ? GNOME_RESTART_IMMEDIATELY : GNOME_RESTART_NEVER));
}
static void
init_session (void)
{
GnomeClient *client;
client = gnome_master_client ();
gtk_signal_connect (GTK_OBJECT (client), "save_yourself",
(GtkSignalFunc) save_session,
NULL);
gtk_signal_connect (GTK_OBJECT (client), "die",
(GtkSignalFunc) removed_from_session,
NULL);
set_session_restart (client, nautilus_preferences_get_boolean (NAUTILUS_PREFERENCES_ADD_TO_SESSION));
}
......@@ -139,7 +139,6 @@ static void initiate_file_download (GnomeDruid *druid);
static gboolean set_http_proxy (const char *proxy_url);
static gboolean attempt_http_proxy_autoconfigure (void);
static gboolean check_network_connectivity (void);
static void add_nautilus_to_session (void);
static void convert_gmc_desktop_icons (void);
......@@ -239,11 +238,7 @@ druid_finished (GtkWidget *druid_page)
/* Do the GMC to Nautilus Transition */
nautilus_preferences_set_boolean (NAUTILUS_PREFERENCES_SHOW_DESKTOP, draw_desktop);
if (add_to_session) {
add_nautilus_to_session ();
}
nautilus_preferences_set_boolean (NAUTILUS_PREFERENCES_ADD_TO_SESSION, add_to_session);
if (transfer_gmc_icons) {
convert_gmc_desktop_icons ();
}
......@@ -804,12 +799,6 @@ next_proxy_configuration_page_callback (GtkWidget *button, GnomeDruid *druid)
return TRUE;
}
static void
add_nautilus_to_session (void)
{
}
static void
convert_gmc_desktop_icons (void)
{
......@@ -906,7 +895,11 @@ set_up_gmc_transition_page (NautilusDruidPageEazel *page)
gtk_box_pack_start (GTK_BOX (main_box), checkbox, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbox), TRUE);
gtk_signal_connect (GTK_OBJECT (checkbox), "toggled", GTK_SIGNAL_FUNC (transition_value_changed), &add_to_session);
draw_desktop = TRUE;
add_to_session = TRUE;
transfer_gmc_icons = TRUE;
gtk_widget_show_all (main_box);
}
......@@ -1241,7 +1234,6 @@ set_http_proxy (const char *proxy_url)
}
/* set the "http_proxy" environment variable */
nautilus_setenv ("http_proxy", proxy_url, TRUE);
/* The variable is expected to be in the form host:port */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment