Skip to content

Commit

Permalink
Add option to accept license globally
Browse files Browse the repository at this point in the history
  • Loading branch information
Guts committed Aug 22, 2022
1 parent 3729fb5 commit a17e338
Show file tree
Hide file tree
Showing 5 changed files with 133 additions and 105 deletions.
2 changes: 2 additions & 0 deletions qtribu/gui/dlg_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def apply(self):
settings.browser = self.opt_browser_group.checkedId()
settings.notify_push_info = self.opt_notif_push_msg.isChecked()
settings.notify_push_duration = self.sbx_notif_duration.value()
settings.license_global_accept = self.chb_license_global_accept.isChecked()

# misc
settings.debug_mode = self.opt_debug.isChecked()
Expand All @@ -117,6 +118,7 @@ def load_settings(self) -> dict:
self.opt_browser_group.button(settings.browser).setChecked(True)
self.opt_notif_push_msg.setChecked(settings.notify_push_info)
self.sbx_notif_duration.setValue(settings.notify_push_duration)
self.chb_license_global_accept.setChecked(settings.license_global_accept)

# misc
self.opt_debug.setChecked(settings.debug_mode)
Expand Down
163 changes: 85 additions & 78 deletions qtribu/gui/dlg_settings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>719</width>
<height>378</height>
<width>697</width>
<height>437</height>
</rect>
</property>
<property name="sizePolicy">
Expand Down Expand Up @@ -88,88 +88,49 @@
<string>Features</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="1">
<widget class="QRadioButton" name="opt_browser_qt">
<item row="1" column="0">
<widget class="QLabel" name="lbl_browser">
<property name="minimumSize">
<size>
<width>0</width>
<width>175</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<width>250</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>Embedded browser</string>
<property name="toolTip">
<string>Which web browser to use to display articles.</string>
</property>
<property name="checked">
<bool>true</bool>
<property name="text">
<string>Open in web browser:</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QPushButton" name="btn_reset_read_history">
<item row="3" column="0">
<widget class="QLabel" name="lbl_notification">
<property name="minimumSize">
<size>
<width>0</width>
<width>175</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<width>250</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>Reset read history</string>
<string>Notify for new content:</string>
</property>
</widget>
</item>
<item row="3" column="3">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="lbl_notif_duration">
<property name="text">
<string>Duration:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="sbx_notif_duration">
<property name="toolTip">
<string>'0' means unlimited time, waiting a manual close from the end-user.</string>
</property>
<property name="wrapping">
<bool>false</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::PlusMinus</enum>
</property>
<property name="specialValueText">
<string/>
</property>
<property name="suffix">
<string> seconds</string>
</property>
<property name="prefix">
<string/>
</property>
<property name="maximum">
<number>30</number>
</property>
<property name="value">
<number>10</number>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="3">
<widget class="QRadioButton" name="opt_browser_os">
<item row="4" column="0">
<widget class="QPushButton" name="btn_reset_read_history">
<property name="minimumSize">
<size>
<width>0</width>
Expand All @@ -183,56 +144,62 @@
</size>
</property>
<property name="text">
<string>System default browser</string>
<string>Reset read history</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lbl_browser">
<item row="3" column="1">
<widget class="QCheckBox" name="opt_notif_push_msg">
<property name="minimumSize">
<size>
<width>175</width>
<width>275</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>250</width>
<width>16777215</width>
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>Which web browser to use to display articles.</string>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="text">
<string>Open in web browser:</string>
<string>Informational push message</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="tristate">
<bool>false</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="lbl_notification">
<item row="1" column="3">
<widget class="QRadioButton" name="opt_browser_os">
<property name="minimumSize">
<size>
<width>175</width>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>250</width>
<width>16777215</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>Notify for new content:</string>
<string>System default browser</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="opt_notif_push_msg">
<item row="1" column="1">
<widget class="QRadioButton" name="opt_browser_qt">
<property name="minimumSize">
<size>
<width>275</width>
<width>0</width>
<height>25</height>
</size>
</property>
Expand All @@ -242,17 +209,57 @@
<height>30</height>
</size>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="text">
<string>Informational push message</string>
<string>Embedded browser</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="tristate">
<bool>false</bool>
</widget>
</item>
<item row="3" column="3">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="lbl_notif_duration">
<property name="text">
<string>Duration:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="sbx_notif_duration">
<property name="toolTip">
<string>'0' means unlimited time, waiting a manual close from the end-user.</string>
</property>
<property name="wrapping">
<bool>false</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::PlusMinus</enum>
</property>
<property name="specialValueText">
<string/>
</property>
<property name="suffix">
<string> seconds</string>
</property>
<property name="prefix">
<string/>
</property>
<property name="maximum">
<number>30</number>
</property>
<property name="value">
<number>10</number>
</property>
</widget>
</item>
</layout>
</item>
<item row="5" column="0" colspan="4">
<widget class="QCheckBox" name="chb_license_global_accept">
<property name="text">
<string>Accept publication license globally</string>
</property>
</widget>
</item>
Expand Down
7 changes: 7 additions & 0 deletions qtribu/gui/form_rdp_news.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ def __init__(self, parent=None):
self.btn_preview.clicked.connect(self.generate_preview)
self.txt_preview.setStyleSheet("background-color:transparent;")

# publication
self.chb_license.setChecked(
self.plg_settings.get_value_from_key(
key="license_global_accept", exp_type=bool
)
)

# connect help button
self.btn_box.helpRequested.connect(
partial(
Expand Down
Loading

0 comments on commit a17e338

Please sign in to comment.