Added the third radio button and made them exclusive.

I solved the vertical space problem by eliminating the content margins.
This commit is contained in:
Charles Haley 2023-11-05 17:07:31 +00:00 committed by Kovid Goyal
parent f176c4ac36
commit 1474957e99
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
4 changed files with 95 additions and 74 deletions

View File

@ -108,9 +108,13 @@ class EditAuthorsDialog(QDialog, Ui_EditAuthorsDialog):
self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel).setText(_('&Cancel')) self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel).setText(_('&Cancel'))
self.buttonBox.accepted.connect(self.accepted) self.buttonBox.accepted.connect(self.accepted)
self.buttonBox.rejected.connect(self.rejected) self.buttonBox.rejected.connect(self.rejected)
self.apply_vl_checkbox.setAutoExclusive(False) self.show_button_layout.setSpacing(0)
self.show_button_layout.setContentsMargins(0, 0, 0, 0)
self.apply_all_checkbox.setContentsMargins(0, 0, 0, 0)
self.apply_all_checkbox.setChecked(True)
self.apply_vl_checkbox.setContentsMargins(0, 0, 0, 0)
self.apply_vl_checkbox.toggled.connect(self.use_vl_changed) self.apply_vl_checkbox.toggled.connect(self.use_vl_changed)
self.apply_selection_checkbox.setAutoExclusive(False) self.apply_selection_checkbox.setContentsMargins(0, 0, 0, 0)
self.apply_selection_checkbox.toggled.connect(self.apply_selection_box_changed) self.apply_selection_checkbox.toggled.connect(self.apply_selection_box_changed)
self.table.setAlternatingRowColors(True) self.table.setAlternatingRowColors(True)
@ -214,13 +218,9 @@ class EditAuthorsDialog(QDialog, Ui_EditAuthorsDialog):
self.ignore_cell_changed = orig self.ignore_cell_changed = orig
def use_vl_changed(self, x): def use_vl_changed(self, x):
if self.apply_vl_checkbox.isChecked():
self.apply_selection_checkbox.setChecked(False)
self.show_table(None, None, None, False) self.show_table(None, None, None, False)
def apply_selection_box_changed(self, x): def apply_selection_box_changed(self, x):
if self.apply_selection_checkbox.isChecked():
self.apply_vl_checkbox.setChecked(False)
self.show_table(None, None, None, False) self.show_table(None, None, None, False)
def selection_to_apply(self): def selection_to_apply(self):

View File

@ -65,7 +65,16 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="0" column="4"> <item row="0" column="4" rowspan="2">
<layout class="QVBoxLayout" name="show_button_layout">
<item>
<widget class="QRadioButton" name="apply_all_checkbox">
<property name="text">
<string>Show &amp;all authors</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="apply_vl_checkbox"> <widget class="QRadioButton" name="apply_vl_checkbox">
<property name="toolTip"> <property name="toolTip">
<string>&lt;p&gt;Show authors only if they appear in the <string>&lt;p&gt;Show authors only if they appear in the
@ -81,7 +90,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="4"> <item>
<widget class="QRadioButton" name="apply_selection_checkbox"> <widget class="QRadioButton" name="apply_selection_checkbox">
<property name="toolTip"> <property name="toolTip">
<string>&lt;p&gt;Show items only if they appear in the <string>&lt;p&gt;Show items only if they appear in the
@ -97,6 +106,8 @@
</property> </property>
</widget> </widget>
</item> </item>
</layout>
</item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel"> <widget class="QLabel">
<property name="text"> <property name="text">

View File

@ -372,9 +372,12 @@ class TagListEditor(QDialog, Ui_TagListEditor):
ac.triggered.connect(self.clear_filter) ac.triggered.connect(self.clear_filter)
le.returnPressed.connect(self.do_filter) le.returnPressed.connect(self.do_filter)
self.filter_button.clicked.connect(self.do_filter) self.filter_button.clicked.connect(self.do_filter)
self.apply_vl_checkbox.setAutoExclusive(False) self.show_button_layout.setSpacing(0)
self.show_button_layout.setContentsMargins(0, 0, 0, 0)
self.apply_all_checkbox.setContentsMargins(0, 0, 0, 0)
self.apply_all_checkbox.setChecked(True)
self.apply_vl_checkbox.toggled.connect(self.vl_box_changed) self.apply_vl_checkbox.toggled.connect(self.vl_box_changed)
self.apply_selection_checkbox.setAutoExclusive(False) self.apply_selection_checkbox.setContentsMargins(0, 0, 0, 0)
self.apply_selection_checkbox.toggled.connect(self.apply_selection_box_changed) self.apply_selection_checkbox.toggled.connect(self.apply_selection_box_changed)
self.is_enumerated = False self.is_enumerated = False
@ -540,14 +543,10 @@ class TagListEditor(QDialog, Ui_TagListEditor):
return txt.swapcase() return txt.swapcase()
def vl_box_changed(self): def vl_box_changed(self):
if self.apply_vl_checkbox.isChecked():
self.apply_selection_checkbox.setChecked(False)
self.search_item_row = -1 self.search_item_row = -1
self.fill_in_table(None, None, False) self.fill_in_table(None, None, False)
def apply_selection_box_changed(self): def apply_selection_box_changed(self):
if self.apply_selection_checkbox.isChecked():
self.apply_vl_checkbox.setChecked(False)
self.search_item_row = -1 self.search_item_row = -1
self.fill_in_table(None, None, False) self.fill_in_table(None, None, False)

View File

@ -71,7 +71,16 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="0" column="4"> <item row="0" column="4" rowspan="2">
<layout class="QVBoxLayout" name="show_button_layout">
<item>
<widget class="QRadioButton" name="apply_all_checkbox">
<property name="text">
<string>Show &amp;all items</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="apply_vl_checkbox"> <widget class="QRadioButton" name="apply_vl_checkbox">
<property name="toolTip"> <property name="toolTip">
<string>&lt;p&gt;Show items only if they appear in the <string>&lt;p&gt;Show items only if they appear in the
@ -87,7 +96,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="4"> <item>
<widget class="QRadioButton" name="apply_selection_checkbox"> <widget class="QRadioButton" name="apply_selection_checkbox">
<property name="toolTip"> <property name="toolTip">
<string>&lt;p&gt;Show items only if they appear in the <string>&lt;p&gt;Show items only if they appear in the
@ -103,6 +112,8 @@
</property> </property>
</widget> </widget>
</item> </item>
</layout>
</item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="text"> <property name="text">