Disable buttons for add/remove weblink

This commit is contained in:
Timmy Welch 2024-03-01 15:26:11 -08:00
parent 163cf44751
commit ff2547e7f2
3 changed files with 10 additions and 7 deletions

View File

@ -113,7 +113,7 @@ class TaggerWindow(QtWidgets.QMainWindow):
"alternate_count": self.leAltIssueCount,
"imprint": self.leImprint,
"notes": self.teNotes,
"web_links": self.leWebLink,
"web_links": (self.leWebLink, self.btnOpenWebLink, self.btnAddWebLink, self.btnRemoveWebLink),
"format": self.cbFormat,
"manga": self.cbManga,
"black_and_white": self.cbBW,
@ -125,7 +125,7 @@ class TaggerWindow(QtWidgets.QMainWindow):
"characters": self.teCharacters,
"teams": self.teTeams,
"locations": self.teLocations,
"credits": [self.twCredits, self.btnAddCredit, self.btnEditCredit, self.btnRemoveCredit],
"credits": (self.twCredits, self.btnAddCredit, self.btnEditCredit, self.btnRemoveCredit),
"credits.person": 2,
"credits.role": 1,
"credits.primary": 0,

View File

@ -6,6 +6,7 @@ import io
import logging
import traceback
import webbrowser
from collections.abc import Sequence
from PyQt5.QtCore import QUrl
from PyQt5.QtWidgets import QWidget
@ -155,7 +156,7 @@ if qt_available:
active_palette = None
def enable_widget(widget: QtWidgets.QWidget | list[QtWidgets.QWidget], enable: bool) -> None:
if isinstance(widget, list):
if isinstance(widget, Sequence):
for w in widget:
_enable_widget(w, enable)
else:
@ -214,6 +215,8 @@ if qt_available:
widget.setReadOnly(True)
widget.setPalette(inactive_palette[0])
elif isinstance(widget, QtWidgets.QListWidget):
inactive_palette = palettes()
widget.setPalette(inactive_palette[0])
widget.setMovement(QtWidgets.QListWidget.Static)
def replaceWidget(

View File

@ -975,7 +975,7 @@
</widget>
</item>
<item row="2" column="1">
<widget class="QPushButton" name="btnWebLinkRemove">
<widget class="QPushButton" name="btnRemoveWebLink">
<property name="text">
<string>Delete Item</string>
</property>
@ -998,7 +998,7 @@
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="btnWebLinkAdd">
<widget class="QPushButton" name="btnAddWebLink">
<property name="text">
<string>Add Item</string>
</property>
@ -1510,7 +1510,7 @@
<resources/>
<connections>
<connection>
<sender>btnWebLinkAdd</sender>
<sender>btnAddWebLink</sender>
<signal>clicked()</signal>
<receiver>actionAddWebLink</receiver>
<slot>trigger()</slot>
@ -1526,7 +1526,7 @@
</hints>
</connection>
<connection>
<sender>btnWebLinkRemove</sender>
<sender>btnRemoveWebLink</sender>
<signal>clicked()</signal>
<receiver>actionRemoveWebLink</receiver>
<slot>trigger()</slot>