Allow user to set a base Qt window style #2251
|
@ -1,3 +1,4 @@
|
||||||
|
"""Tests for PyBitmessage settings"""
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
@ -14,8 +15,7 @@ class TestSettings(TestBase):
|
||||||
|
|
||||||
def test_udp(self):
|
def test_udp(self):
|
||||||
"""Test the effect of checkBoxUDP"""
|
"""Test the effect of checkBoxUDP"""
|
||||||
udp_setting = config.safeGetBoolean(
|
udp_setting = config.safeGetBoolean('bitmessagesettings', 'udp')
|
||||||
'bitmessagesettings', 'udp')
|
|
||||||
self.assertEqual(udp_setting, self.dialog.checkBoxUDP.isChecked())
|
self.assertEqual(udp_setting, self.dialog.checkBoxUDP.isChecked())
|
||||||
self.dialog.checkBoxUDP.setChecked(not udp_setting)
|
self.dialog.checkBoxUDP.setChecked(not udp_setting)
|
||||||
self.dialog.accept()
|
self.dialog.accept()
|
||||||
|
@ -32,3 +32,22 @@ class TestSettings(TestBase):
|
||||||
else:
|
else:
|
||||||
if not udp_setting:
|
if not udp_setting:
|
||||||
self.fail('No Announcer thread found while udp set to True')
|
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())
|
||||||
|
|
Reference in New Issue
Block a user