@@ -337,36 +337,42 @@ private void cmbbx_savedSequences_SelectedIndexChanged(object sender, EventArgs
337337 break ;
338338 }
339339 }
340+ try
341+ {
342+ // Save in a file
343+ if ( ! Directory . Exists ( "SavedSequences" ) )
344+ Directory . CreateDirectory ( "SavedSequences" ) ;
345+ File . WriteAllText ( "SavedSequences\\ " + sequenceName + ".sqc" , currentSequence ) ;
340346
341- // Save in a file
342- if ( ! Directory . Exists ( "SavedSequences" ) )
343- Directory . CreateDirectory ( "SavedSequences" ) ;
344- File . WriteAllText ( "SavedSequences \\ " + sequenceName + ".sqc" , currentSequence ) ;
345-
346- // Adds the sequence to the ComboBox
347- cmbbx_savedSequences . Items . Add ( sequenceName ) ;
347+ // Adds the sequence to the ComboBox
348+ cmbbx_savedSequences . Items . Add ( sequenceName ) ;
349+ }
350+ catch ( Exception ex )
351+ {
352+ MessageBox . Show ( "The sequence couldn't be saved in your drive, make sure the installation path have the necessary permissions or start the program as Administrator." , "Permissions Error" , MessageBoxButtons . OK , MessageBoxIcon . Error ) ;
353+ }
348354 }
349- }
350- else if ( cmbbx_savedSequences . Items [ cmbbx_savedSequences . SelectedIndex ] . ToString ( ) . Contains ( "+ New" ) )
351- {
352- // Clear the current points
353- lstbx_points . Items . Clear ( ) ;
354- }
355- else if ( cmbbx_savedSequences . Items [ cmbbx_savedSequences . SelectedIndex ] . ToString ( ) . Contains ( "------" ) )
356- {
357- // Does nothing as only serves as separator between options and actual saved sequences
358- }
359- else
360- {
361- // Clear the current points
362- lstbx_points . Items . Clear ( ) ;
355+ else if ( cmbbx_savedSequences . Items [ cmbbx_savedSequences . SelectedIndex ] . ToString ( ) . Contains ( "+ New" ) )
356+ {
357+ // Clear the current points
358+ lstbx_points . Items . Clear ( ) ;
359+ }
360+ else if ( cmbbx_savedSequences . Items [ cmbbx_savedSequences . SelectedIndex ] . ToString ( ) . Contains ( "------" ) )
361+ {
362+ // Does nothing as only serves as separator between options and actual saved sequences
363+ }
364+ else
365+ {
366+ // Clear the current points
367+ lstbx_points . Items . Clear ( ) ;
363368
364- // Load from the file
365- string [ ] savedSequence = File . ReadAllText ( "SavedSequences\\ " + cmbbx_savedSequences . SelectedItem + ".sqc" ) . Split ( "\n " ) ;
369+ // Load from the file
370+ string [ ] savedSequence = File . ReadAllText ( "SavedSequences\\ " + cmbbx_savedSequences . SelectedItem + ".sqc" ) . Split ( "\n " ) ;
366371
367- lstbx_points . Items . AddRange ( savedSequence ) ;
372+ lstbx_points . Items . AddRange ( savedSequence ) ;
373+ }
374+ cmbbx_savedSequences . SelectedText = "" ;
368375 }
369- cmbbx_savedSequences . SelectedText = "" ;
370376 }
371377
372378 private void nmrupdwn_actionDelay_ValueChanged ( object sender , EventArgs e )
0 commit comments