@@ -25,7 +25,6 @@ public frmMain()
2525 // Form Init.
2626 this . Size = Properties . Settings . Default . FormSize ;
2727 this . Icon = Properties . Resources . ifme_green ;
28- this . Text = Globals . AppInfo . NameTitle ;
2928 pictBannerRight . Parent = pictBannerMain ;
3029
3130 // Fix Mono WinForms Drawing
@@ -36,24 +35,30 @@ public frmMain()
3635 pictBannerMain . Width += 9 ;
3736 pictBannerRight . Left += 116 ;
3837
39- if ( Properties . Settings . Default . FormSize . Width < 800 )
40- this . Width = 800 ;
41- if ( Properties . Settings . Default . FormSize . Height < 600 )
42- this . Height = 600 ;
43-
4438 // In UNIX, shutdown require root
4539 chkDoneOffMachine . Visible = false ;
4640 }
41+
42+ // Enhanced screen, some text (languages) not fit
43+ if ( Properties . Settings . Default . FormSize . Width < 800 )
44+ this . Width = 800 ;
45+ if ( Properties . Settings . Default . FormSize . Height < 600 )
46+ this . Height = 600 ;
4747 }
4848
4949 private void frmMain_FormClosing ( object sender , FormClosingEventArgs e )
5050 {
51- var msgbox = MessageBox . Show ( Language . IMessage . Quit , "" , MessageBoxButtons . YesNo , MessageBoxIcon . Question ) ;
51+ if ( BGThread . IsBusy )
52+ {
53+ e . Cancel = true ;
54+ return ;
55+ }
5256
57+ var msgbox = MessageBox . Show ( Language . IMessage . Quit , "" , MessageBoxButtons . YesNo , MessageBoxIcon . Question ) ;
5358 if ( msgbox == DialogResult . No )
5459 e . Cancel = true ;
55-
56- UserSettingsSave ( ) ;
60+ else
61+ UserSettingsSave ( ) ;
5762
5863 if ( OS . IsLinux )
5964 Console . Write ( "[info] Your settings has been saved, {0} exit safely\n " , Globals . AppInfo . NameShort ) ;
@@ -93,14 +98,17 @@ private void frmMain_Load(object sender, EventArgs e)
9398 PrintLog ( Log . OK , "New default temporary folder created!" ) ;
9499 }
95100
96- // Check for updates
101+ // Check for updates and load addons
97102 PrintLog ( Log . Info , "Checking for updates" ) ;
98103 frmSplashScreen SS = new frmSplashScreen ( ) ;
99104 SS . ShowDialog ( ) ;
100105
101106 // Display that IFME has new version
102107 PrintLog ( Log . Info , Globals . AppInfo . VersionMsg ) ;
103108
109+ // Update form title
110+ this . Text = Globals . AppInfo . NameTitle ;
111+
104112 // Load list of ISO language file to control
105113 try
106114 {
@@ -908,7 +916,7 @@ private void btnResume_Click(object sender, EventArgs e)
908916
909917 private void btnStart_Click ( object sender , EventArgs e )
910918 {
911- if ( btnStart . Text . Equals ( Language . IControl . btnStop ) )
919+ if ( BGThread . IsBusy )
912920 {
913921 var msgbox = MessageBox . Show ( Language . IMessage . Halt , "" , MessageBoxButtons . YesNo , MessageBoxIcon . Warning ) ;
914922 if ( msgbox == DialogResult . Yes )
@@ -1107,8 +1115,8 @@ private void BGThread_DoWork(object sender, DoWorkEventArgs e)
11071115 if ( ! IsInterlaced && String . Equals ( video [ 0 ] . frameRateMode , "VFR" ) )
11081116 {
11091117 // Tell user
1110- FormTitle ( String . Format ( "Queue {0} of {1}: Get timecodes for synchronisation " , x + 1 , queue . Length ) ) ;
1111- InvokeLog ( Log . Info , "Reading source time codes for reference. Please Wait..." ) ;
1118+ FormTitle ( String . Format ( "Queue {0} of {1}: Indexing source video " , x + 1 , queue . Length ) ) ;
1119+ InvokeLog ( Log . Info , "Indexing source for future reference. Please Wait..." ) ;
11121120
11131121 // Get source timecode, this gurantee video and audio in sync (https://github.com/FFMS/ffms2/issues/165)
11141122 // FFmpeg mkvtimestamp_v2 give wrong timecodes, DTS or duplicate frame issue, using FFms Index to provide timecodes
@@ -1183,6 +1191,10 @@ private void BGThread_DoWork(object sender, DoWorkEventArgs e)
11831191 string fmt = stext [ s ] . format . ToLower ( ) ;
11841192 string file = String . Format ( "subtitle_id_{0}_{1}.{2}" , id , iso , fmt ) ;
11851193
1194+ // Just in case
1195+ if ( String . IsNullOrEmpty ( iso ) )
1196+ iso = "und" ;
1197+
11861198 MkvExtractId . SubtitleData [ s , 0 ] = iso ;
11871199 MkvExtractId . SubtitleData [ s , 1 ] = file ;
11881200 MkvExtractId . SubtitleData [ s , 2 ] = id . ToString ( ) ;
@@ -1502,16 +1514,16 @@ private void BGThread_DoWork(object sender, DoWorkEventArgs e)
15021514 }
15031515 else if ( HasSubtitle )
15041516 {
1505- // Turn to disable
1517+ // Turn to disable for next queue
15061518 HasSubtitle = false ;
15071519 for ( int i = 0 ; i < MkvExtractId . SubtitleData . GetLength ( 0 ) ; i ++ )
15081520 {
15091521 if ( MkvExtractId . SubtitleData [ i , 0 ] == null )
15101522 break ;
15111523 string [ ] sp = new string [ 3 ] ;
15121524 sp [ 0 ] = MkvExtractId . SubtitleData [ i , 0 ] ; //lang
1513- sp [ 1 ] = MkvExtractId . SubtitleData [ i , 1 ] . ToUpper ( ) ; //file name only (description?)
1514- sp [ 2 ] = Path . Combine ( tmp , MkvExtractId . SubtitleData [ i , 1 ] ) ; //full path
1525+ sp [ 1 ] = MkvExtractId . SubtitleData [ i , 1 ] . ToUpper ( ) . Replace ( '_' , ' ' ) ; //file name only (description?)
1526+ sp [ 2 ] = Path . Combine ( tmp , MkvExtractId . SubtitleData [ i , 1 ] ) ; //full path
15151527 command += String . Format ( "--language \" 0:{0}\" --track-name \" 0:{1}\" --forced-track 0:no -s 0 -D -A -T --no-global-tags --no-chapters \" (\" \" {2}\" \" )\" " , sp ) ;
15161528 trackorder = trackorder + "," + id . ToString ( ) + ":0" ;
15171529 id ++ ;
@@ -1598,8 +1610,17 @@ private int StartProcess(string exe, string args)
15981610
15991611 if ( OS . IsWindows )
16001612 {
1601- SI . FileName = "cmd.exe" ;
1602- SI . Arguments = String . Format ( "/c start \" IFME\" /D \" {2}\" /WAIT /B \" {0}\" {1}" , exe , args , Globals . AppInfo . CurrentFolder ) ;
1613+
1614+ if ( args . Contains ( '>' ) )
1615+ {
1616+ SI . FileName = "cmd" ;
1617+ SI . Arguments = String . Format ( "/c start \" \" /D \" {2}\" /WAIT /B \" {0}\" {1}" , exe , args , Globals . AppInfo . CurrentFolder ) ;
1618+ }
1619+ else
1620+ {
1621+ SI . FileName = exe ;
1622+ SI . Arguments = args ;
1623+ }
16031624 }
16041625 else
16051626 {
@@ -1975,6 +1996,7 @@ ctrl is CheckBox ||
19751996 Language . IMessage . ResetSettingsAsk = data [ Language . Section . Msg ] [ "ResetSettingsAsk" ] ;
19761997 Language . IMessage . ResetSettingsOK = data [ Language . Section . Msg ] [ "ResetSettingsOK" ] ;
19771998 Language . IMessage . MKVOnly = data [ Language . Section . Msg ] [ "MKVOnly" ] ;
1999+ Language . IMessage . NotEmptyFolder = data [ Language . Section . Msg ] [ "NotEmptyFolder" ] ;
19782000 // ToolTip
19792001 Language . IMessage . ProTipTitle = data [ Language . Section . Pro ] [ "Title" ] ;
19802002 Language . IMessage . ProTipUpdate = data [ Language . Section . Pro ] [ "TellUpdate" ] ;
0 commit comments