def __init__(self, main): super().__init__(main) # Kilgarriff's Ratio group_box_kilgarriffs_ratio = QGroupBox(self.tr('Kilgarriff\'s Ratio'), self) self.label_kilgarriffs_ratio_smoothing_param = QLabel( self.tr('Smoothing Parameter:'), self) self.spin_box_kilgarriffs_ratio_smoothing_param = wl_box.Wl_Double_Spin_Box( self) self.spin_box_kilgarriffs_ratio_smoothing_param.setRange(0.01, 10000) group_box_kilgarriffs_ratio.setLayout(wl_layout.Wl_Layout()) group_box_kilgarriffs_ratio.layout().addWidget( self.label_kilgarriffs_ratio_smoothing_param, 0, 0) group_box_kilgarriffs_ratio.layout().addWidget( self.spin_box_kilgarriffs_ratio_smoothing_param, 0, 1) group_box_kilgarriffs_ratio.layout().setColumnStretch(2, 1) self.setLayout(wl_layout.Wl_Layout()) self.layout().addWidget(group_box_kilgarriffs_ratio, 0, 0) self.layout().setContentsMargins(6, 4, 6, 4) self.layout().setRowStretch(1, 1)
def __init__(self, main): super().__init__(main) # General group_box_general = QGroupBox(self.tr('General'), self) (self.label_dispersion_divide, self.spin_box_dispersion_number_sections, self.label_dispersion_sections ) = wl_widgets.wl_widgets_number_sections(self) group_box_general.setLayout(wl_layout.Wl_Layout()) group_box_general.layout().addWidget(self.label_dispersion_divide, 0, 0) group_box_general.layout().addWidget( self.spin_box_dispersion_number_sections, 0, 1) group_box_general.layout().addWidget(self.label_dispersion_sections, 0, 2) group_box_general.layout().setColumnStretch(3, 1) self.setLayout(wl_layout.Wl_Layout()) self.layout().addWidget(group_box_general, 0, 0) self.layout().setContentsMargins(6, 4, 6, 4) self.layout().setRowStretch(1, 1)
def __init__(self, main): super().__init__(main) # Detection Settings group_box_detection_settings = QGroupBox(self.tr('Detection Settings'), self) self.label_auto_detection_number_lines = QLabel( self.tr('Number of lines to scan in each file:'), self) (self.spin_box_auto_detection_number_lines, self.checkbox_auto_detection_number_lines_no_limit ) = wl_widgets.wl_widgets_no_limit(self) self.spin_box_auto_detection_number_lines.setRange(1, 1000000) group_box_detection_settings.setLayout(wl_layout.Wl_Layout()) group_box_detection_settings.layout().addWidget( self.label_auto_detection_number_lines, 0, 0) group_box_detection_settings.layout().addWidget( self.spin_box_auto_detection_number_lines, 0, 1) group_box_detection_settings.layout().addWidget( self.checkbox_auto_detection_number_lines_no_limit, 0, 2) group_box_detection_settings.layout().setColumnStretch(3, 1) # Default Settings group_box_default_settings = QGroupBox(self.tr('Default Settings'), self) self.label_auto_detection_default_lang = QLabel( self.tr('Default Language:'), self) self.combo_box_auto_detection_default_lang = wl_box.Wl_Combo_Box_Lang( self) self.label_auto_detection_default_encoding = QLabel( self.tr('Default Encoding:'), self) self.combo_box_auto_detection_default_encoding = wl_box.Wl_Combo_Box_Encoding( self) group_box_default_settings.setLayout(wl_layout.Wl_Layout()) group_box_default_settings.layout().addWidget( self.label_auto_detection_default_lang, 0, 0) group_box_default_settings.layout().addWidget( self.combo_box_auto_detection_default_lang, 0, 1) group_box_default_settings.layout().addWidget( self.label_auto_detection_default_encoding, 1, 0) group_box_default_settings.layout().addWidget( self.combo_box_auto_detection_default_encoding, 1, 1) group_box_default_settings.layout().setColumnStretch(3, 1) self.setLayout(wl_layout.Wl_Layout()) self.layout().addWidget(group_box_detection_settings, 0, 0) self.layout().addWidget(group_box_default_settings, 1, 0) self.layout().setContentsMargins(6, 4, 6, 4) self.layout().setRowStretch(2, 1)
def __init__(self, main): super().__init__(main) # Rank Settings group_box_rank_settings = QGroupBox(self.tr('Rank Settings'), self) self.checkbox_continue_numbering_after_ties = QCheckBox( self.tr('Continue numbering after ties'), self) group_box_rank_settings.setLayout(wl_layout.Wl_Layout()) group_box_rank_settings.layout().addWidget( self.checkbox_continue_numbering_after_ties, 0, 0) group_box_rank_settings.layout().setRowStretch(1, 0) # Precision Settings group_box_precision_settings = QGroupBox(self.tr('Precision Settings'), self) self.label_precision_decimal = QLabel(self.tr('Decimal:'), self) self.spin_box_precision_decimal = wl_box.Wl_Spin_Box(self) self.label_precision_pct = QLabel(self.tr('Percentage:'), self) self.spin_box_precision_pct = wl_box.Wl_Spin_Box(self) self.label_precision_p_value = QLabel(self.tr('p-value:'), self) self.spin_box_precision_p_value = wl_box.Wl_Spin_Box(self) self.spin_box_precision_decimal.setRange(0, 10) self.spin_box_precision_pct.setRange(0, 10) self.spin_box_precision_p_value.setRange(0, 15) group_box_precision_settings.setLayout(wl_layout.Wl_Layout()) group_box_precision_settings.layout().addWidget( self.label_precision_decimal, 0, 0) group_box_precision_settings.layout().addWidget( self.spin_box_precision_decimal, 0, 1) group_box_precision_settings.layout().addWidget( self.label_precision_pct, 1, 0) group_box_precision_settings.layout().addWidget( self.spin_box_precision_pct, 1, 1) group_box_precision_settings.layout().addWidget( self.label_precision_p_value, 2, 0) group_box_precision_settings.layout().addWidget( self.spin_box_precision_p_value, 2, 1) group_box_precision_settings.layout().setColumnStretch(2, 1) self.setLayout(wl_layout.Wl_Layout()) self.layout().addWidget(group_box_rank_settings, 0, 0) self.layout().addWidget(group_box_precision_settings, 1, 0) self.layout().setContentsMargins(6, 4, 6, 4) self.layout().setRowStretch(2, 1)
def __init__(self, main): super().__init__(main) # Font Settings group_box_font_settings = QGroupBox(self.tr('Font Settings'), self) self.label_font_family = QLabel(self.tr('Font Family:'), self) self.combo_box_font_family = wl_box.Wl_Combo_Box_Font_Family(self) self.label_font_size = QLabel(self.tr('Font Size:'), self) self.combo_box_font_size = wl_box.Wl_Combo_Box_Font_Size(self) group_box_font_settings.setLayout(QGridLayout()) group_box_font_settings.layout().addWidget(self.label_font_family, 0, 0) group_box_font_settings.layout().addWidget(self.combo_box_font_family, 0, 1) group_box_font_settings.layout().addWidget(self.label_font_size, 1, 0) group_box_font_settings.layout().addWidget(self.combo_box_font_size, 1, 1) group_box_font_settings.layout().setColumnStretch(2, 1) # Update Settings group_box_update_settings = QGroupBox(self.tr('Update Settings'), self) self.checkbox_check_updates_on_startup = QCheckBox( self.tr('Check for updates on startup'), self) group_box_update_settings.setLayout(wl_layout.Wl_Layout()) group_box_update_settings.layout().addWidget( self.checkbox_check_updates_on_startup, 0, 0) # Miscellaneous group_box_misc = QGroupBox(self.tr('Miscellaneous'), self) self.checkbox_confirm_on_exit = QCheckBox( self.tr('Always confirm on exit'), self) group_box_misc.setLayout(wl_layout.Wl_Layout()) group_box_misc.layout().addWidget(self.checkbox_confirm_on_exit, 0, 0) self.setLayout(wl_layout.Wl_Layout()) self.layout().addWidget(group_box_font_settings, 0, 0) self.layout().addWidget(group_box_update_settings, 1, 0) self.layout().addWidget(group_box_misc, 2, 0) self.layout().setContentsMargins(6, 4, 6, 4) self.layout().setRowStretch(3, 1)
def __init__(self, main, table): super().__init__(main, main.tr('Sort Results')) self.table = table self.settings = self.main.settings_custom['concordancer'][ 'sort_results'] self.table_sort = wl_table.Wl_Table_Results_Sort_Conordancer( self, self.table) self.button_reset_settings = wl_button.Wl_Button_Reset_Settings(self) self.button_sort = QPushButton(self.tr('Sort'), self) self.button_close = QPushButton(self.tr('Close'), self) self.table_sort.setFixedWidth(280) self.button_reset_settings.setFixedWidth(130) self.button_sort.setFixedWidth(80) self.button_close.setFixedWidth(80) self.table_sort.itemChanged.connect(self.sort_table_changed) self.button_sort.clicked.connect( lambda: self.table_sort.sort_results()) self.button_close.clicked.connect(self.reject) layout_table_sort = wl_layout.Wl_Layout() layout_table_sort.addWidget(self.table_sort, 0, 0, 4, 1) layout_table_sort.addWidget(self.table_sort.button_add, 0, 1) layout_table_sort.addWidget(self.table_sort.button_insert, 1, 1) layout_table_sort.addWidget(self.table_sort.button_remove, 2, 1) layout_table_sort.setRowStretch(3, 1) self.setLayout(wl_layout.Wl_Layout()) self.layout().addLayout(layout_table_sort, 0, 0, 1, 4) self.layout().addWidget(wl_layout.Wl_Separator(self), 1, 0, 1, 4) self.layout().addWidget(self.button_reset_settings, 2, 0) self.layout().addWidget(self.button_sort, 2, 2) self.layout().addWidget(self.button_close, 2, 3) self.layout().setColumnStretch(1, 1) self.set_fixed_size()
def __init__(self, main): super().__init__(main) # POS Tag Settings group_box_pos_tag_settings = QGroupBox(self.tr('POS Tag Settings'), self) self.table_tags_pos = Wl_Table_Tags_Pos(self) group_box_pos_tag_settings.setLayout(wl_layout.Wl_Layout()) group_box_pos_tag_settings.layout().addWidget(self.table_tags_pos, 0, 0, 1, 3) group_box_pos_tag_settings.layout().addWidget( self.table_tags_pos.button_add, 1, 0) group_box_pos_tag_settings.layout().addWidget( self.table_tags_pos.button_remove, 1, 1) group_box_pos_tag_settings.layout().addWidget( self.table_tags_pos.button_reset, 1, 2) # Non-POS Tag Settings group_box_non_pos_tag_settings = QGroupBox( self.tr('Non-POS Tag Settings'), self) self.table_tags_non_pos = Wl_Table_Tags_Non_Pos(self) group_box_non_pos_tag_settings.setLayout(wl_layout.Wl_Layout()) group_box_non_pos_tag_settings.layout().addWidget( self.table_tags_non_pos, 0, 0, 1, 3) group_box_non_pos_tag_settings.layout().addWidget( self.table_tags_non_pos.button_add, 1, 0) group_box_non_pos_tag_settings.layout().addWidget( self.table_tags_non_pos.button_remove, 1, 1) group_box_non_pos_tag_settings.layout().addWidget( self.table_tags_non_pos.button_reset, 1, 2) self.setLayout(wl_layout.Wl_Layout()) self.layout().addWidget(group_box_pos_tag_settings, 0, 0) self.layout().addWidget(group_box_non_pos_tag_settings, 1, 0) self.layout().setContentsMargins(6, 4, 6, 4) self.layout().setRowStretch(2, 1)
def __init__(self, main): super().__init__(main, main.tr('Citing'), width = 450, no_button = True) self.label_citing = wl_label.Wl_Label_Dialog( self.tr(''' <div> If you publish work that uses Wordless, please cite as follows. </div> '''), self ) self.label_citation_sys = QLabel(self.tr('Citation System:'), self) self.combo_box_citation_sys = wl_box.Wl_Combo_Box(self) self.text_edit_citing = QTextEdit(self) self.button_copy = QPushButton(self.tr('Copy'), self) self.button_close = QPushButton(self.tr('Close'), self) self.combo_box_citation_sys.addItems([ self.tr('APA (7th Edition)'), self.tr('MLA (8th Edition)') ]) self.button_copy.setFixedWidth(100) self.button_close.setFixedWidth(100) self.text_edit_citing.setFixedHeight(100) self.text_edit_citing.setReadOnly(True) self.combo_box_citation_sys.currentTextChanged.connect(self.citation_sys_changed) self.button_copy.clicked.connect(self.copy) self.button_close.clicked.connect(self.accept) layout_citation_sys = wl_layout.Wl_Layout() layout_citation_sys.addWidget(self.label_citation_sys, 0, 0) layout_citation_sys.addWidget(self.combo_box_citation_sys, 0, 1) layout_citation_sys.setColumnStretch(2, 1) self.wrapper_info.layout().addWidget(self.label_citing, 0, 0, 1, 2) self.wrapper_info.layout().addLayout(layout_citation_sys, 1, 0, 1, 2) self.wrapper_info.layout().addWidget(self.text_edit_citing, 2, 0, 1, 2) self.wrapper_buttons.layout().addWidget(self.button_copy, 0, 0) self.wrapper_buttons.layout().addWidget(self.button_close, 0, 1) self.load_settings() self.set_fixed_height()
def __init__(self, main, title, width=0, height=0, no_button=False): super().__init__(main, title, width, height) self.setWindowFlag(Qt.MSWindowsFixedSizeDialogHint, True) self.setWindowFlag(Qt.WindowContextHelpButtonHint, False) self.wrapper_info = QWidget(self) self.wrapper_info.setObjectName('wrapper-info') self.wrapper_info.setStyleSheet(''' QWidget#wrapper-info { border-bottom: 1px solid #B0B0B0; background-color: #FFF; } ''') self.wrapper_info.setLayout(wl_layout.Wl_Layout()) self.wrapper_info.layout().setContentsMargins(20, 10, 20, 10) self.wrapper_buttons = QWidget(self) self.wrapper_buttons.setLayout(wl_layout.Wl_Layout()) self.wrapper_buttons.layout().setContentsMargins(11, 0, 11, 11) if not no_button: self.button_ok = QPushButton(self.tr('OK'), self) self.button_ok.clicked.connect(self.accept) self.wrapper_buttons.layout().addWidget(self.button_ok, 0, 0, Qt.AlignRight) self.setLayout(wl_layout.Wl_Layout()) self.layout().addWidget(self.wrapper_info, 0, 0) self.layout().addWidget(self.wrapper_buttons, 1, 0) self.layout().setRowStretch(0, 1) self.layout().setContentsMargins(0, 0, 0, 0)
def __init__(self, main): super().__init__(main) # General group_box_general = QGroupBox(self.tr('General'), self) (self.label_adjusted_freq_divide, self.spin_box_adjusted_freq_number_sections, self.label_adjusted_freq_sections ) = wl_widgets.wl_widgets_number_sections(self) self.checkbox_use_same_settings_dispersion = QCheckBox( self.tr( 'Use same settings in "Settings -> Measures -> Dispersion"'), self) self.checkbox_use_same_settings_dispersion.stateChanged.connect( self.use_same_settings_changed) group_box_general.setLayout(wl_layout.Wl_Layout()) group_box_general.layout().addWidget(self.label_adjusted_freq_divide, 0, 0) group_box_general.layout().addWidget( self.spin_box_adjusted_freq_number_sections, 0, 1) group_box_general.layout().addWidget(self.label_adjusted_freq_sections, 0, 2) group_box_general.layout().addWidget( self.checkbox_use_same_settings_dispersion, 1, 0, 1, 4) group_box_general.layout().setColumnStretch(3, 1) self.setLayout(wl_layout.Wl_Layout()) self.layout().addWidget(group_box_general, 0, 0) self.layout().setContentsMargins(6, 4, 6, 4) self.layout().setRowStretch(1, 1) self.use_same_settings_changed()
def init_central_widget(self): self.wl_file_area = wl_file_area.Wrapper_File_Area(self) self.init_work_area() wrapper_file_area = QWidget() wrapper_file_area.setLayout(wl_layout.Wl_Layout()) wrapper_file_area.layout().addWidget(self.wl_file_area, 0, 0) if platform.system() == 'Windows': self.wl_file_area.layout().setContentsMargins(2, 0, 2, 0) wrapper_file_area.layout().setContentsMargins(0, 0, 2, 0) elif platform.system() == 'Darwin': wrapper_file_area.layout().setContentsMargins(3, 0, 3, 0) elif platform.system() == 'Linux': self.wl_file_area.layout().setContentsMargins(0, 0, 2, 0) wrapper_file_area.layout().setContentsMargins(0, 0, 0, 0) splitter_central_widget = wl_layout.Wl_Splitter(Qt.Vertical, self) splitter_central_widget.addWidget(self.wl_work_area) splitter_central_widget.addWidget(wrapper_file_area) if platform.system() in ['Windows', 'Linux']: splitter_central_widget.setHandleWidth(1) elif platform.system() == 'Darwin': splitter_central_widget.setHandleWidth(2) splitter_central_widget.setObjectName('splitter-central-widget') splitter_central_widget.setStyleSheet(''' QSplitter#splitter-central-widget { padding: 4px 6px; } ''') splitter_central_widget.setStretchFactor(0, 1) self.setCentralWidget(splitter_central_widget)
def __init__(self, main): super().__init__(main) self.time_start = time.time() self.timer_time_elapsed = QTimer(self) self.label_progress = QLabel('', self) self.label_time_elapsed = QLabel(self.tr('Elapsed Time: 0:00:00'), self) self.label_processing = wl_label.Wl_Label_Dialog( self. tr('Please wait. It may take a few seconds to several minutes for the operation to be completed.' ), self) self.timer_time_elapsed.timeout.connect(self.update_elapsed_time) self.timer_time_elapsed.start(1000) self.setLayout(wl_layout.Wl_Layout()) self.layout().addWidget(self.label_progress, 0, 0) self.layout().addWidget(self.label_time_elapsed, 0, 1, Qt.AlignRight) self.layout().addWidget(self.label_processing, 1, 0, 1, 2) self.layout().setContentsMargins(20, 10, 20, 10)
def __init__(self, main): super().__init__(main) # Table self.table_overview = Wl_Table_Overview(self) self.wrapper_table.layout().addWidget(self.table_overview, 0, 0, 1, 4) self.wrapper_table.layout().addWidget( self.table_overview.button_generate_table, 1, 0) self.wrapper_table.layout().addWidget( self.table_overview.button_export_selected, 1, 1) self.wrapper_table.layout().addWidget( self.table_overview.button_export_all, 1, 2) self.wrapper_table.layout().addWidget(self.table_overview.button_clear, 1, 3) # Token Settings self.group_box_token_settings = QGroupBox(self.tr('Token Settings'), self) (self.checkbox_words, self.checkbox_lowercase, self.checkbox_uppercase, self.checkbox_title_case, self.checkbox_nums, self.checkbox_puncs, self.checkbox_treat_as_lowercase, self.checkbox_lemmatize_tokens, self.checkbox_filter_stop_words, self.stacked_widget_ignore_tags, self.checkbox_ignore_tags, self.checkbox_ignore_tags_tags, self.stacked_widget_ignore_tags_type, self.combo_box_ignore_tags, self.combo_box_ignore_tags_tags, self.label_ignore_tags, self.checkbox_use_tags) = wl_widgets.wl_widgets_token_settings(self) self.checkbox_words.stateChanged.connect(self.token_settings_changed) self.checkbox_lowercase.stateChanged.connect( self.token_settings_changed) self.checkbox_uppercase.stateChanged.connect( self.token_settings_changed) self.checkbox_title_case.stateChanged.connect( self.token_settings_changed) self.checkbox_nums.stateChanged.connect(self.token_settings_changed) self.checkbox_puncs.stateChanged.connect(self.token_settings_changed) self.checkbox_treat_as_lowercase.stateChanged.connect( self.token_settings_changed) self.checkbox_lemmatize_tokens.stateChanged.connect( self.token_settings_changed) self.checkbox_filter_stop_words.stateChanged.connect( self.token_settings_changed) self.checkbox_ignore_tags.stateChanged.connect( self.token_settings_changed) self.checkbox_ignore_tags_tags.stateChanged.connect( self.token_settings_changed) self.combo_box_ignore_tags.currentTextChanged.connect( self.token_settings_changed) self.combo_box_ignore_tags_tags.currentTextChanged.connect( self.token_settings_changed) self.checkbox_use_tags.stateChanged.connect( self.token_settings_changed) layout_ignore_tags = wl_layout.Wl_Layout() layout_ignore_tags.addWidget(self.stacked_widget_ignore_tags, 0, 0) layout_ignore_tags.addWidget(self.stacked_widget_ignore_tags_type, 0, 1) layout_ignore_tags.addWidget(self.label_ignore_tags, 0, 2) layout_ignore_tags.setColumnStretch(3, 1) self.group_box_token_settings.setLayout(wl_layout.Wl_Layout()) self.group_box_token_settings.layout().addWidget( self.checkbox_words, 0, 0) self.group_box_token_settings.layout().addWidget( self.checkbox_lowercase, 0, 1) self.group_box_token_settings.layout().addWidget( self.checkbox_uppercase, 1, 0) self.group_box_token_settings.layout().addWidget( self.checkbox_title_case, 1, 1) self.group_box_token_settings.layout().addWidget( self.checkbox_nums, 2, 0) self.group_box_token_settings.layout().addWidget( self.checkbox_puncs, 2, 1) self.group_box_token_settings.layout().addWidget( wl_layout.Wl_Separator(self), 3, 0, 1, 2) self.group_box_token_settings.layout().addWidget( self.checkbox_treat_as_lowercase, 4, 0, 1, 2) self.group_box_token_settings.layout().addWidget( self.checkbox_lemmatize_tokens, 5, 0, 1, 2) self.group_box_token_settings.layout().addWidget( self.checkbox_filter_stop_words, 6, 0, 1, 2) self.group_box_token_settings.layout().addWidget( wl_layout.Wl_Separator(self), 7, 0, 1, 2) self.group_box_token_settings.layout().addLayout( layout_ignore_tags, 8, 0, 1, 2) self.group_box_token_settings.layout().addWidget( self.checkbox_use_tags, 9, 0, 1, 2) # Generation Settings self.group_box_generation_settings = QGroupBox( self.tr('Generation Settings'), self) self.label_base_sttr = QLabel( self.tr('Base of standardized type-token ratio:'), self) self.spin_box_base_sttr = wl_box.Wl_Spin_Box(self) self.spin_box_base_sttr.setRange(100, 10000) self.spin_box_base_sttr.valueChanged.connect( self.generation_settings_changed) self.group_box_generation_settings.setLayout(wl_layout.Wl_Layout()) self.group_box_generation_settings.layout().addWidget( self.label_base_sttr, 0, 0) self.group_box_generation_settings.layout().addWidget( self.spin_box_base_sttr, 1, 0) # Table Settings self.group_box_table_settings = QGroupBox(self.tr('Table Settings'), self) (self.checkbox_show_pct, self.checkbox_show_cumulative, self.checkbox_show_breakdown) = wl_widgets.wl_widgets_table_settings( self, table=self.table_overview) self.checkbox_show_pct.stateChanged.connect( self.table_settings_changed) self.checkbox_show_cumulative.stateChanged.connect( self.table_settings_changed) self.checkbox_show_breakdown.stateChanged.connect( self.table_settings_changed) self.group_box_table_settings.setLayout(wl_layout.Wl_Layout()) self.group_box_table_settings.layout().addWidget( self.checkbox_show_pct, 0, 0) self.group_box_table_settings.layout().addWidget( self.checkbox_show_cumulative, 1, 0) self.group_box_table_settings.layout().addWidget( self.checkbox_show_breakdown, 2, 0) self.wrapper_settings.layout().addWidget(self.group_box_token_settings, 0, 0) self.wrapper_settings.layout().addWidget( self.group_box_generation_settings, 1, 0) self.wrapper_settings.layout().addWidget(self.group_box_table_settings, 2, 0) self.wrapper_settings.layout().setRowStretch(3, 1) self.load_settings()
def wl_widgets_search_settings(parent, tab): def multi_search_mode_changed(): if checkbox_multi_search_mode.isChecked(): label_search_term.setText(parent.tr('Search Terms:')) if line_edit_search_term.text() and list_search_terms.count() == 0: list_search_terms.load_items([line_edit_search_term.text()]) stacked_widget_search_term.setCurrentIndex(1) else: label_search_term.setText(parent.tr('Search Term:')) stacked_widget_search_term.setCurrentIndex(0) def token_settings_changed(): token_settings = main.settings_custom[tab]['token_settings'] checkbox_ignore_tags.blockSignals(True) checkbox_match_tags.blockSignals(True) if token_settings['ignore_tags']: checkbox_ignore_tags.setEnabled(False) checkbox_match_tags.setEnabled(False) else: checkbox_ignore_tags.setEnabled(True) checkbox_match_tags.setEnabled(True) if token_settings['use_tags']: checkbox_ignore_tags.setEnabled(False) checkbox_match_tags.setEnabled(False) else: checkbox_ignore_tags.setEnabled(True) checkbox_match_tags.setEnabled(True) checkbox_ignore_tags.blockSignals(False) checkbox_match_tags.blockSignals(False) def ignore_tags_changed(): if checkbox_ignore_tags.isChecked(): checkbox_match_tags.setEnabled(False) checkbox_match_tags.setChecked(False) else: checkbox_match_tags.setEnabled(True) def match_tags_changed(): if checkbox_match_tags.isChecked(): checkbox_match_inflected_forms.setEnabled(False) checkbox_ignore_tags.setEnabled(False) checkbox_ignore_tags.setChecked(False) else: checkbox_match_inflected_forms.setEnabled(True) checkbox_ignore_tags.setEnabled(True) main = wl_misc.find_wl_main(parent) label_search_term = QLabel(parent.tr('Search Term:'), parent) checkbox_multi_search_mode = QCheckBox(parent.tr('Multi-search Mode'), parent) line_edit_search_term = QLineEdit(parent) list_search_terms = wl_list.Wl_List_Search_Terms(parent) label_separator = wl_label.Wl_Label_Hint(parent.tr('* Use space to separate multiple tokens'), parent) checkbox_ignore_case = QCheckBox(parent.tr('Ignore case'), parent) checkbox_match_inflected_forms = QCheckBox(parent.tr('Match all inflected forms'), parent) checkbox_match_whole_words = QCheckBox(parent.tr('Match whole words only'), parent) checkbox_use_regex = QCheckBox(parent.tr('Use regular expression'), parent) checkbox_ignore_tags = QCheckBox(parent.tr('Ignore tags'), parent) checkbox_match_tags = QCheckBox(parent.tr('Match tags only'), parent) wrapper_search_terms = QWidget(parent) wrapper_search_terms.setLayout(wl_layout.Wl_Layout()) wrapper_search_terms.layout().addWidget(list_search_terms, 0, 0, 5, 1) wrapper_search_terms.layout().addWidget(list_search_terms.button_add, 0, 1) wrapper_search_terms.layout().addWidget(list_search_terms.button_remove, 1, 1) wrapper_search_terms.layout().addWidget(list_search_terms.button_clear, 2, 1) wrapper_search_terms.layout().addWidget(list_search_terms.button_import, 3, 1) wrapper_search_terms.layout().addWidget(list_search_terms.button_export, 4, 1) wrapper_search_terms.layout().setContentsMargins(0, 0, 0, 0) stacked_widget_search_term = wl_layout.Wl_Stacked_Widget(parent) stacked_widget_search_term.addWidget(line_edit_search_term) stacked_widget_search_term.addWidget(wrapper_search_terms) checkbox_match_tags.token_settings_changed = token_settings_changed checkbox_multi_search_mode.stateChanged.connect(multi_search_mode_changed) checkbox_ignore_tags.stateChanged.connect(ignore_tags_changed) checkbox_match_tags.stateChanged.connect(match_tags_changed) multi_search_mode_changed() token_settings_changed() ignore_tags_changed() match_tags_changed() return ( label_search_term, checkbox_multi_search_mode, stacked_widget_search_term, line_edit_search_term, list_search_terms, label_separator, checkbox_ignore_case, checkbox_match_inflected_forms, checkbox_match_whole_words, checkbox_use_regex, checkbox_ignore_tags, checkbox_match_tags )
def __init__(self, main): super().__init__(main) # Line Chart group_box_figs_line_chart = QGroupBox(self.tr('Line Chart'), self) self.label_figs_line_chart_font = QLabel(self.tr('Font:'), self) self.combo_box_figs_line_chart_font = wl_box.Wl_Combo_Box_Font_Family(self) group_box_figs_line_chart.setLayout(wl_layout.Wl_Layout()) group_box_figs_line_chart.layout().addWidget(self.label_figs_line_chart_font, 0, 0) group_box_figs_line_chart.layout().addWidget(self.combo_box_figs_line_chart_font, 0, 1) group_box_figs_line_chart.layout().setColumnStretch(2, 1) # Word Cloud group_box_figs_word_cloud = QGroupBox(self.tr('Word Cloud'), self) self.label_figs_word_cloud_font = QLabel(self.tr('Font:'), self) self.combo_box_figs_word_cloud_font = wl_box.Wl_Combo_Box(self) self.label_figs_word_cloud_bg_color = QLabel(self.tr('Background Color:'), self) (self.label_figs_word_cloud_bg_color_pick, self.button_figs_word_cloud_bg_color_pick) = wl_widgets.wl_widgets_pick_color(self) self.combo_box_figs_word_cloud_font.addItems([ 'DroidSansMono', 'Code2000', 'Unifont' ]) group_box_figs_word_cloud.setLayout(wl_layout.Wl_Layout()) group_box_figs_word_cloud.layout().addWidget(self.label_figs_word_cloud_font, 0, 0) group_box_figs_word_cloud.layout().addWidget(self.combo_box_figs_word_cloud_font, 0, 1, 1, 2) group_box_figs_word_cloud.layout().addWidget(self.label_figs_word_cloud_bg_color, 1, 0) group_box_figs_word_cloud.layout().addWidget(self.label_figs_word_cloud_bg_color_pick, 1, 1) group_box_figs_word_cloud.layout().addWidget(self.button_figs_word_cloud_bg_color_pick, 1, 2) group_box_figs_word_cloud.layout().setColumnStretch(3, 1) # Network Graph group_box_figs_network_graph = QGroupBox(self.tr('Network Graph'), self) self.label_figs_network_graph_layout = QLabel(self.tr('Layout:'), self) self.combo_box_figs_network_graph_layout = wl_box.Wl_Combo_Box(self) self.label_figs_network_graph_node_font = QLabel(self.tr('Node Font:'), self) self.combo_box_figs_network_graph_node_font = wl_box.Wl_Combo_Box_Font_Family(self) self.label_figs_network_graph_node_font_size = QLabel(self.tr('Node Font Size:'), self) self.spin_box_figs_network_graph_node_font_size = wl_box.Wl_Spin_Box_Font_Size(self) self.label_figs_network_graph_edge_font = QLabel(self.tr('Edge Font:'), self) self.combo_box_figs_network_graph_edge_font = wl_box.Wl_Combo_Box_Font_Family(self) self.label_figs_network_graph_edge_font_size = QLabel(self.tr('Edge Font Size:'), self) self.spin_box_figs_network_graph_edge_font_size = wl_box.Wl_Spin_Box_Font_Size(self) self.label_figs_network_graph_edge_color = QLabel(self.tr('Edge Color:'), self) (self.label_figs_network_graph_edge_color_pick, self.combo_box_figs_network_graph_color_pick) = wl_widgets.wl_widgets_pick_color(self) self.combo_box_figs_network_graph_layout.addItems([ self.tr('Circular'), self.tr('Kamada-Kawai'), self.tr('Planar'), self.tr('Random'), self.tr('Shell'), self.tr('Spring'), self.tr('Spectral') ]) group_box_figs_network_graph.setLayout(wl_layout.Wl_Layout()) group_box_figs_network_graph.layout().addWidget(self.label_figs_network_graph_layout, 0, 0) group_box_figs_network_graph.layout().addWidget(self.combo_box_figs_network_graph_layout, 0, 1, 1, 2) group_box_figs_network_graph.layout().addWidget(self.label_figs_network_graph_node_font, 1, 0) group_box_figs_network_graph.layout().addWidget(self.combo_box_figs_network_graph_node_font, 1, 1, 1, 2) group_box_figs_network_graph.layout().addWidget(self.label_figs_network_graph_node_font_size, 2, 0) group_box_figs_network_graph.layout().addWidget(self.spin_box_figs_network_graph_node_font_size, 2, 1, 1, 2) group_box_figs_network_graph.layout().addWidget(self.label_figs_network_graph_edge_font, 3, 0) group_box_figs_network_graph.layout().addWidget(self.combo_box_figs_network_graph_edge_font, 3, 1, 1, 2) group_box_figs_network_graph.layout().addWidget(self.label_figs_network_graph_edge_font_size, 4, 0) group_box_figs_network_graph.layout().addWidget(self.spin_box_figs_network_graph_edge_font_size, 4, 1, 1, 2) group_box_figs_network_graph.layout().addWidget(self.label_figs_network_graph_edge_color, 5, 0) group_box_figs_network_graph.layout().addWidget(self.label_figs_network_graph_edge_color_pick, 5, 1) group_box_figs_network_graph.layout().addWidget(self.combo_box_figs_network_graph_color_pick, 5, 2) group_box_figs_network_graph.layout().setColumnStretch(3, 1) self.setLayout(wl_layout.Wl_Layout()) self.layout().addWidget(group_box_figs_line_chart, 0, 0) self.layout().addWidget(group_box_figs_word_cloud, 1, 0) self.layout().addWidget(group_box_figs_network_graph, 2, 0) self.layout().setContentsMargins(6, 4, 6, 4) self.layout().setRowStretch(3, 1)
def __init__(self, main): super().__init__(main) self.pos_tag_mappings_loaded = False settings_global = self.main.settings_global['pos_taggers'] self.settings_tagsets = QWidget(self) # Preview Settings group_box_preview_settings = QGroupBox(self.tr('Preview Settings:'), self) self.label_tagsets_lang = QLabel(self.tr('Language:'), self) self.combo_box_tagsets_lang = wl_box.Wl_Combo_Box(self) self.label_tagsets_pos_tagger = QLabel(self.tr('POS Tagger:'), self) self.combo_box_tagsets_pos_tagger = wl_box.Wl_Combo_Box_Adjustable( self) self.combo_box_tagsets_lang.addItems( wl_conversion.to_lang_text(self.main, list(settings_global))) self.combo_box_tagsets_lang.currentTextChanged.connect( self.preview_lang_changed) self.combo_box_tagsets_pos_tagger.currentTextChanged.connect( self.preview_pos_tagger_changed) group_box_preview_settings.setLayout(wl_layout.Wl_Layout()) group_box_preview_settings.layout().addWidget(self.label_tagsets_lang, 0, 0) group_box_preview_settings.layout().addWidget( self.combo_box_tagsets_lang, 0, 1, Qt.AlignLeft) group_box_preview_settings.layout().addWidget( self.label_tagsets_pos_tagger, 1, 0) group_box_preview_settings.layout().addWidget( self.combo_box_tagsets_pos_tagger, 1, 1, Qt.AlignLeft) group_box_preview_settings.layout().setColumnStretch(2, 1) # Mapping Settings group_box_mapping_settings = QGroupBox(self.tr('Mapping Settings')) self.label_tagsets_num_pos_tags = QLabel('', self) self.button_tagsets_reset = QPushButton(self.tr('Reset'), self) self.button_tagsets_reset_all = QPushButton(self.tr('Reset All'), self) self.table_mappings = wl_table.Wl_Table( self, headers=[ self.tr('POS Tag'), self.tr('Universal POS Tag'), self.tr('Description'), self.tr('Examples') ]) self.button_tagsets_reset.setFixedWidth(100) self.button_tagsets_reset_all.setFixedWidth(100) self.button_tagsets_reset.clicked.connect(self.reset_mappings) self.button_tagsets_reset_all.clicked.connect(self.reset_all_mappings) group_box_mapping_settings.setLayout(wl_layout.Wl_Layout()) group_box_mapping_settings.layout().addWidget( self.label_tagsets_num_pos_tags, 0, 0) group_box_mapping_settings.layout().addWidget( self.button_tagsets_reset, 0, 2) group_box_mapping_settings.layout().addWidget( self.button_tagsets_reset_all, 0, 3) group_box_mapping_settings.layout().addWidget(self.table_mappings, 1, 0, 1, 4) group_box_mapping_settings.layout().setColumnStretch(1, 1) self.setLayout(wl_layout.Wl_Layout()) self.layout().addWidget(group_box_preview_settings, 0, 0) self.layout().addWidget(group_box_mapping_settings, 1, 0) self.layout().setContentsMargins(6, 4, 6, 4) self.layout().setRowStretch(1, 1)
def __init__(self, main): super().__init__(main) # Files group_box_import_files = QGroupBox(self.tr('Files'), self) self.label_import_files_default_path = QLabel(self.tr('Default Path:'), self) self.line_edit_import_files_default_path = QLineEdit(self) self.button_import_files_browse = QPushButton(self.tr('Browse...'), self) self.button_import_files_browse.clicked.connect(self.browse_files) group_box_import_files.setLayout(wl_layout.Wl_Layout()) group_box_import_files.layout().addWidget( self.label_import_files_default_path, 0, 0) group_box_import_files.layout().addWidget( self.line_edit_import_files_default_path, 0, 1) group_box_import_files.layout().addWidget( self.button_import_files_browse, 0, 2) # Search Terms group_box_import_search_terms = QGroupBox(self.tr('Search Terms'), self) self.label_import_search_terms_default_path = QLabel( self.tr('Default Path:'), self) self.line_edit_import_search_terms_default_path = QLineEdit(self) self.button_import_search_terms_browse = QPushButton( self.tr('Browse'), self) self.checkbox_import_search_terms_detect_encodings = QCheckBox( self.tr('Auto-detect encodings')) self.button_import_search_terms_browse.clicked.connect( self.browse_search_terms) group_box_import_search_terms.setLayout(wl_layout.Wl_Layout()) group_box_import_search_terms.layout().addWidget( self.label_import_search_terms_default_path, 0, 0) group_box_import_search_terms.layout().addWidget( self.line_edit_import_search_terms_default_path, 0, 1) group_box_import_search_terms.layout().addWidget( self.button_import_search_terms_browse, 0, 2) group_box_import_search_terms.layout().addWidget( self.checkbox_import_search_terms_detect_encodings, 1, 0, 1, 3) # Stop Words group_box_import_stop_words = QGroupBox(self.tr('Stop Words'), self) self.label_import_stop_words_default_path = QLabel( self.tr('Default Path:'), self) self.line_edit_import_stop_words_default_path = QLineEdit(self) self.button_import_stop_words_browse = QPushButton( self.tr('Browse'), self) self.checkbox_import_stop_words_detect_encodings = QCheckBox( self.tr('Auto-detect encodings')) self.button_import_stop_words_browse.clicked.connect( self.browse_stop_words) group_box_import_stop_words.setLayout(wl_layout.Wl_Layout()) group_box_import_stop_words.layout().addWidget( self.label_import_stop_words_default_path, 0, 0) group_box_import_stop_words.layout().addWidget( self.line_edit_import_stop_words_default_path, 0, 1) group_box_import_stop_words.layout().addWidget( self.button_import_stop_words_browse, 0, 2) group_box_import_stop_words.layout().addWidget( self.checkbox_import_stop_words_detect_encodings, 1, 0, 1, 3) # Temporary Files group_box_import_temp_files = QGroupBox(self.tr('Temporary Files'), self) self.label_import_temp_files_default_path = QLabel( self.tr('Default Path:'), self) self.line_edit_import_temp_files_default_path = QLineEdit(self) self.button_import_temp_files_browse = QPushButton( self.tr('Browse...'), self) self.label_import_temp_files_default_encoding = QLabel( self.tr('Default Encoding:'), self) self.combo_box_import_temp_files_default_encoding = wl_box.Wl_Combo_Box_Encoding( self) self.button_import_temp_files_browse.clicked.connect( self.browse_temp_files) group_box_import_temp_files.setLayout(wl_layout.Wl_Layout()) group_box_import_temp_files.layout().addWidget( self.label_import_temp_files_default_path, 0, 0) group_box_import_temp_files.layout().addWidget( self.line_edit_import_temp_files_default_path, 0, 1) group_box_import_temp_files.layout().addWidget( self.button_import_temp_files_browse, 0, 2) group_box_import_temp_files.layout().addWidget( self.label_import_temp_files_default_encoding, 1, 0) group_box_import_temp_files.layout().addWidget( self.combo_box_import_temp_files_default_encoding, 1, 1, 1, 2) self.setLayout(wl_layout.Wl_Layout()) self.layout().addWidget(group_box_import_files, 0, 0) self.layout().addWidget(group_box_import_search_terms, 1, 0) self.layout().addWidget(group_box_import_stop_words, 2, 0) self.layout().addWidget(group_box_import_temp_files, 3, 0) self.layout().setContentsMargins(6, 4, 6, 4) self.layout().setRowStretch(4, 1)
def __init__(self, main): super().__init__(main) # Table self.table_wordlist = Wl_Table_Wordlist(self) layout_results = wl_layout.Wl_Layout() layout_results.addWidget(self.table_wordlist.label_number_results, 0, 0) layout_results.addWidget(self.table_wordlist.button_results_filter, 0, 2) layout_results.addWidget(self.table_wordlist.button_results_search, 0, 3) layout_results.setColumnStretch(1, 1) self.wrapper_table.layout().addLayout(layout_results, 0, 0, 1, 5) self.wrapper_table.layout().addWidget(self.table_wordlist, 1, 0, 1, 5) self.wrapper_table.layout().addWidget( self.table_wordlist.button_generate_table, 2, 0) self.wrapper_table.layout().addWidget( self.table_wordlist.button_generate_fig, 2, 1) self.wrapper_table.layout().addWidget( self.table_wordlist.button_export_selected, 2, 2) self.wrapper_table.layout().addWidget( self.table_wordlist.button_export_all, 2, 3) self.wrapper_table.layout().addWidget(self.table_wordlist.button_clear, 2, 4) # Token Settings self.group_box_token_settings = QGroupBox(self.tr('Token Settings'), self) (self.checkbox_words, self.checkbox_lowercase, self.checkbox_uppercase, self.checkbox_title_case, self.checkbox_nums, self.checkbox_puncs, self.checkbox_treat_as_lowercase, self.checkbox_lemmatize_tokens, self.checkbox_filter_stop_words, self.checkbox_ignore_tags, self.checkbox_use_tags) = wl_widgets.wl_widgets_token_settings(self) self.checkbox_words.stateChanged.connect(self.token_settings_changed) self.checkbox_lowercase.stateChanged.connect( self.token_settings_changed) self.checkbox_uppercase.stateChanged.connect( self.token_settings_changed) self.checkbox_title_case.stateChanged.connect( self.token_settings_changed) self.checkbox_nums.stateChanged.connect(self.token_settings_changed) self.checkbox_puncs.stateChanged.connect(self.token_settings_changed) self.checkbox_treat_as_lowercase.stateChanged.connect( self.token_settings_changed) self.checkbox_lemmatize_tokens.stateChanged.connect( self.token_settings_changed) self.checkbox_filter_stop_words.stateChanged.connect( self.token_settings_changed) self.checkbox_ignore_tags.stateChanged.connect( self.token_settings_changed) self.checkbox_use_tags.stateChanged.connect( self.token_settings_changed) self.group_box_token_settings.setLayout(wl_layout.Wl_Layout()) self.group_box_token_settings.layout().addWidget( self.checkbox_words, 0, 0) self.group_box_token_settings.layout().addWidget( self.checkbox_lowercase, 0, 1) self.group_box_token_settings.layout().addWidget( self.checkbox_uppercase, 1, 0) self.group_box_token_settings.layout().addWidget( self.checkbox_title_case, 1, 1) self.group_box_token_settings.layout().addWidget( self.checkbox_nums, 2, 0) self.group_box_token_settings.layout().addWidget( self.checkbox_puncs, 2, 1) self.group_box_token_settings.layout().addWidget( wl_layout.Wl_Separator(self), 3, 0, 1, 2) self.group_box_token_settings.layout().addWidget( self.checkbox_treat_as_lowercase, 4, 0, 1, 2) self.group_box_token_settings.layout().addWidget( self.checkbox_lemmatize_tokens, 5, 0, 1, 2) self.group_box_token_settings.layout().addWidget( self.checkbox_filter_stop_words, 6, 0, 1, 2) self.group_box_token_settings.layout().addWidget( wl_layout.Wl_Separator(self), 7, 0, 1, 2) self.group_box_token_settings.layout().addWidget( self.checkbox_ignore_tags, 8, 0) self.group_box_token_settings.layout().addWidget( self.checkbox_use_tags, 8, 1) # Generation Settings self.group_box_generation_settings = QGroupBox( self.tr('Generation Settings')) (self.label_measure_dispersion, self.combo_box_measure_dispersion ) = wl_widgets.wl_widgets_measure_dispersion(self) (self.label_measure_adjusted_freq, self.combo_box_measure_adjusted_freq ) = wl_widgets.wl_widgets_measure_adjusted_freq(self) (self.label_settings_measures, self.button_settings_measures ) = wl_widgets.wl_widgets_settings_measures(self, tab=self.tr('Dispersion')) self.combo_box_measure_dispersion.currentTextChanged.connect( self.generation_settings_changed) self.combo_box_measure_adjusted_freq.currentTextChanged.connect( self.generation_settings_changed) layout_settings_measures = wl_layout.Wl_Layout() layout_settings_measures.addWidget(self.label_settings_measures, 0, 0) layout_settings_measures.addWidget(self.button_settings_measures, 0, 1) layout_settings_measures.setColumnStretch(1, 1) self.group_box_generation_settings.setLayout(wl_layout.Wl_Layout()) self.group_box_generation_settings.layout().addWidget( self.label_measure_dispersion, 0, 0) self.group_box_generation_settings.layout().addWidget( self.combo_box_measure_dispersion, 1, 0) self.group_box_generation_settings.layout().addWidget( self.label_measure_adjusted_freq, 2, 0) self.group_box_generation_settings.layout().addWidget( self.combo_box_measure_adjusted_freq, 3, 0) self.group_box_generation_settings.layout().addWidget( wl_layout.Wl_Separator(self), 4, 0) self.group_box_generation_settings.layout().addLayout( layout_settings_measures, 5, 0) # Table Settings self.group_box_table_settings = QGroupBox(self.tr('Table Settings')) (self.checkbox_show_pct, self.checkbox_show_cumulative, self.checkbox_show_breakdown) = wl_widgets.wl_widgets_table_settings( self, table=self.table_wordlist) self.checkbox_show_pct.stateChanged.connect( self.table_settings_changed) self.checkbox_show_cumulative.stateChanged.connect( self.table_settings_changed) self.checkbox_show_breakdown.stateChanged.connect( self.table_settings_changed) self.group_box_table_settings.setLayout(wl_layout.Wl_Layout()) self.group_box_table_settings.layout().addWidget( self.checkbox_show_pct, 0, 0) self.group_box_table_settings.layout().addWidget( self.checkbox_show_cumulative, 1, 0) self.group_box_table_settings.layout().addWidget( self.checkbox_show_breakdown, 2, 0) # Figure Settings self.group_box_fig_settings = QGroupBox(self.tr('Figure Settings'), self) (self.label_graph_type, self.combo_box_graph_type, self.label_use_file, self.combo_box_use_file, self.label_use_data, self.combo_box_use_data, self.checkbox_use_pct, self.checkbox_use_cumulative ) = wl_widgets.wl_widgets_fig_settings(self) self.label_rank = QLabel(self.tr('Rank:'), self) (self.label_rank_min, self.spin_box_rank_min, self.checkbox_rank_min_no_limit, self.label_rank_max, self.spin_box_rank_max, self.checkbox_rank_max_no_limit) = wl_widgets.wl_widgets_filter( self, filter_min=1, filter_max=100000) self.combo_box_graph_type.currentTextChanged.connect( self.fig_settings_changed) self.combo_box_use_file.currentTextChanged.connect( self.fig_settings_changed) self.combo_box_use_data.currentTextChanged.connect( self.fig_settings_changed) self.checkbox_use_pct.stateChanged.connect(self.fig_settings_changed) self.checkbox_use_cumulative.stateChanged.connect( self.fig_settings_changed) self.spin_box_rank_min.valueChanged.connect(self.fig_settings_changed) self.checkbox_rank_min_no_limit.stateChanged.connect( self.fig_settings_changed) self.spin_box_rank_max.valueChanged.connect(self.fig_settings_changed) self.checkbox_rank_max_no_limit.stateChanged.connect( self.fig_settings_changed) layout_fig_settings_combo_boxes = wl_layout.Wl_Layout() layout_fig_settings_combo_boxes.addWidget(self.label_graph_type, 0, 0) layout_fig_settings_combo_boxes.addWidget(self.combo_box_graph_type, 0, 1) layout_fig_settings_combo_boxes.addWidget(self.label_use_file, 1, 0) layout_fig_settings_combo_boxes.addWidget(self.combo_box_use_file, 1, 1) layout_fig_settings_combo_boxes.addWidget(self.label_use_data, 2, 0) layout_fig_settings_combo_boxes.addWidget(self.combo_box_use_data, 2, 1) layout_fig_settings_combo_boxes.setColumnStretch(1, 1) self.group_box_fig_settings.setLayout(wl_layout.Wl_Layout()) self.group_box_fig_settings.layout().addLayout( layout_fig_settings_combo_boxes, 0, 0, 1, 3) self.group_box_fig_settings.layout().addWidget(self.checkbox_use_pct, 1, 0, 1, 3) self.group_box_fig_settings.layout().addWidget( self.checkbox_use_cumulative, 2, 0, 1, 3) self.group_box_fig_settings.layout().addWidget( wl_layout.Wl_Separator(self), 3, 0, 1, 3) self.group_box_fig_settings.layout().addWidget(self.label_rank, 4, 0, 1, 3) self.group_box_fig_settings.layout().addWidget(self.label_rank_min, 5, 0) self.group_box_fig_settings.layout().addWidget(self.spin_box_rank_min, 5, 1) self.group_box_fig_settings.layout().addWidget( self.checkbox_rank_min_no_limit, 5, 2) self.group_box_fig_settings.layout().addWidget(self.label_rank_max, 6, 0) self.group_box_fig_settings.layout().addWidget(self.spin_box_rank_max, 6, 1) self.group_box_fig_settings.layout().addWidget( self.checkbox_rank_max_no_limit, 6, 2) self.group_box_fig_settings.layout().setColumnStretch(1, 1) self.wrapper_settings.layout().addWidget(self.group_box_token_settings, 0, 0) self.wrapper_settings.layout().addWidget( self.group_box_generation_settings, 1, 0) self.wrapper_settings.layout().addWidget(self.group_box_table_settings, 2, 0) self.wrapper_settings.layout().addWidget(self.group_box_fig_settings, 3, 0) self.wrapper_settings.layout().setRowStretch(4, 1) self.load_settings()
def __init__(self, main): super().__init__(main) settings_global = self.main.settings_global['pos_taggers'] # POS Tagger Settings group_box_pos_tagger_settings = QGroupBox( self.tr('POS Tagger Settings'), self) self.table_pos_taggers = wl_table.Wl_Table( self, headers=[self.tr('Language'), self.tr('POS Taggers')], cols_stretch=[self.tr('POS Taggers')]) self.checkbox_to_universal_pos_tags = QCheckBox( self.tr('Convert all POS tags to universal POS tags')) self.table_pos_taggers.verticalHeader().setHidden(True) self.table_pos_taggers.setRowCount(len(settings_global)) for i, lang in enumerate(settings_global): self.table_pos_taggers.setItem( i, 0, QTableWidgetItem(wl_conversion.to_lang_text(self.main, lang))) self.__dict__[ f'combo_box_pos_tagger_{lang}'] = wl_box.Wl_Combo_Box(self) self.__dict__[f'combo_box_pos_tagger_{lang}'].addItems( settings_global[lang]) self.__dict__[ f'combo_box_pos_tagger_{lang}'].currentTextChanged.connect( lambda text, lang=lang: self.pos_taggers_changed(lang)) self.table_pos_taggers.setCellWidget( i, 1, self.__dict__[f'combo_box_pos_tagger_{lang}']) self.checkbox_to_universal_pos_tags.stateChanged.connect( self.preview_results_changed) group_box_pos_tagger_settings.setLayout(wl_layout.Wl_Layout()) group_box_pos_tagger_settings.layout().addWidget( self.table_pos_taggers, 0, 0) group_box_pos_tagger_settings.layout().addWidget( self.checkbox_to_universal_pos_tags, 1, 0) # Preview group_box_preview = QGroupBox(self.tr('Preview'), self) self.label_pos_tagging_preview_lang = QLabel( self.tr('Select language:'), self) self.combo_box_pos_tagging_preview_lang = wl_box.Wl_Combo_Box(self) self.label_pos_tagging_preview_processing = QLabel('', self) self.text_edit_pos_tagging_preview_samples = QTextEdit(self) self.text_edit_pos_tagging_preview_results = QTextEdit(self) self.combo_box_pos_tagging_preview_lang.addItems( wl_conversion.to_lang_text(self.main, list(settings_global))) self.text_edit_pos_tagging_preview_samples.setAcceptRichText(False) self.text_edit_pos_tagging_preview_results.setReadOnly(True) self.combo_box_pos_tagging_preview_lang.currentTextChanged.connect( self.preview_changed) self.combo_box_pos_tagging_preview_lang.currentTextChanged.connect( self.preview_results_changed) self.text_edit_pos_tagging_preview_samples.textChanged.connect( self.preview_changed) self.text_edit_pos_tagging_preview_samples.textChanged.connect( self.preview_results_changed) self.text_edit_pos_tagging_preview_results.textChanged.connect( self.preview_changed) layout_preview_settings = wl_layout.Wl_Layout() layout_preview_settings.addWidget(self.label_pos_tagging_preview_lang, 0, 0) layout_preview_settings.addWidget( self.combo_box_pos_tagging_preview_lang, 0, 1) layout_preview_settings.addWidget( self.label_pos_tagging_preview_processing, 0, 3) layout_preview_settings.setColumnStretch(2, 1) group_box_preview.setLayout(wl_layout.Wl_Layout()) group_box_preview.layout().addLayout(layout_preview_settings, 0, 0, 1, 2) group_box_preview.layout().addWidget( self.text_edit_pos_tagging_preview_samples, 1, 0) group_box_preview.layout().addWidget( self.text_edit_pos_tagging_preview_results, 1, 1) self.setLayout(wl_layout.Wl_Layout()) self.layout().addWidget(group_box_pos_tagger_settings, 0, 0) self.layout().addWidget(group_box_preview, 1, 0) self.layout().setContentsMargins(6, 4, 6, 4) self.layout().setRowStretch(0, 3) self.layout().setRowStretch(1, 2)
def __init__(self, main): super().__init__(main) # Tables group_box_export_tables = QGroupBox(self.tr('Tables'), self) self.label_export_tables_default_path = QLabel( self.tr('Default Path:'), self) self.line_edit_export_tables_default_path = QLineEdit(self) self.button_export_tables_default_path = QPushButton( self.tr('Browse'), self) self.label_export_tables_default_type = QLabel( self.tr('Default Type:'), self) self.combo_box_export_tables_default_type = wl_box.Wl_Combo_Box(self) self.label_export_tables_default_encoding = QLabel( self.tr('Default Encoding:'), self) self.combo_box_export_tables_default_encoding = wl_box.Wl_Combo_Box_Encoding( self.main) self.combo_box_export_tables_default_type.addItems( self.main.settings_global['file_types']['export_tables']) self.button_export_tables_default_path.clicked.connect( self.browse_tables) self.combo_box_export_tables_default_type.currentTextChanged.connect( self.tables_default_type_changed) group_box_export_tables.setLayout(wl_layout.Wl_Layout()) group_box_export_tables.layout().addWidget( self.label_export_tables_default_path, 0, 0) group_box_export_tables.layout().addWidget( self.line_edit_export_tables_default_path, 0, 1) group_box_export_tables.layout().addWidget( self.button_export_tables_default_path, 0, 2) group_box_export_tables.layout().addWidget( self.label_export_tables_default_type, 1, 0) group_box_export_tables.layout().addWidget( self.combo_box_export_tables_default_type, 1, 1, 1, 2) group_box_export_tables.layout().addWidget( self.label_export_tables_default_encoding, 2, 0) group_box_export_tables.layout().addWidget( self.combo_box_export_tables_default_encoding, 2, 1, 1, 2) # Search Terms group_box_export_search_terms = QGroupBox(self.tr('Search Terms'), self) self.label_export_search_terms_default_path = QLabel( self.tr('Default Path:'), self) self.line_edit_export_search_terms_default_path = QLineEdit(self) self.button_export_search_terms_default_path = QPushButton( self.tr('Browse'), self) self.label_export_search_terms_default_encoding = QLabel( self.tr('Default Encoding:'), self) self.combo_box_export_search_terms_default_encoding = wl_box.Wl_Combo_Box_Encoding( self) self.button_export_search_terms_default_path.clicked.connect( self.browse_search_terms) group_box_export_search_terms.setLayout(wl_layout.Wl_Layout()) group_box_export_search_terms.layout().addWidget( self.label_export_search_terms_default_path, 0, 0) group_box_export_search_terms.layout().addWidget( self.line_edit_export_search_terms_default_path, 0, 1) group_box_export_search_terms.layout().addWidget( self.button_export_search_terms_default_path, 0, 2) group_box_export_search_terms.layout().addWidget( self.label_export_search_terms_default_encoding, 1, 0) group_box_export_search_terms.layout().addWidget( self.combo_box_export_search_terms_default_encoding, 1, 1, 1, 2) # Stop Words group_box_export_stop_words = QGroupBox(self.tr('Stop Words'), self) self.label_export_stop_words_default_path = QLabel( self.tr('Default Path:'), self) self.line_edit_export_stop_words_default_path = QLineEdit(self) self.button_export_stop_words_default_path = QPushButton( self.tr('Browse'), self) self.label_export_stop_words_default_encoding = QLabel( self.tr('Default Encoding:'), self) self.combo_box_export_stop_words_default_encoding = wl_box.Wl_Combo_Box_Encoding( self) self.button_export_stop_words_default_path.clicked.connect( self.browse_stop_words) group_box_export_stop_words.setLayout(wl_layout.Wl_Layout()) group_box_export_stop_words.layout().addWidget( self.label_export_stop_words_default_path, 0, 0) group_box_export_stop_words.layout().addWidget( self.line_edit_export_stop_words_default_path, 0, 1) group_box_export_stop_words.layout().addWidget( self.button_export_stop_words_default_path, 0, 2) group_box_export_stop_words.layout().addWidget( self.label_export_stop_words_default_encoding, 1, 0) group_box_export_stop_words.layout().addWidget( self.combo_box_export_stop_words_default_encoding, 1, 1, 1, 2) self.setLayout(wl_layout.Wl_Layout()) self.layout().addWidget(group_box_export_tables, 0, 0) self.layout().addWidget(group_box_export_search_terms, 1, 0) self.layout().addWidget(group_box_export_stop_words, 2, 0) self.layout().setContentsMargins(6, 4, 6, 4) self.layout().setRowStretch(3, 1) self.tables_default_type_changed()
def __init__(self, main): super().__init__(main, main.tr('Acknowledgments'), width=550) with open('wl_acks/wl_acks_general.csv', 'r', encoding='utf_8', newline='') as f: csv_reader = csv.reader(f, delimiter='|') self.ACKS_GENERAL = [row for row in csv_reader] with open('wl_acks/wl_acks_nlp.csv', 'r', encoding='utf_8', newline='') as f: csv_reader = csv.reader(f, delimiter='|') self.ACKS_NLP = [row for row in csv_reader] with open('wl_acks/wl_acks_lang_data.csv', 'r', encoding='utf_8', newline='') as f: csv_reader = csv.reader(f, delimiter='|') self.ACKS_LANG_DATA = [row for row in csv_reader] with open('wl_acks/wl_acks_plotting.csv', 'r', encoding='utf_8', newline='') as f: csv_reader = csv.reader(f, delimiter='|') self.ACKS_PLOTTING = [row for row in csv_reader] with open('wl_acks/wl_acks_misc.csv', 'r', encoding='utf_8', newline='') as f: csv_reader = csv.reader(f, delimiter='|') self.ACKS_MISC = [row for row in csv_reader] self.label_acks = wl_label.Wl_Label_Dialog( self.tr(''' <div> I would like to extend my sincere gratitude to the following open-source projects without which this project would not have been possible: </div> '''), self) self.label_browse_category = QLabel(self.tr('Browse by category:'), self) self.combo_box_browse_category = wl_box.Wl_Combo_Box(self) self.table_acks = wl_table.Wl_Table(self, headers=[ self.tr('Name'), self.tr('Version'), self.tr('Author(s)'), self.tr('License') ]) self.combo_box_browse_category.addItems([ self.tr('General'), self.tr('Natural Language Processing'), self.tr('Language Data'), self.tr('Plotting'), self.tr('Miscellaneous') ]) self.table_acks.setFixedHeight(250) self.combo_box_browse_category.currentTextChanged.connect( self.browse_category_changed) layout_browse_category = wl_layout.Wl_Layout() layout_browse_category.addWidget(self.label_browse_category, 0, 0) layout_browse_category.addWidget(self.combo_box_browse_category, 0, 1) layout_browse_category.setColumnStretch(2, 1) self.wrapper_info.layout().addWidget(self.label_acks, 0, 0) self.wrapper_info.layout().addLayout(layout_browse_category, 1, 0) self.wrapper_info.layout().addWidget(self.table_acks, 2, 0) self.load_settings() self.set_fixed_height()
def __init__(self, main, tab, table): super().__init__(main, main.tr('Search in Results')) self.tab = tab self.table = table self.settings = self.main.settings_custom[self.tab]['search_results'] self.items_found = [] (self.label_search_term, self.checkbox_multi_search_mode, self.stacked_widget_search_term, self.line_edit_search_term, self.list_search_terms, self.label_separator, self.checkbox_ignore_case, self.checkbox_match_inflected_forms, self.checkbox_match_whole_words, self.checkbox_use_regex, self.checkbox_ignore_tags, self.checkbox_match_tags) = wl_widgets.wl_widgets_search_settings( self, self.tab) self.button_find_next = QPushButton(self.tr('Find Next'), self) self.button_find_prev = QPushButton(self.tr('Find Previous'), self) self.button_find_all = QPushButton(self.tr('Find All'), self) self.button_reset_settings = wl_button.Wl_Button_Reset_Settings(self) self.button_clear_hightlights = QPushButton( self.tr('Clear Highlights'), self) self.button_close = QPushButton(self.tr('Close'), self) self.button_reset_settings.setFixedWidth(130) self.button_close.setFixedWidth(80) self.checkbox_multi_search_mode.stateChanged.connect( self.search_settings_changed) self.line_edit_search_term.textChanged.connect( self.search_settings_changed) self.line_edit_search_term.returnPressed.connect( self.button_find_next.click) self.list_search_terms.itemChanged.connect( self.search_settings_changed) self.checkbox_ignore_case.stateChanged.connect( self.search_settings_changed) self.checkbox_match_inflected_forms.stateChanged.connect( self.search_settings_changed) self.checkbox_match_whole_words.stateChanged.connect( self.search_settings_changed) self.checkbox_use_regex.stateChanged.connect( self.search_settings_changed) self.checkbox_ignore_tags.stateChanged.connect( self.search_settings_changed) self.checkbox_match_tags.stateChanged.connect( self.search_settings_changed) self.button_find_next.clicked.connect(lambda: self.find_next()) self.button_find_prev.clicked.connect(lambda: self.find_prev()) self.button_find_all.clicked.connect(lambda: self.find_all()) self.button_clear_hightlights.clicked.connect(self.clear_highlights) self.button_close.clicked.connect(self.reject) layout_buttons_right = wl_layout.Wl_Layout() layout_buttons_right.addWidget(self.button_find_next, 0, 0) layout_buttons_right.addWidget(self.button_find_prev, 1, 0) layout_buttons_right.addWidget(self.button_find_all, 2, 0) layout_buttons_right.addWidget(self.button_clear_hightlights, 3, 0) layout_buttons_right.setRowStretch(4, 1) layout_buttons_bottom = wl_layout.Wl_Layout() layout_buttons_bottom.addWidget(self.button_reset_settings, 0, 0) layout_buttons_bottom.addWidget(self.button_close, 0, 1, Qt.AlignRight) self.setLayout(wl_layout.Wl_Layout()) self.layout().addWidget(self.label_search_term, 0, 0) self.layout().addWidget(self.checkbox_multi_search_mode, 0, 1, Qt.AlignRight) self.layout().addWidget(self.stacked_widget_search_term, 1, 0, 1, 2) self.layout().addWidget(self.label_separator, 2, 0, 1, 2) self.layout().addWidget(self.checkbox_ignore_case, 3, 0, 1, 2) self.layout().addWidget(self.checkbox_match_inflected_forms, 4, 0, 1, 2) self.layout().addWidget(self.checkbox_match_whole_words, 5, 0, 1, 2) self.layout().addWidget(self.checkbox_use_regex, 6, 0, 1, 2) self.layout().addWidget(self.checkbox_ignore_tags, 7, 0, 1, 2) self.layout().addWidget(self.checkbox_match_tags, 8, 0, 1, 2) self.layout().addWidget( wl_layout.Wl_Separator(self, orientation='Vertical'), 0, 2, 9, 1) self.layout().addLayout(layout_buttons_right, 0, 3, 9, 1) self.layout().addWidget(wl_layout.Wl_Separator(self), 9, 0, 1, 4) self.layout().addLayout(layout_buttons_bottom, 10, 0, 1, 4) self.main.wl_work_area.currentChanged.connect(self.reject) self.load_settings()
def __init__(self, main): super().__init__(main) settings_global = self.main.settings_global['lemmatizers'] # Lemmatizer Settings group_box_lemmatizer_settings = QGroupBox( self.tr('Lemmatizer Settings'), self) table_lemmatizers = wl_table.Wl_Table( self, headers=[self.tr('Language'), self.tr('Lemmatizers')], cols_stretch=[self.tr('Lemmatizers')]) table_lemmatizers.verticalHeader().setHidden(True) table_lemmatizers.setRowCount(len(settings_global)) for i, lang in enumerate(settings_global): table_lemmatizers.setItem( i, 0, QTableWidgetItem(wl_conversion.to_lang_text(self.main, lang))) self.__dict__[ f'combo_box_lemmatizer_{lang}'] = wl_box.Wl_Combo_Box(self) self.__dict__[f'combo_box_lemmatizer_{lang}'].addItems( settings_global[lang]) table_lemmatizers.setCellWidget( i, 1, self.__dict__[f'combo_box_lemmatizer_{lang}']) group_box_lemmatizer_settings.setLayout(wl_layout.Wl_Layout()) group_box_lemmatizer_settings.layout().addWidget( table_lemmatizers, 0, 0) # Preview group_box_preview = QGroupBox(self.tr('Preview'), self) self.label_lemmatization_preview_lang = QLabel( self.tr('Select language:'), self) self.combo_box_lemmatization_preview_lang = wl_box.Wl_Combo_Box(self) self.button_lemmatization_start_processing = QPushButton( self.tr('Start processing'), self) self.text_edit_lemmatization_preview_samples = QTextEdit(self) self.text_edit_lemmatization_preview_results = QTextEdit(self) self.combo_box_lemmatization_preview_lang.addItems( wl_conversion.to_lang_text(self.main, list(settings_global.keys()))) self.button_lemmatization_start_processing.setFixedWidth(150) self.text_edit_lemmatization_preview_samples.setAcceptRichText(False) self.text_edit_lemmatization_preview_results.setReadOnly(True) self.combo_box_lemmatization_preview_lang.currentTextChanged.connect( self.preview_changed) self.button_lemmatization_start_processing.clicked.connect( self.preview_results_changed) self.text_edit_lemmatization_preview_samples.textChanged.connect( self.preview_changed) self.text_edit_lemmatization_preview_results.textChanged.connect( self.preview_changed) layout_preview_settings = wl_layout.Wl_Layout() layout_preview_settings.addWidget( self.label_lemmatization_preview_lang, 0, 0) layout_preview_settings.addWidget( self.combo_box_lemmatization_preview_lang, 0, 1) layout_preview_settings.addWidget( self.button_lemmatization_start_processing, 0, 3) layout_preview_settings.setColumnStretch(2, 1) group_box_preview.setLayout(wl_layout.Wl_Layout()) group_box_preview.layout().addLayout(layout_preview_settings, 0, 0, 1, 2) group_box_preview.layout().addWidget( self.text_edit_lemmatization_preview_samples, 1, 0) group_box_preview.layout().addWidget( self.text_edit_lemmatization_preview_results, 1, 1) self.setLayout(wl_layout.Wl_Layout()) self.layout().addWidget(group_box_lemmatizer_settings, 0, 0) self.layout().addWidget(group_box_preview, 1, 0) self.layout().setContentsMargins(6, 4, 6, 4) self.layout().setRowStretch(0, 3) self.layout().setRowStretch(1, 2)
def __init__(self, main): super().__init__(main) self.main = main self.setWindowTitle(self.tr('Settings')) self.setFixedSize(800, 550) self.tree_settings = wl_tree.Wl_Tree(self) self.tree_settings.addTopLevelItem( QTreeWidgetItem([self.tr('General')])) self.tree_settings.topLevelItem(0).addChild( QTreeWidgetItem([self.tr('Import')])) self.tree_settings.topLevelItem(0).addChild( QTreeWidgetItem([self.tr('Export')])) self.tree_settings.addTopLevelItem( QTreeWidgetItem([self.tr('Auto-detection')])) self.tree_settings.addTopLevelItem(QTreeWidgetItem([self.tr('Data')])) self.tree_settings.addTopLevelItem(QTreeWidgetItem([self.tr('Tags')])) self.tree_settings.addTopLevelItem( QTreeWidgetItem([self.tr('Sentence Tokenization')])) self.tree_settings.addTopLevelItem( QTreeWidgetItem([self.tr('Word Tokenization')])) self.tree_settings.addTopLevelItem( QTreeWidgetItem([self.tr('Word Detokenization')])) self.tree_settings.addTopLevelItem( QTreeWidgetItem([self.tr('POS Tagging')])) self.tree_settings.topLevelItem(7).addChild( QTreeWidgetItem([self.tr('Tagsets')])) self.tree_settings.addTopLevelItem( QTreeWidgetItem([self.tr('Lemmatization')])) self.tree_settings.addTopLevelItem( QTreeWidgetItem([self.tr('Stop Words')])) self.tree_settings.addTopLevelItem( QTreeWidgetItem([self.tr('Measures')])) self.tree_settings.topLevelItem(10).addChild( QTreeWidgetItem([self.tr('Dispersion')])) self.tree_settings.topLevelItem(10).addChild( QTreeWidgetItem([self.tr('Adjusted Frequency')])) self.tree_settings.topLevelItem(10).addChild( QTreeWidgetItem([self.tr('Statistical Significance')])) self.tree_settings.topLevelItem(10).addChild( QTreeWidgetItem([self.tr('Effect Size')])) self.tree_settings.addTopLevelItem( QTreeWidgetItem([self.tr('Figures')])) self.tree_settings.itemSelectionChanged.connect(self.selection_changed) self.scroll_area_settings = wl_layout.Wl_Scroll_Area(self) self.stacked_widget_settings = QStackedWidget(self) self.settings_general = wl_settings_general.Wl_Settings_General( self.main) self.settings_import = wl_settings_general.Wl_Settings_Import( self.main) self.settings_export = wl_settings_general.Wl_Settings_Export( self.main) self.settings_auto_detection = wl_settings_auto_detection.Wl_Settings_Auto_Detection( self.main) self.settings_data = wl_settings_data.Wl_Settings_Data(self.main) self.settings_tags = wl_settings_tags.Wl_Settings_Tags(self.main) self.settings_sentence_tokenization = wl_settings_sentence_tokenization.Wl_Settings_Sentence_Tokenization( self.main) self.settings_word_tokenization = wl_settings_word_tokenization.Wl_Settings_Word_Tokenization( self.main) self.settings_word_detokenization = wl_settings_word_detokenization.Wl_Settings_Word_Detokenization( self.main) self.settings_pos_tagging = wl_settings_pos_tagging.Wl_Settings_Pos_Tagging( self.main) self.settings_tagsets = wl_settings_pos_tagging.Wl_Settings_Tagsets( self.main) self.settings_lemmatization = wl_settings_lemmatization.Wl_Settings_Lemmatization( self.main) self.settings_stop_words = wl_settings_stop_words.Wl_Settings_Stop_Words( self.main) self.settings_dispersion = wl_settings_measures.Wl_Settings_Dispersion( self.main) self.settings_adjusted_freq = wl_settings_measures.Wl_Settings_Adjusted_Freq( self.main) self.settings_statistical_significance = wl_settings_measures.Wl_Settings_Statistical_Significance( self.main) self.settings_effect_size = wl_settings_measures.Wl_Settings_Effect_Size( self.main) self.settings_figs = wl_settings_figs.Wl_Settings_Figs(self.main) self.settings_all = [ self.settings_general, self.settings_import, self.settings_export, self.settings_auto_detection, self.settings_data, self.settings_tags, self.settings_sentence_tokenization, self.settings_word_tokenization, self.settings_word_detokenization, self.settings_pos_tagging, self.settings_tagsets, self.settings_lemmatization, self.settings_stop_words, self.settings_dispersion, self.settings_adjusted_freq, self.settings_statistical_significance, self.settings_effect_size, self.settings_figs ] for settings in self.settings_all: self.stacked_widget_settings.addWidget(settings) self.scroll_area_settings.setWidget(self.stacked_widget_settings) button_reset_settings = wl_button.Wl_Button_Reset_All_Settings(self) button_save = QPushButton(self.tr('Save'), self) button_apply = QPushButton(self.tr('Apply'), self) button_cancel = QPushButton(self.tr('Cancel'), self) button_save.clicked.connect(self.save_settings) button_apply.clicked.connect(self.apply_settings) button_cancel.clicked.connect(self.reject) button_reset_settings.setFixedWidth(150) button_save.setFixedWidth(80) button_apply.setFixedWidth(80) button_cancel.setFixedWidth(80) layout_buttons = wl_layout.Wl_Layout() layout_buttons.addWidget(button_reset_settings, 0, 0) layout_buttons.addWidget(button_save, 0, 2) layout_buttons.addWidget(button_apply, 0, 3) layout_buttons.addWidget(button_cancel, 0, 4) layout_buttons.setColumnStretch(1, 1) self.setLayout(wl_layout.Wl_Layout()) self.layout().addWidget(self.tree_settings, 0, 0) self.layout().addWidget(self.scroll_area_settings, 0, 1) self.layout().addLayout(layout_buttons, 1, 0, 1, 2) self.tree_settings.item_selected_old = self.tree_settings.topLevelItem( 0)
def __init__(self, main): super().__init__(main) # Header Tag Settings group_box_header_tag_settings = QGroupBox( self.tr('Header Tag Settings'), self) self.table_tags_header = Wl_Table_Tags_Header(self) self.label_tags_header = wl_label.Wl_Label_Important( self. tr('All contents surrounded by header tags will be ignored during text processing!' ), self) group_box_header_tag_settings.setLayout(wl_layout.Wl_Layout()) group_box_header_tag_settings.layout().addWidget( self.table_tags_header, 0, 0, 1, 3) group_box_header_tag_settings.layout().addWidget( self.table_tags_header.button_add, 1, 0) group_box_header_tag_settings.layout().addWidget( self.table_tags_header.button_remove, 1, 1) group_box_header_tag_settings.layout().addWidget( self.table_tags_header.button_reset, 1, 2) group_box_header_tag_settings.layout().addWidget( self.label_tags_header, 2, 0, 1, 3) group_box_header_tag_settings.layout().setRowStretch(3, 1) # Body Tag Settings group_box_body_tag_settings = QGroupBox(self.tr('Body Tag Settings'), self) self.table_tags_body = Wl_Table_Tags_Body(self) self.label_tags_body = wl_label.Wl_Label_Hint( self.tr('Use * to indicate any number of characters'), self) group_box_body_tag_settings.setLayout(wl_layout.Wl_Layout()) group_box_body_tag_settings.layout().addWidget(self.table_tags_body, 0, 0, 1, 3) group_box_body_tag_settings.layout().addWidget( self.table_tags_body.button_add, 1, 0) group_box_body_tag_settings.layout().addWidget( self.table_tags_body.button_remove, 1, 1) group_box_body_tag_settings.layout().addWidget( self.table_tags_body.button_reset, 1, 2) group_box_body_tag_settings.layout().addWidget(self.label_tags_body, 2, 0, 1, 3) group_box_body_tag_settings.layout().setRowStretch(3, 1) # XML Tag Settings group_box_xml_tag_settings = QGroupBox(self.tr('XML Tag Settings'), self) self.table_tags_xml = Wl_Table_Tags_Xml(self) group_box_xml_tag_settings.setLayout(wl_layout.Wl_Layout()) group_box_xml_tag_settings.layout().addWidget(self.table_tags_xml, 0, 0, 1, 3) group_box_xml_tag_settings.layout().addWidget( self.table_tags_xml.button_add, 1, 0) group_box_xml_tag_settings.layout().addWidget( self.table_tags_xml.button_remove, 1, 1) group_box_xml_tag_settings.layout().addWidget( self.table_tags_xml.button_reset, 1, 2) group_box_xml_tag_settings.layout().setRowStretch(2, 1) self.setLayout(wl_layout.Wl_Layout()) self.layout().addWidget(group_box_header_tag_settings, 0, 0) self.layout().addWidget(group_box_body_tag_settings, 1, 0) self.layout().addWidget(group_box_xml_tag_settings, 2, 0) self.layout().setContentsMargins(6, 4, 6, 4) self.layout().setRowStretch(3, 1)
def __init__(self, main): super().__init__(main) settings_global = self.main.settings_global['stop_words'] # Stop Words Settings group_box_stop_words_settings = QGroupBox( self.tr('Stop Words Settings'), self) table_stop_words = wl_table.Wl_Table( self, headers=[self.tr('Language'), self.tr('Lists of Stop Words')], cols_stretch=[self.tr('Lists of Stop Words')]) table_stop_words.verticalHeader().setHidden(True) table_stop_words.setRowCount(len(settings_global)) for i, lang in enumerate(settings_global): table_stop_words.setItem( i, 0, QTableWidgetItem(wl_conversion.to_lang_text(self.main, lang))) self.__dict__[ f'combo_box_stop_words_{lang}'] = wl_box.Wl_Combo_Box(self) self.__dict__[f'combo_box_stop_words_{lang}'].addItems( settings_global[lang]) self.__dict__[ f'combo_box_stop_words_{lang}'].currentTextChanged.connect( lambda text, lang=lang: self.stop_words_changed(lang)) table_stop_words.setCellWidget( i, 1, self.__dict__[f'combo_box_stop_words_{lang}']) group_box_stop_words_settings.setLayout(wl_layout.Wl_Layout()) group_box_stop_words_settings.layout().addWidget( table_stop_words, 0, 0) # Preview group_box_preview = QGroupBox(self.tr('Preview'), self) self.label_stop_words_preview_lang = QLabel( self.tr('Select language:'), self) self.combo_box_stop_words_preview_lang = wl_box.Wl_Combo_Box(self) self.combo_box_stop_words_preview_lang.addItems( wl_conversion.to_lang_text(self.main, list(settings_global.keys()))) self.label_stop_words_preview_count = QLabel('', self) self.list_stop_words_preview_results = wl_list.Wl_List_Stop_Words(self) self.combo_box_stop_words_preview_lang.currentTextChanged.connect( self.preview_settings_changed) self.combo_box_stop_words_preview_lang.currentTextChanged.connect( self.preview_results_changed) layout_preview_settings = wl_layout.Wl_Layout() layout_preview_settings.addWidget(self.label_stop_words_preview_lang, 0, 0) layout_preview_settings.addWidget( self.combo_box_stop_words_preview_lang, 0, 1) layout_preview_settings.addWidget(self.label_stop_words_preview_count, 0, 3) layout_preview_settings.setColumnStretch(2, 1) group_box_preview.setLayout(wl_layout.Wl_Layout()) group_box_preview.layout().addLayout(layout_preview_settings, 0, 0, 1, 5) group_box_preview.layout().addWidget( self.list_stop_words_preview_results, 1, 0, 1, 5) group_box_preview.layout().addWidget( self.list_stop_words_preview_results.button_add, 2, 0) group_box_preview.layout().addWidget( self.list_stop_words_preview_results.button_remove, 2, 1) group_box_preview.layout().addWidget( self.list_stop_words_preview_results.button_clear, 2, 2) group_box_preview.layout().addWidget( self.list_stop_words_preview_results.button_import, 2, 3) group_box_preview.layout().addWidget( self.list_stop_words_preview_results.button_export, 2, 4) self.setLayout(wl_layout.Wl_Layout()) self.layout().addWidget(group_box_stop_words_settings, 0, 0) self.layout().addWidget(group_box_preview, 1, 0) self.layout().setContentsMargins(6, 4, 6, 4) self.layout().setRowStretch(0, 3) self.layout().setRowStretch(1, 2) self.preview_results_changed()
def __init__(self, main): super().__init__(main, main.tr('Donating'), width=450) self.label_donating = wl_label.Wl_Label_Dialog( self.tr(''' <div> If you would like to support the development of Wordless, you may donate via <a href="https://www.paypal.com/">PayPal</a>, <a href="https://global.alipay.com/">Alipay</a>, or <a href="https://pay.weixin.qq.com/index.php/public/wechatpay_en">WeChat Pay</a>. </div> '''), self) self.label_donating_via = QLabel(self.tr('Donating via:'), self) self.combo_box_donating_via = wl_box.Wl_Combo_Box(self) self.label_donating_via_img = wl_label.Wl_Label_Html('', self) self.label_donating_note = wl_label.Wl_Label_Dialog( self.tr(''' <div> <span style="color: #F00;"><b>Important Note</b></span>: I <b>WILL NOT PROVIDE</b> invoices, receipts, refund services, detailed spending reports, my contact information other than email addresses, my personal social media accounts, private email/phone support, or guarantees on bug fixes, enhancements, new features, or new releases of Wordless for donation. </div> '''), self) self.combo_box_donating_via.addItems( [self.tr('PayPal'), self.tr('Alipay'), self.tr('WeChat Pay')]) self.combo_box_donating_via.currentTextChanged.connect( self.donating_via_changed) layout_donating_via = wl_layout.Wl_Layout() layout_donating_via.addWidget(self.label_donating_via, 0, 0) layout_donating_via.addWidget(self.combo_box_donating_via, 0, 1) layout_donating_via.setColumnStretch(2, 1) self.wrapper_info.layout().addWidget(self.label_donating, 0, 0) self.wrapper_info.layout().addLayout(layout_donating_via, 1, 0) self.wrapper_info.layout().addWidget(self.label_donating_via_img, 2, 0, Qt.AlignHCenter | Qt.AlignVCenter) self.wrapper_info.layout().addWidget(self.label_donating_note, 3, 0) # Calculate height donating_via_old = self.main.settings_custom['menu']['help'][ 'donating']['donating_via'] self.combo_box_donating_via.setCurrentText('PayPal') self.donating_via_changed() height_donating_via_paypal = self.label_donating_via_img.sizeHint( ).height() self.height_paypal = self.heightForWidth(self.width()) self.combo_box_donating_via.setCurrentText('Alipay') self.donating_via_changed() height_donating_via_alipay = self.label_donating_via_img.sizeHint( ).height() self.height_alipay = self.heightForWidth(self.width()) + ( height_donating_via_alipay - height_donating_via_paypal) self.main.settings_custom['menu']['help']['donating'][ 'donating_via'] = donating_via_old self.load_settings()
def __init__(self, main): super().__init__(main) # z-score group_box_z_score = QGroupBox(self.tr('z-score'), self) (self.label_z_score_direction, self.combo_box_z_score_direction ) = wl_widgets.wl_widgets_direction_2(self) group_box_z_score.setLayout(wl_layout.Wl_Layout()) group_box_z_score.layout().addWidget(self.label_z_score_direction, 0, 0) group_box_z_score.layout().addWidget(self.combo_box_z_score_direction, 0, 1) group_box_z_score.layout().setColumnStretch(2, 1) # Student's t-test (Two-sample) group_box_students_t_test_2_sample = QGroupBox( self.tr('Student\'s t-test (Two-sample)'), self) (self.label_students_t_test_2_sample_divide, self.spin_box_students_t_test_2_sample_number_sections, self.label_students_t_test_2_sample_sections ) = wl_widgets.wl_widgets_number_sections(self) (self.label_students_t_test_2_sample_use_data, self.combo_box_students_t_test_2_sample_use_data ) = wl_widgets.wl_widgets_use_data_freq(self) self.label_students_t_test_2_sample_variances = QLabel( self.tr('Variances:'), self) self.combo_box_students_t_test_2_sample_variances = QComboBox(self) self.label_welchs_t_test = wl_label.Wl_Label_Hint( self.tr(''' <p> * If variances are set to "Unequal", the Welch\'s t-test will be performed instead. </p> '''), self) self.combo_box_students_t_test_2_sample_variances.addItems( [self.tr('Equal'), self.tr('Unequal')]) layout_students_t_test_2_sample_number_sections = wl_layout.Wl_Layout() layout_students_t_test_2_sample_number_sections.addWidget( self.label_students_t_test_2_sample_divide, 0, 0) layout_students_t_test_2_sample_number_sections.addWidget( self.spin_box_students_t_test_2_sample_number_sections, 0, 1) layout_students_t_test_2_sample_number_sections.addWidget( self.label_students_t_test_2_sample_sections, 0, 2) layout_students_t_test_2_sample_number_sections.setColumnStretch(3, 1) group_box_students_t_test_2_sample.setLayout(wl_layout.Wl_Layout()) group_box_students_t_test_2_sample.layout().addLayout( layout_students_t_test_2_sample_number_sections, 0, 0, 1, 3) group_box_students_t_test_2_sample.layout().addWidget( self.label_students_t_test_2_sample_use_data, 1, 0) group_box_students_t_test_2_sample.layout().addWidget( self.combo_box_students_t_test_2_sample_use_data, 1, 1) group_box_students_t_test_2_sample.layout().addWidget( self.label_students_t_test_2_sample_variances, 2, 0) group_box_students_t_test_2_sample.layout().addWidget( self.combo_box_students_t_test_2_sample_variances, 2, 1) group_box_students_t_test_2_sample.layout().addWidget( self.label_welchs_t_test, 3, 0, 1, 3) group_box_students_t_test_2_sample.layout().setColumnStretch(2, 1) # Pearson's Chi-squared Test group_box_pearsons_chi_squared_test = QGroupBox( self.tr('Pearson\'s Chi-squared Test'), self) self.checkbox_pearsons_chi_squared_test_apply_correction = QCheckBox( self.tr('Apply Yates\'s correction for continuity')) group_box_pearsons_chi_squared_test.setLayout(wl_layout.Wl_Layout()) group_box_pearsons_chi_squared_test.layout().addWidget( self.checkbox_pearsons_chi_squared_test_apply_correction, 0, 0) # Fisher's Exact Test group_box_fishers_exact_test = QGroupBox( self.tr('Fisher\'s Exact Test'), self) (self.label_fishers_exact_test_direction, self.combo_box_fishers_exact_test_direction ) = wl_widgets.wl_widgets_direction(self) group_box_fishers_exact_test.setLayout(wl_layout.Wl_Layout()) group_box_fishers_exact_test.layout().addWidget( self.label_fishers_exact_test_direction, 0, 0) group_box_fishers_exact_test.layout().addWidget( self.combo_box_fishers_exact_test_direction, 0, 1) group_box_fishers_exact_test.layout().setColumnStretch(2, 1) # Mann-Whitney U Test group_box_mann_whitney_u_test = QGroupBox( self.tr('Mann-Whitney U Test'), self) (self.label_mann_whitney_u_test_divide, self.spin_box_mann_whitney_u_test_number_sections, self.label_mann_whitney_u_test_sections ) = wl_widgets.wl_widgets_number_sections(self) (self.label_mann_whitney_u_test_use_data, self.combo_box_mann_whitney_u_test_use_data ) = wl_widgets.wl_widgets_use_data_freq(self) (self.label_mann_whitney_u_test_direction, self.combo_box_mann_whitney_u_test_direction ) = wl_widgets.wl_widgets_direction(self) self.checkbox_mann_whitney_u_test_apply_correction = QCheckBox( self.tr('Apply continuity correction'), self) layout_mann_whitney_u_test_number_sections = wl_layout.Wl_Layout() layout_mann_whitney_u_test_number_sections.addWidget( self.label_mann_whitney_u_test_divide, 0, 0) layout_mann_whitney_u_test_number_sections.addWidget( self.spin_box_mann_whitney_u_test_number_sections, 0, 1) layout_mann_whitney_u_test_number_sections.addWidget( self.label_mann_whitney_u_test_sections, 0, 2) layout_mann_whitney_u_test_number_sections.setColumnStretch(3, 1) group_box_mann_whitney_u_test.setLayout(wl_layout.Wl_Layout()) group_box_mann_whitney_u_test.layout().addLayout( layout_mann_whitney_u_test_number_sections, 0, 0, 1, 3) group_box_mann_whitney_u_test.layout().addWidget( self.label_mann_whitney_u_test_use_data, 1, 0) group_box_mann_whitney_u_test.layout().addWidget( self.combo_box_mann_whitney_u_test_use_data, 1, 1) group_box_mann_whitney_u_test.layout().addWidget( self.label_mann_whitney_u_test_direction, 2, 0) group_box_mann_whitney_u_test.layout().addWidget( self.combo_box_mann_whitney_u_test_direction, 2, 1) group_box_mann_whitney_u_test.layout().addWidget( self.checkbox_mann_whitney_u_test_apply_correction, 3, 0, 1, 3) group_box_mann_whitney_u_test.layout().setColumnStretch(3, 1) self.setLayout(wl_layout.Wl_Layout()) self.layout().addWidget(group_box_z_score, 0, 0) self.layout().addWidget(group_box_students_t_test_2_sample, 1, 0) self.layout().addWidget(group_box_pearsons_chi_squared_test, 2, 0) self.layout().addWidget(group_box_fishers_exact_test, 3, 0) self.layout().addWidget(group_box_mann_whitney_u_test, 4, 0) self.layout().setContentsMargins(6, 4, 6, 4) self.layout().setRowStretch(5, 1)
def __init__(self, main): super().__init__(main) # Table self.table_files = Wl_Table_Files(self) self.wrapper_table.layout().addWidget(self.table_files, 0, 0, 1, 5) self.wrapper_table.layout().addWidget( self.table_files.button_open_files, 1, 0) self.wrapper_table.layout().addWidget(self.table_files.button_open_dir, 1, 1) self.wrapper_table.layout().addWidget(self.table_files.button_reopen, 1, 2) self.wrapper_table.layout().addWidget( self.table_files.button_close_selected, 1, 3) self.wrapper_table.layout().addWidget( self.table_files.button_close_all, 1, 4) # Folder Settings self.group_box_folder_settings = QGroupBox(self.tr('Folder Settings'), self) self.checkbox_subfolders = QCheckBox(self.tr('Subfolders'), self) self.checkbox_subfolders.stateChanged.connect( self.folder_settings_changed) self.group_box_folder_settings.setLayout(wl_layout.Wl_Layout()) self.group_box_folder_settings.layout().addWidget( self.checkbox_subfolders, 0, 0) # Auto-detection Settings self.group_box_auto_detection_settings = QGroupBox( self.tr('Auto-detection Settings'), self) self.checkbox_detect_langs = QCheckBox(self.tr('Detect languages'), self) self.checkbox_detect_encodings = QCheckBox(self.tr('Detect encodings'), self) self.checkbox_detect_langs.stateChanged.connect( self.auto_detection_settings_changed) self.checkbox_detect_encodings.stateChanged.connect( self.auto_detection_settings_changed) self.group_box_auto_detection_settings.setLayout(wl_layout.Wl_Layout()) self.group_box_auto_detection_settings.layout().addWidget( self.checkbox_detect_langs, 0, 0) self.group_box_auto_detection_settings.layout().addWidget( self.checkbox_detect_encodings, 0, 1) self.wrapper_settings.layout().addWidget( self.group_box_folder_settings, 0, 0) self.wrapper_settings.layout().addWidget( self.group_box_auto_detection_settings, 1, 0) self.wrapper_settings.layout().setRowStretch(2, 1) self.load_settings() # Load files self.main.wl_files = Wl_Files(self.table_files) self.main.wl_files.update_table()
def __init__(self, main, tab): super().__init__(main, main.tr('Context Settings')) self.tab = tab self.settings = self.main.settings_custom[self.tab]['context_settings'] # Inclusion self.inclusion_group_box = QGroupBox(self.tr('Inclusion'), self) self.inclusion_group_box.setCheckable(True) (self.inclusion_label_search_term, self.inclusion_checkbox_multi_search_mode, self.inclusion_stacked_widget_search_term, self.inclusion_line_edit_search_term, self.inclusion_list_search_terms, self.inclusion_label_separator, self.inclusion_checkbox_ignore_case, self.inclusion_checkbox_match_inflected_forms, self.inclusion_checkbox_match_whole_words, self.inclusion_checkbox_use_regex, self.inclusion_stacked_widget_ignore_tags, self.inclusion_checkbox_ignore_tags, self.inclusion_checkbox_ignore_tags_tags, self.inclusion_stacked_widget_ignore_tags_type, self.inclusion_combo_box_ignore_tags, self.inclusion_combo_box_ignore_tags_tags, self.inclusion_label_ignore_tags, self.inclusion_checkbox_match_tags ) = wl_widgets.wl_widgets_search_settings(self, tab=tab) self.inclusion_label_context_window = QLabel( self.tr('Context Window:'), self) (self.inclusion_checkbox_context_window_sync, self.inclusion_label_context_window_left, self.inclusion_spin_box_context_window_left, self.inclusion_label_context_window_right, self.inclusion_spin_box_context_window_right ) = wl_widgets.wl_widgets_window(self) self.inclusion_group_box.toggled.connect(self.inclusion_changed) self.inclusion_checkbox_multi_search_mode.stateChanged.connect( self.inclusion_changed) self.inclusion_checkbox_multi_search_mode.stateChanged.connect( self.multi_search_mode_changed) self.inclusion_line_edit_search_term.textChanged.connect( self.inclusion_changed) self.inclusion_list_search_terms.itemChanged.connect( self.inclusion_changed) self.inclusion_checkbox_ignore_case.stateChanged.connect( self.inclusion_changed) self.inclusion_checkbox_match_inflected_forms.stateChanged.connect( self.inclusion_changed) self.inclusion_checkbox_match_whole_words.stateChanged.connect( self.inclusion_changed) self.inclusion_checkbox_use_regex.stateChanged.connect( self.inclusion_changed) self.inclusion_checkbox_ignore_tags.stateChanged.connect( self.inclusion_changed) self.inclusion_checkbox_ignore_tags_tags.stateChanged.connect( self.inclusion_changed) self.inclusion_combo_box_ignore_tags.currentTextChanged.connect( self.inclusion_changed) self.inclusion_combo_box_ignore_tags_tags.currentTextChanged.connect( self.inclusion_changed) self.inclusion_checkbox_match_tags.stateChanged.connect( self.inclusion_changed) self.inclusion_checkbox_context_window_sync.stateChanged.connect( self.inclusion_changed) self.inclusion_spin_box_context_window_left.valueChanged.connect( self.inclusion_changed) self.inclusion_spin_box_context_window_right.valueChanged.connect( self.inclusion_changed) inclusion_layout_multi_search_mode = wl_layout.Wl_Layout() inclusion_layout_multi_search_mode.addWidget( self.inclusion_label_search_term, 0, 0) inclusion_layout_multi_search_mode.addWidget( self.inclusion_checkbox_multi_search_mode, 0, 1, Qt.AlignRight) inclusion_layout_ignore_tags = wl_layout.Wl_Layout() inclusion_layout_ignore_tags.addWidget( self.inclusion_stacked_widget_ignore_tags, 0, 0) inclusion_layout_ignore_tags.addWidget( self.inclusion_stacked_widget_ignore_tags_type, 0, 1) inclusion_layout_ignore_tags.addWidget( self.inclusion_label_ignore_tags, 0, 2) inclusion_layout_ignore_tags.setColumnStretch(3, 1) self.inclusion_group_box.setLayout(wl_layout.Wl_Layout()) self.inclusion_group_box.layout().addLayout( inclusion_layout_multi_search_mode, 0, 0, 1, 4) self.inclusion_group_box.layout().addWidget( self.inclusion_stacked_widget_search_term, 1, 0, 1, 4) self.inclusion_group_box.layout().addWidget( self.inclusion_label_separator, 2, 0, 1, 4) self.inclusion_group_box.layout().addWidget( self.inclusion_checkbox_ignore_case, 3, 0, 1, 4) self.inclusion_group_box.layout().addWidget( self.inclusion_checkbox_match_inflected_forms, 4, 0, 1, 4) self.inclusion_group_box.layout().addWidget( self.inclusion_checkbox_match_whole_words, 5, 0, 1, 4) self.inclusion_group_box.layout().addWidget( self.inclusion_checkbox_use_regex, 6, 0, 1, 4) self.inclusion_group_box.layout().addLayout( inclusion_layout_ignore_tags, 7, 0, 1, 4) self.inclusion_group_box.layout().addWidget( self.inclusion_checkbox_match_tags, 8, 0, 1, 4) self.inclusion_group_box.layout().addWidget( wl_layout.Wl_Separator(self), 9, 0, 1, 4) self.inclusion_group_box.layout().addWidget( self.inclusion_label_context_window, 10, 0, 1, 3) self.inclusion_group_box.layout().addWidget( self.inclusion_checkbox_context_window_sync, 10, 3, Qt.AlignRight) self.inclusion_group_box.layout().addWidget( self.inclusion_label_context_window_left, 11, 0) self.inclusion_group_box.layout().addWidget( self.inclusion_spin_box_context_window_left, 11, 1) self.inclusion_group_box.layout().addWidget( self.inclusion_label_context_window_right, 11, 2) self.inclusion_group_box.layout().addWidget( self.inclusion_spin_box_context_window_right, 11, 3) self.inclusion_group_box.layout().setColumnStretch(1, 1) self.inclusion_group_box.layout().setColumnStretch(3, 1) # Exclusion self.exclusion_group_box = QGroupBox(self.tr('Exclusion'), self) self.exclusion_group_box.setCheckable(True) (self.exclusion_label_search_term, self.exclusion_checkbox_multi_search_mode, self.exclusion_stacked_widget_search_term, self.exclusion_line_edit_search_term, self.exclusion_list_search_terms, self.exclusion_label_separator, self.exclusion_checkbox_ignore_case, self.exclusion_checkbox_match_inflected_forms, self.exclusion_checkbox_match_whole_words, self.exclusion_checkbox_use_regex, self.exclusion_stacked_widget_ignore_tags, self.exclusion_checkbox_ignore_tags, self.exclusion_checkbox_ignore_tags_tags, self.exclusion_stacked_widget_ignore_tags_type, self.exclusion_combo_box_ignore_tags, self.exclusion_combo_box_ignore_tags_tags, self.exclusion_label_ignore_tags, self.exclusion_checkbox_match_tags ) = wl_widgets.wl_widgets_search_settings(self, tab=tab) self.exclusion_label_context_window = QLabel( self.tr('Context Window:'), self) (self.exclusion_checkbox_context_window_sync, self.exclusion_label_context_window_left, self.exclusion_spin_box_context_window_left, self.exclusion_label_context_window_right, self.exclusion_spin_box_context_window_right ) = wl_widgets.wl_widgets_window(self) self.exclusion_group_box.toggled.connect(self.exclusion_changed) self.exclusion_checkbox_multi_search_mode.stateChanged.connect( self.exclusion_changed) self.exclusion_checkbox_multi_search_mode.stateChanged.connect( self.multi_search_mode_changed) self.exclusion_line_edit_search_term.textChanged.connect( self.exclusion_changed) self.exclusion_list_search_terms.itemChanged.connect( self.exclusion_changed) self.exclusion_checkbox_ignore_case.stateChanged.connect( self.exclusion_changed) self.exclusion_checkbox_match_inflected_forms.stateChanged.connect( self.exclusion_changed) self.exclusion_checkbox_match_whole_words.stateChanged.connect( self.exclusion_changed) self.exclusion_checkbox_use_regex.stateChanged.connect( self.exclusion_changed) self.exclusion_checkbox_ignore_tags.stateChanged.connect( self.exclusion_changed) self.exclusion_checkbox_ignore_tags_tags.stateChanged.connect( self.exclusion_changed) self.exclusion_combo_box_ignore_tags.currentTextChanged.connect( self.exclusion_changed) self.exclusion_combo_box_ignore_tags_tags.currentTextChanged.connect( self.exclusion_changed) self.exclusion_checkbox_match_tags.stateChanged.connect( self.exclusion_changed) self.exclusion_checkbox_context_window_sync.stateChanged.connect( self.exclusion_changed) self.exclusion_spin_box_context_window_left.valueChanged.connect( self.exclusion_changed) self.exclusion_spin_box_context_window_right.valueChanged.connect( self.exclusion_changed) exclusion_layout_multi_search_mode = wl_layout.Wl_Layout() exclusion_layout_multi_search_mode.addWidget( self.exclusion_label_search_term, 0, 0) exclusion_layout_multi_search_mode.addWidget( self.exclusion_checkbox_multi_search_mode, 0, 1, Qt.AlignRight) exclusion_layout_ignore_tags = wl_layout.Wl_Layout() exclusion_layout_ignore_tags.addWidget( self.exclusion_stacked_widget_ignore_tags, 0, 0) exclusion_layout_ignore_tags.addWidget( self.exclusion_stacked_widget_ignore_tags_type, 0, 1) exclusion_layout_ignore_tags.addWidget( self.exclusion_label_ignore_tags, 0, 2) exclusion_layout_ignore_tags.setColumnStretch(3, 1) self.exclusion_group_box.setLayout(wl_layout.Wl_Layout()) self.exclusion_group_box.layout().addLayout( exclusion_layout_multi_search_mode, 0, 0, 1, 4) self.exclusion_group_box.layout().addWidget( self.exclusion_stacked_widget_search_term, 1, 0, 1, 4) self.exclusion_group_box.layout().addWidget( self.exclusion_label_separator, 2, 0, 1, 4) self.exclusion_group_box.layout().addWidget( self.exclusion_checkbox_ignore_case, 3, 0, 1, 4) self.exclusion_group_box.layout().addWidget( self.exclusion_checkbox_match_inflected_forms, 4, 0, 1, 4) self.exclusion_group_box.layout().addWidget( self.exclusion_checkbox_match_whole_words, 5, 0, 1, 4) self.exclusion_group_box.layout().addWidget( self.exclusion_checkbox_use_regex, 6, 0, 1, 4) self.exclusion_group_box.layout().addLayout( exclusion_layout_ignore_tags, 7, 0, 1, 4) self.exclusion_group_box.layout().addWidget( self.exclusion_checkbox_match_tags, 8, 0, 1, 4) self.exclusion_group_box.layout().addWidget( wl_layout.Wl_Separator(self), 9, 0, 1, 4) self.exclusion_group_box.layout().addWidget( self.exclusion_label_context_window, 10, 0, 1, 3) self.exclusion_group_box.layout().addWidget( self.exclusion_checkbox_context_window_sync, 10, 3, Qt.AlignRight) self.exclusion_group_box.layout().addWidget( self.exclusion_label_context_window_left, 11, 0) self.exclusion_group_box.layout().addWidget( self.exclusion_spin_box_context_window_left, 11, 1) self.exclusion_group_box.layout().addWidget( self.exclusion_label_context_window_right, 11, 2) self.exclusion_group_box.layout().addWidget( self.exclusion_spin_box_context_window_right, 11, 3) self.exclusion_group_box.layout().setColumnStretch(1, 1) self.exclusion_group_box.layout().setColumnStretch(3, 1) self.button_reset_settings = wl_button.Wl_Button_Reset_Settings(self) self.button_ok = QPushButton(self.tr('OK'), self) self.button_ok.clicked.connect(self.accept) self.button_reset_settings.setFixedWidth(130) self.setLayout(wl_layout.Wl_Layout()) self.layout().addWidget(self.inclusion_group_box, 0, 0, Qt.AlignTop) self.layout().addWidget(self.exclusion_group_box, 0, 1, Qt.AlignTop) self.layout().addWidget(self.button_reset_settings, 1, 0, Qt.AlignLeft) self.layout().addWidget(self.button_ok, 1, 1, Qt.AlignRight) self.layout().setColumnStretch(0, 1) self.layout().setColumnStretch(1, 1) self.load_settings()