示例#1
0
        // Everything below here is overly sepcific and will be replaced when a general
        // playlist standard is decided upon.

        public void GetPodcastModelPathAtPos(int x, int y, out TreePath path)
        {
            GetPathAtPos(x, y, out path);

            if (path == null)
            {
                return;
            }

            path = sort.ConvertPathToChildPath(path);
            path = filter.ConvertPathToChildPath(path);
        }
示例#2
0
    private void OnTagClicked(object o, ItemActivatedArgs args)
    {
        TreePath  childpath = _filter.ConvertPathToChildPath(args.Path);
        string    tag       = (string)_tags[childpath.Indices[0]];
        ArrayList tagschosen;

        if (checkbutton1.Active || !checkbutton1.Sensitive)
        {
            Photo p = ((DeskFlickrUI.SelectedPhoto)_selectedphotos[_curphotoindex]).photo;
            p.AddTag(tag);
            tagschosen = p.Tags;
        }
        else
        {
            foreach (DeskFlickrUI.SelectedPhoto sel in _selectedphotos)
            {
                Photo p = sel.photo;
                p.AddTag(tag);
            }
            tagschosen = ((DeskFlickrUI.SelectedPhoto)_selectedphotos[0]).photo.Tags;
            foreach (DeskFlickrUI.SelectedPhoto sel in _selectedphotos)
            {
                Photo p = sel.photo;
                tagschosen = Utils.GetIntersection(tagschosen, p.Tags);
            }
        }
        ActivateRevertButton();
        _ignorechangedevent   = true;
        textview3.Buffer.Text = Utils.GetDelimitedString(tagschosen, " ");
        _ignorechangedevent   = false;
    }
示例#3
0
    private void DeleteSelection()
    {
        var paths = Selection.GetSelectedRows();

        for (int i = 0; i < paths.Length; ++i)
        {
            var path1 = modelSort.ConvertPathToChildPath(paths[i]);
            paths[i] = modelFilter.ConvertPathToChildPath(path1);
        }

        store.RemoveItems(paths);
    }
示例#4
0
        private void OnButtonPressed(object o, ButtonPressEventArgs args)
        {
            if (args.Event.Type != EventType.ButtonPress || args.Event.Button != 3)
            {
                // Not a right-click, early return
                return;
            }

            this.Tree.GetPathAtPos((int)args.Event.X, (int)args.Event.Y, out var sorterPath);
            var filterPath = _treeSorter.ConvertPathToChildPath(sorterPath);
            var modelPath  = _treeFilter.ConvertPathToChildPath(filterPath);

            if (modelPath == null)
            {
                _saveItem.Sensitive           = false;
                _exportItem.Sensitive         = false;
                _openItem.Sensitive           = false;
                _queueForExportItem.Sensitive = false;
                _copyPathItem.Sensitive       = false;
                return;
            }

            var currentFileReference = _treeModel.GetReferenceByPath(this.GameContext, modelPath);

            if (currentFileReference.IsFile || currentFileReference.IsDirectory)
            {
                _saveItem.Sensitive           = true;
                _exportItem.Sensitive         = true;
                _openItem.Sensitive           = true;
                _queueForExportItem.Sensitive = true;
                _copyPathItem.Sensitive       = true;
            }
            else
            {
                _saveItem.Sensitive           = false;
                _exportItem.Sensitive         = false;
                _openItem.Sensitive           = true;
                _queueForExportItem.Sensitive = false;
                _copyPathItem.Sensitive       = false;
            }

            _treeContextMenu.ShowAll();

            //this.TreeContextMenu.Popup(); // only available in GTK >= 3.22
            _treeContextMenu.PopupForDevice(args.Event.Device, null, null, null, null, args.Event.Button, args.Event.Time);
        }