2 using System
.Diagnostics
;
6 namespace Search
.Pages
{
8 public delegate void DaemonStarted ();
10 public class StartDaemon
: Base
{
12 public DaemonStarted DaemonStarted
;
14 private Gtk
.Button button
;
18 HeaderIconStock
= Stock
.DialogError
;
19 HeaderMarkup
= "<big><b>" + Catalog
.GetString ("Search service not running") + "</b></big>";
21 button
= new Gtk
.Button (Catalog
.GetString ("Start search service"));
22 button
.Clicked
+= OnStartDaemon
;
27 private void OnStartDaemon (object o
, EventArgs args
)
29 string beagled_filename
= "beagled";
31 Process daemon
= new Process ();
32 daemon
.StartInfo
.FileName
= beagled_filename
;
33 daemon
.StartInfo
.UseShellExecute
= false;
37 } catch (System
.ComponentModel
.Win32Exception e
) {
38 Console
.WriteLine ("Unable to start daemon: {0}", e
.Message
);
41 // Give the daemon some time to start
42 if (DaemonStarted
!= null)
43 GLib
.Timeout
.Add (5000, DaemonStartedTimeout
);
46 private bool DaemonStartedTimeout ()