Example #1
0
		public void Query (string query_text)
		{
			if (icon_enabled) {
				if (!String.IsNullOrEmpty (query_text))
					icon_window.Search (query_text);

				icon_window.ShowAll ();
			} else {
				SearchWindow window = new SearchWindow (this);
				window.DeleteEvent += OnWindowDeleteEvent;
				
				if (!String.IsNullOrEmpty (query_text))
					window.Search (query_text);

				window.ShowAll ();
				ref_count++;
			}
		}
Example #2
0
		public Search (bool icon_enabled, bool docs_enabled)
		{
			this.icon_enabled = icon_enabled;
			this.docs_enabled = docs_enabled;

			if (icon_enabled) {
				icon_window = new SearchWindow (this);
				icon_window.QueryEvent += OnQueryEvent;

				tray = new TrayIcon ();
				tray.Clicked += OnTrayActivated;
				tray.Search += OnTraySearch;
				tray.Quit += OnTrayQuit;

				Config config = Conf.Get (Conf.Names.BeagleSearchConfig);
				keybinder = new XKeybinder ();
				SetKeyBindings (config);

				Inotify.Start ();
				Conf.WatchForUpdates();
				Conf.Subscribe (Conf.Names.BeagleSearchConfig, OnConfigurationChanged);
			}
		}
Example #3
0
        public Search(bool icon_enabled, bool docs_enabled)
        {
            this.icon_enabled = icon_enabled;
            this.docs_enabled = docs_enabled;

            if (icon_enabled)
            {
                icon_window             = new SearchWindow(this);
                icon_window.QueryEvent += OnQueryEvent;

                tray          = new TrayIcon();
                tray.Clicked += OnTrayActivated;
                tray.Search  += OnTraySearch;
                tray.Quit    += OnTrayQuit;

                Config config = Conf.Get(Conf.Names.BeagleSearchConfig);
                keybinder = new XKeybinder();
                SetKeyBindings(config);

                Inotify.Start();
                Conf.WatchForUpdates();
                Conf.Subscribe(Conf.Names.BeagleSearchConfig, OnConfigurationChanged);
            }
        }
Example #4
0
		public UIManager (SearchWindow search)
		{
			this.search = search;
			this.actions = new ActionGroup ("Actions");

			ActionEntry quit_action_entry;

			if (search.IconEnabled) {
				quit_action_entry = new ActionEntry ("Quit", Gtk.Stock.Close,
								     null, "<control>Q",
						 		     Catalog.GetString ("Close Desktop Search"),
						 		     Quit);
			} else {
				quit_action_entry = new ActionEntry ("Quit", Gtk.Stock.Quit,
								     null, "<control>Q",
						 		     Catalog.GetString ("Exit Desktop Search"),
						 		     Quit);

			}

			Gtk.ActionEntry[] entries = new ActionEntry[] {
				new ActionEntry ("Search", null,
						 Catalog.GetString ("_Search"),
						 null, null, null),
				new ActionEntry ("Domain", null,
						 Catalog.GetString ("Search _Domains"),
						 null, null, null),
				new ActionEntry ("Actions", null,
						 Catalog.GetString ("_Actions"),
						 null, null, null),
				new ActionEntry ("View", null,
						 Catalog.GetString ("_View"),
						 null, null, null),
				new ActionEntry ("Service", null,
						 Catalog.GetString ("Service _Options"),
						 null, null, null),
				new ActionEntry ("Help", null,
						 Catalog.GetString ("_Help"),
						 null, null, null),
				quit_action_entry,
				new ActionEntry ("Preferences", Gtk.Stock.Preferences,
						 null, null,
						 Catalog.GetString ("Exit Desktop Search"),
						 Preferences),
				new ActionEntry ("StartService", Gtk.Stock.Execute,
						 Catalog.GetString ("Start service"),
						 null, null, StartService),
				new ActionEntry ("StopService", Gtk.Stock.Stop,
						 Catalog.GetString ("Stop service"),
						 null, null, StopService),
				new ActionEntry ("IndexInfo", Gtk.Stock.Index,
						 Catalog.GetString ("Index information"),
						 null, null, IndexInfo),
				new ActionEntry ("Contents", Gtk.Stock.Help,
						 Catalog.GetString ("_Contents"),
						 "F1",
						 Catalog.GetString ("Help - Table of Contents"),
						 Help),
				new ActionEntry ("About", Gnome.Stock.About,
						 null, null,
						 Catalog.GetString ("About Desktop Search"),
						 About),
				new ActionEntry ("QuickTips", null,
						 Catalog.GetString ("Quick Tips"),
						 null, null, QuickTips),
				new ActionEntry ("FocusSearchEntry", null, "",
						 "<control>K", null,
						 OnFocusSearchEntry),
				new ActionEntry ("FocusSearchEntry2", null, "",
						 "<control>L", null,
						 OnFocusSearchEntry),
				new ActionEntry ("HideWindow", null, "",
						 "Escape", null,
						 OnHideWindow),
				new ActionEntry ("HideWindow2", null, "",
						 "<control>W", null,
						 OnHideWindow)
			};
			actions.Add (entries);

			sort_entries = new RadioActionEntry[] {
				new RadioActionEntry ("SortModified", null,
						      Catalog.GetString ("Sort by Date _Modified"), null,
						      Catalog.GetString ("Sort the most-recently-modified matches first"),
						      (int)SortType.Modified),
				new RadioActionEntry ("SortName", null,
						      Catalog.GetString ("Sort by _Name"), null,
						      Catalog.GetString ("Sort matches by name"),
						      (int)SortType.Name),
				new RadioActionEntry ("SortRelevance", null,
						      Catalog.GetString ("Sort by _Relevance"), null,
						      Catalog.GetString ("Sort the best matches first"),
						      (int)SortType.Relevance),
			};
			actions.Add (sort_entries, (int)SortType.Modified, OnSortChanged);

			domain_entries = new ToggleActionEntry [] {
				new ToggleActionEntry ("Local", null,
						       Catalog.GetString ("_Local"),
						       null,
						       Catalog.GetString ("Search in personal data in this computer"), /* personal files, emails */
						       OnDomainChanged,
						       true),
				new ToggleActionEntry ("System", null,
						       Catalog.GetString ("_System"),
						       null,
						       Catalog.GetString ("Search in system data on this computer"), /* system manpages, applications */
						       OnDomainChanged,
						       true),
				new ToggleActionEntry ("Global", null,
						       Catalog.GetString ("_Global"),
						       null,
						       Catalog.GetString ("Search in internet services"), /* gmail and other web services */
						       OnDomainChanged,
						       false),
				new ToggleActionEntry ("Neighborhood", null,
						       Catalog.GetString ("_Neighborhood"),
						       null,
						       Catalog.GetString ("Search on computers near me"), /* remote beagle services */
						       OnDomainChanged,
						       false)
			};
			actions.Add (domain_entries);

			view_entries = new ToggleActionEntry[] {
				new ToggleActionEntry ("ShowDetails", null,
						       Catalog.GetString ("Show Details"), null, null,
						       OnToggleDetails, true)
			};
			actions.Add (view_entries);

			InsertActionGroup (actions, 0);
			search.AddAccelGroup (AccelGroup);
			AddUiFromString (ui_def);
		}
Example #5
0
        public UIManager(SearchWindow search)
        {
            this.search  = search;
            this.actions = new ActionGroup("Actions");

            ActionEntry quit_action_entry;

            if (search.IconEnabled)
            {
                quit_action_entry = new ActionEntry("Quit", Gtk.Stock.Close,
                                                    null, "<control>Q",
                                                    Catalog.GetString("Close Desktop Search"),
                                                    Quit);
            }
            else
            {
                quit_action_entry = new ActionEntry("Quit", Gtk.Stock.Quit,
                                                    null, "<control>Q",
                                                    Catalog.GetString("Exit Desktop Search"),
                                                    Quit);
            }

            Gtk.ActionEntry[] entries = new ActionEntry[] {
                new ActionEntry("Search", null,
                                Catalog.GetString("_Search"),
                                null, null, null),
                new ActionEntry("Domain", null,
                                Catalog.GetString("Search _Domains"),
                                null, null, null),
                new ActionEntry("Actions", null,
                                Catalog.GetString("_Actions"),
                                null, null, null),
                new ActionEntry("View", null,
                                Catalog.GetString("_View"),
                                null, null, null),
                new ActionEntry("Service", null,
                                Catalog.GetString("Service _Options"),
                                null, null, null),
                new ActionEntry("Help", null,
                                Catalog.GetString("_Help"),
                                null, null, null),
                quit_action_entry,
                new ActionEntry("Preferences", Gtk.Stock.Preferences,
                                null, null,
                                Catalog.GetString("Exit Desktop Search"),
                                Preferences),
                new ActionEntry("StartService", Gtk.Stock.Execute,
                                Catalog.GetString("Start service"),
                                null, null, StartService),
                new ActionEntry("StopService", Gtk.Stock.Stop,
                                Catalog.GetString("Stop service"),
                                null, null, StopService),
                new ActionEntry("IndexInfo", Gtk.Stock.Index,
                                Catalog.GetString("Index information"),
                                null, null, IndexInfo),
                new ActionEntry("Contents", Gtk.Stock.Help,
                                Catalog.GetString("_Contents"),
                                "F1",
                                Catalog.GetString("Help - Table of Contents"),
                                Help),
                new ActionEntry("About", Gnome.Stock.About,
                                null, null,
                                Catalog.GetString("About Desktop Search"),
                                About),
                new ActionEntry("QuickTips", null,
                                Catalog.GetString("Quick Tips"),
                                null, null, QuickTips),
                new ActionEntry("FocusSearchEntry", null, "",
                                "<control>K", null,
                                OnFocusSearchEntry),
                new ActionEntry("FocusSearchEntry2", null, "",
                                "<control>L", null,
                                OnFocusSearchEntry),
                new ActionEntry("HideWindow", null, "",
                                "Escape", null,
                                OnHideWindow),
                new ActionEntry("HideWindow2", null, "",
                                "<control>W", null,
                                OnHideWindow)
            };
            actions.Add(entries);

            sort_entries = new RadioActionEntry[] {
                new RadioActionEntry("SortModified", null,
                                     Catalog.GetString("Sort by Date _Modified"), null,
                                     Catalog.GetString("Sort the most-recently-modified matches first"),
                                     (int)SortType.Modified),
                new RadioActionEntry("SortName", null,
                                     Catalog.GetString("Sort by _Name"), null,
                                     Catalog.GetString("Sort matches by name"),
                                     (int)SortType.Name),
                new RadioActionEntry("SortRelevance", null,
                                     Catalog.GetString("Sort by _Relevance"), null,
                                     Catalog.GetString("Sort the best matches first"),
                                     (int)SortType.Relevance),
            };
            actions.Add(sort_entries, (int)SortType.Modified, OnSortChanged);

            domain_entries = new ToggleActionEntry [] {
                new ToggleActionEntry("Local", null,
                                      Catalog.GetString("_Local"),
                                      null,
                                      Catalog.GetString("Search in personal data in this computer"),                   /* personal files, emails */
                                      OnDomainChanged,
                                      true),
                new ToggleActionEntry("System", null,
                                      Catalog.GetString("_System"),
                                      null,
                                      Catalog.GetString("Search in system data on this computer"),                   /* system manpages, applications */
                                      OnDomainChanged,
                                      true),
                new ToggleActionEntry("Global", null,
                                      Catalog.GetString("_Global"),
                                      null,
                                      Catalog.GetString("Search in internet services"),                   /* gmail and other web services */
                                      OnDomainChanged,
                                      false),
                new ToggleActionEntry("Neighborhood", null,
                                      Catalog.GetString("_Neighborhood"),
                                      null,
                                      Catalog.GetString("Search on computers near me"),                   /* remote beagle services */
                                      OnDomainChanged,
                                      false)
            };
            actions.Add(domain_entries);

            view_entries = new ToggleActionEntry[] {
                new ToggleActionEntry("ShowDetails", null,
                                      Catalog.GetString("Show Details"), null, null,
                                      OnToggleDetails, true)
            };
            actions.Add(view_entries);

            InsertActionGroup(actions, 0);
            search.AddAccelGroup(AccelGroup);
            AddUiFromString(ui_def);
        }