本文整理匯總了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()