bool hires; // for file name presentation only

        public ScreenShotConfigureForm()
        {
            InitializeComponent();
            EDDiscovery.EDDTheme theme = EDDiscovery.EDDTheme.Instance;
            bool winborder             = theme.ApplyStd(this);

            panelTop.Visible = panelTop.Enabled = !winborder;
        }
Esempio n. 2
0
        public void Show()
        {
            if (_formMap != null)
            {
                if (SystemsDatabase.Instance.RebuildRunning)
                {
                    ExtendedControls.MessageBoxTheme.Show("Not Available due to DB rebuild", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    EDDiscovery.EDDTheme theme = EDDiscovery.EDDTheme.Instance;
                    _formMap.IconSelect(theme.ApplyStd(_formMap));

                    _formMap.Show();
                    _formMap.Focus();
                }
            }
        }
Esempio n. 3
0
        public void Init(bool ad, Icon ic)           // true = manage downloads, else just show actions and allow editing of them
        {
            this.Icon          = ic;
            managedownloadmode = ad;

            SizeF prev = this.AutoScaleDimensions;

            EDDiscovery.EDDTheme theme = EDDiscovery.EDDTheme.Instance;
            bool winborder             = theme.ApplyStd(this); // changing FONT changes the autoscale since form is in AutoScaleMode=font

            //System.Diagnostics.Debug.WriteLine("Scale factor " + prev + "->" + this.AutoScaleDimensions);

            statusStripCustom.Visible             = panelTop.Visible = panelTop.Enabled = !winborder;
            richTextBoxScrollDescription.ReadOnly = true;

            buttonExtGlobals.Visible = !managedownloadmode;

            BaseUtils.Translator.Instance.Translate(this);

            label_index.Text = this.Text = (managedownloadmode) ? "Add-On Manager".T(EDTx.AddOnManagerForm_AddOnTitle) : "Edit Add-Ons".T(EDTx.AddOnManagerForm_EditTitle);
        }
Esempio n. 4
0
        void ReadyToDisplay()
        {
            this.Cursor = Cursors.Default;
            panelVScroll.RemoveAllControls(new List <Control>()
            {
                buttonMore
            });

            mgr = new VersioningManager();

            int[] edversion = System.Reflection.Assembly.GetExecutingAssembly().GetVersionInts();
            System.Diagnostics.Debug.Assert(edversion != null);

            ReadLocalFiles(mgr, managedownloadmode);

            if (managedownloadmode)
            {
                mgr.ReadInstallFiles(EDDiscovery.Properties.Resources.URLGithubDataDownload, "ActionFiles/V1", downloadactfolder, EDDOptions.Instance.AppDataDirectory, "*.act", edversion, "Action File");
                mgr.ReadInstallFiles(EDDiscovery.Properties.Resources.URLGithubDataDownload, "VideoFiles/V1", downloadflightfolder, EDDOptions.Instance.AppDataDirectory, "*.vid", edversion, "Video File");
                mgr.ReadInstallFiles(EDDiscovery.Properties.Resources.URLGithubDataDownload, "AddonFiles/V1", downloadaddonfolder, EDDOptions.Instance.AppDataDirectory, "*.inf", edversion, "Other File");
#if DEBUG
                mgr.ReadInstallFiles(EDDiscovery.Properties.Resources.URLGithubDataDownload, "ActionFiles/Debug", downloadactdebugfolder, EDDOptions.Instance.AppDataDirectory, "*.act", edversion, "Action File");
#endif
            }

            mgr.Sort();

            panelVScroll.SuspendLayout();

            int[] tabs;
            if (managedownloadmode)
            {
                //               type, n,  ver  des  stat act, del, ena
                tabs = new int[] { 0, 80, 280, 360, 560, 660, 760, 820, 880 }
            }
            ;
            else
            {
                tabs = new int[] { 0, 80, 280, 360, 560, 560, 660, 720, 780 }
            };

            EDDiscovery.EDDTheme theme = EDDiscovery.EDDTheme.Instance;

            int fonth       = (int)theme.GetFont.GetHeight() + 1;
            int headervsize = fonth + panelheightmargin + 2;

            panelVScroll.Controls.Add(new Label()
            {
                Location = new Point(tabs[0] + panelleftmargin, panelheightmargin), Size = new Size(tabs[1] - tabs[0] - 2, headervsize), Text = "Type".Tx(this)
            });
            panelVScroll.Controls.Add(new Label()
            {
                Location = new Point(tabs[1] + panelleftmargin, panelheightmargin), Size = new Size(tabs[2] - tabs[1] - 2, headervsize), Text = "Name".Tx(this)
            });
            panelVScroll.Controls.Add(new Label()
            {
                Location = new Point(tabs[2] + panelleftmargin, panelheightmargin), Size = new Size(tabs[3] - tabs[2] - 2, headervsize), Text = "Version".Tx(this)
            });
            panelVScroll.Controls.Add(new Label()
            {
                Location = new Point(tabs[3] + panelleftmargin, panelheightmargin), Size = new Size(tabs[4] - tabs[3] - 2, headervsize), Text = "Description".Tx(this)
            });
            if (managedownloadmode)
            {
                panelVScroll.Controls.Add(new Label()
                {
                    Location = new Point(tabs[4] + panelleftmargin, panelheightmargin), Size = new Size(tabs[5] - tabs[4] - 2, headervsize), Text = "Status".Tx(this)
                });
            }
            panelVScroll.Controls.Add(new Label()
            {
                Location = new Point(tabs[5] + panelleftmargin, panelheightmargin), Size = new Size(tabs[6] - tabs[5] - 2, headervsize), Text = "Action".Tx(this)
            });
            panelVScroll.Controls.Add(new Label()
            {
                Location = new Point(tabs[6] + panelleftmargin, panelheightmargin), Size = new Size(tabs[7] - tabs[6] - 2, headervsize), Text = "Delete".Tx(this)
            });
            panelVScroll.Controls.Add(new Label()
            {
                Location = new Point(tabs[7] + panelleftmargin, panelheightmargin), Size = new Size(tabs[8] - tabs[7] - 2, headervsize), Text = "Enabled".Tx(this)
            });

            int vpos = headervsize + 8;

            // draw everything in 8.25 point position then scale

            foreach (VersioningManager.DownloadItem di in mgr.DownloadItems)
            {
                Group g = new Group();
                g.di                = di;
                g.panel             = new Panel();
                g.panel.BorderStyle = BorderStyle.FixedSingle;
                g.panel.Tag         = g;
                g.panel.MouseEnter += MouseEnterControl;

                g.type          = new Label();
                g.type.Location = new Point(tabs[0], labelheightmargin);      // 8 spacing, allow 8*4 to indent
                g.type.Size     = new Size(tabs[1] - tabs[0], 24);
                g.type.Text     = di.itemtype;
                g.panel.Controls.Add(g.type);

                g.info          = new ExtendedControls.ExtButton();
                g.info.Location = new Point(tabs[1], labelheightmargin - 4);      // 8 spacing, allow 8*4 to indent
                g.info.Size     = new Size(16, 16);
                g.info.Text     = "i";
                g.info.Click   += Info_Click;
                g.info.Tag      = g;
                g.panel.Controls.Add(g.info);

                g.name          = new Label();
                g.name.Location = new Point(tabs[1] + 32, labelheightmargin);      // 8 spacing, allow 8*4 to indent
                g.name.Size     = new Size(tabs[2] - tabs[1] - 32, 24);
                g.name.Text     = di.itemname;
                g.panel.Controls.Add(g.name);

                g.version          = new Label();
                g.version.Location = new Point(tabs[2], labelheightmargin);      // 8 spacing, allow 8*4 to indent
                g.version.Size     = new Size(tabs[3] - tabs[2], 24);
                g.version.Text     = (di.localversion != null) ? di.localversion.ToString(".") : "N/A";
                g.panel.Controls.Add(g.version);

                g.shortdesc          = new Label();
                g.shortdesc.Location = new Point(tabs[3], labelheightmargin);      // 8 spacing, allow 8*4 to indent
                g.shortdesc.Size     = new Size(tabs[4] - tabs[3], 24);
                g.shortdesc.Text     = di.ShortLocalDescription;
                if (g.shortdesc.Text.Length == 0)
                {
                    g.shortdesc.Text = "N/A";
                }
                g.panel.Controls.Add(g.shortdesc);

                if (managedownloadmode)
                {
                    bool   isversion = false;
                    string text;
                    if (di.state == VersioningManager.ItemState.EDOutOfDate)
                    {
                        text = "Newer EDD required".Tx(this, "Newer");
                    }
                    else if (di.state == VersioningManager.ItemState.EDTooOld)
                    {
                        text = "Too old for EDD".Tx(this, "Old");
                    }
                    else if (di.state == VersioningManager.ItemState.UpToDate)
                    {
                        text = (di.localmodified) ? "Locally modified".Tx(this) : "Up to Date".Tx(this);
                    }
                    else if (di.state == VersioningManager.ItemState.LocalOnly)
                    {
                        text = "Local Only".Tx(this, "LocalOnly");
                    }
                    else if (di.state == VersioningManager.ItemState.NotPresent)
                    {
                        isversion = true;
                        text      = "Version".Tx(this) + " " + di.downloadedversion.ToString(".") + ((di.localmodified) ? "*" : "");
                    }
                    else
                    {
                        isversion = true;
                        text      = "New version".Tx(this) + " " + di.downloadedversion.ToString(".") + ((di.localmodified) ? "*" : "");
                    }

                    g.actionlabel          = new Label();
                    g.actionlabel.Location = new Point(tabs[4], labelheightmargin);      // 8 spacing, allow 8*4 to indent
                    g.actionlabel.Size     = new Size(tabs[5] - tabs[4], 24);
                    g.actionlabel.Text     = text;
                    g.panel.Controls.Add(g.actionlabel);

                    if (isversion)
                    {
                        g.actionbutton          = new ExtendedControls.ExtButton();
                        g.actionbutton.Location = new Point(tabs[5], labelheightmargin - 4);      // 8 spacing, allow 8*4 to indent
                        g.actionbutton.Size     = new Size(tabs[6] - tabs[5] - 20, 24);
                        g.actionbutton.Text     = (di.state == VersioningManager.ItemState.NotPresent) ? "Install".Tx(this) : "Update".Tx(this);
                        g.actionbutton.Click   += Actionbutton_Click;
                        g.actionbutton.Tag      = g;
                        g.panel.Controls.Add(g.actionbutton);
                    }
                }
                else
                {
                    bool loaded = CheckActionLoaded != null?CheckActionLoaded(g.di.itemname) : false;

                    if (loaded)     // may not be loaded IF its got an error.
                    {
                        g.actionbutton          = new ExtendedControls.ExtButton();
                        g.actionbutton.Location = new Point(tabs[5], labelheightmargin - 4);      // 8 spacing, allow 8*4 to indent
                        g.actionbutton.Size     = new Size(tabs[6] - tabs[5] - 20, 24);
                        g.actionbutton.Text     = "Edit".Tx(this);
                        g.actionbutton.Click   += ActionbuttonEdit_Click;
                        g.actionbutton.Tag      = g;
                        g.panel.Controls.Add(g.actionbutton);
                    }
                }

                if (di.HasLocalCopy)
                {
                    g.deletebutton          = new ExtendedControls.ExtButton();
                    g.deletebutton.Location = new Point(tabs[6], labelheightmargin - 4);      // 8 spacing, allow 8*4 to indent
                    g.deletebutton.Size     = new Size(24, 24);
                    g.deletebutton.Text     = "X";
                    g.deletebutton.Click   += Deletebutton_Click;
                    g.deletebutton.Tag      = g;
                    g.panel.Controls.Add(g.deletebutton);
                }

                if (di.localenable.HasValue)
                {
                    g.enabled          = new ExtendedControls.ExtCheckBox();
                    g.enabled.Location = new Point(tabs[7], labelheightmargin);
                    g.enabled.Size     = new Size(tabs[8] - tabs[7], 24);
                    g.enabled.Text     = "";// "Enabled".Tx(this);
                    g.enabled.Checked  = di.localenable.Value;
                    g.enabled.Click   += Enabled_Click;
                    g.enabled.Tag      = g;
                    g.panel.Controls.Add(g.enabled);
                }

                g.panel.Location = new Point(panelleftmargin, vpos);
                g.panel.Size     = g.panel.FindMaxSubControlArea(4, 4);

                panelVScroll.Controls.Add(g.panel);
                vpos += g.panel.Height + 4;
            }

            buttonMore.Location = new Point(panelleftmargin, vpos);

            panelVScroll.Scale(this.CurrentAutoScaleFactor());       // scale newly added children to form

            theme.ApplyStd(panelVScroll);

            panelVScroll.ResumeLayout();
        }

        bool infoclicked = false;