Example #1
0
        public BestTray(BestWindow bw, bool autostarted)
        {
            this.autostarted = autostarted;

            Raw = egg_tray_icon_new("Search");

            win              = bw;
            win.DeleteEvent += new DeleteEventHandler(WindowDeleteEvent);

            eventbox                   = new Gtk.EventBox();
            eventbox.CanFocus          = true;
            eventbox.ButtonPressEvent += new ButtonPressEventHandler(ButtonPress);

            Gdk.Pixbuf smalldog = Images.GetPixbuf("best.png");
            eventbox.Add(new Gtk.Image(smalldog.ScaleSimple(24, 24, Gdk.InterpType.Hyper)));

            KeyBinding binding = Conf.Searching.ShowSearchWindowBinding;

            string tooltip = String.Format("Beagle Search ({0})", binding.ToReadableString());

            tips = new Gtk.Tooltips();
            tips.SetTip(eventbox, tooltip, null);
            tips.Enable();

            Add(eventbox);
            eventbox.ShowAll();

            keybinder = new Beagle.Util.XKeybinder();
            keybinder.Bind(binding.ToString(),
                           new EventHandler(ShowBeaglePressed));
        }
Example #2
0
		public BestTray (BestWindow bw, bool autostarted)
		{
			this.autostarted = autostarted;

			Raw = egg_tray_icon_new ("Search");

			win = bw;
			win.DeleteEvent += new DeleteEventHandler (WindowDeleteEvent);
						
			eventbox = new Gtk.EventBox ();
			eventbox.CanFocus = true;
			eventbox.ButtonPressEvent += new ButtonPressEventHandler (ButtonPress);
			
			Gdk.Pixbuf smalldog = Images.GetPixbuf ("best.png");
			eventbox.Add (new Gtk.Image (smalldog.ScaleSimple (24, 24, Gdk.InterpType.Hyper)));

			KeyBinding binding = Conf.Searching.ShowSearchWindowBinding;

			string tooltip = String.Format ("Beagle Search ({0})", binding.ToReadableString ());
			tips = new Gtk.Tooltips ();
			tips.SetTip (eventbox, tooltip, null);
			tips.Enable ();
			
			Add (eventbox);
			eventbox.ShowAll ();

			keybinder = new Beagle.Util.XKeybinder ();
			keybinder.Bind (binding.ToString (),
					new EventHandler (ShowBeaglePressed));
		}
Example #3
0
        static void NoTrayWindowDeleteEvent(object o, Gtk.DeleteEventArgs args)
        {
            BestWindow win = (BestWindow)o;

            win.StoreSettingsInConf(false);
            Application.Quit();
        }
Example #4
0
		static void Main (String[] args)
		{
			ParseArgs (args);

			Program best = new Program ("best", "0.0", Modules.UI, args);

			try {
				GeckoUtils.Init ();
			} catch (DllNotFoundException) {
				// We might get this exception if there are
				// missing symbols from the Mozilla runtime if
				// the user did a Firefox 1.0 -> 1.5 upgrade.
				// There's nothing we can do about this, it's
				// an ABI change, so tell the user this is
				// probably what's wrong.
				Console.WriteLine (Catalog.GetString ("Best cannot initialize Mozilla's Gecko runtime environment.\n" +
								      "Have you upgraded Mozilla or Firefox recently?  If so, you\n" +
								      "probably need to rebuild beagle against this new version.\n" +
								      "See http://bugzilla.gnome.org/show_bug.cgi?id=326503 for\n" + 
								      "more information."));
				Environment.Exit (1);
			}

			GeckoUtils.SetSystemFonts ();

			// I18N
			Catalog.Init ("beagle", ExternalStringsHack.LocaleDir);

			// Create the window.
			BestWindow win;
			if (query != "") {
				win = new BestWindow (query);
				win.Show ();
			} else {
				win = new BestWindow ();
				if (showWindow)
					win.Show ();
			}

			// Create the tray icon.
			BestTray icon;			
			if (doTray) {
				icon = new BestTray (win, autostarted);
				icon.Show ();
				Console.WriteLine (Catalog.GetString ("If you're wondering whether Best is working check " +
						   "your notification area (system tray)"));
			} else {
				win.Show ();
				win.Present ();
				win.FocusEntry ();
				win.DeleteEvent += new Gtk.DeleteEventHandler (NoTrayWindowDeleteEvent);
			}

			best.Run ();
		}
Example #5
0
        static void Main(String[] args)
        {
            ParseArgs(args);

            Program best = new Program("best", "0.0", Modules.UI, args);

            try {
                GeckoUtils.Init();
            } catch (DllNotFoundException) {
                // We might get this exception if there are
                // missing symbols from the Mozilla runtime if
                // the user did a Firefox 1.0 -> 1.5 upgrade.
                // There's nothing we can do about this, it's
                // an ABI change, so tell the user this is
                // probably what's wrong.
                Console.WriteLine(Catalog.GetString("Best cannot initialize Mozilla's Gecko runtime environment.\n" +
                                                    "Have you upgraded Mozilla or Firefox recently?  If so, you\n" +
                                                    "probably need to rebuild beagle against this new version.\n" +
                                                    "See http://bugzilla.gnome.org/show_bug.cgi?id=326503 for\n" +
                                                    "more information."));
                Environment.Exit(1);
            }

            GeckoUtils.SetSystemFonts();

            // I18N
            Catalog.Init("beagle", ExternalStringsHack.LocaleDir);

            // Create the window.
            BestWindow win;

            if (query != "")
            {
                win = new BestWindow(query);
                win.Show();
            }
            else
            {
                win = new BestWindow();
                if (showWindow)
                {
                    win.Show();
                }
            }

            // Create the tray icon.
            BestTray icon;

            if (doTray)
            {
                icon = new BestTray(win, autostarted);
                icon.Show();
                Console.WriteLine(Catalog.GetString("If you're wondering whether Best is working check " +
                                                    "your notification area (system tray)"));
            }
            else
            {
                win.Show();
                win.Present();
                win.FocusEntry();
                win.DeleteEvent += new Gtk.DeleteEventHandler(NoTrayWindowDeleteEvent);
            }

            best.Run();
        }