Logo Search packages:      
Sourcecode: jigdo version File versions

GtkSingleUrl Class Reference

#include <gtk-single-url.hh>

Inheritance diagram for GtkSingleUrl:

JobLine Job::DataSource::IO Job::IO

List of all members.


Detailed Description

This class is two things at once:

1) Normal GtkSingleUrl mode: The frontend for a single-file download. It is a JobLine, so can be paused etc. like all JobLines. It registers as a Job::SingleUrl::IO with the Job::SingleUrl _that_it_owns_, to be notified whenever the job has something to say.

2) GtkDataSource-which-just-isnt-called-like-that, aka "child mode": The frontend for a Job::DataSource object. This object is _not_ owned by the GtkSingleUrl object. This is used if a MakeImageDl starts new child downloads.

The two modes share so much code that IMHO doing two classes would not be better.

Definition at line 43 of file gtk-single-url.hh.


Public Types

typedef void(GtkSingleUrl::* TickHandler )()

Public Member Functions

void callRegularly (TickHandler handler)
void callRegularlyLater (const int milliSec, TickHandler handler)
void childIsFinished ()
virtual void cont ()
virtual void dataSource_data (const byte *data, size_t size, uint64 currentSize)=0
 GtkSingleUrl (const string &uriStr, const string &destDesc, Job::DataSource *download)
 GtkSingleUrl (const string &uriStr, const string &destFile)
virtual Job::IOjob_removeIo (Job::IO *rmIo)
void on_closeButton_clicked ()
void on_pauseButton_clicked ()
void on_restartButton_clicked ()
void on_startButton_clicked ()
void on_stopButton_clicked ()
virtual void pause ()
virtual bool paused () const
virtual void percentDone (uint64 *cur, uint64 *total)
virtual bool run ()
virtual void selectRow ()
virtual void stop ()

Static Public Member Functions

static void create (const char *uri, const char *dest)

Static Public Attributes

static const int CHILD_FINISHED_DELAY = 10000

Protected Member Functions

void callRegularly (TickHandler handler)
void callRegularlyLater (const int milliSec, TickHandler handler)
TickHandler getHandler () const
 Return current tick handler.
JobListjobList () const
 Pointer to JobList.
bool needTicks () const
 Does this object need to be called regularly?
GtkTreeIter * row ()

Private Types

enum  State {
  CREATED, RUNNING, PAUSED, STOPPED,
  ERROR, SUCCEEDED
}

Private Member Functions

virtual void dataSource_data (const byte *data, unsigned size, uint64 currentSize)
virtual void dataSource_dataSize (uint64 n)
void deleteThis ()
void failedPermanently (string *message)
virtual void job_deleted ()
virtual void job_failed (string *message)
virtual void job_message (string *message)
virtual void job_succeeded ()
void openOutputAndResume ()
void openOutputAndRun (bool pragmaNoCache=false)
void restart ()
void resumeAsk (struct stat *fileInfo)
void showProgress ()
void startResume ()
void updateTreeView ()
void updateWindow ()

Static Private Member Functions

static void afterCloseButtonClickedResponse (GtkDialog *, int r, gpointer)
static void afterRestartButtonClickedResponse (GtkDialog *, int r, gpointer)
static void afterStartButtonClickedResponse (GtkDialog *, int r, gpointer)
static void resumeResponse (GtkDialog *, int r, gpointer data)

Private Attributes

bool childMode
string dest
SmartPtr< BfstreamCounted > destStream
Job::DataSourcejob
MessageBox::Ref messageBox
GTimeVal pauseStart
string progress
Job::SingleUrlsingleUrl
State state
string status
string treeViewStatus
string uri

Static Private Attributes

static const int RESTART_WARNING_THRESHOLD = 30

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index