Commit 6d4d325e authored by Mike Engber's avatar Mike Engber

Changed command line options: renamed --manage-destop to --start-desktop,


	* src/nautilus-application.c: (nautilus_application_startup),
	(nautilus_application_close_desktop),
	(nautilus_application_close_all_windows):
	* src/nautilus-application.h:
	* src/nautilus-first-time-druid.c: (druid_finished):
	* src/nautilus-main.c: (main):
	* src/nautilus-shell-interface.idl:
	* src/nautilus-shell.c: (nautilus_shell_get_epv),
	(corba_start_desktop), (corba_stop_desktop), (corba_quit):
	Changed command line options: renamed --manage-destop to
	--start-desktop, added --stop-desktop, added --quit. Bug#1847
	2 new corba calls for nautilus shell, one for starting the
	desktop and one for quitting.
parent d4f4026d
2000-08-02 Michael Engber <engber@eazel.com>
* src/nautilus-application.c: (nautilus_application_startup),
(nautilus_application_close_desktop),
(nautilus_application_close_all_windows):
* src/nautilus-application.h:
* src/nautilus-first-time-druid.c: (druid_finished):
* src/nautilus-main.c: (main):
* src/nautilus-shell-interface.idl:
* src/nautilus-shell.c: (nautilus_shell_get_epv),
(corba_start_desktop), (corba_stop_desktop), (corba_quit):
Changed command line options: renamed --manage-destop to
--start-desktop, added --stop-desktop, added --quit. Bug#1847
2 new corba calls for nautilus shell, one for starting the
desktop and one for quitting.
2000-08-02 John Sullivan <sullivan@eazel.com>
Fixed bug 1877 (Customize window doesn't come to front if
......
......@@ -284,7 +284,9 @@ nautilus_make_uri_list_from_strv (const char * const *strv)
gboolean
nautilus_application_startup (NautilusApplication *application,
gboolean manage_desktop,
gboolean kill_shell,
gboolean stop_desktop,
gboolean start_desktop,
const char *urls[])
{
CORBA_Environment ev;
......@@ -306,7 +308,7 @@ nautilus_application_startup (NautilusApplication *application,
*/
/* FIXME: You will get multiple druids if you invoke nautilus again. */
if (!nautilus_user_main_directory_exists ()) {
nautilus_first_time_druid_show (application, manage_desktop, urls);
nautilus_first_time_druid_show (application, start_desktop, urls);
return TRUE;
}
......@@ -404,20 +406,25 @@ nautilus_application_startup (NautilusApplication *application,
}
}
/* Set up the desktop. */
if (manage_desktop) {
Nautilus_Shell_manage_desktop (shell, &ev);
}
if (kill_shell) {
Nautilus_Shell_quit (shell, &ev);
} else {
if (start_desktop) {
Nautilus_Shell_start_desktop (shell, &ev);
}
/* Create the other windows. */
if (urls != NULL) {
url_list = nautilus_make_uri_list_from_strv (urls);
Nautilus_Shell_open_windows (shell, url_list, &ev);
CORBA_free (url_list);
}
if (stop_desktop) {
Nautilus_Shell_stop_desktop (shell, &ev);
}
if (!manage_desktop && urls == NULL) {
Nautilus_Shell_open_default_window (shell, &ev);
/* Create the other windows. */
if (urls != NULL) {
url_list = nautilus_make_uri_list_from_strv (urls);
Nautilus_Shell_open_windows (shell, url_list, &ev);
CORBA_free (url_list);
} else if (!start_desktop && !stop_desktop) {
Nautilus_Shell_open_default_window (shell, &ev);
}
}
/* We're done with the shell now, so let it go. */
......@@ -470,8 +477,11 @@ nautilus_application_open_desktop (NautilusApplication *application)
void
nautilus_application_close_desktop (void)
{
gtk_widget_destroy (GTK_WIDGET (nautilus_application_desktop));
if (nautilus_application_window_list == NULL) {
if (nautilus_application_desktop != NULL) {
gtk_widget_destroy (GTK_WIDGET (nautilus_application_desktop));
}
if (nautilus_application_window_list == NULL && gtk_main_level () > 0) {
gtk_main_quit ();
}
}
......@@ -479,7 +489,7 @@ nautilus_application_close_desktop (void)
void
nautilus_application_close_all_windows (void)
{
while (nautilus_application_window_list) {
while (nautilus_application_window_list != NULL) {
nautilus_window_close (NAUTILUS_WINDOW (nautilus_application_window_list->data));
}
}
......
......@@ -50,7 +50,9 @@ typedef struct {
GtkType nautilus_application_get_type (void);
NautilusApplication *nautilus_application_new (void);
gboolean nautilus_application_startup (NautilusApplication *application,
gboolean manage_desktop,
gboolean kill_shell,
gboolean stop_desktop,
gboolean start_desktop,
const char *urls[]);
GSList *nautilus_application_windows (void);
......
......@@ -82,10 +82,10 @@ druid_finished (GtkWidget *druid_page)
else
signup_uris[0] = "eazel:register";
signup_uris[1] = NULL;
nautilus_application_startup(save_application, save_manage_desktop, &signup_uris[0]);
nautilus_application_startup(save_application, FALSE, save_manage_desktop, FALSE, &signup_uris[0]);
} else {
nautilus_application_startup(save_application, save_manage_desktop, NULL);
nautilus_application_startup(save_application, FALSE, save_manage_desktop, FALSE, NULL);
}
}
......
......@@ -47,16 +47,24 @@
int
main (int argc, char *argv[])
{
gboolean kill_shell;
gboolean stop_desktop;
gboolean start_desktop;
gboolean perform_self_check;
gboolean manage_desktop;
poptContext popt_context;
const char **args;
CORBA_ORB orb;
NautilusApplication *application;
struct poptOption options[] = {
#ifndef NAUTILUS_OMIT_SELF_CHECK
{ "check", '\0', POPT_ARG_NONE, &perform_self_check, 0, N_("Perform high-speed self-check tests."), NULL },
#endif
{ "manage-desktop", '\0', POPT_ARG_NONE, &manage_desktop, 0, N_("Draw background and icons on desktop."), NULL },
{ "quit", '\0', POPT_ARG_NONE, &kill_shell, 0, N_("Quit Nautilus."), NULL },
{ "stop-desktop", '\0', POPT_ARG_NONE, &stop_desktop, 0, N_("Don't draw background and icons on desktop."), NULL },
{ "start-desktop", '\0', POPT_ARG_NONE, &start_desktop, 0, N_("Draw background and icons on desktop."), NULL },
{ NULL, '\0', POPT_ARG_INCLUDE_TABLE, &oaf_popt_options, 0, NULL, NULL },
POPT_AUTOHELP
{ NULL, '\0', 0, NULL, 0, NULL, NULL }
......@@ -77,11 +85,15 @@ main (int argc, char *argv[])
#endif
/* Initialize the services that we use. */
perform_self_check = FALSE;
manage_desktop = FALSE;
kill_shell = FALSE;
stop_desktop = FALSE;
start_desktop = FALSE;
perform_self_check = FALSE;
gnome_init_with_popt_table ("nautilus", VERSION,
argc, argv, options, 0,
&popt_context);
g_thread_init (NULL);
orb = oaf_init (argc, argv);
gnome_vfs_init ();
......@@ -98,15 +110,30 @@ main (int argc, char *argv[])
#endif
} else {
/* Run the nautilus application. */
application = nautilus_application_new ();
if (nautilus_application_startup (application,
manage_desktop,
poptGetArgs (popt_context))) {
bonobo_main ();
args = poptGetArgs (popt_context);
if (kill_shell && args != NULL) {
fprintf(stderr, _("nautilus: --quit cannot be used with URIs.\n"));
} else if (kill_shell && start_desktop) {
fprintf(stderr, _("nautiluls: --quit and --start-desktop cannot be used together.\n"));
} else if (stop_desktop && start_desktop) {
fprintf(stderr, _("nautiluls: --stop-desktop and --start-desktop cannot be used together.\n"));
} else {
application = nautilus_application_new ();
if (nautilus_application_startup (application,
kill_shell,
stop_desktop,
start_desktop,
args)) {
bonobo_main ();
}
bonobo_object_unref (BONOBO_OBJECT (application));
}
bonobo_object_unref (BONOBO_OBJECT (application));
poptFreeContext(popt_context);
}
gnome_vfs_shutdown ();
return EXIT_SUCCESS;
......
......@@ -11,7 +11,9 @@ module Nautilus {
interface Shell : ::Bonobo::Unknown {
oneway void open_windows (in URIList uris);
oneway void open_default_window ();
oneway void manage_desktop ();
oneway void start_desktop ();
oneway void stop_desktop ();
oneway void quit ();
};
};
......
......@@ -36,6 +36,7 @@
#include "nautilus-desktop-window.h"
#include <gtk/gtklabel.h>
#include <gtk/gtkframe.h>
#include <gtk/gtkmain.h>
#include <libgnome/gnome-i18n.h>
#include <libgnomeui/gnome-stock.h>
#include <libgnomeui/gnome-uidefs.h>
......@@ -55,7 +56,11 @@ static void corba_open_windows (PortableServer_Servant servant,
CORBA_Environment *ev);
static void corba_open_default_window (PortableServer_Servant servant,
CORBA_Environment *ev);
static void corba_manage_desktop (PortableServer_Servant servant,
static void corba_start_desktop (PortableServer_Servant servant,
CORBA_Environment *ev);
static void corba_stop_desktop (PortableServer_Servant servant,
CORBA_Environment *ev);
static void corba_quit (PortableServer_Servant servant,
CORBA_Environment *ev);
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusShell, nautilus_shell, BONOBO_OBJECT_TYPE)
......@@ -72,7 +77,9 @@ nautilus_shell_get_epv (void)
static POA_Nautilus_Shell__epv epv;
epv.open_windows = corba_open_windows;
epv.open_default_window = corba_open_default_window;
epv.manage_desktop = corba_manage_desktop;
epv.start_desktop = corba_start_desktop;
epv.stop_desktop = corba_stop_desktop;
epv.quit = corba_quit;
return &epv;
}
......@@ -256,7 +263,7 @@ corba_open_default_window (PortableServer_Servant servant,
}
static void
corba_manage_desktop (PortableServer_Servant servant,
corba_start_desktop (PortableServer_Servant servant,
CORBA_Environment *ev)
{
NautilusShell *shell;
......@@ -267,3 +274,19 @@ corba_manage_desktop (PortableServer_Servant servant,
nautilus_application_open_desktop (application);
}
static void
corba_stop_desktop (PortableServer_Servant servant,
CORBA_Environment *ev)
{
nautilus_application_close_desktop ();
}
static void
corba_quit (PortableServer_Servant servant,
CORBA_Environment *ev)
{
if (gtk_main_level () > 0) {
gtk_main_quit ();
}
}
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