@@ -520,6 +520,16 @@ def layout_control(self):
520
520
target_lang .setFixedWidth (150 )
521
521
target_layout .addWidget (target_lang )
522
522
523
+ cache_group = QGroupBox (_ ('Cache Status' ))
524
+ cache_layout = QVBoxLayout (cache_group )
525
+ cache_status = QLabel (
526
+ _ ('Enabled' ) if self .cache .is_persistence () else _ ('Disabled' ))
527
+ cache_status .setAlignment (Qt .AlignCenter )
528
+ cache_status .setStyleSheet (
529
+ 'border-radius:2px;color:white;background-color:%s;'
530
+ % ('green' if self .cache .is_persistence () else 'grey' ))
531
+ cache_layout .addWidget (cache_status )
532
+
523
533
save_group = QGroupBox (_ ('Output Ebook' ))
524
534
save_layout = QHBoxLayout (save_group )
525
535
save_ebook = QPushButton (_ ('Output' ))
@@ -535,6 +545,7 @@ def layout_control(self):
535
545
536
546
ebook_title .textChanged .connect (self .ebook .set_title )
537
547
548
+ layout .addWidget (cache_group )
538
549
layout .addWidget (engine_group )
539
550
layout .addWidget (source_group )
540
551
layout .addWidget (target_group )
@@ -662,8 +673,8 @@ def auto_open_close_splitter():
662
673
663
674
def change_selected_item ():
664
675
rows = self .table .get_selected_rows ()
665
- if not self .on_working and len (rows ) > 0 :
666
- paragraph = self .table .paragraph (rows .pop (0 ))
676
+ if not self .on_working and len (rows ) == 1 :
677
+ paragraph = self .table .paragraph (rows .pop (- 1 ))
667
678
self .raw_text .emit (paragraph .raw )
668
679
self .original_text .emit (paragraph .original )
669
680
self .translation_text [str ].emit (paragraph .translation )
0 commit comments