From: <che...@us...> - 2007-08-05 11:25:46
|
Revision: 793 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=793&view=rev Author: chef_koch Date: 2007-08-05 04:25:44 -0700 (Sun, 05 Aug 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Database/DatabaseHandler.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsBase.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsBase.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsDirCache.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGamebase.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGrouper.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsMame.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/BaseItem.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/FileItemInfo.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ProgramUtils.cs Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Database/DatabaseHandler.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Database/DatabaseHandler.cs 2007-08-05 10:09:23 UTC (rev 792) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Database/DatabaseHandler.cs 2007-08-05 11:25:44 UTC (rev 793) @@ -51,8 +51,6 @@ static List<ApplicationItem> globalApplicationItemList = new List<ApplicationItem>(); private const string DATABASEFILE = "myProgramsAltDatabaseV1.db3"; - public static bool useMPsThumbDirectory = false; - // singleton. Dont allow any instance of this class private DatabaseHandler() { } Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.cs 2007-08-05 10:09:23 UTC (rev 792) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.cs 2007-08-05 11:25:44 UTC (rev 793) @@ -331,7 +331,7 @@ public bool FirstImageDirectoryValid() { - if (DatabaseHandler.useMPsThumbDirectory) return true; + if (ProgramUtils.UseThumbsDir()) return true; if (this.imageDirsTextBox.Text.Length == 0) { Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsBase.Designer.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsBase.Designer.cs 2007-08-05 10:09:23 UTC (rev 792) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsBase.Designer.cs 2007-08-05 11:25:44 UTC (rev 793) @@ -55,6 +55,8 @@ this.applicationExeTextBox = new System.Windows.Forms.TextBox(); this.prePostButton = new System.Windows.Forms.Button(); this.startupDirComboBox = new System.Windows.Forms.ComboBox(); + this.pictureBox = new System.Windows.Forms.PictureBox(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit(); this.SuspendLayout(); // // winTypeLabel @@ -72,7 +74,7 @@ this.enabledCheckbox.AutoSize = true; this.enabledCheckbox.Location = new System.Drawing.Point(427, 17); this.enabledCheckbox.Name = "enabledCheckbox"; - this.enabledCheckbox.Size = new System.Drawing.Size(65, 17); + this.enabledCheckbox.Size = new System.Drawing.Size(64, 17); this.enabledCheckbox.TabIndex = 1; this.enabledCheckbox.Text = "Enabled"; this.enabledCheckbox.UseVisualStyleBackColor = true; @@ -100,8 +102,9 @@ this.titleTextBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.titleTextBox.Location = new System.Drawing.Point(94, 44); this.titleTextBox.Name = "titleTextBox"; - this.titleTextBox.Size = new System.Drawing.Size(325, 20); + this.titleTextBox.Size = new System.Drawing.Size(325, 21); this.titleTextBox.TabIndex = 4; + this.titleTextBox.TextChanged += new System.EventHandler(this.titleTextBox_TextChanged); // // applicationExeButton // @@ -118,7 +121,7 @@ this.shellexecuteCheckBox.AutoSize = true; this.shellexecuteCheckBox.Location = new System.Drawing.Point(7, 322); this.shellexecuteCheckBox.Name = "shellexecuteCheckBox"; - this.shellexecuteCheckBox.Size = new System.Drawing.Size(88, 17); + this.shellexecuteCheckBox.Size = new System.Drawing.Size(87, 17); this.shellexecuteCheckBox.TabIndex = 7; this.shellexecuteCheckBox.Text = "ShellExecute"; this.shellexecuteCheckBox.UseVisualStyleBackColor = true; @@ -129,7 +132,7 @@ this.waitExitCheckBox.AutoSize = true; this.waitExitCheckBox.Location = new System.Drawing.Point(7, 368); this.waitExitCheckBox.Name = "waitExitCheckBox"; - this.waitExitCheckBox.Size = new System.Drawing.Size(82, 17); + this.waitExitCheckBox.Size = new System.Drawing.Size(86, 17); this.waitExitCheckBox.TabIndex = 8; this.waitExitCheckBox.Text = "Wait for exit"; this.waitExitCheckBox.UseVisualStyleBackColor = true; @@ -157,15 +160,17 @@ this.applicationImageTextBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.applicationImageTextBox.Location = new System.Drawing.Point(94, 97); this.applicationImageTextBox.Name = "applicationImageTextBox"; - this.applicationImageTextBox.Size = new System.Drawing.Size(325, 20); + this.applicationImageTextBox.Size = new System.Drawing.Size(325, 21); this.applicationImageTextBox.TabIndex = 13; + this.applicationImageTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.applicationImageTextBox.TextChanged += new System.EventHandler(this.applicationImageTextBox_TextChanged); // // applicationArgumentsTextBox // this.applicationArgumentsTextBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.applicationArgumentsTextBox.Location = new System.Drawing.Point(94, 123); this.applicationArgumentsTextBox.Name = "applicationArgumentsTextBox"; - this.applicationArgumentsTextBox.Size = new System.Drawing.Size(325, 20); + this.applicationArgumentsTextBox.Size = new System.Drawing.Size(325, 21); this.applicationArgumentsTextBox.TabIndex = 14; // // winStyleLabel @@ -206,7 +211,7 @@ this.quoteCheckBox.AutoSize = true; this.quoteCheckBox.Location = new System.Drawing.Point(7, 299); this.quoteCheckBox.Name = "quoteCheckBox"; - this.quoteCheckBox.Size = new System.Drawing.Size(102, 17); + this.quoteCheckBox.Size = new System.Drawing.Size(104, 17); this.quoteCheckBox.TabIndex = 19; this.quoteCheckBox.Text = "Quote filenames"; this.quoteCheckBox.UseVisualStyleBackColor = true; @@ -236,7 +241,7 @@ this.allowRefreshCheckBox.AutoSize = true; this.allowRefreshCheckBox.Location = new System.Drawing.Point(7, 345); this.allowRefreshCheckBox.Name = "allowRefreshCheckBox"; - this.allowRefreshCheckBox.Size = new System.Drawing.Size(154, 17); + this.allowRefreshCheckBox.Size = new System.Drawing.Size(159, 17); this.allowRefreshCheckBox.TabIndex = 30; this.allowRefreshCheckBox.Text = "Allow refresh in mediaportal"; this.allowRefreshCheckBox.UseVisualStyleBackColor = true; @@ -257,7 +262,7 @@ this.applicationExeTextBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.applicationExeTextBox.Location = new System.Drawing.Point(94, 71); this.applicationExeTextBox.Name = "applicationExeTextBox"; - this.applicationExeTextBox.Size = new System.Drawing.Size(325, 20); + this.applicationExeTextBox.Size = new System.Drawing.Size(325, 21); this.applicationExeTextBox.TabIndex = 32; this.applicationExeTextBox.TextChanged += new System.EventHandler(this.applicationExeTextBox_TextChanged); // @@ -279,10 +284,21 @@ this.startupDirComboBox.Size = new System.Drawing.Size(325, 21); this.startupDirComboBox.TabIndex = 36; // + // pictureBox + // + this.pictureBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.pictureBox.Location = new System.Drawing.Point(324, 203); + this.pictureBox.Name = "pictureBox"; + this.pictureBox.Size = new System.Drawing.Size(170, 170); + this.pictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox.TabIndex = 37; + this.pictureBox.TabStop = false; + // // AppSettingsBase // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.pictureBox); this.Controls.Add(this.startupDirComboBox); this.Controls.Add(this.prePostButton); this.Controls.Add(this.applicationExeTextBox); @@ -307,7 +323,7 @@ this.Controls.Add(this.enabledCheckbox); this.Controls.Add(this.winTypeLabel); this.Name = "AppSettingsBase"; - this.Size = new System.Drawing.Size(497, 550); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -341,5 +357,6 @@ protected System.Windows.Forms.TextBox applicationExeTextBox; protected System.Windows.Forms.Button prePostButton; protected System.Windows.Forms.ComboBox startupDirComboBox; + private System.Windows.Forms.PictureBox pictureBox; } } \ No newline at end of file Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsBase.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsBase.cs 2007-08-05 10:09:23 UTC (rev 792) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsBase.cs 2007-08-05 11:25:44 UTC (rev 793) @@ -37,6 +37,7 @@ using GUIPrograms; using GUIPrograms.Items; using GUIPrograms.Database; +using MediaPortal.Configuration; namespace GUIPrograms.Design { @@ -44,7 +45,6 @@ { string preLaunch = string.Empty; string postLaunch = string.Empty; - protected bool useThumbsDir = true; public AppSettingsBase() { @@ -57,11 +57,6 @@ base.LoadSettings(curApp); AppItemToForm(curApp); - - if (DatabaseHandler.KeyExists(ProgramUtils.cUSE_MP_THUMBS_DIR)) - useThumbsDir = bool.Parse(DatabaseHandler.ReadSetting(ProgramUtils.cUSE_MP_THUMBS_DIR)); - else - useThumbsDir = true; } public override void SaveSettings(ApplicationItem curApp) @@ -85,6 +80,16 @@ preLaunch = curApp.PreLaunch; postLaunch = curApp.PostLaunch; } + + if (ProgramUtils.UseThumbsDir()) + applicationImageTextBox.Text = MediaPortal.Util.Utils.GetCoverArtName( + Config.GetSubFolder(Config.Dir.Thumbs, @"MyProgramsAlt"), + titleTextBox.Text); + else + applicationImageTextBox.Text = curApp.Imagefile; + applicationImageTextBox.ReadOnly = ProgramUtils.UseThumbsDir(); + applicationImageButton.Visible = !ProgramUtils.UseThumbsDir(); + return true; } @@ -95,6 +100,9 @@ curApp.PreLaunch = preLaunch; curApp.PostLaunch = postLaunch; } + + if (!ProgramUtils.UseThumbsDir()) + curApp.Imagefile = applicationImageTextBox.Text; } protected void SetWindowStyle(ProcessWindowStyle val) @@ -231,9 +239,22 @@ startupDirComboBox.Items.Add(Path.GetDirectoryName(applicationExeTextBox.Text)); } + private void titleTextBox_TextChanged(object sender, EventArgs e) + { + if (ProgramUtils.UseThumbsDir()) + applicationImageTextBox.Text = MediaPortal.Util.Utils.GetCoverArtName( + Config.GetSubFolder(Config.Dir.Thumbs, @"MyProgramsAlt"), + titleTextBox.Text); + } + private void applicationImageTextBox_TextChanged(object sender, EventArgs e) + { + pictureBox.ImageLocation = applicationImageTextBox.Text; + } + + } } \ No newline at end of file Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsDirCache.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsDirCache.cs 2007-08-05 10:09:23 UTC (rev 792) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsDirCache.cs 2007-08-05 11:25:44 UTC (rev 793) @@ -58,11 +58,12 @@ shellexecuteCheckBox.Checked = curApp.UseShellExecute; quoteCheckBox.Checked = curApp.UseQuotes; waitExitCheckBox.Checked = (curApp.WaitForExit); - applicationImageTextBox.Text = curApp.Imagefile; allowRefreshCheckBox.Checked = curApp.RefreshGUIAllowed; - if(curApp.PlatformId != 0){ - platformComboBox.SelectedValue = curApp.PlatformId; - } + if (curApp.PlatformId != 0) + { + platformComboBox.SelectedValue = curApp.PlatformId; + } + return true; } @@ -79,10 +80,8 @@ curApp.UseQuotes = quoteCheckBox.Checked; curApp.WaitForExit = waitExitCheckBox.Checked; curApp.SourceType = ItemType.DIRCACHE; - curApp.Imagefile = applicationImageTextBox.Text; curApp.RefreshGUIAllowed = (allowRefreshCheckBox.Checked); curApp.PlatformId =(int) platformComboBox.SelectedValue; - } public override bool EntriesOK(ApplicationItem curApp) Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGamebase.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGamebase.cs 2007-08-05 10:09:23 UTC (rev 792) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGamebase.cs 2007-08-05 11:25:44 UTC (rev 793) @@ -70,7 +70,6 @@ this.quoteCheckBox.Checked = true; //(curApp.UseQuotes); this.waitExitCheckBox.Checked = (curApp.WaitForExit); SetWindowStyle(curApp.WindowStyle); - this.applicationImageTextBox.Text = curApp.Imagefile; this.allowRefreshCheckBox.Checked = curApp.RefreshGUIAllowed; @@ -90,7 +89,6 @@ curApp.UseQuotes = this.quoteCheckBox.Checked; curApp.WaitForExit = this.waitExitCheckBox.Checked; curApp.SourceType = ItemType.GAMEBASE; - curApp.Imagefile = this.applicationImageTextBox.Text; curApp.RefreshGUIAllowed = this.allowRefreshCheckBox.Checked; } Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGrouper.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGrouper.cs 2007-08-05 10:09:23 UTC (rev 792) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGrouper.cs 2007-08-05 11:25:44 UTC (rev 793) @@ -77,7 +77,6 @@ curApp.Enabled = enabledCheckbox.Checked; curApp.Title = titleTextBox.Text; curApp.SourceType = ItemType.GROUPER; - curApp.Imagefile = applicationImageTextBox.Text; } @@ -86,7 +85,6 @@ base.AppItemToForm(curApp); this.enabledCheckbox.Checked = curApp.Enabled; titleTextBox.Text = curApp.Title; - applicationImageTextBox.Text = curApp.Imagefile; return true; } Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsMame.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsMame.cs 2007-08-05 10:09:23 UTC (rev 792) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsMame.cs 2007-08-05 11:25:44 UTC (rev 793) @@ -54,7 +54,6 @@ this.applicationExeTextBox.Text = curApp.Filename; this.applicationArgumentsTextBox.Text = curApp.Arguments; SetWindowStyle(curApp.WindowStyle); - this.applicationImageTextBox.Text = curApp.Imagefile; return true; } @@ -69,7 +68,6 @@ curApp.Arguments = this.applicationArgumentsTextBox.Text; curApp.WindowStyle = GetSelectedWindowStyle(); curApp.SourceType = ItemType.MAMEDIRECT; - curApp.Imagefile = this.applicationImageTextBox.Text; curApp.RefreshGUIAllowed = true; Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs 2007-08-05 10:09:23 UTC (rev 792) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs 2007-08-05 11:25:44 UTC (rev 793) @@ -1075,7 +1075,7 @@ { FileItem curFile = item.MusicTag as FileItem; - if ( DatabaseHandler.useMPsThumbDirectory ) + if ( ProgramUtils.UseThumbsDir() ) return GetCurThumbFromThumbsDir( curFile ); else return GetCurThumb( curFile ); Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/BaseItem.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/BaseItem.cs 2007-08-05 10:09:23 UTC (rev 792) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/BaseItem.cs 2007-08-05 11:25:44 UTC (rev 793) @@ -72,7 +72,7 @@ string imgFile = String.Empty; - if (DatabaseHandler.useMPsThumbDirectory) + if (ProgramUtils.UseThumbsDir()) imgFile = curFileItem.Imagefile; else imgFile = MediaPortal.Util.Utils.GetCoverArtName( Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/FileItemInfo.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/FileItemInfo.cs 2007-08-05 10:09:23 UTC (rev 792) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/FileItemInfo.cs 2007-08-05 11:25:44 UTC (rev 793) @@ -351,7 +351,7 @@ // imageUrl contains a full URL with one picture to download i++; - if (DatabaseHandler.useMPsThumbDirectory) + if (ProgramUtils.UseThumbsDir()) strFile = curFile.GetNewValidImageFileFromThumbsDir(curApp, Path.GetExtension(imageUrl)); else strFile = curFile.GetNewValidImageFile(curApp, Path.GetExtension(imageUrl)); Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ProgramUtils.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ProgramUtils.cs 2007-08-05 10:09:23 UTC (rev 792) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ProgramUtils.cs 2007-08-05 11:25:44 UTC (rev 793) @@ -393,5 +393,13 @@ comboBox.DisplayMember = "Text"; } + + public static bool UseThumbsDir() + { + if (DatabaseHandler.KeyExists(ProgramUtils.cUSE_MP_THUMBS_DIR)) + return bool.Parse(DatabaseHandler.ReadSetting(ProgramUtils.cUSE_MP_THUMBS_DIR)); + else + return true; + } } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |