Beispiel #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));
        }
Beispiel #2
0
 public ItemAction(BrowsablePointer pointer,
                   string name,
                   string label,
                   string tooltip,
                   string stock_id) : base(name, label, tooltip, stock_id)
 {
     tips.Enable();
     item          = pointer;
     item.Changed += ItemChanged;
 }
Beispiel #3
0
        public ReferenceTreeViewer()
        {
            Build();
            store                     = new Gtk.TreeStore(typeof(object), typeof(string), typeof(string), typeof(bool), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string));
            treeview.Model            = store;
            treeview.HeadersClickable = true;

            Gtk.TreeViewColumn complete_column = new Gtk.TreeViewColumn();
            complete_column.Title     = "Type";
            complete_column.Resizable = true;

            Gtk.CellRendererPixbuf pix_render = new Gtk.CellRendererPixbuf();
            complete_column.PackStart(pix_render, false);
            complete_column.AddAttribute(pix_render, "stock-id", ImageCol);

            Gtk.CellRendererText text_render = new Gtk.CellRendererText();
            complete_column.PackStart(text_render, true);

            complete_column.AddAttribute(text_render, "text", TypeCol);
            complete_column.Clickable = true;

            treeview.AppendColumn(complete_column);

            AddColumn("Instances", InstancesCol, "Number of instances of a type. Only instances that contain references are included.");
            TreeColRefs = treeview.Columns.Length;
            AddColumn("References", RefsCol, "Number of references to the parent type.");
            AddColumn("Root Refs", RootRefsCol, "Number of indirect references to instances of the tree root type.");
            AddColumn("Root Mem", RootMemCol, "Amount of memory of the root instances indirectly referenced.");
            AddColumn("Memory Size", SizeCol, "Memory allocated by instances of the type.");
            AddColumn("Avg. Size", AvgSizeCol, "Average size of the instances.");

            treeview.TestExpandRow += new Gtk.TestExpandRowHandler(OnTestExpandRow);
            treeview.RowActivated  += new Gtk.RowActivatedHandler(OnNodeActivated);
//			treeview.AppendColumn (new Gtk.TreeViewColumn());

            int nc = 0;

            foreach (TreeViewColumn c in treeview.Columns)
            {
                store.SetSortFunc(nc, CompareNodes);
                c.SortColumnId = nc++;
            }
            store.SetSortColumnId(1, Gtk.SortType.Descending);
            treeview.RulesHint = true;
            tips.Enable();
        }
Beispiel #4
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));
		}
        void requestnewgridregion()
        {
            cx = 0;
            cy = 0;

            Gtk.Application.Invoke(delegate{

                for (int x = 0; x < 9; x++)
                {
                    regions[x] = new OpenMetaverse.GridRegion();
                    regions[x].Name = "";
                    maps[x].SetAsWater();
                    Gtk.Tooltips name = new Gtk.Tooltips();
                    name.SetTip(maps[x], "Empty", "");
                    name.Enable();
                }

                Logger.Log("Requesting map region for current region",Helpers.LogLevel.Debug);
                requested = true;
                MainClass.client.Grid.RequestMapRegion(MainClass.client.Network.CurrentSim.Name, GridLayerType.Objects);

            });
        }
        void MainClass_onRegister()
        {
            requested = false;

            for (int x = 0; x < 9; x++)
            {
                maps[x].SetAsWater();
                regions[x] = new OpenMetaverse.GridRegion();
                regions[x].Name = "";

                Gtk.Tooltips name = new Gtk.Tooltips();
                name.SetTip(maps[x], "Empty", "");
                name.Enable();
            }

            MainClass.client.Network.SimChanged += new EventHandler<SimChangedEventArgs>(Network_SimChanged);
            MainClass.client.Grid.GridRegion += new EventHandler<GridRegionEventArgs>(Grid_GridRegion);
        }
        void Grid_GridRegion(object sender, GridRegionEventArgs e)
        {
            lock (MainClass.win.grid_regions)
            {
                if (!MainClass.win.grid_regions.ContainsKey(e.Region.RegionHandle))
                {
                    MainClass.win.grid_regions.Add(e.Region.RegionHandle, e.Region);
                }
            }

            Gtk.Application.Invoke(delegate {

            Logger.Log("Got grid region for :"+e.Region.Name+" ("+e.Region.RegionHandle.ToString()+")", Helpers.LogLevel.Debug);

            if (e.Region.RegionHandle == MainClass.client.Network.CurrentSim.Handle && requested==true)
            {
                requested = false;
                cx = (uint)e.Region.X;
                cy = (uint)e.Region.Y;
                Logger.Log("Requesting neighbour grid "+(e.Region.X - 1).ToString()+","+(e.Region.Y - 1).ToString()+(e.Region.X + 1).ToString()+(e.Region.Y + 1).ToString(), Helpers.LogLevel.Debug);
                MainClass.client.Grid.RequestMapBlocks(GridLayerType.Objects, (ushort)(e.Region.X - 1), (ushort)(e.Region.Y - 1), (ushort)(e.Region.X + 1), (ushort)(e.Region.Y + 1), false);
            }

            int col = (int)2 - (((int)cx + (int)1) - (int)e.Region.X); //FFS
            int row = (((int)cy + (int)1) - (int)e.Region.Y);

            if (row < 0 || row > 2)
                return;
            if (col < 0 || col > 2)
                return;

            Logger.Log("We found ("+row.ToString()+","+col.ToString()+")",Helpers.LogLevel.Debug);

            int index = (row * 3) + col;

            Gtk.Tooltips name = new Gtk.Tooltips();
            name.SetTip(maps[index], e.Region.Name, "");
            name.Enable();
            regions[index]=e.Region;

            maps[index].SetGridRegion( e.Region.RegionHandle);

            });
        }
Beispiel #8
0
        public SearchWindow(ISearch search) : base(WindowType.Toplevel)
        {
            this.search = search;

            base.Title         = Catalog.GetString("Desktop Search");
            base.Icon          = WidgetFu.LoadThemeIcon("system-search", 16);
            base.DefaultWidth  = 700;
            base.DefaultHeight = 550;
            base.DeleteEvent  += OnWindowDelete;

            VBox vbox = new VBox();

            vbox.Spacing = 3;

            uim = new UIManager(this);
            uim.DomainChanged += OnDomainChanged;
            uim.SortChanged   += OnSortChanged;
            uim.ToggleDetails += OnToggleDetails;
            uim.ShowQuickTips += OnShowQuickTips;
            uim.ShowIndexInfo += OnShowIndexInfo;
            uim.StartDaemon   += OnStartDaemon;
            uim.StopDaemon    += OnStopDaemon;
            vbox.PackStart(uim.MenuBar, false, false, 0);

            HBox hbox = new HBox(false, 6);

            Label label = new Label(Catalog.GetString("_Find in:"));

            hbox.PackStart(label, false, false, 0);

            scope_list = ComboBox.NewText();
            foreach (ScopeMapping mapping in scope_mappings)
            {
                scope_list.AppendText(mapping.label);
            }
            scope_list.Active = 0;

            scope_list.Changed += new EventHandler(delegate(object o, EventArgs args) {
                ComboBox combo = o as ComboBox;
                if (o == null)
                {
                    return;
                }
                int active = combo.Active;
                Log.Debug("Scope changed: {0} maps to '{1}'", combo.ActiveText, scope_mappings [active].query_mapping);
                Query(true);
            });
            hbox.PackStart(scope_list, false, false, 0);

            entry            = new Entry();
            entry.Activated += OnEntryActivated;
            hbox.PackStart(entry, true, true, 0);

            label.MnemonicWidget  = entry;
            uim.FocusSearchEntry += delegate() { entry.GrabFocus(); };

            // The auto search after timeout feauture is now optional
            // and can be disabled.

            if (Conf.BeagleSearch.GetOption(Conf.Names.BeagleSearchAutoSearch, true))
            {
                entry.Changed    += OnEntryResetTimeout;
                entry.MoveCursor += OnEntryResetTimeout;
            }

            button = new Gtk.Button();
            Gtk.HBox  button_hbox = new Gtk.HBox(false, 2);
            Gtk.Image icon        = new Gtk.Image(Gtk.Stock.Find, Gtk.IconSize.Button);
            button_hbox.PackStart(icon, false, false, 0);
            label = new Gtk.Label(Catalog.GetString("Find Now"));
            button_hbox.PackStart(label, false, false, 0);
            button.Add(button_hbox);
            button.Clicked += OnButtonClicked;

            Gtk.VBox buttonVBox = new Gtk.VBox(false, 0);
            buttonVBox.PackStart(button, true, false, 0);
            hbox.PackStart(buttonVBox, false, false, 0);

            spinner = new Spinner();
            hbox.PackStart(spinner, false, false, 0);

            HBox padding_hbox = new HBox();

            padding_hbox.PackStart(hbox, true, true, 9);
            vbox.PackStart(padding_hbox, false, true, 6);

            VBox view_box = new VBox(false, 3);

            vbox.PackStart(view_box, true, true, 0);

            HBox na_padding = new HBox();

            view_box.PackStart(na_padding, false, true, 0);

            notification_area = new NotificationArea();
            na_padding.PackStart(notification_area, true, true, 3);

            pages             = new Gtk.Notebook();
            pages.ShowTabs    = false;
            pages.ShowBorder  = false;
            pages.BorderWidth = 3;
            view_box.PackStart(pages, true, true, 0);

            quicktips = new Pages.QuickTips();
            quicktips.Show();
            pages.Add(quicktips);

            indexinfo = new Pages.IndexInfo();
            indexinfo.Show();
            pages.Add(indexinfo);

            rootuser = new Pages.RootUser();
            rootuser.Show();
            pages.Add(rootuser);

            startdaemon = new Pages.StartDaemon();
            startdaemon.DaemonStarted += OnDaemonStarted;
            startdaemon.Show();
            pages.Add(startdaemon);

            panes = new Beagle.Search.Panes();
            panes.Show();
            pages.Add(panes);

            view = new GroupView();
            view.TileSelected += ShowInformation;
            panes.MainContents = view;

            this.statusbar = new Gtk.Statusbar();
            vbox.PackEnd(this.statusbar, false, false, 0);

            Add(vbox);

            tips = new Gtk.Tooltips();
            tips.SetTip(entry, Catalog.GetString("Type in search terms"), "");
            tips.SetTip(button, Catalog.GetString("Start searching"), "");
            tips.Enable();

            if (Environment.UserName == "root" && !Conf.Daemon.GetOption(Conf.Names.AllowRoot, false))
            {
                pages.CurrentPage = pages.PageNum(rootuser);
                entry.Sensitive   = button.Sensitive = uim.Sensitive = false;
            }
            else
            {
                pages.CurrentPage = pages.PageNum(quicktips);
            }

            entry.GrabFocus();
            StartCheckingIndexingStatus();
        }
Beispiel #9
0
		public SearchWindow (ISearch search) : base (WindowType.Toplevel)
		{
			this.search = search;

			base.Title = Catalog.GetString ("Desktop Search");
			base.Icon = WidgetFu.LoadThemeIcon ("system-search", 16);
			base.DefaultWidth = 700;
			base.DefaultHeight = 550;
			base.DeleteEvent += OnWindowDelete;
			
			VBox vbox = new VBox ();
			vbox.Spacing = 3;

			uim = new UIManager (this);
			uim.DomainChanged += OnDomainChanged;
			uim.SortChanged += OnSortChanged;
			uim.ToggleDetails += OnToggleDetails;
			uim.ShowQuickTips += OnShowQuickTips;
			uim.ShowIndexInfo += OnShowIndexInfo;
			uim.StartDaemon += OnStartDaemon;
			uim.StopDaemon += OnStopDaemon;
			vbox.PackStart (uim.MenuBar, false, false, 0);

			HBox hbox = new HBox (false, 6);
			
			Label label = new Label (Catalog.GetString ("_Find in:"));
			hbox.PackStart (label, false, false, 0);
			
			scope_list = ComboBox.NewText ();
			foreach (ScopeMapping mapping in scope_mappings)
				scope_list.AppendText (mapping.label);
			scope_list.Active = 0;

			scope_list.Changed += new EventHandler (delegate (object o, EventArgs args) {
									ComboBox combo = o as ComboBox;
									if (o == null)
										return;
									int active = combo.Active;
									Log.Debug ("Scope changed: {0} maps to '{1}'", combo.ActiveText, scope_mappings [active].query_mapping);
									Query (true);
								});
			hbox.PackStart (scope_list, false, false, 0);

			entry = new Entry ();
			entry.Activated += OnEntryActivated;
			hbox.PackStart (entry, true, true, 0);

			label.MnemonicWidget = entry;
			uim.FocusSearchEntry += delegate () { entry.GrabFocus (); };

			// The auto search after timeout feauture is now optional
			// and can be disabled.

			if (Conf.BeagleSearch.GetOption (Conf.Names.BeagleSearchAutoSearch, true)) {
				entry.Changed += OnEntryResetTimeout;
				entry.MoveCursor += OnEntryResetTimeout;
			}

			button = new Gtk.Button ();
			Gtk.HBox button_hbox = new Gtk.HBox (false, 2);
			Gtk.Image icon = new Gtk.Image (Gtk.Stock.Find, Gtk.IconSize.Button);
			button_hbox.PackStart (icon, false, false, 0);
			label = new Gtk.Label (Catalog.GetString ("Find Now"));
			button_hbox.PackStart (label, false, false, 0);
			button.Add (button_hbox);
			button.Clicked += OnButtonClicked;

			Gtk.VBox buttonVBox = new Gtk.VBox (false, 0);
			buttonVBox.PackStart (button, true, false, 0);
			hbox.PackStart (buttonVBox, false, false, 0);

			spinner = new Spinner ();
			hbox.PackStart (spinner, false, false, 0);

			HBox padding_hbox = new HBox ();
			padding_hbox.PackStart (hbox, true, true, 9);
			vbox.PackStart (padding_hbox, false, true, 6);

			VBox view_box = new VBox (false, 3);
			vbox.PackStart (view_box, true, true, 0);

			HBox na_padding = new HBox ();
			view_box.PackStart (na_padding, false, true, 0);

			notification_area = new NotificationArea ();
			na_padding.PackStart (notification_area, true, true, 3);

			pages = new Gtk.Notebook ();
			pages.ShowTabs = false;
			pages.ShowBorder = false;
			pages.BorderWidth = 3;
			view_box.PackStart (pages, true, true, 0);

			quicktips = new Pages.QuickTips ();
			quicktips.Show ();
			pages.Add (quicktips);

			indexinfo = new Pages.IndexInfo ();
			indexinfo.Show ();
			pages.Add (indexinfo);

			rootuser = new Pages.RootUser ();
			rootuser.Show ();
			pages.Add (rootuser);

			startdaemon = new Pages.StartDaemon ();
			startdaemon.DaemonStarted += OnDaemonStarted;
			startdaemon.Show ();
			pages.Add (startdaemon);

			panes = new Beagle.Search.Panes ();
			panes.Show ();
			pages.Add (panes);

			view = new GroupView ();
			view.TileSelected += ShowInformation;
			panes.MainContents = view;

			this.statusbar = new Gtk.Statusbar ();
			vbox.PackEnd (this.statusbar, false, false, 0);
			
			Add (vbox);

			tips = new Gtk.Tooltips ();
			tips.SetTip (entry, Catalog.GetString ("Type in search terms"), "");
			tips.SetTip (button, Catalog.GetString ("Start searching"), "");
			tips.Enable ();

			if (Environment.UserName == "root" && !Conf.Daemon.GetOption (Conf.Names.AllowRoot, false)) {
				pages.CurrentPage = pages.PageNum (rootuser);
				entry.Sensitive = button.Sensitive = uim.Sensitive = false;
			} else {
				pages.CurrentPage = pages.PageNum (quicktips);
			}

			entry.GrabFocus ();
			StartCheckingIndexingStatus ();
		}
Beispiel #10
0
        public QueryWidget(PhotoQuery query, Db db, TagSelectionWidget selector) : base(new HBox())
        {
            box             = Child as HBox;
            box.Spacing     = 6;
            box.BorderWidth = 2;

            tips.Enable();

            this.query     = query;
            query.Changed += HandleChanged;

            label = new Gtk.Label(Catalog.GetString("Find: "));
            label.Show();
            label.Ypad = 9;
            box.PackStart(label, false, false, 0);

            untagged         = new Gtk.Label(Catalog.GetString("Untagged photos"));
            untagged.Visible = false;
            box.PackStart(untagged, false, false, 0);

            comma1_label         = new Gtk.Label(", ");
            comma1_label.Visible = false;
            box.PackStart(comma1_label, false, false, 0);

            rated         = new Gtk.Label(Catalog.GetString("Rated photos"));
            rated.Visible = false;
            box.PackStart(rated, false, false, 0);

            comma2_label         = new Gtk.Label(", ");
            comma2_label.Visible = false;
            box.PackStart(comma2_label, false, false, 0);

            // Note for translators: 'Import roll' is no command, it means 'Roll that has been imported'
            rollfilter         = new Gtk.Label(Catalog.GetString("Import roll"));
            rollfilter.Visible = false;
            box.PackStart(rollfilter, false, false, 0);

            logic_widget = new LogicWidget(query, db.Tags, selector);
            logic_widget.Show();
            box.PackStart(logic_widget, true, true, 0);

            warning_box = new Gtk.HBox();
            warning_box.PackStart(new Gtk.Label(System.String.Empty));

            Gtk.Image warning_image = new Gtk.Image("gtk-info", Gtk.IconSize.Button);
            warning_image.Show();
            warning_box.PackStart(warning_image, false, false, 0);

            clear_button = new Gtk.Button();
            clear_button.Add(new Gtk.Image("gtk-close", Gtk.IconSize.Button));
            clear_button.Clicked += HandleClearButtonClicked;
            clear_button.Relief   = Gtk.ReliefStyle.None;
            box.PackEnd(clear_button, false, false, 0);
            tips.SetTip(clear_button, Catalog.GetString("Clear search"), null);

            refresh_button = new Gtk.Button();
            refresh_button.Add(new Gtk.Image("gtk-refresh", Gtk.IconSize.Button));
            refresh_button.Clicked += HandleRefreshButtonClicked;
            refresh_button.Relief   = Gtk.ReliefStyle.None;
            box.PackEnd(refresh_button, false, false, 0);
            tips.SetTip(refresh_button, Catalog.GetString("Refresh search"), null);

            Gtk.Label warning = new Gtk.Label(Catalog.GetString("No matching photos found"));
            warning_box.PackStart(warning, false, false, 0);
            warning_box.ShowAll();
            warning_box.Spacing = 6;
            warning_box.Visible = false;

            box.PackEnd(warning_box, false, false, 0);

            warning_box.Visible = false;
        }