Allow user to set a base Qt window style #2251

Merged
PeterSurda merged 7 commits from gitea-91 into v0.6 2024-06-16 06:43:57 +02:00
Showing only changes of commit d46af0835a - Show all commits

View File

@ -1,3 +1,4 @@
"""Tests for PyBitmessage settings"""
import threading
import time
@ -14,8 +15,7 @@ class TestSettings(TestBase):
def test_udp(self):
"""Test the effect of checkBoxUDP"""
udp_setting = config.safeGetBoolean(
'bitmessagesettings', 'udp')
udp_setting = config.safeGetBoolean('bitmessagesettings', 'udp')
self.assertEqual(udp_setting, self.dialog.checkBoxUDP.isChecked())
self.dialog.checkBoxUDP.setChecked(not udp_setting)
self.dialog.accept()
@ -32,3 +32,22 @@ class TestSettings(TestBase):
else:
if not udp_setting:
self.fail('No Announcer thread found while udp set to True')
def test_styling(self):
"""Test custom windows style and font"""
style_setting = config.safeGet('bitmessagesettings', 'windowstyle')
font_setting = config.safeGet('bitmessagesettings', 'font')
self.assertIs(style_setting, None)
self.assertIs(font_setting, None)
style_control = self.dialog.comboBoxStyle
self.assertEqual(style_control.currentText(), 'GTK+')
style_count = style_control.count()
self.assertGreater(style_count, 1)
for i in range(style_count):
if i != style_control.currentIndex():
style_control.setCurrentIndex(i)
break
self.dialog.accept()
self.assertEqual(
config.safeGet('bitmessagesettings', 'windowstyle'),
style_control.currentText())