// The Class declaration of our Http Connection system
class Fetcher : public eWindow
{
/
//else show a Messagebox with Error description.
eString sMsg = "Error " + eString().sprintf("%d", err);
eMessageBox msg(sMsg, _("User Abort"), eMessageBox::iconWarning|eMessageBox::btOK);
msg.show(); msg.exec(); msg.hide();
}
}
// internal download procedure (standard)
eHTTPDataSource * Fetcher::createDownloadSink(eHTTPConnection *conn)
{ dataSinkP = new eHTTPDownload(connectionP, (char *)tempPath.c_str());
return(dataSinkP);
}
void eBibleMainWindow::downloadDone(int err)
{
// set the flag that indicates that download is complete
if(!downloadDoneFlag)
{ downloadDoneFlag = 1;
// create a buffer to read the temp file with download data.
char buf[512];
// declare the variables we will use in this function
eString strview;
// open temporary file cotaining the downloaded data
FILE *f = fopen("/var/tmp/bdemo.sh", "rt");
if (f)
{
label->hide();
// Insert into the label the output we have stored in the variable strview
label->setText(strview);
// Show the label with the new text
label->show();
// hide the connection button
ok->hide();
// set the flag that indicates we are not in download state anymore
inDownloadFlag = 0;
}
}
eBibleMainWindow::~eBibleMainWindow()
{
// we have to do almost nothing here. all widgets are automatically removed
// since they are child of us. the eWidget-destructor will to this for us.
}
#ifndef __ewindow_h
#define __ewindow_h
#include <lib/gui/ewidget.h>
#include <lib/gui/decoration.h>
/**
* \brief A (decorated) top level widget.
*
* An eWindow is whats actually seen as a window. It's top level (thus you cannot specify a parent),
* and may have a (skinned) decoration. It's clientrect is usually a bit smaller since it has a titlebar
* and a border.
*
*/
class eWindow: public eWidget
{
eDecoration deco;
gColor fontColor, titleBarColor;
staticint globCancel;
void init_eWindow();
protected:
int borderTop, borderLeft, borderBottom, borderRight;
int titleOffsetLeft, titleOffsetRight, titleOffsetTop, titleFontSize, titleHeight;
void redrawWidget(gPainter *target, const eRect &where);
void eraseBackground(gPainter *target, const eRect &where);
void drawTitlebar(gPainter *target);
void recalcClientRect();
int eventHandler(const eWidgetEvent &event);
void willShow();
void willHide();
public:
enum { OFF, ON };
staticvoid globalCancel(int mode) { globCancel=mode; }
eRect getTitleBarRect();
/**
* \brief Constructs the window
*
* \arg takefocus the \c eWidget::eWidget takefocus parameter. You don't need to set it if just
* one widget \e inside the parent needs focus. That widget can apply for it by itself.
*/
eWindow(int takefocus=0);
/**
* destructs the window.
*/
~eWindow();
};
#endif
You know what I don't know why I'm going crazy over this, I'm done commenting until you try replacing the "code" variable in Fetcher::fetch() with "MyCode".
As far as I can see, there is no mytext that could be reachable from Fetcher (it is not a member or a parameter)
An eBibleMainWindow knows what is mytext.