@@ -67,6 +67,12 @@ private void frmMain_Load(object sender, EventArgs e)
6767 Size = Settings . Default . WindowSize ;
6868 Location = Settings . Default . WindowPosition ;
6969
70+ //Load listview column widths
71+ clmName . Width = Settings . Default . NameColWidth ;
72+ clmStatus . Width = Settings . Default . StatusColWidth ;
73+ clmDesc . Width = Settings . Default . DescColWidth ;
74+ clmPath . Width = Settings . Default . PathColWidth ;
75+
7076 //Convert the current window handle to a form that's expected by 86Box
7177 hWndHex = string . Format ( "{0:X}" , Handle . ToInt64 ( ) ) ;
7278 hWndHex = hWndHex . PadLeft ( 16 , '0' ) ;
@@ -208,9 +214,6 @@ private void btnEdit_Click(object sender, EventArgs e)
208214 {
209215 dlgEditVM dlg = new dlgEditVM ( ) ;
210216 dlg . ShowDialog ( ) ;
211-
212- if ( dlg . DialogResult == DialogResult . OK )
213- LoadVMs ( ) ;
214217 }
215218
216219 //Load the settings from the registry
@@ -317,7 +320,6 @@ private void LoadVMs()
317320 ListViewItem newLvi = new ListViewItem ( vm . Name )
318321 {
319322 Tag = vm ,
320- //ToolTipText = vm.Desc,
321323 ImageIndex = 0
322324 } ;
323325 newLvi . SubItems . Add ( new ListViewItem . ListViewSubItem ( newLvi , vm . GetStatusString ( ) ) ) ;
@@ -531,6 +533,13 @@ private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
531533 Settings . Default . WindowState = WindowState ;
532534 Settings . Default . WindowSize = Size ;
533535 Settings . Default . WindowPosition = Location ;
536+
537+ //Save listview column widths
538+ Settings . Default . NameColWidth = clmName . Width ;
539+ Settings . Default . StatusColWidth = clmStatus . Width ;
540+ Settings . Default . DescColWidth = clmDesc . Width ;
541+ Settings . Default . PathColWidth = clmPath . Width ;
542+
534543 Settings . Default . Save ( ) ;
535544 }
536545
@@ -619,7 +628,7 @@ private void VMStart()
619628
620629 //initSuccess is ignored for now because WaitForInputIdle() likes to return false more often now that
621630 //86Box is compiled with GCC 9.3.0...
622- if ( ! p . MainWindowHandle . Equals ( IntPtr . Zero ) /* && initSuccess*/ )
631+ if ( ! p . MainWindowHandle . Equals ( IntPtr . Zero ) && initSuccess )
623632 {
624633 vm . hWnd = p . MainWindowHandle ; //Get the window handle of the newly created process
625634 vm . Status = VM . STATUS_RUNNING ;
@@ -889,6 +898,7 @@ public void VMAdd(string name, string desc, bool openCFG, bool startVM)
889898 ImageIndex = 0
890899 } ;
891900 newLvi . SubItems . Add ( new ListViewItem . ListViewSubItem ( newLvi , newVM . GetStatusString ( ) ) ) ;
901+ newLvi . SubItems . Add ( new ListViewItem . ListViewSubItem ( newLvi , newVM . Desc ) ) ;
892902 newLvi . SubItems . Add ( new ListViewItem . ListViewSubItem ( newLvi , newVM . Path ) ) ;
893903 lstVMs . Items . Add ( newLvi ) ;
894904 Directory . CreateDirectory ( cfgpath + newVM . Name ) ;
@@ -967,11 +977,8 @@ public void VMEdit(string name, string desc)
967977 }
968978 vm . Name = name ;
969979 vm . Path = cfgpath + vm . Name ;
970- lstVMs . SelectedItems [ 0 ] . Text = name ;
971- lstVMs . SelectedItems [ 0 ] . SubItems [ 2 ] . Text = vm . Path ;
972980 }
973981 vm . Desc = desc ;
974- lstVMs . SelectedItems [ 0 ] . ToolTipText = desc ;
975982
976983 //Create a new registry value with new info, delete the old one
977984 regkey = Registry . CurrentUser . OpenSubKey ( @"SOFTWARE\86Box\Virtual Machines" , true ) ;
@@ -988,6 +995,7 @@ public void VMEdit(string name, string desc)
988995
989996 MessageBox . Show ( "Virtual machine \" " + vm . Name + "\" was successfully modified. Please update its configuration so that any folder paths (e.g. for hard disk images) point to the new folder." , "Success" , MessageBoxButtons . OK , MessageBoxIcon . Information ) ;
990997 VMSort ( sortColumn , sortOrder ) ;
998+ LoadVMs ( ) ;
991999 }
9921000
9931001 private void btnDelete_Click ( object sender , EventArgs e )
@@ -1067,9 +1075,6 @@ private void editToolStripMenuItem_Click(object sender, EventArgs e)
10671075 {
10681076 dlgEditVM dlg = new dlgEditVM ( ) ;
10691077 dlg . ShowDialog ( ) ;
1070-
1071- if ( dlg . DialogResult == DialogResult . OK )
1072- LoadVMs ( ) ;
10731078 }
10741079
10751080 private void btnCtrlAltDel_Click ( object sender , EventArgs e )
@@ -1617,7 +1622,6 @@ public void VMImport(string name, string desc, string importPath, bool openCFG,
16171622 ListViewItem newLvi = new ListViewItem ( newVM . Name )
16181623 {
16191624 Tag = newVM ,
1620- ToolTipText = newVM . Desc ,
16211625 ImageIndex = 0
16221626 } ;
16231627 newLvi . SubItems . Add ( new ListViewItem . ListViewSubItem ( newLvi , newVM . GetStatusString ( ) ) ) ;
@@ -1711,7 +1715,7 @@ private void VMCountRefresh()
17111715 }
17121716 }
17131717
1714- lblVMCount . Text = "Total VMs: " + lstVMs . Items . Count + " | Running: " + runningVMs + " | Paused: " + pausedVMs + " | Waiting: " + waitingVMs + " | Stopped: " + stoppedVMs ;
1718+ lblVMCount . Text = "All VMs: " + lstVMs . Items . Count + " | Running: " + runningVMs + " | Paused: " + pausedVMs + " | Waiting: " + waitingVMs + " | Stopped: " + stoppedVMs ;
17151719 }
17161720
17171721 private void openConfigFileToolStripMenuItem_Click ( object sender , EventArgs e )
0 commit comments