def on_create_new_channel_clicked(self, checked): def create_channel_callback(channel_name=None): TriblerNetworkRequest( "channels/mychannel/0/channels", self.on_new_channel_response, method='POST', raw_data=json.dumps({"name": channel_name}) if channel_name else None, ) NewChannelDialog(self, create_channel_callback)
def create_new_channel(self, checked): # TODO: DRY this with tablecontentmodel, possibly using QActions def create_channel_callback(channel_name): TriblerNetworkRequest( "channels/mychannel/0/channels", self.channels_menu_list.load_channels, method='POST', raw_data=json.dumps({"name": channel_name}) if channel_name else None, ) NewChannelDialog(self, create_channel_callback)
def on_create_new_folder_clicked(self, checked): selected = self.dialog_widget.channels_tree_wt.selectedItems() if not selected: return channel_id = selected[0].id_ url = ("channels/mychannel/%i" % channel_id) + ( "/channels" if channel_id == 0 else "/collections") def create_channel_callback(channel_name=None): TriblerNetworkRequest( url, self.on_new_channel_response, method='POST', raw_data=json.dumps({"name": channel_name}) if channel_name else None, ) NewChannelDialog(self, create_channel_callback)
def create_new_channel(self, checked): # pylint: disable=W0613 NewChannelDialog(self, self.model.create_new_channel)
def create_new_channel(self, checked): NewChannelDialog(self, self.model.create_new_channel)