Example #1
0
        private bool HasSamePublishedDate(History.History item, DateTime publishedDate)
        {
            DateTime itemsPublishedDate;

            if (!DateTime.TryParse(item.Data.GetValueOrDefault("PublishedDate", null), out itemsPublishedDate))
            {
                return(true);
            }

            return(itemsPublishedDate.AddDays(-2) <= publishedDate && itemsPublishedDate.AddDays(2) >= publishedDate);
        }
Example #2
0
        public void MarkAsFailed(TrackedDownload trackedDownload, History.History history)
        {
            if (trackedDownload != null && trackedDownload.State == TrackedDownloadState.Downloading)
            {
                trackedDownload.State = TrackedDownloadState.DownloadFailed;
            }

            var downloadClientId = history.Data.GetValueOrDefault(DownloadTrackingService.DOWNLOAD_CLIENT_ID);

            if (downloadClientId.IsNullOrWhiteSpace())
            {
                PublishDownloadFailedEvent(new List <History.History> {
                    history
                }, "Manually marked as failed");
            }
            else
            {
                var grabbedHistory = GetHistoryItems(_historyService.Grabbed(), downloadClientId);

                PublishDownloadFailedEvent(grabbedHistory, "Manually marked as failed");
            }
        }
Example #3
0
        public FileDialog(string AWildCard, string ATitle, string InputName, StdDlg.StdDialogOptions AOptions, byte HistoryId)
            : base(new Rect(15, 1, 64, 20), ATitle)
        {
            Options |= OptionFlags.ofCentered;
            WildCard = AWildCard;
            Rect R = new Rect(3, 3, 31, 4);

            FileName          = new FileInputLine(R, 79);
            FileName.GrowMode = GrowModes.gfGrowHiX;
            FileName.Data     = WildCard;
            Insert(FileName);
            R = new Rect(2, 2, 3 + Drivers.CStrLen(InputName), 3);
            View Control = new Label(R, InputName, FileName);

            Insert(Control);
            R                = new Rect(31, 3, 34, 4);
            Control          = new History.History(R, FileName, HistoryId);
            Control.GrowMode = GrowModes.gfGrowHiX | GrowModes.gfGrowLoX;
            Insert(Control);
            R       = new Rect(3, 14, 34, 15);
            Control = new ScrollBar(R);
            Insert(Control);
            R                 = new Rect(3, 6, 34, 14);
            FileList          = new FileList(R, (ScrollBar)Control);
            FileList.GrowMode = GrowModes.gfGrowHiX | GrowModes.gfGrowHiY;

            Insert(FileList);
            R       = new Rect(2, 5, 8, 6);
            Control = new Label(R, "~F~iles", FileList);
            Insert(Control);

            R = new Rect(35, 3, 46, 5);
            Button.ButtonFlags Opt = Button.ButtonFlags.Default;
            if ((AOptions & StdDialogOptions.fdOpenButton) != 0)
            {
                View V = new Button(R, "~O~pen", StdDialog.cmFileOpen, Opt);
                V.GrowMode = GrowModes.gfGrowHiX | GrowModes.gfGrowLoX;
                Insert(V);
                Opt    = Button.ButtonFlags.Normal;
                R.A.Y += 3;
                R.B.Y += 3;
            }
            if ((AOptions & StdDialogOptions.fdReplaceButton) != 0)
            {
                View V = new Button(R, "~R~eplace", StdDialog.cmFileReplace, Opt);
                V.GrowMode = GrowModes.gfGrowHiX | GrowModes.gfGrowLoX;
                Insert(V);
                Opt    = Button.ButtonFlags.Normal;
                R.A.Y += 3;
                R.B.Y += 3;
            }
            if ((AOptions & StdDialogOptions.fdClearButton) != 0)
            {
                View V = new Button(R, "~C~lear", StdDialog.cmFileClear, Opt);
                V.GrowMode = GrowModes.gfGrowHiX | GrowModes.gfGrowLoX;
                Insert(V);
                R.A.Y += 3;
                R.B.Y += 3;
            }
            View VV = new Button(R, "Cancel", cmCancel, Opt);

            VV.GrowMode = GrowModes.gfGrowHiX | GrowModes.gfGrowLoX;
            Insert(VV);
            R.A.Y += 3;
            R.B.Y += 3;
            if ((AOptions & StdDialogOptions.fdHelpButton) != 0)
            {
                View V = new Button(R, "Help", cmHelp, Button.ButtonFlags.Normal);
                V.GrowMode = GrowModes.gfGrowHiX | GrowModes.gfGrowLoX;
                Insert(V);
                R.A.Y += 3;
                R.B.Y += 3;
            }
            R                = new Rect(1, 16, 48, 18);
            Control          = new FileInfoPane(R);
            Control.GrowMode = GrowModes.gfGrowHiX | GrowModes.gfGrowLoY | GrowModes.gfGrowHiY;
            Insert(Control);

            SelectNext(false);

            if ((AOptions & StdDialogOptions.fdNoLoadDir) == 0)
            {
                ReadDirectory();
            }
        }
Example #4
0
 private Document(IMessageBus messageBus, DocumentData data)
 {
     _messageBus = messageBus;
     Data        = data;
     _history    = new History.History(messageBus, this);
 }
Example #5
0
        public void Show()
        {
            CqaLabel.Heading1("Scan");

            if (!JqaManager.CheckIfJqaIsInstalled())
            {
                CqaLabel.Error("CQA is currently not installed.");
                return;
            }

            CqaLabel.Normal("CQA scans all scripts inside your Assets folder.");

            History.History history = _historyManager.LoadHistory();

            if (history != null)
            {
                CqaLabel.Normal("The last scan was at " + history.GetLastScan() + ".");
            }

            EditorGUI.BeginDisabledGroup(_jqaExecutor.IsAnyProcessRunning());
            if (CqaButton.NormalButton("Scan Assets"))
            {
                _jqaExecutor.ScanAssets();
            }

            if (Directory.Exists(JqaPaths.Instance.BuildJqaStorePath()) && CqaButton.NormalButton("Start Server"))
            {
                _jqaExecutor.StartServer();
            }

            EditorGUI.EndDisabledGroup();

            if (_jqaExecutor.IsScanProcessRunning())
            {
                CqaLabel.Bold("Status: Running ...");

                // FIXME: Stopping the process does currently not work.
                //
                // if (CqaButton.NormalButton("Stop Process"))
                // {
                //     _jqaExecutor.StopProcess();
                // }
            }

            GUILayout.Space(30);
            CqaLine.DrawHorizontalLine();

            CqaLabel.Heading1("Report");

            if (!JqaExecutor.DidFinishSuccessfullyOnce())
            {
                CqaLabel.Error("You must scan your project before you can create a report.");
                return;
            }

            CqaLabel.Normal("Select rules that you want to be checked in the report.");

            if (_jqaExecutor.IsReportProcessRunning())
            {
                CqaLabel.Bold("Status: Running ...");

                // FIXME: Stopping the process does currently not work.
                //
                // if (CqaButton.NormalButton("Stop Process"))
                // {
                //     _jqaExecutor.StopProcess();
                // }
            }

            _ruleSelector.OnGUI();

            ShowReportButtons();
        }