Re: [PATCH] enable nautilus to run as a daemon without any window created
- From: Alexander Larsson <alexl redhat com>
- To: JF Ding <jfding gmail com>
- Cc: nautilus-list gnome org
- Subject: Re: [PATCH] enable nautilus to run as a daemon without any window created
- Date: Mon, 20 Apr 2009 15:01:11 +0200
On Mon, 2009-04-20 at 15:10 +0800, JF Ding wrote:
> Hi list,
> Recently I have added one new feature to nautilus in my local
> branch: run nautilus as a daemon without any
> window created (file explorer or desktop) and can monitor media
> automount events.
> As we know, nautilus cannot startup with both --no-desktop and
> --no-default-window options. But in the desktop
> session of our current project, we need nautilus as the default file
> manager but need not its desktop window. This
> patch is to enable this requirement.
> Also this request and patch are files to bugzilla, the link is
> http://bugzilla.gnome.org/show_bug.cgi?id=579574
+ <key>/schemas/apps/nautilus/preferences/daemon_enable</key>
+ <applyto>/apps/nautilus/preferences/daemon_enable</applyto>
+#define
NAUTILUS_PREFERENCES_DAEMON_ENABLE "preferences/daemon_enable"
A better name would be "daemon_mode"
+static gboolean allow_daemon = FALSE;
Same here, call it "daemon_mode".
@@ -139,6 +141,12 @@ nautilus_main_event_loop_quit (gboolean explicit)
while (event_loop_registrants != NULL) {
gtk_object_destroy (event_loop_registrants->data);
}
+
+ /* To quit all instances, disable daemon */
+ if (allow_daemon) {
+ allow_daemon = FALSE;
+ eel_gtk_main_quit_all ();
+ }
}
static void
Only do this if explicit is TRUE. It is always true atm, but that may
change.
+ { "daemon", '\0', 0, G_OPTION_ARG_NONE, &daemon_mode,
+ N_("Start Nautilus as a daemon for media automount."), NULL },
I don't understand why you added the command line argument. It seems to
just
complicate everything and have no additional gain. For instance, if
you pass --daemon and another nautilus is already running then you
would need to call into the running instance and tell it to enable
daemon mode. All this seems unnecessary and we should just drop the
--daemon switch.
However, you need to fix the handling of the gconf setting so that if
the setting is changed this is picked up during runtime. Easiest way
to do this is with eel_preferences_add_auto_boolean, however in this
case you probably have to use eel_preferences_add_callback since you
don't just want to update the daemon_mode boolean but also ensure that
we exit if the value goes from TRUE to FALSE when there are no windows
availible.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]