Пример #1
0
        void ShowFileMaskUI()
        {
            if (labelFileMask != null)
            {
                return;
            }

            uint row;

            if (checkbuttonRecursively != null)
            {
                row = TableGetRowForItem(tableFindAndReplace, checkbuttonRecursively) + 1;
            }
            else
            {
                row = TableGetRowForItem(tableFindAndReplace, labelScope) + 1;
            }

            labelFileMask = new Label {
                LabelProp    = GettextCatalog.GetString("_File Mask:"),
                UseUnderline = true,
                Xalign       = 0f
            };
            labelFileMask.Show();

            searchentryFileMask = new SearchEntry()
            {
                ForceFilterButtonVisible = false,
                IsCheckMenu    = true,
                ActiveFilterID = 0,
                Visible        = true,
                Ready          = true,
            };

            var checkMenuItem = searchentryFileMask.AddFilterOption(0, GettextCatalog.GetString("Include binary files"));

            checkMenuItem.DrawAsRadio = false;
            checkMenuItem.Active      = properties.Get("IncludeBinaryFiles", false);
            checkMenuItem.Toggled    += delegate {
                properties.Set("IncludeBinaryFiles", checkMenuItem.Active);
            };

            var checkMenuItem1 = searchentryFileMask.AddFilterOption(1, GettextCatalog.GetString("Include hidden files and directories"));

            checkMenuItem1.DrawAsRadio = false;
            checkMenuItem1.Active      = properties.Get("IncludeHiddenFiles", false);
            checkMenuItem1.Toggled    += delegate {
                properties.Set("IncludeHiddenFiles", checkMenuItem1.Active);
            };

            searchentryFileMask.Query = properties.Get("MonoDevelop.FindReplaceDialogs.FileMask", "");

            searchentryFileMask.Entry.ActivatesDefault = true;
            searchentryFileMask.Show();

            SetupAccessibilityForSearch();

            TableAddRow(tableFindAndReplace, row, labelFileMask, searchentryFileMask);
        }
Пример #2
0
        private void BuildSearchEntry()
        {
            AddSearchFilter(TrackFilterType.None, String.Empty, Catalog.GetString("Artist, Album, or Title"));
            AddSearchFilter(TrackFilterType.SongName, "title", Catalog.GetString("Track Title"));
            AddSearchFilter(TrackFilterType.ArtistName, "artist", Catalog.GetString("Artist Name"));
            AddSearchFilter(TrackFilterType.AlbumArtist, "albumartist", Catalog.GetString("Album Artist"));
            AddSearchFilter(TrackFilterType.AlbumTitle, "album", Catalog.GetString("Album Title"));
            AddSearchFilter(TrackFilterType.Genre, "genre", Catalog.GetString("Genre"));
            AddSearchFilter(TrackFilterType.Year, "year", Catalog.GetString("Year"));
            AddSearchFilter(TrackFilterType.Comment, "comment", Catalog.GetString("Comment"));

            search_entry = new SearchEntry();
            search_entry.SetSizeRequest(260, -1);

            foreach (SearchFilter filter in search_filters.Values)
            {
                search_entry.AddFilterOption(filter.Id, filter.Title);
                if (filter.Id == (int)TrackFilterType.None)
                {
                    search_entry.AddFilterSeparator();
                }
            }

            search_entry.FilterChanged += OnSearchEntryFilterChanged;
            search_entry.ActivateFilter((int)TrackFilterType.None);

            OnSearchEntryFilterChanged(search_entry, EventArgs.Empty);
        }
        public WebBrowserShell(string name, WebView view) : base(2, 3, false)
        {
            this.name = name;
            this.view = view;

            RowSpacing = 5;

            view.LoadStatusChanged += (o, e) => {
                if (view.LoadStatus == OssiferLoadStatus.FirstVisuallyNonEmptyLayout)
                {
                    UpdateTitle(view.Title);

                    switch (search_clear_on_navigate_state)
                    {
                    case 1:
                        search_clear_on_navigate_state = 2;
                        break;

                    case 2:
                        search_clear_on_navigate_state = 0;
                        search_entry.Query             = String.Empty;
                        break;
                    }
                }
            };

            view.Ready += (o, e) => navigation_control.WebView = view;

            navigation_control.GoHomeEvent += (o, e) => view.GoHome();

            Attach(navigation_control, 0, 1, 0, 1,
                   AttachOptions.Shrink,
                   AttachOptions.Shrink,
                   0, 0);

            title.Xalign    = 0.0f;
            title.Xpad      = 6;
            title.Ellipsize = Pango.EllipsizeMode.End;

            Attach(title, 1, 2, 0, 1,
                   AttachOptions.Expand | AttachOptions.Fill,
                   AttachOptions.Shrink,
                   0, 0);

            //search_entry.EmptyMessage = String.Format (Catalog.GetString ("Search the Amazon MP3 Store"));
            search_entry.SetSizeRequest(260, -1);
            // FIXME: dummy option to make the "search" icon show up;
            // we should probably fix this in the SearchEntry, but also
            // add real filter options for searching Amazon MP3 (artist,
            // album, genre, etc.)
            search_entry.AddFilterOption(0, name);
            search_entry.Show();
            search_entry.Activated += (o, e) => {
                view.GoSearch(search_entry.Query);
                view.HasFocus = true;
                search_clear_on_navigate_state = 1;
            };
            Attach(search_entry, 2, 3, 0, 1,
                   AttachOptions.Fill,
                   AttachOptions.Shrink,
                   0, 0);

            view_scroll.Add(view);
            view_scroll.ShadowType = ShadowType.In;

            Attach(view_scroll, 0, 3, 1, 2,
                   AttachOptions.Expand | AttachOptions.Fill,
                   AttachOptions.Expand | AttachOptions.Fill,
                   0, 0);

            UpdateTitle(String.Format(Catalog.GetString("Loading {0}..."), name));

            ShowAll();
        }