mirror of
https://github.com/RolandWH/SIPPCompare.git
synced 2025-03-14 22:01:36 +00:00
begin adding optional fields
This commit is contained in:
parent
b62518875f
commit
9143afc176
@ -53,13 +53,6 @@
|
|||||||
<property name="verticalSpacing">
|
<property name="verticalSpacing">
|
||||||
<number>5</number>
|
<number>5</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="0" colspan="2">
|
|
||||||
<widget class="QLabel" name="plat_name_lab">
|
|
||||||
<property name="text">
|
|
||||||
<string>Platform name</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="8" column="0" colspan="2">
|
<item row="8" column="0" colspan="2">
|
||||||
<widget class="QLabel" name="share_deal_reduce_amount_lab">
|
<widget class="QLabel" name="share_deal_reduce_amount_lab">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -67,44 +60,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="2">
|
|
||||||
<widget class="QLineEdit" name="plat_name_box"/>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0" colspan="2">
|
|
||||||
<widget class="QLabel" name="share_plat_fee_lab">
|
|
||||||
<property name="text">
|
|
||||||
<string>Share platform fee*</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="7" column="0" colspan="2">
|
|
||||||
<widget class="QLabel" name="share_deal_reduce_trades_lab">
|
|
||||||
<property name="text">
|
|
||||||
<string>Share dealing discount # of trades</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="5" column="0" colspan="2">
|
|
||||||
<widget class="QLabel" name="share_deal_fee_lab">
|
|
||||||
<property name="text">
|
|
||||||
<string>Share dealing fee*</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0" colspan="2">
|
|
||||||
<widget class="QLabel" name="fund_deal_fee_lab">
|
|
||||||
<property name="text">
|
|
||||||
<string>Fund dealing fee*</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="0" colspan="2">
|
|
||||||
<widget class="QLabel" name="share_plat_max_fee_lab">
|
|
||||||
<property name="text">
|
|
||||||
<string>Share platform fee cap/mth</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="8" column="2">
|
<item row="8" column="2">
|
||||||
<widget class="QDoubleSpinBox" name="share_deal_reduce_amount_box">
|
<widget class="QDoubleSpinBox" name="share_deal_reduce_amount_box">
|
||||||
<property name="buttonSymbols">
|
<property name="buttonSymbols">
|
||||||
@ -118,19 +73,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="2">
|
|
||||||
<widget class="QDoubleSpinBox" name="share_deal_fee_box">
|
|
||||||
<property name="buttonSymbols">
|
|
||||||
<enum>QAbstractSpinBox::ButtonSymbols::NoButtons</enum>
|
|
||||||
</property>
|
|
||||||
<property name="correctionMode">
|
|
||||||
<enum>QAbstractSpinBox::CorrectionMode::CorrectToNearestValue</enum>
|
|
||||||
</property>
|
|
||||||
<property name="prefix">
|
|
||||||
<string>£</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="2">
|
<item row="4" column="2">
|
||||||
<widget class="QDoubleSpinBox" name="share_plat_max_fee_box">
|
<widget class="QDoubleSpinBox" name="share_plat_max_fee_box">
|
||||||
<property name="buttonSymbols">
|
<property name="buttonSymbols">
|
||||||
@ -144,16 +86,49 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="2">
|
<item row="0" column="3">
|
||||||
<widget class="QDoubleSpinBox" name="share_plat_fee_box">
|
<widget class="QCheckBox" name="plat_name_check">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0" colspan="2">
|
||||||
|
<widget class="QLabel" name="plat_name_lab">
|
||||||
|
<property name="text">
|
||||||
|
<string>Platform name</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
|
<widget class="QLineEdit" name="plat_name_box"/>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="3">
|
||||||
|
<widget class="QCheckBox" name="share_plat_fee_check">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="2">
|
||||||
|
<widget class="QDoubleSpinBox" name="share_deal_fee_box">
|
||||||
<property name="buttonSymbols">
|
<property name="buttonSymbols">
|
||||||
<enum>QAbstractSpinBox::ButtonSymbols::NoButtons</enum>
|
<enum>QAbstractSpinBox::ButtonSymbols::NoButtons</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="correctionMode">
|
<property name="correctionMode">
|
||||||
<enum>QAbstractSpinBox::CorrectionMode::CorrectToNearestValue</enum>
|
<enum>QAbstractSpinBox::CorrectionMode::CorrectToNearestValue</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="suffix">
|
<property name="prefix">
|
||||||
<string>%</string>
|
<string>£</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -170,6 +145,47 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="0" colspan="2">
|
||||||
|
<widget class="QLabel" name="fund_deal_fee_lab">
|
||||||
|
<property name="text">
|
||||||
|
<string>Fund dealing fee*</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0" colspan="2">
|
||||||
|
<widget class="QLabel" name="share_plat_max_fee_lab">
|
||||||
|
<property name="text">
|
||||||
|
<string>Share platform fee cap/mth</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="2">
|
||||||
|
<widget class="QDoubleSpinBox" name="share_plat_fee_box">
|
||||||
|
<property name="buttonSymbols">
|
||||||
|
<enum>QAbstractSpinBox::ButtonSymbols::NoButtons</enum>
|
||||||
|
</property>
|
||||||
|
<property name="correctionMode">
|
||||||
|
<enum>QAbstractSpinBox::CorrectionMode::CorrectToNearestValue</enum>
|
||||||
|
</property>
|
||||||
|
<property name="suffix">
|
||||||
|
<string>%</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="7" column="3">
|
||||||
|
<widget class="QCheckBox" name="share_deal_reduce_trades_check">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0" colspan="2">
|
||||||
|
<widget class="QLabel" name="share_deal_fee_lab">
|
||||||
|
<property name="text">
|
||||||
|
<string>Share dealing fee*</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="7" column="2">
|
<item row="7" column="2">
|
||||||
<widget class="QSpinBox" name="share_deal_reduce_trades_box">
|
<widget class="QSpinBox" name="share_deal_reduce_trades_box">
|
||||||
<property name="buttonSymbols">
|
<property name="buttonSymbols">
|
||||||
@ -180,6 +196,60 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="7" column="0" colspan="2">
|
||||||
|
<widget class="QLabel" name="share_deal_reduce_trades_lab">
|
||||||
|
<property name="text">
|
||||||
|
<string>Share dealing discount # of trades</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="8" column="3">
|
||||||
|
<widget class="QCheckBox" name="share_deal_reduce_amount_check">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="3">
|
||||||
|
<widget class="QCheckBox" name="share_deal_fee_check">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0" colspan="2">
|
||||||
|
<widget class="QLabel" name="share_plat_fee_lab">
|
||||||
|
<property name="text">
|
||||||
|
<string>Share platform fee*</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="3">
|
||||||
|
<widget class="QCheckBox" name="fund_deal_fee_check">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="3">
|
||||||
|
<widget class="QCheckBox" name="share_plat_max_fee_check">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QPushButton" name="save_but">
|
<widget class="QPushButton" name="save_but">
|
||||||
@ -221,6 +291,13 @@
|
|||||||
<tabstop>share_deal_reduce_trades_box</tabstop>
|
<tabstop>share_deal_reduce_trades_box</tabstop>
|
||||||
<tabstop>share_deal_reduce_amount_box</tabstop>
|
<tabstop>share_deal_reduce_amount_box</tabstop>
|
||||||
<tabstop>save_but</tabstop>
|
<tabstop>save_but</tabstop>
|
||||||
|
<tabstop>plat_name_check</tabstop>
|
||||||
|
<tabstop>fund_deal_fee_check</tabstop>
|
||||||
|
<tabstop>share_plat_fee_check</tabstop>
|
||||||
|
<tabstop>share_plat_max_fee_check</tabstop>
|
||||||
|
<tabstop>share_deal_fee_check</tabstop>
|
||||||
|
<tabstop>share_deal_reduce_trades_check</tabstop>
|
||||||
|
<tabstop>share_deal_reduce_amount_check</tabstop>
|
||||||
</tabstops>
|
</tabstops>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections>
|
<connections>
|
||||||
|
@ -30,6 +30,13 @@ class PlatformEdit(QWidget):
|
|||||||
if autofill:
|
if autofill:
|
||||||
self.save_but.setEnabled(True)
|
self.save_but.setEnabled(True)
|
||||||
|
|
||||||
|
self.optional_check_boxes = [
|
||||||
|
self.plat_name_check,
|
||||||
|
self.share_plat_max_fee_check,
|
||||||
|
self.share_deal_reduce_trades_check,
|
||||||
|
self.share_deal_reduce_amount_check
|
||||||
|
]
|
||||||
|
|
||||||
# Create main window object, passing this instance as param
|
# Create main window object, passing this instance as param
|
||||||
self.main_win = main_window.SIPPCompare(self)
|
self.main_win = main_window.SIPPCompare(self)
|
||||||
|
|
||||||
@ -40,6 +47,9 @@ class PlatformEdit(QWidget):
|
|||||||
self.share_plat_fee_box.valueChanged.connect(self.check_valid)
|
self.share_plat_fee_box.valueChanged.connect(self.check_valid)
|
||||||
self.share_deal_fee_box.valueChanged.connect(self.check_valid)
|
self.share_deal_fee_box.valueChanged.connect(self.check_valid)
|
||||||
|
|
||||||
|
for check_box in self.optional_check_boxes:
|
||||||
|
check_box.checkStateChanged.connect(self.check_valid)
|
||||||
|
|
||||||
# Install event filter on input boxes in order to select all text on focus
|
# Install event filter on input boxes in order to select all text on focus
|
||||||
self.fund_deal_fee_box.installEventFilter(self)
|
self.fund_deal_fee_box.installEventFilter(self)
|
||||||
self.share_plat_fee_box.installEventFilter(self)
|
self.share_plat_fee_box.installEventFilter(self)
|
||||||
@ -48,6 +58,9 @@ class PlatformEdit(QWidget):
|
|||||||
self.share_deal_reduce_trades_box.installEventFilter(self)
|
self.share_deal_reduce_trades_box.installEventFilter(self)
|
||||||
self.share_deal_reduce_amount_box.installEventFilter(self)
|
self.share_deal_reduce_amount_box.installEventFilter(self)
|
||||||
|
|
||||||
|
#for check_box in self.optional_check_boxes:
|
||||||
|
# check_box.installEventFilter(self)
|
||||||
|
|
||||||
# Set validators
|
# Set validators
|
||||||
# Regex accepts any characters that match [a-Z], [0-9] or _
|
# Regex accepts any characters that match [a-Z], [0-9] or _
|
||||||
self.plat_name_box.setValidator(
|
self.plat_name_box.setValidator(
|
||||||
@ -79,10 +92,13 @@ class PlatformEdit(QWidget):
|
|||||||
|
|
||||||
# When focus is given to an input box, select all text in it (easier to edit)
|
# When focus is given to an input box, select all text in it (easier to edit)
|
||||||
def eventFilter(self, obj: QObject, event: QEvent):
|
def eventFilter(self, obj: QObject, event: QEvent):
|
||||||
if event.type() == QEvent.Type.FocusIn:
|
if obj.staticMetaObject.className() == "QDoubleSpinBox" and event.type() == QEvent.Type.FocusIn:
|
||||||
# Alternative condition for % suffix - currently unused
|
# Alternative condition for % suffix - currently unused
|
||||||
#if obj.value() == 0 or obj == self.share_plat_fee_box:
|
#if obj.value() == 0 or obj == self.share_plat_fee_box:
|
||||||
QTimer.singleShot(0, obj.selectAll)
|
QTimer.singleShot(0, obj.selectAll)
|
||||||
|
#if obj in self.optional_check_boxes and \
|
||||||
|
#event.type() == QEvent.Type.FocusIn or event.type() == QEvent.Type.FocusOut:
|
||||||
|
# print("Working")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Check if all required fields have valid (non-zero) input
|
# Check if all required fields have valid (non-zero) input
|
||||||
|
Loading…
x
Reference in New Issue
Block a user