Skip to content

Commit

Permalink
Hide individual update items but leave plugins update check visible
Browse files Browse the repository at this point in the history
  • Loading branch information
rdswift authored and phw committed Sep 22, 2023
1 parent 118f5f7 commit 0b8ed2f
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 62 deletions.
2 changes: 1 addition & 1 deletion picard/ui/options/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def load(self):
self.set_update_level(config.setting["update_level"])
self.ui.update_check_days.setValue(config.setting["update_check_days"])
if not self.tagger.autoupdate_enabled:
self.ui.update_check_groupbox.hide()
self.ui.program_update_check_group.hide()

def set_update_level(self, value):
if value not in PROGRAM_UPDATE_LEVELS:
Expand Down
50 changes: 28 additions & 22 deletions picard/ui/ui_options_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,33 +115,27 @@ def setupUi(self, GeneralOptionsPage):
self.check_for_plugin_updates = QtWidgets.QCheckBox(self.update_check_groupbox)
self.check_for_plugin_updates.setObjectName("check_for_plugin_updates")
self.verticalLayout_2.addWidget(self.check_for_plugin_updates)
self.program_update_check_frame = QtWidgets.QFrame(self.update_check_groupbox)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.program_update_check_frame.sizePolicy().hasHeightForWidth())
self.program_update_check_frame.setSizePolicy(sizePolicy)
self.program_update_check_frame.setFrameShape(QtWidgets.QFrame.NoFrame)
self.program_update_check_frame.setFrameShadow(QtWidgets.QFrame.Plain)
self.program_update_check_frame.setObjectName("program_update_check_frame")
self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.program_update_check_frame)
self.verticalLayout_5.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_5.setObjectName("verticalLayout_5")
self.check_for_updates = QtWidgets.QCheckBox(self.program_update_check_frame)
self.program_update_check_group = QtWidgets.QWidget(self.update_check_groupbox)
self.program_update_check_group.setMinimumSize(QtCore.QSize(0, 0))
self.program_update_check_group.setObjectName("program_update_check_group")
self.verticalLayout_6 = QtWidgets.QVBoxLayout(self.program_update_check_group)
self.verticalLayout_6.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_6.setObjectName("verticalLayout_6")
self.check_for_updates = QtWidgets.QCheckBox(self.program_update_check_group)
self.check_for_updates.setObjectName("check_for_updates")
self.verticalLayout_5.addWidget(self.check_for_updates)
self.verticalLayout_6.addWidget(self.check_for_updates)
self.gridLayout = QtWidgets.QGridLayout()
self.gridLayout.setContentsMargins(-1, -1, -1, 0)
self.gridLayout.setObjectName("gridLayout")
self.label_2 = QtWidgets.QLabel(self.program_update_check_frame)
self.label_2 = QtWidgets.QLabel(self.program_update_check_group)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth())
self.label_2.setSizePolicy(sizePolicy)
self.label_2.setObjectName("label_2")
self.gridLayout.addWidget(self.label_2, 0, 0, 1, 1)
self.update_check_days = QtWidgets.QSpinBox(self.program_update_check_frame)
self.update_check_days = QtWidgets.QSpinBox(self.program_update_check_group)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
Expand All @@ -151,14 +145,13 @@ def setupUi(self, GeneralOptionsPage):
self.update_check_days.setMinimum(1)
self.update_check_days.setObjectName("update_check_days")
self.gridLayout.addWidget(self.update_check_days, 0, 1, 1, 1)
self.verticalLayout_5.addLayout(self.gridLayout)
self.gridLayout_2 = QtWidgets.QGridLayout()
self.gridLayout_2.setContentsMargins(-1, -1, -1, 0)
self.gridLayout_2.setObjectName("gridLayout_2")
self.label_3 = QtWidgets.QLabel(self.program_update_check_frame)
self.label_3 = QtWidgets.QLabel(self.program_update_check_group)
self.label_3.setObjectName("label_3")
self.gridLayout_2.addWidget(self.label_3, 0, 0, 1, 1)
self.update_level = QtWidgets.QComboBox(self.program_update_check_frame)
self.update_level = QtWidgets.QComboBox(self.program_update_check_group)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
Expand All @@ -167,7 +160,21 @@ def setupUi(self, GeneralOptionsPage):
self.update_level.setEditable(False)
self.update_level.setObjectName("update_level")
self.gridLayout_2.addWidget(self.update_level, 0, 1, 1, 1)
self.verticalLayout_5.addLayout(self.gridLayout_2)
self.gridLayout.addLayout(self.gridLayout_2, 1, 0, 1, 1)
self.verticalLayout_6.addLayout(self.gridLayout)
self.verticalLayout_2.addWidget(self.program_update_check_group)
self.program_update_check_frame = QtWidgets.QFrame(self.update_check_groupbox)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.program_update_check_frame.sizePolicy().hasHeightForWidth())
self.program_update_check_frame.setSizePolicy(sizePolicy)
self.program_update_check_frame.setFrameShape(QtWidgets.QFrame.NoFrame)
self.program_update_check_frame.setFrameShadow(QtWidgets.QFrame.Plain)
self.program_update_check_frame.setObjectName("program_update_check_frame")
self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.program_update_check_frame)
self.verticalLayout_5.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_5.setObjectName("verticalLayout_5")
self.verticalLayout_2.addWidget(self.program_update_check_frame)
self.vboxlayout.addWidget(self.update_check_groupbox)
spacerItem2 = QtWidgets.QSpacerItem(181, 21, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
Expand All @@ -183,8 +190,7 @@ def setupUi(self, GeneralOptionsPage):
GeneralOptionsPage.setTabOrder(self.analyze_new_files, self.cluster_new_files)
GeneralOptionsPage.setTabOrder(self.cluster_new_files, self.ignore_file_mbids)
GeneralOptionsPage.setTabOrder(self.ignore_file_mbids, self.check_for_plugin_updates)
GeneralOptionsPage.setTabOrder(self.check_for_plugin_updates, self.check_for_updates)
GeneralOptionsPage.setTabOrder(self.check_for_updates, self.update_check_days)
GeneralOptionsPage.setTabOrder(self.check_for_plugin_updates, self.update_check_days)
GeneralOptionsPage.setTabOrder(self.update_check_days, self.update_level)

def retranslateUi(self, GeneralOptionsPage):
Expand Down
101 changes: 62 additions & 39 deletions ui/options_general.ui
Original file line number Diff line number Diff line change
Expand Up @@ -228,20 +228,14 @@ QCheckBox { color: black }</string>
</widget>
</item>
<item>
<widget class="QFrame" name="program_update_check_frame">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
<widget class="QWidget" name="program_update_check_group" native="true">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<layout class="QVBoxLayout" name="verticalLayout_6">
<property name="leftMargin">
<number>0</number>
</property>
Expand Down Expand Up @@ -295,38 +289,68 @@ QCheckBox { color: black }</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_2">
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Updates to check:</string>
<item row="1" column="0">
<layout class="QGridLayout" name="gridLayout_2">
<property name="bottomMargin">
<number>0</number>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="update_level">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="editable">
<bool>false</bool>
</property>
</widget>
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Updates to check:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="update_level">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="editable">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QFrame" name="program_update_check_frame">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down Expand Up @@ -355,7 +379,6 @@ QCheckBox { color: black }</string>
<tabstop>cluster_new_files</tabstop>
<tabstop>ignore_file_mbids</tabstop>
<tabstop>check_for_plugin_updates</tabstop>
<tabstop>check_for_updates</tabstop>
<tabstop>update_check_days</tabstop>
<tabstop>update_level</tabstop>
</tabstops>
Expand Down

0 comments on commit 0b8ed2f

Please sign in to comment.