From ef52f111c1fe6e5353199df405ba9798988e2db4 Mon Sep 17 00:00:00 2001 From: xantari Date: Fri, 23 Apr 2021 23:19:29 -0500 Subject: [PATCH] fix out of range rating issue --- .../EditDatabaseEntryForm.Designer.cs | 77 +++++++++---------- PinCab.Configurator/EditDatabaseEntryForm.cs | 2 +- .../EditDatabaseEntryForm.resx | 9 --- 3 files changed, 37 insertions(+), 51 deletions(-) diff --git a/PinCab.Configurator/EditDatabaseEntryForm.Designer.cs b/PinCab.Configurator/EditDatabaseEntryForm.Designer.cs index 9bafa12..ede8ae1 100644 --- a/PinCab.Configurator/EditDatabaseEntryForm.Designer.cs +++ b/PinCab.Configurator/EditDatabaseEntryForm.Designer.cs @@ -86,6 +86,9 @@ private void InitializeComponent() this.label4 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.tabPageAdditionalInfo = new System.Windows.Forms.TabPage(); + this.dataGridViewDirectDownloadUrls = new System.Windows.Forms.DataGridView(); + this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.label25 = new System.Windows.Forms.Label(); this.label24 = new System.Windows.Forms.Label(); this.btnAddRelatedEntry = new System.Windows.Forms.Button(); this.dataGridViewRelatedEntries = new System.Windows.Forms.DataGridView(); @@ -116,9 +119,6 @@ private void InitializeComponent() this.label19 = new System.Windows.Forms.Label(); this.dataGridViewAdditionalUrls = new System.Windows.Forms.DataGridView(); this.Url = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewDirectDownloadUrls = new System.Windows.Forms.DataGridView(); - this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.label25 = new System.Windows.Forms.Label(); this.tabControlGeneral.SuspendLayout(); this.tabPageGeneral.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericRating)).BeginInit(); @@ -127,11 +127,11 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.numericYear)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericPlayers)).BeginInit(); this.tabPageAdditionalInfo.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridViewDirectDownloadUrls)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dataGridViewRelatedEntries)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.databaseEntryBindingSource)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dataGridViewScreenshotUrls)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dataGridViewAdditionalUrls)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.dataGridViewDirectDownloadUrls)).BeginInit(); this.SuspendLayout(); // // btnSave @@ -376,11 +376,6 @@ private void InitializeComponent() // numericRating // this.numericRating.Location = new System.Drawing.Point(256, 506); - this.numericRating.Maximum = new decimal(new int[] { - 10, - 0, - 0, - 0}); this.numericRating.Name = "numericRating"; this.numericRating.Size = new System.Drawing.Size(64, 20); this.numericRating.TabIndex = 163; @@ -724,6 +719,37 @@ private void InitializeComponent() this.tabPageAdditionalInfo.Text = "Additional Data"; this.tabPageAdditionalInfo.UseVisualStyleBackColor = true; // + // dataGridViewDirectDownloadUrls + // + this.dataGridViewDirectDownloadUrls.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.dataGridViewDirectDownloadUrls.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells; + this.dataGridViewDirectDownloadUrls.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.EnableWithoutHeaderText; + this.dataGridViewDirectDownloadUrls.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridViewDirectDownloadUrls.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.dataGridViewTextBoxColumn2}); + this.dataGridViewDirectDownloadUrls.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter; + this.dataGridViewDirectDownloadUrls.Location = new System.Drawing.Point(8, 272); + this.dataGridViewDirectDownloadUrls.Name = "dataGridViewDirectDownloadUrls"; + this.dataGridViewDirectDownloadUrls.Size = new System.Drawing.Size(575, 87); + this.dataGridViewDirectDownloadUrls.TabIndex = 140; + this.dataGridViewDirectDownloadUrls.DoubleClick += new System.EventHandler(this.dataGridViewDirectDownloadUrls_DoubleClick); + // + // dataGridViewTextBoxColumn2 + // + this.dataGridViewTextBoxColumn2.HeaderText = "Url"; + this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2"; + this.dataGridViewTextBoxColumn2.Width = 45; + // + // label25 + // + this.label25.AutoSize = true; + this.label25.Location = new System.Drawing.Point(7, 256); + this.label25.Name = "label25"; + this.label25.Size = new System.Drawing.Size(107, 13); + this.label25.TabIndex = 139; + this.label25.Text = "Direct Download Urls"; + // // label24 // this.label24.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -1021,37 +1047,6 @@ private void InitializeComponent() this.Url.Name = "Url"; this.Url.Width = 45; // - // dataGridViewDirectDownloadUrls - // - this.dataGridViewDirectDownloadUrls.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.dataGridViewDirectDownloadUrls.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells; - this.dataGridViewDirectDownloadUrls.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.EnableWithoutHeaderText; - this.dataGridViewDirectDownloadUrls.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.dataGridViewDirectDownloadUrls.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.dataGridViewTextBoxColumn2}); - this.dataGridViewDirectDownloadUrls.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter; - this.dataGridViewDirectDownloadUrls.Location = new System.Drawing.Point(8, 272); - this.dataGridViewDirectDownloadUrls.Name = "dataGridViewDirectDownloadUrls"; - this.dataGridViewDirectDownloadUrls.Size = new System.Drawing.Size(575, 87); - this.dataGridViewDirectDownloadUrls.TabIndex = 140; - this.dataGridViewDirectDownloadUrls.DoubleClick += new System.EventHandler(this.dataGridViewDirectDownloadUrls_DoubleClick); - // - // dataGridViewTextBoxColumn2 - // - this.dataGridViewTextBoxColumn2.HeaderText = "Url"; - this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2"; - this.dataGridViewTextBoxColumn2.Width = 45; - // - // label25 - // - this.label25.AutoSize = true; - this.label25.Location = new System.Drawing.Point(7, 256); - this.label25.Name = "label25"; - this.label25.Size = new System.Drawing.Size(107, 13); - this.label25.TabIndex = 139; - this.label25.Text = "Direct Download Urls"; - // // EditDatabaseEntryForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1074,11 +1069,11 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.numericPlayers)).EndInit(); this.tabPageAdditionalInfo.ResumeLayout(false); this.tabPageAdditionalInfo.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridViewDirectDownloadUrls)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dataGridViewRelatedEntries)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.databaseEntryBindingSource)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dataGridViewScreenshotUrls)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dataGridViewAdditionalUrls)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.dataGridViewDirectDownloadUrls)).EndInit(); this.ResumeLayout(false); } diff --git a/PinCab.Configurator/EditDatabaseEntryForm.cs b/PinCab.Configurator/EditDatabaseEntryForm.cs index 56c78d2..3928f99 100644 --- a/PinCab.Configurator/EditDatabaseEntryForm.cs +++ b/PinCab.Configurator/EditDatabaseEntryForm.cs @@ -108,7 +108,7 @@ private void LoadForm() txtIpdbNumber.Text = _dbEntry.IpdbNumber.HasValue ? _dbEntry.IpdbNumber.Value.ToString() : ""; numericFileBytes.Value = _dbEntry.FileSizeBytes.HasValue ? _dbEntry.FileSizeBytes.Value : 0; numericDownloadCount.Value = _dbEntry.DownloadCount.HasValue ? _dbEntry.DownloadCount.Value : 0; - numericRating.Value = _dbEntry.Rating.HasValue ? _dbEntry.Rating.Value : 0; + numericRating.Value = _dbEntry.Rating.HasValue ? (_dbEntry.Rating.Value > 10 ? 10 : _dbEntry.Rating.Value) : 0; dateTimeModified.Value = _dbEntry.LastModifiedDateUtc.HasValue ? _dbEntry.LastModifiedDateUtc.Value : DateTime.UtcNow; lblReadableFileSize.Text = Convert.ToInt64(numericFileBytes.Value).FileSizeHumanReadable(); diff --git a/PinCab.Configurator/EditDatabaseEntryForm.resx b/PinCab.Configurator/EditDatabaseEntryForm.resx index e01d8ab..e505413 100644 --- a/PinCab.Configurator/EditDatabaseEntryForm.resx +++ b/PinCab.Configurator/EditDatabaseEntryForm.resx @@ -129,13 +129,4 @@ True - - 17, 17 - - - True - - - True - \ No newline at end of file