ELinks 0.16.1.1
dialogs.c File Reference
#include <sys/types.h>
#include "elinks.h"
#include "dialogs/document.h"
#include "dialogs/download.h"
#include "dialogs/progress.h"
#include "intl/libintl.h"
#include "mime/mime.h"
#include "network/connection.h"
#include "network/state.h"
#include "protocol/bittorrent/bencoding.h"
#include "protocol/bittorrent/bittorrent.h"
#include "protocol/bittorrent/common.h"
#include "protocol/bittorrent/dialogs.h"
#include "protocol/bittorrent/piececache.h"
#include "protocol/uri.h"
#include "session/download.h"
#include "session/session.h"
#include "terminal/draw.h"
#include "util/conv.h"
#include "util/string.h"
Include dependency graph for dialogs.c:

Data Structures

struct  bittorrent_download_info

Macros

#define BITTORRENT_QUERY_WIDGETS_COUNT   6

Functions

static void done_bittorrent_download_info (struct bittorrent_download_info *info)
static struct bittorrent_download_infoinit_bittorrent_download_info (struct bittorrent_meta *meta)
static void add_bittorrent_meta_to_string (struct string *msg, struct bittorrent_meta *meta, struct terminal *term, int add_files)
void set_bittorrent_files_for_deletion (struct download *download)
void set_bittorrent_notify_on_completion (struct download *download, struct terminal *term)
void notify_bittorrent_download_complete (struct bittorrent_connection *bittorrent)
widget_handler_status_T dlg_show_bittorrent_info (struct dialog_data *dlg_data, struct widget_data *widget_data)
char * get_bittorrent_message (struct download *download, struct terminal *term, int wide, int full, const char *separator)
void draw_bittorrent_piece_progress (struct download *download, struct terminal *term, int x, int y, int width, char *text, struct color_pair *color)
void bittorrent_message_dialog (struct session *ses, void *data)
static void abort_bittorrent_download_query (struct dialog_data *dlg_data)
static widget_handler_status_T bittorrent_download (struct dialog_data *dlg_data, struct widget_data *widget_data)
 The download button handler.
static widget_handler_status_T tp_show_header (struct dialog_data *dlg_data, struct widget_data *widget_data)
static void bittorrent_query_callback (void *data, struct connection_state state, struct bittorrent_const_string *response)
 Build a dialog querying the user on how to handle a .torrent file.
void query_bittorrent_dialog (struct type_query *type_query)

Macro Definition Documentation

◆ BITTORRENT_QUERY_WIDGETS_COUNT

#define BITTORRENT_QUERY_WIDGETS_COUNT   6

Function Documentation

◆ abort_bittorrent_download_query()

void abort_bittorrent_download_query ( struct dialog_data * dlg_data)
static

◆ add_bittorrent_meta_to_string()

void add_bittorrent_meta_to_string ( struct string * msg,
struct bittorrent_meta * meta,
struct terminal * term,
int add_files )
static

◆ bittorrent_download()

widget_handler_status_T bittorrent_download ( struct dialog_data * dlg_data,
struct widget_data * widget_data )
static

The download button handler.

Basicly it redirects <uri> to bittorrent:<uri> and starts displaying the download.

bittorrent_query_callback() passes this function as a widget_handler_T to add_dlg_button().

◆ bittorrent_message_dialog()

void bittorrent_message_dialog ( struct session * ses,
void * data )

◆ bittorrent_query_callback()

void bittorrent_query_callback ( void * data,
struct connection_state state,
struct bittorrent_const_string * response )
static

Build a dialog querying the user on how to handle a .torrent file.

query_bittorrent_dialog() passes this function as a bittorrent_fetch_callback_T to init_bittorrent_fetch().

◆ dlg_show_bittorrent_info()

widget_handler_status_T dlg_show_bittorrent_info ( struct dialog_data * dlg_data,
struct widget_data * widget_data )

◆ done_bittorrent_download_info()

void done_bittorrent_download_info ( struct bittorrent_download_info * info)
static

◆ draw_bittorrent_piece_progress()

void draw_bittorrent_piece_progress ( struct download * download,
struct terminal * term,
int x,
int y,
int width,
char * text,
struct color_pair * color )

◆ get_bittorrent_message()

char * get_bittorrent_message ( struct download * download,
struct terminal * term,
int wide,
int full,
const char * separator )

◆ init_bittorrent_download_info()

struct bittorrent_download_info * init_bittorrent_download_info ( struct bittorrent_meta * meta)
static

◆ notify_bittorrent_download_complete()

void notify_bittorrent_download_complete ( struct bittorrent_connection * bittorrent)

◆ query_bittorrent_dialog()

void query_bittorrent_dialog ( struct type_query * type_query)

◆ set_bittorrent_files_for_deletion()

void set_bittorrent_files_for_deletion ( struct download * download)

◆ set_bittorrent_notify_on_completion()

void set_bittorrent_notify_on_completion ( struct download * download,
struct terminal * term )

◆ tp_show_header()

widget_handler_status_T tp_show_header ( struct dialog_data * dlg_data,
struct widget_data * widget_data )
related