本文整理汇总了Python中gui.MainWindow.set_settings方法的典型用法代码示例。如果您正苦于以下问题:Python MainWindow.set_settings方法的具体用法?Python MainWindow.set_settings怎么用?Python MainWindow.set_settings使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gui.MainWindow
的用法示例。
在下文中一共展示了MainWindow.set_settings方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from gui import MainWindow [as 别名]
# 或者: from gui.MainWindow import set_settings [as 别名]
def main():
# create the GUI
app = QtWidgets.QApplication(sys.argv)
# create the event loop
event_loop = QEventLoop(app)
asyncio.set_event_loop(event_loop)
main_window = MainWindow()
# need chat_slot to be able to add to add the chat signal
chat_slot = main_window.central_widget.message_area.chat_slot
settings = get_settings_helper()
# this methods also handles passing in values to websites
plugin_manager = instantiate_plugin_manager(settings)
main_window.set_settings(settings)
chat_list = plugin_manager.get_instances()
# connect the sockets signals to the GUI
for chat in chat_list:
chat.chat_signal.connect(chat_slot)
chat.connected_signal.connect(main_window.status_bar.set_widget_status)
listener_interface = pluginmanager.PluginInterface()
listener_interface.collect_plugins(plugins)
listener_list = listener_interface.get_instances() # flake8: noqa
# main_window.central_widget.message_area.listeners = listener_list
main_window.show()
try:
event_loop.run_forever()
except KeyboardInterrupt:
pass
for chat in chat_list:
if chat.process:
chat.process.terminate()
event_loop.close()
sys.exit()