@@ -39,7 +39,7 @@ public Form1()
3939 Logger . logger . Info ( "🦄//////////////////🦄 - App Started - 🦄///////////////////////🦄" ) ;
4040
4141 const string Caption = "預設會強制指定為由右而左,直排小說的翻頁方向。" ;
42- toolTip . SetToolTip ( chkbModifyPageDirection , Caption ) ;
42+ toolTip . SetToolTip ( cbModifyPageDirection , Caption ) ;
4343 SetInitialValue ( ) ;
4444
4545 //呼叫語言func
@@ -56,13 +56,13 @@ public Form1()
5656
5757 private void SetInitialValue ( )
5858 {
59- chkbToChinese . Checked = ChoHoe . Properties . Settings . Default . ChineseConvert ;
60- chkbModifyPageDirection . Checked = ChoHoe . Properties . Settings . Default . IfChangePageDirection ;
59+ cbToChinese . Checked = ChoHoe . Properties . Settings . Default . ChineseConvert ;
60+ cbModifyPageDirection . Checked = ChoHoe . Properties . Settings . Default . IfChangePageDirection ;
6161 rdoPageRTL . Checked = ChoHoe . Properties . Settings . Default . PageDirection ;
6262 rdoPageLTR . Checked = ! ChoHoe . Properties . Settings . Default . PageDirection ;
63- chkbReplacePicture . Checked = ChoHoe . Properties . Settings . Default . ReplaceImg ;
64- chkbConvertMobi . Checked = ChoHoe . Properties . Settings . Default . ConvertMobi ;
65- chkbEmbdedFont . Checked = ChoHoe . Properties . Settings . Default . EmbedFont ;
63+ cbReplacePicture . Checked = ChoHoe . Properties . Settings . Default . ReplaceImg ;
64+ cbConvertMobi . Checked = ChoHoe . Properties . Settings . Default . ConvertMobi ;
65+ cbEmbdedFont . Checked = ChoHoe . Properties . Settings . Default . EmbedFont ;
6666 btnToTraditionValue . Text = ChoHoe . Properties . Settings . Default . ToTriditional ? ">" : "<" ;
6767 ToTradictional = ChoHoe . Properties . Settings . Default . ToTriditional ;
6868
@@ -194,7 +194,7 @@ private void btnConvert_Click(object sender, EventArgs e)
194194
195195 btnConvert . Enabled = false ;
196196
197- bwConvert . RunWorkerAsync ( argument : chkbModifyPageDirection . Checked ) ;
197+ bwConvert . RunWorkerAsync ( argument : cbModifyPageDirection . Checked ) ;
198198
199199
200200 }
@@ -288,8 +288,9 @@ private void btnConvertBatch_Click(object sender, EventArgs e)
288288
289289 Logger . logger . Info ( "開始轉檔" ) ;
290290
291+ Tuple < bool , bool > variables = new Tuple < bool , bool > ( cbModifyPageDirection . Checked , cbRemoveCss . Checked ) ;
291292
292- bwConvertBatch . RunWorkerAsync ( argument : chkbModifyPageDirection . Checked ) ;
293+ bwConvertBatch . RunWorkerAsync ( argument : variables ) ;
293294 }
294295
295296 private void rdoPageRTL_CheckedChanged ( object sender , EventArgs e )
@@ -310,9 +311,9 @@ private void rdoPageLTR_CheckedChanged(object sender, EventArgs e)
310311 }
311312 }
312313
313- private void chkbToChinese_CheckChanged ( object sender , EventArgs e )
314+ private void cbToChinese_CheckChanged ( object sender , EventArgs e )
314315 {
315- ChoHoe . Properties . Settings . Default . ChineseConvert = chkbToChinese . Checked ;
316+ ChoHoe . Properties . Settings . Default . ChineseConvert = cbToChinese . Checked ;
316317 ChoHoe . Properties . Settings . Default . Save ( ) ;
317318 }
318319
@@ -321,27 +322,27 @@ private void Form1_FormClosing(object sender, FormClosingEventArgs e)
321322 ChoHoe . Properties . Settings . Default . Save ( ) ;
322323 }
323324
324- private void chkbModifyPageDirection_CheckedChanged ( object sender , EventArgs e )
325+ private void cbModifyPageDirection_CheckedChanged ( object sender , EventArgs e )
325326 {
326- ChoHoe . Properties . Settings . Default . IfChangePageDirection = chkbModifyPageDirection . Checked ;
327+ ChoHoe . Properties . Settings . Default . IfChangePageDirection = cbModifyPageDirection . Checked ;
327328 ChoHoe . Properties . Settings . Default . Save ( ) ;
328329 }
329330
330- private void chkbReplacePicture_CheckedChanged ( object sender , EventArgs e )
331+ private void cbReplacePicture_CheckedChanged ( object sender , EventArgs e )
331332 {
332- ChoHoe . Properties . Settings . Default . ReplaceImg = chkbReplacePicture . Checked ;
333+ ChoHoe . Properties . Settings . Default . ReplaceImg = cbReplacePicture . Checked ;
333334 ChoHoe . Properties . Settings . Default . Save ( ) ;
334335 }
335336
336- private void chkbConvertMobi_CheckedChanged ( object sender , EventArgs e )
337+ private void cbConvertMobi_CheckedChanged ( object sender , EventArgs e )
337338 {
338- ChoHoe . Properties . Settings . Default . ConvertMobi = chkbConvertMobi . Checked ;
339+ ChoHoe . Properties . Settings . Default . ConvertMobi = cbConvertMobi . Checked ;
339340 ChoHoe . Properties . Settings . Default . Save ( ) ;
340341 }
341342
342- private void chkbEmbdedFont_CheckedChanged ( object sender , EventArgs e )
343+ private void cbEmbdedFont_CheckedChanged ( object sender , EventArgs e )
343344 {
344- ChoHoe . Properties . Settings . Default . EmbedFont = chkbEmbdedFont . Checked ;
345+ ChoHoe . Properties . Settings . Default . EmbedFont = cbEmbdedFont . Checked ;
345346 ChoHoe . Properties . Settings . Default . Save ( ) ;
346347 }
347348
@@ -408,11 +409,11 @@ private void Convert_Backgroundworker_DoWork(object sender, DoWorkEventArgs e)
408409
409410 if ( Modifypage )
410411 {
411- abook . Convert ( chkbToChinese . Checked , ToTradictional , rdoPageRTL . Checked , chkbConvertMobi . Checked , chkbEmbdedFont . Checked , chkbReplacePicture . Checked , txtAuthor . Text , txtTittle . Text ) ;
412+ abook . Convert ( cbToChinese . Checked , ToTradictional , rdoPageRTL . Checked , cbConvertMobi . Checked , cbEmbdedFont . Checked , cbReplacePicture . Checked , txtAuthor . Text , txtTittle . Text ) ;
412413 }
413414 else
414415 {
415- abook . Convert ( chkbToChinese . Checked , ToTradictional , true , chkbConvertMobi . Checked , chkbEmbdedFont . Checked , chkbReplacePicture . Checked , txtAuthor . Text , txtTittle . Text ) ;
416+ abook . Convert ( cbToChinese . Checked , ToTradictional , true , cbConvertMobi . Checked , cbEmbdedFont . Checked , cbReplacePicture . Checked , txtAuthor . Text , txtTittle . Text ) ;
416417 }
417418 e . Cancel = true ;
418419 return ;
@@ -433,17 +434,23 @@ private void Convert_RunWorker_Completed(object sender, RunWorkerCompletedEventA
433434
434435 private void Convert_Batch_Backgroundworker_DoWork ( object sender , DoWorkEventArgs e )
435436 {
436- bool Modifypage = ( bool ) e . Argument ;
437437
438+ Tuple < bool , bool > para = ( Tuple < bool , bool > ) e . Argument ;
439+ bool Modifypage = para . Item1 ;
440+ bool RemoveCss = para . Item2 ;
441+
442+
443+
438444 foreach ( Book item in batchBookList )
439445 {
446+ item . IsRemoveCss ( RemoveCss ) ;
440447 if ( Modifypage )
441448 {
442- item . Convert ( chkbChineseBatch . Checked , BatchToTradictional , rdoPageRTLBatch . Checked , chkbConvertMobiBatch . Checked , chkbEmbdedFontBatch . Checked , chkbReplacePictureBatch . Checked , item . GetAuthor ( ) , item . GetTitle ( ) ) ;
449+ item . Convert ( cbChineseBatch . Checked , BatchToTradictional , rdoPageRTLBatch . Checked , cbConvertMobiBatch . Checked , cbEmbdedFontBatch . Checked , cbReplacePictureBatch . Checked , item . GetAuthor ( ) , item . GetTitle ( ) ) ;
443450 }
444451 else
445452 {
446- item . Convert ( chkbChineseBatch . Checked , BatchToTradictional , true , chkbConvertMobiBatch . Checked , chkbEmbdedFontBatch . Checked , chkbReplacePictureBatch . Checked , item . GetAuthor ( ) , item . GetTitle ( ) ) ;
453+ item . Convert ( cbChineseBatch . Checked , BatchToTradictional , true , cbConvertMobiBatch . Checked , cbEmbdedFontBatch . Checked , cbReplacePictureBatch . Checked , item . GetAuthor ( ) , item . GetTitle ( ) ) ;
447454 }
448455 }
449456 e . Cancel = true ;
@@ -539,34 +546,34 @@ private void btnDelete_Click(object sender, EventArgs e)
539546
540547 }
541548
542- private void chkbChineseBatch_CheckedChanged ( object sender , EventArgs e )
549+ private void cbChineseBatch_CheckedChanged ( object sender , EventArgs e )
543550 {
544- ChoHoe . Properties . Settings . Default . Batch_ChineseConvert = chkbChineseBatch . Checked ;
551+ ChoHoe . Properties . Settings . Default . Batch_ChineseConvert = cbChineseBatch . Checked ;
545552 ChoHoe . Properties . Settings . Default . Save ( ) ;
546553 }
547554
548- private void chkbModifyPageDirectionBatch_CheckedChanged ( object sender , EventArgs e )
555+ private void cbModifyPageDirectionBatch_CheckedChanged ( object sender , EventArgs e )
549556 {
550- ChoHoe . Properties . Settings . Default . Batch_IfChangePageDirection = chkbModifyPageDirectionBatch . Checked ;
557+ ChoHoe . Properties . Settings . Default . Batch_IfChangePageDirection = cbModifyPageDirectionBatch . Checked ;
551558 ChoHoe . Properties . Settings . Default . Save ( ) ;
552559 }
553560
554- private void chkbConvertMobiBatch_CheckedChanged ( object sender , EventArgs e )
561+ private void cbConvertMobiBatch_CheckedChanged ( object sender , EventArgs e )
555562 {
556- ChoHoe . Properties . Settings . Default . Batch_ConvertMobi = chkbConvertMobiBatch . Checked ;
563+ ChoHoe . Properties . Settings . Default . Batch_ConvertMobi = cbConvertMobiBatch . Checked ;
557564 ChoHoe . Properties . Settings . Default . Save ( ) ;
558565 }
559566
560- private void chkbReplacePictureBatch_CheckedChanged ( object sender , EventArgs e )
567+ private void cbReplacePictureBatch_CheckedChanged ( object sender , EventArgs e )
561568 {
562- ChoHoe . Properties . Settings . Default . Batch_ReplaceImg = chkbReplacePictureBatch . Checked ;
569+ ChoHoe . Properties . Settings . Default . Batch_ReplaceImg = cbReplacePictureBatch . Checked ;
563570 ChoHoe . Properties . Settings . Default . Save ( ) ;
564571 }
565572
566- private void chkbEmbdedFontBatch_CheckedChanged ( object sender , EventArgs e )
573+ private void cbEmbdedFontBatch_CheckedChanged ( object sender , EventArgs e )
567574 {
568575 ChoHoe . Properties . Settings . Default . Batch_EmbedFont
569- = chkbEmbdedFontBatch . Checked ;
576+ = cbEmbdedFontBatch . Checked ;
570577 ChoHoe . Properties . Settings . Default . Save ( ) ;
571578 }
572579
@@ -609,6 +616,12 @@ private void runningUi(string message, bool enabled)
609616
610617 }
611618
619+ private void cbRemoveCss_CheckedChanged ( object sender , EventArgs e )
620+ {
621+ ChoHoe . Properties . Settings . Default . Batch_RemoveCss
622+ = cbRemoveCss . Checked ;
623+ ChoHoe . Properties . Settings . Default . Save ( ) ;
624+ }
612625 }
613626
614627}
0 commit comments