3 // Bleeding Edge Search Tool: Beagle search GUI
5 // Nat Friedman <nat@novell.com>
7 // Copyright (C) 2004 Novell, Inc.
25 static public string DefaultWindowTitle
= "Beagle Search (beta)";
27 static void PrintUsageAndExit ()
30 "best: GUI interface to the Beagle search system.\n" +
31 "Web page: http://www.gnome.org/projects/beagle\n" +
32 "Copyright (C) 2004-2005 Novell, Inc.\n\n";
35 "Usage: best [OPTIONS] [<query string>]\n\n" +
37 " --no-tray\t\t\tDo not create a notification area applet.\n" +
38 " --show-window\t\t\tDisplay a search window.\n" +
39 " --help\t\t\tPrint this usage message.\n";
41 Console
.WriteLine (usage
);
43 System
.Environment
.Exit (0);
46 static string query
= "";
47 static bool doTray
= true;
48 static bool showWindow
= false;
49 static bool autostarted
= false;
51 static void ParseArgs (String
[] args
)
54 while (i
< args
.Length
) {
69 // Ignore session management
70 case "--sm-config-prefix":
71 case "--sm-client-id":
73 // These all take an argument, so
79 if (! Conf
.Searching
.Autostart
){
80 Console
.WriteLine ("Autostarting is disabled, not starting");
87 if (query
.Length
!= 0)
97 static void NoTrayWindowDeleteEvent (object o
, Gtk
.DeleteEventArgs args
)
102 static void Main (String
[] args
)
106 Program best
= new Program ("best", "0.0", Modules
.UI
, args
);
109 GeckoUtils
.SetSystemFonts ();
112 Catalog
.Init ("beagle", ExternalStringsHack
.LocaleDir
);
114 // Create the window.
117 win
= new BestWindow (query
);
120 win
= new BestWindow ();
125 // Create the tray icon.
128 icon
= new BestTray (win
, autostarted
);
130 Console
.WriteLine (Catalog
.GetString ("If you're wondering whether Best is working check " +
131 "your notification area (system tray)"));
136 win
.DeleteEvent
+= new Gtk
.DeleteEventHandler (NoTrayWindowDeleteEvent
);