diff --git a/GUI/Main.Designer.cs b/GUI/Main.Designer.cs index bf21445ce6..71f8b35eef 100644 --- a/GUI/Main.Designer.cs +++ b/GUI/Main.Designer.cs @@ -33,6 +33,7 @@ private void InitializeComponent() System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Main)); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.selectKSPInstallMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.installFromckanToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.exportModListToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); @@ -163,6 +164,7 @@ private void InitializeComponent() // fileToolStripMenuItem // this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.selectKSPInstallMenuItem, this.installFromckanToolStripMenuItem, this.exportModListToolStripMenuItem, this.toolStripSeparator1, @@ -171,6 +173,13 @@ private void InitializeComponent() this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); this.fileToolStripMenuItem.Text = "File"; // + // selectKSPInstallMenuItem + // + this.selectKSPInstallMenuItem.Name = "selectKSPInstallMenuItem"; + this.selectKSPInstallMenuItem.Size = new System.Drawing.Size(196, 22); + this.selectKSPInstallMenuItem.Text = "Select KSP Install..."; + this.selectKSPInstallMenuItem.Click += new System.EventHandler(this.selectKSPInstallMenuItem_Click); + // // installFromckanToolStripMenuItem // this.installFromckanToolStripMenuItem.Name = "installFromckanToolStripMenuItem"; @@ -398,64 +407,64 @@ private void InitializeComponent() this.ModList.Size = new System.Drawing.Size(651, 578); this.ModList.TabIndex = 3; this.ModList.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.ModList_CellContentClick); + this.ModList.ColumnHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.ModList_HeaderMouseClick); this.ModList.SelectionChanged += new System.EventHandler(this.ModList_SelectedIndexChanged); - this.ModList.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.ModList_KeyPress); this.ModList.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ModList_KeyDown); - this.ModList.ColumnHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.ModList_HeaderMouseClick); + this.ModList.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.ModList_KeyPress); // // Installed // this.Installed.HeaderText = "Installed"; this.Installed.Name = "Installed"; + this.Installed.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.Installed.Width = 50; - this.Installed.SortMode = DataGridViewColumnSortMode.Programmatic; // // Update // this.Update.HeaderText = "Update"; this.Update.Name = "Update"; + this.Update.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.Update.Width = 46; - this.Update.SortMode = DataGridViewColumnSortMode.Programmatic; // // ModName // this.ModName.HeaderText = "Name"; this.ModName.Name = "ModName"; this.ModName.ReadOnly = true; + this.ModName.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.ModName.Width = 58; - this.ModName.SortMode = DataGridViewColumnSortMode.Programmatic; // // Author // this.Author.HeaderText = "Author"; this.Author.Name = "Author"; this.Author.ReadOnly = true; + this.Author.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.Author.Width = 61; - this.Author.SortMode = DataGridViewColumnSortMode.Programmatic; // // InstalledVersion // this.InstalledVersion.HeaderText = "Installed version"; this.InstalledVersion.Name = "InstalledVersion"; this.InstalledVersion.ReadOnly = true; + this.InstalledVersion.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.InstalledVersion.Width = 97; - this.InstalledVersion.SortMode = DataGridViewColumnSortMode.Programmatic; // // LatestVersion // this.LatestVersion.HeaderText = "Latest version"; this.LatestVersion.Name = "LatestVersion"; this.LatestVersion.ReadOnly = true; + this.LatestVersion.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.LatestVersion.Width = 88; - this.LatestVersion.SortMode = DataGridViewColumnSortMode.Programmatic; // // Description // this.Description.HeaderText = "Description"; this.Description.Name = "Description"; this.Description.ReadOnly = true; + this.Description.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; this.Description.Width = 83; - this.Description.SortMode = DataGridViewColumnSortMode.Programmatic; // // Homepage // @@ -464,8 +473,8 @@ private void InitializeComponent() this.Homepage.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline; this.Homepage.Name = "Homepage"; this.Homepage.ReadOnly = true; - this.Homepage.Width = 65; - this.Homepage.SortMode = DataGridViewColumnSortMode.Programmatic; + this.Homepage.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; + this.Homepage.Width = 84; // // splitContainer1 // @@ -1193,7 +1202,7 @@ private void InitializeComponent() this.MainMenuStrip = this.menuStrip1; this.MinimumSize = new System.Drawing.Size(878, 664); this.Name = "Main"; - this.Text = "CKAN-GUI"; + this.Text = "CKAN-GUI"; this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); this.menuStrip2.ResumeLayout(false); @@ -1324,6 +1333,7 @@ private void InitializeComponent() private ToolStripMenuItem FilterAllButton; private ToolStripSeparator toolStripSeparator1; private ToolStripMenuItem exportModListToolStripMenuItem; + private ToolStripMenuItem selectKSPInstallMenuItem; } } diff --git a/GUI/Main.cs b/GUI/Main.cs index 324a29b652..6ca7dbcced 100644 --- a/GUI/Main.cs +++ b/GUI/Main.cs @@ -920,6 +920,15 @@ private void exportModListToolStripMenuItem_Click(object sender, EventArgs e) File.Copy(Path.Combine(CurrentInstance.CkanDir(), "installed-default.ckan"), dlg.FileName); } } + + private void selectKSPInstallMenuItem_Click(object sender, EventArgs e) + { + Main.Instance.Manager.ClearAutoStart(); + var old_instance = Main.Instance.CurrentInstance; + var result = new ChooseKSPInstance().ShowDialog(); + if (!Equals(old_instance, Main.Instance.CurrentInstance)) + Main.Instance.CurrentInstanceUpdated(); + } } public class GUIUser : NullUser diff --git a/GUI/SettingsDialog.Designer.cs b/GUI/SettingsDialog.Designer.cs index 859e4215a4..1ecd69204a 100644 --- a/GUI/SettingsDialog.Designer.cs +++ b/GUI/SettingsDialog.Designer.cs @@ -37,10 +37,6 @@ private void InitializeComponent() this.CacheGroupBox = new System.Windows.Forms.GroupBox(); this.ClearCKANCacheButton = new System.Windows.Forms.Button(); this.CKANCacheLabel = new System.Windows.Forms.Label(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.KSPInstallPathLabel = new System.Windows.Forms.Label(); - this.label1 = new System.Windows.Forms.Label(); - this.ResetAutoStartChoice = new System.Windows.Forms.Button(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.CheckUpdateOnLaunchCheckbox = new System.Windows.Forms.CheckBox(); this.InstallUpdateButton = new System.Windows.Forms.Button(); @@ -51,7 +47,6 @@ private void InitializeComponent() this.CheckForUpdatesButton = new System.Windows.Forms.Button(); this.RepositoryGroupBox.SuspendLayout(); this.CacheGroupBox.SuspendLayout(); - this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.SuspendLayout(); // @@ -158,47 +153,6 @@ private void InitializeComponent() this.CKANCacheLabel.TabIndex = 0; this.CKANCacheLabel.Text = "There are currently N files in the cache, taking up M MiB"; // - // groupBox1 - // - this.groupBox1.Controls.Add(this.KSPInstallPathLabel); - this.groupBox1.Controls.Add(this.label1); - this.groupBox1.Controls.Add(this.ResetAutoStartChoice); - this.groupBox1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.groupBox1.Location = new System.Drawing.Point(12, 334); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(476, 93); - this.groupBox1.TabIndex = 10; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "KSP Install"; - // - // KSPInstallPathLabel - // - this.KSPInstallPathLabel.Location = new System.Drawing.Point(137, 20); - this.KSPInstallPathLabel.Name = "KSPInstallPathLabel"; - this.KSPInstallPathLabel.Size = new System.Drawing.Size(320, 41); - this.KSPInstallPathLabel.TabIndex = 2; - this.KSPInstallPathLabel.Text = "label2"; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(7, 20); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(124, 13); - this.label1.TabIndex = 1; - this.label1.Text = "Current KSP install path: "; - // - // ResetAutoStartChoice - // - this.ResetAutoStartChoice.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.ResetAutoStartChoice.Location = new System.Drawing.Point(309, 64); - this.ResetAutoStartChoice.Name = "ResetAutoStartChoice"; - this.ResetAutoStartChoice.Size = new System.Drawing.Size(161, 23); - this.ResetAutoStartChoice.TabIndex = 0; - this.ResetAutoStartChoice.Text = "Choose another KSP install"; - this.ResetAutoStartChoice.UseVisualStyleBackColor = true; - this.ResetAutoStartChoice.Click += new System.EventHandler(this.ResetAutoStartChoice_Click); - // // groupBox2 // this.groupBox2.Controls.Add(this.CheckUpdateOnLaunchCheckbox); @@ -209,7 +163,7 @@ private void InitializeComponent() this.groupBox2.Controls.Add(this.label3); this.groupBox2.Controls.Add(this.CheckForUpdatesButton); this.groupBox2.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.groupBox2.Location = new System.Drawing.Point(12, 433); + this.groupBox2.Location = new System.Drawing.Point(12, 334); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(476, 105); this.groupBox2.TabIndex = 11; @@ -290,9 +244,8 @@ private void InitializeComponent() // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(495, 542); + this.ClientSize = new System.Drawing.Size(495, 442); this.Controls.Add(this.groupBox2); - this.Controls.Add(this.groupBox1); this.Controls.Add(this.CacheGroupBox); this.Controls.Add(this.RepositoryGroupBox); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; @@ -302,8 +255,6 @@ private void InitializeComponent() this.RepositoryGroupBox.ResumeLayout(false); this.CacheGroupBox.ResumeLayout(false); this.CacheGroupBox.PerformLayout(); - this.groupBox1.ResumeLayout(false); - this.groupBox1.PerformLayout(); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); this.ResumeLayout(false); @@ -317,10 +268,6 @@ private void InitializeComponent() private System.Windows.Forms.GroupBox CacheGroupBox; private System.Windows.Forms.Label CKANCacheLabel; private System.Windows.Forms.Button ClearCKANCacheButton; - private System.Windows.Forms.GroupBox groupBox1; - private System.Windows.Forms.Button ResetAutoStartChoice; - private System.Windows.Forms.Label KSPInstallPathLabel; - private System.Windows.Forms.Label label1; private System.Windows.Forms.Button DeleteRepoButton; private System.Windows.Forms.ListBox ReposListBox; private System.Windows.Forms.Button UpRepoButton; diff --git a/GUI/SettingsDialog.cs b/GUI/SettingsDialog.cs index c2da783400..835cdca129 100644 --- a/GUI/SettingsDialog.cs +++ b/GUI/SettingsDialog.cs @@ -24,8 +24,6 @@ public void UpdateDialog() { RefreshReposListBox(); - KSPInstallPathLabel.Text = Main.Instance.CurrentInstance.GameDir(); - LocalVersionLabel.Text = Meta.Version(); CheckUpdateOnLaunchCheckbox.Checked = Main.Instance.m_Configuration.CheckForUpdatesOnLaunch; @@ -90,15 +88,6 @@ private void ClearCKANCacheButton_Click(object sender, EventArgs e) UpdateCacheInfo(); } - private void ResetAutoStartChoice_Click(object sender, EventArgs e) - { - Main.Instance.Manager.ClearAutoStart(); - var old_instance = Main.Instance.CurrentInstance; - var result = new ChooseKSPInstance().ShowDialog(); - if(!Equals(old_instance, Main.Instance.CurrentInstance)) - Main.Instance.CurrentInstanceUpdated(); - } - private void ReposListBox_SelectedIndexChanged(object sender, EventArgs e) { DeleteRepoButton.Enabled = ReposListBox.SelectedItem != null;