예제 #1
0
        void ShowPopupMenu(Gdk.EventButton evnt)
        {
            var menu = new ContextMenu();

            columnsActions = new Dictionary <ContextMenuItem, int> ();

            var copy = new ContextMenuItem(GettextCatalog.GetString("Copy Task"));

            copy.Clicked += OnGenTaskCopied;
            menu.Add(copy);

            var jump = new ContextMenuItem(GettextCatalog.GetString("_Go to Task"));

            jump.Clicked += OnGenTaskJumpto;
            menu.Add(jump);

            var delete = new ContextMenuItem(GettextCatalog.GetString("_Delete Task"));

            delete.Clicked += OnGenTaskDelete;
            menu.Add(delete);

            var columns     = new ContextMenuItem(GettextCatalog.GetString("Columns"));
            var columnsMenu = new ColumnSelectorMenu(view, restoreID);

            columns.SubMenu = columnsMenu;
            menu.Add(columns);

            copy.Sensitive = jump.Sensitive = delete.Sensitive =
                view.Selection != null &&
                view.Selection.CountSelectedRows() > 0 &&
                view.IsAColumnVisible();

            menu.Show(view, evnt);
        }
예제 #2
0
        void ShowPopup(Gdk.EventButton evt)
        {
            var menu = new ContextMenu();

            var help = new ContextMenuItem(GettextCatalog.GetString("Go to _Reference"));

            help.Clicked += OnShowReference;
            menu.Add(help);

            if (BuildOutput.IsFeatureEnabled)
            {
                var goBuild = new ContextMenuItem(GettextCatalog.GetString("Go to _Log"));
                goBuild.Clicked += async(s, e) => await OnGoToLog(s, e);

                menu.Add(goBuild);
            }

            var jump = new ContextMenuItem(GettextCatalog.GetString("_Go to Task"));

            jump.Clicked += OnTaskJumpto;
            menu.Add(jump);

            var columnsMenu = new ColumnSelectorMenu(view,
                                                     restoreID,
                                                     GettextCatalog.GetString("Type"),
                                                     GettextCatalog.GetString("Validity"));

            menu.Add(new SeparatorContextMenuItem());

            var copy = new ContextMenuItem(GettextCatalog.GetString("_Copy"));

            copy.Clicked += OnTaskCopied;
            menu.Add(copy);


            menu.Add(new SeparatorContextMenuItem());

            var columns = new ContextMenuItem(GettextCatalog.GetString("Columns"));

            columns.SubMenu = columnsMenu;
            menu.Add(columns);

            help.Sensitive = copy.Sensitive = jump.Sensitive =
                view.Selection != null &&
                view.Selection.CountSelectedRows() > 0 &&
                view.IsAColumnVisible();

            // Disable Help and Go To if multiple rows selected.
            if (help.Sensitive && view.Selection.CountSelectedRows() > 1)
            {
                help.Sensitive = false;
                jump.Sensitive = false;
            }

            string dummyString;

            help.Sensitive &= GetSelectedErrorReference(out dummyString);

            menu.Show(view, evt);
        }