本文整理汇总了Python中TriblerGUI.tribler_request_manager.TriblerRequestManager.get_variables方法的典型用法代码示例。如果您正苦于以下问题:Python TriblerRequestManager.get_variables方法的具体用法?Python TriblerRequestManager.get_variables怎么用?Python TriblerRequestManager.get_variables使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TriblerGUI.tribler_request_manager.TriblerRequestManager
的用法示例。
在下文中一共展示了TriblerRequestManager.get_variables方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TriblerWindow
# 需要导入模块: from TriblerGUI.tribler_request_manager import TriblerRequestManager [as 别名]
# 或者: from TriblerGUI.tribler_request_manager.TriblerRequestManager import get_variables [as 别名]
class TriblerWindow(QMainWindow):
resize_event = pyqtSignal()
def __init__(self):
super(TriblerWindow, self).__init__()
self.navigation_stack = []
uic.loadUi('qt_resources/mainwindow.ui', self)
# Remove the focus rect on OS X
[widget.setAttribute(Qt.WA_MacShowFocusRect, 0) for widget in self.findChildren(QLineEdit) +
self.findChildren(QListView) + self.findChildren(QTreeWidget)]
self.subscribed_channels_list = self.findChild(QWidget, "subscribed_channels_list")
self.channel_torrents_list = self.findChild(QWidget, "channel_torrents_list")
self.top_menu_button = self.findChild(QToolButton, "top_menu_button")
self.top_search_bar = self.findChild(QLineEdit, "top_search_bar")
self.top_search_button = self.findChild(QToolButton, "top_search_button")
self.my_profile_button = self.findChild(QToolButton, "my_profile_button")
self.video_player_page = self.findChild(QWidget, "video_player_page")
self.search_results_page = self.findChild(QWidget, "search_results_page")
self.downloads_page = self.findChild(QWidget, "downloads_page")
self.settings_page = self.findChild(QWidget, "settings_page")
self.my_channel_page = self.findChild(QWidget, "my_channel_page")
self.left_menu = self.findChild(QWidget, "left_menu")
self.top_search_bar.returnPressed.connect(self.on_top_search_button_click)
self.top_search_button.clicked.connect(self.on_top_search_button_click)
self.top_menu_button.clicked.connect(self.on_top_menu_button_click)
self.search_results_list.itemClicked.connect(self.on_channel_item_click)
self.subscribed_channels_list.itemClicked.connect(self.on_channel_item_click)
self.left_menu_home_button = self.findChild(QWidget, "left_menu_home_button")
self.left_menu_home_button.clicked_menu_button.connect(self.clicked_menu_button)
self.left_menu_my_channel_button = self.findChild(QWidget, "left_menu_my_channel_button")
self.left_menu_my_channel_button.clicked_menu_button.connect(self.clicked_menu_button)
self.left_menu_subscribed_button = self.findChild(QWidget, "left_menu_subscribed_button")
self.left_menu_subscribed_button.clicked_menu_button.connect(self.clicked_menu_button)
self.left_menu_downloads_button = self.findChild(QWidget, "left_menu_downloads_button")
self.left_menu_downloads_button.clicked_menu_button.connect(self.clicked_menu_button)
self.left_menu_videoplayer_button = self.findChild(QWidget, "left_menu_videoplayer_button")
self.left_menu_videoplayer_button.clicked_menu_button.connect(self.clicked_menu_button)
self.left_menu_settings_button = self.findChild(QWidget, "left_menu_settings_button")
self.left_menu_settings_button.clicked_menu_button.connect(self.clicked_menu_button)
self.menu_buttons = [self.left_menu_home_button, self.left_menu_my_channel_button,
self.left_menu_subscribed_button, self.left_menu_videoplayer_button,
self.left_menu_settings_button, self.left_menu_downloads_button]
channel_back_button = self.findChild(QToolButton, "channel_back_button")
channel_back_button.clicked.connect(self.on_page_back_clicked)
self.channel_tab = self.findChild(QWidget, "channel_tab")
self.channel_tab.initialize()
self.channel_tab.clicked_tab_button.connect(self.on_channel_tab_button_clicked)
self.channel_stacked_widget = self.findChild(QStackedWidget, "channel_stacked_widget")
self.channel_comments_list = self.findChild(QTreeWidget, "channel_comments_list")
self.channel_activities_list = self.findChild(QListWidget, "channel_activities_list")
# TODO Martijn: for now, fill the comments and activity items on the channel details page with some dummy data
for i in range(0, 10):
parent_item = QTreeWidgetItem(self.channel_comments_list)
widget_item = ChannelCommentListItem(self.channel_comments_list, 0)
self.channel_comments_list.setItemWidget(parent_item, 0, widget_item)
child_item = QTreeWidgetItem(self.channel_comments_list)
widget_item = ChannelCommentListItem(self.channel_comments_list, 1)
self.channel_comments_list.setItemWidget(child_item, 0, widget_item)
for i in range(0, 10):
item = QListWidgetItem(self.channel_activities_list)
widget_item = ChannelActivityListItem(self.channel_activities_list)
item.setSizeHint(widget_item.sizeHint())
self.channel_activities_list.setItemWidget(item, widget_item)
# fetch the variables, needed for the video player port
self.variables_request_mgr = TriblerRequestManager()
self.variables_request_mgr.get_variables(self.received_variables)
self.event_request_manager = EventRequestManager()
self.event_request_manager.received_free_space.connect(self.received_free_space)
self.event_request_manager.received_download_status.connect(self.downloads_page.received_download_status)
self.video_player_page.initialize_player()
self.search_results_page.initialize_search_results_page()
self.settings_page.initialize_settings_page()
self.my_channel_page.initialize_my_channel_page()
self.downloads_page.initialize_downloads_page()
self.stackedWidget.setCurrentIndex(PAGE_HOME)
self.show()
def received_free_space(self, free_space):
self.statusBar.set_free_space(free_space)
def received_subscribed_channels(self, results):
#.........这里部分代码省略.........